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

Implementing the explicit heat equation solver in CUDA.

parent 7e18a52c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -66,7 +66,7 @@ class heatEquationSolver
   bool makeSnapshot( const RealType& time,
                      const IndexType& step,
                      const MeshType& mesh,
                      const DofVectorType& dofs,
                      DofVectorType& dofs,
                      DofVectorType& auxDofs );

   IndexType getDofs( const MeshType& mesh ) const;
+5 −4
Original line number Diff line number Diff line
@@ -174,11 +174,12 @@ heatEquationSolver< Mesh, DifferentialOperator, BoundaryCondition, RightHandSide
makeSnapshot( const RealType& time,
              const IndexType& step,
              const MeshType& mesh,
              const DofVectorType& dofs,
              DofVectorType& dofs,
              DofVectorType& auxiliaryDofs )
{
   cout << endl << "Writing output at time " << time << " step " << step << "." << endl;

   this->bindDofs( mesh, dofs );
   tnlString fileName;
   FileNameBaseNumberEnding( "u-", step, 5, ".tnl", fileName );
   if( ! this->solution.save( fileName ) )
@@ -223,7 +224,7 @@ getExplicitRHS( const RealType& time,
    * You may use supporting vectors again if you need.
    */

   cout << "u = " << u << endl;
   //cout << "u = " << u << endl;
   this->bindDofs( mesh, u );
   tnlExplicitUpdater< Mesh, DofVectorType, DifferentialOperator, BoundaryCondition, RightHandSide > explicitUpdater;
   explicitUpdater.template update< Mesh::Dimensions >( time,
@@ -233,8 +234,8 @@ getExplicitRHS( const RealType& time,
                                                        this->rightHandSide,
                                                        u,
                                                        fu );
   cout << "u = " << u << endl;
   cout << "fu = " << fu << endl;
   //cout << "u = " << u << endl;
   //cout << "fu = " << fu << endl;
   //_u.save( "u.tnl" );
   //_fu.save( "fu.tnl" );
   //getchar();
+1 −1
Original line number Diff line number Diff line
@@ -357,7 +357,7 @@ bool tnlSharedArray< Element, Device, Index > :: save( tnlFile& file ) const
   if( ! tnlObject :: save( file ) )
      return false;
#ifdef HAVE_NOT_CXX11
   if( ! file. write< const Index, Device >( &this -> size ) )
   if( ! file. write< const Index, tnlHost >( &this -> size ) )
#else            
   if( ! file. write( &this -> size ) )
#endif      
+0 −1
Original line number Diff line number Diff line
@@ -95,7 +95,6 @@ setupFunction( const tnlParameterContainer& parameters,
   if( Device::DeviceType == ( int ) tnlCudaDevice )
   {
      this->function = tnlCuda::passToDevice( *auxFunction );
      cout << "Copying test function to device -- this->function - " << this->function << endl;
      delete auxFunction;
      if( ! checkCudaDevice )
         return false;
+1 −1
Original line number Diff line number Diff line
@@ -115,7 +115,7 @@ template< typename Real,
          typename InteriorEntitiesProcessor >
__global__ void tnlTraversalGrid1DInteriorCells( const tnlGrid< 1, Real, tnlCuda, Index >* grid,
                                                 UserData* userData,
                                                 int gridIdx )
                                                 const Index gridIdx )
{
   typedef Real RealType;
   typedef Index IndexType;
Loading