Commit 12f695ef authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Refactoring problems.

parent d1c9a774
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
#ifndef advectionPROBLEM_H_
#define advectionPROBLEM_H_

#include <TNL/problems/tnlPDEProblem.h>
#include <TNL/Problems/PDEProblem.h>
#include <TNL/Functions/MeshFunction.h>
#include <TNL/tnlSharedPointer.h>

using namespace TNL::Problems;

namespace TNL {

template< typename Mesh,
@@ -12,7 +14,7 @@ template< typename Mesh,
          typename RightHandSide,
           typename DifferentialOperator >
class advectionProblem:
   public tnlPDEProblem< Mesh,
   public PDEProblem< Mesh,
                         typename DifferentialOperator::RealType,
                         typename Mesh::DeviceType,
                         typename DifferentialOperator::IndexType >
@@ -23,7 +25,7 @@ class advectionProblem:
      typedef typename Mesh::DeviceType DeviceType;
      typedef typename DifferentialOperator::IndexType IndexType;
      typedef Functions::MeshFunction< Mesh > MeshFunctionType;
      typedef tnlPDEProblem< Mesh, RealType, DeviceType, IndexType > BaseType;
      typedef PDEProblem< Mesh, RealType, DeviceType, IndexType > BaseType;
      typedef tnlSharedPointer< MeshFunctionType, DeviceType > MeshFunctionPointer;
      typedef tnlSharedPointer< DifferentialOperator > DifferentialOperatorPointer;
      typedef tnlSharedPointer< BoundaryCondition > BoundaryConditionPointer;
+5 −4
Original line number Diff line number Diff line
@@ -17,11 +17,12 @@
#include <TNL/Functions/TestFunction.h>
#include <TNL/operators/diffusion/tnlLinearDiffusion.h>
#include <TNL/operators/diffusion/tnlExactLinearDiffusion.h>
#include <TNL/problems/tnlHeatEquationEocRhs.h>
#include <TNL/problems/tnlHeatEquationEocProblem.h>
#include <TNL/Problems/HeatEquationEocRhs.h>
#include <TNL/Problems/HeatEquationEocProblem.h>
#include <TNL/operators/tnlDirichletBoundaryConditions.h>

using namespace TNL;
using namespace TNL::Problems;

//typedef tnlDefaultBuildMeshConfig BuildConfig;
typedef Solvers::tnlFastBuildConfig BuildConfig;
@@ -60,10 +61,10 @@ class heatEquationSetter
      typedef tnlLinearDiffusion< MeshType, Real, Index > ApproximateOperator;
      typedef tnlExactLinearDiffusion< Dimensions > ExactOperator;
      typedef Functions::TestFunction< MeshType::meshDimensions, Real, Device > TestFunction;
      typedef tnlHeatEquationEocRhs< ExactOperator, TestFunction > RightHandSide;
      typedef HeatEquationEocRhs< ExactOperator, TestFunction > RightHandSide;
      typedef Vectors::StaticVector < MeshType::meshDimensions, Real > Vertex;
      typedef tnlDirichletBoundaryConditions< MeshType, TestFunction, Dimensions, Real, Index > BoundaryConditions;
      typedef tnlHeatEquationEocProblem< MeshType, BoundaryConditions, RightHandSide, ApproximateOperator > Solver;
      typedef HeatEquationEocProblem< MeshType, BoundaryConditions, RightHandSide, ApproximateOperator > Solver;
      SolverStarter solverStarter;
      return solverStarter.template run< Solver >( parameters );
   };
+6 −5
Original line number Diff line number Diff line
@@ -19,10 +19,11 @@
#include <TNL/operators/tnlNeumannBoundaryConditions.h>
#include <TNL/Functions/Analytic/ConstantFunction.h>
#include <TNL/Functions/MeshFunction.h>
#include <TNL/problems/tnlHeatEquationProblem.h>
#include <TNL/Problems/HeatEquationProblem.h>
#include <TNL/mesh/tnlGrid.h>

using namespace TNL;
using namespace TNL::Problems;

//typedef tnlDefaultBuildMeshConfig BuildConfig;
typedef Solvers::tnlFastBuildConfig BuildConfig;
@@ -79,12 +80,12 @@ class heatEquationSetter
         if( boundaryConditionsType == "dirichlet" )
         {
            typedef tnlDirichletBoundaryConditions< MeshType, ConstantFunction > BoundaryConditions;
            typedef tnlHeatEquationProblem< MeshType, BoundaryConditions, RightHandSide, ApproximateOperator > Problem;
            typedef HeatEquationProblem< MeshType, BoundaryConditions, RightHandSide, ApproximateOperator > Problem;
            SolverStarter solverStarter;
            return solverStarter.template run< Problem >( parameters );
         }
         typedef tnlNeumannBoundaryConditions< MeshType, ConstantFunction, Real, Index > BoundaryConditions;
         typedef tnlHeatEquationProblem< MeshType, BoundaryConditions, RightHandSide, ApproximateOperator > Problem;
         typedef HeatEquationProblem< MeshType, BoundaryConditions, RightHandSide, ApproximateOperator > Problem;
         SolverStarter solverStarter;
         return solverStarter.template run< Problem >( parameters );
      }
@@ -92,12 +93,12 @@ class heatEquationSetter
      if( boundaryConditionsType == "dirichlet" )
      {
         typedef tnlDirichletBoundaryConditions< MeshType, MeshFunction > BoundaryConditions;
         typedef tnlHeatEquationProblem< MeshType, BoundaryConditions, RightHandSide, ApproximateOperator > Problem;
         typedef HeatEquationProblem< MeshType, BoundaryConditions, RightHandSide, ApproximateOperator > Problem;
         SolverStarter solverStarter;
         return solverStarter.template run< Problem >( parameters );
      }
      typedef tnlNeumannBoundaryConditions< MeshType, MeshFunction, Real, Index > BoundaryConditions;
      typedef tnlHeatEquationProblem< MeshType, BoundaryConditions, RightHandSide, ApproximateOperator > Problem;
      typedef HeatEquationProblem< MeshType, BoundaryConditions, RightHandSide, ApproximateOperator > Problem;
      SolverStarter solverStarter;
      return solverStarter.template run< Problem >( parameters );
   };
+4 −3
Original line number Diff line number Diff line
#ifndef eulerPROBLEM_H_
#define eulerPROBLEM_H_

#include <TNL/problems/tnlPDEProblem.h>
#include <TNL/Problems/PDEProblem.h>
#include <TNL/Functions/MeshFunction.h>

using namespace TNL::Problems;
namespace TNL {

template< typename Mesh,
@@ -11,7 +12,7 @@ template< typename Mesh,
          typename RightHandSide,
           typename DifferentialOperator >
class eulerProblem:
   public tnlPDEProblem< Mesh,
   public PDEProblem< Mesh,
                         typename DifferentialOperator::RealType,
                         typename Mesh::DeviceType,
                         typename DifferentialOperator::IndexType >
@@ -26,7 +27,7 @@ class eulerProblem:
      typedef tnlSharedPointer< DifferentialOperator > DifferentialOperatorPointer;
      typedef tnlSharedPointer< BoundaryCondition > BoundaryConditionPointer;
      typedef tnlSharedPointer< RightHandSide, DeviceType > RightHandSidePointer;
      typedef tnlPDEProblem< Mesh, RealType, DeviceType, IndexType > BaseType;      
      typedef PDEProblem< Mesh, RealType, DeviceType, IndexType > BaseType;      
      
      using typename BaseType::MeshType;
      using typename BaseType::MeshPointer;
+5 −3
Original line number Diff line number Diff line
#pragma once

#include <TNL/problems/tnlPDEProblem.h>
#include <TNL/Problems/PDEProblem.h>
#include <TNL/Functions/MeshFunction.h>

using namespace TNL::Problems;

namespace TNL {

template< typename Mesh,
@@ -10,7 +12,7 @@ template< typename Mesh,
          typename RightHandSide,
           typename DifferentialOperator >
class eulerProblem:
   public tnlPDEProblem< Mesh,
   public PDEProblem< Mesh,
                         typename DifferentialOperator::RealType,
                         typename Mesh::DeviceType,
                         typename DifferentialOperator::IndexType >
@@ -25,7 +27,7 @@ class eulerProblem:
      typedef tnlSharedPointer< DifferentialOperator > DifferentialOperatorPointer;
      typedef tnlSharedPointer< BoundaryCondition > BoundaryConditionPointer;
      typedef tnlSharedPointer< RightHandSide, DeviceType > RightHandSidePointer;
      typedef tnlPDEProblem< Mesh, RealType, DeviceType, IndexType > BaseType;      
      typedef PDEProblem< Mesh, RealType, DeviceType, IndexType > BaseType;      
      
      using typename BaseType::MeshType;
      using typename BaseType::MeshPointer;
Loading