Skip to content
Snippets Groups Projects
HamiltonJacobiProblem.h 3.9 KiB
Newer Older
/***************************************************************************
Tomáš Oberhuber's avatar
Tomáš Oberhuber committed
                          hamiltonJacobiProblem.h  -  description
                             -------------------
    begin                : Jul 8 , 2014
    copyright            : (C) 2014 by Tomas Sobotik
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

Tomáš Oberhuber's avatar
Tomáš Oberhuber committed
#pragma once
Tomáš Oberhuber's avatar
Tomáš Oberhuber committed
#include <problems/tnlPDEProblem.h>
#include <solvers/preconditioners/tnlDummyPreconditioner.h>
#include <solvers/tnlSolverMonitor.h>
#include <core/tnlLogger.h>
#include <TNL/Containers/Vector.h>
#include <solvers/pde/tnlExplicitUpdater.h>
#include <solvers/pde/tnlLinearSystemAssembler.h>
Tomáš Oberhuber's avatar
Tomáš Oberhuber committed
#include <functions/tnlMeshFunction.h>
#include <TNL/Meshes/DistributedMeshes/DistributedGridIO.h>

Tomáš Oberhuber's avatar
Tomáš Oberhuber committed
		    typename DifferentialOperator,
		    typename BoundaryCondition,
		    typename RightHandSide>
class HamiltonJacobiProblem : public tnlPDEProblem< Mesh,
Tomáš Oberhuber's avatar
Tomáš Oberhuber committed
                                                    typename DifferentialOperator::RealType,
                                                    typename Mesh::DeviceType,
                                                    typename DifferentialOperator::IndexType  >
      typedef typename DifferentialOperator::RealType RealType;
      typedef typename Mesh::DeviceType DeviceType;
      typedef typename DifferentialOperator::IndexType IndexType;
      typedef tnlMeshFunction< Mesh > MeshFunctionType;
      typedef tnlPDEProblem< Mesh, TimeDependentProblem, RealType, DeviceType, IndexType > BaseType;
      using typename BaseType::MeshType;
      using typename BaseType::DofVectorType;
      using typename BaseType::MeshDependentDataType;
      String getPrologHeader() const;
      void writeProlog( tnlLogger& logger,
                        const Config::ParameterContainer& parameters ) const;
      bool setup( const Config::ParameterContainer& parameters );
      bool setInitialCondition( const Config::ParameterContainer& parameters,
                                const MeshType& mesh,
                                DofVectorType& dofs,
                                MeshDependentDataType& meshDependentData );
      bool makeSnapshot( const RealType& time,
                         const IndexType& step,
                         const MeshType& mesh,
                         DofVectorType& dofs,
                         MeshDependentDataType& meshDependentData );
      IndexType getDofs( const MeshType& mesh ) const;
      void bindDofs( const MeshType& mesh,
                     DofVectorType& dofs );
      void getExplicitUpdate( const RealType& time,
                           const RealType& tau,
                           const MeshType& mesh,
                           DofVectorType& _u,
                           DofVectorType& _fu,
                           MeshDependentDataType& meshDependentData );

   protected:
      tnlExplicitUpdater< Mesh, MeshFunctionType, DifferentialOperator, BoundaryCondition, RightHandSide  > explicitUpdater;
      DifferentialOperator differentialOperator;
      BoundaryCondition boundaryCondition;
Tomáš Oberhuber's avatar
Tomáš Oberhuber committed
#include "HamiltonJacobiProblem_impl.h"