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

#include <KokkosVariableValue.h>

Public Member Functions

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

Private Attributes

Variable _var
 Coupled Kokkos variable.
 

Detailed Description

Definition at line 764 of file KokkosVariableValue.h.

Constructor & Destructor Documentation

◆ VectorVariableCurl() [1/3]

Moose::Kokkos::VectorVariableCurl::VectorVariableCurl ( )
default

Default constructor.

◆ VectorVariableCurl() [2/3]

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

Constructor.

Parameters
varThe Kokkos variable

Definition at line 775 of file KokkosVariableValue.h.

775: _var(var) { checkVariable(_var, true, "VectorVariableCurl"); }
Variable _var
Coupled Kokkos variable.
void checkVariable(const Variable &var, bool expect_vector, const std::string &wrapper_name)

◆ VectorVariableCurl() [3/3]

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

Constructor.

Parameters
varThe MOOSE variable
tagThe vector tag name

Definition at line 781 of file KokkosVariableValue.h.

782 : _var(var, tag)
783 {
784 checkVariable(_var, true, "VectorVariableCurl");
785 }

Member Function Documentation

◆ operator bool()

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

Get whether the variable was coupled.

Returns
Whether the variable was coupled

Definition at line 791 of file KokkosVariableValue.h.

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

◆ operator()()

KOKKOS_FUNCTION Real3 Moose::Kokkos::VectorVariableCurl::operator() ( AssemblyDatum datum,
unsigned int  qp,
unsigned int  comp = 0 
) const
inline

Get the current vector variable curl.

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

Definition at line 895 of file KokkosVariableValue.h.

896{
897 KOKKOS_ASSERT(_var.initialized());
898
899 Real3 curl = 0;
900
901 if (_var.coupled())
902 {
903 KOKKOS_ASSERT(!datum.isNodal());
904
905 auto & elem = datum.elem();
906 auto side = datum.side();
907 auto & sys = datum.system(_var.sys(comp));
908 auto var = _var.var(comp);
909 auto tag = _var.tag();
910
911 if (side == libMesh::invalid_uint)
912 curl = sys.getVectorQpVectorCurl(elem, datum.qpOffset() + qp, var, tag);
913 else
914 {
915 auto fe = sys.getFETypeID(var);
916 auto n_dofs = datum.assembly().getNumDofs(elem.type, fe);
917 auto & grad_phi = datum.assembly().getVectorGradPhiFace(elem.subdomain, elem.type, fe)(side);
918 auto jacobian = datum.J(qp);
919 auto jacobian_transpose = jacobian.transpose();
920 Real33 grad = 0;
921
922 for (unsigned int i = 0; i < n_dofs; ++i)
923 grad += sys.getVectorDofValue(sys.getElemLocalDofIndex(elem.id, i, var), tag) *
924 (grad_phi(i, qp) * jacobian_transpose);
925
926 curl = curlFromVectorGradient(grad, datum.assembly().getDimension());
927 }
928 }
929
930 return curl;
931}
KOKKOS_FUNCTION unsigned int getNumDofs(unsigned int elem_type, unsigned int fe_type) const
Get the number of DOFs of a FE type for an element type.
KOKKOS_FUNCTION unsigned int getDimension() const
Get the mesh dimension.
KOKKOS_FUNCTION const auto & getVectorGradPhiFace(ContiguousSubdomainID subdomain, unsigned int elem_type, unsigned int fe_type) const
Get the gradient of face vector shape functions of a FE type for an element type and subdomain.
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 const Assembly & assembly() const
Get the Kokkos assembly.
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.
KOKKOS_INLINE_FUNCTION Real3 curlFromVectorGradient(const Real33 grad, const unsigned int dim)
Vector3< Real > Real3
Definition KokkosTypes.h:32
const unsigned int invalid_uint
KOKKOS_INLINE_FUNCTION Real33 transpose() const

◆ variable()

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

Get the Kokkos variable.

Returns
The Kokkos variable

Definition at line 807 of file KokkosVariableValue.h.

807{ return _var; }

Member Data Documentation

◆ _var

Variable Moose::Kokkos::VectorVariableCurl::_var
private

Coupled Kokkos variable.

Definition at line 813 of file KokkosVariableValue.h.

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


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