Skip to content

Commit

Permalink
avoiding merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
ajnonaka committed Apr 2, 2024
1 parent 95903b5 commit fa397c7
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 83 deletions.
46 changes: 23 additions & 23 deletions src_common/BCPhysToMath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,52 +10,52 @@ 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] = BCType::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] = BCType::foextrap;
bc_lo[i] = amrex::BCType::foextrap;
} else if (bc_vel_lo[i] == -2) {
// pressure inflow
bc_lo[i] = BCType::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] = BCType::foextrap;
bc_hi[i] = amrex::BCType::foextrap;
} else if (bc_vel_hi[i] == -2) {
// pressure inflow
bc_hi[i] = BCType::ext_dir;
bc_hi[i] = amrex::BCType::ext_dir;
}
}
}
else if (bccomp == RHO_BC_COMP ) { // density
for (int i=0; i<AMREX_SPACEDIM; ++i) {
if (bc_mass_lo[i] == 1) {
// wall -> first-order extrapolation
bc_lo[i] = BCType::foextrap;
bc_lo[i] = amrex::BCType::foextrap;
}
else if (bc_mass_lo[i] == 2) {
// reservoir -> dirichlet
bc_lo[i] = BCType::ext_dir;
bc_lo[i] = amrex::BCType::ext_dir;
}
else if (bc_mass_lo[i] == 4) {
// reservoir -> dirichlet
bc_lo[i] = BCType::foextrap;
bc_lo[i] = amrex::BCType::foextrap;
}
if (bc_mass_hi[i] == 1) {
// wall -> first-order extrapolation
bc_hi[i] = BCType::foextrap;
bc_hi[i] = amrex::BCType::foextrap;
}
else if (bc_mass_hi[i] == 2) {
// reservoir -> dirichlet
bc_hi[i] = BCType::ext_dir;
bc_hi[i] = amrex::BCType::ext_dir;
}
else if (bc_mass_hi[i] == 4) {
// reservoir -> dirichlet
bc_hi[i] = BCType::foextrap;
bc_hi[i] = amrex::BCType::foextrap;
}
}
}
Expand All @@ -64,23 +64,23 @@ 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] = BCType::foextrap;
bc_lo[i] = amrex::BCType::foextrap;
}
else if (bc_mass_lo[i] == 2) {
// reservoir -> dirichlet
bc_lo[i] = BCType::ext_dir;
bc_lo[i] = amrex::BCType::ext_dir;
}
else if (bc_mass_lo[i] == 4) {
// reservoir -> dirichlet
bc_lo[i] = SPEC_CONTACT_BC;
}
if (bc_mass_hi[i] == 1) {
// wall -> first-order extrapolation
bc_hi[i] = BCType::foextrap;
bc_hi[i] = amrex::BCType::foextrap;
}
else if (bc_mass_hi[i] == 2) {
// reservoir -> dirichlet
bc_hi[i] = BCType::ext_dir;
bc_hi[i] = amrex::BCType::ext_dir;
}
else if (bc_mass_hi[i] == 4) {
// reservoir -> dirichlet
Expand All @@ -92,39 +92,39 @@ void BCPhysToMath(int bccomp, amrex::Vector<int>& bc_lo, amrex::Vector<int>& bc_
for (int i=0; i<AMREX_SPACEDIM; ++i) {
if (bc_therm_lo[i] == 1) {
// adiabtic -> first-order extrapolation
bc_lo[i] = BCType::foextrap;
bc_lo[i] = amrex::BCType::foextrap;
}
else if (bc_therm_lo[i] == 2) {
// isothermal -> dirichlet
bc_lo[i] = BCType::ext_dir;
bc_lo[i] = amrex::BCType::ext_dir;
}
if (bc_therm_hi[i] == 1) {
// adiabatic -> first-order extrapolation
bc_hi[i] = BCType::foextrap;
bc_hi[i] = amrex::BCType::foextrap;
}
else if (bc_therm_hi[i] == 2) {
// isothermal -> dirichlet
bc_hi[i] = BCType::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] = BCType::ext_dir;
bc_lo[i] = amrex::BCType::ext_dir;
}
else if (bc_es_lo[i] == 2) {
// neumann
bc_lo[i] = BCType::foextrap;
bc_lo[i] = amrex::BCType::foextrap;
}
if (bc_es_hi[i] == 1) {
// dirichlet
bc_hi[i] = BCType::ext_dir;
bc_hi[i] = amrex::BCType::ext_dir;
}
else if (bc_es_hi[i] == 2) {
// neumann
bc_hi[i] = BCType::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] == BCType::foextrap || bc_lo[0] == BCType::ext_dir || bc_lo[0] == SPEC_CONTACT_BC) {
if (bc_lo[0] == amrex::BCType::foextrap || bc_lo[0] == amrex::BCType::ext_dir || bc_lo[0] == SPEC_CONTACT_BC) {
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] == BCType::foextrap || bc_hi[0] == BCType::ext_dir || bc_hi[0] == SPEC_CONTACT_BC) {
if (bc_hi[0] == amrex::BCType::foextrap || bc_hi[0] == amrex::BCType::ext_dir || bc_hi[0] == SPEC_CONTACT_BC) {
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] == BCType::foextrap || bc_lo[1] == BCType::ext_dir || bc_lo[1] == SPEC_CONTACT_BC) {
if (bc_lo[1] == amrex::BCType::foextrap || bc_lo[1] == amrex::BCType::ext_dir || bc_lo[1] == SPEC_CONTACT_BC) {
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] == BCType::foextrap || bc_hi[1] == BCType::ext_dir || bc_hi[1] == SPEC_CONTACT_BC) {
if (bc_hi[1] == amrex::BCType::foextrap || bc_hi[1] == amrex::BCType::ext_dir || bc_hi[1] == SPEC_CONTACT_BC) {
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] == BCType::foextrap || bc_lo[2] == BCType::ext_dir || bc_lo[2] == SPEC_CONTACT_BC) {
if (bc_lo[2] == amrex::BCType::foextrap || bc_lo[2] == amrex::BCType::ext_dir || bc_lo[2] == SPEC_CONTACT_BC) {
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] == BCType::foextrap || bc_hi[2] == BCType::ext_dir || bc_hi[2] == SPEC_CONTACT_BC) {
if (bc_hi[2] == amrex::BCType::foextrap || bc_hi[2] == amrex::BCType::ext_dir || bc_hi[2] == SPEC_CONTACT_BC) {
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
36 changes: 18 additions & 18 deletions src_common/ConvertStag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void AverageCCToFace(const MultiFab& cc_in, std::array<MultiFab, AMREX_SPACEDIM>
// note: at physical boundaries,
// the value in the ghost cells represent the value ON the boundary
// so we simply copy the ghost cell value into the value on the domain (and ghost faces too)
if (bc_lo[0] == BCType::foextrap || bc_lo[0] == BCType::ext_dir || bc_lo[0] == SPEC_CONTACT_BC) {
if (bc_lo[0] == amrex::BCType::foextrap || bc_lo[0] == amrex::BCType::ext_dir || bc_lo[0] == SPEC_CONTACT_BC) {
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 @@ -93,7 +93,7 @@ void AverageCCToFace(const MultiFab& cc_in, std::array<MultiFab, AMREX_SPACEDIM>
}
}

if (bc_hi[0] == BCType::foextrap || bc_hi[0] == BCType::ext_dir || bc_hi[0] == SPEC_CONTACT_BC) {
if (bc_hi[0] == amrex::BCType::foextrap || bc_hi[0] == amrex::BCType::ext_dir || bc_hi[0] == SPEC_CONTACT_BC) {
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 @@ -105,7 +105,7 @@ void AverageCCToFace(const MultiFab& cc_in, std::array<MultiFab, AMREX_SPACEDIM>
}
}

if (bc_lo[1] == BCType::foextrap || bc_lo[1] == BCType::ext_dir || bc_lo[1] == SPEC_CONTACT_BC) {
if (bc_lo[1] == amrex::BCType::foextrap || bc_lo[1] == amrex::BCType::ext_dir || bc_lo[1] == SPEC_CONTACT_BC) {
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 @@ -117,7 +117,7 @@ void AverageCCToFace(const MultiFab& cc_in, std::array<MultiFab, AMREX_SPACEDIM>
}
}

if (bc_hi[1] == BCType::foextrap || bc_hi[1] == BCType::ext_dir || bc_hi[1] == SPEC_CONTACT_BC) {
if (bc_hi[1] == amrex::BCType::foextrap || bc_hi[1] == amrex::BCType::ext_dir || bc_hi[1] == SPEC_CONTACT_BC) {
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 @@ -130,7 +130,7 @@ void AverageCCToFace(const MultiFab& cc_in, std::array<MultiFab, AMREX_SPACEDIM>
}

#if (AMREX_SPACEDIM == 3)
if (bc_lo[2] == BCType::foextrap || bc_lo[2] == BCType::ext_dir || bc_lo[2] == SPEC_CONTACT_BC) {
if (bc_lo[2] == amrex::BCType::foextrap || bc_lo[2] == amrex::BCType::ext_dir || bc_lo[2] == SPEC_CONTACT_BC) {
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 @@ -142,7 +142,7 @@ void AverageCCToFace(const MultiFab& cc_in, std::array<MultiFab, AMREX_SPACEDIM>
}
}

if (bc_hi[2] == BCType::foextrap || bc_hi[2] == BCType::ext_dir || bc_hi[2] == SPEC_CONTACT_BC) {
if (bc_hi[2] == amrex::BCType::foextrap || bc_hi[2] == amrex::BCType::ext_dir || bc_hi[2] == SPEC_CONTACT_BC) {
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 Expand Up @@ -298,7 +298,7 @@ void AverageCCToNode(const MultiFab& cc_in, MultiFab& node_in, int scomp, int nc
// boundary conditions
// note: at physical boundaries,
// the value in ghost cells represents the value ON the boundary
if (bc_lo[0] == BCType::foextrap || bc_lo[0] == BCType::ext_dir) {
if (bc_lo[0] == amrex::BCType::foextrap || bc_lo[0] == amrex::BCType::ext_dir) {
if (bx.smallEnd(0) <= dom.smallEnd(0)) {
int lo = dom.smallEnd(0);
amrex::ParallelFor(bx, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
Expand All @@ -314,7 +314,7 @@ void AverageCCToNode(const MultiFab& cc_in, MultiFab& node_in, int scomp, int nc
}
}

if (bc_hi[0] == BCType::foextrap || bc_hi[0] == BCType::ext_dir) {
if (bc_hi[0] == amrex::BCType::foextrap || bc_hi[0] == amrex::BCType::ext_dir) {
if (bx.bigEnd(0) >= dom.bigEnd(0)+1) {
int hi = dom.bigEnd(0);
amrex::ParallelFor(bx, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
Expand All @@ -330,7 +330,7 @@ void AverageCCToNode(const MultiFab& cc_in, MultiFab& node_in, int scomp, int nc
}
}

if (bc_lo[1] == BCType::foextrap || bc_lo[1] == BCType::ext_dir) {
if (bc_lo[1] == amrex::BCType::foextrap || bc_lo[1] == amrex::BCType::ext_dir) {
if (bx.smallEnd(1) <= dom.smallEnd(1)) {
int lo = dom.smallEnd(1);
amrex::ParallelFor(bx, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
Expand All @@ -346,7 +346,7 @@ void AverageCCToNode(const MultiFab& cc_in, MultiFab& node_in, int scomp, int nc
}
}

if (bc_hi[1] == BCType::foextrap || bc_hi[1] == BCType::ext_dir) {
if (bc_hi[1] == amrex::BCType::foextrap || bc_hi[1] == amrex::BCType::ext_dir) {
if (bx.bigEnd(1) >= dom.bigEnd(1)+1) {
int hi = dom.bigEnd(1);
amrex::ParallelFor(bx, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
Expand All @@ -364,7 +364,7 @@ void AverageCCToNode(const MultiFab& cc_in, MultiFab& node_in, int scomp, int nc

#if (AMREX_SPACEDIM == 3)

if (bc_lo[2] == BCType::foextrap || bc_lo[2] == BCType::ext_dir) {
if (bc_lo[2] == amrex::BCType::foextrap || bc_lo[2] == amrex::BCType::ext_dir) {
if (bx.smallEnd(2) <= dom.smallEnd(2)) {
int lo = dom.smallEnd(2);
amrex::ParallelFor(bx, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
Expand All @@ -376,7 +376,7 @@ void AverageCCToNode(const MultiFab& cc_in, MultiFab& node_in, int scomp, int nc
}
}

if (bc_hi[2] == BCType::foextrap || bc_hi[2] == BCType::ext_dir) {
if (bc_hi[2] == amrex::BCType::foextrap || bc_hi[2] == amrex::BCType::ext_dir) {
if (bx.bigEnd(2) >= dom.bigEnd(2)+1) {
int hi = dom.bigEnd(2);
amrex::ParallelFor(bx, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
Expand Down Expand Up @@ -455,7 +455,7 @@ void AverageCCToEdge(const MultiFab& cc_in, std::array<MultiFab, NUM_EDGE>& edge
// the value in ghost cells represents the value ON the boundary

// lo-x
if (bc_lo[0] == BCType::foextrap || bc_lo[0] == BCType::ext_dir) {
if (bc_lo[0] == amrex::BCType::foextrap || bc_lo[0] == amrex::BCType::ext_dir) {
if (bx_xy.smallEnd(0) <= dom.smallEnd(0)) {
int lo = dom.smallEnd(0);
amrex::ParallelFor(bx_xy, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
Expand All @@ -477,7 +477,7 @@ void AverageCCToEdge(const MultiFab& cc_in, std::array<MultiFab, NUM_EDGE>& edge
}

// hi-x
if (bc_hi[0] == BCType::foextrap || bc_hi[0] == BCType::ext_dir) {
if (bc_hi[0] == amrex::BCType::foextrap || bc_hi[0] == amrex::BCType::ext_dir) {
if (bx_xy.bigEnd(0) >= dom.smallEnd(0)+1) {
int hi = dom.bigEnd(0);
amrex::ParallelFor(bx_xy, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
Expand All @@ -499,7 +499,7 @@ void AverageCCToEdge(const MultiFab& cc_in, std::array<MultiFab, NUM_EDGE>& edge
}

// lo-y
if (bc_lo[1] == BCType::foextrap || bc_lo[1] == BCType::ext_dir) {
if (bc_lo[1] == amrex::BCType::foextrap || bc_lo[1] == amrex::BCType::ext_dir) {
if (bx_xy.smallEnd(1) <= dom.smallEnd(1)) {
int lo = dom.smallEnd(1);
amrex::ParallelFor(bx_xy, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
Expand All @@ -521,7 +521,7 @@ void AverageCCToEdge(const MultiFab& cc_in, std::array<MultiFab, NUM_EDGE>& edge
}

// hi-y
if (bc_hi[1] == BCType::foextrap || bc_hi[1] == BCType::ext_dir) {
if (bc_hi[1] == amrex::BCType::foextrap || bc_hi[1] == amrex::BCType::ext_dir) {
if (bx_xy.bigEnd(1) <= dom.bigEnd(1)) {
int hi = dom.bigEnd(1);
amrex::ParallelFor(bx_xy, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
Expand All @@ -543,7 +543,7 @@ void AverageCCToEdge(const MultiFab& cc_in, std::array<MultiFab, NUM_EDGE>& edge
}

// lo-z
if (bc_lo[2] == BCType::foextrap || bc_lo[2] == BCType::ext_dir) {
if (bc_lo[2] == amrex::BCType::foextrap || bc_lo[2] == amrex::BCType::ext_dir) {
if (bx_xz.smallEnd(2) <= dom.smallEnd(2)) {
int lo = dom.smallEnd(2);
amrex::ParallelFor(bx_xz, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
Expand All @@ -565,7 +565,7 @@ void AverageCCToEdge(const MultiFab& cc_in, std::array<MultiFab, NUM_EDGE>& edge
}

// hi-z
if (bc_hi[2] == BCType::foextrap || bc_hi[2] == BCType::ext_dir) {
if (bc_hi[2] == amrex::BCType::foextrap || bc_hi[2] == amrex::BCType::ext_dir) {
if (bx_xz.bigEnd(2) <= dom.bigEnd(2)) {
int hi = dom.bigEnd(2);
amrex::ParallelFor(bx_xz, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
Expand Down
Loading

0 comments on commit fa397c7

Please sign in to comment.