Commit 2569cbbc authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Implementing the time dependent and time independent PDE solver.

parent 74b2a34b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ template< typename Mesh,
           typename DifferentialOperator >
class advectionProblem:
   public tnlPDEProblem< Mesh,
                         TimeDependentProblem,
                         typename DifferentialOperator::RealType,
                         typename Mesh::DeviceType,
                         typename DifferentialOperator::IndexType >
@@ -20,7 +21,7 @@ class advectionProblem:
      typedef typename Mesh::DeviceType DeviceType;
      typedef typename DifferentialOperator::IndexType IndexType;
      typedef tnlMeshFunction< Mesh > MeshFunctionType;
      typedef tnlPDEProblem< Mesh, RealType, DeviceType, IndexType > BaseType;
      typedef tnlPDEProblem< Mesh, TimeDependentProblem, RealType, DeviceType, IndexType > BaseType;

      using typename BaseType::MeshType;
      using typename BaseType::DofVectorType;
+34 −0
Original line number Diff line number Diff line
/* 
 * File:   tnlFastSweepingSolver.h
 * Author: oberhuber
 *
 * Created on July 12, 2016, 6:04 PM
 */

#pragma once

#include <functions/tnlConstantFunction.h>
#include <problems/tnlPDEProblem.h>

template< typename Mesh,
          typename Anisotropy = tnlConstanstFunction< Mesh > >
class tnlFastSweepingSolver  : public tnlPDEProblem< Mesh,
                                                     typename Mesh::RealType,
                                                     typename Mesh::DeviceType,
                                                     typename Mesh::IndexType  >
{
   public:

      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;
};

+39 −42
Original line number Diff line number Diff line
@@ -30,11 +30,11 @@ template< typename Mesh,
		    typename BoundaryCondition,
		    typename RightHandSide>
class HamiltonJacobiProblem : public tnlPDEProblem< Mesh,
                                                    TimeDependentProblem,
                                                    typename DifferentialOperator::RealType,
                                                    typename Mesh::DeviceType,
                                                    typename DifferentialOperator::IndexType  >
{

   public:

      typedef typename DifferentialOperator::RealType RealType;
@@ -42,7 +42,7 @@ class HamiltonJacobiProblem : public tnlPDEProblem< Mesh,
      typedef typename DifferentialOperator::IndexType IndexType;

      typedef tnlMeshFunction< Mesh > MeshFunctionType;
   typedef tnlPDEProblem< Mesh, RealType, DeviceType, IndexType > BaseType;
      typedef tnlPDEProblem< Mesh, TimeDependentProblem, RealType, DeviceType, IndexType > BaseType;

      using typename BaseType::MeshType;
      using typename BaseType::DofVectorType;
@@ -91,9 +91,6 @@ class HamiltonJacobiProblem : public tnlPDEProblem< Mesh,
      BoundaryCondition boundaryCondition;

      RightHandSide rightHandSide;

   //bool schemeTest;
   //bool tested;
};

#include "HamiltonJacobiProblem_impl.h"
+1 −3
Original line number Diff line number Diff line
@@ -27,11 +27,9 @@ class HamiltonJacobiProblemConfig
      {
         config.addDelimiter( "Hamilton-Jacobi solver settings:" );
         config.addEntry        < tnlString > ( "problem-name", "This defines particular problem.", "hamilton-jacobi" );
         config.addEntry       < tnlString > ( "scheme", "This defines scheme used for discretization.", "upwind" );
         config.addEntry       < tnlString > ( "scheme", "This defines scheme used for discretization.", "godunov" );
         config.addEntryEnum( "godunov" );
         config.addEntryEnum( "upwind" );
         config.addEntryEnum( "godunov2" );
         config.addEntryEnum( "upwind2" );
         config.addEntry        < double > ( "epsilon", "This defines epsilon for smoothening of sign().", 3.0 );
         config.addEntry        < double > ( "-value", "Constant value of RHS.", 0.0 );
      }
+7 −28
Original line number Diff line number Diff line
@@ -20,12 +20,8 @@
#include <functions/tnlConstantFunction.h>
#include <operators/tnlNeumannBoundaryConditions.h>
#include <operators/tnlDirichletBoundaryConditions.h>
#include <operators/hamilton-jacobi/upwind-eikonal/upwindEikonal.h>
//#include <operators/hamilton-jacobi/godunov-eikonal/godunovEikonal.h>
//#include <operators/hamilton-jacobi/upwind/upwind.h>
//#include <operators/hamilton-jacobi/godunov/godunov.h>
//#include <functions/tnlSDFSign.h>
//#include <functions/tnlSDFGridValue.h>
#include <operators/hamilton-jacobi/upwindEikonal.h>
#include <operators/hamilton-jacobi/godunovEikonal.h>
#include <operators/hamilton-jacobi/tnlEikonalOperator.h>


@@ -62,31 +58,14 @@ bool HamiltonJacobiProblemSetter< RealType, DeviceType, IndexType, MeshType, Con
           typedef HamiltonJacobiProblem< MeshType, Operator, BoundaryConditions, RightHandSide > Solver;
           return solverStarter.template run< Solver >( parameters );
      }
      /*else if ( schemeName == "godunov")
      if( schemeName == "godunov" )
      {
         typedef godunovEikonalScheme< MeshType, RealType, IndexType > Operator;
           typedef godunovEikonalScheme< MeshType, RealType, IndexType > GradientNormOperator;
           typedef tnlConstantFunction< Dimensions, RealType > RightHandSide;
           typedef tnlEikonalOperator< GradientNormOperator, RightHandSide > Operator;
           typedef HamiltonJacobiProblem< MeshType, Operator, BoundaryConditions, RightHandSide > Solver;
           return solverStarter.template run< Solver >( parameters );
      }      
      else if( schemeName == "upwind2" )
      {
           typedef tnlSDFSign< MeshType, Dimensions, RealType, tnlSDFGridValue<MeshType, Dimensions, RealType>, 1 > Sign;
           typedef tnlSDFSign< MeshType, Dimensions, RealType, tnlSDFGridValue<MeshType, Dimensions, RealType>, 1 > RightHandSide;
           typedef upwindScheme< MeshType, RealType, IndexType, Sign > Operator;
           typedef HamiltonJacobiProblem< MeshType, Operator, BoundaryConditions, RightHandSide > Solver;
           return solverStarter.template run< Solver >( parameters );
      }
      else if ( schemeName == "godunov2")
      {
           typedef tnlSDFSign< MeshType, Dimensions, RealType, tnlSDFGridValue<MeshType, Dimensions, RealType>, 1 > Sign;
           typedef tnlSDFSign< MeshType, Dimensions, RealType, tnlSDFGridValue<MeshType, Dimensions, RealType>, 1 > RightHandSide;
         typedef godunovScheme< MeshType, RealType, IndexType, Sign > Operator;
         typedef HamiltonJacobiProblem< MeshType, Operator, BoundaryConditions, RightHandSide > Solver;
         return solverStarter.template run< Solver >( parameters );
      }*/


      else
         cerr << "Unknown scheme '" << schemeName << "'." << endl;

Loading