![]() |
Block-Structured AMR Software Framework
|
Coordinate system; provides mapping between physical space and index space. More...
#include <AMReX_CoordSys.H>
Public Types | |
| enum | CoordType { undef = -1 , cartesian = 0 , RZ = 1 , SPHERICAL = 2 } |
| Coordinate system type: undefined, Cartesian, cylindrical (RZ), or spherical. More... | |
Public Member Functions | |
| bool | Ok () const noexcept |
| Is ok? | |
| void | SetCoord (CoordType coord) noexcept |
| Set the CoordType. | |
| CoordType | Coord () const noexcept |
| Returns the CoordType. | |
| int | CoordInt () const noexcept |
| Returns the CoordType as an int. | |
| bool | IsSPHERICAL () const noexcept |
| Is CoordType == SPHERICAL? | |
| bool | IsRZ () const noexcept |
| Is CoordType == RZ? | |
| bool | IsCartesian () const noexcept |
| Is CoordType == cartesian? | |
| void | SetOffset (const Real *x_lo) noexcept |
| Sets the offset for each coordinate direction. | |
| const Real * | Offset () const noexcept |
| Returns the offset. | |
| Real | Offset (int dir) const noexcept |
| Returns the offset for the specified coordinate direction. | |
| const Real * | CellSize () const noexcept |
| Returns the cellsize for each coordinate direction. | |
| Real | CellSize (int dir) const noexcept |
| Returns the cellsize for the specified coordinate direction. | |
| GpuArray< Real, 3 > | CellSizeArray () const noexcept |
| Returns the cell sizes as a GpuArray for use on host or device. | |
| const Real * | InvCellSize () const noexcept |
| Returns the inverse cellsize for each coordinate direction. | |
| Real | InvCellSize (int dir) const noexcept |
| Returns the inverse cellsize for the specified coordinate direction. | |
| GpuArray< Real, 3 > | InvCellSizeArray () const noexcept |
| Returns the inverse cell sizes as a GpuArray for use on host or device. | |
| Real | CellCenter (int point, int dir) const noexcept |
| Returns location of cell center in specified direction. | |
| void | CellCenter (const IntVect &point, Vector< Real > &loc) const noexcept |
| Return location of the specified cell center. | |
| void | CellCenter (const IntVect &point, Real *loc) const noexcept |
| Return location of the specified cell center. | |
| Real | LoEdge (int point, int dir) const noexcept |
| Returns location of lo edge in specified direction. | |
| Real | LoEdge (const IntVect &point, int dir) const noexcept |
| Equivalent to LoEdge(point[dir], dir). | |
| Real | HiEdge (int point, int dir) const noexcept |
| Returns location of hi edge in specified direction. | |
| Real | HiEdge (const IntVect &point, int dir) const noexcept |
| Equivalent to HiEdge(point[dir], dir). | |
| void | LoFace (const IntVect &point, int dir, Vector< Real > &loc) const noexcept |
Compute the physical location of the lower face in direction dir. | |
| void | LoFace (const IntVect &point, int dir, Real *loc) const noexcept |
Compute the physical location of the lower face in direction dir. | |
| void | HiFace (const IntVect &point, int dir, Vector< Real > &loc) const noexcept |
Compute the physical location of the upper face in direction dir. | |
| void | HiFace (const IntVect &point, int dir, Real *loc) const noexcept |
Compute the physical location of the upper face in direction dir. | |
| void | LoNode (const IntVect &point, Vector< Real > &loc) const noexcept |
| Return the location of the lower-left node of the cell. | |
| void | LoNode (const IntVect &point, Real *loc) const noexcept |
| Return the location of the lower-left node of the cell. | |
| void | HiNode (const IntVect &point, Vector< Real > &loc) const noexcept |
| Return the location of the upper-right node of the cell. | |
| void | HiNode (const IntVect &point, Real *loc) const noexcept |
| Return the location of the upper-right node of the cell. | |
| IntVect | CellIndex (const Real *point) const noexcept |
Returns cell-centered index of cell containing point. | |
| IntVect | LowerIndex (const Real *point) const noexcept |
| Returns nodal index of lower-left corner of cell containing this point. | |
| IntVect | UpperIndex (const Real *point) const noexcept |
| Returns nodal index of upper right hand corner of cell containing this point. | |
| void | SetVolume (FArrayBox &a_volfab, const Box ®ion) const |
| Compute cell volumes in given region and place them into input FAB. | |
| void | GetVolume (FArrayBox &vol, const Box ®ion) const |
| Compute cell volumes in given region and place them into resize()d input FAB. | |
| void | SetDLogA (FArrayBox &a_dlogafab, const Box ®ion, int dir) const |
| Compute d(log(A))/dr at cell centers in given region and place them into input FAB. | |
| void | GetDLogA (FArrayBox &dloga, const Box ®ion, int dir) const |
| Compute d(log(A))/dr at cell centers in given region and return the results in the resize()d input FAB. | |
| Real | Volume (const IntVect &point) const |
| Return the physical volume of the specified cell. | |
| Real | Volume (const Real xlo[3], const Real xhi[3]) const |
| Return the volume of the specified cell. | |
| void | SetFaceArea (FArrayBox &a_areafab, const Box ®ion, int dir) const |
| Compute area of cell faces in given region and given index direction and return the result in input FAB. | |
| void | GetFaceArea (FArrayBox &area, const Box ®ion, int dir) const |
| Compute area of cell faces in given region and given index direction and return the result in resize()d input FAB. | |
| Real | AreaLo (const IntVect &point, int dir) const noexcept |
| Returns lo face area of given cell in direction dir. | |
| Real | AreaHi (const IntVect &point, int dir) const noexcept |
| Returns hi face area of given cell in direction dir. | |
| void | GetEdgeLoc (Vector< Real > &loc, const Box ®ion, int dir) const |
| Return array of physical locations of cell edges in the resize()d input array. | |
| void | GetCellLoc (Vector< Real > &loc, const Box ®ion, int dir) const |
| Return array of physical locations of cell centers in the resize()d input array. | |
| void | GetEdgeVolCoord (Vector< Real > &vc, const Box ®ion, int dir) const |
| Return array of volume coordinates at cell edges for region in given direction. | |
| void | GetCellVolCoord (Vector< Real > &vc, const Box ®ion, int dir) const |
| Return array of volume coordinates at cell centers for region in given direction. | |
Protected Attributes | |
| CoordType | c_sys = undef |
| Real | offset [3] |
| Real | dx [3] = { 0. , 0. , 0. } |
| Real | inv_dx [3] |
| bool | ok = false |
Friends | |
| std::ostream & | operator<< (std::ostream &, const CoordSys &) |
| Nice ASCII output. | |
| std::istream & | operator>> (std::istream &, CoordSys &) |
| Nice ASCII input. | |
Coordinate system; provides mapping between physical space and index space.
Supports Cartesian, cylindrical (RZ), and spherical coordinate systems.
Returns hi face area of given cell in direction dir.
Returns lo face area of given cell in direction dir.
Return location of the specified cell center.
| point | Cell-centered index (i,j,k). |
| loc | Output pointer to an array of length AMREX_SPACEDIM. |
Return location of the specified cell center.
| point | Cell-centered index (i,j,k). |
| loc | Output vector resized to AMREX_SPACEDIM holding coordinates. |
Returns location of cell center in specified direction.
Returns cell-centered index of cell containing point.
This may return undesired results if point is on a cell boundary.
| point | Physical-space coordinates. |
|
inlinenoexcept |
Returns the cellsize for each coordinate direction.
Returns the cellsize for the specified coordinate direction.
Returns the cell sizes as a GpuArray for use on host or device.
|
inlinenoexcept |
Returns the CoordType.
|
inlinenoexcept |
Returns the CoordType as an int.
Return array of physical locations of cell centers in the resize()d input array.
Return array of volume coordinates at cell centers for region in given direction.
Compute d(log(A))/dr at cell centers in given region and return the results in the resize()d input FAB.
| dloga | Output fab; resized to region before being filled with derivatives. |
| region | Region of cells over which to compute the derivative. |
| dir | Coordinate direction of the area change. |
Return array of physical locations of cell edges in the resize()d input array.
Return array of volume coordinates at cell edges for region in given direction.
Compute area of cell faces in given region and given index direction and return the result in resize()d input FAB.
Compute cell volumes in given region and place them into resize()d input FAB.
| vol | Output fab; resized to region before being filled with volumes. |
| region | Region of cells over which to compute volumes. |
Equivalent to HiEdge(point[dir], dir).
Returns location of hi edge in specified direction.
Compute the physical location of the upper face in direction dir.
| point | Cell index of the owning cell. |
| dir | Coordinate direction (0-based). |
| loc | Output pointer to an array of length AMREX_SPACEDIM. |
|
noexcept |
Compute the physical location of the upper face in direction dir.
| point | Cell index of the owning cell. |
| dir | Coordinate direction (0-based). |
| loc | Output vector resized to AMREX_SPACEDIM holding coordinates. |
Return the location of the upper-right node of the cell.
| point | Cell index of the owning cell. |
| loc | Output pointer to an array of length AMREX_SPACEDIM. |
Return the location of the upper-right node of the cell.
| point | Cell index of the owning cell. |
| loc | Output vector resized to AMREX_SPACEDIM holding coordinates. |
|
inlinenoexcept |
Returns the inverse cellsize for each coordinate direction.
Returns the inverse cellsize for the specified coordinate direction.
Returns the inverse cell sizes as a GpuArray for use on host or device.
|
inlinenoexcept |
Is CoordType == cartesian?
|
inlinenoexcept |
Is CoordType == RZ?
|
inlinenoexcept |
Is CoordType == SPHERICAL?
Equivalent to LoEdge(point[dir], dir).
Returns location of lo edge in specified direction.
Compute the physical location of the lower face in direction dir.
| point | Cell index of the owning cell. |
| dir | Coordinate direction (0-based). |
| loc | Output pointer to an array of length AMREX_SPACEDIM. |
|
noexcept |
Compute the physical location of the lower face in direction dir.
| point | Cell index of the owning cell. |
| dir | Coordinate direction (0-based). |
| loc | Output vector resized to AMREX_SPACEDIM holding coordinates. |
Return the location of the lower-left node of the cell.
| point | Cell index of the owning cell. |
| loc | Output pointer to an array of length AMREX_SPACEDIM. |
Return the location of the lower-left node of the cell.
| point | Cell index of the owning cell. |
| loc | Output vector resized to AMREX_SPACEDIM holding coordinates. |
Returns nodal index of lower-left corner of cell containing this point.
| point | Physical-space coordinates. |
|
inlinenoexcept |
Returns the offset.
Returns the offset for the specified coordinate direction.
|
inlinenoexcept |
Is ok?
|
inlinenoexcept |
Set the CoordType.
Compute d(log(A))/dr at cell centers in given region and place them into input FAB.
| a_dlogafab | Output fab; must be sized to cover region (not resized by this call). |
| region | Region of cells over which to compute the derivative. |
| dir | Coordinate direction of the area change. |
Compute area of cell faces in given region and given index direction and return the result in input FAB.
|
noexcept |
Sets the offset for each coordinate direction.
Compute cell volumes in given region and place them into input FAB.
| a_volfab | Output fab; must be sized to cover region (not resized by this call). |
| region | Region of cells over which to compute volumes. |
Returns nodal index of upper right hand corner of cell containing this point.
| point | Physical-space coordinates. |
Return the physical volume of the specified cell.
| point | Cell-centered index (i,j,k). |
Return the volume of the specified cell.
|
friend |
Nice ASCII output.
|
friend |
Nice ASCII input.
|
protected |
|
protected |
|
protected |
|
protected |