MCPcopy Create free account
hub / github.com/AMReX-Codes/amrex / getIndexBox

Function getIndexBox

Src/Base/AMReX_MultiFabUtil.cpp:12–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10 using namespace amrex;
11
12 Box
13 getIndexBox (const RealBox& real_box, const Geometry& geom) {
14 IntVect slice_lo, slice_hi;
15
16 AMREX_D_TERM(slice_lo[0]=static_cast<int>(std::floor((real_box.lo(0) - geom.ProbLo(0))/geom.CellSize(0)));,
17 slice_lo[1]=static_cast<int>(std::floor((real_box.lo(1) - geom.ProbLo(1))/geom.CellSize(1)));,
18 slice_lo[2]=static_cast<int>(std::floor((real_box.lo(2) - geom.ProbLo(2))/geom.CellSize(2))););
19
20 AMREX_D_TERM(slice_hi[0]=static_cast<int>(std::floor((real_box.hi(0) - geom.ProbLo(0))/geom.CellSize(0)));,
21 slice_hi[1]=static_cast<int>(std::floor((real_box.hi(1) - geom.ProbLo(1))/geom.CellSize(1)));,
22 slice_hi[2]=static_cast<int>(std::floor((real_box.hi(2) - geom.ProbLo(2))/geom.CellSize(2))););
23
24 return Box(slice_lo, slice_hi) & geom.Domain();
25 }
26
27
28 std::unique_ptr<MultiFab> allocateSlice (int dir, const MultiFab& cell_centered_data,

Callers 1

allocateSliceFunction · 0.85

Calls 6

AMREX_D_TERMFunction · 0.50
loMethod · 0.45
ProbLoMethod · 0.45
CellSizeMethod · 0.45
hiMethod · 0.45
DomainMethod · 0.45

Tested by

no test coverage detected