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 Variable & variable () 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 776 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 787 of file KokkosVariableValue.h.

787: _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 793 of file KokkosVariableValue.h.

794 : _var(var, tag)
795 {
796 checkVariable(_var, true, "VectorVariableCurl");
797 }

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 803 of file KokkosVariableValue.h.

803{ 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 907 of file KokkosVariableValue.h.

908{
909 KOKKOS_ASSERT(_var.initialized());
910
911 Real3 curl = 0;
912
913 if (_var.coupled())
914 {
915 KOKKOS_ASSERT(!datum.isNodal());
916
917 auto & elem = datum.elem();
918 auto side = datum.side();
919 auto & sys = datum.system(_var.sys(comp));
920 auto var = _var.var(comp);
921 auto tag = _var.tag();
922
923 if (side == libMesh::invalid_uint)
924 curl = sys.getVectorQpVectorCurl(elem, datum.qpOffset() + qp, var, tag);
925 else
926 {
927 auto fe = sys.getFETypeID(var);
928 auto n_dofs = datum.assembly().getNumDofs(elem.type, fe);
929 auto & grad_phi = datum.assembly().getVectorGradPhiFace(elem.subdomain, elem.type, fe)(side);
930 auto jacobian = datum.J(qp);
931 auto jacobian_transpose = jacobian.transpose();
932 Real33 grad = 0;
933
934 for (unsigned int i = 0; i < n_dofs; ++i)
935 grad += sys.getVectorDofValue(sys.getElemLocalDofIndex(elem.id, i, var), tag) *
936 (grad_phi(i, qp) * jacobian_transpose);
937
938 curl = curlFromVectorGradient(grad, datum.assembly().getDimension());
939 }
940 }
941
942 return curl;
943}
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 819 of file KokkosVariableValue.h.

819{ return _var; }

Member Data Documentation

◆ _var

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

Coupled Kokkos variable.

Definition at line 825 of file KokkosVariableValue.h.

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


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