Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare for amrex changes #147

Merged
merged 1 commit into from
Jan 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prepare for amrex changes
  • Loading branch information
WeiqunZhang committed Jan 22, 2024
commit 87ff1fe0032dee3e37580859714c322cd5353161
4 changes: 2 additions & 2 deletions exec/immersed_boundary/channel_dumbbell/main_driver.cpp
Original file line number Diff line number Diff line change
@@ -343,13 +343,13 @@ void main_driver(const char * argv) {
init_vel(BL_TO_FORTRAN_BOX(bx),
BL_TO_FORTRAN_ANYD(umac[d][mfi]), geom.CellSize(),
geom.ProbLo(), geom.ProbHi(), & d,
ZFILL(realDomain.lo()), ZFILL(realDomain.hi()),
AMREX_ZFILL(realDomain.lo()), AMREX_ZFILL(realDomain.hi()),
&prob_type);

// initialize tracer
init_s_vel(BL_TO_FORTRAN_BOX(bx),
BL_TO_FORTRAN_ANYD(tracer[mfi]),
dx, ZFILL(realDomain.lo()), ZFILL(realDomain.hi()));
dx, AMREX_ZFILL(realDomain.lo()), AMREX_ZFILL(realDomain.hi()));

}

8 changes: 4 additions & 4 deletions exec/immersed_boundary/channel_multiblob/main_driver.cpp
Original file line number Diff line number Diff line change
@@ -411,20 +411,20 @@ void main_driver(const char * argv) {
AMREX_D_TERM(dm=0; init_vel(BL_TO_FORTRAN_BOX(bx),
BL_TO_FORTRAN_ANYD(umac[0][mfi]), geom.CellSize(),
geom.ProbLo(), geom.ProbHi() ,&dm,
ZFILL(realDomain.lo()), ZFILL(realDomain.hi()));,
AMREX_ZFILL(realDomain.lo()), AMREX_ZFILL(realDomain.hi()));,
dm=1; init_vel(BL_TO_FORTRAN_BOX(bx),
BL_TO_FORTRAN_ANYD(umac[1][mfi]), geom.CellSize(),
geom.ProbLo(), geom.ProbHi() ,&dm,
ZFILL(realDomain.lo()), ZFILL(realDomain.hi()));,
AMREX_ZFILL(realDomain.lo()), AMREX_ZFILL(realDomain.hi()));,
dm=2; init_vel(BL_TO_FORTRAN_BOX(bx),
BL_TO_FORTRAN_ANYD(umac[2][mfi]), geom.CellSize(),
geom.ProbLo(), geom.ProbHi() ,&dm,
ZFILL(realDomain.lo()), ZFILL(realDomain.hi())););
AMREX_ZFILL(realDomain.lo()), AMREX_ZFILL(realDomain.hi())););

// initialize tracer
init_s_vel(BL_TO_FORTRAN_BOX(bx),
BL_TO_FORTRAN_ANYD(tracer[mfi]),
dx, ZFILL(realDomain.lo()), ZFILL(realDomain.hi()));
dx, AMREX_ZFILL(realDomain.lo()), AMREX_ZFILL(realDomain.hi()));

}

10 changes: 5 additions & 5 deletions exec/immersed_boundary/channel_rigid/main_driver.cpp
Original file line number Diff line number Diff line change
@@ -324,20 +324,20 @@ void main_driver(const char * argv) {
AMREX_D_TERM(dm=0; init_vel(BL_TO_FORTRAN_BOX(bx),
BL_TO_FORTRAN_ANYD(umac[0][mfi]), geom.CellSize(),
geom.ProbLo(), geom.ProbHi(), & dm,
ZFILL(realDomain.lo()), ZFILL(realDomain.hi()));,
AMREX_ZFILL(realDomain.lo()), AMREX_ZFILL(realDomain.hi()));,
dm=1; init_vel(BL_TO_FORTRAN_BOX(bx),
BL_TO_FORTRAN_ANYD(umac[1][mfi]), geom.CellSize(),
geom.ProbLo(), geom.ProbHi(), & dm,
ZFILL(realDomain.lo()), ZFILL(realDomain.hi()));,
AMREX_ZFILL(realDomain.lo()), AMREX_ZFILL(realDomain.hi()));,
dm=2; init_vel(BL_TO_FORTRAN_BOX(bx),
BL_TO_FORTRAN_ANYD(umac[2][mfi]), geom.CellSize(),
geom.ProbLo(), geom.ProbHi(), & dm,
ZFILL(realDomain.lo()), ZFILL(realDomain.hi())););
AMREX_ZFILL(realDomain.lo()), AMREX_ZFILL(realDomain.hi())););

// initialize tracer
init_s_vel(BL_TO_FORTRAN_BOX(bx),
BL_TO_FORTRAN_ANYD(tracer[mfi]),
dx, ZFILL(realDomain.lo()), ZFILL(realDomain.hi()));
dx, AMREX_ZFILL(realDomain.lo()), AMREX_ZFILL(realDomain.hi()));

}

@@ -454,7 +454,7 @@ void main_driver(const char * argv) {
// const Box& bx = mfi.validbox();
// init_s_vel(BL_TO_FORTRAN_BOX(bx),
// BL_TO_FORTRAN_ANYD(mf_cc[0][mfi]),
// dx, ZFILL(realDomain.lo()), ZFILL(realDomain.hi()));
// dx, AMREX_ZFILL(realDomain.lo()), AMREX_ZFILL(realDomain.hi()));
// }
// }

2 changes: 1 addition & 1 deletion exec/immersed_boundary/flagellum/main_driver.cpp
Original file line number Diff line number Diff line change
@@ -544,7 +544,7 @@ void main_driver(const char * argv) {
init_vel(BL_TO_FORTRAN_BOX(bx),
BL_TO_FORTRAN_ANYD(umac[d][mfi]), geom.CellSize(),
geom.ProbLo(), geom.ProbHi(), & d,
ZFILL(realDomain.lo()), ZFILL(realDomain.hi()),
AMREX_ZFILL(realDomain.lo()), AMREX_ZFILL(realDomain.hi()),
&prob_type);
}

2 changes: 1 addition & 1 deletion exec/immersed_boundary/taylor_line/main_driver.cpp
Original file line number Diff line number Diff line change
@@ -538,7 +538,7 @@ void main_driver(const char * argv) {
init_vel(BL_TO_FORTRAN_BOX(bx),
BL_TO_FORTRAN_ANYD(umac[d][mfi]), geom.CellSize(),
geom.ProbLo(), geom.ProbHi(), & d,
ZFILL(realDomain.lo()), ZFILL(realDomain.hi()),
AMREX_ZFILL(realDomain.lo()), AMREX_ZFILL(realDomain.hi()),
&prob_type);
}

34 changes: 17 additions & 17 deletions src_common/BCPhysToMath.cpp
Original file line number Diff line number Diff line change
@@ -10,24 +10,24 @@ void BCPhysToMath(int bccomp, amrex::Vector<int>& bc_lo, amrex::Vector<int>& bc_

// set to interior/periodic by default; overwrite below
for (int i=0; i<AMREX_SPACEDIM; ++i) {
bc_lo[i] = bc_hi[i] = INT_DIR;
bc_lo[i] = bc_hi[i] = amrex::BCType::int_dir;
}

if (bccomp == PRES_BC_COMP) { // PRESSURE
for (int i=0; i<AMREX_SPACEDIM; ++i) {
if (bc_vel_lo[i] == 1 || bc_vel_lo[i] == 2) {
// wall -> first-order extrapolation
bc_lo[i] = FOEXTRAP;
bc_lo[i] = amrex::BCType::foextrap;
} else if (bc_vel_lo[i] == -2) {
// pressure inflow
bc_lo[i] = EXT_DIR;
bc_lo[i] = amrex::BCType::ext_dir;
}
if (bc_vel_hi[i] == 1 || bc_vel_hi[i] == 2) {
// wall -> first-order extrapolation
bc_hi[i] = FOEXTRAP;
bc_hi[i] = amrex::BCType::foextrap;
} else if (bc_vel_hi[i] == -2) {
// pressure inflow
bc_hi[i] = EXT_DIR;
bc_hi[i] = amrex::BCType::ext_dir;
}
}
}
@@ -37,59 +37,59 @@ void BCPhysToMath(int bccomp, amrex::Vector<int>& bc_lo, amrex::Vector<int>& bc_
for (int i=0; i<AMREX_SPACEDIM; ++i) {
if (bc_mass_lo[i] == 1) {
// wall -> first-order extrapolation
bc_lo[i] = FOEXTRAP;
bc_lo[i] = amrex::BCType::foextrap;
}
else if (bc_mass_lo[i] == 2) {
// reservoir -> dirichlet
bc_lo[i] = EXT_DIR;
bc_lo[i] = amrex::BCType::ext_dir;
}
if (bc_mass_hi[i] == 1) {
// wall -> first-order extrapolation
bc_hi[i] = FOEXTRAP;
bc_hi[i] = amrex::BCType::foextrap;
}
else if (bc_mass_hi[i] == 2) {
// reservoir -> dirichlet
bc_hi[i] = EXT_DIR;
bc_hi[i] = amrex::BCType::ext_dir;
}
}
}
else if (bccomp == TEMP_BC_COMP) { // TEMPERATURE
for (int i=0; i<AMREX_SPACEDIM; ++i) {
if (bc_therm_lo[i] == 1) {
// adiabtic -> first-order extrapolation
bc_lo[i] = FOEXTRAP;
bc_lo[i] = amrex::BCType::foextrap;
}
else if (bc_therm_lo[i] == 2) {
// isothermal -> dirichlet
bc_lo[i] = EXT_DIR;
bc_lo[i] = amrex::BCType::ext_dir;
}
if (bc_therm_hi[i] == 1) {
// adiabatic -> first-order extrapolation
bc_hi[i] = FOEXTRAP;
bc_hi[i] = amrex::BCType::foextrap;
}
else if (bc_therm_hi[i] == 2) {
// isothermal -> dirichlet
bc_hi[i] = EXT_DIR;
bc_hi[i] = amrex::BCType::ext_dir;
}
}
}
else if (bccomp == EPOT_BC_COMP) { // ELECTRIC POTENTIAL
for (int i=0; i<AMREX_SPACEDIM; ++i) {
if (bc_es_lo[i] == 1) {
// dirichlet
bc_lo[i] = EXT_DIR;
bc_lo[i] = amrex::BCType::ext_dir;
}
else if (bc_es_lo[i] == 2) {
// neumann
bc_lo[i] = FOEXTRAP;
bc_lo[i] = amrex::BCType::foextrap;
}
if (bc_es_hi[i] == 1) {
// dirichlet
bc_hi[i] = EXT_DIR;
bc_hi[i] = amrex::BCType::ext_dir;
}
else if (bc_es_hi[i] == 2) {
// neumann
bc_hi[i] = FOEXTRAP;
bc_hi[i] = amrex::BCType::foextrap;
}
}
}
12 changes: 6 additions & 6 deletions src_common/ComputeDivAndGrad.cpp
Original file line number Diff line number Diff line change
@@ -92,7 +92,7 @@ void ComputeGrad(const MultiFab & phi_in, std::array<MultiFab, AMREX_SPACEDIM> &
// boundary conditions
// note: at physical boundaries,
// alter stencil at boundary since ghost value represents value at boundary
if (bc_lo[0] == FOEXTRAP || bc_lo[0] == EXT_DIR) {
if (bc_lo[0] == amrex::BCType::foextrap || bc_lo[0] == amrex::BCType::ext_dir) {
if (bx_x.smallEnd(0) <= dom.smallEnd(0)) {
int lo = dom.smallEnd(0);
amrex::ParallelFor(bx_x, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
@@ -106,7 +106,7 @@ void ComputeGrad(const MultiFab & phi_in, std::array<MultiFab, AMREX_SPACEDIM> &
}
}

if (bc_hi[0] == FOEXTRAP || bc_hi[0] == EXT_DIR) {
if (bc_hi[0] == amrex::BCType::foextrap || bc_hi[0] == amrex::BCType::ext_dir) {
if (bx_x.bigEnd(0) >= dom.bigEnd(0)+1) {
int hi = dom.bigEnd(0)+1;
amrex::ParallelFor(bx_x, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
@@ -120,7 +120,7 @@ void ComputeGrad(const MultiFab & phi_in, std::array<MultiFab, AMREX_SPACEDIM> &
}
}

if (bc_lo[1] == FOEXTRAP || bc_lo[1] == EXT_DIR) {
if (bc_lo[1] == amrex::BCType::foextrap || bc_lo[1] == amrex::BCType::ext_dir) {
if (bx_y.smallEnd(1) <= dom.smallEnd(1)) {
int lo = dom.smallEnd(1);
amrex::ParallelFor(bx_y, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
@@ -134,7 +134,7 @@ void ComputeGrad(const MultiFab & phi_in, std::array<MultiFab, AMREX_SPACEDIM> &
}
}

if (bc_hi[1] == FOEXTRAP || bc_hi[1] == EXT_DIR) {
if (bc_hi[1] == amrex::BCType::foextrap || bc_hi[1] == amrex::BCType::ext_dir) {
if (bx_y.bigEnd(1) >= dom.bigEnd(1)+1) {
int hi = dom.bigEnd(1)+1;
amrex::ParallelFor(bx_y, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
@@ -149,7 +149,7 @@ void ComputeGrad(const MultiFab & phi_in, std::array<MultiFab, AMREX_SPACEDIM> &
}

#if (AMREX_SPACEDIM == 3)
if (bc_lo[2] == FOEXTRAP || bc_lo[2] == EXT_DIR) {
if (bc_lo[2] == amrex::BCType::foextrap || bc_lo[2] == amrex::BCType::ext_dir) {
if (bx_z.smallEnd(2) <= dom.smallEnd(2)) {
int lo = dom.smallEnd(2);
amrex::ParallelFor(bx_z, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
@@ -163,7 +163,7 @@ void ComputeGrad(const MultiFab & phi_in, std::array<MultiFab, AMREX_SPACEDIM> &
}
}

if (bc_hi[2] == FOEXTRAP || bc_hi[2] == EXT_DIR) {
if (bc_hi[2] == amrex::BCType::foextrap || bc_hi[2] == amrex::BCType::ext_dir) {
if (bx_z.bigEnd(2) >= dom.bigEnd(2)+1) {
int hi = dom.bigEnd(2)+1;
amrex::ParallelFor(bx_z, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
Loading
Loading