Skip to content

Commit

Permalink
Prepare for amrex changes
Browse files Browse the repository at this point in the history
  • Loading branch information
WeiqunZhang committed Jan 21, 2024
1 parent 9b6de04 commit 42a43f7
Show file tree
Hide file tree
Showing 19 changed files with 155 additions and 155 deletions.
6 changes: 3 additions & 3 deletions Diagnostics/DustCollapse/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,17 +172,17 @@ int main(int argc, char* argv[])
const Box& bx = mfi.tilebox();

#if (AMREX_SPACEDIM == 1)
fdustcollapse1d(ARLIM_3D(bx.loVect()), ARLIM_3D(bx.hiVect()),
fdustcollapse1d(AMREX_ARLIM_3D(bx.loVect()), AMREX_ARLIM_3D(bx.hiVect()),
BL_TO_FORTRAN_FAB(lev_data_mf[mfi]),
nbins, dens.dataPtr(),
imask.dataPtr(), mask_size, r1, dens_comp, &cnt);
#elif (AMREX_SPACEDIM == 2)

fdustcollapse2d(ARLIM_3D(bx.loVect()), ARLIM_3D(bx.hiVect()),
fdustcollapse2d(AMREX_ARLIM_3D(bx.loVect()), AMREX_ARLIM_3D(bx.hiVect()),
BL_TO_FORTRAN_FAB(lev_data_mf[mfi]),
nbins, dens.dataPtr(), volcount.dataPtr(),
imask.dataPtr(), mask_size, r1,
ZFILL(level_dx), dx_fine, yctr, dens_comp);
AMREX_ZFILL(level_dx), dx_fine, yctr, dens_comp);
#else
fdustcollapse3d(bx.loVect(), bx.hiVect(),
BL_TO_FORTRAN_FAB(lev_data_mf[mfi]),
Expand Down
4 changes: 2 additions & 2 deletions Diagnostics/Radiation/gaussian_pulse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,11 @@ int main(int argc, char* argv[])
for (MFIter mfi(lev_data_mf, true); mfi.isValid(); ++mfi) {
const Box& bx = mfi.tilebox();

fgaussian_pulse(ARLIM_3D(bx.loVect()), ARLIM_3D(bx.hiVect()),
fgaussian_pulse(AMREX_ARLIM_3D(bx.loVect()), AMREX_ARLIM_3D(bx.hiVect()),
BL_TO_FORTRAN_FAB(lev_data_mf[mfi]),
nbins, rad_bin.dataPtr(), ncount.dataPtr(),
imask.dataPtr(), mask_size, r1,
rad_comp, ZFILL(dx), dx_fine, xctr, yctr);
rad_comp, AMREX_ZFILL(dx), dx_fine, xctr, yctr);

}

Expand Down
4 changes: 2 additions & 2 deletions Diagnostics/Radiation/lgt_frnt1d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,13 @@ int main(int argc, char* argv[])
for (MFIter mfi(lev_data_mf, true); mfi.isValid(); ++mfi) {
const Box& bx = mfi.tilebox();

flgt_frnt1d(ARLIM_3D(bx.loVect()), ARLIM_3D(bx.hiVect()),
flgt_frnt1d(AMREX_ARLIM_3D(bx.loVect()), AMREX_ARLIM_3D(bx.hiVect()),
BL_TO_FORTRAN_FAB(lev_data_mf[mfi]),
nbins, dens_bin.dataPtr(), vel_bin.dataPtr(),
pres_bin.dataPtr(), rad_bin.dataPtr(),
imask.dataPtr(), mask_size, r1,
dens_comp, xmom_comp, pres_comp, rad_comp,
ZFILL(dx), dx_fine);
AMREX_ZFILL(dx), dx_fine);
}

// adjust r1 for the next lowest level
Expand Down
2 changes: 1 addition & 1 deletion Diagnostics/Radiation/rad_shock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ int main(int argc, char* argv[])
for (MFIter mfi(lev_data_mf, true); mfi.isValid(); ++mfi) {
const Box& bx = mfi.tilebox();

fradshock(ARLIM_3D(bx.loVect()), ARLIM_3D(bx.hiVect()),
fradshock(AMREX_ARLIM_3D(bx.loVect()), AMREX_ARLIM_3D(bx.hiVect()),
problo.dataPtr(), probhi.dataPtr(),
BL_TO_FORTRAN_FAB(lev_data_mf[mfi]),
nbins, vars_bin.dataPtr(),
Expand Down
2 changes: 1 addition & 1 deletion Diagnostics/Radiation/rad_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ int main(int argc, char* argv[])

Real rhoe, rad;

fradsource(ARLIM_3D(bx.loVect()), ARLIM_3D(bx.hiVect()),
fradsource(AMREX_ARLIM_3D(bx.loVect()), AMREX_ARLIM_3D(bx.hiVect()),
BL_TO_FORTRAN_FAB(lev_data_mf[mfi]),
&rhoe, &rad, rhoe_comp, rad_comp);

Expand Down
6 changes: 3 additions & 3 deletions Diagnostics/Radiation/rad_sphere.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,12 @@ int main(int argc, char* argv[])
for (MFIter mfi(lev_data_mf, true); mfi.isValid(); ++mfi) {
const Box& bx = mfi.tilebox();

fradsphere(ARLIM_3D(bx.loVect()), ARLIM_3D(bx.hiVect()),
ZFILL(problo), ZFILL(probhi),
fradsphere(AMREX_ARLIM_3D(bx.loVect()), AMREX_ARLIM_3D(bx.hiVect()),
AMREX_ZFILL(problo), AMREX_ZFILL(probhi),
BL_TO_FORTRAN_FAB(lev_data_mf[mfi]),
nbins, vars_bin.dataPtr(),
imask.dataPtr(), mask_size, r1,
ZFILL(dx), &cnt);
AMREX_ZFILL(dx), &cnt);
}

// adjust r1 for the next lowest level
Expand Down
2 changes: 1 addition & 1 deletion Diagnostics/Radiation/rhd_shocktube.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ int main(int argc, char* argv[])
for (MFIter mfi(lev_data_mf, true); mfi.isValid(); ++mfi) {
const Box& bx = mfi.tilebox();

frhdshocktube(ARLIM_3D(bx.loVect()), ARLIM_3D(bx.hiVect()),
frhdshocktube(AMREX_ARLIM_3D(bx.loVect()), AMREX_ARLIM_3D(bx.hiVect()),
BL_TO_FORTRAN_FAB(lev_data_mf[mfi]),
nbins, dens_bin.dataPtr(), vel_bin.dataPtr(),
pres_bin.dataPtr(), rad_bin.dataPtr(),
Expand Down
4 changes: 2 additions & 2 deletions Docs/source/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ Debugging

::

print_state(mf, IntVect(D_DECL(10, 20, 30)));
print_state(mf, IntVect(AMREX_D_DECL(10, 20, 30)));

Here, the IntVect has the dimension that we were compiled with
(and this is handled through the preprocessor ``D_DECL``). In
(and this is handled through the preprocessor ``AMREX_D_DECL``). In
this case, we are inspecting zone (10, 20, 30), in the global index
space. Note that since a multifab exists only on a single level, the
integer indices here refer to the global index space on that level.
Expand Down
36 changes: 18 additions & 18 deletions Exec/science/Detonation/problem_bc_fill.H
Original file line number Diff line number Diff line change
Expand Up @@ -63,39 +63,39 @@ void problem_bc_fill(int i, int j, int k,
// Note: in these checks we're only looking at the boundary
// conditions on the first state component (density).

if (i < domlo[0] && (bcs(0).lo(0) != REFLECT_ODD &&
bcs(0).lo(0) != INT_DIR &&
bcs(0).lo(0) != REFLECT_EVEN)) {
if (i < domlo[0] && (bcs(0).lo(0) != amrex::BCType::reflect_odd &&
bcs(0).lo(0) != amrex::BCType::int_dir &&
bcs(0).lo(0) != amrex::BCType::reflect_even)) {
do_ambient_fill = true;
}
else if (i > domhi[0] && (bcs(0).hi(0) != REFLECT_ODD &&
bcs(0).hi(0) != INT_DIR &&
bcs(0).hi(0) != REFLECT_ODD)) {
else if (i > domhi[0] && (bcs(0).hi(0) != amrex::BCType::reflect_odd &&
bcs(0).hi(0) != amrex::BCType::int_dir &&
bcs(0).hi(0) != amrex::BCType::reflect_odd)) {
do_ambient_fill = true;
}

if (AMREX_SPACEDIM >= 2) {
if (j < domlo[1] && (bcs(0).lo(1) != REFLECT_ODD &&
bcs(0).lo(1) != INT_DIR &&
bcs(0).lo(1) != REFLECT_ODD)) {
if (j < domlo[1] && (bcs(0).lo(1) != amrex::BCType::reflect_odd &&
bcs(0).lo(1) != amrex::BCType::int_dir &&
bcs(0).lo(1) != amrex::BCType::reflect_odd)) {
do_ambient_fill = true;
}
else if (j > domhi[1] && (bcs(0).hi(1) != REFLECT_ODD &&
bcs(0).hi(1) != INT_DIR &&
bcs(0).hi(1) != REFLECT_ODD)) {
else if (j > domhi[1] && (bcs(0).hi(1) != amrex::BCType::reflect_odd &&
bcs(0).hi(1) != amrex::BCType::int_dir &&
bcs(0).hi(1) != amrex::BCType::reflect_odd)) {
do_ambient_fill = true;
}
}

if (AMREX_SPACEDIM == 3) {
if (k < domlo[2] && (bcs(0).lo(2) != REFLECT_ODD &&
bcs(0).lo(2) != INT_DIR &&
bcs(0).lo(2) != REFLECT_ODD)) {
if (k < domlo[2] && (bcs(0).lo(2) != amrex::BCType::reflect_odd &&
bcs(0).lo(2) != amrex::BCType::int_dir &&
bcs(0).lo(2) != amrex::BCType::reflect_odd)) {
do_ambient_fill = true;
}
else if (k > domhi[2] && (bcs(0).hi(2) != REFLECT_ODD &&
bcs(0).hi(2) != INT_DIR &&
bcs(0).hi(2) != REFLECT_ODD)) {
else if (k > domhi[2] && (bcs(0).hi(2) != amrex::BCType::reflect_odd &&
bcs(0).hi(2) != amrex::BCType::int_dir &&
bcs(0).hi(2) != amrex::BCType::reflect_odd)) {
do_ambient_fill = true;
}
}
Expand Down
16 changes: 8 additions & 8 deletions Source/radiation/HABEC.H
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ namespace HABEC

Real bfv, bfm, bfm2;

if (bct == LO_DIRICHLET) {
if (bct == AMREX_LO_DIRICHLET) {
if (bho >= 1) {
Real h2 = 0.5e0_rt * h;
Real th2 = 3.e0_rt * h2;
Expand Down Expand Up @@ -306,7 +306,7 @@ namespace HABEC
else {
bct = bctype;
}
if (bct == LO_DIRICHLET) {
if (bct == AMREX_LO_DIRICHLET) {
if (bho >= 1) {
h2 = 0.5e0_rt * h;
th2 = 3.e0_rt * h2;
Expand All @@ -319,12 +319,12 @@ namespace HABEC
bfm = bfv;
}
}
else if (bct == LO_NEUMANN) {
else if (bct == AMREX_LO_NEUMANN) {
bfv = beta * r;
bfm = 0.e0_rt;
bfm2 = 0.e0_rt;
}
else if (bct == LO_MARSHAK) {
else if (bct == AMREX_LO_MARSHAK) {
bfv = 2.e0_rt * beta * r;
if (bho >= 1) {
bfm = 0.375e0_rt * c * bfv;
Expand All @@ -334,7 +334,7 @@ namespace HABEC
bfm = 0.25e0_rt * c * bfv;
}
}
else if (bct == LO_SANCHEZ_POMRANING) {
else if (bct == AMREX_LO_SANCHEZ_POMRANING) {
bfv = 2.e0_rt * beta * r;
if (bho >= 1) {
bfm = 1.5e0_rt * spa(i,j,k) * c * bfv;
Expand Down Expand Up @@ -457,7 +457,7 @@ namespace HABEC
{
if (mask.contains(i+icp,j+jcp,k+kcp)) {
if (mask(i+icp,j+jcp,k+kcp) > 0) {
if (bct == LO_DIRICHLET) {
if (bct == AMREX_LO_DIRICHLET) {
Real d_sign = 1.0_rt;
if (iep != 0 || jep != 0 || kep != 0) {
// right edge
Expand Down Expand Up @@ -568,15 +568,15 @@ namespace HABEC
else {
bct = bctype;
}
if (bct == LO_DIRICHLET) {
if (bct == AMREX_LO_DIRICHLET) {
Real d_sign = 1.0_rt;
if (iep != 0 || jep != 0 || kep != 0) {
// right edge
d_sign = -1.0_rt;
}
dterm(i+iep,j+jep,k+kep) = d(i+iep,j+jep,k+kep) * d_sign * (er(i,j,k) - bcval(i+icp,j+jcp,k+kcp)) / (0.5_rt * h + bcl);
}
else if (bct == LO_NEUMANN && bcval(i+icp,j+jcp,k+kcp) == 0.0_rt) {
else if (bct == AMREX_LO_NEUMANN && bcval(i+icp,j+jcp,k+kcp) == 0.0_rt) {
dterm(i+iep,j+jep,k+kep) = 0.0_rt;
}
}
Expand Down
Loading

0 comments on commit 42a43f7

Please sign in to comment.