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

Generic datum class containing geometric information related to the mesh. More...

#include <KokkosDatum.h>

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

Public Member Functions

KOKKOS_FUNCTION MeshDatum (ContiguousElementID elem, const unsigned int side, const Mesh &mesh)
 Constructor. More...
 
KOKKOS_FUNCTION const Meshmesh () const
 Get the Kokkos mesh. More...
 
KOKKOS_FUNCTION const ElementInfoelem () const
 Get the element information object. More...
 
KOKKOS_FUNCTION ContiguousElementID elemID () const
 Get the contiguous element ID. More...
 
KOKKOS_FUNCTION bool hasNeighbor () const
 Get whether the current side has a neighbor. More...
 
KOKKOS_FUNCTION const ElementInfoneighbor () const
 Get the neighbor element information object. More...
 
KOKKOS_FUNCTION ContiguousElementID neighborID () const
 Get the contiguous neighbor element ID. More...
 
KOKKOS_FUNCTION unsigned int side () const
 Get the side index. More...
 
KOKKOS_FUNCTION bool isSide () const
 Get whether the current datum is on a side. More...
 
KOKKOS_FUNCTION ContiguousSubdomainID subdomain () const
 Get the contiguous subdomain ID. More...
 
KOKKOS_FUNCTION ContiguousSubdomainID neighborSubdomain () const
 Get the contiguous neighbor subdomain ID. More...
 

Static Protected Member Functions

static KOKKOS_FUNCTION ElementInfo neighborInfo (ContiguousElementID elem, const unsigned int side, const Mesh &mesh)
 Get the neighbor element information object for an element side. More...
 

Protected Attributes

const Mesh_mesh
 Reference to the Kokkos mesh. More...
 
const ElementInfo _elem
 Current element information object. More...
 
const unsigned int _side = libMesh::invalid_uint
 Current side index. More...
 
const ElementInfo _neighbor
 Current neighbor element information object. More...
 

Detailed Description

Generic datum class containing geometric information related to the mesh.

This is a base class for derived datum classes for both finite volume and finite element system assembly.

Definition at line 24 of file KokkosDatum.h.

Constructor & Destructor Documentation

◆ MeshDatum()

KOKKOS_FUNCTION Moose::Kokkos::MeshDatum::MeshDatum ( ContiguousElementID  elem,
const unsigned int  side,
const Mesh mesh 
)
inline

Constructor.

Parameters
elemThe contiguous element ID
sideThe element side index, or libMesh::invalid_uint for element-only data
meshThe Kokkos mesh

Definition at line 138 of file KokkosDatum.h.

141  : _mesh(mesh),
143  _side(side),
145 {
146 }
static KOKKOS_FUNCTION ElementInfo neighborInfo(ContiguousElementID elem, const unsigned int side, const Mesh &mesh)
Get the neighbor element information object for an element side.
Definition: KokkosDatum.h:155
const ElementInfo _neighbor
Current neighbor element information object.
Definition: KokkosDatum.h:135
KOKKOS_FUNCTION unsigned int side() const
Get the side index.
Definition: KokkosDatum.h:79
static constexpr dof_id_type invalid_id
const unsigned int _side
Current side index.
Definition: KokkosDatum.h:130
KOKKOS_FUNCTION const auto & getElementInfo(ContiguousElementID elem) const
Get the element information object.
Definition: KokkosMesh.h:206
const ElementInfo _elem
Current element information object.
Definition: KokkosDatum.h:125
KOKKOS_FUNCTION const ElementInfo & elem() const
Get the element information object.
Definition: KokkosDatum.h:46
KOKKOS_FUNCTION const Mesh & mesh() const
Get the Kokkos mesh.
Definition: KokkosDatum.h:40
const Mesh & _mesh
Reference to the Kokkos mesh.
Definition: KokkosDatum.h:120
ContiguousElementID id
Contiguous element ID.
Definition: KokkosMesh.h:42

Member Function Documentation

◆ elem()

KOKKOS_FUNCTION const ElementInfo& Moose::Kokkos::MeshDatum::elem ( ) const
inline

◆ elemID()

KOKKOS_FUNCTION ContiguousElementID Moose::Kokkos::MeshDatum::elemID ( ) const
inline

Get the contiguous element ID.

Returns
The contiguous element ID

Definition at line 52 of file KokkosDatum.h.

Referenced by KokkosExtraIDIntegralVectorPostprocessor::execute(), Moose::Kokkos::LinearFVFluxKernel::hasBoundaryData(), and KokkosExtraIDIntegralVectorPostprocessor::reduce().

52 { return _elem.id; }
const ElementInfo _elem
Current element information object.
Definition: KokkosDatum.h:125
ContiguousElementID id
Contiguous element ID.
Definition: KokkosMesh.h:42

◆ hasNeighbor()

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

Get whether the current side has a neighbor.

Returns
Whether the current side has a neighbor

Definition at line 149 of file KokkosDatum.h.

Referenced by Moose::Kokkos::LinearFVFluxKernel::hasFaceNeighbor().

150 {
152 }
const ElementInfo _neighbor
Current neighbor element information object.
Definition: KokkosDatum.h:135
static constexpr dof_id_type invalid_id
ContiguousElementID id
Contiguous element ID.
Definition: KokkosMesh.h:42

◆ isSide()

KOKKOS_FUNCTION bool Moose::Kokkos::MeshDatum::isSide ( ) const
inline

Get whether the current datum is on a side.

Returns
Whether the current datum is on a side

Definition at line 85 of file KokkosDatum.h.

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

85 { return _side != libMesh::invalid_uint; }
const unsigned int invalid_uint
const unsigned int _side
Current side index.
Definition: KokkosDatum.h:130

◆ mesh()

KOKKOS_FUNCTION const Mesh& Moose::Kokkos::MeshDatum::mesh ( ) const
inline

Get the Kokkos mesh.

Returns
The Kokkos mesh

Definition at line 40 of file KokkosDatum.h.

Referenced by neighborInfo().

40 { return _mesh; }
const Mesh & _mesh
Reference to the Kokkos mesh.
Definition: KokkosDatum.h:120

◆ neighbor()

KOKKOS_FUNCTION const ElementInfo& Moose::Kokkos::MeshDatum::neighbor ( ) const
inline

Get the neighbor element information object.

Returns
The neighbor element information object. If there is no neighbor or if this datum is not meant to represent face data, then this will point to a default constructed ElementInfo whose data members represent invalid state (e.g. hold invalid_uint, invalid_id like values)

Definition at line 67 of file KokkosDatum.h.

Referenced by neighborInfo().

67 { return _neighbor; }
const ElementInfo _neighbor
Current neighbor element information object.
Definition: KokkosDatum.h:135

◆ neighborID()

KOKKOS_FUNCTION ContiguousElementID Moose::Kokkos::MeshDatum::neighborID ( ) const
inline

Get the contiguous neighbor element ID.

Returns
The contiguous neighbor element ID or libMesh::DofObject::invalid_id

Definition at line 73 of file KokkosDatum.h.

Referenced by Moose::Kokkos::LinearFVFluxKernel::operator()().

73 { return _neighbor.id; }
const ElementInfo _neighbor
Current neighbor element information object.
Definition: KokkosDatum.h:135
ContiguousElementID id
Contiguous element ID.
Definition: KokkosMesh.h:42

◆ neighborInfo()

KOKKOS_FUNCTION ElementInfo Moose::Kokkos::MeshDatum::neighborInfo ( ContiguousElementID  elem,
const unsigned int  side,
const Mesh mesh 
)
inlinestaticprotected

Get the neighbor element information object for an element side.

Parameters
elemThe contiguous element ID
sideThe side index
meshThe Kokkos mesh
Returns
The neighbor element information object, or a default ElementInfo (a default constructed ElementInfo's data members all represent invalid state) when elem is libMesh::DofObject::invalid_id, side is libMesh::invalid_uint, or the Kokkos mesh has no contiguous neighbor ID for the side. The latter includes exterior boundary sides with no libMesh neighbor and sides whose libMesh neighbor is libMesh::remote_elem. Off-process neighbors present as ghost elements have contiguous IDs and return their ElementInfo.

Definition at line 155 of file KokkosDatum.h.

156 {
158  return {};
159 
160  const auto neighbor = mesh.getNeighbor(elem, side);
162 }
const unsigned int invalid_uint
KOKKOS_FUNCTION unsigned int side() const
Get the side index.
Definition: KokkosDatum.h:79
static constexpr dof_id_type invalid_id
KOKKOS_FUNCTION ContiguousElementID getNeighbor(ContiguousElementID elem, unsigned int side) const
Get the neighbor contiguous element ID.
Definition: KokkosMesh.h:218
KOKKOS_FUNCTION const auto & getElementInfo(ContiguousElementID elem) const
Get the element information object.
Definition: KokkosMesh.h:206
KOKKOS_FUNCTION const ElementInfo & elem() const
Get the element information object.
Definition: KokkosDatum.h:46
KOKKOS_FUNCTION const Mesh & mesh() const
Get the Kokkos mesh.
Definition: KokkosDatum.h:40
KOKKOS_FUNCTION const ElementInfo & neighbor() const
Get the neighbor element information object.
Definition: KokkosDatum.h:67

◆ neighborSubdomain()

KOKKOS_FUNCTION ContiguousSubdomainID Moose::Kokkos::MeshDatum::neighborSubdomain ( ) const
inline

Get the contiguous neighbor subdomain ID.

Returns
The contiguous neighbor subdomain ID

Definition at line 97 of file KokkosDatum.h.

Referenced by Moose::Kokkos::LinearFVFluxKernel::hasFaceNeighbor().

97 { return _neighbor.subdomain; }
const ElementInfo _neighbor
Current neighbor element information object.
Definition: KokkosDatum.h:135
ContiguousSubdomainID subdomain
Contiguous subdomain ID.
Definition: KokkosMesh.h:46

◆ side()

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

◆ subdomain()

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

Get the contiguous subdomain ID.

Returns
The contiguous subdomain ID

Definition at line 91 of file KokkosDatum.h.

Referenced by KokkosExtraIDIntegralVectorPostprocessor::execute(), and KokkosExtraIDIntegralVectorPostprocessor::reduce().

91 { return _elem.subdomain; }
ContiguousSubdomainID subdomain
Contiguous subdomain ID.
Definition: KokkosMesh.h:46
const ElementInfo _elem
Current element information object.
Definition: KokkosDatum.h:125

Member Data Documentation

◆ _elem

const ElementInfo Moose::Kokkos::MeshDatum::_elem
protected

◆ _mesh

const Mesh& Moose::Kokkos::MeshDatum::_mesh
protected

◆ _neighbor

const ElementInfo Moose::Kokkos::MeshDatum::_neighbor
protected

Current neighbor element information object.

Definition at line 135 of file KokkosDatum.h.

Referenced by hasNeighbor(), neighbor(), neighborID(), and neighborSubdomain().

◆ _side

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

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