A basic, axis-aligned, logically-rectangular mesh. More...
#include <direct_product_mesh.h>
Public Member Functions | |
Direct_Product_Mesh ()=delete | |
Default constructor (disabled) More... | |
Direct_Product_Mesh (const std::array< std::vector< double >, D > &axis_points_in, const Wonton::Executor_type *executor=nullptr, const int num_ghost_layers=0, const int dpart=D) | |
Constructor to create a Direct_Product_Mesh. More... | |
Direct_Product_Mesh & | operator= (const Direct_Product_Mesh< D, CoordSys > &)=delete |
Assignment operator (disabled). More... | |
int | space_dimension () const |
Get the dimensionality of the mesh. More... | |
bool | distributed () const |
Is the mesh distributed. More... | |
int | num_axis_points (const int dim, const Entity_type etype=Entity_type::ALL) const |
Get the number of axis points (cell boundary coordinates) along a specified axis. More... | |
int | num_ghost_layers () const |
Number of ghost layers on any end. More... | |
Entity_type | axis_point_type (const int dim, const int pointid) const |
Entity type of axis point. More... | |
GID_t | point_global_index (const int dim, const int pointid) const |
Global index of point along a specified axis. More... | |
int | num_axis_cells (const int dim, const Entity_type etype=Entity_type::ALL) const |
Get the number of cell along a specified axis. More... | |
double | get_axis_point (const int dim, const int pointid) const |
Get the specified axis point (coordinate value of cell corner) More... | |
bool | point_on_external_boundary (const int dim, const int pointid) const |
is point on external (global) boundary along given axis More... | |
void | get_global_coord_bounds (const int dim, double *lo, double *hi) const |
get global coordinate bounds along axis More... | |
void | get_local_coord_bounds (const int dim, double *lo, double *hi) const |
coordinate bounds of OWNED cells in local domain (ghost layers EXCLUDED) More... | |
Detailed Description
template<int D, class CoordSys = Wonton::DefaultCoordSys>
class Wonton::Direct_Product_Mesh< D, CoordSys >
A basic, axis-aligned, logically-rectangular mesh.
A Direct_Product_Mesh is a basic, serial, N-dimensional, axis-aliged, logically-rectangular mesh. It is called a direct product mesh because it is the direct product of independent discretizations along each axis.
The discretizations need not be uniform – that is, the cell sizes can vary across the mesh. However, they are static. Once set, they will not change.
Storage of the mesh is based on cell boundary coordinates, aka axis points.
This is meant to be an example of a simple structured mesh implementation that can be used by a wrapper class (see direct_product_mesh_wrapper.h) that implements the interface needed by Portage. All getters in this class are per axis.
The scheme for labeling cells as PARALLEL_OWNED or PARALLEL_GHOST is simple - each rank has a contiguous set of owned cells bounded by ghost cells on either side in each direction. There may be 0 to N ghost layers on each side (lower and upper) in each direction
LABELING CONVENTIONS: The scheme for labeling points as PARALLEL_OWNED or PARALLEL_GHOST on a parallel partition is PER AXIS coordinate. That means when considering a node as a whole, the parallel status of each of its coordinates must be taken into consideration - if it is PARALLEL_GHOST in any one direction, it is a PARALLEL_GHOST. The scheme is as follows:
- The outer most points of the ghost layer are PARALLEL_GHOST
- Any point in the "interior" of the partition in that axis is PARALLEL_OWNED (i.e., if all cells connected to it are PARALLEL_OWNED)
- The high boundary of owned cells of a partition (i.e. the axis point with a PARALLEL_OWNED cell before it and a PARALLEL_GHOST after it) is PARALLEL_OWNED
- The low boundary of owned cells of a partition (i.e. the axis point with a PARALLEL_GHOST cell before it and a PARALLEL_OWNED cell after it) is PARALLEL_GHOST unless it forms the low boundary of the global domain in which case it is PARALLEL_OWNED
The labeling scheme for nodes and cells is shown in the figure below (g is ghost and o is owned) for 1 layer of ghosts.
lower upper lower upper lower upper GLOBAL partition partition partition partition GLOBAL boundary boundary boundary boundary boundary boundary | | | | | |
axis pts g o o o o g g g o o o g g g o o o g +—+—+—+—+—+ +—+—+—+—+—+ +—+—+—+—+—+ cells g o o o g g o o o g g o o o g
Indexing conventions: NG = num_ghost_layers N = Number of global points in the domain (exclude ghost points we created) Local index = index of points along an axis in the current partition
0. Both points and cells have one index per axis
- The local index for the lowest PARALLEL_OWNED POINT is 0
- The local indices for the PARALLEL_GHOST POINTS before point 0 are -1, -2, ..., -NG
- The local index for the lowest PARALLEL_OWNED CELL is 0
- The local indices for the PARALLEL_GHOST CELLS before cell 0 are -1, -2, ..., -NG
- The global index for the first globally owned POINT is 0
- The global index for the last globallly owned POINT is N (where N is the total number of global points in the input)
- The global indices for the ghost points before the first owned point are -1, -2, ..., -NG for the ghost points after the last owned point are N, N+1, ..., N+NG-1
- We don't bother with global cell indices along each axis (not needed so far)
Constructor & Destructor Documentation
◆ Direct_Product_Mesh() [1/2]
|
delete |
Default constructor (disabled)
◆ Direct_Product_Mesh() [2/2]
Wonton::Direct_Product_Mesh< D, CoordSys >::Direct_Product_Mesh | ( | const std::array< std::vector< double >, D > & | axis_points_in, |
const Wonton::Executor_type * | executor = nullptr , |
||
const int | num_ghost_layers = 0 , |
||
const int | dpart = D |
||
) |
Constructor to create a Direct_Product_Mesh.
- Parameters
-
[in] axis_points Global cell boundary coords along each axis. [in] executor Pointer to serial or parallel executor [in] num_ghost_layers Number of ghost layers requested in parallel [in] dpart Number of directions to partition in parallel
Specify the axis point coordinates that delineate the cells of the mesh along each axis.
Member Function Documentation
◆ axis_point_type()
Entity_type Wonton::Direct_Product_Mesh< D, CoordSys >::axis_point_type | ( | const int | dim, |
const int | pointid | ||
) | const |
Entity type of axis point.
- Parameters
-
[in] dim The axis to query [in] pointid The point to query
- Returns
- Wonton entity type of point (along this axis)
◆ distributed()
bool Wonton::Direct_Product_Mesh< D, CoordSys >::distributed | ( | ) | const |
Is the mesh distributed.
◆ get_axis_point()
double Wonton::Direct_Product_Mesh< D, CoordSys >::get_axis_point | ( | const int | dim, |
const int | pointid | ||
) | const |
Get the specified axis point (coordinate value of cell corner)
- Parameters
-
[in] dim The axis to query. [in] pointid The point to query (pointid of left ghost along axis is -1, of first owned point is 0 and of right ghost is n where n is the number of owned points along the axis
- Returns
- coordinate value of point along axis. If the point is a ghost but does not exist (e.g pointid=-1 on the left boundary), it will throw an exception
◆ get_global_coord_bounds()
void Wonton::Direct_Product_Mesh< D, CoordSys >::get_global_coord_bounds | ( | const int | dim, |
double * | lo, | ||
double * | hi | ||
) | const |
get global coordinate bounds along axis
- Parameters
-
[in] dim axis along which to get bounds [out] lo lower coordinate bound along axis [out] hi upper coordinate bound along axis
◆ get_local_coord_bounds()
void Wonton::Direct_Product_Mesh< D, CoordSys >::get_local_coord_bounds | ( | const int | dim, |
double * | lo, | ||
double * | hi | ||
) | const |
coordinate bounds of OWNED cells in local domain (ghost layers EXCLUDED)
- Parameters
-
[in] dim axis along which to get bounds [out] lo lower coordinate bound along axis [out] hi upper coordinate bound along axis
◆ num_axis_cells()
int Wonton::Direct_Product_Mesh< D, CoordSys >::num_axis_cells | ( | const int | dim, |
const Entity_type | etype = Entity_type::ALL |
||
) | const |
Get the number of cell along a specified axis.
- Parameters
-
[in] dim The axis to query. [in] etype The type of cells to count (See Wonton::Entity_type)
- Returns
- The number of cells along specified axis
◆ num_axis_points()
int Wonton::Direct_Product_Mesh< D, CoordSys >::num_axis_points | ( | const int | dim, |
const Entity_type | etype = Entity_type::ALL |
||
) | const |
Get the number of axis points (cell boundary coordinates) along a specified axis.
- Parameters
-
[in] dim The axis to query. [in] etype The type of points to count (See Wonton::Entity_type)
- Returns
- The number of points along specified axis
◆ num_ghost_layers()
int Wonton::Direct_Product_Mesh< D, CoordSys >::num_ghost_layers | ( | ) | const |
Number of ghost layers on any end.
- Returns
- Number of ghost cell layers
Note that if this returns a value of 2, it means there are 2 ghost cells on each end of the mesh in that direction for a total of 4.
◆ operator=()
|
delete |
Assignment operator (disabled).
◆ point_global_index()
GID_t Wonton::Direct_Product_Mesh< D, CoordSys >::point_global_index | ( | const int | dim, |
const int | pointid | ||
) | const |
Global index of point along a specified axis.
- Parameters
-
[in] dim The axis to query. [in] pointid The point to query (pointid of left ghost along axis is -1)
- Returns
- global index of point along axis
◆ point_on_external_boundary()
bool Wonton::Direct_Product_Mesh< D, CoordSys >::point_on_external_boundary | ( | const int | dim, |
const int | pointid | ||
) | const |
is point on external (global) boundary along given axis
Both the owned points on the global boundary AND their boundary ghost counterparts will return true in this call
◆ space_dimension()
int Wonton::Direct_Product_Mesh< D, CoordSys >::space_dimension | ( | ) | const |
Get the dimensionality of the mesh.
The documentation for this class was generated from the following file:
- /home/wonton/wonton/wonton/mesh/direct_product/direct_product_mesh.h