Skip to content

Commit

Permalink
Merge pull request #88 from WeiqunZhang/amrex_prefix
Browse files Browse the repository at this point in the history
Prepare for amrex changes
  • Loading branch information
WeiqunZhang authored Jan 21, 2024
2 parents 810ef72 + e27ceb3 commit fb5216c
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 25 deletions.
6 changes: 3 additions & 3 deletions Source/AGN/AGN_halos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@ Nyx::agn_halo_find (Real dt)
for (BoxIterator bit(vertBox); bit.ok(); ++bit)
{
IntVect vert = bit();
IntVect iv(D_DECL(vertices[vert[0]][0],
vertices[vert[1]][1],
vertices[vert[2]][2]));
IntVect iv(AMREX_D_DECL(vertices[vert[0]][0],
vertices[vert[1]][1],
vertices[vert[2]][2]));
reeber_halos_pos.push_back(iv);
reeber_halos_mass.push_back(haloMass);
}
Expand Down
2 changes: 1 addition & 1 deletion Source/DerivedQuantities/ParticleDerive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Nyx::particle_derive (const std::string& name, Real time, int ngrow)
// We want the total particle count at this level or higher.
//
std::unique_ptr<MultiFab> derive_dat = particle_derive("particle_count", time, ngrow);
IntVect trr(D_DECL(1, 1, 1));
IntVect trr(1);

// @todo: level vs. lev
for (int lev = level + 1; lev <= parent->finestLevel(); lev++)
Expand Down
8 changes: 4 additions & 4 deletions Source/Driver/Nyx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,14 +314,14 @@ Nyx::read_params ()
{
if (DefaultGeometry().isPeriodic(dir))
{
if (lo_bc[dir] != Interior)
if (lo_bc[dir] != amrex::PhysBCType::interior)
{
std::cerr << "Nyx::read_params:periodic in direction "
<< dir
<< " but low BC is not Interior" << std::endl;
amrex::Error();
}
if (hi_bc[dir] != Interior)
if (hi_bc[dir] != amrex::PhysBCType::interior)
{
std::cerr << "Nyx::read_params:periodic in direction "
<< dir
Expand All @@ -338,14 +338,14 @@ Nyx::read_params ()
//
for (int dir = 0; dir < AMREX_SPACEDIM; dir++)
{
if (lo_bc[dir] == Interior)
if (lo_bc[dir] == amrex::PhysBCType::interior)
{
std::cerr << "Nyx::read_params:interior bc in direction "
<< dir
<< " but not periodic" << std::endl;
amrex::Error();
}
if (hi_bc[dir] == Interior)
if (hi_bc[dir] == amrex::PhysBCType::interior)
{
std::cerr << "Nyx::read_params:interior bc in direction "
<< dir
Expand Down
8 changes: 4 additions & 4 deletions Source/Gravity/Gravity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -958,12 +958,12 @@ Gravity::make_mg_bc ()
mlmg_lobc[idim] = MLLinOp::BCType::Periodic;
mlmg_hibc[idim] = MLLinOp::BCType::Periodic;
} else {
if (phys_bc->lo(idim) == Symmetry) {
if (phys_bc->lo(idim) == amrex::PhysBCType::symmetry) {
mlmg_lobc[idim] = MLLinOp::BCType::Neumann;
} else {
mlmg_lobc[idim] = MLLinOp::BCType::Dirichlet;
}
if (phys_bc->hi(idim) == Symmetry) {
if (phys_bc->hi(idim) == amrex::PhysBCType::symmetry) {
mlmg_hibc[idim] = MLLinOp::BCType::Neumann;
} else {
mlmg_hibc[idim] = MLLinOp::BCType::Dirichlet;
Expand Down Expand Up @@ -1430,8 +1430,8 @@ Gravity::set_boundary(BndryData& bd, MultiFab& rhs, const Real* dx)
// across an interior boundary or a periodic boundary.
{
// Define the type of boundary conditions to be Dirichlet (even for periodic)
bd.setBoundCond(Orientation(n, Orientation::low) ,i,0,LO_DIRICHLET);
bd.setBoundCond(Orientation(n, Orientation::high),i,0,LO_DIRICHLET);
bd.setBoundCond(Orientation(n, Orientation::low) ,i,0,AMREX_LO_DIRICHLET);
bd.setBoundCond(Orientation(n, Orientation::high),i,0,AMREX_LO_DIRICHLET);

// Set the boundary conditions to the cell centers outside the domain
bd.setBoundLoc(Orientation(n, Orientation::low) ,i,0.5*dx[n]);
Expand Down
4 changes: 2 additions & 2 deletions Source/Hydro/strang_hydro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ Nyx::strang_hydro (Real time,
const Box& bx = mfi.tilebox();
for (int i = 0; i < S_new[mfi].nComp(); i++)
{
IntVect p_nan(D_DECL(-10, -10, -10));
IntVect p_nan(AMREX_D_DECL(-10, -10, -10));
if (ParallelDescriptor::IOProcessor())
std::cout << "strang_hydro: testing component " << i << " for NaNs" << std::endl;
if (S_new[mfi].contains_nan(bx,Density+i,1,p_nan))
Expand Down Expand Up @@ -201,7 +201,7 @@ Nyx::strang_hydro (Real time,
{
for (int i = 0; i < S_new.nComp(); i++)
{
IntVect p_nan(D_DECL(-10, -10, -10));
IntVect p_nan(AMREX_D_DECL(-10, -10, -10));
if (ParallelDescriptor::IOProcessor())
std::cout << "strang_hydro: testing component " << i << " for NaNs" << std::endl;
if (S_new.contains_nan(Density+i,1,0))
Expand Down
6 changes: 3 additions & 3 deletions Source/Initialization/Nyx_setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ typedef StateDescriptor::BndryFunc BndryFunc;
//
static int scalar_bc[] =
{
INT_DIR, EXT_DIR, FOEXTRAP, REFLECT_EVEN, REFLECT_EVEN, REFLECT_EVEN
amrex::BCType::int_dir, amrex::BCType::ext_dir, amrex::BCType::foextrap, amrex::BCType::reflect_even, amrex::BCType::reflect_even, amrex::BCType::reflect_even
};

static int norm_vel_bc[] =
{
INT_DIR, EXT_DIR, FOEXTRAP, REFLECT_ODD, REFLECT_ODD, REFLECT_ODD
amrex::BCType::int_dir, amrex::BCType::ext_dir, amrex::BCType::foextrap, amrex::BCType::reflect_odd, amrex::BCType::reflect_odd, amrex::BCType::reflect_odd
};

static int tang_vel_bc[] =
{
INT_DIR, EXT_DIR, FOEXTRAP, REFLECT_EVEN, REFLECT_EVEN, REFLECT_EVEN
amrex::BCType::int_dir, amrex::BCType::ext_dir, amrex::BCType::foextrap, amrex::BCType::reflect_even, amrex::BCType::reflect_even, amrex::BCType::reflect_even
};

static
Expand Down
4 changes: 2 additions & 2 deletions Source/Particle/DarkMatterParticleContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ DarkMatterParticleContainer::InitCosmo1ppcMultiLevel(
Real disp[AMREX_SPACEDIM];
Real vel[AMREX_SPACEDIM];

Real mean_disp[AMREX_SPACEDIM]={D_DECL(0,0,0)};
Real mean_disp[AMREX_SPACEDIM]={AMREX_D_DECL(0,0,0)};


//
Expand All @@ -360,7 +360,7 @@ DarkMatterParticleContainer::InitCosmo1ppcMultiLevel(
{
for (int ix = fab_lo[0]; ix <= fab_hi[0]; ix++)
{
IntVect indices(D_DECL(ix, jx, kx));
IntVect indices(AMREX_D_DECL(ix, jx, kx));
totalcount++;
if (baWhereNot.contains(indices))
{
Expand Down
10 changes: 5 additions & 5 deletions Source/Particle/NyxParticleContainer.H
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ NyxParticleContainer<NSR,NSI,NAR,NAI>::sumParticleMomentum (int lev,

const ParticleLevel& pmap = this->GetParticles(lev);

D_TERM(mom[0] = 0;, mom[1] = 0;, mom[2] = 0;);
AMREX_D_TERM(mom[0] = 0;, mom[1] = 0;, mom[2] = 0;);

for (typename ParticleLevel::const_iterator pmap_it = pmap.begin(), pmapEnd = pmap.end(); pmap_it != pmapEnd; ++pmap_it)
{
Expand All @@ -303,13 +303,13 @@ NyxParticleContainer<NSR,NSI,NAR,NAI>::sumParticleMomentum (int lev,

if (p.id() > 0)
{
D_TERM(mom_0 += p.rdata(0) * p.rdata(1);,
mom_1 += p.rdata(0) * p.rdata(2);,
mom_2 += p.rdata(0) * p.rdata(3););
AMREX_D_TERM(mom_0 += p.rdata(0) * p.rdata(1);,
mom_1 += p.rdata(0) * p.rdata(2);,
mom_2 += p.rdata(0) * p.rdata(3););
}
}

D_TERM(mom[0] += mom_0;, mom[1] += mom_1;, mom[2] += mom_2;);
AMREX_D_TERM(mom[0] += mom_0;, mom[1] += mom_1;, mom[2] += mom_2;);
}

amrex::ParallelDescriptor::ReduceRealSum(mom,AMREX_SPACEDIM);
Expand Down
2 changes: 1 addition & 1 deletion Source/TimeStep/Nyx_enforce_minimum_density.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ Nyx::enforce_minimum_density_cons ( MultiFab& S_old, MultiFab& S_new)
const Box& bx = mfi.growntilebox();
for (int i = 0; i < S_new[mfi].nComp(); i++)
{
IntVect p_nan(D_DECL(-10, -10, -10));
IntVect p_nan(AMREX_D_DECL(-10, -10, -10));
// if (ParallelDescriptor::IOProcessor())
// std::cout << "enforce_minimum_density: testing component " << i << " for NaNs" << std::endl;
bool has_nan=S_new[mfi].contains_nan<RunOn::Device>(bx,Density_comp+i,1,p_nan);
Expand Down

0 comments on commit fb5216c

Please sign in to comment.