Skip to content

Commit

Permalink
more updates
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale committed Jan 21, 2024
1 parent e800fe0 commit 1685ebb
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 54 deletions.
10 changes: 5 additions & 5 deletions Exec/science/wdmerger/Prob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ Castro::wd_update (Real time, Real dt)
GpuArray<bool, 3> symm_bound_hi{false};

for (int n = 0; n < AMREX_SPACEDIM; ++n) {
if (phys_bc.lo()[n] == Symmetry) {
if (phys_bc.lo()[n] == amrex::PhysBCType::symmetry) {
symm_bound_lo[n] = true;
}
if (phys_bc.hi()[n] == Symmetry) {
if (phys_bc.hi()[n] == amrex::PhysBCType::symmetry) {
symm_bound_hi[n] = true;
}
}
Expand Down Expand Up @@ -665,9 +665,9 @@ Castro::update_relaxation(Real time, Real dt) {

const int* lo_bc = phys_bc.lo();

const bool symm_lo_x = (lo_bc[0] == Symmetry);
const bool symm_lo_y = (lo_bc[1] == Symmetry);
const bool symm_lo_z = (lo_bc[2] == Symmetry);
const bool symm_lo_x = (lo_bc[0] == amrex::PhysBCType::symmetry);
const bool symm_lo_y = (lo_bc[1] == amrex::PhysBCType::symmetry);
const bool symm_lo_z = (lo_bc[2] == amrex::PhysBCType::symmetry);

ReduceOps<ReduceOpSum, ReduceOpSum, ReduceOpSum, ReduceOpSum, ReduceOpSum, ReduceOpSum> reduce_op;
ReduceData<Real, Real, Real, Real, Real, Real> reduce_data(reduce_op);
Expand Down
10 changes: 5 additions & 5 deletions Exec/science/wdmerger/wdmerger_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,15 +462,15 @@ void binary_setup ()
const Real* problo = DefaultGeometry().ProbLo();
const Real* probhi = DefaultGeometry().ProbHi();

if (Castro::physbc().lo(0) == Symmetry && problem::center[0] != problo[0]) {
if (Castro::physbc().lo(0) == amrex::PhysBCType::symmetry && problem::center[0] != problo[0]) {
amrex::Error("Symmetric lower x-boundary but the center is not on this boundary.");
}

if (Castro::physbc().lo(1) == Symmetry && problem::center[1] != problo[1]) {
if (Castro::physbc().lo(1) == amrex::PhysBCType::symmetry && problem::center[1] != problo[1]) {
amrex::Error("Symmetric lower y-boundary but the center is not on this boundary.");
}

if (Castro::physbc().lo(2) == Symmetry && problem::center[2] != problo[2]) {
if (Castro::physbc().lo(2) == amrex::PhysBCType::symmetry && problem::center[2] != problo[2]) {
amrex::Error("Symmetric lower z-boundary but the center is not on this boundary.");
}

Expand Down Expand Up @@ -656,7 +656,7 @@ void binary_setup ()

Real length;

if (Castro::physbc().lo(problem::axis_1-1) == Symmetry) {
if (Castro::physbc().lo(problem::axis_1-1) == amrex::PhysBCType::symmetry) {

// In this case we're only modelling the secondary.
length = problem::r_P_initial + problem::radius_P;
Expand Down Expand Up @@ -787,7 +787,7 @@ void binary_setup ()

// Safety check: make sure the stars are actually inside the computational domain.

if (!(AMREX_SPACEDIM == 2 && Castro::physbc().lo(1) == Symmetry)) {
if (!(AMREX_SPACEDIM == 2 && Castro::physbc().lo(1) == amrex::PhysBCType::symmetry)) {

if ((0.5_rt * (probhi[0] - problo[0]) < problem::radius_P) ||
(0.5_rt * (probhi[1] - problo[1]) < problem::radius_P) ||
Expand Down
4 changes: 2 additions & 2 deletions Source/hydro/Castro_mol_hydro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,8 @@ Castro::construct_mol_hydro_source(Real time, Real dt, MultiFab& A_update)
GpuArray<bool, AMREX_SPACEDIM> lo_periodic;
GpuArray<bool, AMREX_SPACEDIM> hi_periodic;
for (int idir = 0; idir < AMREX_SPACEDIM; idir++) {
lo_periodic[idir] = lo_bc[idir] == Interior;
hi_periodic[idir] = hi_bc[idir] == Interior;
lo_periodic[idir] = lo_bc[idir] == amrex::PhysBCType::interior;
hi_periodic[idir] = hi_bc[idir] == amrex::PhysBCType::interior;
}

amrex::ParallelFor(nbx, NQ,
Expand Down
20 changes: 10 additions & 10 deletions Source/hydro/fourth_center_average.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ Castro::make_cell_center(const Box& bx,
GpuArray<bool, AMREX_SPACEDIM> lo_periodic;
GpuArray<bool, AMREX_SPACEDIM> hi_periodic;
for (int idir = 0; idir < AMREX_SPACEDIM; idir++) {
lo_periodic[idir] = lo_bc[idir] == Interior;
hi_periodic[idir] = hi_bc[idir] == Interior;
lo_periodic[idir] = lo_bc[idir] == amrex::PhysBCType::interior;
hi_periodic[idir] = hi_bc[idir] == amrex::PhysBCType::interior;
}

amrex::ParallelFor(bx, U.nComp(),
Expand Down Expand Up @@ -68,8 +68,8 @@ Castro::make_cell_center_in_place(const Box& bx,
GpuArray<bool, AMREX_SPACEDIM> lo_periodic;
GpuArray<bool, AMREX_SPACEDIM> hi_periodic;
for (int idir = 0; idir < AMREX_SPACEDIM; idir++) {
lo_periodic[idir] = lo_bc[idir] == Interior;
hi_periodic[idir] = hi_bc[idir] == Interior;
lo_periodic[idir] = lo_bc[idir] == amrex::PhysBCType::interior;
hi_periodic[idir] = hi_bc[idir] == amrex::PhysBCType::interior;
}

for (int n = 0; n < U.nComp(); n++) {
Expand Down Expand Up @@ -105,8 +105,8 @@ Castro::compute_lap_term(const Box& bx,
GpuArray<bool, AMREX_SPACEDIM> lo_periodic;
GpuArray<bool, AMREX_SPACEDIM> hi_periodic;
for (int idir = 0; idir < AMREX_SPACEDIM; idir++) {
lo_periodic[idir] = lo_bc[idir] == Interior;
hi_periodic[idir] = hi_bc[idir] == Interior;
lo_periodic[idir] = lo_bc[idir] == amrex::PhysBCType::interior;
hi_periodic[idir] = hi_bc[idir] == amrex::PhysBCType::interior;
}

amrex::ParallelFor(bx,
Expand Down Expand Up @@ -136,8 +136,8 @@ Castro::make_fourth_average(const Box& bx,
GpuArray<bool, AMREX_SPACEDIM> lo_periodic;
GpuArray<bool, AMREX_SPACEDIM> hi_periodic;
for (int idir = 0; idir < AMREX_SPACEDIM; idir++) {
lo_periodic[idir] = lo_bc[idir] == Interior;
hi_periodic[idir] = hi_bc[idir] == Interior;
lo_periodic[idir] = lo_bc[idir] == amrex::PhysBCType::interior;
hi_periodic[idir] = hi_bc[idir] == amrex::PhysBCType::interior;
}

amrex::ParallelFor(bx, q.nComp(),
Expand Down Expand Up @@ -186,8 +186,8 @@ Castro::make_fourth_in_place_n(const Box& bx,
GpuArray<bool, AMREX_SPACEDIM> lo_periodic;
GpuArray<bool, AMREX_SPACEDIM> hi_periodic;
for (int idir = 0; idir < AMREX_SPACEDIM; idir++) {
lo_periodic[idir] = lo_bc[idir] == Interior;
hi_periodic[idir] = hi_bc[idir] == Interior;
lo_periodic[idir] = lo_bc[idir] == amrex::PhysBCType::interior;
hi_periodic[idir] = hi_bc[idir] == amrex::PhysBCType::interior;
}

amrex::ParallelFor(bx,
Expand Down
60 changes: 30 additions & 30 deletions Source/hydro/fourth_order.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,25 @@ Castro::fourth_interfaces(const Box& bx,
// interpolate to the edges -- this is a_{i-1/2}
// note for non-periodic physical boundaries, we use a special stencil

if (i == domlo[0]+1 && lo_bc[0] == Symmetry) {
if (i == domlo[0]+1 && lo_bc[0] == amrex::PhysBCType::symmetry) {
// use a stencil for the interface that is one zone
// from the left physical boundary, MC Eq. 22
a_int(i,j,k) = (1.0_rt/12.0_rt)*(3.0_rt*a(i-1,j,k,ncomp) + 13.0_rt*a(i,j,k,ncomp) -
5.0_rt*a(i+1,j,k,ncomp) + a(i+2,j,k,ncomp));

} else if (i == domlo[0] && lo_bc[0] == Symmetry) {
} else if (i == domlo[0] && lo_bc[0] == amrex::PhysBCType::symmetry) {
// use a stencil for when the interface is on the
// left physical boundary MC Eq. 21
a_int(i,j,k) = (1.0_rt/12.0_rt)*(25.0_rt*a(i,j,k,ncomp) - 23.0_rt*a(i+1,j,k,ncomp) +
13.0_rt*a(i+2,j,k,ncomp) - 3.0_rt*a(i+3,j,k,ncomp));

} else if (i == domhi[0] && hi_bc[0] == Symmetry) {
} else if (i == domhi[0] && hi_bc[0] == amrex::PhysBCType::symmetry) {
// use a stencil for the interface that is one zone
// from the right physical boundary, MC Eq. 22
a_int(i,j,k) = (1.0_rt/12.0_rt)*(3.0_rt*a(i,j,k,ncomp) + 13.0_rt*a(i-1,j,k,ncomp) -
5.0_rt*a(i-2,j,k,ncomp) + a(i-3,j,k,ncomp));

} else if (i == domhi[0]+1 && hi_bc[0] == Symmetry) {
} else if (i == domhi[0]+1 && hi_bc[0] == amrex::PhysBCType::symmetry) {
// use a stencil for when the interface is on the
// right physical boundary MC Eq. 21
a_int(i,j,k) = (1.0_rt/12.0_rt)*(25.0_rt*a(i-1,j,k,ncomp) - 23.0_rt*a(i-2,j,k,ncomp) +
Expand All @@ -78,25 +78,25 @@ Castro::fourth_interfaces(const Box& bx,

// interpolate to the edges

if (j == domlo[1]+1 && lo_bc[1] == Symmetry) {
if (j == domlo[1]+1 && lo_bc[1] == amrex::PhysBCType::symmetry) {
// use a stencil for the interface that is one zone
// from the left physical boundary, MC Eq. 22
a_int(i,j,k) = (1.0_rt/12.0_rt)*(3.0_rt*a(i,j-1,k,ncomp) + 13.0_rt*a(i,j,k,ncomp) -
5.0_rt*a(i,j+1,k,ncomp) + a(i,j+2,k,ncomp));

} else if (j == domlo[1] && lo_bc[1] == Symmetry) {
} else if (j == domlo[1] && lo_bc[1] == amrex::PhysBCType::symmetry) {
// use a stencil for when the interface is on the
// left physical boundary MC Eq. 21
a_int(i,j,k) = (1.0_rt/12.0_rt)*(25.0_rt*a(i,j,k,ncomp) - 23.0_rt*a(i,j+1,k,ncomp) +
13.0_rt*a(i,j+2,k,ncomp) - 3.0_rt*a(i,j+3,k,ncomp));

} else if (j == domhi[1] && hi_bc[1] == Symmetry) {
} else if (j == domhi[1] && hi_bc[1] == amrex::PhysBCType::symmetry) {
// use a stencil for the interface that is one zone
// from the right physical boundary, MC Eq. 22
a_int(i,j,k) = (1.0_rt/12.0_rt)*(3.0_rt*a(i,j,k,ncomp) + 13.0_rt*a(i,j-1,k,ncomp) -
5.0_rt*a(i,j-2,k,ncomp) + a(i,j-3,k,ncomp));

} else if (j == domhi[1]+1 && hi_bc[1] == Symmetry) {
} else if (j == domhi[1]+1 && hi_bc[1] == amrex::PhysBCType::symmetry) {
// use a stencil for when the interface is on the
// right physical boundary MC Eq. 21
a_int(i,j,k) = (1.0_rt/12.0_rt)*(25.0_rt*a(i,j-1,k,ncomp) - 23.0_rt*a(i,j-2,k,ncomp) +
Expand All @@ -120,25 +120,25 @@ Castro::fourth_interfaces(const Box& bx,

// interpolate to the edges

if (k == domlo[2]+1 && lo_bc[2] == Symmetry) {
if (k == domlo[2]+1 && lo_bc[2] == amrex::PhysBCType::symmetry) {
// use a stencil for the interface that is one zone
// from the left physical boundary, MC Eq. 22
a_int(i,j,k) = (1.0_rt/12.0_rt)*(3.0_rt*a(i,j,k-1,ncomp) + 13.0_rt*a(i,j,k,ncomp) -
5.0_rt*a(i,j,k+1,ncomp) + a(i,j,k+2,ncomp));

} else if (k == domlo[2] && lo_bc[2] == Symmetry) {
} else if (k == domlo[2] && lo_bc[2] == amrex::PhysBCType::symmetry) {
// use a stencil for when the interface is on the
// left physical boundary MC Eq. 21
a_int(i,j,k) = (1.0_rt/12.0_rt)*(25.0_rt*a(i,j,k,ncomp) - 23.0_rt*a(i,j,k+1,ncomp) +
13.0_rt*a(i,j,k+2,ncomp) - 3.0_rt*a(i,j,k+3,ncomp));

} else if (k == domhi[2] && hi_bc[2] == Symmetry) {
} else if (k == domhi[2] && hi_bc[2] == amrex::PhysBCType::symmetry) {
// use a stencil for the interface that is one zone
// from the right physical boundary, MC Eq. 22
a_int(i,j,k) = (1.0_rt/12.0_rt)*(3.0_rt*a(i,j,k,ncomp) + 13.0_rt*a(i,j,k-1,ncomp) -
5.0_rt*a(i,j,k-2,ncomp) + a(i,j,k-3,ncomp));

} else if (k == domhi[2]+1 && hi_bc[2] == Symmetry) {
} else if (k == domhi[2]+1 && hi_bc[2] == amrex::PhysBCType::symmetry) {
// use a stencil for when the interface is on the
// right physical boundary MC Eq. 21
a_int(i,j,k) = (1.0_rt/12.0_rt)*(25.0_rt*a(i,j,k-1,ncomp) - 23.0_rt*a(i,j,k-2,ncomp) +
Expand Down Expand Up @@ -300,17 +300,17 @@ Castro::states(const Box& bx,

// reset the left state at domlo[0] if needed -- it is outside the domain

if (lo_bc[0] == Outflow) {
if (lo_bc[0] == amrex::PhysBCType::outflow) {
//al(domlo[0],j,k,ncomp) = ar(domlo[0],j,k,ncomp);

} else if (lo_bc[0] == Symmetry) {
} else if (lo_bc[0] == amrex::PhysBCType::symmetry) {
if (ncomp == QU) {
al(domlo[0],j,k,QU) = -ar(domlo[0],j,k,QU);
} else {
al(domlo[0],j,k,ncomp) = ar(domlo[0],j,k,ncomp);
}

} else if (lo_bc[0] == Interior) {
} else if (lo_bc[0] == amrex::PhysBCType::interior) {
// we don't need to do anything here

} else {
Expand All @@ -324,17 +324,17 @@ Castro::states(const Box& bx,

// reset the right state at domhi[0]+1 if needed -- it is outside the domain

if (hi_bc[0] == Outflow) {
if (hi_bc[0] == amrex::PhysBCType::outflow) {
//ar(domhi[0]+1,j,k,ncomp) = al(domhi[0]+1,j,k,ncomp);

} else if (hi_bc[0] == Symmetry) {
} else if (hi_bc[0] == amrex::PhysBCType::symmetry) {
if (ncomp == QU) {
ar(domhi[0]+1,j,k,QU) = -al(domhi[0]+1,j,k,QU);
} else {
ar(domhi[0]+1,j,k,ncomp) = al(domhi[0]+1,j,k,ncomp);
}

} else if (hi_bc[0] == Interior) {
} else if (hi_bc[0] == amrex::PhysBCType::interior) {
// we don't need to do anything here

} else {
Expand Down Expand Up @@ -465,17 +465,17 @@ Castro::states(const Box& bx,

// reset the left state at domlo[1] if needed -- it is outside the domain

if (lo_bc[1] == Outflow) {
if (lo_bc[1] == amrex::PhysBCType::outflow) {
//al(i,domlo[1],k,ncomp) = ar(i,domlo[1],k,ncomp);

} else if (lo_bc[1] == Symmetry) {
} else if (lo_bc[1] == amrex::PhysBCType::symmetry) {
if (ncomp == QV) {
al(i,domlo[1],k,QV) = -ar(i,domlo[1],k,QV);
} else {
al(i,domlo[1],k,ncomp) = ar(i,domlo[1],k,ncomp);
}

} else if (lo_bc[1] == Interior) {
} else if (lo_bc[1] == amrex::PhysBCType::interior) {
// we don't need to do anything here

} else {
Expand All @@ -489,17 +489,17 @@ Castro::states(const Box& bx,

// reset the right state at domhi[1]+1 if needed -- it is outside the domain

if (hi_bc[1] == Outflow) {
if (hi_bc[1] == amrex::PhysBCType::outflow) {
//ar(i,domhi[1]+1,k,ncomp) = al(i,domhi[1]+1,k,ncomp);

} else if (hi_bc[1] == Symmetry) {
} else if (hi_bc[1] == amrex::PhysBCType::symmetry) {
if (ncomp == QV) {
ar(i,domhi[1]+1,k,QV) = -al(i,domhi[1]+1,k,QV);
} else {
ar(i,domhi[1]+1,k,ncomp) = al(i,domhi[1]+1,k,ncomp);
}

} else if (hi_bc[1] == Interior) {
} else if (hi_bc[1] == amrex::PhysBCType::interior) {
// we don't need to do anything here

} else {
Expand Down Expand Up @@ -628,17 +628,17 @@ Castro::states(const Box& bx,
if (k == domlo[2]) {
// reset the left state at domlo[2] if needed -- it is outside the domain

if (lo_bc[2] == Outflow) {
if (lo_bc[2] == amrex::PhysBCType::outflow) {
//al(i,j,domlo[2],ncomp) = ar(i,j,domlo[2],ncomp);

} else if (lo_bc[2] == Symmetry) {
} else if (lo_bc[2] == amrex::PhysBCType::symmetry) {
if (ncomp == QW) {
al(i,j,domlo[2],QW) = -ar(i,j,domlo[2],QW);
} else {
al(i,j,domlo[2],ncomp) = ar(i,j,domlo[2],ncomp);
}

} else if (lo_bc[2] == Interior) {
} else if (lo_bc[2] == amrex::PhysBCType::interior) {
// we don't need to do anything here

} else {
Expand All @@ -651,17 +651,17 @@ Castro::states(const Box& bx,
if (k == domhi[2]+1) {
// reset the right state at domhi[2]+1 if needed -- it is outside the domain

if (hi_bc[2] == Outflow) {
if (hi_bc[2] == amrex::PhysBCType::outflow) {
//ar(i,j,domhi[2]+1,ncomp) = al(i,j,domhi[2]+1,ncomp);

} else if (hi_bc[2] == Symmetry) {
} else if (hi_bc[2] == amrex::PhysBCType::symmetry) {
if (ncomp == QW) {
ar(i,j,domhi[2]+1,QW) = -al(i,j,domhi[2]+1,QW);
} else {
ar(i,j,domhi[2]+1,ncomp) = al(i,j,domhi[2]+1,ncomp);
}

} else if (lo_bc[2] == Interior) {
} else if (lo_bc[2] == amrex::PhysBCType::interior) {
// we don't need to do anything here

} else {
Expand Down
4 changes: 2 additions & 2 deletions Source/mhd/mhd_plm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Castro::plm(const Box& bx,
const int* lo_bc = phys_bc.lo();
const int* hi_bc = phys_bc.hi();

bool lo_symm = lo_bc[idir] == Symmetry;
bool hi_symm = hi_bc[idir] == Symmetry;
bool lo_symm = lo_bc[idir] == amrex::PhysBCType::symmetry;
bool hi_symm = hi_bc[idir] == amrex::PhysBCType::symmetry;

const auto domlo = geom.Domain().loVect3d();
const auto domhi = geom.Domain().hiVect3d();
Expand Down

0 comments on commit 1685ebb

Please sign in to comment.