Loading src/functions/tnlMeshFunction.h +2 −2 Original line number Diff line number Diff line Loading @@ -75,9 +75,9 @@ class tnlMeshFunction : const MeshType& getMesh() const; const VectorType& getData() const; __cuda_callable__ const VectorType& getData() const; VectorType& getData(); __cuda_callable__ VectorType& getData(); bool refresh( const RealType& time = 0.0 ) const; Loading src/functions/tnlMeshFunction_impl.h +2 −0 Original line number Diff line number Diff line Loading @@ -177,6 +177,7 @@ getMesh() const template< typename Mesh, int MeshEntityDimensions, typename Real > __cuda_callable__ const typename tnlMeshFunction< Mesh, MeshEntityDimensions, Real >::VectorType& tnlMeshFunction< Mesh, MeshEntityDimensions, Real >:: getData() const Loading @@ -187,6 +188,7 @@ getData() const template< typename Mesh, int MeshEntityDimensions, typename Real > __cuda_callable__ typename tnlMeshFunction< Mesh, MeshEntityDimensions, Real >::VectorType& tnlMeshFunction< Mesh, MeshEntityDimensions, Real >:: getData() Loading src/solvers/ode/tnlEulerSolver_impl.h +1 −1 Original line number Diff line number Diff line Loading @@ -138,7 +138,7 @@ bool tnlEulerSolver< Problem > :: solve( DofVectorType& u ) time += currentTau; if( ! this->nextIteration() ) return false; return this->checkConvergence(); /**** * Compute the new time step. Loading tests/benchmarks/heat-equation-benchmark/BenchmarkLaplace_impl.h +11 −6 Original line number Diff line number Diff line Loading @@ -141,7 +141,7 @@ operator()( const MeshFunction& u, * The following example is the Laplace operator approximated * by the Finite difference method. */ static_assert( MeshEntity::entityDimensions == 2, "Wrong mesh entity dimensions." ); /*static_assert( MeshEntity::entityDimensions == 2, "Wrong mesh entity dimensions." ); static_assert( MeshFunction::getEntitiesDimensions() == 2, "Wrong preimage function" ); const typename MeshEntity::template NeighbourEntities< 2 >& neighbourEntities = entity.getNeighbourEntities(); Loading @@ -151,9 +151,14 @@ operator()( const MeshFunction& u, const IndexType& east = neighbourEntities.template getEntityIndex< 1, 0 >(); const IndexType& west = neighbourEntities.template getEntityIndex< -1, 0 >(); const IndexType& north = neighbourEntities.template getEntityIndex< 0, 1 >(); const IndexType& south = neighbourEntities.template getEntityIndex< 0, -1 >(); return ( u[ west ] - 2.0 * u[ center ] + u[ east ] ) * hxSquareInverse + ( u[ south ] - 2.0 * u[ center ] + u[ north ] ) * hySquareInverse; const IndexType& south = neighbourEntities.template getEntityIndex< 0, -1 >(); */ /*const IndexType& xSize = entity.getMesh().getDimensions().x(); const IndexType& c = entity.getIndex(); const RealType& hxSquareInverse = entity.getMesh().template getSpaceStepsProducts< -2, 0 >(); const RealType& hySquareInverse = entity.getMesh().template getSpaceStepsProducts< 0, -2 >(); return ( u[ c - 1 ] - 2.0 * u[ c ] + u[ c + 1 ] ) * hxSquareInverse + ( u[ c - xSize ] - 2.0 * u[ c ] + u[ c + xSize ] ) * hySquareInverse;*/ } template< typename MeshReal, Loading tests/benchmarks/heat-equation-benchmark/HeatEquationBenchmarkProblem.h +12 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,8 @@ class HeatEquationBenchmarkProblem: using typename BaseType::DofVectorType; using typename BaseType::MeshDependentDataType; HeatEquationBenchmarkProblem(); static tnlString getTypeStatic(); tnlString getPrologHeader() const; Loading Loading @@ -71,11 +73,21 @@ class HeatEquationBenchmarkProblem: DofVectorType& rightHandSide, MeshDependentDataType& meshDependentData ); ~HeatEquationBenchmarkProblem(); protected: DifferentialOperator differentialOperator; BoundaryCondition boundaryCondition; RightHandSide rightHandSide; tnlString cudaKernelType; MeshType* cudaMesh; BoundaryCondition* cudaBoundaryConditions; RightHandSide* cudaRightHandSide; DifferentialOperator* cudaDifferentialOperator; }; #include "HeatEquationBenchmarkProblem_impl.h" Loading Loading
src/functions/tnlMeshFunction.h +2 −2 Original line number Diff line number Diff line Loading @@ -75,9 +75,9 @@ class tnlMeshFunction : const MeshType& getMesh() const; const VectorType& getData() const; __cuda_callable__ const VectorType& getData() const; VectorType& getData(); __cuda_callable__ VectorType& getData(); bool refresh( const RealType& time = 0.0 ) const; Loading
src/functions/tnlMeshFunction_impl.h +2 −0 Original line number Diff line number Diff line Loading @@ -177,6 +177,7 @@ getMesh() const template< typename Mesh, int MeshEntityDimensions, typename Real > __cuda_callable__ const typename tnlMeshFunction< Mesh, MeshEntityDimensions, Real >::VectorType& tnlMeshFunction< Mesh, MeshEntityDimensions, Real >:: getData() const Loading @@ -187,6 +188,7 @@ getData() const template< typename Mesh, int MeshEntityDimensions, typename Real > __cuda_callable__ typename tnlMeshFunction< Mesh, MeshEntityDimensions, Real >::VectorType& tnlMeshFunction< Mesh, MeshEntityDimensions, Real >:: getData() Loading
src/solvers/ode/tnlEulerSolver_impl.h +1 −1 Original line number Diff line number Diff line Loading @@ -138,7 +138,7 @@ bool tnlEulerSolver< Problem > :: solve( DofVectorType& u ) time += currentTau; if( ! this->nextIteration() ) return false; return this->checkConvergence(); /**** * Compute the new time step. Loading
tests/benchmarks/heat-equation-benchmark/BenchmarkLaplace_impl.h +11 −6 Original line number Diff line number Diff line Loading @@ -141,7 +141,7 @@ operator()( const MeshFunction& u, * The following example is the Laplace operator approximated * by the Finite difference method. */ static_assert( MeshEntity::entityDimensions == 2, "Wrong mesh entity dimensions." ); /*static_assert( MeshEntity::entityDimensions == 2, "Wrong mesh entity dimensions." ); static_assert( MeshFunction::getEntitiesDimensions() == 2, "Wrong preimage function" ); const typename MeshEntity::template NeighbourEntities< 2 >& neighbourEntities = entity.getNeighbourEntities(); Loading @@ -151,9 +151,14 @@ operator()( const MeshFunction& u, const IndexType& east = neighbourEntities.template getEntityIndex< 1, 0 >(); const IndexType& west = neighbourEntities.template getEntityIndex< -1, 0 >(); const IndexType& north = neighbourEntities.template getEntityIndex< 0, 1 >(); const IndexType& south = neighbourEntities.template getEntityIndex< 0, -1 >(); return ( u[ west ] - 2.0 * u[ center ] + u[ east ] ) * hxSquareInverse + ( u[ south ] - 2.0 * u[ center ] + u[ north ] ) * hySquareInverse; const IndexType& south = neighbourEntities.template getEntityIndex< 0, -1 >(); */ /*const IndexType& xSize = entity.getMesh().getDimensions().x(); const IndexType& c = entity.getIndex(); const RealType& hxSquareInverse = entity.getMesh().template getSpaceStepsProducts< -2, 0 >(); const RealType& hySquareInverse = entity.getMesh().template getSpaceStepsProducts< 0, -2 >(); return ( u[ c - 1 ] - 2.0 * u[ c ] + u[ c + 1 ] ) * hxSquareInverse + ( u[ c - xSize ] - 2.0 * u[ c ] + u[ c + xSize ] ) * hySquareInverse;*/ } template< typename MeshReal, Loading
tests/benchmarks/heat-equation-benchmark/HeatEquationBenchmarkProblem.h +12 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,8 @@ class HeatEquationBenchmarkProblem: using typename BaseType::DofVectorType; using typename BaseType::MeshDependentDataType; HeatEquationBenchmarkProblem(); static tnlString getTypeStatic(); tnlString getPrologHeader() const; Loading Loading @@ -71,11 +73,21 @@ class HeatEquationBenchmarkProblem: DofVectorType& rightHandSide, MeshDependentDataType& meshDependentData ); ~HeatEquationBenchmarkProblem(); protected: DifferentialOperator differentialOperator; BoundaryCondition boundaryCondition; RightHandSide rightHandSide; tnlString cudaKernelType; MeshType* cudaMesh; BoundaryCondition* cudaBoundaryConditions; RightHandSide* cudaRightHandSide; DifferentialOperator* cudaDifferentialOperator; }; #include "HeatEquationBenchmarkProblem_impl.h" Loading