2 #ifndef AMREX_COORDSYS_H_
3 #define AMREX_COORDSYS_H_
4 #include <AMReX_Config.H>
35 [[nodiscard]]
bool Ok () const noexcept {
return ok; }
44 [[nodiscard]]
int CoordInt () const noexcept {
return static_cast<int>(
c_sys); }
52 [[nodiscard]]
bool IsRZ () const noexcept {
62 void SetOffset (
const Real* x_lo) noexcept;
65 [[nodiscard]]
const Real*
Offset () const noexcept {
return offset; }
68 [[nodiscard]] Real
Offset (
int dir)
const noexcept {
return offset[dir]; }
93 [[nodiscard]] Real
CellCenter (
int point,
int dir)
const noexcept
105 [[nodiscard]] Real
LoEdge (
int point,
int dir)
const noexcept
117 [[nodiscard]] Real
HiEdge (
int point,
int dir)
const noexcept
132 void LoFace (
const IntVect& point,
int dir, Real* loc)
const noexcept;
138 void HiFace (
const IntVect& point,
int dir, Real* loc)
const noexcept;
144 void LoNode (
const IntVect& point, Real* loc)
const noexcept;
150 void HiNode (
const IntVect& point, Real* loc)
const noexcept;
192 [[nodiscard]] Real
Volume (
const Real xlo[AMREX_SPACEDIM],
193 const Real xhi[AMREX_SPACEDIM])
const;
208 [[nodiscard]] Real
AreaLo (
const IntVect& point,
int dir)
const noexcept;
211 [[nodiscard]] Real
AreaHi (
const IntVect& point,
int dir)
const noexcept;
245 std::numeric_limits<Real>::infinity(),
246 std::numeric_limits<Real>::infinity())};
#define BL_ASSERT(EX)
Definition: AMReX_BLassert.H:39
#define AMREX_D_DECL(a, b, c)
Definition: AMReX_SPACE.H:104
Coordinate System.
Definition: AMReX_CoordSys.H:24
Real inv_dx[AMREX_SPACEDIM]
Definition: AMReX_CoordSys.H:244
bool Ok() const noexcept
Is ok?
Definition: AMReX_CoordSys.H:35
Real dx[AMREX_SPACEDIM]
Definition: AMReX_CoordSys.H:242
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.
Definition: AMReX_CoordSys.cpp:303
friend std::istream & operator>>(std::istream &, CoordSys &)
Nice ASCII input.
Definition: AMReX_CoordSys.cpp:466
void GetVolume(FArrayBox &vol, const Box ®ion) const
Compute cell volumes in given region and place them into resize()d input FAB.
Definition: AMReX_CoordSys.cpp:173
IntVect CellIndex(const Real *point) const noexcept
Returns cell centered index of cell containing point. This may return undesired results if point is o...
Definition: AMReX_CoordSys.cpp:134
void LoNode(const IntVect &point, Vector< Real > &loc) const noexcept
Return location of lower left hand corner.
Definition: AMReX_CoordSys.cpp:106
void SetCoord(CoordType coord) noexcept
Set the CoordType.
Definition: AMReX_CoordSys.H:38
CoordType Coord() const noexcept
Returns the CoordType.
Definition: AMReX_CoordSys.H:41
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 F...
Definition: AMReX_CoordSys.cpp:257
int CoordInt() const noexcept
Returns the CoordType as an int.
Definition: AMReX_CoordSys.H:44
void GetEdgeVolCoord(Vector< Real > &vc, const Box ®ion, int dir) const
Return array of volume coordinates at cell edges for region in given direction.
Definition: AMReX_CoordSys.cpp:322
Real InvCellSize(int dir) const noexcept
Returns the inverse cellsize for the specified coordinate direction.
Definition: AMReX_CoordSys.H:85
friend std::ostream & operator<<(std::ostream &, const CoordSys &)
Nice ASCII output.
Definition: AMReX_CoordSys.cpp:446
bool IsCartesian() const noexcept
Is CoordType == cartesian?
Definition: AMReX_CoordSys.H:57
Real CellCenter(int point, int dir) const noexcept
Returns location of cell center in specified direction.
Definition: AMReX_CoordSys.H:93
void GetCellVolCoord(Vector< Real > &vc, const Box ®ion, int dir) const
Return array of volume coordinates at cell centers for region in given direction.
Definition: AMReX_CoordSys.cpp:384
Real HiEdge(const IntVect &point, int dir) const noexcept
Equivalent to HiEdge(point[dir], dir).
Definition: AMReX_CoordSys.H:123
void HiNode(const IntVect &point, Vector< Real > &loc) const noexcept
Return location of upper right hand corner.
Definition: AMReX_CoordSys.cpp:126
Real LoEdge(const IntVect &point, int dir) const noexcept
Equivalent to LoEdge(point[dir], dir).
Definition: AMReX_CoordSys.H:111
IntVect UpperIndex(const Real *point) const noexcept
Returns node centered index of upper right hand corner of cell containing this point.
Definition: AMReX_CoordSys.cpp:160
void SetVolume(FArrayBox &a_volfab, const Box ®ion) const
Compute cell volumes in given region and place them into input FAB.
Definition: AMReX_CoordSys.cpp:181
Real AreaHi(const IntVect &point, int dir) const noexcept
Returns hi face area of given cell in direction dir.
Definition: AMReX_CoordSys.cpp:581
CoordType c_sys
Definition: AMReX_CoordSys.H:239
bool IsSPHERICAL() const noexcept
Is CoordType == SPHERICAL?
Definition: AMReX_CoordSys.H:47
Real offset[AMREX_SPACEDIM]
Definition: AMReX_CoordSys.H:240
void HiFace(const IntVect &point, int dir, Vector< Real > &loc) const noexcept
Sets location of hi face into loc.
Definition: AMReX_CoordSys.cpp:85
const Real * Offset() const noexcept
Returns the offset.
Definition: AMReX_CoordSys.H:65
Real HiEdge(int point, int dir) const noexcept
Returns location of hi edge in specified direction.
Definition: AMReX_CoordSys.H:117
GpuArray< Real, AMREX_SPACEDIM > CellSizeArray() const noexcept
Definition: AMReX_CoordSys.H:76
Real Offset(int dir) const noexcept
Returns the offset for the specified coordinate direction.
Definition: AMReX_CoordSys.H:68
Real LoEdge(int point, int dir) const noexcept
Returns location of lo edge in specified direction.
Definition: AMReX_CoordSys.H:105
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.
Definition: AMReX_CoordSys.cpp:217
Real Volume(const IntVect &point) const
Return the volume of the specified cell.
Definition: AMReX_CoordSys.cpp:494
void LoFace(const IntVect &point, int dir, Vector< Real > &loc) const noexcept
Sets location of lo face into loc.
Definition: AMReX_CoordSys.cpp:62
bool ok
Definition: AMReX_CoordSys.H:247
const Real * InvCellSize() const noexcept
Returns the inverse cellsize for each coordinate direction.
Definition: AMReX_CoordSys.H:82
GpuArray< Real, AMREX_SPACEDIM > InvCellSizeArray() const noexcept
Definition: AMReX_CoordSys.H:87
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 FA...
Definition: AMReX_CoordSys.cpp:208
const Real * CellSize() const noexcept
Returns the cellsize for each coordinate direction.
Definition: AMReX_CoordSys.H:71
void SetOffset(const Real *x_lo) noexcept
Sets the offset for each coordinate direction.
Definition: AMReX_CoordSys.cpp:20
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.
Definition: AMReX_CoordSys.cpp:284
IntVect LowerIndex(const Real *point) const noexcept
Returns node centered index of lower left hand corner of cell containing this point.
Definition: AMReX_CoordSys.cpp:147
Real AreaLo(const IntVect &point, int dir) const noexcept
Returns lo face area of given cell in direction dir.
Definition: AMReX_CoordSys.cpp:527
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(...
Definition: AMReX_CoordSys.cpp:246
CoordType
Definition: AMReX_CoordSys.H:27
@ RZ
Definition: AMReX_CoordSys.H:27
@ undef
Definition: AMReX_CoordSys.H:27
@ cartesian
Definition: AMReX_CoordSys.H:27
@ SPHERICAL
Definition: AMReX_CoordSys.H:27
Real CellSize(int dir) const noexcept
Returns the cellsize for the specified coordinate direction.
Definition: AMReX_CoordSys.H:74
bool IsRZ() const noexcept
Is CoordType == RZ?
Definition: AMReX_CoordSys.H:52
A Fortran Array of REALs.
Definition: AMReX_FArrayBox.H:229
Definition: AMReX_Amr.cpp:49