Commit f036fe10 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber Committed by Tomáš Oberhuber
Browse files

Fixing mesh function evaluator to work with more general RealType.

parent 7da96b04
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -45,11 +45,11 @@ class FunctionAdapter
         return function.setup( meshPointer, parameters, prefix );
      }
      
      template< typename EntityType, typename TimeReal = RealType >
      template< typename EntityType >
      __cuda_callable__ inline
      static RealType getValue( const FunctionType& function,
                                const EntityType& meshEntity,
                                const TimeReal& time )
                                const RealType& time )
      {
         return function( meshEntity, time );
      }
+13 −13
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ class MeshFunctionEvaluator
                  "Input and output functions must have the same domain dimensions." );

   public:
      typedef typename OutMeshFunction::RealType RealType;
      typedef typename InFunction::RealType RealType;
      typedef typename OutMeshFunction::MeshType MeshType;
      typedef typename MeshType::DeviceType DeviceType;
      typedef Functions::MeshFunctionEvaluatorTraverserUserData< OutMeshFunction, InFunction, RealType > TraverserUserData;
@@ -69,30 +69,30 @@ class MeshFunctionEvaluator
      template< typename OutMeshFunctionPointer, typename InFunctionPointer >
      static void evaluate( OutMeshFunctionPointer& meshFunction,
                            const InFunctionPointer& function,
                            const RealType& time = 0.0,
                            const RealType& outFunctionMultiplicator = 0.0,
                            const RealType& inFunctionMultiplicator = 1.0 );
                            const RealType& time = ( RealType ) 0.0,
                            const RealType& outFunctionMultiplicator = ( RealType ) 0.0,
                            const RealType& inFunctionMultiplicator = ( RealType ) 1.0 );

      template< typename OutMeshFunctionPointer, typename InFunctionPointer >
      static void evaluateAllEntities( OutMeshFunctionPointer& meshFunction,
                                       const InFunctionPointer& function,
                                       const RealType& time = 0.0,
                                       const RealType& outFunctionMultiplicator = 0.0,
                                       const RealType& inFunctionMultiplicator = 1.0 );
                                       const RealType& time = ( RealType ) 0.0,
                                       const RealType& outFunctionMultiplicator = ( RealType ) 0.0,
                                       const RealType& inFunctionMultiplicator = ( RealType ) 1.0 );
 
      template< typename OutMeshFunctionPointer, typename InFunctionPointer >
      static void evaluateInteriorEntities( OutMeshFunctionPointer& meshFunction,
                                            const InFunctionPointer& function,
                                            const RealType& time = 0.0,
                                            const RealType& outFunctionMultiplicator = 0.0,
                                            const RealType& inFunctionMultiplicator = 1.0 );
                                            const RealType& time = ( RealType ) 0.0,
                                            const RealType& outFunctionMultiplicator = ( RealType ) 0.0,
                                            const RealType& inFunctionMultiplicator = ( RealType ) 1.0 );

      template< typename OutMeshFunctionPointer, typename InFunctionPointer >
      static void evaluateBoundaryEntities( OutMeshFunctionPointer& meshFunction,
                                            const InFunctionPointer& function,
                                            const RealType& time = 0.0,
                                            const RealType& outFunctionMultiplicator = 0.0,
                                            const RealType& inFunctionMultiplicator = 1.0 );
                                            const RealType& time = ( RealType ) 0.0,
                                            const RealType& outFunctionMultiplicator = ( RealType ) 0.0,
                                            const RealType& inFunctionMultiplicator = ( RealType ) 1.0 );

   protected:

+2 −2
Original line number Diff line number Diff line
@@ -427,7 +427,7 @@ operator += ( const Function& f )
{
   Pointers::DevicePointer< ThisType > thisDevicePtr( *this );
   Pointers::DevicePointer< typename std::add_const< Function >::type > fDevicePtr( f );
   MeshFunctionEvaluator< ThisType, Function >::evaluate( thisDevicePtr, fDevicePtr, 1.0, 1.0 );
   MeshFunctionEvaluator< ThisType, Function >::evaluate( thisDevicePtr, fDevicePtr, ( RealType ) 1.0, ( RealType ) 1.0 );
   return *this;
}

@@ -441,7 +441,7 @@ operator -= ( const Function& f )
{
   Pointers::DevicePointer< ThisType > thisDevicePtr( *this );
   Pointers::DevicePointer< typename std::add_const< Function >::type > fDevicePtr( f );
   MeshFunctionEvaluator< ThisType, Function >::evaluate( thisDevicePtr, fDevicePtr, 1.0, -1.0 );
   MeshFunctionEvaluator< ThisType, Function >::evaluate( thisDevicePtr, fDevicePtr, ( RealType ) 1.0, ( RealType ) -1.0 );
   return *this;
}