Proto
3.2
|
Single Level Mapped Multiblock Map. More...
#include <Proto_MBLevelBoxData.H>
Public Member Functions | |
MBLevelMap () | |
Trivial Constructor. More... | |
MBLevelMap (const MBDisjointBoxLayout &a_layout, const Array< Point, DIM+1 > &a_ghost, unsigned int a_focalBlock=0) | |
Non-Trivial Constructor. More... | |
MBLevelMap (const MBDisjointBoxLayout &a_layout, Point a_ghost, unsigned int a_focalBlock=0) | |
Non-Trivial Constructor. More... | |
void | define (const MBDisjointBoxLayout &a_layout, const Array< Point, DIM+1 > &a_ghost, unsigned int a_focalBlock=0) |
Define. More... | |
void | define (const MBDisjointBoxLayout &a_layout, Point a_ghost, unsigned int a_focalBlock=0) |
void | initialize () const |
MBLevelBoxData< double, DIM, MEM, PR_NODE > & | map () |
Access Cached Coordinate Values. More... | |
std::shared_ptr< MBLevelBoxData< double, DIM, MEM, PR_NODE > > | mapData () |
const MBLevelBoxData< double, DIM, MEM, PR_NODE > & | map () const |
Access Cached Coordinate Values (Const Overload) More... | |
MBLevelBoxData< double, 1, MEM, PR_CELL > & | jacobian () |
Jacobian Access. More... | |
std::shared_ptr< MBLevelBoxData< double, 1, MEM, PR_CELL > > | jacobianData () |
const MBLevelBoxData< double, 1, MEM, PR_CELL > & | jacobian () const |
Jacobian Access (Const Overload) More... | |
void | apply (BoxData< double, DIM, MEM > &a_X, BoxData< double, 1, MEM > &a_J, unsigned int a_block) const |
Compute Map. More... | |
void | apply (BoxData< double, DIM, MEM > &a_X, BoxData< double, 1, MEM > &a_J, FluxBoxData< double, DIM, MEM > &a_NT, unsigned int a_block) const |
Compute Map (With Metrics) More... | |
void | doApply (BoxData< double, DIM, MEM > &a_X, BoxData< double, 1, MEM > &a_J, unsigned int a_computeBlock, unsigned int a_outBlock) const |
Compute Map With Rotation. More... | |
BoxData< double, DIM, MEM > | cellCentered (const Box &a_box, unsigned int a_computeBlock, unsigned int a_outBlock) const |
Compute Cell Centered Coordinates. More... | |
BoxData< double, DIM, MEM > | cellAveraged (const Box &a_box, unsigned int a_computeBlock, unsigned int a_outBlock) const |
Compute Cell Centered Coordinates. More... | |
Array< double, DIM > | mappedCoords (const Point &point, const BlockIndex &block) const |
Array< double, DIM > | mappedCoords (const Point &point, const BlockIndex &block, const Array< double, DIM > &offset) const |
Array< double, DIM > | apply (const MBDataPoint &a_point) const |
Compute Mapped Coordinates. More... | |
Array< double, DIM > | apply (const MBDataPoint &a_point, const Array< double, DIM > &a_offset) const |
Analytic Map (DataPoint With Offset) More... | |
Array< double, DIM > | cellCentered (const MBDataPoint &a_point) const |
Compute Cell Centered Coordinates. More... | |
Array< double, DIM > | analyticCellCentered (const MBDataPoint &a_point) const |
Compute Cell Centered Coordinates, analytic case. More... | |
Array< double, DIM > | cellAveraged (const MBDataPoint &a_point) const |
Compute Cell Averaged Coordinates. More... | |
const MBDisjointBoxLayout & | layout () const |
Get Layout. More... | |
const Array< double, DIM > | dx (BlockIndex a_block) const |
Get Mapped Grid Spacing. More... | |
MAP & | op (BlockIndex a_block) const |
Get Operator. More... | |
Array< Point, DIM+1 > | ghost () const |
Get Ghost Sizes. More... | |
BoxData< double, DIM, MEM > | X (const Box &a_box, const Array< double, DIM > &a_dx) const |
Get Mapped Coordinate Values. More... | |
MAP & | operator[] (BlockIndex block) |
Point | convertPoint (Point srcPoint, BlockIndex srcBlock, BlockIndex dstBlock) const |
Convert a Point from one block's index space to another by using forward / inverse mapping. More... | |
std::optional< std::pair< MBIndex, Point > > | whichNeighborContains (const MBIndex &localIndex, const Point &localPoint, bool checkLocalInteriorGhostCells=true) const |
Private Attributes | |
Array< Point, DIM+1 > | m_ghost |
unsigned int | m_focalBlock |
Stencil< double > | m_c2c |
std::vector< std::shared_ptr< MAP > > | m_ops |
Map operators. More... | |
std::vector< Array< double, DIM > > | m_dx |
Mapped space grid spacing. More... | |
MBDisjointBoxLayout | m_layout |
bool | m_initialized |
std::shared_ptr< MBLevelBoxData< double, DIM, MEM, PR_NODE > > | m_X |
Cached coodinate values. More... | |
std::shared_ptr< MBLevelBoxData< double, 1, MEM, PR_CELL > > | m_J |
Cached Jacobian values. More... | |
Single Level Mapped Multiblock Map.
This class provides an interface for constructing maps for use in single level mapped multiblock applications.
When a map is constructed, coordinate and Jacobian data are cached for all valid regions of the supplied MBDisjointBoxLayout as well as proscribed ghost regions. However, the map's apply function can be used to compute these quantities on any domain where the associated functions are defined.
USAGE: To use this interface, create a class which inherits from MBLevelMap. The map itself is implemented by defining the one of the virtual "apply" functions (the user may supply either one or both depending on whether or not they need and/or would like to define how the metric tensor is computed). The user may also implement the virtual init function which will be called during construction of the Map. The init function is useful for caching constant data such as operators, stencils, or metrics in order to prevent computing these quantities each time apply is called.
|
inline |
Trivial Constructor.
|
inline |
Non-Trivial Constructor.
|
inline |
Non-Trivial Constructor.
|
inline |
Define.
Delayed construction.
a_layout | A mapped multiblock layout defining the domain |
a_ghost | An array of ghost data sizes. This ghost array is used To define how much ghost data should be allocated for cached arrays of the coordinates and Jacobian. |
a_focalBlock | The "focus" block id associated with this map. Often unused. |
|
inline |
|
inline |
|
inline |
Access Cached Coordinate Values.
Returns an MBLevelBoxData containing the cached coordinate data. The returned data has NODE centering.
|
inline |
References Proto::MBLevelMap< MAP, MEM >::m_X.
|
inline |
Access Cached Coordinate Values (Const Overload)
|
inline |
Jacobian Access.
Returns an MBLevelBoxData containing the cached Jacobian data. The returned data has CELL centering and is assumed to be cell averaged.
Referenced by Proto::MBLevelMap< MAP, MEM >::jacobianData().
|
inline |
|
inline |
Jacobian Access (Const Overload)
|
inline |
Compute Map.
Users should override this function when defining their map if they do not want to explicitly define the metric tensor (NT). The domains of the coordinate and Jacobian quantities are assumed to be defined before they are input to this function. Note that the ghost values used to define the map during construction have absolutely no bearing on the valid domains for this function, so long as the relevant analytic functions are defined.
a_X | Coordinates at nodes [input/output] |
a_J | Cell averaged jacobian [input/output] |
a_index | MBIndex corresponding to the patch where the operator is being applied |
|
inline |
Compute Map (With Metrics)
Users should override this function when defining their map if they want to explicitly define the metric tensor (NT). The domains of the coordinate and Jacobian quantities are assumed to be defined before they are input to this function. Note that the ghost values used to define the map during construction have absolutely no bearing on the valid domains for this function, so long as the relevant analytic functions are defined.
a_X | Coordinates at nodes [input/output] |
a_J | Cell averaged jacobian [input/output] |
a_NT | Face averaged metric terms in each coordinate direction [output] |
a_index | MBIndex corresponding to the patch where the operator is being applied |
|
inline |
Compute Map With Rotation.
Used internally for the case where X and J are defined on domains in a different coordinate system from the block of the map computation (defined by a_index). This function creates a temporary version of X and J with domains in the block associated with a_index, computes X and J, and copies the result with rotation into the outputs.
Not recommended for public use.
|
inline |
Compute Cell Centered Coordinates.
Returns the cell-centered coordinates on a specified range.
a_box | Output range |
a_computeBlock | Block index associated with the coordinates being computed |
a_outBlock | Block index associated with the input range |
|
inline |
Compute Cell Centered Coordinates.
Returns the cell-averaged coordinates on a specified range.
a_box | Output range |
a_computeBlock | Block index associated with the coordinates being computed |
a_outBlock | Block index associated with the input range |
|
inline |
|
inline |
|
inline |
Compute Mapped Coordinates.
Returns coordinates in mapped space of a given data point. The Coordinates are of the cell center of the point plus the offset which is in units of the grid spacing. Analytic Map (DataPoint Cell Center)
|
inline |
Analytic Map (DataPoint With Offset)
|
inline |
Compute Cell Centered Coordinates.
Computes the cell-centered coodinate values at a specified MBDataPoint
|
inline |
Compute Cell Centered Coordinates, analytic case.
Computes the cell-centered coodinate valuesas a specified analytic function,
auto computeBlock = a_point.srcBlock(); Array<double,DIM> X; Array<double,DIM> thisDx = this->dx(a_point.srcBlock()); Point pt = a_point.point(); f_cubeSphereMapPoint<MEM>(pt,X,thisDx,CUBED_SPHERE_SHELL_R0, CUBED_SPHERE_SHELL_R1,a_point.srcBlock(), CUBED_SPHERE_SHELL_RADIAL_COORD); return X; }
|
inline |
Compute Cell Averaged Coordinates.
Computes the cell-averaged coodinate values at a specified MBDataPoint
|
inline |
Get Layout.
|
inline |
Get Mapped Grid Spacing.
|
inline |
Get Operator.
|
inline |
Get Ghost Sizes.
References Proto::MBLevelMap< MAP, MEM >::m_ghost.
|
inline |
Get Mapped Coordinate Values.
Given a node-centered box and grid spacing, generate the node centered mapped coordinates. This assumes that the origin corresponds to the point (0,0,...,0) and that the input box already accounts for node centering (e.g. Box::grow(PR_NODE) is assumed to already have been called.)
/param a_box A box that already accounts for node centering /param a_dx Grid spacing
|
inline |
|
inline |
|
inline |
|
private |
Referenced by Proto::MBLevelMap< MAP, MEM >::ghost().
|
private |
|
private |
|
mutableprivate |
Map operators.
|
private |
Mapped space grid spacing.
|
private |
|
mutableprivate |
|
mutableprivate |
Cached coodinate values.
Referenced by Proto::MBLevelMap< MAP, MEM >::mapData().
|
mutableprivate |
Cached Jacobian values.
Referenced by Proto::MBLevelMap< MAP, MEM >::jacobianData().