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

Fixing tnl-quickstart.

parent 50191569
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -87,7 +87,7 @@ class PDESolver : public Object

      DofVectorPointer dofsPointer;

      MeshDependentDataPointer meshDependentData;
      MeshDependentDataPointer meshDependentDataPointer;

      TimeStepper* timeStepper;

+6 −6
Original line number Diff line number Diff line
@@ -95,15 +95,15 @@ setup( const Config::ParameterContainer& parameters,
   /****
    * Set mesh dependent data
    */
   this->problem->setMeshDependentData( this->meshPointer, this->meshDependentData );
   this->problem->bindMeshDependentData( this->meshPointer, this->meshDependentData );
   this->problem->setMeshDependentData( this->meshPointer, this->meshDependentDataPointer );
   this->problem->bindMeshDependentData( this->meshPointer, this->meshDependentDataPointer );
   
   /***
    * Set-up the initial condition
    */
  std::cout << "Setting up the initial condition ... ";
   typedef typename Problem :: DofVectorType DofVectorType;
   if( ! this->problem->setInitialCondition( parameters, meshPointer, this->dofsPointer, this->meshDependentData ) )
   if( ! this->problem->setInitialCondition( parameters, meshPointer, this->dofsPointer, this->meshDependentDataPointer ) )
      return false;
  std::cout << " [ OK ]" << std::endl;

@@ -337,7 +337,7 @@ solve()
   this->computeTimer->reset();
 
   this->ioTimer->start();
   if( ! this->problem->makeSnapshot( t, step, meshPointer, this->dofsPointer, this->meshDependentData ) )
   if( ! this->problem->makeSnapshot( t, step, meshPointer, this->dofsPointer, this->meshDependentDataPointer ) )
   {
      std::cerr << "Making the snapshot failed." << std::endl;
      return false;
@@ -355,14 +355,14 @@ solve()
   {
      RealType tau = min( this->snapshotPeriod,
                          this->finalTime - t );
      if( ! this->timeStepper->solve( t, t + tau, this->meshPointer, this->dofsPointer, this->meshDependentData ) )
      if( ! this->timeStepper->solve( t, t + tau, this->meshPointer, this->dofsPointer, this->meshDependentDataPointer ) )
         return false;
      step ++;
      t += tau;

      this->ioTimer->start();
      this->computeTimer->stop();
      if( ! this->problem->makeSnapshot( t, step, this->meshPointer, this->dofsPointer, this->meshDependentData ) )
      if( ! this->problem->makeSnapshot( t, step, this->meshPointer, this->dofsPointer, this->meshDependentDataPointer ) )
      {
         std::cerr << "Making the snapshot failed." << std::endl;
         return false;
+5 −4
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ class {problemBaseName}Problem:
      using typename BaseType::DofVectorType;
      using typename BaseType::DofVectorPointer;
      using typename BaseType::MeshDependentDataType;
      using typename BaseType::MeshDependentDataPointer;


      static TNL::String getTypeStatic();
@@ -46,7 +47,7 @@ class {problemBaseName}Problem:
      bool setInitialCondition( const TNL::Config::ParameterContainer& parameters,
                                const MeshPointer& mesh,
                                DofVectorPointer& dofs,
                                MeshDependentDataType& meshDependentData );
                                MeshDependentDataPointer& meshDependentData );

      template< typename MatrixPointer >
      bool setupLinearSystem( const MeshPointer& mesh,
@@ -56,7 +57,7 @@ class {problemBaseName}Problem:
                         const IndexType& step,
                         const MeshPointer& mesh,
                         DofVectorPointer& dofs,
                         MeshDependentDataType& meshDependentData );
                         MeshDependentDataPointer& meshDependentData );

      IndexType getDofs( const MeshPointer& mesh ) const;

@@ -68,7 +69,7 @@ class {problemBaseName}Problem:
                           const MeshPointer& mesh,
                           DofVectorPointer& _u,
                           DofVectorPointer& _fu,
                           MeshDependentDataType& meshDependentData );
                           MeshDependentDataPointer& meshDependentData );

      template< typename MatrixPointer >
      void assemblyLinearSystem( const RealType& time,
@@ -77,7 +78,7 @@ class {problemBaseName}Problem:
                                 DofVectorPointer& dofs,
                                 MatrixPointer& matrixPointer,
                                 DofVectorPointer& rightHandSide,
                                 MeshDependentDataType& meshDependentData );
                                 MeshDependentDataPointer& meshDependentData );

   protected:
    
+5 −5
Original line number Diff line number Diff line
@@ -94,7 +94,7 @@ bool
setInitialCondition( const TNL::Config::ParameterContainer& parameters,    
                     const MeshPointer& mesh,
                     DofVectorPointer& dofs,
                     MeshDependentDataType& meshDependentData )
                     MeshDependentDataPointer& meshDependentData )
{{
   const TNL::String& initialConditionFile = parameters.getParameter< TNL::String >( "initial-condition" );
   TNL::Functions::MeshFunction< Mesh > u( mesh, dofs );
@@ -142,7 +142,7 @@ makeSnapshot( const RealType& time,
              const IndexType& step,
              const MeshPointer& mesh,
              DofVectorPointer& dofs,
              MeshDependentDataType& meshDependentData )
              MeshDependentDataPointer& meshDependentData )
{{
   std::cout << std::endl << "Writing output at time " << time << " step " << step << "." << std::endl;
   this->bindDofs( mesh, dofs );
@@ -166,10 +166,10 @@ getExplicitRHS( const RealType& time,
                const MeshPointer& mesh,
                DofVectorPointer& _u,
                DofVectorPointer& _fu,
                MeshDependentDataType& meshDependentData )
                MeshDependentDataPointer& meshDependentData )
{{
   /****
    * If you use an explicit solver like tnlEulerSolver or tnlMersonSolver, you
    * If you use an explicit solver like EulerSolver or MersonSolver, you
    * need to implement this method. Compute the right-hand side of
    *
    *   d/dt u(x) = fu( x, u )
@@ -208,7 +208,7 @@ assemblyLinearSystem( const RealType& time,
                      DofVectorPointer& _u,
                      MatrixPointer& matrixPointer,
                      DofVectorPointer& b,
                      MeshDependentDataType& meshDependentData )
                      MeshDependentDataPointer& meshDependentData )
{{
   TNL::Solvers::PDE::LinearSystemAssembler< Mesh,
                             MeshFunctionType,