Skip to content

Commit

Permalink
Merge branch 'main' of github.com:AMReX-FHD/FHDeX into main
Browse files Browse the repository at this point in the history
  • Loading branch information
jbbel committed Feb 6, 2024
2 parents c5c17e3 + 16f671d commit bc8297c
Show file tree
Hide file tree
Showing 21 changed files with 374 additions and 398 deletions.
4 changes: 2 additions & 2 deletions exec/immersed_boundary/channel_dumbbell/main_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()));

}

Expand Down
8 changes: 4 additions & 4 deletions exec/immersed_boundary/channel_multiblob/main_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()));

}

Expand Down
10 changes: 5 additions & 5 deletions exec/immersed_boundary/channel_rigid/main_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()));

}

Expand Down Expand Up @@ -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()));
// }
// }

Expand Down
2 changes: 1 addition & 1 deletion exec/immersed_boundary/flagellum/main_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion exec/immersed_boundary/taylor_line/main_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
34 changes: 17 additions & 17 deletions src_common/BCPhysToMath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
Expand All @@ -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;
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions src_common/ComputeDivAndGrad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
Loading

0 comments on commit bc8297c

Please sign in to comment.