Loading src/functions/tnlBoundaryOperatorFunction.h +3 −1 Original line number Diff line number Diff line Loading @@ -53,6 +53,8 @@ class tnlBoundaryOperatorFunction const BoundaryOperator* boundaryOperator; const FunctionType* function; template< typename, typename > friend class tnlMeshFunctionEvaluator; }; Loading src/functions/tnlExactOperatorFunction.h +3 −1 Original line number Diff line number Diff line Loading @@ -18,9 +18,11 @@ #ifndef TNLEXACTOPERATORFUNCTION_H #define TNLEXACTOPERATORFUNCTION_H #include <functions/tnlFunction.h> template< typename Operator, typename Function > class tnlExactOperatorFunction class tnlExactOperatorFunction : public tnlFunction< Operator::Dimensions, AnalyticFunction > { public: Loading src/functions/tnlFunctionEvaluator.h +1 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ class tnlFunctionEvaluatorTraverserUserData functionCoefficient( &functionCoefficient ), dofVectorCoefficient( &dofVectorCoefficient ) {}; }; Loading src/functions/tnlMeshFunction.h +4 −2 Original line number Diff line number Diff line Loading @@ -101,7 +101,7 @@ class tnlMeshFunction : RealType getLpNorm( const RealType& p ) const; RealType getMaxMorm() const; RealType getMaxNorm() const; bool save( tnlFile& file ) const; Loading @@ -120,6 +120,8 @@ class tnlMeshFunction : const MeshType* mesh; VectorType data; template< typename, typename > friend class tnlMeshFunctionEvaluator; }; #include <functions/tnlMeshFunction_impl.h> Loading src/functions/tnlMeshFunctionEvaluator.h +24 −19 Original line number Diff line number Diff line Loading @@ -34,18 +34,18 @@ */ template< typename OutMeshFunction, typename InFunction > class tnlMeshFunctionEvaluator class tnlMeshFunctionEvaluator : public tnlFunction< OutMeshFunction::getMeshEntityDimensions(), MeshFunction > { public: typedef typename OutMeshFunction::MeshType MeshType; typedef typename MeshType::RealType MeshRealType; typedef typename MeshType::DeviceType MeshDeviceType; typedef typename MeshType::IndexType MeshIndexType; typedef typename OutMeshFunction::Real RealType; typedef typename OutMeshFunction::RealType RealType; const static int meshEntityDimensions = OutMeshFunction::entityDimensions; static_assert( MeshType::meshDimensions == InFunction::Dimensions, static_assert( MeshType::meshDimensions == InFunction::getDimensions(), "Input function and the mesh of the mesh function have both different number of dimensions." ); static void evaluate( OutMeshFunction& meshFunction, Loading Loading @@ -111,6 +111,7 @@ template< typename OutMeshFunction, typename Operator, typename Function > class tnlMeshFunctionEvaluator< OutMeshFunction, tnlOperatorFunction< Operator, Function > > : public tnlFunction< OutMeshFunction::getMeshEntityDimensions(), MeshFunction > { public: Loading @@ -118,7 +119,7 @@ class tnlMeshFunctionEvaluator< OutMeshFunction, tnlOperatorFunction< Operator, typedef typename MeshType::RealType MeshRealType; typedef typename MeshType::DeviceType MeshDeviceType; typedef typename MeshType::IndexType MeshIndexType; typedef typename OutMeshFunction::Real RealType; typedef typename OutMeshFunction::RealType RealType; typedef tnlOperatorFunction< Operator, Function > OperatorFunctionType; static_assert( std::is_same< MeshType, typename OperatorFunctionType::MeshType >::value, Loading @@ -136,9 +137,10 @@ class tnlMeshFunctionEvaluator< OutMeshFunction, tnlOperatorFunction< Operator, class TraverserUserData { public: typedef OperatorFunctionType InFunctionType; public: TraverserUserData( const OperatorFunctionType* operatorFunction, const RealType* time, OutMeshFunction* meshFunction, Loading Loading @@ -167,6 +169,7 @@ template< typename OutMeshFunction, typename BoundaryOperator, typename Function > class tnlMeshFunctionEvaluator< OutMeshFunction, tnlBoundaryOperatorFunction< BoundaryOperator, Function > > : public tnlFunction< OutMeshFunction::getMeshEntityDimensions(), MeshFunction > { public: Loading @@ -174,7 +177,7 @@ class tnlMeshFunctionEvaluator< OutMeshFunction, tnlBoundaryOperatorFunction< Bo typedef typename MeshType::RealType MeshRealType; typedef typename MeshType::DeviceType MeshDeviceType; typedef typename MeshType::IndexType MeshIndexType; typedef typename OutMeshFunction::Real RealType; typedef typename OutMeshFunction::RealType RealType; typedef tnlBoundaryOperatorFunction< BoundaryOperator, Function > BoundaryOperatorFunctionType; static_assert( std::is_same < MeshType, typename BoundaryOperatorFunctionType::MeshType >::value, Loading Loading @@ -222,13 +225,15 @@ template< typename MeshType, typename UserData > class tnlMeshFunctionEvaluatorEntitiesProcessor { public: template< typename EntityType > __cuda_callable__ static inline void processEntity( const MeshType& mesh, UserData& userData, const EntityType& entity ) { typedef tnlFunctionAdapter< MeshType, typename UserData::InFunction > FunctionAdapter; typedef tnlFunctionAdapter< MeshType, typename UserData::InFunctionType > FunctionAdapter; ( *userData.meshFunction )( entity ) = *userData.outFunctionMultiplicator * ( *userData.meshFunction )( entity ) + *userData.inFunctionMultiplicator * Loading Loading
src/functions/tnlBoundaryOperatorFunction.h +3 −1 Original line number Diff line number Diff line Loading @@ -53,6 +53,8 @@ class tnlBoundaryOperatorFunction const BoundaryOperator* boundaryOperator; const FunctionType* function; template< typename, typename > friend class tnlMeshFunctionEvaluator; }; Loading
src/functions/tnlExactOperatorFunction.h +3 −1 Original line number Diff line number Diff line Loading @@ -18,9 +18,11 @@ #ifndef TNLEXACTOPERATORFUNCTION_H #define TNLEXACTOPERATORFUNCTION_H #include <functions/tnlFunction.h> template< typename Operator, typename Function > class tnlExactOperatorFunction class tnlExactOperatorFunction : public tnlFunction< Operator::Dimensions, AnalyticFunction > { public: Loading
src/functions/tnlFunctionEvaluator.h +1 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ class tnlFunctionEvaluatorTraverserUserData functionCoefficient( &functionCoefficient ), dofVectorCoefficient( &dofVectorCoefficient ) {}; }; Loading
src/functions/tnlMeshFunction.h +4 −2 Original line number Diff line number Diff line Loading @@ -101,7 +101,7 @@ class tnlMeshFunction : RealType getLpNorm( const RealType& p ) const; RealType getMaxMorm() const; RealType getMaxNorm() const; bool save( tnlFile& file ) const; Loading @@ -120,6 +120,8 @@ class tnlMeshFunction : const MeshType* mesh; VectorType data; template< typename, typename > friend class tnlMeshFunctionEvaluator; }; #include <functions/tnlMeshFunction_impl.h> Loading
src/functions/tnlMeshFunctionEvaluator.h +24 −19 Original line number Diff line number Diff line Loading @@ -34,18 +34,18 @@ */ template< typename OutMeshFunction, typename InFunction > class tnlMeshFunctionEvaluator class tnlMeshFunctionEvaluator : public tnlFunction< OutMeshFunction::getMeshEntityDimensions(), MeshFunction > { public: typedef typename OutMeshFunction::MeshType MeshType; typedef typename MeshType::RealType MeshRealType; typedef typename MeshType::DeviceType MeshDeviceType; typedef typename MeshType::IndexType MeshIndexType; typedef typename OutMeshFunction::Real RealType; typedef typename OutMeshFunction::RealType RealType; const static int meshEntityDimensions = OutMeshFunction::entityDimensions; static_assert( MeshType::meshDimensions == InFunction::Dimensions, static_assert( MeshType::meshDimensions == InFunction::getDimensions(), "Input function and the mesh of the mesh function have both different number of dimensions." ); static void evaluate( OutMeshFunction& meshFunction, Loading Loading @@ -111,6 +111,7 @@ template< typename OutMeshFunction, typename Operator, typename Function > class tnlMeshFunctionEvaluator< OutMeshFunction, tnlOperatorFunction< Operator, Function > > : public tnlFunction< OutMeshFunction::getMeshEntityDimensions(), MeshFunction > { public: Loading @@ -118,7 +119,7 @@ class tnlMeshFunctionEvaluator< OutMeshFunction, tnlOperatorFunction< Operator, typedef typename MeshType::RealType MeshRealType; typedef typename MeshType::DeviceType MeshDeviceType; typedef typename MeshType::IndexType MeshIndexType; typedef typename OutMeshFunction::Real RealType; typedef typename OutMeshFunction::RealType RealType; typedef tnlOperatorFunction< Operator, Function > OperatorFunctionType; static_assert( std::is_same< MeshType, typename OperatorFunctionType::MeshType >::value, Loading @@ -136,9 +137,10 @@ class tnlMeshFunctionEvaluator< OutMeshFunction, tnlOperatorFunction< Operator, class TraverserUserData { public: typedef OperatorFunctionType InFunctionType; public: TraverserUserData( const OperatorFunctionType* operatorFunction, const RealType* time, OutMeshFunction* meshFunction, Loading Loading @@ -167,6 +169,7 @@ template< typename OutMeshFunction, typename BoundaryOperator, typename Function > class tnlMeshFunctionEvaluator< OutMeshFunction, tnlBoundaryOperatorFunction< BoundaryOperator, Function > > : public tnlFunction< OutMeshFunction::getMeshEntityDimensions(), MeshFunction > { public: Loading @@ -174,7 +177,7 @@ class tnlMeshFunctionEvaluator< OutMeshFunction, tnlBoundaryOperatorFunction< Bo typedef typename MeshType::RealType MeshRealType; typedef typename MeshType::DeviceType MeshDeviceType; typedef typename MeshType::IndexType MeshIndexType; typedef typename OutMeshFunction::Real RealType; typedef typename OutMeshFunction::RealType RealType; typedef tnlBoundaryOperatorFunction< BoundaryOperator, Function > BoundaryOperatorFunctionType; static_assert( std::is_same < MeshType, typename BoundaryOperatorFunctionType::MeshType >::value, Loading Loading @@ -222,13 +225,15 @@ template< typename MeshType, typename UserData > class tnlMeshFunctionEvaluatorEntitiesProcessor { public: template< typename EntityType > __cuda_callable__ static inline void processEntity( const MeshType& mesh, UserData& userData, const EntityType& entity ) { typedef tnlFunctionAdapter< MeshType, typename UserData::InFunction > FunctionAdapter; typedef tnlFunctionAdapter< MeshType, typename UserData::InFunctionType > FunctionAdapter; ( *userData.meshFunction )( entity ) = *userData.outFunctionMultiplicator * ( *userData.meshFunction )( entity ) + *userData.inFunctionMultiplicator * Loading