https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
Moose::Kokkos::VectorVariableGradient Class Reference

#include <KokkosVariableValue.h>

Public Member Functions

 VectorVariableGradient ()=default
 Default constructor.
 
 VectorVariableGradient (Variable var)
 Constructor.
 
 VectorVariableGradient (const MooseVariableFieldBase &var, const TagName &tag=Moose::SOLUTION_TAG)
 Constructor.
 
KOKKOS_FUNCTION operator bool () const
 Get whether the variable was coupled.
 
KOKKOS_FUNCTION const Variable & variable () const
 Get the Kokkos variable.
 
KOKKOS_FUNCTION Real33 operator() (AssemblyDatum &datum, unsigned int qp, unsigned int comp=0) const
 Get the current vector variable gradient.
 

Private Attributes

Variable _var
 Coupled Kokkos variable.
 

Detailed Description

Definition at line 720 of file KokkosVariableValue.h.

Constructor & Destructor Documentation

◆ VectorVariableGradient() [1/3]

Moose::Kokkos::VectorVariableGradient::VectorVariableGradient ( )
default

Default constructor.

◆ VectorVariableGradient() [2/3]

Moose::Kokkos::VectorVariableGradient::VectorVariableGradient ( Variable  var)
inline

Constructor.

Parameters
varThe Kokkos variable

Definition at line 731 of file KokkosVariableValue.h.

731 : _var(var)
732 {
733 checkVariable(_var, true, "VectorVariableGradient");
734 }
Variable _var
Coupled Kokkos variable.
void checkVariable(const Variable &var, bool expect_vector, const std::string &wrapper_name)

◆ VectorVariableGradient() [3/3]

Moose::Kokkos::VectorVariableGradient::VectorVariableGradient ( const MooseVariableFieldBase &  var,
const TagName &  tag = Moose::SOLUTION_TAG 
)
inline

Constructor.

Parameters
varThe MOOSE variable
tagThe vector tag name

Definition at line 740 of file KokkosVariableValue.h.

742 : _var(var, tag)
743 {
744 checkVariable(_var, true, "VectorVariableGradient");
745 }

Member Function Documentation

◆ operator bool()

KOKKOS_FUNCTION Moose::Kokkos::VectorVariableGradient::operator bool ( ) const
inline

Get whether the variable was coupled.

Returns
Whether the variable was coupled

Definition at line 751 of file KokkosVariableValue.h.

751{ return _var.coupled(); }
KOKKOS_FUNCTION bool coupled() const
Get whether the variable is coupled.

◆ operator()()

KOKKOS_FUNCTION Real33 Moose::Kokkos::VectorVariableGradient::operator() ( AssemblyDatum &  datum,
unsigned int  qp,
unsigned int  comp = 0 
) const
inline

Get the current vector variable gradient.

Parameters
datumThe AssemblyDatum object of the current thread
qpThe local quadrature point index
Returns
The vector variable gradient

Definition at line 881 of file KokkosVariableValue.h.

882{
883 KOKKOS_ASSERT(_var.initialized());
884
885 Real33 grad = 0;
886
887 if (_var.coupled())
888 {
889 KOKKOS_ASSERT(!datum.isNodal());
890
891 auto & elem = datum.elem();
892 auto side = datum.side();
893 auto & sys = datum.system(_var.sys(comp));
894 auto var = _var.var(comp);
895 auto tag = _var.tag();
896
897 if (side == libMesh::invalid_uint)
898 grad = sys.getVectorQpVectorGrad(elem, datum.qpOffset() + qp, var, tag);
899 else
900 grad = sys.getVectorQpVectorGradFace(elem, side, datum.J(qp), qp, var, tag);
901 }
902
903 return grad;
904}
KOKKOS_FUNCTION const FESystem & system(unsigned int sys) const
Get the Kokkos system.
KOKKOS_FUNCTION const Real33 & J(const unsigned int qp)
Get the inverse of Jacobian matrix | dxi/dx deta/dx dzeta/dx | | dxi/dy deta/dy dzeta/dy | | dxi/dz d...
KOKKOS_FUNCTION dof_id_type qpOffset() const
Get the starting offset into the global quadrature point index.
KOKKOS_FUNCTION bool isNodal() const
Get whether the current datum is on a node.
KOKKOS_FUNCTION unsigned int side() const
Get the side index.
Definition KokkosDatum.h:79
KOKKOS_FUNCTION const ElementInfo & elem() const
Get the element information object.
Definition KokkosDatum.h:46
KOKKOS_FUNCTION unsigned int var(unsigned int comp=0) const
Get the variable number of a component.
KOKKOS_FUNCTION TagID tag() const
Get the vector tag ID.
KOKKOS_FUNCTION bool initialized() const
Get whether the variable is initialized.
KOKKOS_FUNCTION unsigned int sys(unsigned int comp=0) const
Get the system number of a component.
const unsigned int invalid_uint

◆ variable()

KOKKOS_FUNCTION const Variable & Moose::Kokkos::VectorVariableGradient::variable ( ) const
inline

Get the Kokkos variable.

Returns
The Kokkos variable

Definition at line 767 of file KokkosVariableValue.h.

767{ return _var; }

Member Data Documentation

◆ _var

Variable Moose::Kokkos::VectorVariableGradient::_var
private

Coupled Kokkos variable.

Definition at line 773 of file KokkosVariableValue.h.

Referenced by operator bool(), operator()(), variable(), VectorVariableGradient(), and VectorVariableGradient().


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