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

#include <KokkosVariableValue.h>

Public Member Functions

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

Private Attributes

Variable _var
 Coupled Kokkos variable. More...
 

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"); }
void checkVariable(const Variable &var, bool expect_vector, const std::string &wrapper_name)
Variable _var
Coupled Kokkos variable.

◆ 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  }
void checkVariable(const Variable &var, bool expect_vector, const std::string &wrapper_name)
Variable _var
Coupled Kokkos variable.

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.
Variable _var
Coupled Kokkos variable.

◆ 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 TagID tag() const
Get the vector tag ID.
Vector3< Real > Real3
Definition: KokkosTypes.h:32
KOKKOS_FUNCTION unsigned int sys(unsigned int comp=0) const
Get the system number of a component.
const unsigned int invalid_uint
KOKKOS_FUNCTION unsigned int getDimension() const
Get the mesh dimension.
KOKKOS_FUNCTION const FESystem & system(unsigned int sys) const
Get the Kokkos system.
Definition: KokkosDatum.h:281
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...
Definition: KokkosDatum.h:495
KOKKOS_FUNCTION bool initialized() const
Get whether the variable is initialized.
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 side() const
Get the side index.
Definition: KokkosDatum.h:79
KOKKOS_FUNCTION bool coupled() const
Get whether the variable is coupled.
Variable _var
Coupled Kokkos variable.
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_INLINE_FUNCTION Real3 curlFromVectorGradient(const Real33 grad, const unsigned int dim)
Definition: KokkosTypes.h:591
KOKKOS_FUNCTION const Assembly & assembly() const
Get the Kokkos assembly.
Definition: KokkosDatum.h:274
KOKKOS_INLINE_FUNCTION Real33 transpose() const
Definition: KokkosTypes.h:448
KOKKOS_FUNCTION bool isNodal() const
Get whether the current datum is on a node.
Definition: KokkosDatum.h:324
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 dof_id_type qpOffset() const
Get the starting offset into the global quadrature point index.
Definition: KokkosDatum.h:309

◆ 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; }
Variable _var
Coupled Kokkos variable.

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(), and VectorVariableCurl().


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