Loading src/TNL/Problems/HeatEquationProblem_impl.h +3 −3 Original line number Diff line number Diff line Loading @@ -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"); Loading src/TNL/Solvers/PDE/BoundaryConditionsSetter.h +6 −2 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ #include <TNL/Devices/Cuda.h> #include <TNL/Functions/FunctionAdapter.h> #include <TNL/SharedPointer.h> namespace TNL { namespace Solvers { Loading Loading @@ -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 { Loading src/TNL/Solvers/PDE/BoundaryConditionsSetter_impl.h +9 −7 Original line number Diff line number Diff line Loading @@ -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 ); Loading @@ -51,7 +53,7 @@ apply( const BoundaryConditions& boundaryConditions, Devices::Cuda::freeFromDevice( kernelBoundaryConditions ); Devices::Cuda::freeFromDevice( kernelU ); checkCudaDevice; } }*/ } } // namespace PDE Loading src/Tools/tnl-quickstart/operator-grid-specialization.h.in +8 −8 Original line number Diff line number Diff line Loading @@ -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, Loading src/Tools/tnl-quickstart/operator-grid-specialization_impl.h.in +8 −8 Original line number Diff line number Diff line Loading @@ -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 Loading
src/TNL/Problems/HeatEquationProblem_impl.h +3 −3 Original line number Diff line number Diff line Loading @@ -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"); Loading
src/TNL/Solvers/PDE/BoundaryConditionsSetter.h +6 −2 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ #include <TNL/Devices/Cuda.h> #include <TNL/Functions/FunctionAdapter.h> #include <TNL/SharedPointer.h> namespace TNL { namespace Solvers { Loading Loading @@ -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 { Loading
src/TNL/Solvers/PDE/BoundaryConditionsSetter_impl.h +9 −7 Original line number Diff line number Diff line Loading @@ -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 ); Loading @@ -51,7 +53,7 @@ apply( const BoundaryConditions& boundaryConditions, Devices::Cuda::freeFromDevice( kernelBoundaryConditions ); Devices::Cuda::freeFromDevice( kernelU ); checkCudaDevice; } }*/ } } // namespace PDE Loading
src/Tools/tnl-quickstart/operator-grid-specialization.h.in +8 −8 Original line number Diff line number Diff line Loading @@ -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, Loading
src/Tools/tnl-quickstart/operator-grid-specialization_impl.h.in +8 −8 Original line number Diff line number Diff line Loading @@ -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