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

736: _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 742 of file KokkosVariableValue.h.

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

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

752{ 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 856 of file KokkosVariableValue.h.

857{
858 KOKKOS_ASSERT(_var.initialized());
859
860 Real3 curl = 0;
861
862 if (_var.coupled())
863 {
864 KOKKOS_ASSERT(!datum.isNodal());
865
866 auto & elem = datum.elem();
867 auto side = datum.side();
868 auto & sys = datum.system(_var.sys(comp));
869 auto var = _var.var(comp);
870 auto tag = _var.tag();
871
872 if (side == libMesh::invalid_uint)
873 curl = sys.getVectorQpVectorCurl(elem, datum.qpOffset() + qp, var, tag);
874 else
875 {
876 auto fe = sys.getFETypeID(var);
877 auto n_dofs = datum.assembly().getNumDofs(elem.type, fe);
878 auto & grad_phi = datum.assembly().getVectorGradPhiFace(elem.subdomain, elem.type, fe)(side);
879 auto jacobian = datum.J(qp);
880 auto jacobian_transpose = jacobian.transpose();
881 Real33 grad = 0;
882
883 for (unsigned int i = 0; i < n_dofs; ++i)
884 grad += sys.getVectorDofValue(sys.getElemLocalDofIndex(elem.id, i, var), tag) *
885 (grad_phi(i, qp) * jacobian_transpose);
886
887 curl = curlFromVectorGradient(grad, datum.assembly().getDimension());
888 }
889 }
890
891 return curl;
892}
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 768 of file KokkosVariableValue.h.

768{ return _var; }

Member Data Documentation

◆ _var

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

Coupled Kokkos variable.

Definition at line 774 of file KokkosVariableValue.h.

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


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