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

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

#include <KokkosDatum.h>

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

Public Member Functions

KOKKOS_FUNCTION Datum (const ContiguousElementID elem, const unsigned int side, const Assembly &assembly, const Array< System > &systems)
 Constructor for element and side data. More...
 
KOKKOS_FUNCTION Datum (const ContiguousNodeID node, const Assembly &assembly, const Array< System > &systems)
 Constructor for node data. 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 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...
 

Private Member Functions

KOKKOS_FUNCTION void reinitTransform (const unsigned int qp)
 Compute and cache the physical transformation data. More...
 

Private Attributes

bool _transform_reinit = false
 Flag whether the physical transformation data was cached. More...
 
Real33 _J
 Cached physical transformation data. More...
 
Real _JxW
 
Real3 _xyz
 

Detailed Description

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

Definition at line 25 of file KokkosDatum.h.

Constructor & Destructor Documentation

◆ Datum() [1/2]

KOKKOS_FUNCTION Moose::Kokkos::Datum::Datum ( const ContiguousElementID  elem,
const unsigned int  side,
const Assembly assembly,
const Array< System > &  systems 
)
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

Definition at line 36 of file KokkosDatum.h.

41  _systems(systems),
43  _side(side),
50  {
51  }
const unsigned int invalid_uint
const Assembly & _assembly
Reference of the Kokkos assembly.
Definition: KokkosDatum.h:172
KOKKOS_FUNCTION dof_id_type getQpOffset(ElementInfo info) const
Get the starting offset of quadrature points of an element into the global quadrature point index...
const unsigned int _side
Current side index.
Definition: KokkosDatum.h:184
const unsigned int _n_qps
Number of local quadrature points.
Definition: KokkosDatum.h:196
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
KOKKOS_FUNCTION ContiguousElementID getNeighbor(ContiguousElementID elem, unsigned int side) const
Get the neighbor contiguous element ID.
Definition: KokkosMesh.h:154
static const dof_id_type invalid_id
KOKKOS_FUNCTION const Assembly & assembly() const
Get the Kokkos assembly.
Definition: KokkosDatum.h:68
KOKKOS_FUNCTION const auto & getElementInfo(ContiguousElementID elem) const
Get the element information object.
Definition: KokkosMesh.h:144
KOKKOS_FUNCTION dof_id_type getNumFaceQps(ContiguousSubdomainID subdomain) const
Get the total number of facial quadrature points in a subdomain Note: this number does not represent ...
KOKKOS_FUNCTION const Mesh & kokkosMesh() const
Get the const reference of the Kokkos mesh.
Definition: KokkosMesh.h:360
const dof_id_type _qp_offset
Starting offset into the global quadrature point index.
Definition: KokkosDatum.h:200
KOKKOS_FUNCTION dof_id_type getQpFaceOffset(ElementInfo info, unsigned int side) const
Get the starting offset of quadrature points of a side of an element into the global quadrature point...
KOKKOS_FUNCTION const ElementInfo & elem() const
Get the element information object.
Definition: KokkosDatum.h:80
KOKKOS_FUNCTION dof_id_type getNumQps(ContiguousSubdomainID subdomain) const
Get the total number of elemental quadrature points in a subdomain.
const ContiguousElementID _neighbor
Current contiguous element ID of neighbor.
Definition: KokkosDatum.h:192
const Array< System > & _systems
Reference of the Kokkos systems.
Definition: KokkosDatum.h:176
ContiguousElementID id
Contiguous element ID.
Definition: KokkosMesh.h:44

◆ Datum() [2/2]

KOKKOS_FUNCTION Moose::Kokkos::Datum::Datum ( const ContiguousNodeID  node,
const Assembly assembly,
const Array< System > &  systems 
)
inline

Constructor for node data.

Parameters
nodeThe contiguous node ID of the current thread
assemblyThe Kokkos assembly
systemsThe Kokkos systems

Definition at line 59 of file KokkosDatum.h.

60  : _assembly(assembly), _systems(systems), _node(node)
61  {
62  }
const Assembly & _assembly
Reference of the Kokkos assembly.
Definition: KokkosDatum.h:172
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 Array< System > & _systems
Reference of the Kokkos systems.
Definition: KokkosDatum.h:176
const ContiguousNodeID _node
Current contiguous node ID.
Definition: KokkosDatum.h:188

Member Function Documentation

◆ assembly()

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

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
inline

◆ hasNeighbor()

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

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

◆ isNodal()

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

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 J(), JxW(), Moose::Kokkos::VariableValue::operator()(), and q_point().

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

◆ J()

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

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

◆ JxW()

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

◆ n_qps()

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

◆ node()

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

◆ q_point()

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

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
inline

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 ( )
inline

◆ reinitTransform()

KOKKOS_FUNCTION void Moose::Kokkos::Datum::reinitTransform ( const unsigned int  qp)
inlineprivate

Compute and cache the physical transformation data.

Parameters
qpThe local quadrature point index

Definition at line 224 of file KokkosDatum.h.

Referenced by J(), JxW(), and q_point().

225 {
226  if (_transform_reinit)
227  return;
228 
230  {
231  _J = _assembly.getJacobian(_elem, qp);
232  _JxW = _assembly.getJxW(_elem, qp);
233  _xyz = _assembly.getQPoint(_elem, qp);
234  }
235  else
237 
238  _transform_reinit = true;
239 }
const unsigned int invalid_uint
const Assembly & _assembly
Reference of the Kokkos assembly.
Definition: KokkosDatum.h:172
const unsigned int _side
Current side index.
Definition: KokkosDatum.h:184
const ElementInfo _elem
Current element information object.
Definition: KokkosDatum.h:180
KOKKOS_FUNCTION Real getJxW(ElementInfo info, unsigned int qp) const
Get the transformed Jacobian weight of an element quadrature point.
bool _transform_reinit
Flag whether the physical transformation data was cached.
Definition: KokkosDatum.h:212
KOKKOS_FUNCTION Real33 getJacobian(ElementInfo info, unsigned int qp) const
Get the inverse of Jacobian matrix of an element quadrature point.
Real33 _J
Cached physical transformation data.
Definition: KokkosDatum.h:217
KOKKOS_FUNCTION void computePhysicalMap(const ElementInfo info, const unsigned int qp, Real33 *const jacobian, Real *const JxW, Real3 *const q_points) const
Compute physical transformation data for an element.
KOKKOS_FUNCTION Real3 getQPoint(ElementInfo info, unsigned int qp) const
Get the coordinate of an element quadrature point.

◆ side()

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

◆ subdomain()

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

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
inline

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

Member Data Documentation

◆ _assembly

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

Reference of the Kokkos assembly.

Definition at line 172 of file KokkosDatum.h.

Referenced by assembly(), J(), q_point(), and reinitTransform().

◆ _elem

const ElementInfo Moose::Kokkos::Datum::_elem
protected

Current element information object.

Definition at line 180 of file KokkosDatum.h.

Referenced by elem(), reinitTransform(), and subdomain().

◆ _J

Real33 Moose::Kokkos::Datum::_J
private

Cached physical transformation data.

Definition at line 217 of file KokkosDatum.h.

Referenced by J(), and reinitTransform().

◆ _JxW

Real Moose::Kokkos::Datum::_JxW
private

Definition at line 218 of file KokkosDatum.h.

Referenced by JxW(), and reinitTransform().

◆ _n_qps

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

Number of local quadrature points.

Definition at line 196 of file KokkosDatum.h.

Referenced by n_qps().

◆ _neighbor

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

Current contiguous element ID of neighbor.

Definition at line 192 of file KokkosDatum.h.

Referenced by hasNeighbor().

◆ _node

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

Current contiguous node ID.

Definition at line 188 of file KokkosDatum.h.

Referenced by isNodal(), node(), and q_point().

◆ _qp_offset

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

Starting offset into the global quadrature point index.

Definition at line 200 of file KokkosDatum.h.

Referenced by qpOffset().

◆ _side

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

Current side index.

Definition at line 184 of file KokkosDatum.h.

Referenced by reinitTransform(), and side().

◆ _systems

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

Reference of the Kokkos systems.

Definition at line 176 of file KokkosDatum.h.

Referenced by system().

◆ _transform_reinit

bool Moose::Kokkos::Datum::_transform_reinit = false
private

Flag whether the physical transformation data was cached.

Definition at line 212 of file KokkosDatum.h.

Referenced by reinit(), and reinitTransform().

◆ _xyz

Real3 Moose::Kokkos::Datum::_xyz
private

Definition at line 219 of file KokkosDatum.h.

Referenced by q_point(), and reinitTransform().


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