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

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

800 : _var(var, tag)
801 {
802 checkVariable(_var, true, "VectorVariableCurl");
803 }

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

809{ 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 913 of file KokkosVariableValue.h.

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

825{ return _var; }

Member Data Documentation

◆ _var

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

Coupled Kokkos variable.

Definition at line 831 of file KokkosVariableValue.h.

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


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