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

The Kokkos object that holds thread-private data in the parallel operations of Kokkos residual objects. More...

#include <KokkosDatum.h>

Inheritance diagram for Moose::Kokkos::ResidualDatum:
[legend]

Public Member Functions

KOKKOS_FUNCTION ResidualDatum (const ContiguousElementID elem, const unsigned int side, const Assembly &assembly, const Array< System > &systems, const Variable &ivar, const unsigned int jvar, const unsigned int comp=0)
 Constructor for element and side data. More...
 
KOKKOS_FUNCTION ResidualDatum (const ContiguousNodeID node, const Assembly &assembly, const Array< System > &systems, const Variable &ivar, const unsigned int jvar, const unsigned int comp=0)
 Constructor for node data. More...
 
KOKKOS_FUNCTION unsigned int n_dofs () const
 Get the number of local DOFs. More...
 
KOKKOS_FUNCTION unsigned int n_idofs () const
 Get the number of local DOFs. More...
 
KOKKOS_FUNCTION unsigned int n_jdofs () const
 Get the number of local DOFs for the coupled variable. More...
 
KOKKOS_FUNCTION unsigned int var () const
 Get the variable number. More...
 
KOKKOS_FUNCTION unsigned int ivar () const
 Get the variable number. More...
 
KOKKOS_FUNCTION unsigned int jvar () const
 Get the coupled variable number. More...
 
KOKKOS_FUNCTION unsigned int fe () const
 Get the variable FE type ID. More...
 
KOKKOS_FUNCTION unsigned int ife () const
 Get the variable FE type ID. More...
 
KOKKOS_FUNCTION unsigned int jfe () const
 Get the coupled variable FE type ID. More...
 
KOKKOS_FUNCTION const Assemblyassembly () const
 Get the Kokkos assembly. More...
 
KOKKOS_FUNCTION const Systemsystem (unsigned int sys) const
 Get the Kokkos system. More...
 
KOKKOS_FUNCTION const ElementInfoelem () const
 Get the element information object. More...
 
KOKKOS_FUNCTION ContiguousSubdomainID subdomain () const
 Get the contiguous subdomain ID. More...
 
KOKKOS_FUNCTION unsigned int side () const
 Get the side index. More...
 
KOKKOS_FUNCTION ContiguousNodeID node () const
 Get the contiguous node ID. More...
 
KOKKOS_FUNCTION unsigned int n_qps () const
 Get the number of local quadrature points. More...
 
KOKKOS_FUNCTION dof_id_type qpOffset () const
 Get the starting offset into the global quadrature point index. More...
 
KOKKOS_FUNCTION bool hasNeighbor () const
 Get whether the current side has a neighbor. More...
 
KOKKOS_FUNCTION bool isNodal () const
 Get whether the current datum is on a node. More...
 
KOKKOS_FUNCTION const Real33J (const unsigned int qp)
 Get the inverse of Jacobian matrix | dxi/dx deta/dx dzeta/dx | | dxi/dy deta/dy dzeta/dy | | dxi/dz deta/dz dzeta/dz |. More...
 
KOKKOS_FUNCTION Real JxW (const unsigned int qp)
 Get the transformed Jacobian weight. More...
 
KOKKOS_FUNCTION Real3 q_point (const unsigned int qp)
 Get the physical quadrature point coordinate. More...
 
KOKKOS_FUNCTION void reinit ()
 Reset the reinit flag. More...
 

Protected Attributes

const TagID _tag
 Solution tag ID. More...
 
const unsigned int _ivar
 Variable numbers. More...
 
const unsigned int _jvar
 
const unsigned int _ife
 FE type IDs of variables. More...
 
const unsigned int _jfe
 
const unsigned int _n_idofs = 1
 Number of local DOFs. More...
 
const unsigned int _n_jdofs = 1
 
const Assembly_assembly
 Reference of the Kokkos assembly. More...
 
const Array< System > & _systems
 Reference of the Kokkos systems. More...
 
const ElementInfo _elem
 Current element information object. More...
 
const unsigned int _side = libMesh::invalid_uint
 Current side index. More...
 
const ContiguousNodeID _node = libMesh::DofObject::invalid_id
 Current contiguous node ID. More...
 
const ContiguousElementID _neighbor = libMesh::DofObject::invalid_id
 Current contiguous element ID of neighbor. More...
 
const unsigned int _n_qps = 1
 Number of local quadrature points. More...
 
const dof_id_type _qp_offset = libMesh::DofObject::invalid_id
 Starting offset into the global quadrature point index. More...
 

Detailed Description

The Kokkos object that holds thread-private data in the parallel operations of Kokkos residual objects.

Definition at line 245 of file KokkosDatum.h.

Constructor & Destructor Documentation

◆ ResidualDatum() [1/2]

KOKKOS_FUNCTION Moose::Kokkos::ResidualDatum::ResidualDatum ( const ContiguousElementID  elem,
const unsigned int  side,
const Assembly assembly,
const Array< System > &  systems,
const Variable ivar,
const unsigned int  jvar,
const unsigned int  comp = 0 
)
inline

Constructor for element and side data.

Parameters
elemThe contiguous element ID of the current thread
sideThe side index of the current thread
assemblyThe Kokkos assembly
systemsThe Kokkos systems
ivarThe Kokkos variable
jvarThe coupled variable number
compThe variable component

Definition at line 259 of file KokkosDatum.h.

266  : Datum(elem, side, assembly, systems),
267  _tag(ivar.tag()),
268  _ivar(ivar.var(comp)),
269  _jvar(jvar),
270  _ife(systems[ivar.sys(comp)].getFETypeID(_ivar)),
271  _jfe(systems[ivar.sys(comp)].getFETypeID(_jvar)),
274  {
275  }
const unsigned int _n_jdofs
Definition: KokkosDatum.h:363
const unsigned int _ife
FE type IDs of variables.
Definition: KokkosDatum.h:359
const unsigned int _jvar
Definition: KokkosDatum.h:355
const unsigned int _jfe
Definition: KokkosDatum.h:359
const unsigned int _n_idofs
Number of local DOFs.
Definition: KokkosDatum.h:363
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.
const ElementInfo _elem
Current element information object.
Definition: KokkosDatum.h:180
KOKKOS_FUNCTION unsigned int side() const
Get the side index.
Definition: KokkosDatum.h:90
const unsigned int _ivar
Variable numbers.
Definition: KokkosDatum.h:355
unsigned int type
Element type ID.
Definition: KokkosMesh.h:40
KOKKOS_FUNCTION const Assembly & assembly() const
Get the Kokkos assembly.
Definition: KokkosDatum.h:68
const TagID _tag
Solution tag ID.
Definition: KokkosDatum.h:351
KOKKOS_FUNCTION const ElementInfo & elem() const
Get the element information object.
Definition: KokkosDatum.h:80
KOKKOS_FUNCTION Datum(const ContiguousElementID elem, const unsigned int side, const Assembly &assembly, const Array< System > &systems)
Constructor for element and side data.
Definition: KokkosDatum.h:36
KOKKOS_FUNCTION unsigned int jvar() const
Get the coupled variable number.
Definition: KokkosDatum.h:330
KOKKOS_FUNCTION unsigned int ivar() const
Get the variable number.
Definition: KokkosDatum.h:325

◆ ResidualDatum() [2/2]

KOKKOS_FUNCTION Moose::Kokkos::ResidualDatum::ResidualDatum ( const ContiguousNodeID  node,
const Assembly assembly,
const Array< System > &  systems,
const Variable ivar,
const unsigned int  jvar,
const unsigned int  comp = 0 
)
inline

Constructor for node data.

Parameters
elemThe contiguous element ID of the current thread
assemblyThe Kokkos assembly
systemsThe Kokkos systems
ivarThe Kokkos variable
jvarThe coupled variable number
compThe variable component

Definition at line 286 of file KokkosDatum.h.

292  : Datum(node, assembly, systems),
293  _tag(ivar.tag()),
294  _ivar(ivar.var(comp)),
295  _jvar(jvar),
296  _ife(systems[ivar.sys(comp)].getFETypeID(_ivar)),
297  _jfe(systems[ivar.sys(comp)].getFETypeID(_jvar))
298  {
299  }
const unsigned int _ife
FE type IDs of variables.
Definition: KokkosDatum.h:359
const unsigned int _jvar
Definition: KokkosDatum.h:355
const unsigned int _jfe
Definition: KokkosDatum.h:359
const unsigned int _ivar
Variable numbers.
Definition: KokkosDatum.h:355
KOKKOS_FUNCTION const Assembly & assembly() const
Get the Kokkos assembly.
Definition: KokkosDatum.h:68
KOKKOS_FUNCTION ContiguousNodeID node() const
Get the contiguous node ID.
Definition: KokkosDatum.h:95
const TagID _tag
Solution tag ID.
Definition: KokkosDatum.h:351
KOKKOS_FUNCTION Datum(const ContiguousElementID elem, const unsigned int side, const Assembly &assembly, const Array< System > &systems)
Constructor for element and side data.
Definition: KokkosDatum.h:36
KOKKOS_FUNCTION unsigned int jvar() const
Get the coupled variable number.
Definition: KokkosDatum.h:330
KOKKOS_FUNCTION unsigned int ivar() const
Get the variable number.
Definition: KokkosDatum.h:325

Member Function Documentation

◆ assembly()

KOKKOS_FUNCTION const Assembly& Moose::Kokkos::Datum::assembly ( ) const
inlineinherited

Get the Kokkos assembly.

Returns
The Kokkos assembly

Definition at line 68 of file KokkosDatum.h.

Referenced by Moose::Kokkos::VariablePhiValue::operator()(), Moose::Kokkos::VariablePhiGradient::operator()(), Moose::Kokkos::VariableTestValue::operator()(), and Moose::Kokkos::VariableTestGradient::operator()().

68 { return _assembly; }
const Assembly & _assembly
Reference of the Kokkos assembly.
Definition: KokkosDatum.h:172

◆ elem()

KOKKOS_FUNCTION const ElementInfo& Moose::Kokkos::Datum::elem ( ) const
inlineinherited

◆ fe()

KOKKOS_FUNCTION unsigned int Moose::Kokkos::ResidualDatum::fe ( ) const
inline

Get the variable FE type ID.

Returns
The variable FE type ID

Definition at line 335 of file KokkosDatum.h.

335 { return _ife; }
const unsigned int _ife
FE type IDs of variables.
Definition: KokkosDatum.h:359

◆ hasNeighbor()

KOKKOS_FUNCTION bool Moose::Kokkos::Datum::hasNeighbor ( ) const
inlineinherited

Get whether the current side has a neighbor.

Returns
Whether the current side has a neighbor

Definition at line 110 of file KokkosDatum.h.

static const dof_id_type invalid_id
const ContiguousElementID _neighbor
Current contiguous element ID of neighbor.
Definition: KokkosDatum.h:192

◆ ife()

KOKKOS_FUNCTION unsigned int Moose::Kokkos::ResidualDatum::ife ( ) const
inline

Get the variable FE type ID.

Returns
The variable FE type ID

Definition at line 340 of file KokkosDatum.h.

Referenced by Moose::Kokkos::VariableTestValue::operator()(), and Moose::Kokkos::VariableTestGradient::operator()().

340 { return _ife; }
const unsigned int _ife
FE type IDs of variables.
Definition: KokkosDatum.h:359

◆ isNodal()

KOKKOS_FUNCTION bool Moose::Kokkos::Datum::isNodal ( ) const
inlineinherited

Get whether the current datum is on a node.

Returns
Whether the current datum is on a node

Definition at line 115 of file KokkosDatum.h.

Referenced by Moose::Kokkos::Datum::J(), Moose::Kokkos::Datum::JxW(), Moose::Kokkos::VariableValue::operator()(), and Moose::Kokkos::Datum::q_point().

static const dof_id_type invalid_id
const ContiguousNodeID _node
Current contiguous node ID.
Definition: KokkosDatum.h:188

◆ ivar()

KOKKOS_FUNCTION unsigned int Moose::Kokkos::ResidualDatum::ivar ( ) const
inline

Get the variable number.

Returns
The variable number

Definition at line 325 of file KokkosDatum.h.

325 { return _ivar; }
const unsigned int _ivar
Variable numbers.
Definition: KokkosDatum.h:355

◆ J()

KOKKOS_FUNCTION const Real33& Moose::Kokkos::Datum::J ( const unsigned int  qp)
inlineinherited

Get the inverse of Jacobian matrix | dxi/dx deta/dx dzeta/dx | | dxi/dy deta/dy dzeta/dy | | dxi/dz deta/dz dzeta/dz |.

Parameters
qpThe local quadrature point index
Returns
The Jacobian matrix

Definition at line 125 of file KokkosDatum.h.

Referenced by Moose::Kokkos::VariablePhiGradient::operator()(), Moose::Kokkos::VariableTestGradient::operator()(), and Moose::Kokkos::VariableGradient::operator()().

126  {
127  if (!isNodal())
128  reinitTransform(qp);
129  else
131 
132  return _J;
133  }
const Assembly & _assembly
Reference of the Kokkos assembly.
Definition: KokkosDatum.h:172
KOKKOS_INLINE_FUNCTION void identity(const unsigned int dim=3)
Definition: KokkosTypes.h:58
KOKKOS_FUNCTION unsigned int getDimension() const
Get the mesh dimension.
KOKKOS_FUNCTION void reinitTransform(const unsigned int qp)
Compute and cache the physical transformation data.
Definition: KokkosDatum.h:224
KOKKOS_FUNCTION bool isNodal() const
Get whether the current datum is on a node.
Definition: KokkosDatum.h:115
Real33 _J
Cached physical transformation data.
Definition: KokkosDatum.h:217

◆ jfe()

KOKKOS_FUNCTION unsigned int Moose::Kokkos::ResidualDatum::jfe ( ) const
inline

Get the coupled variable FE type ID.

Returns
The variable FE type ID

Definition at line 345 of file KokkosDatum.h.

Referenced by Moose::Kokkos::VariablePhiValue::operator()(), and Moose::Kokkos::VariablePhiGradient::operator()().

345 { return _jfe; }
const unsigned int _jfe
Definition: KokkosDatum.h:359

◆ jvar()

KOKKOS_FUNCTION unsigned int Moose::Kokkos::ResidualDatum::jvar ( ) const
inline

◆ JxW()

KOKKOS_FUNCTION Real Moose::Kokkos::Datum::JxW ( const unsigned int  qp)
inlineinherited

◆ n_dofs()

KOKKOS_FUNCTION unsigned int Moose::Kokkos::ResidualDatum::n_dofs ( ) const
inline

Get the number of local DOFs.

Returns
The number of local DOFs

Definition at line 305 of file KokkosDatum.h.

Referenced by Moose::Kokkos::ResidualObject::computeResidualInternal().

305 { return _n_idofs; }
const unsigned int _n_idofs
Number of local DOFs.
Definition: KokkosDatum.h:363

◆ n_idofs()

KOKKOS_FUNCTION unsigned int Moose::Kokkos::ResidualDatum::n_idofs ( ) const
inline

Get the number of local DOFs.

Returns
The number of local DOFs

Definition at line 310 of file KokkosDatum.h.

Referenced by KokkosTimeDerivative::computeJacobianInternal(), and Moose::Kokkos::ResidualObject::computeJacobianInternal().

310 { return _n_idofs; }
const unsigned int _n_idofs
Number of local DOFs.
Definition: KokkosDatum.h:363

◆ n_jdofs()

KOKKOS_FUNCTION unsigned int Moose::Kokkos::ResidualDatum::n_jdofs ( ) const
inline

◆ n_qps()

KOKKOS_FUNCTION unsigned int Moose::Kokkos::Datum::n_qps ( ) const
inlineinherited

◆ node()

KOKKOS_FUNCTION ContiguousNodeID Moose::Kokkos::Datum::node ( ) const
inlineinherited

◆ q_point()

KOKKOS_FUNCTION Real3 Moose::Kokkos::Datum::q_point ( const unsigned int  qp)
inlineinherited

Get the physical quadrature point coordinate.

Parameters
qpThe local quadrature point index
Returns
The physical quadrature point coordinate

Definition at line 153 of file KokkosDatum.h.

154  {
155  if (!isNodal())
156  reinitTransform(qp);
157  else
159 
160  return _xyz;
161  }
const Assembly & _assembly
Reference of the Kokkos assembly.
Definition: KokkosDatum.h:172
KOKKOS_FUNCTION void reinitTransform(const unsigned int qp)
Compute and cache the physical transformation data.
Definition: KokkosDatum.h:224
KOKKOS_FUNCTION Real3 getNodePoint(ContiguousNodeID node) const
Get the coordinate of a node.
Definition: KokkosMesh.h:215
KOKKOS_FUNCTION const Mesh & kokkosMesh() const
Get the const reference of the Kokkos mesh.
Definition: KokkosMesh.h:360
KOKKOS_FUNCTION bool isNodal() const
Get whether the current datum is on a node.
Definition: KokkosDatum.h:115
const ContiguousNodeID _node
Current contiguous node ID.
Definition: KokkosDatum.h:188

◆ qpOffset()

KOKKOS_FUNCTION dof_id_type Moose::Kokkos::Datum::qpOffset ( ) const
inlineinherited

Get the starting offset into the global quadrature point index.

Returns
The starting offset

Definition at line 105 of file KokkosDatum.h.

Referenced by Moose::Kokkos::VariableValue::operator()(), and Moose::Kokkos::VariableGradient::operator()().

105 { return _qp_offset; }
const dof_id_type _qp_offset
Starting offset into the global quadrature point index.
Definition: KokkosDatum.h:200

◆ reinit()

KOKKOS_FUNCTION void Moose::Kokkos::Datum::reinit ( )
inlineinherited

◆ side()

KOKKOS_FUNCTION unsigned int Moose::Kokkos::Datum::side ( ) const
inlineinherited

◆ subdomain()

KOKKOS_FUNCTION ContiguousSubdomainID Moose::Kokkos::Datum::subdomain ( ) const
inlineinherited

Get the contiguous subdomain ID.

Returns
The contiguous subdomain ID

Definition at line 85 of file KokkosDatum.h.

85 { return _elem.subdomain; }
const ElementInfo _elem
Current element information object.
Definition: KokkosDatum.h:180
ContiguousSubdomainID subdomain
Contiguous subdomain ID.
Definition: KokkosMesh.h:48

◆ system()

KOKKOS_FUNCTION const System& Moose::Kokkos::Datum::system ( unsigned int  sys) const
inlineinherited

Get the Kokkos system.

Parameters
sysThe system number
Returns
The Kokkos system

Definition at line 74 of file KokkosDatum.h.

Referenced by Moose::Kokkos::VariableValue::operator()(), and Moose::Kokkos::VariableGradient::operator()().

74 { return _systems[sys]; }
const Array< System > & _systems
Reference of the Kokkos systems.
Definition: KokkosDatum.h:176

◆ var()

KOKKOS_FUNCTION unsigned int Moose::Kokkos::ResidualDatum::var ( ) const
inline

Get the variable number.

Returns
The variable number

Definition at line 320 of file KokkosDatum.h.

320 { return _ivar; }
const unsigned int _ivar
Variable numbers.
Definition: KokkosDatum.h:355

Member Data Documentation

◆ _assembly

const Assembly& Moose::Kokkos::Datum::_assembly
protectedinherited

◆ _elem

const ElementInfo Moose::Kokkos::Datum::_elem
protectedinherited

Current element information object.

Definition at line 180 of file KokkosDatum.h.

Referenced by Moose::Kokkos::Datum::elem(), Moose::Kokkos::Datum::reinitTransform(), and Moose::Kokkos::Datum::subdomain().

◆ _ife

const unsigned int Moose::Kokkos::ResidualDatum::_ife
protected

FE type IDs of variables.

Definition at line 359 of file KokkosDatum.h.

Referenced by fe(), and ife().

◆ _ivar

const unsigned int Moose::Kokkos::ResidualDatum::_ivar
protected

Variable numbers.

Definition at line 355 of file KokkosDatum.h.

Referenced by ivar(), and var().

◆ _jfe

const unsigned int Moose::Kokkos::ResidualDatum::_jfe
protected

Definition at line 359 of file KokkosDatum.h.

Referenced by jfe().

◆ _jvar

const unsigned int Moose::Kokkos::ResidualDatum::_jvar
protected

Definition at line 355 of file KokkosDatum.h.

Referenced by jvar().

◆ _n_idofs

const unsigned int Moose::Kokkos::ResidualDatum::_n_idofs = 1
protected

Number of local DOFs.

Definition at line 363 of file KokkosDatum.h.

Referenced by n_dofs(), and n_idofs().

◆ _n_jdofs

const unsigned int Moose::Kokkos::ResidualDatum::_n_jdofs = 1
protected

Definition at line 363 of file KokkosDatum.h.

Referenced by n_jdofs().

◆ _n_qps

const unsigned int Moose::Kokkos::Datum::_n_qps = 1
protectedinherited

Number of local quadrature points.

Definition at line 196 of file KokkosDatum.h.

Referenced by Moose::Kokkos::Datum::n_qps().

◆ _neighbor

const ContiguousElementID Moose::Kokkos::Datum::_neighbor = libMesh::DofObject::invalid_id
protectedinherited

Current contiguous element ID of neighbor.

Definition at line 192 of file KokkosDatum.h.

Referenced by Moose::Kokkos::Datum::hasNeighbor().

◆ _node

const ContiguousNodeID Moose::Kokkos::Datum::_node = libMesh::DofObject::invalid_id
protectedinherited

Current contiguous node ID.

Definition at line 188 of file KokkosDatum.h.

Referenced by Moose::Kokkos::Datum::isNodal(), Moose::Kokkos::Datum::node(), and Moose::Kokkos::Datum::q_point().

◆ _qp_offset

const dof_id_type Moose::Kokkos::Datum::_qp_offset = libMesh::DofObject::invalid_id
protectedinherited

Starting offset into the global quadrature point index.

Definition at line 200 of file KokkosDatum.h.

Referenced by Moose::Kokkos::Datum::qpOffset().

◆ _side

const unsigned int Moose::Kokkos::Datum::_side = libMesh::invalid_uint
protectedinherited

Current side index.

Definition at line 184 of file KokkosDatum.h.

Referenced by Moose::Kokkos::Datum::reinitTransform(), and Moose::Kokkos::Datum::side().

◆ _systems

const Array<System>& Moose::Kokkos::Datum::_systems
protectedinherited

Reference of the Kokkos systems.

Definition at line 176 of file KokkosDatum.h.

Referenced by Moose::Kokkos::Datum::system().

◆ _tag

const TagID Moose::Kokkos::ResidualDatum::_tag
protected

Solution tag ID.

Definition at line 351 of file KokkosDatum.h.


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