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

Device-side geometric context for finite volume kernels and boundary conditions. More...

#include <KokkosDatum.h>

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

Public Member Functions

KOKKOS_FUNCTION FVDatum (ContiguousElementID elem, const unsigned int side, const Mesh &mesh)
 Constructor. More...
 
KOKKOS_FUNCTION Real3 faceCentroid () const
 Get the centroid of the current element side. More...
 
KOKKOS_FUNCTION Real3 faceNormal () const
 Get the outward unit normal of the current element side. More...
 
KOKKOS_FUNCTION Real faceDCNMag () const
 Get the distance from the current element centroid to its neighbor centroid. More...
 
KOKKOS_FUNCTION Real faceDCFMag () const
 Get the distance from the current element centroid to the current side centroid. More...
 
KOKKOS_FUNCTION Real faceArea () const
 Get the coordinate-weighted area of the current element side. More...
 
KOKKOS_FUNCTION Real3 elementCentroid () const
 Get the current element centroid. More...
 
KOKKOS_FUNCTION Real elementVolume () const
 Get the coordinate-weighted current element volume. 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

Device-side geometric context for finite volume kernels and boundary conditions.

Definition at line 167 of file KokkosDatum.h.

Constructor & Destructor Documentation

◆ FVDatum()

KOKKOS_FUNCTION Moose::Kokkos::FVDatum::FVDatum ( 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 235 of file KokkosDatum.h.

238  : MeshDatum(elem, side, mesh)
239 {
240 }
KOKKOS_FUNCTION unsigned int side() const
Get the side index.
Definition: KokkosDatum.h:79
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 MeshDatum(ContiguousElementID elem, const unsigned int side, const Mesh &mesh)
Constructor.
Definition: KokkosDatum.h:138

Member Function Documentation

◆ elem()

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

◆ elementCentroid()

KOKKOS_FUNCTION Real3 Moose::Kokkos::FVDatum::elementCentroid ( ) const
inline

Get the current element centroid.

Precondition
The current element is locally owned.
Returns
The element centroid

Definition at line 225 of file KokkosDatum.h.

Referenced by KokkosLinearFVSource::computeRightHandSideContribution().

225 { return _mesh.getElementCentroid(_elem.id); }
KOKKOS_FUNCTION Real3 getElementCentroid(ContiguousElementID elem) const
Get the centroid of a local element.
Definition: KokkosMesh.h:330
const ElementInfo _elem
Current element information object.
Definition: KokkosDatum.h:125
const Mesh & _mesh
Reference to the Kokkos mesh.
Definition: KokkosDatum.h:120
ContiguousElementID id
Contiguous element ID.
Definition: KokkosMesh.h:42

◆ elementVolume()

KOKKOS_FUNCTION Real Moose::Kokkos::FVDatum::elementVolume ( ) const
inline

Get the coordinate-weighted current element volume.

Precondition
The current element is locally owned.
Returns
The element volume including the coordinate transformation factor

Definition at line 232 of file KokkosDatum.h.

Referenced by KokkosLinearFVSource::computeRightHandSideContribution().

232 { return _mesh.getElementVolume(_elem.id); }
KOKKOS_FUNCTION Real getElementVolume(ContiguousElementID elem) const
Get the coordinate-weighted volume of a local element.
Definition: KokkosMesh.h:319
const ElementInfo _elem
Current element information object.
Definition: KokkosDatum.h:125
const Mesh & _mesh
Reference to the Kokkos mesh.
Definition: KokkosDatum.h:120
ContiguousElementID id
Contiguous element ID.
Definition: KokkosMesh.h:42

◆ elemID()

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

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

◆ faceArea()

KOKKOS_FUNCTION Real Moose::Kokkos::FVDatum::faceArea ( ) const
inline

Get the coordinate-weighted area of the current element side.

Precondition
This datum represents a valid side of a locally owned element.
Returns
The side area including the coordinate transformation factor

Definition at line 218 of file KokkosDatum.h.

Referenced by KokkosLinearFVAdvection::computeBoundaryMatrixContribution(), KokkosLinearFVDiffusion::computeBoundaryMatrixContribution(), KokkosLinearFVAdvection::computeBoundaryRightHandSideContribution(), KokkosLinearFVDiffusion::computeBoundaryRightHandSideContribution(), KokkosLinearFVAdvection::computeInternalMatrixContribution(), KokkosLinearFVAdvection::computeInternalNeighborMatrixContribution(), and KokkosLinearFVDiffusion::faceConductance().

218 { return _mesh.getSideArea(_elem.id, _side); }
const unsigned int _side
Current side index.
Definition: KokkosDatum.h:130
KOKKOS_FUNCTION Real getSideArea(ContiguousElementID elem, unsigned int side) const
Get the coordinate-weighted area of an element side.
Definition: KokkosMesh.h:228
const ElementInfo _elem
Current element information object.
Definition: KokkosDatum.h:125
const Mesh & _mesh
Reference to the Kokkos mesh.
Definition: KokkosDatum.h:120
ContiguousElementID id
Contiguous element ID.
Definition: KokkosMesh.h:42

◆ faceCentroid()

KOKKOS_FUNCTION Real3 Moose::Kokkos::FVDatum::faceCentroid ( ) const
inline

Get the centroid of the current element side.

Precondition
This datum represents a valid side of a locally owned element.
Returns
The side centroid

Definition at line 184 of file KokkosDatum.h.

Referenced by KokkosLinearFVFunctorNeumannBC::computeBoundaryNormalGradient(), KokkosLinearFVFunctorDirichletBC::computeBoundaryNormalGradient(), KokkosLinearFVFunctorNeumannBC::computeBoundaryValue(), KokkosLinearFVFunctorDirichletBC::computeBoundaryValue(), and KokkosLinearFVDiffusion::faceDiffusionCoefficient().

184 { return _mesh.getSideCentroid(_elem.id, _side); }
const unsigned int _side
Current side index.
Definition: KokkosDatum.h:130
KOKKOS_FUNCTION Real3 getSideCentroid(ContiguousElementID elem, unsigned int side) const
Get the centroid of an element side.
Definition: KokkosMesh.h:239
const ElementInfo _elem
Current element information object.
Definition: KokkosDatum.h:125
const Mesh & _mesh
Reference to the Kokkos mesh.
Definition: KokkosDatum.h:120
ContiguousElementID id
Contiguous element ID.
Definition: KokkosMesh.h:42

◆ faceDCFMag()

KOKKOS_FUNCTION Real Moose::Kokkos::FVDatum::faceDCFMag ( ) const
inline

Get the distance from the current element centroid to the current side centroid.

Precondition
This datum represents a valid side of a locally owned element.
Returns
The element-centroid to side-centroid distance

Definition at line 208 of file KokkosDatum.h.

Referenced by KokkosLinearFVFunctorDirichletBC::computeBoundaryNormalGradient(), and KokkosLinearFVFunctorNeumannBC::computeBoundaryValue().

209  {
211  }
KOKKOS_FUNCTION Real getElementCentroidToSideCentroidDistance(ContiguousElementID elem, unsigned int side) const
Get the element-centroid to side-centroid distance for an element side.
Definition: KokkosMesh.h:273
const unsigned int _side
Current side index.
Definition: KokkosDatum.h:130
const ElementInfo _elem
Current element information object.
Definition: KokkosDatum.h:125
const Mesh & _mesh
Reference to the Kokkos mesh.
Definition: KokkosDatum.h:120
ContiguousElementID id
Contiguous element ID.
Definition: KokkosMesh.h:42

◆ faceDCNMag()

KOKKOS_FUNCTION Real Moose::Kokkos::FVDatum::faceDCNMag ( ) const
inline

Get the distance from the current element centroid to its neighbor centroid.

Precondition
This datum represents a side of a locally owned element with a neighbor.
Returns
The element-centroid to neighbor-centroid distance

Definition at line 198 of file KokkosDatum.h.

Referenced by KokkosLinearFVDiffusion::faceConductance().

199  {
201  }
const unsigned int _side
Current side index.
Definition: KokkosDatum.h:130
const ElementInfo _elem
Current element information object.
Definition: KokkosDatum.h:125
KOKKOS_FUNCTION Real getElementCentroidToNeighborCentroidDistance(ContiguousElementID elem, unsigned int side) const
Get the element-centroid to neighbor-centroid distance for an element side with a neighbor...
Definition: KokkosMesh.h:299
const Mesh & _mesh
Reference to the Kokkos mesh.
Definition: KokkosDatum.h:120
ContiguousElementID id
Contiguous element ID.
Definition: KokkosMesh.h:42

◆ faceNormal()

KOKKOS_FUNCTION Real3 Moose::Kokkos::FVDatum::faceNormal ( ) const
inline

Get the outward unit normal of the current element side.

Precondition
This datum represents a valid side of a locally owned element.
Returns
The side normal

Definition at line 191 of file KokkosDatum.h.

Referenced by KokkosLinearFVAdvection::normalFaceFlux().

191 { return _mesh.getSideNormal(_elem.id, _side); }
KOKKOS_FUNCTION Real3 getSideNormal(ContiguousElementID elem, unsigned int side) const
Get the outward unit normal of an element side.
Definition: KokkosMesh.h:250
const unsigned int _side
Current side index.
Definition: KokkosDatum.h:130
const ElementInfo _elem
Current element information object.
Definition: KokkosDatum.h:125
const Mesh & _mesh
Reference to the Kokkos mesh.
Definition: KokkosDatum.h:120
ContiguousElementID id
Contiguous element ID.
Definition: KokkosMesh.h:42

◆ hasNeighbor()

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

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
inlineinherited

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
inlineinherited

Get the Kokkos mesh.

Returns
The Kokkos mesh

Definition at line 40 of file KokkosDatum.h.

Referenced by Moose::Kokkos::MeshDatum::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
inlineinherited

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 Moose::Kokkos::MeshDatum::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
inlineinherited

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 
)
inlinestaticprotectedinherited

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
inlineinherited

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
inlineinherited

◆ subdomain()

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

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
protectedinherited

◆ _mesh

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

◆ _neighbor

const ElementInfo Moose::Kokkos::MeshDatum::_neighbor
protectedinherited

◆ _side

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

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