https://mooseframework.inl.gov
Public Member Functions | Private Attributes | List of all members
Moose::Kokkos::Function Class Referencefinal

The abstract class that provides polymorphic interfaces for a function. More...

#include <KokkosFunction.h>

Public Member Functions

 Function (std::shared_ptr< FunctionWrapperHostBase > wrapper)
 Constructor. More...
 
 Function (const Function &function)
 Copy constructor for parallel dispatch. More...
 
 ~Function ()
 Destructor. More...
 
KOKKOS_FUNCTION Real value (Real t, Real3 p) const
 
KOKKOS_FUNCTION Real3 vectorValue (Real t, Real3 p) const
 
KOKKOS_FUNCTION Real3 gradient (Real t, Real3 p) const
 
KOKKOS_FUNCTION Real3 curl (Real t, Real3 p) const
 
KOKKOS_FUNCTION Real div (Real t, Real3 p) const
 
KOKKOS_FUNCTION Real timeDerivative (Real t, Real3 p) const
 
KOKKOS_FUNCTION Real timeIntegral (Real t1, Real t2, Real3 p) const
 
KOKKOS_FUNCTION Real integral () const
 
KOKKOS_FUNCTION Real average () const
 

Private Attributes

std::shared_ptr< FunctionWrapperHostBase_wrapper_host
 Pointer to the host function wrapper. More...
 
FunctionWrapperDeviceBase_wrapper_device = nullptr
 Pointer to the device function wrapper. More...
 

Detailed Description

The abstract class that provides polymorphic interfaces for a function.

NOTE: This class is not the base class for a Kokkos function derivation. The user should derive their own function from Moose::Kokkos::FunctionBase.

Definition at line 147 of file KokkosFunction.h.

Constructor & Destructor Documentation

◆ Function() [1/2]

Moose::Kokkos::Function::Function ( std::shared_ptr< FunctionWrapperHostBase wrapper)

Constructor.

Parameters
wrapperThe host function wrapper

◆ Function() [2/2]

Moose::Kokkos::Function::Function ( const Function function)

Copy constructor for parallel dispatch.

◆ ~Function()

Moose::Kokkos::Function::~Function ( )

Destructor.

Member Function Documentation

◆ average()

KOKKOS_FUNCTION Real Moose::Kokkos::Function::average ( ) const
inline

Definition at line 181 of file KokkosFunction.h.

181 { return _wrapper_device->average(); }
FunctionWrapperDeviceBase * _wrapper_device
Pointer to the device function wrapper.
virtual KOKKOS_FUNCTION Real average() const =0

◆ curl()

KOKKOS_FUNCTION Real3 Moose::Kokkos::Function::curl ( Real  t,
Real3  p 
) const
inline

Definition at line 170 of file KokkosFunction.h.

170 { return _wrapper_device->curl(t, p); }
FunctionWrapperDeviceBase * _wrapper_device
Pointer to the device function wrapper.
virtual KOKKOS_FUNCTION Real3 curl(Real t, Real3 p) const =0

◆ div()

KOKKOS_FUNCTION Real Moose::Kokkos::Function::div ( Real  t,
Real3  p 
) const
inline

Definition at line 171 of file KokkosFunction.h.

171 { return _wrapper_device->div(t, p); }
FunctionWrapperDeviceBase * _wrapper_device
Pointer to the device function wrapper.
virtual KOKKOS_FUNCTION Real div(Real t, Real3 p) const =0

◆ gradient()

KOKKOS_FUNCTION Real3 Moose::Kokkos::Function::gradient ( Real  t,
Real3  p 
) const
inline

Definition at line 169 of file KokkosFunction.h.

169 { return _wrapper_device->gradient(t, p); }
virtual KOKKOS_FUNCTION Real3 gradient(Real t, Real3 p) const =0
FunctionWrapperDeviceBase * _wrapper_device
Pointer to the device function wrapper.

◆ integral()

KOKKOS_FUNCTION Real Moose::Kokkos::Function::integral ( ) const
inline

Definition at line 180 of file KokkosFunction.h.

180 { return _wrapper_device->integral(); }
virtual KOKKOS_FUNCTION Real integral() const =0
FunctionWrapperDeviceBase * _wrapper_device
Pointer to the device function wrapper.

◆ timeDerivative()

KOKKOS_FUNCTION Real Moose::Kokkos::Function::timeDerivative ( Real  t,
Real3  p 
) const
inline

Definition at line 172 of file KokkosFunction.h.

173  {
174  return _wrapper_device->timeDerivative(t, p);
175  }
FunctionWrapperDeviceBase * _wrapper_device
Pointer to the device function wrapper.
virtual KOKKOS_FUNCTION Real timeDerivative(Real t, Real3 p) const =0

◆ timeIntegral()

KOKKOS_FUNCTION Real Moose::Kokkos::Function::timeIntegral ( Real  t1,
Real  t2,
Real3  p 
) const
inline

Definition at line 176 of file KokkosFunction.h.

177  {
178  return _wrapper_device->timeIntegral(t1, t2, p);
179  }
virtual KOKKOS_FUNCTION Real timeIntegral(Real t1, Real t2, Real3 p) const =0
FunctionWrapperDeviceBase * _wrapper_device
Pointer to the device function wrapper.

◆ value()

KOKKOS_FUNCTION Real Moose::Kokkos::Function::value ( Real  t,
Real3  p 
) const
inline

Definition at line 164 of file KokkosFunction.h.

Referenced by KokkosFunctionAux::computeValue().

164 { return _wrapper_device->value(t, p); }
FunctionWrapperDeviceBase * _wrapper_device
Pointer to the device function wrapper.
virtual KOKKOS_FUNCTION Real value(Real t, Real3 p) const =0
Virtual shims that calls the corresponding methods of the actual stored function. ...

◆ vectorValue()

KOKKOS_FUNCTION Real3 Moose::Kokkos::Function::vectorValue ( Real  t,
Real3  p 
) const
inline

Definition at line 165 of file KokkosFunction.h.

166  {
167  return _wrapper_device->vectorValue(t, p);
168  }
virtual KOKKOS_FUNCTION Real3 vectorValue(Real t, Real3 p) const =0
FunctionWrapperDeviceBase * _wrapper_device
Pointer to the device function wrapper.

Member Data Documentation

◆ _wrapper_device

FunctionWrapperDeviceBase* Moose::Kokkos::Function::_wrapper_device = nullptr
private

Pointer to the device function wrapper.

Definition at line 191 of file KokkosFunction.h.

Referenced by average(), curl(), div(), gradient(), integral(), timeDerivative(), timeIntegral(), value(), and vectorValue().

◆ _wrapper_host

std::shared_ptr<FunctionWrapperHostBase> Moose::Kokkos::Function::_wrapper_host
private

Pointer to the host function wrapper.

Definition at line 187 of file KokkosFunction.h.


The documentation for this class was generated from the following file: