Commit 1520b3d8 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Fixing tnl-quickstart.

parent 41bf21bd
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -37,14 +37,14 @@ template< int Dimensions, typename Real, typename Device, typename Index >
/****
 * Please, chose your preferred time discretization  here.
 */
template<> struct ConfigTagTimeDiscretisation< {problemBaseName}BuildConfigTag, tnlExplicitTimeDiscretisationTag >{{ enum {{ enabled = true }}; }};
template<> struct ConfigTagTimeDiscretisation< {problemBaseName}BuildConfigTag, tnlSemiImplicitTimeDiscretisationTag >{{ enum {{ enabled = true }}; }};
template<> struct ConfigTagTimeDiscretisation< {problemBaseName}BuildConfigTag, tnlImplicitTimeDiscretisationTag >{{ enum {{ enabled = false }}; }};
template<> struct ConfigTagTimeDiscretisation< {problemBaseName}BuildConfigTag, ExplicitTimeDiscretisationTag >{{ enum {{ enabled = true }}; }};
template<> struct ConfigTagTimeDiscretisation< {problemBaseName}BuildConfigTag, SemiImplicitTimeDiscretisationTag >{{ enum {{ enabled = true }}; }};
template<> struct ConfigTagTimeDiscretisation< {problemBaseName}BuildConfigTag, ImplicitTimeDiscretisationTag >{{ enum {{ enabled = false }}; }};

/****
 * Only the Runge-Kutta-Merson solver is enabled by default.
 */
template<> struct ConfigTagExplicitSolver< {problemBaseName}BuildConfigTag, tnlExplicitEulerSolverTag >{{ enum {{ enabled = false }}; }};
template<> struct ConfigTagExplicitSolver< {problemBaseName}BuildConfigTag, ExplicitEulerSolverTag >{{ enum {{ enabled = false }}; }};

}} // namespace Solvers
}} // namespace TNL
 No newline at end of file
+2 −2
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ class {problemBaseName}Config
      static void configSetup( Config::ConfigDescription& config )
      {{
         config.addDelimiter( "{problemName} settings:" );
         config.addEntry< tnlString >( "boundary-conditions-type", "Choose the boundary conditions type.", "dirichlet");
         config.addEntry< String >( "boundary-conditions-type", "Choose the boundary conditions type.", "dirichlet");
            config.addEntryEnum< String >( "dirichlet" );
            config.addEntryEnum< String >( "neumann" );
         config.addEntry< double >( "boundary-conditions-constant", "This sets a value in case of the constant boundary conditions." );
@@ -71,7 +71,7 @@ class {problemBaseName}Setter
          String boundaryConditionsType = parameters.getParameter< String >( "boundary-conditions-type" );
          if( parameters.checkParameter( "boundary-conditions-constant" ) )
          {{
             typedef Functions::Constant< Dimensions, Real > ConstantFunction;
             typedef Functions::Analytic::Constant< Dimensions, Real > ConstantFunction;
             if( boundaryConditionsType == "dirichlet" )
             {{
                typedef Operators::DirichletBoundaryConditions< MeshType, ConstantFunction, MeshType::getMeshDimensions(), Real, Index > BoundaryConditions;
+15 −9
Original line number Diff line number Diff line
@@ -22,9 +22,12 @@ class {problemBaseName}Problem:
      typedef TNL::Problems::PDEProblem< Mesh, RealType, DeviceType, IndexType > BaseType;

      using typename BaseType::MeshType;
      using typename BaseType::MeshPointer;
      using typename BaseType::DofVectorType;
      using typename BaseType::DofVectorPointer;
      using typename BaseType::MeshDependentDataType;


      static TNL::String getTypeStatic();

      TNL::String getPrologHeader() const;
@@ -32,31 +35,34 @@ class {problemBaseName}Problem:
      void writeProlog( TNL::Logger& logger,
                        const TNL::Config::ParameterContainer& parameters ) const;

      bool setup( const TNL::Config::ParameterContainer& parameters );
      bool setup( const MeshPointer& meshPointer,
                  const TNL::Config::ParameterContainer& parameters,
                  const TNL::String& prefix );


      bool setInitialCondition( const TNL::Config::ParameterContainer& parameters,
                                const MeshType& mesh,
                                const MeshPointer& mesh,
                                DofVectorType& dofs,
                                MeshDependentDataType& meshDependentData );

      template< typename Matrix >
      bool setupLinearSystem( const MeshType& mesh,
      bool setupLinearSystem( const MeshPointer& mesh,
                              Matrix& matrix );

      bool makeSnapshot( const RealType& time,
                         const IndexType& step,
                         const MeshType& mesh,
                         const MeshPointer& mesh,
                         DofVectorType& dofs,
                         MeshDependentDataType& meshDependentData );

      IndexType getDofs( const MeshType& mesh ) const;
      IndexType getDofs( const MeshPointer& mesh ) const;

      void bindDofs( const MeshType& mesh,
                     DofVectorType& dofs );
      void bindDofs( const MeshPointer& mesh,
                     DofVectorPointer& dofs );

      void getExplicitRHS( const RealType& time,
                           const RealType& tau,
                           const MeshType& mesh,
                           const MeshPointer& mesh,
                           DofVectorType& _u,
                           DofVectorType& _fu,
                           MeshDependentDataType& meshDependentData );
@@ -64,7 +70,7 @@ class {problemBaseName}Problem:
      template< typename Matrix >
      void assemblyLinearSystem( const RealType& time,
                                 const RealType& tau,
                                 const MeshType& mesh,
                                 const MeshPointer& mesh,
                                 DofVectorType& dofs,
                                 Matrix& matrix,
                                 DofVectorType& rightHandSide,
+11 −9
Original line number Diff line number Diff line
@@ -49,7 +49,9 @@ template< typename Mesh,
          typename DifferentialOperator >
bool
{problemBaseName}Problem< Mesh, BoundaryCondition, RightHandSide, DifferentialOperator >::        
setup( const TNL::Config::ParameterContainer& parameters )
setup( const MeshPointer& meshPointer,
       const TNL::Config::ParameterContainer& parameters,
       const TNL::String& prefix )
{{
   if( ! this->boundaryCondition.setup( parameters, "boundary-conditions-" ) ||
       ! this->rightHandSide.setup( parameters, "right-hand-side-" ) )
@@ -63,7 +65,7 @@ template< typename Mesh,
          typename DifferentialOperator >
typename {problemBaseName}Problem< Mesh, BoundaryCondition, RightHandSide, DifferentialOperator >::IndexType
    {problemBaseName}Problem< Mesh, BoundaryCondition, RightHandSide, DifferentialOperator >::            
getDofs( const MeshType& mesh ) const
getDofs( const MeshPointer& mesh ) const
{{
   /****
    * Return number of  DOFs (degrees of freedom) i.e. number
@@ -78,8 +80,8 @@ template< typename Mesh,
          typename DifferentialOperator >
void
{problemBaseName}Problem< Mesh, BoundaryCondition, RightHandSide, DifferentialOperator >::            
bindDofs( const MeshType& mesh,
          DofVectorType& dofVector )    
bindDofs( const MeshPointer& mesh,
          DofVectorPointer& dofVector )    
{{
}}

@@ -90,7 +92,7 @@ template< typename Mesh,
bool
{problemBaseName}Problem< Mesh, BoundaryCondition, RightHandSide, DifferentialOperator >::            
setInitialCondition( const TNL::Config::ParameterContainer& parameters,    
                     const MeshType& mesh,
                     const MeshPointer& mesh,
                     DofVectorType& dofs,
                     MeshDependentDataType& meshDependentData )
{{
@@ -111,7 +113,7 @@ template< typename Mesh,
   template< typename Matrix >
bool
{problemBaseName}Problem< Mesh, BoundaryCondition, RightHandSide, DifferentialOperator >::                
setupLinearSystem( const MeshType& mesh,
setupLinearSystem( const MeshPointer& mesh,
                   Matrix& matrix )
{{
   const IndexType dofs = this->getDofs( mesh );
@@ -138,7 +140,7 @@ bool
{problemBaseName}Problem< Mesh, BoundaryCondition, RightHandSide, DifferentialOperator >::                    
makeSnapshot( const RealType& time,
              const IndexType& step,
              const MeshType& mesh,
              const MeshPointer& mesh,
              DofVectorType& dofs,
              MeshDependentDataType& meshDependentData )
{{
@@ -161,7 +163,7 @@ void
{problemBaseName}Problem< Mesh, BoundaryCondition, RightHandSide, DifferentialOperator >::                    
getExplicitRHS( const RealType& time,
                const RealType& tau,
                const MeshType& mesh,
                const MeshPointer& mesh,
                DofVectorType& _u,
                DofVectorType& _fu,
                MeshDependentDataType& meshDependentData )
@@ -202,7 +204,7 @@ void
{problemBaseName}Problem< Mesh, BoundaryCondition, RightHandSide, DifferentialOperator >::                
assemblyLinearSystem( const RealType& time,
                      const RealType& tau,
                      const MeshType& mesh,
                      const MeshPointer& mesh,
                      DofVectorType& _u,
                      Matrix& matrix,
                      DofVectorType& b,