1 #ifndef ERF_SBM_INVENTORY_H_
2 #define ERF_SBM_INVENTORY_H_
5 #include <AMReX_IntVect.H>
6 #include <AMReX_ParallelDescriptor.H>
7 #include <AMReX_REAL.H>
33 inline InventoryRoundoff
35 const std::uint64_t fine_cells,
36 const amrex::IntVect& ratio,
37 const bool with_prolongation,
38 const std::uint64_t leaf_updates = 0,
39 const std::uint64_t boundary_face_terms = 0)
41 std::uint64_t refinement_volume = 1U;
42 for (
int dir = 0; dir < AMREX_SPACEDIM; ++dir) {
43 refinement_volume *=
static_cast<std::uint64_t
>(ratio[dir]);
46 fine_cells % refinement_volume == 0
U &&
47 coarse_cells >= fine_cells / refinement_volume);
49 roundoff.
leaf_cell_terms = coarse_cells - fine_cells / refinement_volume + fine_cells;
50 for (
int ranks = amrex::ParallelDescriptor::NProcs(); ranks > 1;
51 ranks = (ranks + 1) / 2) {
55 8U * roundoff.
leaf_cell_terms * (1U + leaf_updates) + 6U * boundary_face_terms +
57 (with_prolongation ? refinement_volume + 6U : 0
U);
61 "SBM composite inventory check: operation count times machine epsilon "
62 "reaches one, so this grid cannot be checked at this precision");
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(axis >=0 &&axis< AMREX_SPACEDIM, "prob.axis must be 0, 1 or 2")
AMREX_ALWAYS_ASSERT(bx.length()[2]==khi+1)
@ U
Definition: ERF_IndexDefines.H:178
@ q
Definition: ERF_WSM6.H:296
InventoryRoundoff composite_inventory_roundoff(const std::uint64_t coarse_cells, const std::uint64_t fine_cells, const amrex::IntVect &ratio, const bool with_prolongation, const std::uint64_t leaf_updates=0, const std::uint64_t boundary_face_terms=0)
Definition: ERF_SBMInventory.H:34
real(c_double), parameter epsilon
Definition: ERF_module_model_constants.F90:12
Definition: ERF_SBMInventory.H:15
std::uint64_t leaf_cell_terms
Definition: ERF_SBMInventory.H:16
amrex::Real rounding_factor
Definition: ERF_SBMInventory.H:19
int reduction_depth
Definition: ERF_SBMInventory.H:18
std::uint64_t operation_count
Definition: ERF_SBMInventory.H:17