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

Fixing tnl-quickstart.

parent 6d78d9f9
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -227,11 +227,11 @@ getExplicitRHS( const RealType& time,
      this->rightHandSidePointer,
      this->uPointer,
      fuPointer );
   /*BoundaryConditionsSetter< MeshFunctionType, BoundaryCondition > boundaryConditionsSetter;
   Solvers::PDE::BoundaryConditionsSetter< MeshFunctionType, BoundaryCondition > boundaryConditionsSetter;
   boundaryConditionsSetter.template apply< typename Mesh::Cell >(
      this->boundaryCondition,
      this->boundaryConditionPointer,
      time + tau,
      this->u );*/
      this->uPointer );
   
   //fu.write( "fu.txt", "gnuplot" );
   //this->u.write( "u.txt", "gnuplot");
+6 −2
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@

#include <TNL/Devices/Cuda.h>
#include <TNL/Functions/FunctionAdapter.h>
#include <TNL/SharedPointer.h>

namespace TNL {
namespace Solvers {
@@ -55,11 +56,14 @@ class BoundaryConditionsSetter
         RealType,
         MeshFunction,
         BoundaryConditions > TraverserUserData;
      typedef SharedPointer< MeshType, DeviceType > MeshPointer;
      typedef SharedPointer< BoundaryConditions, DeviceType > BoundaryConditionsPointer;
      typedef SharedPointer< MeshFunction, DeviceType > MeshFunctionPointer;

      template< typename EntityType = typename MeshType::Cell >
      static void apply( const BoundaryConditions& boundaryConditions,
      static void apply( const BoundaryConditionsPointer& boundaryConditions,
                         const RealType& time,
                         MeshFunction& u );
                         MeshFunctionPointer& u );
 
      class TraverserBoundaryEntitiesProcessor
      {
+9 −7
Original line number Diff line number Diff line
@@ -22,20 +22,22 @@ template< typename MeshFunction,
   template< typename EntityType >
void
BoundaryConditionsSetter< MeshFunction, BoundaryConditions >::
apply( const BoundaryConditions& boundaryConditions,
apply( const BoundaryConditionsPointer& boundaryConditions,
       const RealType& time,
       MeshFunction& u )
       MeshFunctionPointer& u )
{
   if( std::is_same< DeviceType, Devices::Host >::value )
   //if( std::is_same< DeviceType, Devices::Host >::value )
   {
      TraverserUserData userData( time, boundaryConditions, u );
      TraverserUserData userData( time,
                                  boundaryConditions.template getData< DeviceType >(),
                                  u.template modifyData< DeviceType >() );
      Meshes::Traverser< MeshType, EntityType > meshTraverser;
      meshTraverser.template processBoundaryEntities< TraverserUserData,
                                                      TraverserBoundaryEntitiesProcessor >
                                                    ( u.getMeshPointer(),
                                                    ( u->getMeshPointer(),
                                                      userData );
   }
   if( std::is_same< DeviceType, Devices::Cuda >::value )
   /*if( std::is_same< DeviceType, Devices::Cuda >::value )
   {
      RealType* kernelTime = Devices::Cuda::passToDevice( time );
      BoundaryConditions* kernelBoundaryConditions = Devices::Cuda::passToDevice( boundaryConditions );
@@ -51,7 +53,7 @@ apply( const BoundaryConditions& boundaryConditions,
      Devices::Cuda::freeFromDevice( kernelBoundaryConditions );
      Devices::Cuda::freeFromDevice( kernelU );
      checkCudaDevice;
   }
   }*/
}

} // namespace PDE
+8 −8
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ class {operatorName}< TNL::Meshes::Grid< {meshDimensions}, MeshReal, Device, Mes

      template< typename MeshEntity, typename Vector, typename MatrixRow >
      __cuda_callable__
      void updateLinearSystem( const RealType& time,
      void setMatrixElements( const RealType& time,
                              const RealType& tau,
                              const MeshType& mesh,
                              const IndexType& index,
+8 −8
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ template< typename MeshReal,
__cuda_callable__        
void
{operatorName}< TNL::Meshes::Grid< {meshDimensions}, MeshReal, Device, MeshIndex >, Real, Index >::
updateLinearSystem( const RealType& time,
setMatrixElements( const RealType& time,
                   const RealType& tau,
                   const MeshType& mesh,
                   const IndexType& index,
Loading