The Kokkos mesh object. More...
#include <KokkosMesh.h>
Classes | |
| struct | MeshMap |
| The wrapper of host maps. More... | |
Public Member Functions | |
| Mesh (MooseMesh &mesh) | |
| Constructor. More... | |
| const MooseMesh & | getMesh () |
| Get the underyling MOOSE mesh. More... | |
| bool | initialized () const |
| Get whether the mesh was initialized. More... | |
| void | update () |
| Update the mesh. More... | |
| void | setNeedsElementGeometry () |
| Mark that element geometry data is needed; initElementGeometry() will be called on the next update() More... | |
| void | setNeedsElementSideGeometry () |
| Mark that element-side geometry data is needed; initElementSideGeometry() will be called on the next update() More... | |
| auto | getNumSubdomains () const |
| Get the number of subdomains. More... | |
| auto | getNumLocalElementTypes () const |
| Get the number of local elements types. More... | |
| const auto & | getElementTypeMap () const |
| Get the element type ID map. More... | |
| dof_id_type | getNumLocalElements () const |
| Get the number of local elements. More... | |
| dof_id_type | getNumLocalAndPossiblyOneNeighborLayerGhostElements () const |
| Get the total number of elements, i.e. More... | |
| auto | getNumSubdomainLocalElements (const SubdomainID subdomain) const |
| Get the number of local elements in a MOOSE subdomain. More... | |
| auto | getNumLocalNodes () const |
| Get the number of local nodes including semi-local nodes. More... | |
| const auto & | getLocalNodes () const |
| Get the list of local nodes including semi-local nodes. More... | |
| ContiguousSubdomainID | getContiguousSubdomainID (const SubdomainID subdomain) const |
| Get the contiguous subdomain ID of a MOOSE subdomain. More... | |
| ContiguousBoundaryID | getContiguousBoundaryID (const BoundaryID boundary) const |
| Get the contiguous boundary ID of a boundary. More... | |
| unsigned int | getElementTypeID (const Elem *elem) const |
| Get the element type ID of an element. More... | |
| ContiguousElementID | getContiguousElementID (const Elem *elem) const |
| Get the contiguous element ID of an element. More... | |
| const auto & | getGhostElemIdMapping () const |
| Get the ghost element ID map (host-side only) More... | |
| auto | getSubdomainContiguousElementIDRange (const SubdomainID subdomain) const |
| Get the range of contiguous element IDs for a subdomain. More... | |
| ContiguousNodeID | getContiguousNodeID (const Node *node) const |
| Get the contiguous node ID of a node. More... | |
| const auto & | getSubdomainContiguousNodeIDs (const SubdomainID subdomain) const |
| Get the list of local contiguous node IDs for a subdomain NOTE: This list excludes semi-local nodes. More... | |
| const auto & | getBoundaryContiguousNodeIDs (const BoundaryID boundary) const |
| Get the list of local contiguous node IDs for a boundary NOTE: This list excludes semi-local nodes. More... | |
| KOKKOS_FUNCTION const auto & | getElementInfo (ContiguousElementID elem) const |
| Get the element information object. More... | |
| KOKKOS_FUNCTION ContiguousElementID | getNeighbor (ContiguousElementID elem, unsigned int side) const |
| Get the neighbor contiguous element ID. More... | |
| KOKKOS_FUNCTION Real | getSideArea (ContiguousElementID elem, unsigned int side) const |
| Get the coordinate-weighted area of an element side. More... | |
| KOKKOS_FUNCTION Real3 | getSideCentroid (ContiguousElementID elem, unsigned int side) const |
| Get the centroid of an element side. More... | |
| KOKKOS_FUNCTION Real3 | getSideNormal (ContiguousElementID elem, unsigned int side) const |
| Get the outward unit normal of an element side. More... | |
| KOKKOS_FUNCTION Real3 | getElementCentroidToSideCentroidVector (ContiguousElementID elem, unsigned int side) const |
| Get the element-centroid to side-centroid vector for an element side. More... | |
| KOKKOS_FUNCTION Real | getElementCentroidToSideCentroidDistance (ContiguousElementID elem, unsigned int side) const |
| Get the element-centroid to side-centroid distance for an element side. More... | |
| KOKKOS_FUNCTION Real3 | getElementCentroidToNeighborCentroidVector (ContiguousElementID elem, unsigned int side) const |
| Get the element-centroid to neighbor-centroid vector for an element side with a neighbor. More... | |
| 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. More... | |
| KOKKOS_FUNCTION BoundaryID | getSideBoundaryID (ContiguousElementID elem, unsigned int side) const |
| KOKKOS_FUNCTION Real | getElementVolume (ContiguousElementID elem) const |
| Get the coordinate-weighted volume of a local element. More... | |
| KOKKOS_FUNCTION Real3 | getElementCentroid (ContiguousElementID elem) const |
| Get the centroid of a local element. More... | |
| void | initElementGeometry () |
| Allocate and populate local element centroids and coordinate-weighted volumes. More... | |
| void | initElementSideGeometry () |
| Allocate and populate cached side geometry: side areas, centroids, normals, element-centroid to side-centroid and element-centroid to neighbor-centroid vectors and their magnitudes, and boundary IDs. More... | |
| KOKKOS_FUNCTION unsigned int | getNumSides (unsigned int elem_type) const |
| Get the number of sides of an element type. More... | |
| KOKKOS_FUNCTION unsigned int | getNumNodes (unsigned int elem_type) const |
| Get the number of nodes of an element type. More... | |
| KOKKOS_FUNCTION unsigned int | getNumNodes (unsigned int elem_type, unsigned int side) const |
| Get the number of nodes on a side of an element type. More... | |
| KOKKOS_FUNCTION dof_id_type | getExtraElementID (ContiguousElementID elem, unsigned int index) const |
| Get the extra element ID of an element. More... | |
| KOKKOS_FUNCTION dof_id_type | getStartingContiguousElementID (ContiguousSubdomainID subdomain) const |
| Get the starting contiguous element ID of a subdomain. More... | |
| KOKKOS_FUNCTION ContiguousNodeID | getContiguousNodeID (ContiguousElementID elem, unsigned int node) const |
| Get the contiguous node ID for an element. More... | |
| KOKKOS_FUNCTION ContiguousNodeID | getContiguousNodeID (ElementInfo info, unsigned int side, unsigned int node) const |
| Get the contiguous node ID for a side. More... | |
| KOKKOS_FUNCTION Real3 | getNodePoint (ContiguousNodeID node) const |
| Get the coordinate of a node. More... | |
| KOKKOS_FUNCTION bool | isBoundaryNode (ContiguousNodeID node, ContiguousBoundaryID boundary) const |
| Get whether a node is on a boundary. More... | |
Private Member Functions | |
| void | initMap () |
| Initialize host maps. More... | |
| void | initElement () |
| Initialize device element data. More... | |
Private Attributes | |
| MooseMesh & | _mesh |
| Reference of the MOOSE mesh. More... | |
| bool | _initialized = false |
| Flag whether the mesh was initialized. More... | |
| std::shared_ptr< MeshMap > | _maps |
| A shared pointer holding all the host maps to avoid deep copy. More... | |
| unsigned int | _elem_id_integer = libMesh::invalid_uint |
| Element integer for Kokkos contiguous element ID. More... | |
| unsigned int | _node_id_integer = libMesh::invalid_uint |
| Node integer for Kokkos contiguous node ID. More... | |
| dof_id_type | _num_local_elems = 0 |
| Number of local elements. More... | |
| dof_id_type | _num_ghost_elems = 0 |
| Number of ghost (off-process neighbor) elements. More... | |
| dof_id_type | _num_local_nodes = 0 |
| Number of local nodes including semi-local nodes. More... | |
| Array< ElementInfo > | _elem_info |
| Element information. More... | |
| Array2D< ContiguousElementID > | _elem_neighbor |
| Neighbor contiguous element IDs of each element. More... | |
| Array< ContiguousElementID > | _starting_elem_id |
| Starting contiguous element ID of each subdomain. More... | |
| Array2D< dof_id_type > | _extra_elem_ids |
| Extra element IDs. More... | |
| Array< unsigned int > | _num_sides |
| Number of sides of each element type. More... | |
| Array< unsigned int > | _num_nodes |
| Number of nodes of each element type. More... | |
| Array< Array< unsigned int > > | _num_side_nodes |
| Number of nodes per side of each element side. More... | |
| Array< Array2D< unsigned int > > | _local_side_node |
| Map from local side node index to local element node index. More... | |
| Array< Real3 > | _points |
| Node coordinates. More... | |
| Array2D< ContiguousNodeID > | _nodes |
| Contiguous node IDs of each element. More... | |
| Array< Array< ContiguousNodeID > > | _boundary_nodes |
| Contiguous node IDs on each boundary. More... | |
| bool | _element_geometry_initialized = false |
| Whether initElementGeometry() has been called and the element geometry cache is populated. More... | |
| bool | _needs_element_geometry = false |
| Whether initElementGeometry() should be called on the next update() More... | |
| bool | _element_side_geometry_initialized = false |
| Whether initElementSideGeometry() has been called and the side geometry cache is populated. More... | |
| bool | _needs_element_side_geometry = false |
| Whether initElementSideGeometry() should be called on the next update() More... | |
| Array< Real > | _elem_volume |
| Cached coordinate-weighted local element volumes indexed by contiguous element ID. More... | |
| Array< Real3 > | _elem_centroid |
| Cached local element centroids indexed by contiguous element ID. More... | |
| Array2D< Real > | _side_area |
| Cached coordinate-weighted side areas indexed by (side, local contiguous element ID) More... | |
| Array2D< Real3 > | _side_centroid |
| Cached side centroids indexed by (side, contiguous element ID) More... | |
| Array2D< Real3 > | _side_normal |
| Cached side normals indexed by (side, contiguous element ID) More... | |
| Array2D< Real3 > | _elem_centroid_to_side_centroid |
| Element-centroid to side-centroid vectors indexed by (side, contiguous element ID) More... | |
| Array2D< Real > | _elem_centroid_to_side_centroid_distance |
| Element-centroid to side-centroid distances indexed by (side, contiguous element ID) More... | |
| Array2D< Real3 > | _elem_centroid_to_neighbor_centroid |
| Element-centroid to neighbor-centroid vectors indexed by (side, contiguous element ID) More... | |
| Array2D< Real > | _elem_centroid_to_neighbor_centroid_distance |
| Element-centroid to neighbor-centroid distances indexed by (side, contiguous element ID) More... | |
| Array2D< BoundaryID > | _side_boundary_id |
| Boundary IDs for each side indexed by (side, contiguous element ID) More... | |
The Kokkos mesh object.
Definition at line 52 of file KokkosMesh.h.
|
inline |
Constructor.
| mesh | The MOOSE mesh |
Definition at line 59 of file KokkosMesh.h.
|
inline |
Get the list of local contiguous node IDs for a boundary NOTE: This list excludes semi-local nodes.
| boundary | The MOOSE boundary ID |
Definition at line 196 of file KokkosMesh.h.
| ContiguousBoundaryID Moose::Kokkos::Mesh::getContiguousBoundaryID | ( | const BoundaryID | boundary | ) | const |
Get the contiguous boundary ID of a boundary.
| boundary | The MOOSE boundary ID |
| ContiguousElementID Moose::Kokkos::Mesh::getContiguousElementID | ( | const Elem * | elem | ) | const |
Get the contiguous element ID of an element.
| elem | The libMesh element |
| ContiguousNodeID Moose::Kokkos::Mesh::getContiguousNodeID | ( | const Node * | node | ) | const |
Get the contiguous node ID of a node.
| node | The libMesh node |
|
inline |
Get the contiguous node ID for an element.
| elem | The contiguous element ID |
| node | The node index |
Definition at line 405 of file KokkosMesh.h.
|
inline |
Get the contiguous node ID for a side.
| elem | The contiguous element ID |
| side | The side index |
| node | The node index |
Definition at line 417 of file KokkosMesh.h.
| ContiguousSubdomainID Moose::Kokkos::Mesh::getContiguousSubdomainID | ( | const SubdomainID | subdomain | ) | const |
Get the contiguous subdomain ID of a MOOSE subdomain.
| subdomain | The MOOSE subdomain ID |
|
inline |
Get the centroid of a local element.
| elem | The local contiguous element ID |
Definition at line 330 of file KokkosMesh.h.
Referenced by Moose::Kokkos::FVDatum::elementCentroid().
|
inline |
Get the element-centroid to neighbor-centroid distance for an element side with a neighbor.
| elem | The contiguous element ID |
| side | The side index |
Definition at line 299 of file KokkosMesh.h.
Referenced by Moose::Kokkos::FVDatum::faceDCNMag().
|
inline |
Get the element-centroid to neighbor-centroid vector for an element side with a neighbor.
| elem | The contiguous element ID |
| side | The side index |
Definition at line 286 of file KokkosMesh.h.
|
inline |
Get the element-centroid to side-centroid distance for an element side.
| elem | The contiguous element ID |
| side | The side index |
Definition at line 273 of file KokkosMesh.h.
Referenced by Moose::Kokkos::FVDatum::faceDCFMag().
|
inline |
Get the element-centroid to side-centroid vector for an element side.
| elem | The contiguous element ID |
| side | The side index |
Definition at line 261 of file KokkosMesh.h.
|
inline |
Get the element information object.
| elem | The contiguous element ID |
Definition at line 206 of file KokkosMesh.h.
Referenced by Moose::Kokkos::MeshDatum::neighborInfo().
| unsigned int Moose::Kokkos::Mesh::getElementTypeID | ( | const Elem * | elem | ) | const |
Get the element type ID of an element.
| elem | The libMesh element |
|
inline |
Get the element type ID map.
Definition at line 104 of file KokkosMesh.h.
|
inline |
Get the coordinate-weighted volume of a local element.
| elem | The local contiguous element ID |
Definition at line 319 of file KokkosMesh.h.
Referenced by Moose::Kokkos::FVDatum::elementVolume().
|
inline |
Get the extra element ID of an element.
| elem | The contiguous element ID |
| index | The extra element ID index |
Definition at line 383 of file KokkosMesh.h.
Referenced by Moose::Kokkos::Datum::extraElemID().
|
inline |
Get the ghost element ID map (host-side only)
Definition at line 163 of file KokkosMesh.h.
|
inline |
Get the list of local nodes including semi-local nodes.
Definition at line 134 of file KokkosMesh.h.
|
inline |
Get the underyling MOOSE mesh.
Definition at line 64 of file KokkosMesh.h.
|
inline |
Get the neighbor contiguous element ID.
| elem | The contiguous element ID |
| side | The side index |
Definition at line 218 of file KokkosMesh.h.
Referenced by Moose::Kokkos::MeshDatum::neighborInfo().
|
inline |
Get the coordinate of a node.
| node | The contiguous node ID |
Definition at line 428 of file KokkosMesh.h.
Referenced by Moose::Kokkos::Assembly::computePhysicalMap(), and Moose::Kokkos::Datum::q_point().
|
inline |
Get the total number of elements, i.e.
the local elements plus the ghost elements
Definition at line 618 of file KokkosMesh.h.
|
inline |
Get the number of local elements.
Definition at line 109 of file KokkosMesh.h.
|
inline |
Get the number of local elements types.
Definition at line 99 of file KokkosMesh.h.
|
inline |
Get the number of local nodes including semi-local nodes.
Definition at line 129 of file KokkosMesh.h.
|
inline |
Get the number of nodes of an element type.
| elem_type | The element type ID |
Definition at line 363 of file KokkosMesh.h.
Referenced by Moose::Kokkos::Assembly::computePhysicalMap().
|
inline |
Get the number of nodes on a side of an element type.
| elem_type | The element type ID |
| side | The side index |
Definition at line 373 of file KokkosMesh.h.
|
inline |
Get the number of sides of an element type.
| elem_type | The element type ID |
Definition at line 354 of file KokkosMesh.h.
|
inline |
Get the number of local elements in a MOOSE subdomain.
| subdomain | The MOOSE subdomain ID |
Definition at line 120 of file KokkosMesh.h.
|
inline |
Get the number of subdomains.
Definition at line 94 of file KokkosMesh.h.
|
inline |
Get the coordinate-weighted area of an element side.
| elem | The local contiguous element ID |
| side | The side index |
Definition at line 228 of file KokkosMesh.h.
Referenced by Moose::Kokkos::FVDatum::faceArea().
|
inline |
Moose::INVALID_BOUNDARY_ID Definition at line 309 of file KokkosMesh.h.
|
inline |
Get the centroid of an element side.
| elem | The contiguous element ID |
| side | The side index |
Definition at line 239 of file KokkosMesh.h.
Referenced by Moose::Kokkos::FVDatum::faceCentroid().
|
inline |
Get the outward unit normal of an element side.
| elem | The contiguous element ID |
| side | The side index |
Definition at line 250 of file KokkosMesh.h.
Referenced by Moose::Kokkos::FVDatum::faceNormal().
|
inline |
Get the starting contiguous element ID of a subdomain.
| subdomain | The contiguous subdomain ID |
Definition at line 395 of file KokkosMesh.h.
|
inline |
Get the range of contiguous element IDs for a subdomain.
| subdomain | The MOOSE subdomain ID |
Definition at line 169 of file KokkosMesh.h.
|
inline |
Get the list of local contiguous node IDs for a subdomain NOTE: This list excludes semi-local nodes.
| subdomain | The MOOSE subdomain ID |
Definition at line 186 of file KokkosMesh.h.
|
private |
Initialize device element data.
| void Moose::Kokkos::Mesh::initElementGeometry | ( | ) |
Allocate and populate local element centroids and coordinate-weighted volumes.
| void Moose::Kokkos::Mesh::initElementSideGeometry | ( | ) |
Allocate and populate cached side geometry: side areas, centroids, normals, element-centroid to side-centroid and element-centroid to neighbor-centroid vectors and their magnitudes, and boundary IDs.
|
inline |
Get whether the mesh was initialized.
Definition at line 68 of file KokkosMesh.h.
Referenced by Moose::Kokkos::MeshHolder::kokkosMesh().
|
private |
Initialize host maps.
|
inline |
Get whether a node is on a boundary.
| node | The contiguous node ID |
| boundary | The contiguous boundary ID |
Definition at line 604 of file KokkosMesh.h.
Referenced by KokkosBoundNodalKernel::skipOnBoundary().
|
inline |
Mark that element geometry data is needed; initElementGeometry() will be called on the next update()
Definition at line 78 of file KokkosMesh.h.
Referenced by setNeedsElementSideGeometry().
|
inline |
Mark that element-side geometry data is needed; initElementSideGeometry() will be called on the next update()
Definition at line 84 of file KokkosMesh.h.
| void Moose::Kokkos::Mesh::update | ( | ) |
Update the mesh.
|
private |
Contiguous node IDs on each boundary.
Definition at line 570 of file KokkosMesh.h.
Referenced by isBoundaryNode().
Cached local element centroids indexed by contiguous element ID.
Definition at line 583 of file KokkosMesh.h.
Referenced by getElementCentroid().
Element-centroid to neighbor-centroid vectors indexed by (side, contiguous element ID)
Definition at line 595 of file KokkosMesh.h.
Referenced by getElementCentroidToNeighborCentroidVector().
Element-centroid to neighbor-centroid distances indexed by (side, contiguous element ID)
Definition at line 597 of file KokkosMesh.h.
Referenced by getElementCentroidToNeighborCentroidDistance().
Element-centroid to side-centroid vectors indexed by (side, contiguous element ID)
Definition at line 591 of file KokkosMesh.h.
Referenced by getElementCentroidToSideCentroidVector().
Element-centroid to side-centroid distances indexed by (side, contiguous element ID)
Definition at line 593 of file KokkosMesh.h.
Referenced by getElementCentroidToSideCentroidDistance().
|
private |
Element integer for Kokkos contiguous element ID.
Definition at line 510 of file KokkosMesh.h.
|
private |
|
private |
Neighbor contiguous element IDs of each element.
Definition at line 534 of file KokkosMesh.h.
Referenced by getNeighbor().
Cached coordinate-weighted local element volumes indexed by contiguous element ID.
Definition at line 581 of file KokkosMesh.h.
Referenced by getElementVolume().
|
private |
Whether initElementGeometry() has been called and the element geometry cache is populated.
Definition at line 573 of file KokkosMesh.h.
Referenced by getElementCentroid(), and getElementVolume().
|
private |
Whether initElementSideGeometry() has been called and the side geometry cache is populated.
Definition at line 577 of file KokkosMesh.h.
Referenced by getElementCentroidToNeighborCentroidDistance(), getElementCentroidToNeighborCentroidVector(), getElementCentroidToSideCentroidDistance(), getElementCentroidToSideCentroidVector(), getSideArea(), getSideBoundaryID(), getSideCentroid(), and getSideNormal().
|
private |
|
private |
Flag whether the mesh was initialized.
Definition at line 455 of file KokkosMesh.h.
Referenced by initialized().
Map from local side node index to local element node index.
Definition at line 558 of file KokkosMesh.h.
Referenced by getContiguousNodeID().
|
private |
A shared pointer holding all the host maps to avoid deep copy.
Definition at line 505 of file KokkosMesh.h.
Referenced by getBoundaryContiguousNodeIDs(), getElementTypeMap(), getGhostElemIdMapping(), getLocalNodes(), getNumLocalElementTypes(), getNumSubdomainLocalElements(), getNumSubdomains(), getSubdomainContiguousElementIDRange(), and getSubdomainContiguousNodeIDs().
|
private |
|
private |
Whether initElementGeometry() should be called on the next update()
Definition at line 575 of file KokkosMesh.h.
Referenced by setNeedsElementGeometry().
|
private |
Whether initElementSideGeometry() should be called on the next update()
Definition at line 579 of file KokkosMesh.h.
Referenced by setNeedsElementSideGeometry().
|
private |
Node integer for Kokkos contiguous node ID.
Definition at line 514 of file KokkosMesh.h.
|
private |
Contiguous node IDs of each element.
Definition at line 566 of file KokkosMesh.h.
Referenced by getContiguousNodeID().
|
private |
Number of ghost (off-process neighbor) elements.
Definition at line 522 of file KokkosMesh.h.
Referenced by getNumLocalAndPossiblyOneNeighborLayerGhostElements().
|
private |
Number of local elements.
Definition at line 518 of file KokkosMesh.h.
Referenced by getNumLocalAndPossiblyOneNeighborLayerGhostElements(), and getNumLocalElements().
|
private |
Number of local nodes including semi-local nodes.
Definition at line 526 of file KokkosMesh.h.
Referenced by getNumLocalNodes().
Number of nodes of each element type.
Definition at line 550 of file KokkosMesh.h.
Referenced by getNumNodes().
Number of nodes per side of each element side.
Definition at line 554 of file KokkosMesh.h.
Referenced by getNumNodes().
Number of sides of each element type.
Definition at line 546 of file KokkosMesh.h.
Referenced by getNumSides().
Cached coordinate-weighted side areas indexed by (side, local contiguous element ID)
Definition at line 585 of file KokkosMesh.h.
Referenced by getSideArea().
|
private |
Boundary IDs for each side indexed by (side, contiguous element ID)
Definition at line 599 of file KokkosMesh.h.
Referenced by getSideBoundaryID().
Cached side centroids indexed by (side, contiguous element ID)
Definition at line 587 of file KokkosMesh.h.
Referenced by getSideCentroid().
Cached side normals indexed by (side, contiguous element ID)
Definition at line 589 of file KokkosMesh.h.
Referenced by getSideNormal().
|
private |
Starting contiguous element ID of each subdomain.
Definition at line 538 of file KokkosMesh.h.
Referenced by getStartingContiguousElementID().
1.8.14