https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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.
 
KOKKOS_FUNCTION Real3 faceCentroid () const
 Get the centroid of the current element side.
 
KOKKOS_FUNCTION Real3 faceNormal () const
 Get the outward unit normal of the current element side.
 
KOKKOS_FUNCTION Real faceDCNMag () const
 Get the distance from the current element centroid to its neighbor centroid.
 
KOKKOS_FUNCTION Real faceDCFMag () const
 Get the distance from the current element centroid to the current side centroid.
 
KOKKOS_FUNCTION Real faceArea () const
 Get the coordinate-weighted area of the current element side.
 
KOKKOS_FUNCTION Real3 elementCentroid () const
 Get the current element centroid.
 
KOKKOS_FUNCTION Real elementVolume () const
 Get the coordinate-weighted current element volume.
 
KOKKOS_FUNCTION const Meshmesh () const
 Get the Kokkos mesh.
 
KOKKOS_FUNCTION const ElementInfoelem () const
 Get the element information object.
 
KOKKOS_FUNCTION ContiguousElementID elemID () const
 Get the contiguous element ID.
 
KOKKOS_FUNCTION bool hasNeighbor () const
 Get whether the current side has a neighbor.
 
KOKKOS_FUNCTION const ElementInfoneighbor () const
 Get the neighbor element information object.
 
KOKKOS_FUNCTION ContiguousElementID neighborID () const
 Get the contiguous neighbor element ID.
 
KOKKOS_FUNCTION unsigned int side () const
 Get the side index.
 
KOKKOS_FUNCTION bool isSide () const
 Get whether the current datum is on a side.
 
KOKKOS_FUNCTION ContiguousSubdomainID subdomain () const
 Get the contiguous subdomain ID.
 
KOKKOS_FUNCTION ContiguousSubdomainID neighborSubdomain () const
 Get the contiguous neighbor subdomain ID.
 

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.
 

Protected Attributes

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

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.

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.

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.

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

Referenced by KokkosLinearFVSource::computeRightHandSideContribution().

◆ 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.

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

Referenced by KokkosLinearFVSource::computeRightHandSideContribution().

◆ 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.

52{ return _elem.id; }

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

◆ 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.

218{ return _mesh.getSideArea(_elem.id, _side); }
const unsigned int _side
Current side index.
KOKKOS_FUNCTION Real getSideArea(ContiguousElementID elem, unsigned int side) const
Get the coordinate-weighted area of an element side.
Definition KokkosMesh.h:228

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

◆ 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.

184{ return _mesh.getSideCentroid(_elem.id, _side); }
KOKKOS_FUNCTION Real3 getSideCentroid(ContiguousElementID elem, unsigned int side) const
Get the centroid of an element side.
Definition KokkosMesh.h:239

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

◆ 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.

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

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

◆ 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.

199 {
201 }
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

Referenced by KokkosLinearFVDiffusion::faceConductance().

◆ 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.

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

Referenced by KokkosLinearFVAdvection::normalFaceFlux().

◆ 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.

150{
152}
const ElementInfo _neighbor
Current neighbor element information object.
static constexpr dof_id_type invalid_id

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

◆ 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.

85{ return _side != libMesh::invalid_uint; }
const unsigned int invalid_uint

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

◆ 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.

40{ return _mesh; }

Referenced by Moose::Kokkos::MeshDatum::neighborInfo().

◆ 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.

67{ return _neighbor; }

Referenced by Moose::Kokkos::MeshDatum::neighborInfo().

◆ 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.

73{ return _neighbor.id; }

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

◆ 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}
KOKKOS_FUNCTION const ElementInfo & neighbor() const
Get the neighbor element information object.
Definition KokkosDatum.h:67
KOKKOS_FUNCTION const auto & getElementInfo(ContiguousElementID elem) const
Get the element information object.
Definition KokkosMesh.h:206
KOKKOS_FUNCTION ContiguousElementID getNeighbor(ContiguousElementID elem, unsigned int side) const
Get the neighbor contiguous element ID.
Definition KokkosMesh.h:218

◆ 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.

97{ return _neighbor.subdomain; }
ContiguousSubdomainID subdomain
Contiguous subdomain ID.
Definition KokkosMesh.h:46

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

◆ 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.

91{ return _elem.subdomain; }

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

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: