Loading src/problems/tnlHeatEquationProblem.h +6 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ #include <operators/diffusion/tnlLinearDiffusion.h> #include <matrices/tnlEllpackMatrix.h> #include <functions/tnlMeshFunction.h> #include <core/tnlTimer.h> template< typename Mesh, typename BoundaryCondition, Loading Loading @@ -60,6 +61,9 @@ class tnlHeatEquationProblem : public tnlPDEProblem< Mesh, void writeProlog( tnlLogger& logger, const tnlParameterContainer& parameters ) const; bool writeEpilog( tnlLogger& logger ); bool setup( const tnlParameterContainer& parameters ); bool setInitialCondition( const tnlParameterContainer& parameters, Loading Loading @@ -108,6 +112,8 @@ class tnlHeatEquationProblem : public tnlPDEProblem< Mesh, BoundaryCondition boundaryCondition; RightHandSide rightHandSide; tnlTimer gpuTransferTimer; }; #include <problems/tnlHeatEquationProblem_impl.h> Loading src/problems/tnlHeatEquationProblem_impl.h +15 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,19 @@ writeProlog( tnlLogger& logger, const tnlParameterContainer& parameters ) const { } template< typename Mesh, typename BoundaryCondition, typename RightHandSide, typename DifferentialOperator > bool tnlHeatEquationProblem< Mesh, BoundaryCondition, RightHandSide, DifferentialOperator >:: writeEpilog( tnlLogger& logger ) { logger.writeParameter< const char* >( "GPU transfer time:", "" ); this->gpuTransferTimer.writeLog( logger, 1 ); return true; } template< typename Mesh, typename BoundaryCondition, typename RightHandSide, Loading @@ -76,6 +89,7 @@ bool tnlHeatEquationProblem< Mesh, BoundaryCondition, RightHandSide, DifferentialOperator >:: setup( const tnlParameterContainer& parameters ) { this->gpuTransferTimer.reset(); if( ! this->boundaryCondition.setup( parameters, "boundary-conditions-" ) || ! this->rightHandSide.setup( parameters, "right-hand-side-" ) ) return false; Loading Loading @@ -207,6 +221,7 @@ getExplicitRHS( const RealType& time, this->bindDofs( mesh, uDofs ); MeshFunctionType fu( mesh, fuDofs ); tnlExplicitUpdater< Mesh, MeshFunctionType, DifferentialOperator, BoundaryCondition, RightHandSide > explicitUpdater; explicitUpdater.setGPUTransferTimer( this->gpuTransferTimer ); explicitUpdater.template update< typename Mesh::Cell >( time, mesh, Loading src/problems/tnlPDEProblem.h +3 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,9 @@ class tnlPDEProblem : public tnlProblem< Real, Device, Index > void writeProlog( tnlLogger& logger, const tnlParameterContainer& parameters ) const; bool writeEpilog( tnlLogger& logger ) const; bool setMeshDependentData( const MeshType& mesh, MeshDependentDataType& meshDependentData ); Loading src/problems/tnlPDEProblem_impl.h +12 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,18 @@ writeProlog( tnlLogger& logger, const tnlParameterContainer& parameters ) const { } template< typename Mesh, typename Real, typename Device, typename Index > bool tnlPDEProblem< Mesh, Real, Device, Index >:: writeEpilog( tnlLogger& logger ) const { return true; } template< typename Mesh, typename Real, typename Device, Loading src/solvers/pde/tnlExplicitUpdater.h +13 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #define TNLEXPLICITUPDATER_H_ #include <functions/tnlFunctionAdapter.h> #include <core/tnlTimer.h> template< typename Real, typename MeshFunction, Loading Loading @@ -73,6 +74,14 @@ class tnlExplicitUpdater BoundaryConditions, RightHandSide > TraverserUserData; tnlExplicitUpdater() : gpuTransferTimer( 0 ){} void setGPUTransferTimer( tnlTimer& timer ) { this->gpuTransferTimer = &timer; } template< typename EntityType > void update( const RealType& time, const MeshType& mesh, Loading Loading @@ -126,6 +135,10 @@ class tnlExplicitUpdater *userData.time ); } }; protected: tnlTimer* gpuTransferTimer; }; #include <solvers/pde/tnlExplicitUpdater_impl.h> Loading Loading
src/problems/tnlHeatEquationProblem.h +6 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ #include <operators/diffusion/tnlLinearDiffusion.h> #include <matrices/tnlEllpackMatrix.h> #include <functions/tnlMeshFunction.h> #include <core/tnlTimer.h> template< typename Mesh, typename BoundaryCondition, Loading Loading @@ -60,6 +61,9 @@ class tnlHeatEquationProblem : public tnlPDEProblem< Mesh, void writeProlog( tnlLogger& logger, const tnlParameterContainer& parameters ) const; bool writeEpilog( tnlLogger& logger ); bool setup( const tnlParameterContainer& parameters ); bool setInitialCondition( const tnlParameterContainer& parameters, Loading Loading @@ -108,6 +112,8 @@ class tnlHeatEquationProblem : public tnlPDEProblem< Mesh, BoundaryCondition boundaryCondition; RightHandSide rightHandSide; tnlTimer gpuTransferTimer; }; #include <problems/tnlHeatEquationProblem_impl.h> Loading
src/problems/tnlHeatEquationProblem_impl.h +15 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,19 @@ writeProlog( tnlLogger& logger, const tnlParameterContainer& parameters ) const { } template< typename Mesh, typename BoundaryCondition, typename RightHandSide, typename DifferentialOperator > bool tnlHeatEquationProblem< Mesh, BoundaryCondition, RightHandSide, DifferentialOperator >:: writeEpilog( tnlLogger& logger ) { logger.writeParameter< const char* >( "GPU transfer time:", "" ); this->gpuTransferTimer.writeLog( logger, 1 ); return true; } template< typename Mesh, typename BoundaryCondition, typename RightHandSide, Loading @@ -76,6 +89,7 @@ bool tnlHeatEquationProblem< Mesh, BoundaryCondition, RightHandSide, DifferentialOperator >:: setup( const tnlParameterContainer& parameters ) { this->gpuTransferTimer.reset(); if( ! this->boundaryCondition.setup( parameters, "boundary-conditions-" ) || ! this->rightHandSide.setup( parameters, "right-hand-side-" ) ) return false; Loading Loading @@ -207,6 +221,7 @@ getExplicitRHS( const RealType& time, this->bindDofs( mesh, uDofs ); MeshFunctionType fu( mesh, fuDofs ); tnlExplicitUpdater< Mesh, MeshFunctionType, DifferentialOperator, BoundaryCondition, RightHandSide > explicitUpdater; explicitUpdater.setGPUTransferTimer( this->gpuTransferTimer ); explicitUpdater.template update< typename Mesh::Cell >( time, mesh, Loading
src/problems/tnlPDEProblem.h +3 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,9 @@ class tnlPDEProblem : public tnlProblem< Real, Device, Index > void writeProlog( tnlLogger& logger, const tnlParameterContainer& parameters ) const; bool writeEpilog( tnlLogger& logger ) const; bool setMeshDependentData( const MeshType& mesh, MeshDependentDataType& meshDependentData ); Loading
src/problems/tnlPDEProblem_impl.h +12 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,18 @@ writeProlog( tnlLogger& logger, const tnlParameterContainer& parameters ) const { } template< typename Mesh, typename Real, typename Device, typename Index > bool tnlPDEProblem< Mesh, Real, Device, Index >:: writeEpilog( tnlLogger& logger ) const { return true; } template< typename Mesh, typename Real, typename Device, Loading
src/solvers/pde/tnlExplicitUpdater.h +13 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #define TNLEXPLICITUPDATER_H_ #include <functions/tnlFunctionAdapter.h> #include <core/tnlTimer.h> template< typename Real, typename MeshFunction, Loading Loading @@ -73,6 +74,14 @@ class tnlExplicitUpdater BoundaryConditions, RightHandSide > TraverserUserData; tnlExplicitUpdater() : gpuTransferTimer( 0 ){} void setGPUTransferTimer( tnlTimer& timer ) { this->gpuTransferTimer = &timer; } template< typename EntityType > void update( const RealType& time, const MeshType& mesh, Loading Loading @@ -126,6 +135,10 @@ class tnlExplicitUpdater *userData.time ); } }; protected: tnlTimer* gpuTransferTimer; }; #include <solvers/pde/tnlExplicitUpdater_impl.h> Loading