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. More...
 
KOKKOS_FUNCTION Datum (const ContiguousElementID elem, const Assembly &assembly, const Array< System > &systems)
 Constructor for elemental 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 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 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
 Current side index. More...
 
const ContiguousElementID _neighbor
 Current contiguous element ID of neighbor. More...
 
const unsigned int _n_qps
 Number of local quadrature points. More...
 
const dof_id_type _qp_offset
 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.

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:153
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:165
const unsigned int _n_qps
Number of local quadrature points.
Definition: KokkosDatum.h:173
const ElementInfo _elem
Current element information object.
Definition: KokkosDatum.h:161
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:177
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:169
const Array< System > & _systems
Reference of the Kokkos systems.
Definition: KokkosDatum.h:157
ContiguousElementID id
Contiguous element ID.
Definition: KokkosMesh.h:44

◆ Datum() [2/2]

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

Constructor for elemental data.

Parameters
elemThe contiguous element ID of the current thread
assemblyThe Kokkos assembly
systemsThe Kokkos systems

Definition at line 59 of file KokkosDatum.h.

61  {
62  }
const unsigned int invalid_uint
KOKKOS_FUNCTION const Assembly & assembly() const
Get the Kokkos assembly.
Definition: KokkosDatum.h:68
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.
Definition: KokkosDatum.h:36

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:153

◆ 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 105 of file KokkosDatum.h.

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

◆ 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 115 of file KokkosDatum.h.

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

116  {
117  reinitTransform(qp);
118 
119  return _J;
120  }
KOKKOS_FUNCTION void reinitTransform(const unsigned int qp)
Compute and cache the physical transformation data.
Definition: KokkosDatum.h:201
Real33 _J
Cached physical transformation data.
Definition: KokkosDatum.h:194

◆ 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

◆ 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 137 of file KokkosDatum.h.

138  {
139  reinitTransform(qp);
140 
141  return _xyz;
142  }
KOKKOS_FUNCTION void reinitTransform(const unsigned int qp)
Compute and cache the physical transformation data.
Definition: KokkosDatum.h:201

◆ 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 100 of file KokkosDatum.h.

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

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

◆ 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 201 of file KokkosDatum.h.

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

202 {
203  if (_transform_reinit)
204  return;
205 
207  {
208  _J = _assembly.getJacobian(_elem, qp);
209  _JxW = _assembly.getJxW(_elem, qp);
210  _xyz = _assembly.getQPoint(_elem, qp);
211  }
212  else
214 
215  _transform_reinit = true;
216 }
const unsigned int invalid_uint
const Assembly & _assembly
Reference of the Kokkos assembly.
Definition: KokkosDatum.h:153
const unsigned int _side
Current side index.
Definition: KokkosDatum.h:165
const ElementInfo _elem
Current element information object.
Definition: KokkosDatum.h:161
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:189
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:194
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:161
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:157

Member Data Documentation

◆ _assembly

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

Reference of the Kokkos assembly.

Definition at line 153 of file KokkosDatum.h.

Referenced by assembly(), and reinitTransform().

◆ _elem

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

Current element information object.

Definition at line 161 of file KokkosDatum.h.

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

◆ _J

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

Cached physical transformation data.

Definition at line 194 of file KokkosDatum.h.

Referenced by J(), and reinitTransform().

◆ _JxW

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

Definition at line 195 of file KokkosDatum.h.

Referenced by JxW(), and reinitTransform().

◆ _n_qps

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

Number of local quadrature points.

Definition at line 173 of file KokkosDatum.h.

Referenced by n_qps().

◆ _neighbor

const ContiguousElementID Moose::Kokkos::Datum::_neighbor
protected

Current contiguous element ID of neighbor.

Definition at line 169 of file KokkosDatum.h.

Referenced by hasNeighbor().

◆ _qp_offset

const dof_id_type Moose::Kokkos::Datum::_qp_offset
protected

Starting offset into the global quadrature point index.

Definition at line 177 of file KokkosDatum.h.

Referenced by qpOffset().

◆ _side

const unsigned int Moose::Kokkos::Datum::_side
protected

Current side index.

Definition at line 165 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 157 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 189 of file KokkosDatum.h.

Referenced by reinit(), and reinitTransform().

◆ _xyz

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

Definition at line 196 of file KokkosDatum.h.

Referenced by q_point(), and reinitTransform().


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