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
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 <iosfwd>
21#include <map>
22#include <numbers>
23
24namespace amrex {
25
26class MultiFab;
27class DistributionMapping;
28class BoxArray;
29
36{
39 const Real* CellSize () const noexcept { return dx; }
42 Real CellSize (int dir) const noexcept { return dx[dir]; }
45 const Real* ProbLo () const noexcept { return prob_domain.lo(); }
48 Real ProbLo (int dir) const noexcept { return prob_domain.lo(dir); }
51 const Real* ProbHi () const noexcept { return prob_domain.hi(); }
54 Real ProbHi (int dir) const noexcept { return prob_domain.hi(dir); }
57 const Box& Domain () const noexcept { return domain; }
60 int isPeriodic (const int i) const noexcept { return is_periodic[i]; }
63 int Coord () const noexcept { return coord; }
64
65public:
68 Real dx[AMREX_SPACEDIM];
69 int is_periodic[AMREX_SPACEDIM];
70 int coord;
71};
72
83 :
84 public CoordSys
85{
86public:
93 Geometry () noexcept;
94
108 explicit Geometry (const Box& dom,
109 const RealBox* rb = nullptr,
110 int coord = -1,
111 int const* is_per = nullptr);
124 Geometry (const Box& dom, const RealBox& rb, int coord,
125 Array<int,AMREX_SPACEDIM> const& is_per);
126
127 ~Geometry () = default;
128 Geometry (const Geometry& rhs) = default;
129 Geometry (Geometry&& rhs) noexcept = default;
130 Geometry& operator= (const Geometry& rhs) = default;
131 Geometry& operator= (Geometry&& rhs) noexcept = default;
132
134 [[nodiscard]] GeometryData data() const noexcept {
135 return {
136 .prob_domain = prob_domain,
137 .domain = domain,
138 .dx = {AMREX_D_DECL(dx[0],dx[1],dx[2])},
139 .is_periodic = {AMREX_D_DECL(is_periodic[0], is_periodic[1], is_periodic[2])},
140 .coord = static_cast<int>(c_sys)
141 };
142 }
143
162 static void Setup (const RealBox* rb = nullptr, int coord = -1, int const* isper = nullptr);
164 static void ResetDefaultProbDomain (const RealBox& rb) noexcept;
166 static void ResetDefaultPeriodicity (const Array<int,AMREX_SPACEDIM>& is_per) noexcept;
168 static void ResetDefaultCoord (int coord) noexcept;
169
183 void define (const Box& dom, const RealBox* rb = nullptr, int coord = -1, int const* is_per = nullptr);
184
197 void define (const Box& dom, const RealBox& rb, int coord, Array<int,AMREX_SPACEDIM> const& is_per);
198
200 [[nodiscard]] const RealBox& ProbDomain () const noexcept { return prob_domain; }
202 void ProbDomain (const RealBox& rb)
203 {
204 prob_domain = rb;
206 }
208 [[nodiscard]] const Real* ProbLo () const noexcept { return prob_domain.lo(); }
210 [[nodiscard]] const Real* ProbHi () const noexcept { return prob_domain.hi(); }
212 [[nodiscard]] Real ProbLo (int dir) const noexcept { return prob_domain.lo(dir); }
214 [[nodiscard]] Real ProbHi (int dir) const noexcept { return prob_domain.hi(dir); }
215
217 [[nodiscard]] GpuArray<Real,AMREX_SPACEDIM> ProbLoArray () const noexcept {
218 return {{AMREX_D_DECL(prob_domain.lo(0),prob_domain.lo(1),prob_domain.lo(2))}};
219 }
220
222 [[nodiscard]] GpuArray<Real,AMREX_SPACEDIM> ProbHiArray () const noexcept {
223 return {{AMREX_D_DECL(prob_domain.hi(0),prob_domain.hi(1),prob_domain.hi(2))}};
224 }
225
228 return roundoff_lo;
229 }
230
233 return roundoff_hi;
234 }
235
237 [[nodiscard]] Real ProbSize () const noexcept
238 {
239 return AMREX_D_TERM(prob_domain.length(0),*prob_domain.length(1),*prob_domain.length(2));
240 }
242 [[nodiscard]] Real ProbLength (int dir) const noexcept { return prob_domain.length(dir); }
244 [[nodiscard]] const Box& Domain () const noexcept { return domain; }
246 void Domain (const Box& bx)
247 {
249 domain = bx;
251 }
257 void GetVolume (MultiFab& vol,
258 const BoxArray& grds,
259 const DistributionMapping& dm,
260 int grow) const;
262 void GetVolume (MultiFab& vol) const;
263
268 void GetVolume (FArrayBox& vol,
269 const BoxArray& grds,
270 int idx,
271 int grow) const;
272
275 static Real Volume (const IntVect& point, const GeometryData& geomdata)
276 {
277 const auto *dx = geomdata.CellSize();
278
279 Real vol;
280
281#if AMREX_SPACEDIM == 1
282
283 auto coord = geomdata.Coord();
284
285 if (coord == CoordSys::cartesian) {
286 // Cartesian
287
288 vol = dx[0];
289 }
290 else if (coord == CoordSys::RZ) {
291 // Cylindrical
292
293 Real rl = geomdata.ProbLo()[0] + static_cast<Real>(point[0]) * dx[0];
294 Real rr = rl + dx[0];
295
296 constexpr Real pi = std::numbers::pi_v<Real>;
297 vol = pi * (rl + rr) * dx[0];
298 }
299 else {
300 // Spherical
301
302 Real rl = geomdata.ProbLo()[0] + static_cast<Real>(point[0]) * dx[0];
303 Real rr = rl + dx[0];
304
305 constexpr Real pi = std::numbers::pi_v<Real>;
306 vol = (4.0_rt / 3.0_rt) * pi * dx[0] * (rl * rl + rl * rr + rr * rr);
307 }
308
309#elif AMREX_SPACEDIM == 2
310
311 auto coord = geomdata.Coord();
312
313 if (coord == CoordSys::cartesian) {
314 // Cartesian
315
316 vol = dx[0] * dx[1];
317 }
318 else if (coord == CoordSys::RZ) {
319 // Cylindrical
320
321 Real r_l = geomdata.ProbLo()[0] + static_cast<Real>(point[0]) * dx[0];
322 Real r_r = geomdata.ProbLo()[0] + static_cast<Real>(point[0]+1) * dx[0];
323
324 constexpr Real pi = std::numbers::pi_v<Real>;
325 vol = pi * (r_l + r_r) * dx[0] * dx[1];
326 }
327 else {
328 // Spherical
329
330 Real r_l = geomdata.ProbLo()[0] + static_cast<Real>(point[0]) * dx[0];
331 Real r_r = geomdata.ProbLo()[0] + static_cast<Real>(point[0]+1) * dx[0];
332
333 Real theta_l = geomdata.ProbLo()[1] + static_cast<Real>(point[1]) * dx[1];
334 Real theta_r = geomdata.ProbLo()[1] + static_cast<Real>(point[1]+1) * dx[1];
335
336 constexpr Real twoThirdsPi = static_cast<Real>((2.0 / 3.0) * std::numbers::pi_v<Real>);
337 vol = twoThirdsPi * (std::cos(theta_l) - std::cos(theta_r)) * dx[0] *
338 (r_r*r_r + r_r*r_l + r_l*r_l);
339 }
340
341#else
342
344
345 // Cartesian
346
347 vol = dx[0] * dx[1] * dx[2];
348
349#endif
350
351 return vol;
352 }
353
363 void GetDLogA (MultiFab& dloga,
364 const BoxArray& grds,
365 const DistributionMapping& dm,
366 int dir,
367 int grow) const;
374 void GetFaceArea (MultiFab& area,
375 const BoxArray& grds,
376 const DistributionMapping& dm,
377 int dir,
378 int grow) const;
383 void GetFaceArea (MultiFab& area,
384 int dir) const;
385
391 void GetFaceArea (FArrayBox& area,
392 const BoxArray& grds,
393 int idx,
394 int dir,
395 int grow) const;
397 [[nodiscard]] bool isPeriodic (int dir) const noexcept { return is_periodic[dir]; }
399 [[nodiscard]] bool isAnyPeriodic () const noexcept
400 {
401 return AMREX_D_TERM(isPeriodic(0),||isPeriodic(1),||isPeriodic(2));
402 }
404 [[nodiscard]] bool isAllPeriodic () const noexcept
405 {
406 return AMREX_D_TERM(isPeriodic(0),&&isPeriodic(1),&&isPeriodic(2));
407 }
409 [[nodiscard]] Array<int,AMREX_SPACEDIM> isPeriodic () const noexcept {
410 return {{AMREX_D_DECL(static_cast<int>(is_periodic[0]),
411 static_cast<int>(is_periodic[1]),
412 static_cast<int>(is_periodic[2]))}};
413 }
415 [[nodiscard]] GpuArray<int,AMREX_SPACEDIM> isPeriodicArray () const noexcept {
416 return {{AMREX_D_DECL(static_cast<int>(is_periodic[0]),
417 static_cast<int>(is_periodic[1]),
418 static_cast<int>(is_periodic[2]))}};
419 }
421 [[nodiscard]] int period (int dir) const noexcept { BL_ASSERT(is_periodic[dir]); return domain.length(dir); }
422
424 [[nodiscard]] Periodicity periodicity () const noexcept {
425 return Periodicity(IntVect(AMREX_D_DECL(domain.length(0) * is_periodic[0],
426 domain.length(1) * is_periodic[1],
427 domain.length(2) * is_periodic[2])));
428 }
429
431 [[nodiscard]] Periodicity periodicity (const Box& b) const noexcept {
432 AMREX_ASSERT(b.cellCentered());
433 return Periodicity(IntVect(AMREX_D_DECL(b.length(0) * is_periodic[0],
434 b.length(1) * is_periodic[1],
435 b.length(2) * is_periodic[2])));
436 }
437
449 void periodicShift (const Box& target,
450 const Box& src,
451 Vector<IntVect>& out) const noexcept;
452
454 [[nodiscard]] Box growNonPeriodicDomain (IntVect const& ngrow) const noexcept;
456 [[nodiscard]] Box growNonPeriodicDomain (int ngrow) const noexcept;
458 [[nodiscard]] Box growPeriodicDomain (IntVect const& ngrow) const noexcept;
460 [[nodiscard]] Box growPeriodicDomain (int ngrow) const noexcept;
461
471 Array<int,AMREX_SPACEDIM> r{{AMREX_D_DECL(is_periodic[0],
472 is_periodic[1],
473 is_periodic[2])}};
474 AMREX_D_TERM(is_periodic[0] = period[0];,
475 is_periodic[1] = period[1];,
476 is_periodic[2] = period[2];);
477 return r;
478 }
479
486 void coarsen (IntVect const& rr) {
487 domain.coarsen(rr);
488 for (int i = 0; i < AMREX_SPACEDIM; ++i) {
489 dx[i] = (ProbHi(i) - ProbLo(i)) / static_cast<Real>(domain.length(i));
490 inv_dx[i] = Real(1.)/dx[i];
491 }
492 }
493
500 void refine (IntVect const& rr) {
501 domain.refine(rr);
502 for (int i = 0; i < AMREX_SPACEDIM; ++i) {
503 dx[i] = (ProbHi(i) - ProbLo(i)) / static_cast<Real>(domain.length(i));
504 inv_dx[i] = Real(1.)/dx[i];
505 }
506 }
507
515
523
525 void computeRoundoffDomain ();
526
528 [[nodiscard]] GpuArray<ParticleReal, AMREX_SPACEDIM> const&
529 RoundOffLo () const { return roundoff_lo; }
530
532 [[nodiscard]] GpuArray<ParticleReal, AMREX_SPACEDIM> const&
533 RoundOffHi () const { return roundoff_hi; }
534
535private:
536 void read_params ();
537
538 // is_periodic and RealBox used to be static
539 bool is_periodic[AMREX_SPACEDIM] = {AMREX_D_DECL(false,false,false)};
540 RealBox prob_domain;
541
542 // Due to round-off errors, not all floating point numbers for which plo >= x < phi
543 // will map to a cell that is inside "domain". "roundoff_{lo,hi}" store
544 // positions that are very close to that in prob_domain, and for which all doubles and floats
545 // between them will map to a cell inside domain.
546 GpuArray<ParticleReal , AMREX_SPACEDIM> roundoff_lo, roundoff_hi;
547
548 //
549 Box domain;
550
551 friend std::istream& operator>> (std::istream&, Geometry&);
552};
553
554
559std::ostream& operator<< (std::ostream&, const Geometry&);
564std::istream& operator>> (std::istream&, Geometry&);
565
572inline
573Geometry
574coarsen (Geometry const& fine, IntVect const& rr) {
575 Geometry r{fine};
576 r.coarsen(rr);
577 return r;
578}
579
586inline
587Geometry
588coarsen (Geometry const& fine, int rr) { return coarsen(fine, IntVect(rr)); }
589
596inline
597Geometry
598refine (Geometry const& crse, IntVect const& rr) {
599 Geometry r{crse};
600 r.refine(rr);
601 return r;
602}
603
610inline
611Geometry
612refine (Geometry const& crse, int rr) { return refine(crse, IntVect(rr)); }
613
618inline
619const Geometry&
621 return *(AMReX::top()->getDefaultGeometry());
622}
623
624}
625
626#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
Array4< Real > fine
Definition AMReX_InterpFaceRegister.cpp:90
Array4< Real const > crse
Definition AMReX_InterpFaceRegister.cpp:92
GpuArray< bool, 3 > is_periodic
Definition AMReX_MLEBNodeFDLaplacian.cpp:1101
#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:534
static AMReX * top() noexcept
Pointer to the most recently pushed instance.
Definition AMReX.H:516
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
__host__ __device__ IntVectND< dim > length() const noexcept
Return the length of the BoxND.
Definition AMReX_Box.H:167
__host__ __device__ BoxND & coarsen(int ref_ratio) noexcept
Coarsen BoxND by given (positive) refinement ratio. NOTE: if type(dir) = CELL centered: lo <- lo/rati...
Definition AMReX_Box.H:754
__host__ __device__ BoxND & refine(int ref_ratio) noexcept
Refine BoxND by given (positive) refinement ratio. NOTE: if type(dir) = CELL centered: lo <- lo*ratio...
Definition AMReX_Box.H:730
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:85
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:212
~Geometry()=default
GpuArray< ParticleReal, 3 > ProbLoArrayInParticleReal() const noexcept
Return the lo end of the roundoff domain in ParticleReal precision.
Definition AMReX_Geometry.H:227
void ProbDomain(const RealBox &rb)
Sets the problem domain.
Definition AMReX_Geometry.H:202
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:500
void coarsen(IntVect const &rr)
Coarsen the Geometry by rr.
Definition AMReX_Geometry.H:486
GpuArray< ParticleReal, 3 > ProbHiArrayInParticleReal() const noexcept
Return the hi end of the roundoff domain in ParticleReal precision.
Definition AMReX_Geometry.H:232
const Real * ProbHi() const noexcept
Returns the hi end of the problem domain in each dimension.
Definition AMReX_Geometry.H:210
__host__ static __device__ Real Volume(const IntVect &point, const GeometryData &geomdata)
Return the volume of the specified cell.
Definition AMReX_Geometry.H:275
bool isAnyPeriodic() const noexcept
Is domain periodic in any direction?
Definition AMReX_Geometry.H:399
Array< int, 3 > setPeriodicity(Array< int, 3 > const &period) noexcept
Set the periodicity flags and return the old flags.
Definition AMReX_Geometry.H:470
friend std::istream & operator>>(std::istream &, Geometry &)
Read a Geometry from an input stream in ASCII format.
Definition AMReX_Geometry.cpp:25
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:214
Geometry(const Geometry &rhs)=default
int period(int dir) const noexcept
What's period in specified direction?
Definition AMReX_Geometry.H:421
Geometry & operator=(const Geometry &rhs)=default
const Box & Domain() const noexcept
Returns our rectangular domain.
Definition AMReX_Geometry.H:244
void Domain(const Box &bx)
Sets our rectangular domain.
Definition AMReX_Geometry.H:246
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:415
const RealBox & ProbDomain() const noexcept
Returns the problem domain.
Definition AMReX_Geometry.H:200
Periodicity periodicity() const noexcept
Return the Periodicity based on the length of the domain.
Definition AMReX_Geometry.H:424
Array< int, 3 > isPeriodic() const noexcept
Return the periodicity flags for all directions as an Array.
Definition AMReX_Geometry.H:409
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:242
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:208
GeometryData data() const noexcept
Return a GPU-safe snapshot of the Geometry data.
Definition AMReX_Geometry.H:134
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:222
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:237
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:217
bool isAllPeriodic() const noexcept
Is domain periodic in all directions?
Definition AMReX_Geometry.H:404
bool isPeriodic(int dir) const noexcept
Is the domain periodic in the specified direction?
Definition AMReX_Geometry.H:397
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:529
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:533
Periodicity periodicity(const Box &b) const noexcept
Return the Periodicity based on the length of the cell-centered box b.
Definition AMReX_Geometry.H:431
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
__host__ __device__ const Real * lo() const &noexcept
Returns lo side.
Definition AMReX_RealBox.H:53
__host__ __device__ const Real * hi() const &noexcept
Returns hide side.
Definition AMReX_RealBox.H:58
__host__ __device__ Real length(int dir) const noexcept
Returns length in specified direction.
Definition AMReX_RealBox.H:69
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:1469
__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:1326
__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:1510
std::array< T, N > Array
Definition AMReX_Array.H:31
const Geometry & DefaultGeometry()
Return the default Geometry held by the top-level AMReX instance.
Definition AMReX_Geometry.H:620
Definition AMReX_Amr.cpp:50
std::ostream & operator<<(std::ostream &os, AmrMesh const &amr_mesh)
Stream helper; forwards to the friend declared inside AmrMesh.
Definition AMReX_AmrMesh.cpp:1372
__host__ __device__ void ignore_unused(const Ts &...)
No-op helper that marks variables as intentionally unused.
Definition AMReX.H:259
BoxND< 3 > Box
Box is an alias for amrex::BoxND instantiated with AMREX_SPACEDIM.
Definition AMReX_BaseFwd.H:35
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:1965
GPU-safe snapshot of Geometry data suitable for capture in GPU kernels.
Definition AMReX_Geometry.H:36
Box domain
Cell-centered index-space domain.
Definition AMReX_Geometry.H:67
__host__ __device__ Real ProbLo(int dir) const noexcept
Returns the lo end of the problem domain in direction dir.
Definition AMReX_Geometry.H:48
__host__ __device__ Real CellSize(int dir) const noexcept
Returns the cellsize for direction dir.
Definition AMReX_Geometry.H:42
__host__ __device__ int Coord() const noexcept
Coordinates type.
Definition AMReX_Geometry.H:63
__host__ __device__ const Box & Domain() const noexcept
Returns our rectangular domain.
Definition AMReX_Geometry.H:57
Real dx[3]
Cell size in each dimension.
Definition AMReX_Geometry.H:68
__host__ __device__ Real ProbHi(int dir) const noexcept
Returns the hi end of the problem domain in direction dir.
Definition AMReX_Geometry.H:54
__host__ __device__ const Real * CellSize() const noexcept
Returns the cellsize for each coordinate direction.
Definition AMReX_Geometry.H:39
int coord
Coordinate-system type: 0 for Cartesian, 1 for RZ, and 2 for spherical.
Definition AMReX_Geometry.H:70
__host__ __device__ int isPeriodic(const int i) const noexcept
Returns whether the domain is periodic in the given direction.
Definition AMReX_Geometry.H:60
int is_periodic[3]
For each dimension, 0 if the domain is non-periodic and 1 if it is.
Definition AMReX_Geometry.H:69
__host__ __device__ const Real * ProbLo() const noexcept
Returns the lo end of the problem domain in each dimension.
Definition AMReX_Geometry.H:45
RealBox prob_domain
Physical bounds of the problem domain.
Definition AMReX_Geometry.H:66
__host__ __device__ const Real * ProbHi() const noexcept
Returns the hi end of the problem domain in each dimension.
Definition AMReX_Geometry.H:51
Fixed-size array that can be used on GPU.
Definition AMReX_Array.H:52