35 auto & elem = datum.
elem();
36 auto side = datum.
side();
37 auto fe = datum.
jfe();
57 auto & elem = datum.
elem();
58 auto side = datum.
side();
59 auto fe = datum.
jfe();
80 auto & elem = datum.
elem();
81 auto side = datum.
side();
82 auto fe = datum.
ife();
102 auto & elem = datum.
elem();
103 auto side = datum.
side();
104 auto fe = datum.
ife();
123 template <
bool is_ad>
127 using real_type = std::conditional_t<is_ad, ADReal, Real>;
195 KOKKOS_FUNCTION
auto operator()(
Datum & datum,
unsigned int idx,
unsigned int comp = 0)
const 197 return get(datum,
idx, comp);
226 get(
Datum & datum,
unsigned int idx,
unsigned int comp = 0,
Real seed = 0)
const;
242 template <
bool is_ad>
244 : _var(object._var), _seed(object._seed), _dof(object._dof)
260 template <
bool is_ad>
270 template <
bool is_ad>
274 unsigned int comp)
const 279 datum.
do_derivatives() && _var.coupled() && _var.sys(comp) == datum.
sys() ? _seed[comp] : 0;
281 return get(datum,
idx, comp, seed);
284 return get(datum,
idx, comp);
287 template <
bool is_ad>
292 [[maybe_unused]] Real seed)
const 294 KOKKOS_ASSERT(_var.initialized());
300 auto & sys = datum.
system(_var.sys(comp));
301 auto var = _var.var(comp);
302 auto tag = _var.tag();
310 auto node = datum.
node();
311 dof = sys.getNodeLocalDofIndex(node, 0, var);
315 auto elem = datum.
elem().
id;
316 dof = sys.getElemLocalDofIndex(elem,
idx, var);
320 value = sys.getVectorDofADValue(dof, tag, seed);
322 value = sys.getVectorDofValue(dof, tag);
326 auto & elem = datum.
elem();
327 auto side = datum.
side();
331 ? sys.getVectorQpADValue(elem, datum.
qpOffset(),
idx, var, tag, seed)
332 : sys.getVectorQpADValueFace(elem, side,
idx, var, tag, seed);
335 ? sys.getVectorQpValue(elem, datum.
qpOffset() +
idx, var, tag)
336 : sys.getVectorQpValueFace(elem, side,
idx, var, tag);
340 value = _var.value(comp);
345 template <
bool is_ad>
348 using real3_type = std::conditional_t<is_ad, ADReal3, Real3>;
410 KOKKOS_FUNCTION
auto operator()(
Datum & datum,
unsigned int qp,
unsigned int comp = 0)
const 412 return get(datum, qp, comp);
441 get(
Datum & datum,
unsigned int qp,
unsigned int comp = 0,
Real seed = 0)
const;
453 template <
bool is_ad>
455 : _var(object._var), _seed(object._seed)
471 template <
bool is_ad>
480 template <
bool is_ad>
484 unsigned int comp)
const 489 datum.
do_derivatives() && _var.coupled() && _var.sys(comp) == datum.
sys() ? _seed[comp] : 0;
491 return get(datum, qp, comp, seed);
494 return get(datum, qp, comp);
497 template <
bool is_ad>
502 [[maybe_unused]] Real seed)
const 504 KOKKOS_ASSERT(_var.initialized());
510 KOKKOS_ASSERT(!datum.
isNodal());
512 auto & elem = datum.
elem();
513 auto side = datum.
side();
518 ? datum.
system(_var.sys(comp))
520 elem, datum.
J(qp), datum.
qpOffset(), qp, _var.var(comp), _var.tag(), seed)
521 : datum.
system(_var.sys(comp))
522 .getVectorQpADGradFace(
523 elem, side, datum.
J(qp), qp, _var.var(comp), _var.tag(), seed);
527 ? datum.
system(_var.sys(comp))
528 .getVectorQpGrad(elem, datum.
qpOffset() + qp, _var.var(comp), _var.tag())
529 : datum.
system(_var.sys(comp))
530 .getVectorQpGradFace(elem, side, datum.
J(qp), qp, _var.var(comp), _var.tag());
KOKKOS_FUNCTION const auto & getPhi(ContiguousSubdomainID subdomain, unsigned int elem_type, unsigned int fe_type) const
Get the shape functions of a FE type for an element type and subdomain.
KOKKOS_FUNCTION bool old() const
Get whether the tag is old/older value.
KOKKOS_FUNCTION auto get(Datum &datum, unsigned int qp, unsigned int comp=0, Real seed=0) const
Get the current variable gradient.
The Kokkos object that holds thread-private data in the parallel operations of any Kokkos object...
bool _dof
Flag whether DOF values are requested.
const unsigned int invalid_uint
VariableGradientTempl()=default
Default constructor.
VariableGradientTempl(const std::vector< MooseVariableFieldBase *> &vars, const TagName &tag=Moose::SOLUTION_TAG)
Array< Real > _seed
Derivative seed of each component for AD.
VariableValueTempl(const std::vector< MooseVariableFieldBase *> &vars, const TagName &tag=Moose::SOLUTION_TAG, bool dof=false)
KOKKOS_FUNCTION auto operator()(Datum &datum, unsigned int idx, unsigned int comp=0) const
Get the current variable value.
Variable _var
Coupled Kokkos variable.
KOKKOS_FUNCTION void do_derivatives(const bool flag)
Set whether to compute derivatives for automatic differentiation (AD)
KOKKOS_FUNCTION unsigned int sys() const
Get the system number of variable.
OutputTools< Real >::VariablePhiValue VariablePhiValue
KOKKOS_FUNCTION const auto & getGradPhiFace(ContiguousSubdomainID subdomain, unsigned int elem_type, unsigned int fe_type) const
Get the gradient of face shape functions of a FE type for an element type and subdomain.
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 const auto & getGradPhi(ContiguousSubdomainID subdomain, unsigned int elem_type, unsigned int fe_type) const
Get the gradient of shape functions of a FE type for an element type and subdomain.
This class provides an interface for common operations on field variables of both FE and FV types wit...
KOKKOS_FUNCTION Real3 operator()(AssemblyDatum &datum, unsigned int i, unsigned int qp) const
Get the gradient of the current shape function.
The Kokkos wrapper classes for MOOSE-like shape function access.
KOKKOS_FUNCTION bool dot() const
Get whether the tag is time derivative.
KOKKOS_FUNCTION const auto & getPhiFace(ContiguousSubdomainID subdomain, unsigned int elem_type, unsigned int fe_type) const
Get the face shape functions of a FE type for an element type and subdomain.
Array< Real > _seed
Derivative seed of each component for AD.
KOKKOS_FUNCTION bool coupled() const
Get whether the variable is coupled.
std::conditional_t< is_ad, ADReal3, Real3 > real3_type
KOKKOS_FUNCTION bool isAlloc() const
Get whether the array was allocated either on host or device.
KOKKOS_FUNCTION unsigned int side() const
Get the side index.
virtual const Number & duDotDu(unsigned int var_num=0) const
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
KOKKOS_FUNCTION unsigned int jfe() const
Get the coupled variable FE type ID.
OutputTools< Real >::VariableTestValue VariableTestValue
VariableGradientTempl< is_ad > & operator=(const VariableGradientTempl< is_ad > &object)
Copy assignment operator.
void create(const std::vector< index_type > &n)
Allocate array on host and device.
KOKKOS_FUNCTION const Assembly & assembly() const
Get the Kokkos assembly.
VariableValueTempl()=default
Default constructor.
The Kokkos wrapper classes for MOOSE-like variable value access.
void copyToDevice()
Copy data from host to device.
KOKKOS_FUNCTION unsigned int components()
Get the number of components.
std::conditional_t< is_ad, ADReal, Real > real_type
KOKKOS_FUNCTION Real operator()(AssemblyDatum &datum, unsigned int i, unsigned int qp) const
Get the current shape function.
KOKKOS_FUNCTION Real3 operator()(AssemblyDatum &datum, unsigned int i, unsigned int qp) const
Get the gradient of the current test function.
The type trait that determines the default behavior of copy constructor and deepCopy() If this type t...
KOKKOS_FUNCTION const Variable & variable() const
Get the Kokkos variable.
OutputTools< Real >::VariablePhiGradient VariablePhiGradient
KOKKOS_FUNCTION ContiguousNodeID node() const
Get the contiguous node ID.
VariableValueTempl(const MooseVariableFieldBase &var, const TagName &tag=Moose::SOLUTION_TAG, bool dof=false)
Constructor.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
VariableValueTempl(Variable var, bool dof=false)
Constructor.
Variable _var
Coupled Kokkos variable.
VariableValueTempl< is_ad > & operator=(const VariableValueTempl< is_ad > &object)
Copy assignment operator.
KOKKOS_FUNCTION bool isNodal() const
Get whether the current datum is on a node.
The Kokkos variable object that carries the coupled variable and tag information. ...
KOKKOS_FUNCTION const ElementInfo & elem() const
Get the element information object.
const MooseVariableFieldBase * mooseVar(unsigned int comp=0)
Get the MOOSE variable of a component.
KOKKOS_FUNCTION unsigned int ife() const
Get the variable FE type ID.
KOKKOS_FUNCTION auto get(Datum &datum, unsigned int idx, unsigned int comp=0, Real seed=0) const
Get the current variable value.
VariableGradientTempl(Variable var)
Constructor.
The Kokkos object that holds thread-private data in the parallel operations of Kokkos kernels...
const TagName SOLUTION_TAG
KOKKOS_FUNCTION const Variable & variable() const
Get the Kokkos variable.
KOKKOS_FUNCTION unsigned int var(unsigned int comp=0) const
Get the variable number of a component.
OutputTools< Real >::VariableTestGradient VariableTestGradient
KOKKOS_FUNCTION const System & system(unsigned int sys) const
Get the Kokkos system.
KOKKOS_FUNCTION dof_id_type qpOffset() const
Get the starting offset into the global quadrature point index.
SystemBase & sys()
Get the system this variable is part of.
KOKKOS_FUNCTION auto operator()(Datum &datum, unsigned int qp, unsigned int comp=0) const
Get the current variable gradient.
KOKKOS_FUNCTION Real operator()(AssemblyDatum &datum, unsigned int i, unsigned int qp) const
Get the current test function.
static constexpr bool value
ContiguousElementID id
Contiguous element ID.
VariableGradientTempl(const MooseVariableFieldBase &var, const TagName &tag=Moose::SOLUTION_TAG)
Constructor.