Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
AMReX_Geometry.H
Go to the documentation of this file.
1#ifndef AMREX_GEOMETRY_H_
2#define AMREX_GEOMETRY_H_
3#include <AMReX_Config.H>
4
9
10#include <AMReX_Array.H>
11#include <AMReX_CoordSys.H>
13#include <AMReX_RealBox.H>
14#include <AMReX_Periodicity.H>
15
16#ifdef AMREX_USE_OMP
17#include <omp.h>
18#endif
19
20#include <cmath>
21#include <concepts>
22#include <iosfwd>
23#include <map>
24#include <numbers>
25
26namespace amrex {
27
28class MultiFab;
30class BoxArray;
31
38{
41 const Real* CellSize () const noexcept { return dx; }
44 Real CellSize (int dir) const noexcept { return dx[dir]; }
47 const Real* ProbLo () const noexcept { return prob_domain.lo(); }
50 Real ProbLo (int dir) const noexcept { return prob_domain.lo(dir); }
53 const Real* ProbHi () const noexcept { return prob_domain.hi(); }
56 Real ProbHi (int dir) const noexcept { return prob_domain.hi(dir); }
59 const Box& Domain () const noexcept { return domain; }
62 int isPeriodic (const int i) const noexcept { return is_periodic[i]; }
65 int Coord () const noexcept { return coord; }
66
67public:
70 Real dx[AMREX_SPACEDIM];
71 int is_periodic[AMREX_SPACEDIM];
72 int coord;
73};
74
85 :
86 public CoordSys
87{
88public:
95 Geometry () noexcept;
96
110 explicit Geometry (const Box& dom,
111 const RealBox* rb = nullptr,
112 int coord = -1,
113 int const* is_per = nullptr);
126 Geometry (const Box& dom, const RealBox& rb, int coord,
127 Array<int,AMREX_SPACEDIM> const& is_per);
128
129 ~Geometry () = default;
130 Geometry (const Geometry& rhs) = default;
131 Geometry (Geometry&& rhs) noexcept = default;
132 Geometry& operator= (const Geometry& rhs) = default;
133 Geometry& operator= (Geometry&& rhs) noexcept = default;
134
136 [[nodiscard]] GeometryData data() const noexcept {
137 return {
138 .prob_domain = prob_domain,
139 .domain = domain,
140 .dx = {AMREX_D_DECL(dx[0],dx[1],dx[2])},
141 .is_periodic = {AMREX_D_DECL(is_periodic[0], is_periodic[1], is_periodic[2])},
142 .coord = static_cast<int>(c_sys)
143 };
144 }
145
164 static void Setup (const RealBox* rb = nullptr, int coord = -1, int const* isper = nullptr);
166 static void ResetDefaultProbDomain (const RealBox& rb) noexcept;
168 static void ResetDefaultPeriodicity (const Array<int,AMREX_SPACEDIM>& is_per) noexcept;
170 static void ResetDefaultCoord (int coord) noexcept;
171
185 void define (const Box& dom, const RealBox* rb = nullptr, int coord = -1, int const* is_per = nullptr);
186
199 void define (const Box& dom, const RealBox& rb, int coord, Array<int,AMREX_SPACEDIM> const& is_per);
200
202 [[nodiscard]] const RealBox& ProbDomain () const noexcept { return prob_domain; }
204 void ProbDomain (const RealBox& rb)
205 {
206 prob_domain = rb;
208 }
209
210 [[nodiscard]] const Real* ProbLo () const noexcept { return prob_domain.lo(); }
212 [[nodiscard]] const Real* ProbHi () const noexcept { return prob_domain.hi(); }
214 [[nodiscard]] Real ProbLo (int dir) const noexcept { return prob_domain.lo(dir); }
216 [[nodiscard]] Real ProbHi (int dir) const noexcept { return prob_domain.hi(dir); }
217
219 [[nodiscard]] GpuArray<Real,AMREX_SPACEDIM> ProbLoArray () const noexcept {
220 return {{AMREX_D_DECL(prob_domain.lo(0),prob_domain.lo(1),prob_domain.lo(2))}};
221 }
222
224 [[nodiscard]] GpuArray<Real,AMREX_SPACEDIM> ProbHiArray () const noexcept {
225 return {{AMREX_D_DECL(prob_domain.hi(0),prob_domain.hi(1),prob_domain.hi(2))}};
226 }
227
230 return roundoff_lo;
231 }
232
235 return roundoff_hi;
236 }
237
239 [[nodiscard]] Real ProbSize () const noexcept
240 {
241 return AMREX_D_TERM(prob_domain.length(0),*prob_domain.length(1),*prob_domain.length(2));
242 }
243
244 [[nodiscard]] Real ProbLength (int dir) const noexcept { return prob_domain.length(dir); }
246 [[nodiscard]] const Box& Domain () const noexcept { return domain; }
248 void Domain (const Box& bx)
249 {
251 domain = bx;
253 }
254
259 void GetVolume (MultiFab& vol,
260 const BoxArray& grds,
261 const DistributionMapping& dm,
262 int grow) const;
264 void GetVolume (MultiFab& vol) const;
265
270 void GetVolume (FArrayBox& vol,
271 const BoxArray& grds,
272 int idx,
273 int grow) const;
274
277 static Real Volume (const IntVect& point, const GeometryData& geomdata)
278 {
279 const auto *dx = geomdata.CellSize();
280
281 Real vol;
282
283#if AMREX_SPACEDIM == 1
284
285 auto coord = geomdata.Coord();
286
287 if (coord == CoordSys::cartesian) {
288 // Cartesian
289
290 vol = dx[0];
291 }
292 else if (coord == CoordSys::RZ) {
293 // Cylindrical
294
295 Real rl = geomdata.ProbLo()[0] + static_cast<Real>(point[0]) * dx[0];
296 Real rr = rl + dx[0];
297
298 constexpr Real pi = std::numbers::pi_v<Real>;
299 vol = pi * (rl + rr) * dx[0];
300 }
301 else {
302 // Spherical
303
304 Real rl = geomdata.ProbLo()[0] + static_cast<Real>(point[0]) * dx[0];
305 Real rr = rl + dx[0];
306
307 constexpr Real pi = std::numbers::pi_v<Real>;
308 vol = (4.0_rt / 3.0_rt) * pi * dx[0] * (rl * rl + rl * rr + rr * rr);
309 }
310
311#elif AMREX_SPACEDIM == 2
312
313 auto coord = geomdata.Coord();
314
315 if (coord == CoordSys::cartesian) {
316 // Cartesian
317
318 vol = dx[0] * dx[1];
319 }
320 else if (coord == CoordSys::RZ) {
321 // Cylindrical
322
323 Real r_l = geomdata.ProbLo()[0] + static_cast<Real>(point[0]) * dx[0];
324 Real r_r = geomdata.ProbLo()[0] + static_cast<Real>(point[0]+1) * dx[0];
325
326 constexpr Real pi = std::numbers::pi_v<Real>;
327 vol = pi * (r_l + r_r) * dx[0] * dx[1];
328 }
329 else {
330 // Spherical
331
332 Real r_l = geomdata.ProbLo()[0] + static_cast<Real>(point[0]) * dx[0];
333 Real r_r = geomdata.ProbLo()[0] + static_cast<Real>(point[0]+1) * dx[0];
334
335 Real theta_l = geomdata.ProbLo()[1] + static_cast<Real>(point[1]) * dx[1];
336 Real theta_r = geomdata.ProbLo()[1] + static_cast<Real>(point[1]+1) * dx[1];
337
338 constexpr Real twoThirdsPi = static_cast<Real>((2.0 / 3.0) * std::numbers::pi_v<Real>);
339 vol = twoThirdsPi * (std::cos(theta_l) - std::cos(theta_r)) * dx[0] *
340 (r_r*r_r + r_r*r_l + r_l*r_l);
341 }
342
343#else
344
346
347 // Cartesian
348
349 vol = dx[0] * dx[1] * dx[2];
350
351#endif
352
353 return vol;
354 }
355
365 void GetDLogA (MultiFab& dloga,
366 const BoxArray& grds,
367 const DistributionMapping& dm,
368 int dir,
369 int grow) const;
376 void GetFaceArea (MultiFab& area,
377 const BoxArray& grds,
378 const DistributionMapping& dm,
379 int dir,
380 int grow) const;
385 void GetFaceArea (MultiFab& area,
386 int dir) const;
387
393 void GetFaceArea (FArrayBox& area,
394 const BoxArray& grds,
395 int idx,
396 int dir,
397 int grow) const;
399 [[nodiscard]] bool isPeriodic (int dir) const noexcept { return is_periodic[dir]; }
401 [[nodiscard]] bool isAnyPeriodic () const noexcept
402 {
403 return AMREX_D_TERM(isPeriodic(0),||isPeriodic(1),||isPeriodic(2));
404 }
405
406 [[nodiscard]] bool isAllPeriodic () const noexcept
407 {
408 return AMREX_D_TERM(isPeriodic(0),&&isPeriodic(1),&&isPeriodic(2));
409 }
410
411 [[nodiscard]] Array<int,AMREX_SPACEDIM> isPeriodic () const noexcept {
412 return {{AMREX_D_DECL(static_cast<int>(is_periodic[0]),
413 static_cast<int>(is_periodic[1]),
414 static_cast<int>(is_periodic[2]))}};
415 }
416
417 [[nodiscard]] GpuArray<int,AMREX_SPACEDIM> isPeriodicArray () const noexcept {
418 return {{AMREX_D_DECL(static_cast<int>(is_periodic[0]),
419 static_cast<int>(is_periodic[1]),
420 static_cast<int>(is_periodic[2]))}};
421 }
422
423 [[nodiscard]] int period (int dir) const noexcept { BL_ASSERT(is_periodic[dir]); return domain.length(dir); }
424
426 [[nodiscard]] Periodicity periodicity () const noexcept {
427 return Periodicity(IntVect(AMREX_D_DECL(domain.length(0) * is_periodic[0],
428 domain.length(1) * is_periodic[1],
429 domain.length(2) * is_periodic[2])));
430 }
431
433 [[nodiscard]] Periodicity periodicity (const Box& b) const noexcept {
434 AMREX_ASSERT(b.cellCentered());
435 return Periodicity(IntVect(AMREX_D_DECL(b.length(0) * is_periodic[0],
436 b.length(1) * is_periodic[1],
437 b.length(2) * is_periodic[2])));
438 }
439
451 void periodicShift (const Box& target,
452 const Box& src,
453 Vector<IntVect>& out) const noexcept;
454
456 [[nodiscard]] Box growNonPeriodicDomain (IntVect const& ngrow) const noexcept;
458 [[nodiscard]] Box growNonPeriodicDomain (int ngrow) const noexcept;
460 [[nodiscard]] Box growPeriodicDomain (IntVect const& ngrow) const noexcept;
462 [[nodiscard]] Box growPeriodicDomain (int ngrow) const noexcept;
463
473 Array<int,AMREX_SPACEDIM> r{{AMREX_D_DECL(is_periodic[0],
474 is_periodic[1],
475 is_periodic[2])}};
476 AMREX_D_TERM(is_periodic[0] = period[0];,
477 is_periodic[1] = period[1];,
478 is_periodic[2] = period[2];);
479 return r;
480 }
481
488 void coarsen (IntVect const& rr) {
489 domain.coarsen(rr);
490 for (int i = 0; i < AMREX_SPACEDIM; ++i) {
491 dx[i] = (ProbHi(i) - ProbLo(i)) / static_cast<Real>(domain.length(i));
492 inv_dx[i] = Real(1.)/dx[i];
493 }
494 }
495
502 void refine (IntVect const& rr) {
503 domain.refine(rr);
504 for (int i = 0; i < AMREX_SPACEDIM; ++i) {
505 dx[i] = (ProbHi(i) - ProbLo(i)) / static_cast<Real>(domain.length(i));
506 inv_dx[i] = Real(1.)/dx[i];
507 }
508 }
509
517
525
527 void computeRoundoffDomain ();
528
530 [[nodiscard]] GpuArray<ParticleReal, AMREX_SPACEDIM> const&
531 RoundOffLo () const { return roundoff_lo; }
532
534 [[nodiscard]] GpuArray<ParticleReal, AMREX_SPACEDIM> const&
535 RoundOffHi () const { return roundoff_hi; }
536
537private:
538 void read_params ();
539
540 // is_periodic and RealBox used to be static
541 bool is_periodic[AMREX_SPACEDIM] = {AMREX_D_DECL(false,false,false)};
542 RealBox prob_domain;
543
544 // Due to round-off errors, not all floating point numbers for which plo >= x < phi
545 // will map to a cell that is inside "domain". "roundoff_{lo,hi}" store
546 // positions that are very close to that in prob_domain, and for which all doubles and floats
547 // between them will map to a cell inside domain.
548 GpuArray<ParticleReal , AMREX_SPACEDIM> roundoff_lo, roundoff_hi;
549
550 //
551 Box domain;
552
553 friend std::istream& operator>> (std::istream&, Geometry&);
554};
555
556
561std::ostream& operator<< (std::ostream&, const Geometry&);
566std::istream& operator>> (std::istream&, Geometry&);
567
574inline
576coarsen (Geometry const& fine, IntVect const& rr) {
577 Geometry r{fine};
578 r.coarsen(rr);
579 return r;
580}
581
588inline
589Geometry
590coarsen (Geometry const& fine, int rr) { return coarsen(fine, IntVect(rr)); }
591
598inline
599Geometry
600refine (Geometry const& crse, IntVect const& rr) {
601 Geometry r{crse};
602 r.refine(rr);
603 return r;
604}
605
612inline
613Geometry
614refine (Geometry const& crse, int rr) { return refine(crse, IntVect(rr)); }
615
623template <std::floating_point T>
625T node_coord (T problo, int i, T dx) noexcept
626{
627 return std::fma(T(i), dx, problo);
628}
629
634inline
635const Geometry&
637 return *(AMReX::top()->getDefaultGeometry());
638}
639
640}
641
642#endif /*_GEOMETRY_H_*/
Fixed-size array types for use on GPU and CPU.
#define BL_ASSERT(EX)
Definition AMReX_BLassert.H:39
#define AMREX_ASSERT(EX)
Definition AMReX_BLassert.H:38
Coordinate system that maps between physical space and index space.
#define AMREX_FORCE_INLINE
Definition AMReX_Extension.H:124
#define AMREX_INLINE
Definition AMReX_Extension.H:132
#define AMREX_GPU_HOST_DEVICE
Definition AMReX_GpuQualifiers.H:20
#define AMREX_D_TERM(a, b, c)
Definition AMReX_SPACE.H:172
#define AMREX_D_DECL(a, b, c)
Definition AMReX_SPACE.H:171
Geometry * getDefaultGeometry() noexcept
Geometry owned by this context (constructed with the AMReX object).
Definition AMReX.H:548
static AMReX * top() noexcept
Pointer to the most recently pushed instance.
Definition AMReX.H:530
Reference-counted collection of Boxes.
Definition AMReX_BoxArray.H:681
__host__ __device__ bool cellCentered() const noexcept
Return true if BoxND is cell-centered in all indexing directions.
Definition AMReX_Box.H:356
Coordinate system; provides mapping between physical space and index space.
Definition AMReX_CoordSys.H:31
Real inv_dx[3]
Definition AMReX_CoordSys.H:322
CoordType c_sys
Definition AMReX_CoordSys.H:317
Real dx[3]
Definition AMReX_CoordSys.H:320
@ RZ
Definition AMReX_CoordSys.H:35
@ cartesian
Definition AMReX_CoordSys.H:35
Calculates the distribution of FABs to MPI processes.
Definition AMReX_DistributionMapping.H:51
A Fortran Array of REALs.
Definition AMReX_FArrayBox.H:237
Rectangular problem domain geometry.
Definition AMReX_Geometry.H:87
Geometry(Geometry &&rhs) noexcept=default
Real ProbLo(int dir) const noexcept
Returns the lo end of the problem domain in specified direction.
Definition AMReX_Geometry.H:214
~Geometry()=default
GpuArray< ParticleReal, 3 > ProbLoArrayInParticleReal() const noexcept
Return the lo end of the roundoff domain in ParticleReal precision.
Definition AMReX_Geometry.H:229
void ProbDomain(const RealBox &rb)
Sets the problem domain.
Definition AMReX_Geometry.H:204
bool outsideRoundoffDomain(ParticleReal x, ParticleReal y, ParticleReal z) const
Returns true if a point is outside the roundoff domain. All particles with positions inside the round...
Definition AMReX_Geometry.cpp:709
void GetVolume(MultiFab &vol, const BoxArray &grds, const DistributionMapping &dm, int grow) const
Define vol on grds with dm and fill it with cell volumes.
Definition AMReX_Geometry.cpp:208
void refine(IntVect const &rr)
Refine the Geometry by rr.
Definition AMReX_Geometry.H:502
void coarsen(IntVect const &rr)
Coarsen the Geometry by rr.
Definition AMReX_Geometry.H:488
GpuArray< ParticleReal, 3 > ProbHiArrayInParticleReal() const noexcept
Return the hi end of the roundoff domain in ParticleReal precision.
Definition AMReX_Geometry.H:234
const Real * ProbHi() const noexcept
Returns the hi end of the problem domain in each dimension.
Definition AMReX_Geometry.H:212
__host__ static __device__ Real Volume(const IntVect &point, const GeometryData &geomdata)
Return the volume of the specified cell.
Definition AMReX_Geometry.H:277
bool isAnyPeriodic() const noexcept
Is domain periodic in any direction?
Definition AMReX_Geometry.H:401
Array< int, 3 > setPeriodicity(Array< int, 3 > const &period) noexcept
Set the periodicity flags and return the old flags.
Definition AMReX_Geometry.H:472
static void ResetDefaultProbDomain(const RealBox &rb) noexcept
Set the problem domain of the default Geometry to rb.
Definition AMReX_Geometry.cpp:184
void GetFaceArea(MultiFab &area, const BoxArray &grds, const DistributionMapping &dm, int dir, int grow) const
Define area on the faces of grds normal to dir, using dm, and fill it with face areas.
Definition AMReX_Geometry.cpp:303
Real ProbHi(int dir) const noexcept
Returns the hi end of the problem domain in specified direction.
Definition AMReX_Geometry.H:216
Geometry(const Geometry &rhs)=default
int period(int dir) const noexcept
What's period in specified direction?
Definition AMReX_Geometry.H:423
Geometry & operator=(const Geometry &rhs)=default
const Box & Domain() const noexcept
Returns our rectangular domain.
Definition AMReX_Geometry.H:246
void Domain(const Box &bx)
Sets our rectangular domain.
Definition AMReX_Geometry.H:248
static void Setup(const RealBox *rb=nullptr, int coord=-1, int const *isper=nullptr)
Set up the default Geometry, unless it has already been set up.
Definition AMReX_Geometry.cpp:108
GpuArray< int, 3 > isPeriodicArray() const noexcept
Return the periodicity flags in a GpuArray for device code.
Definition AMReX_Geometry.H:417
const RealBox & ProbDomain() const noexcept
Returns the problem domain.
Definition AMReX_Geometry.H:202
Periodicity periodicity() const noexcept
Return the Periodicity based on the length of the domain.
Definition AMReX_Geometry.H:426
Array< int, 3 > isPeriodic() const noexcept
Return the periodicity flags for all directions as an Array.
Definition AMReX_Geometry.H:411
void GetDLogA(MultiFab &dloga, const BoxArray &grds, const DistributionMapping &dm, int dir, int grow) const
Define dloga on grds with dm and fill it with d(log(A))/dr at cell centers.
Box growNonPeriodicDomain(IntVect const &ngrow) const noexcept
Return domain box with non-periodic directions grown by ngrow.
Definition AMReX_Geometry.cpp:486
void periodicShift(const Box &target, const Box &src, Vector< IntVect > &out) const noexcept
Compute Array of shifts which will translate src so that it will intersect target with non-zero inter...
Definition AMReX_Geometry.cpp:376
Real ProbLength(int dir) const noexcept
Returns length of problem domain in specified dimension.
Definition AMReX_Geometry.H:244
void computeRoundoffDomain()
Compute the roundoff domain.
Definition AMReX_Geometry.cpp:522
const Real * ProbLo() const noexcept
Returns the lo end of the problem domain in each dimension.
Definition AMReX_Geometry.H:210
GeometryData data() const noexcept
Return a GPU-safe snapshot of the Geometry data.
Definition AMReX_Geometry.H:136
Geometry() noexcept
Construct a copy of the default Geometry, if one is available.
Definition AMReX_Geometry.cpp:45
GpuArray< Real, 3 > ProbHiArray() const noexcept
Return the hi end of the problem domain in a GpuArray for device code.
Definition AMReX_Geometry.H:224
Box growPeriodicDomain(IntVect const &ngrow) const noexcept
Return domain box with periodic directions grown by ngrow.
Definition AMReX_Geometry.cpp:498
Real ProbSize() const noexcept
Returns the overall size of the domain by multiplying the ProbLength's together.
Definition AMReX_Geometry.H:239
bool insideRoundoffDomain(ParticleReal x, ParticleReal y, ParticleReal z) const
Returns true if a point is inside the roundoff domain. All particles with positions inside the roundo...
Definition AMReX_Geometry.cpp:721
GpuArray< Real, 3 > ProbLoArray() const noexcept
Return the lo end of the problem domain in a GpuArray for device code.
Definition AMReX_Geometry.H:219
bool isAllPeriodic() const noexcept
Is domain periodic in all directions?
Definition AMReX_Geometry.H:406
bool isPeriodic(int dir) const noexcept
Is the domain periodic in the specified direction?
Definition AMReX_Geometry.H:399
static void ResetDefaultPeriodicity(const Array< int, 3 > &is_per) noexcept
Set the periodicity flags of the default Geometry to is_per.
Definition AMReX_Geometry.cpp:193
GpuArray< ParticleReal, 3 > const & RoundOffLo() const
Returns roundoff domain's lower end.
Definition AMReX_Geometry.H:531
friend std::istream & operator>>(std::istream &, Geometry &)
Read a Geometry from an input stream in ASCII format.
Definition AMReX_Geometry.cpp:25
static void ResetDefaultCoord(int coord) noexcept
Set the coordinate-system type of the default Geometry to coord.
Definition AMReX_Geometry.cpp:200
void define(const Box &dom, const RealBox *rb=nullptr, int coord=-1, int const *is_per=nullptr)
Define this Geometry for the specified index-space domain.
Definition AMReX_Geometry.cpp:70
GpuArray< ParticleReal, 3 > const & RoundOffHi() const
Returns roundoff domain's higher end.
Definition AMReX_Geometry.H:535
Periodicity periodicity(const Box &b) const noexcept
Return the Periodicity based on the length of the cell-centered box b.
Definition AMReX_Geometry.H:433
A collection (stored as an array) of FArrayBox objects.
Definition AMReX_MultiFab.H:40
This provides length of period for periodic domains. 0 means it is not periodic in that direction....
Definition AMReX_Periodicity.H:17
A Box with real dimensions.
Definition AMReX_RealBox.H:28
This class is a thin wrapper around std::vector. Unlike vector, Vector::operator[] provides bound che...
Definition AMReX_Vector.H:29
amrex_real Real
Floating Point Type for Fields.
Definition AMReX_REAL.H:80
amrex_particle_real ParticleReal
Floating Point Type for Particles.
Definition AMReX_REAL.H:91
__host__ __device__ BoxND< dim > coarsen(const BoxND< dim > &b, int ref_ratio) noexcept
Return a copy of b coarsened by the isotropic ratio ref_ratio.
Definition AMReX_Box.H:1471
__host__ __device__ BoxND< dim > grow(const BoxND< dim > &b, int i) noexcept
Return a copy of b grown uniformly by i cells in every direction.
Definition AMReX_Box.H:1328
__host__ __device__ BoxND< dim > refine(const BoxND< dim > &b, int ref_ratio) noexcept
Return a copy of b refined by the isotropic ratio ref_ratio.
Definition AMReX_Box.H:1512
std::array< T, N > Array
Definition AMReX_Array.H:31
__host__ __device__ T node_coord(T problo, int i, T dx) noexcept
Coordinate of node i: problo + i*dx.
Definition AMReX_Geometry.H:625
const Geometry & DefaultGeometry()
Return the default Geometry held by the top-level AMReX instance.
Definition AMReX_Geometry.H:636
Definition AMReX_Amr.cpp:50
__host__ __device__ void ignore_unused(const Ts &...)
No-op helper that marks variables as intentionally unused.
Definition AMReX.H:273
BoxND< 3 > Box
Box is an alias for amrex::BoxND instantiated with AMREX_SPACEDIM.
Definition AMReX_BaseFwd.H:35
@ y
Definition AMReX_Orientation.H:14
@ x
Definition AMReX_Orientation.H:14
@ z
Definition AMReX_Orientation.H:14
IntVectND< 3 > IntVect
IntVect is an alias for amrex::IntVectND instantiated with AMREX_SPACEDIM.
Definition AMReX_BaseFwd.H:38
std::istream & operator>>(std::istream &is, BoxND< dim > &bx)
Read a BoxND from is.
Definition AMReX_Box.H:1967
std::ostream & operator<<(std::ostream &os, AmrMesh const &amr_mesh)
Stream helper; forwards to the friend declared inside AmrMesh.
Definition AMReX_AmrMesh.cpp:1372
GPU-safe snapshot of Geometry data suitable for capture in GPU kernels.
Definition AMReX_Geometry.H:38
Box domain
Cell-centered index-space domain.
Definition AMReX_Geometry.H:69
__host__ __device__ Real ProbLo(int dir) const noexcept
Returns the lo end of the problem domain in direction dir.
Definition AMReX_Geometry.H:50
__host__ __device__ Real CellSize(int dir) const noexcept
Returns the cellsize for direction dir.
Definition AMReX_Geometry.H:44
__host__ __device__ int Coord() const noexcept
Coordinates type.
Definition AMReX_Geometry.H:65
__host__ __device__ const Box & Domain() const noexcept
Returns our rectangular domain.
Definition AMReX_Geometry.H:59
Real dx[3]
Cell size in each dimension.
Definition AMReX_Geometry.H:70
__host__ __device__ Real ProbHi(int dir) const noexcept
Returns the hi end of the problem domain in direction dir.
Definition AMReX_Geometry.H:56
__host__ __device__ const Real * CellSize() const noexcept
Returns the cellsize for each coordinate direction.
Definition AMReX_Geometry.H:41
int coord
Coordinate-system type: 0 for Cartesian, 1 for RZ, and 2 for spherical.
Definition AMReX_Geometry.H:72
__host__ __device__ int isPeriodic(const int i) const noexcept
Returns whether the domain is periodic in the given direction.
Definition AMReX_Geometry.H:62
int is_periodic[3]
For each dimension, 0 if the domain is non-periodic and 1 if it is.
Definition AMReX_Geometry.H:71
__host__ __device__ const Real * ProbLo() const noexcept
Returns the lo end of the problem domain in each dimension.
Definition AMReX_Geometry.H:47
RealBox prob_domain
Physical bounds of the problem domain.
Definition AMReX_Geometry.H:68
__host__ __device__ const Real * ProbHi() const noexcept
Returns the hi end of the problem domain in each dimension.
Definition AMReX_Geometry.H:53
Fixed-size array that can be used on GPU.
Definition AMReX_Array.H:52