Loading...
Searching...
No Matches
terra::grid Namespace Reference

Namespaces

namespace  shell
 

Typedefs

using Layout = Kokkos::LayoutRight
 
template<typename ScalarType >
using Grid0DDataScalar = Kokkos::View< ScalarType, Layout >
 
template<typename ScalarType >
using Grid1DDataScalar = Kokkos::View< ScalarType *, Layout >
 
template<typename ScalarType >
using Grid2DDataScalar = Kokkos::View< ScalarType **, Layout >
 
template<typename ScalarType >
using Grid3DDataScalar = Kokkos::View< ScalarType ***, Layout >
 
template<typename ScalarType >
using Grid4DDataScalar = Kokkos::View< ScalarType ****, Layout >
 
template<typename ScalarType >
using Grid5DDataScalar = Kokkos::View< ScalarType *****, Layout >
 
template<typename ScalarType , int VecDim>
using Grid0DDataVec = Kokkos::View< ScalarType[VecDim], Layout >
 
template<typename ScalarType , int VecDim>
using Grid1DDataVec = Kokkos::View< ScalarType *[VecDim], Layout >
 
template<typename ScalarType , int VecDim>
using Grid2DDataVec = Kokkos::View< ScalarType **[VecDim], Layout >
 
template<typename ScalarType , int VecDim>
using Grid3DDataVec = Kokkos::View< ScalarType ***[VecDim], Layout >
 
template<typename ScalarType , int VecDim>
using Grid4DDataVec = Kokkos::View< ScalarType ****[VecDim], Layout >
 
template<typename ScalarType , int Rows, int Cols, int NumMatrices>
using Grid4DDataMatrices = Kokkos::View< dense::Mat< ScalarType, Rows, Cols > ****[NumMatrices], Layout >
 

Enumerations

enum class  NodeOwnershipFlag : uint8_t { NO_FLAG = 0 , OWNED = 1 }
 FlagLike enum class that indicates whether a node is owned on a subdomain. More...
 
enum class  BoundaryPosition : int { P0 = 0 , P1 = 1 , PV = 2 }
 Enum for encoding the boundary type tuples (in BoundaryVertex, BoundaryEdge, BoundaryFace). More...
 
enum class  BoundaryVertex : int {
  V_000 = boundary_position_encoding( BoundaryPosition::P0, BoundaryPosition::P0, BoundaryPosition::P0 ) , V_100 = boundary_position_encoding( BoundaryPosition::P1, BoundaryPosition::P0, BoundaryPosition::P0 ) , V_010 = boundary_position_encoding( BoundaryPosition::P0, BoundaryPosition::P1, BoundaryPosition::P0 ) , V_110 = boundary_position_encoding( BoundaryPosition::P1, BoundaryPosition::P1, BoundaryPosition::P0 ) ,
  V_001 = boundary_position_encoding( BoundaryPosition::P0, BoundaryPosition::P0, BoundaryPosition::P1 ) , V_101 = boundary_position_encoding( BoundaryPosition::P1, BoundaryPosition::P0, BoundaryPosition::P1 ) , V_011 = boundary_position_encoding( BoundaryPosition::P0, BoundaryPosition::P1, BoundaryPosition::P1 ) , V_111 = boundary_position_encoding( BoundaryPosition::P1, BoundaryPosition::P1, BoundaryPosition::P1 )
}
 Enum for identification of the 8 boundary vertices of a subdomain. More...
 
enum class  BoundaryEdge : int {
  E_X00 = boundary_position_encoding( BoundaryPosition::PV, BoundaryPosition::P0, BoundaryPosition::P0 ) , E_X10 = boundary_position_encoding( BoundaryPosition::PV, BoundaryPosition::P1, BoundaryPosition::P0 ) , E_X01 = boundary_position_encoding( BoundaryPosition::PV, BoundaryPosition::P0, BoundaryPosition::P1 ) , E_X11 = boundary_position_encoding( BoundaryPosition::PV, BoundaryPosition::P1, BoundaryPosition::P1 ) ,
  E_0Y0 = boundary_position_encoding( BoundaryPosition::P0, BoundaryPosition::PV, BoundaryPosition::P0 ) , E_1Y0 = boundary_position_encoding( BoundaryPosition::P1, BoundaryPosition::PV, BoundaryPosition::P0 ) , E_0Y1 = boundary_position_encoding( BoundaryPosition::P0, BoundaryPosition::PV, BoundaryPosition::P1 ) , E_1Y1 = boundary_position_encoding( BoundaryPosition::P1, BoundaryPosition::PV, BoundaryPosition::P1 ) ,
  E_00R = boundary_position_encoding( BoundaryPosition::P0, BoundaryPosition::P0, BoundaryPosition::PV ) , E_10R = boundary_position_encoding( BoundaryPosition::P1, BoundaryPosition::P0, BoundaryPosition::PV ) , E_01R = boundary_position_encoding( BoundaryPosition::P0, BoundaryPosition::P1, BoundaryPosition::PV ) , E_11R = boundary_position_encoding( BoundaryPosition::P1, BoundaryPosition::P1, BoundaryPosition::PV )
}
 Enum for identification of the 12 boundary edges of a subdomain. More...
 
enum class  BoundaryFace : int {
  F_XY0 = boundary_position_encoding( BoundaryPosition::PV, BoundaryPosition::PV, BoundaryPosition::P0 ) , F_XY1 = boundary_position_encoding( BoundaryPosition::PV, BoundaryPosition::PV, BoundaryPosition::P1 ) , F_X0R = boundary_position_encoding( BoundaryPosition::PV, BoundaryPosition::P0, BoundaryPosition::PV ) , F_X1R = boundary_position_encoding( BoundaryPosition::PV, BoundaryPosition::P1, BoundaryPosition::PV ) ,
  F_0YR = boundary_position_encoding( BoundaryPosition::P0, BoundaryPosition::PV, BoundaryPosition::PV ) , F_1YR = boundary_position_encoding( BoundaryPosition::P1, BoundaryPosition::PV, BoundaryPosition::PV )
}
 Enum for identification of the 6 boundary faces of a subdomain. More...
 
enum class  BoundaryDirection : int { FORWARD = 0 , BACKWARD }
 Enum for the iteration direction at a boundary. More...
 

Functions

Grid4DDataScalar< NodeOwnershipFlagsetup_node_ownership_mask_data (const shell::DistributedDomain &domain)
 Set up mask data for a distributed shell domain. The mask encodes ownership information for each grid node.
 
template<typename GridDataType >
constexpr int grid_data_vec_dim ()
 
constexpr int boundary_position_encoding (const BoundaryPosition x, const BoundaryPosition y, const BoundaryPosition r)
 
template<typename BoundaryType >
constexpr BoundaryPosition boundary_position_from_boundary_type_x (const BoundaryType &boundary_type)
 
template<typename BoundaryType >
constexpr BoundaryPosition boundary_position_from_boundary_type_y (const BoundaryType &boundary_type)
 
template<typename BoundaryType >
constexpr BoundaryPosition boundary_position_from_boundary_type_r (const BoundaryType &boundary_type)
 
constexpr bool is_edge_boundary_radial (const BoundaryEdge id)
 
constexpr bool is_face_boundary_normal_to_radial_direction (const BoundaryFace id)
 
constexpr BoundaryVertex other_side_r (BoundaryVertex boundary_vertex)
 
std::string to_string (BoundaryVertex v)
 
std::string to_string (BoundaryEdge e)
 
std::string to_string (BoundaryFace f)
 
std::ostream & operator<< (std::ostream &os, BoundaryVertex v)
 
std::ostream & operator<< (std::ostream &os, BoundaryEdge e)
 
std::ostream & operator<< (std::ostream &os, BoundaryFace f)
 

Variables

constexpr std::array all_boundary_vertices
 
constexpr std::array all_boundary_edges
 
constexpr std::array all_boundary_faces
 

Typedef Documentation

◆ Grid0DDataScalar

template<typename ScalarType >
using terra::grid::Grid0DDataScalar = typedef Kokkos::View< ScalarType, Layout >

◆ Grid0DDataVec

template<typename ScalarType , int VecDim>
using terra::grid::Grid0DDataVec = typedef Kokkos::View< ScalarType[VecDim], Layout >

◆ Grid1DDataScalar

template<typename ScalarType >
using terra::grid::Grid1DDataScalar = typedef Kokkos::View< ScalarType*, Layout >

◆ Grid1DDataVec

template<typename ScalarType , int VecDim>
using terra::grid::Grid1DDataVec = typedef Kokkos::View< ScalarType* [VecDim], Layout >

◆ Grid2DDataScalar

template<typename ScalarType >
using terra::grid::Grid2DDataScalar = typedef Kokkos::View< ScalarType**, Layout >

◆ Grid2DDataVec

template<typename ScalarType , int VecDim>
using terra::grid::Grid2DDataVec = typedef Kokkos::View< ScalarType** [VecDim], Layout >

◆ Grid3DDataScalar

template<typename ScalarType >
using terra::grid::Grid3DDataScalar = typedef Kokkos::View< ScalarType***, Layout >

◆ Grid3DDataVec

template<typename ScalarType , int VecDim>
using terra::grid::Grid3DDataVec = typedef Kokkos::View< ScalarType*** [VecDim], Layout >

◆ Grid4DDataMatrices

template<typename ScalarType , int Rows, int Cols, int NumMatrices>
using terra::grid::Grid4DDataMatrices = typedef Kokkos::View< dense::Mat< ScalarType, Rows, Cols >****[NumMatrices], Layout >

◆ Grid4DDataScalar

template<typename ScalarType >
using terra::grid::Grid4DDataScalar = typedef Kokkos::View< ScalarType****, Layout >

◆ Grid4DDataVec

template<typename ScalarType , int VecDim>
using terra::grid::Grid4DDataVec = typedef Kokkos::View< ScalarType**** [VecDim], Layout >

◆ Grid5DDataScalar

template<typename ScalarType >
using terra::grid::Grid5DDataScalar = typedef Kokkos::View< ScalarType*****, Layout >

◆ Layout

using terra::grid::Layout = typedef Kokkos::LayoutRight

Enumeration Type Documentation

◆ BoundaryDirection

enum class terra::grid::BoundaryDirection : int
strong

Enum for the iteration direction at a boundary.

Enumerator
FORWARD 
BACKWARD 

◆ BoundaryEdge

enum class terra::grid::BoundaryEdge : int
strong

Enum for identification of the 12 boundary edges of a subdomain.

=> x = size - 1,
y = variable,
r = 0
Enumerator
E_X00 
E_X10 
E_X01 
E_X11 
E_0Y0 
E_1Y0 
E_0Y1 
E_1Y1 
E_00R 
E_10R 
E_01R 
E_11R 

◆ BoundaryFace

enum class terra::grid::BoundaryFace : int
strong

Enum for identification of the 6 boundary faces of a subdomain.

=> x = variable,
y = size - 1,
r = variable
Enumerator
F_XY0 
F_XY1 
F_X0R 
F_X1R 
F_0YR 
F_1YR 

◆ BoundaryPosition

enum class terra::grid::BoundaryPosition : int
strong

Enum for encoding the boundary type tuples (in BoundaryVertex, BoundaryEdge, BoundaryFace).

Enumerator
P0 

start (== 0)

P1 

end (== size - 1)

PV 

variable

◆ BoundaryVertex

enum class terra::grid::BoundaryVertex : int
strong

Enum for identification of the 8 boundary vertices of a subdomain.

=> x = 0,
y = size - 1,
r = size - 1
Enumerator
V_000 
V_100 
V_010 
V_110 
V_001 
V_101 
V_011 
V_111 

◆ NodeOwnershipFlag

enum class terra::grid::NodeOwnershipFlag : uint8_t
strong

FlagLike enum class that indicates whether a node is owned on a subdomain.

Each node of the grid is either owned or not owned. Nodes that are duplicated due to the domain partitioning into subdomains must somehow be treated properly in kernels like dot products etc. Values at duplicate nodes typically must not be added twice. This enum shall mark exactly one node of each set of duplicated nodes (and all the non-duplicated nodes in the subdomain interior) as owned.

Enumerator
NO_FLAG 
OWNED 

Function Documentation

◆ boundary_position_encoding()

constexpr int terra::grid::boundary_position_encoding ( const BoundaryPosition  x,
const BoundaryPosition  y,
const BoundaryPosition  r 
)
constexpr

◆ boundary_position_from_boundary_type_r()

template<typename BoundaryType >
constexpr BoundaryPosition terra::grid::boundary_position_from_boundary_type_r ( const BoundaryType &  boundary_type)
constexpr

◆ boundary_position_from_boundary_type_x()

template<typename BoundaryType >
constexpr BoundaryPosition terra::grid::boundary_position_from_boundary_type_x ( const BoundaryType &  boundary_type)
constexpr

◆ boundary_position_from_boundary_type_y()

template<typename BoundaryType >
constexpr BoundaryPosition terra::grid::boundary_position_from_boundary_type_y ( const BoundaryType &  boundary_type)
constexpr

◆ grid_data_vec_dim()

template<typename GridDataType >
constexpr int terra::grid::grid_data_vec_dim ( )
constexpr

◆ is_edge_boundary_radial()

constexpr bool terra::grid::is_edge_boundary_radial ( const BoundaryEdge  id)
constexpr

◆ is_face_boundary_normal_to_radial_direction()

constexpr bool terra::grid::is_face_boundary_normal_to_radial_direction ( const BoundaryFace  id)
constexpr

◆ operator<<() [1/3]

std::ostream & terra::grid::operator<< ( std::ostream &  os,
BoundaryEdge  e 
)
inline

◆ operator<<() [2/3]

std::ostream & terra::grid::operator<< ( std::ostream &  os,
BoundaryFace  f 
)
inline

◆ operator<<() [3/3]

std::ostream & terra::grid::operator<< ( std::ostream &  os,
BoundaryVertex  v 
)
inline

◆ other_side_r()

constexpr BoundaryVertex terra::grid::other_side_r ( BoundaryVertex  boundary_vertex)
constexpr

◆ setup_node_ownership_mask_data()

Grid4DDataScalar< NodeOwnershipFlag > terra::grid::setup_node_ownership_mask_data ( const shell::DistributedDomain domain)
inline

Set up mask data for a distributed shell domain. The mask encodes ownership information for each grid node.

Parameters
domainDistributed shell domain.
Returns
Mask data grid.

◆ to_string() [1/3]

std::string terra::grid::to_string ( BoundaryEdge  e)
inline

◆ to_string() [2/3]

std::string terra::grid::to_string ( BoundaryFace  f)
inline

◆ to_string() [3/3]

std::string terra::grid::to_string ( BoundaryVertex  v)
inline

Variable Documentation

◆ all_boundary_edges

constexpr std::array terra::grid::all_boundary_edges
constexpr
Initial value:
= {
BoundaryEdge::E_X00,
BoundaryEdge::E_X10,
BoundaryEdge::E_X01,
BoundaryEdge::E_X11,
BoundaryEdge::E_0Y0,
BoundaryEdge::E_1Y0,
BoundaryEdge::E_0Y1,
BoundaryEdge::E_1Y1,
BoundaryEdge::E_00R,
BoundaryEdge::E_10R,
BoundaryEdge::E_01R,
BoundaryEdge::E_11R,
}

◆ all_boundary_faces

constexpr std::array terra::grid::all_boundary_faces
constexpr
Initial value:
= {
BoundaryFace::F_XY0,
BoundaryFace::F_XY1,
BoundaryFace::F_X0R,
BoundaryFace::F_X1R,
BoundaryFace::F_0YR,
BoundaryFace::F_1YR,
}

◆ all_boundary_vertices

constexpr std::array terra::grid::all_boundary_vertices
constexpr
Initial value:
= {
BoundaryVertex::V_000,
BoundaryVertex::V_100,
BoundaryVertex::V_010,
BoundaryVertex::V_110,
BoundaryVertex::V_001,
BoundaryVertex::V_101,
BoundaryVertex::V_011,
BoundaryVertex::V_111 }