diff --git a/Source/Diffusion.cpp b/Source/Diffusion.cpp index 8ccd115c..4d4b82dc 100644 --- a/Source/Diffusion.cpp +++ b/Source/Diffusion.cpp @@ -990,14 +990,14 @@ Diffusion::diffuse_Vsync (MultiFab& Vsync, for (int k = 0; k < AMREX_SPACEDIM; k++) { - if (velbc.hi(k) == EXT_DIR) + if (velbc.hi(k) == BCType::ext_dir) { IntVect smallend = domain.smallEnd(); smallend.setVal(k,domain.bigEnd(k)); Box top_strip(smallend,domain.bigEnd(),IntVect::TheCellVector()); Vsync.setVal(0,top_strip,n-Xvel,1,1); } - if (velbc.lo(k) == EXT_DIR) + if (velbc.lo(k) == BCType::ext_dir) { IntVect bigend = domain.bigEnd(); bigend.setVal(k,domain.smallEnd(k)); @@ -1488,15 +1488,15 @@ Diffusion::computeExtensiveFluxes(MLMG& a_mg, MultiFab& Soln, #endif for (MFIter mfi(Soln, mfi_info); mfi.isValid(); ++mfi) { - D_TERM( const auto& fx = flxx.array(mfi);, + AMREX_D_TERM( const auto& fx = flxx.array(mfi);, const auto& fy = flxy.array(mfi);, const auto& fz = flxz.array(mfi);); - D_TERM( const Box ubx = mfi.nodaltilebox(0);, + AMREX_D_TERM( const Box ubx = mfi.nodaltilebox(0);, const Box vbx = mfi.nodaltilebox(1);, const Box wbx = mfi.nodaltilebox(2);); - D_TERM( const auto& areax = area[0].array(mfi);, + AMREX_D_TERM( const auto& areax = area[0].array(mfi);, const auto& areay = area[1].array(mfi);, const auto& areaz = area[2].array(mfi);); @@ -1512,24 +1512,24 @@ Diffusion::computeExtensiveFluxes(MLMG& a_mg, MultiFab& Soln, // For now, set to very large num so we know if you accidentally use it // MLMG will set covered fluxes to zero // - D_TERM(AMREX_PARALLEL_FOR_4D(ubx, ncomp, i, j, k, n, {fx(i,j,k,n) = COVERED_VAL;});, + AMREX_D_TERM(AMREX_PARALLEL_FOR_4D(ubx, ncomp, i, j, k, n, {fx(i,j,k,n) = COVERED_VAL;});, AMREX_PARALLEL_FOR_4D(vbx, ncomp, i, j, k, n, {fy(i,j,k,n) = COVERED_VAL;});, AMREX_PARALLEL_FOR_4D(wbx, ncomp, i, j, k, n, {fz(i,j,k,n) = COVERED_VAL;});); } else if ( flags.getType(amrex::grow(bx,0)) != FabType::regular ) { - D_TERM( const auto& afrac_x = areafrac[0]->array(mfi);, + AMREX_D_TERM( const auto& afrac_x = areafrac[0]->array(mfi);, const auto& afrac_y = areafrac[1]->array(mfi);, const auto& afrac_z = areafrac[2]->array(mfi);); - D_TERM(AMREX_PARALLEL_FOR_4D(ubx, ncomp, i, j, k, n, {fx(i,j,k,n) *= fac*areax(i,j,k)*afrac_x(i,j,k);});, + AMREX_D_TERM(AMREX_PARALLEL_FOR_4D(ubx, ncomp, i, j, k, n, {fx(i,j,k,n) *= fac*areax(i,j,k)*afrac_x(i,j,k);});, AMREX_PARALLEL_FOR_4D(vbx, ncomp, i, j, k, n, {fy(i,j,k,n) *= fac*areay(i,j,k)*afrac_y(i,j,k);});, AMREX_PARALLEL_FOR_4D(wbx, ncomp, i, j, k, n, {fz(i,j,k,n) *= fac*areaz(i,j,k)*afrac_z(i,j,k);});); } else #endif { - D_TERM(AMREX_PARALLEL_FOR_4D(ubx, ncomp, i, j, k, n, {fx(i,j,k,n) *= fac*areax(i,j,k);});, + AMREX_D_TERM(AMREX_PARALLEL_FOR_4D(ubx, ncomp, i, j, k, n, {fx(i,j,k,n) *= fac*areax(i,j,k);});, AMREX_PARALLEL_FOR_4D(vbx, ncomp, i, j, k, n, {fy(i,j,k,n) *= fac*areay(i,j,k);});, AMREX_PARALLEL_FOR_4D(wbx, ncomp, i, j, k, n, {fz(i,j,k,n) *= fac*areaz(i,j,k);});); } @@ -1898,17 +1898,17 @@ Diffusion::setDomainBC (std::array& mlmg_lobc, else { int pbc = bc.lo(idim); - if (pbc == EXT_DIR) + if (pbc == BCType::ext_dir) { mlmg_lobc[idim] = LinOpBCType::Dirichlet; } - else if (pbc == FOEXTRAP || - pbc == HOEXTRAP || - pbc == REFLECT_EVEN) + else if (pbc == BCType::foextrap || + pbc == BCType::hoextrap || + pbc == BCType::reflect_even) { mlmg_lobc[idim] = LinOpBCType::Neumann; } - else if (pbc == REFLECT_ODD) + else if (pbc == BCType::reflect_odd) { mlmg_lobc[idim] = LinOpBCType::reflect_odd; } @@ -1918,17 +1918,17 @@ Diffusion::setDomainBC (std::array& mlmg_lobc, } pbc = bc.hi(idim); - if (pbc == EXT_DIR) + if (pbc == BCType::ext_dir) { mlmg_hibc[idim] = LinOpBCType::Dirichlet; } - else if (pbc == FOEXTRAP || - pbc == HOEXTRAP || - pbc == REFLECT_EVEN) + else if (pbc == BCType::foextrap || + pbc == BCType::hoextrap || + pbc == BCType::reflect_even) { mlmg_hibc[idim] = LinOpBCType::Neumann; } - else if (pbc == REFLECT_ODD) + else if (pbc == BCType::reflect_odd) { mlmg_hibc[idim] = LinOpBCType::reflect_odd; } @@ -1956,17 +1956,17 @@ Diffusion::setDomainBC (std::array& mlmg_lobc, else { int pbc = bc.lo(idim); - if (pbc == EXT_DIR) + if (pbc == BCType::ext_dir) { mlmg_lobc[idim] = LinOpBCType::Dirichlet; } - else if (pbc == FOEXTRAP || - pbc == HOEXTRAP || - pbc == REFLECT_EVEN) + else if (pbc == BCType::foextrap || + pbc == BCType::hoextrap || + pbc == BCType::reflect_even) { mlmg_lobc[idim] = LinOpBCType::Neumann; } - else if (pbc == REFLECT_ODD) + else if (pbc == BCType::reflect_odd) { mlmg_lobc[idim] = LinOpBCType::reflect_odd; } @@ -1976,17 +1976,17 @@ Diffusion::setDomainBC (std::array& mlmg_lobc, } pbc = bc.hi(idim); - if (pbc == EXT_DIR) + if (pbc == BCType::ext_dir) { mlmg_hibc[idim] = LinOpBCType::Dirichlet; } - else if (pbc == FOEXTRAP || - pbc == HOEXTRAP || - pbc == REFLECT_EVEN) + else if (pbc == BCType::foextrap || + pbc == BCType::hoextrap || + pbc == BCType::reflect_even) { mlmg_hibc[idim] = LinOpBCType::Neumann; } - else if (pbc == REFLECT_ODD) + else if (pbc == BCType::reflect_odd) { mlmg_hibc[idim] = LinOpBCType::reflect_odd; } diff --git a/Source/MacProj.cpp b/Source/MacProj.cpp index 8d570272..3adbc1bd 100644 --- a/Source/MacProj.cpp +++ b/Source/MacProj.cpp @@ -805,19 +805,19 @@ MacProj::check_div_cond (int level, { const Box& bx = mfi.tilebox(); auto const& cc_divu = dmac.array(mfi); - D_TERM(auto const& ux_e = U_edge[0].array(mfi);, + AMREX_D_TERM(auto const& ux_e = U_edge[0].array(mfi);, auto const& uy_e = U_edge[1].array(mfi);, auto const& uz_e = U_edge[2].array(mfi);); - D_TERM(auto const& xarea = area[0].array(mfi);, + AMREX_D_TERM(auto const& xarea = area[0].array(mfi);, auto const& yarea = area[1].array(mfi);, auto const& zarea = area[2].array(mfi);); auto const& vol = volume.array(mfi); - amrex::ParallelFor(bx, [cc_divu,D_DECL(ux_e,uy_e,uz_e), - D_DECL(xarea,yarea,zarea), vol] + amrex::ParallelFor(bx, [cc_divu,AMREX_D_DECL(ux_e,uy_e,uz_e), + AMREX_D_DECL(xarea,yarea,zarea), vol] AMREX_GPU_DEVICE (int i, int j, int k) noexcept { - cc_divu(i,j,k) = D_TERM( xarea(i+1,j,k)*ux_e(i+1,j,k) - xarea(i,j,k)*ux_e(i,j,k), + cc_divu(i,j,k) = AMREX_D_TERM( xarea(i+1,j,k)*ux_e(i+1,j,k) - xarea(i,j,k)*ux_e(i,j,k), + yarea(i,j+1,k)*uy_e(i,j+1,k) - yarea(i,j,k)*uy_e(i,j,k), + zarea(i,j,k+1)*uz_e(i,j,k+1) - zarea(i,j,k)*uz_e(i,j,k)); cc_divu(i,j,k) /= vol(i,j,k); @@ -1193,12 +1193,12 @@ MacProj::set_mac_solve_bc (Array& mlmg_lobc, mlmg_lobc[idim] = MLLinOp::BCType::Periodic; mlmg_hibc[idim] = MLLinOp::BCType::Periodic; } else { - if (a_phys_bc.lo(idim) == Outflow) { + if (a_phys_bc.lo(idim) == PhysBCType::outflow) { mlmg_lobc[idim] = MLLinOp::BCType::Dirichlet; } else { mlmg_lobc[idim] = MLLinOp::BCType::Neumann; } - if (a_phys_bc.hi(idim) == Outflow) { + if (a_phys_bc.hi(idim) == PhysBCType::outflow) { mlmg_hibc[idim] = MLLinOp::BCType::Dirichlet; } else { mlmg_hibc[idim] = MLLinOp::BCType::Neumann; diff --git a/Source/NS_BC.H b/Source/NS_BC.H index 958a891d..3c18d6e5 100644 --- a/Source/NS_BC.H +++ b/Source/NS_BC.H @@ -1,54 +1,55 @@ #include +#include // // Components are Interior, Inflow, Outflow, Symmetry, SlipWall, NoSlipWall. // static int norm_vel_bc[] = { - INT_DIR, EXT_DIR, FOEXTRAP, REFLECT_ODD, EXT_DIR, EXT_DIR + amrex::BCType::int_dir, amrex::BCType::ext_dir, amrex::BCType::foextrap, amrex::BCType::reflect_odd, amrex::BCType::ext_dir, amrex::BCType::ext_dir }; static int tang_vel_bc[] = { - INT_DIR, EXT_DIR, FOEXTRAP, REFLECT_EVEN, HOEXTRAP, EXT_DIR + amrex::BCType::int_dir, amrex::BCType::ext_dir, amrex::BCType::foextrap, amrex::BCType::reflect_even, amrex::BCType::hoextrap, amrex::BCType::ext_dir }; static int scalar_bc[] = { - INT_DIR, EXT_DIR, FOEXTRAP, REFLECT_EVEN, FOEXTRAP, FOEXTRAP + amrex::BCType::int_dir, amrex::BCType::ext_dir, amrex::BCType::foextrap, amrex::BCType::reflect_even, amrex::BCType::foextrap, amrex::BCType::foextrap }; static int press_bc[] = { - INT_DIR, FOEXTRAP, FOEXTRAP, REFLECT_EVEN, FOEXTRAP, FOEXTRAP + amrex::BCType::int_dir, amrex::BCType::foextrap, amrex::BCType::foextrap, amrex::BCType::reflect_even, amrex::BCType::foextrap, amrex::BCType::foextrap }; static int norm_gradp_bc[] = { - INT_DIR, FOEXTRAP, FOEXTRAP, REFLECT_ODD, FOEXTRAP, FOEXTRAP + amrex::BCType::int_dir, amrex::BCType::foextrap, amrex::BCType::foextrap, amrex::BCType::reflect_odd, amrex::BCType::foextrap, amrex::BCType::foextrap }; static int tang_gradp_bc[] = { - INT_DIR, FOEXTRAP, FOEXTRAP, REFLECT_EVEN, FOEXTRAP, FOEXTRAP + amrex::BCType::int_dir, amrex::BCType::foextrap, amrex::BCType::foextrap, amrex::BCType::reflect_even, amrex::BCType::foextrap, amrex::BCType::foextrap }; static int temp_bc[] = { - INT_DIR, EXT_DIR, HOEXTRAP, REFLECT_EVEN, REFLECT_EVEN, REFLECT_EVEN + amrex::BCType::int_dir, amrex::BCType::ext_dir, amrex::BCType::hoextrap, amrex::BCType::reflect_even, amrex::BCType::reflect_even, amrex::BCType::reflect_even }; static int divu_bc[] = { - INT_DIR, REFLECT_EVEN, REFLECT_EVEN, REFLECT_EVEN, REFLECT_EVEN, REFLECT_EVEN + amrex::BCType::int_dir, amrex::BCType::reflect_even, amrex::BCType::reflect_even, amrex::BCType::reflect_even, amrex::BCType::reflect_even, amrex::BCType::reflect_even }; static int dsdt_bc[] = { - INT_DIR, EXT_DIR, EXT_DIR, REFLECT_EVEN, REFLECT_EVEN, REFLECT_EVEN + amrex::BCType::int_dir, amrex::BCType::ext_dir, amrex::BCType::ext_dir, amrex::BCType::reflect_even, amrex::BCType::reflect_even, amrex::BCType::reflect_even }; static int average_bc[] = { - INT_DIR, INT_DIR, INT_DIR, INT_DIR, INT_DIR, INT_DIR + amrex::BCType::int_dir, amrex::BCType::int_dir, amrex::BCType::int_dir, amrex::BCType::int_dir, amrex::BCType::int_dir, amrex::BCType::int_dir }; diff --git a/Source/NS_LES.cpp b/Source/NS_LES.cpp index 39807e5b..3c48a0f4 100644 --- a/Source/NS_LES.cpp +++ b/Source/NS_LES.cpp @@ -242,17 +242,17 @@ NavierStokesBase::LES_setDomainBC (std::array& mlmg_ else { int pbc = bc.lo(idim); - if (pbc == EXT_DIR) + if (pbc == BCType::ext_dir) { mlmg_lobc[idim] = LinOpBCType::Dirichlet; } - else if (pbc == FOEXTRAP || - pbc == HOEXTRAP || - pbc == REFLECT_EVEN) + else if (pbc == BCType::foextrap || + pbc == BCType::hoextrap || + pbc == BCType::reflect_even) { mlmg_lobc[idim] = LinOpBCType::Neumann; } - else if (pbc == REFLECT_ODD) + else if (pbc == BCType::reflect_odd) { mlmg_lobc[idim] = LinOpBCType::reflect_odd; } @@ -262,17 +262,17 @@ NavierStokesBase::LES_setDomainBC (std::array& mlmg_ } pbc = bc.hi(idim); - if (pbc == EXT_DIR) + if (pbc == BCType::ext_dir) { mlmg_hibc[idim] = LinOpBCType::Dirichlet; } - else if (pbc == FOEXTRAP || - pbc == HOEXTRAP || - pbc == REFLECT_EVEN) + else if (pbc == BCType::foextrap || + pbc == BCType::hoextrap || + pbc == BCType::reflect_even) { mlmg_hibc[idim] = LinOpBCType::Neumann; } - else if (pbc == REFLECT_ODD) + else if (pbc == BCType::reflect_odd) { mlmg_hibc[idim] = LinOpBCType::reflect_odd; } diff --git a/Source/NS_init_eb2.cpp b/Source/NS_init_eb2.cpp index a4a7ee53..b896f087 100644 --- a/Source/NS_init_eb2.cpp +++ b/Source/NS_init_eb2.cpp @@ -27,41 +27,41 @@ static void reentrant_profile(std::vector &points) { amrex::RealVect p; - p = amrex::RealVect(D_DECL(36.193*0.1, 7.8583*0.1, 0.0)); + p = amrex::RealVect(AMREX_D_DECL(36.193*0.1, 7.8583*0.1, 0.0)); points.push_back(p); - p = amrex::RealVect(D_DECL(35.924*0.1, 7.7881*0.1, 0.0)); + p = amrex::RealVect(AMREX_D_DECL(35.924*0.1, 7.7881*0.1, 0.0)); points.push_back(p); - p = amrex::RealVect(D_DECL(35.713*0.1, 7.5773*0.1, 0.0)); + p = amrex::RealVect(AMREX_D_DECL(35.713*0.1, 7.5773*0.1, 0.0)); points.push_back(p); - p = amrex::RealVect(D_DECL(35.643*0.1, 7.3083*0.1, 0.0)); + p = amrex::RealVect(AMREX_D_DECL(35.643*0.1, 7.3083*0.1, 0.0)); points.push_back(p); - p = amrex::RealVect(D_DECL(35.3*0.1, 7.0281*0.1, 0.0)); + p = amrex::RealVect(AMREX_D_DECL(35.3*0.1, 7.0281*0.1, 0.0)); points.push_back(p); - p = amrex::RealVect(D_DECL(35.421*0.1, 6.241*0.1, 0.0)); + p = amrex::RealVect(AMREX_D_DECL(35.421*0.1, 6.241*0.1, 0.0)); points.push_back(p); - p = amrex::RealVect(D_DECL(34.82*0.1, 5.686*0.1, 0.0)); + p = amrex::RealVect(AMREX_D_DECL(34.82*0.1, 5.686*0.1, 0.0)); points.push_back(p); - p = amrex::RealVect(D_DECL(30.539*0.1, 3.5043*0.1, 0.0)); + p = amrex::RealVect(AMREX_D_DECL(30.539*0.1, 3.5043*0.1, 0.0)); points.push_back(p); - p = amrex::RealVect(D_DECL(29.677*0.1, 2.6577*0.1, 0.0)); + p = amrex::RealVect(AMREX_D_DECL(29.677*0.1, 2.6577*0.1, 0.0)); points.push_back(p); - p = amrex::RealVect(D_DECL(29.457*0.1, 1.47*0.1, 0.0)); + p = amrex::RealVect(AMREX_D_DECL(29.457*0.1, 1.47*0.1, 0.0)); points.push_back(p); - // p = amrex::RealVect(D_DECL(29.38*0.1, -1.1038*0.1, 0.0)); + // p = amrex::RealVect(AMREX_D_DECL(29.38*0.1, -1.1038*0.1, 0.0)); // points.push_back(p); - // p = amrex::RealVect(D_DECL(29.3*0.1, -2.7262*0.1, 0.0)); + // p = amrex::RealVect(AMREX_D_DECL(29.3*0.1, -2.7262*0.1, 0.0)); // points.push_back(p); - // p = amrex::RealVect(D_DECL(29.273*0.1, -4.3428*0.1, 0.0)); + // p = amrex::RealVect(AMREX_D_DECL(29.273*0.1, -4.3428*0.1, 0.0)); // points.push_back(p); - p = amrex::RealVect(D_DECL(28.364*0.1, -5.7632*0.1, 0.0)); + p = amrex::RealVect(AMREX_D_DECL(28.364*0.1, -5.7632*0.1, 0.0)); points.push_back(p); - p = amrex::RealVect(D_DECL(27.151*0.1, -6.8407*0.1, 0.0)); + p = amrex::RealVect(AMREX_D_DECL(27.151*0.1, -6.8407*0.1, 0.0)); points.push_back(p); - p = amrex::RealVect(D_DECL(25.694*0.1, -7.5555*0.1, 0.0)); + p = amrex::RealVect(AMREX_D_DECL(25.694*0.1, -7.5555*0.1, 0.0)); points.push_back(p); - p = amrex::RealVect(D_DECL(24.035*0.1, -7.8586*0.1, 0.0)); + p = amrex::RealVect(AMREX_D_DECL(24.035*0.1, -7.8586*0.1, 0.0)); points.push_back(p); - p = amrex::RealVect(D_DECL(22.358*0.1, -7.6902*0.1, 0.0)); + p = amrex::RealVect(AMREX_D_DECL(22.358*0.1, -7.6902*0.1, 0.0)); points.push_back(p); } #endif @@ -142,18 +142,18 @@ initialize_EB2 (const Geometry& geom, int required_coarsening_level, amrex::RealVect p; std::vector lnpts; - p = amrex::RealVect(D_DECL(22.358*0.1, -7.6902*0.1, 0.0)); + p = amrex::RealVect(AMREX_D_DECL(22.358*0.1, -7.6902*0.1, 0.0)); lnpts.push_back(p); - p = amrex::RealVect(D_DECL(1.9934*0.1, 3.464*0.1, 0.0)); + p = amrex::RealVect(AMREX_D_DECL(1.9934*0.1, 3.464*0.1, 0.0)); lnpts.push_back(p); - p = amrex::RealVect(D_DECL(0.0*0.1, 3.464*0.1, 0.0)); + p = amrex::RealVect(AMREX_D_DECL(0.0*0.1, 3.464*0.1, 0.0)); lnpts.push_back(p); Piston.addLineElement(lnpts); lnpts.clear(); - p = amrex::RealVect(D_DECL(49.0*0.1, 7.8583*0.1, 0.0)); + p = amrex::RealVect(AMREX_D_DECL(49.0*0.1, 7.8583*0.1, 0.0)); lnpts.push_back(p); - p = amrex::RealVect(D_DECL(36.193*0.1, 7.8583*0.1, 0.0)); + p = amrex::RealVect(AMREX_D_DECL(36.193*0.1, 7.8583*0.1, 0.0)); lnpts.push_back(p); Piston.addLineElement(lnpts); lnpts.clear(); @@ -180,37 +180,37 @@ initialize_EB2 (const Geometry& geom, int required_coarsening_level, Real scaleFact; scaleFact = 0.0025; //MKS - p = amrex::RealVect(D_DECL(49.0*0.1*scaleFact, 7.8583*0.1*scaleFact, 0.0)); + p = amrex::RealVect(AMREX_D_DECL(49.0*0.1*scaleFact, 7.8583*0.1*scaleFact, 0.0)); lnpts.push_back(p); - p = amrex::RealVect(D_DECL(36.193*0.1*scaleFact, 7.8583*0.1*scaleFact, 0.0)); + p = amrex::RealVect(AMREX_D_DECL(36.193*0.1*scaleFact, 7.8583*0.1*scaleFact, 0.0)); lnpts.push_back(p); Piston.addLineElement(lnpts); lnpts.clear(); - p = amrex::RealVect(D_DECL(36.193*0.1*scaleFact, 7.8583*0.1*scaleFact, 0.0)); + p = amrex::RealVect(AMREX_D_DECL(36.193*0.1*scaleFact, 7.8583*0.1*scaleFact, 0.0)); lnpts.push_back(p); - p = amrex::RealVect(D_DECL(24.035*0.1*scaleFact, -7.8586*0.1*scaleFact, 0.0)); + p = amrex::RealVect(AMREX_D_DECL(24.035*0.1*scaleFact, -7.8586*0.1*scaleFact, 0.0)); lnpts.push_back(p); Piston.addLineElement(lnpts); lnpts.clear(); - p = amrex::RealVect(D_DECL(24.035*0.1*scaleFact, -7.8586*0.1*scaleFact, 0.0)); + p = amrex::RealVect(AMREX_D_DECL(24.035*0.1*scaleFact, -7.8586*0.1*scaleFact, 0.0)); lnpts.push_back(p); - p = amrex::RealVect(D_DECL(20.0*0.1*scaleFact, -7.8586*0.1*scaleFact, 0.0)); + p = amrex::RealVect(AMREX_D_DECL(20.0*0.1*scaleFact, -7.8586*0.1*scaleFact, 0.0)); lnpts.push_back(p); Piston.addLineElement(lnpts); lnpts.clear(); - p = amrex::RealVect(D_DECL(20.0*0.1*scaleFact, -7.8586*0.1*scaleFact, 0.0)); + p = amrex::RealVect(AMREX_D_DECL(20.0*0.1*scaleFact, -7.8586*0.1*scaleFact, 0.0)); lnpts.push_back(p); - p = amrex::RealVect(D_DECL(1.9934*0.1*scaleFact, 3.464*0.1*scaleFact, 0.0)); + p = amrex::RealVect(AMREX_D_DECL(1.9934*0.1*scaleFact, 3.464*0.1*scaleFact, 0.0)); lnpts.push_back(p); Piston.addLineElement(lnpts); lnpts.clear(); - p = amrex::RealVect(D_DECL(1.9934*0.1*scaleFact, 3.464*0.1*scaleFact, 0.0)); + p = amrex::RealVect(AMREX_D_DECL(1.9934*0.1*scaleFact, 3.464*0.1*scaleFact, 0.0)); lnpts.push_back(p); - p = amrex::RealVect(D_DECL(0.09061*0.1*scaleFact, 3.464*0.1*scaleFact, 0.0)); + p = amrex::RealVect(AMREX_D_DECL(0.09061*0.1*scaleFact, 3.464*0.1*scaleFact, 0.0)); lnpts.push_back(p); Piston.addLineElement(lnpts); diff --git a/Source/NavierStokesBase.cpp b/Source/NavierStokesBase.cpp index 26711b7e..835ee33f 100644 --- a/Source/NavierStokesBase.cpp +++ b/Source/NavierStokesBase.cpp @@ -61,7 +61,7 @@ struct HomExtDirFill // // A dummy function because FillPatch requires something to exist for filling dirichlet boundary conditions, // even if we know we cannot have an ext_dir BC. -// u_mac BCs are only either periodic (INT_DIR) or first order extrapolation (FOEXTRAP). +// u_mac BCs are only either periodic (BCType::int_dir) or first order extrapolation (FOEXTRAP). // struct umacFill { @@ -601,10 +601,10 @@ NavierStokesBase::read_geometry () int coord; pp.get("coord_sys",coord); - if ((Geometry::CoordType) coord == Geometry::RZ && phys_bc.lo(0) != Symmetry) + if ((Geometry::CoordType) coord == Geometry::RZ && phys_bc.lo(0) != PhysBCType::symmetry) { - phys_bc.setLo(0,Symmetry); - amrex::Print() << "\nWarning: Setting phys_bc at xlo to Symmetry\n\n"; + phys_bc.setLo(0,PhysBCType::symmetry); + amrex::Print() << "\nWarning: Setting phys_bc at xlo to PhysBCType::symmetry\n\n"; } #endif } @@ -1638,14 +1638,14 @@ NavierStokesBase::getOutFlowFaces (Vector& outFaces) outFaces.resize(0); for (int idir = 0; idir < AMREX_SPACEDIM; idir++) { - if (phys_bc.lo(idir) == Outflow) + if (phys_bc.lo(idir) == PhysBCType::outflow) { auto len = outFaces.size(); outFaces.resize(len+1); outFaces[len] = Orientation(idir,Orientation::low); } - if (phys_bc.hi(idir) == Outflow) + if (phys_bc.hi(idir) == PhysBCType::outflow) { auto len = outFaces.size(); outFaces.resize(len+1); @@ -2952,7 +2952,7 @@ NavierStokesBase::scalar_advection_update (Real dt, // { // amrex::Print() << "SAU: Old scalar " << sigma << " contains Nans" << std::endl; - // IntVect mpt(D_DECL(-100,100,-100)); + // IntVect mpt(AMREX_D_DECL(-100,100,-100)); // for (MFIter mfi(S_old); mfi.isValid(); ++mfi){ // if ( S_old[mfi].contains_nan(mpt) ) // amrex::Print() << " Nans at " << mpt << std::endl; @@ -2962,7 +2962,7 @@ NavierStokesBase::scalar_advection_update (Real dt, // { // amrex::Print() << "SAU: New scalar " << sigma << " contains Nans" << std::endl; - // IntVect mpt(D_DECL(-100,100,-100)); + // IntVect mpt(AMREX_D_DECL(-100,100,-100)); // for (MFIter mfi(S_new); mfi.isValid(); ++mfi){ // if ( S_new[mfi].contains_nan(mpt) ) // amrex::Print() << " Nans at " << mpt << std::endl; @@ -3040,8 +3040,8 @@ set_bcrec_new (Vector &bcrec, for (int dir = 0; dir < AMREX_SPACEDIM; dir++) { int bc_index = (src_comp+n)*(2*AMREX_SPACEDIM) + dir; - bcrec[n].setLo(dir,INT_DIR); - bcrec[n].setHi(dir,INT_DIR); + bcrec[n].setLo(dir,BCType::int_dir); + bcrec[n].setHi(dir,BCType::int_dir); if ( ( box.smallEnd(dir) < domain.smallEnd(dir) ) || ( box.bigEnd(dir) > domain.bigEnd(dir) ) ) { for (int crse = 0; crse < cgrids.size(); crse++) { @@ -3633,7 +3633,7 @@ NavierStokesBase::velocity_advection_update (Real dt) { amrex::Print() << "VAU: Old velocity " << sigma << " contains Nans" << std::endl; - IntVect mpt(D_DECL(-100,100,-100)); + IntVect mpt(AMREX_D_DECL(-100,100,-100)); for (MFIter mfi(U_old); mfi.isValid(); ++mfi){ const Box& bx = mfi.tilebox(); if ( U_old[mfi].contains_nan(bx, sigma, 1, mpt) ) @@ -3644,7 +3644,7 @@ NavierStokesBase::velocity_advection_update (Real dt) { amrex::Print() << "VAU: New velocity " << sigma << " contains Nans" << std::endl; - IntVect mpt(D_DECL(-100,100,-100)); + IntVect mpt(AMREX_D_DECL(-100,100,-100)); for (MFIter mfi(U_new); mfi.isValid(); ++mfi){ const Box& bx = mfi.tilebox(); if ( U_new[mfi].contains_nan(bx, sigma, 1, mpt) ) @@ -3998,7 +3998,7 @@ NavierStokesBase::ParticleDerive (const std::string& name, // ParticleDerive("particle_count",time,mf,dcomp); - IntVect trr(D_DECL(1,1,1)); + IntVect trr(AMREX_D_DECL(1,1,1)); for (int lev = level+1; lev <= parent->finestLevel(); lev++) { diff --git a/Source/OutFlowBC.cpp b/Source/OutFlowBC.cpp index 36e5a10d..cf39ff99 100644 --- a/Source/OutFlowBC.cpp +++ b/Source/OutFlowBC.cpp @@ -13,7 +13,7 @@ OutFlowBC::SemiGrow (const Box& baseBox, int nGrow, int direction) { - IntVect grow_factor(D_DECL(nGrow,nGrow,nGrow)); + IntVect grow_factor(AMREX_D_DECL(nGrow,nGrow,nGrow)); grow_factor[direction] = 0; return amrex::grow(baseBox,grow_factor); } @@ -23,7 +23,7 @@ OutFlowBC::SemiCoarsen (const Box& baseBox, int ref_factor, int direction) { - IntVect ref_ratio(D_DECL(ref_factor,ref_factor,ref_factor)); + IntVect ref_ratio(AMREX_D_DECL(ref_factor,ref_factor,ref_factor)); ref_ratio[direction] = 1; return amrex::coarsen(baseBox,ref_ratio); } @@ -40,14 +40,14 @@ OutFlowBC::GetOutFlowFaces (bool& haveOutFlow, for (int idir = 0; idir < AMREX_SPACEDIM; idir++) { - if (_phys_bc->lo(idir) == Outflow) + if (_phys_bc->lo(idir) == PhysBCType::outflow) { haveOutFlow = true; outFaces[numOutFlowBC] = Orientation(idir,Orientation::low); numOutFlowBC++; } - if (_phys_bc->hi(idir) == Outflow) + if (_phys_bc->hi(idir) == PhysBCType::outflow) { haveOutFlow = true; outFaces[numOutFlowBC] = Orientation(idir,Orientation::high); @@ -63,12 +63,12 @@ OutFlowBC::HasOutFlowBC (BCRec* _phys_bc) for (int idir = 0; idir < AMREX_SPACEDIM; idir++) { - if (_phys_bc->lo(idir) == Outflow) + if (_phys_bc->lo(idir) == PhysBCType::outflow) { has_out_flow = true; } - if (_phys_bc->hi(idir) == Outflow) + if (_phys_bc->hi(idir) == PhysBCType::outflow) { has_out_flow = true; } diff --git a/Source/Projection.cpp b/Source/Projection.cpp index 02585488..237a4772 100644 --- a/Source/Projection.cpp +++ b/Source/Projection.cpp @@ -1574,11 +1574,11 @@ Projection::initialVorticityProject (int c_lev) // BCRec phys_bc_save(phys_bc->lo(),phys_bc->hi()); for (int i=0; isetLo(i,Outflow); - phys_bc->setHi(i,Outflow); + phys_bc->setLo(i,PhysBCType::outflow); + phys_bc->setHi(i,PhysBCType::outflow); if (geom.isPeriodic(i)) { - phys_bc->setLo(i,Interior); - phys_bc->setHi(i,Interior); + phys_bc->setLo(i,PhysBCType::interior); + phys_bc->setHi(i,PhysBCType::interior); } } // @@ -2445,17 +2445,17 @@ void Projection::doMLMGNodalProjection (int c_lev, int nlevel, } else { - if (phys_bc->lo(idim) == Outflow) { + if (phys_bc->lo(idim) == PhysBCType::outflow) { mlmg_lobc[idim] = LinOpBCType::Dirichlet; - } else if (phys_bc->lo(idim) == Inflow) { + } else if (phys_bc->lo(idim) == PhysBCType::inflow) { mlmg_lobc[idim] = LinOpBCType::inflow; } else { mlmg_lobc[idim] = LinOpBCType::Neumann; } - if (phys_bc->hi(idim) == Outflow) { + if (phys_bc->hi(idim) == PhysBCType::outflow) { mlmg_hibc[idim] = LinOpBCType::Dirichlet; - } else if (phys_bc->hi(idim) == Inflow) { + } else if (phys_bc->hi(idim) == PhysBCType::inflow) { mlmg_hibc[idim] = LinOpBCType::inflow; } else { mlmg_hibc[idim] = LinOpBCType::Neumann; @@ -2591,7 +2591,7 @@ void Projection::set_boundary_velocity (int c_lev, int nlevel, for (int idir=0; idirsetBndry(0.0, Xvel+idir, 1); } else { @@ -2612,7 +2612,7 @@ void Projection::set_boundary_velocity (int c_lev, int nlevel, // const Box& tile = mfi.tilebox(); // BoxList bxlist(tile); - if (lo_bc[idir] == Inflow && reg.smallEnd(idir) == domainBox.smallEnd(idir)) { + if (lo_bc[idir] == PhysBCType::inflow && reg.smallEnd(idir) == domainBox.smallEnd(idir)) { Box bx; // bx is the region we *protect* from zero'ing bx = amrex::adjCellLo(reg, idir); @@ -2629,7 +2629,7 @@ void Projection::set_boundary_velocity (int c_lev, int nlevel, bxlist.push_back(bx); } - if (hi_bc[idir] == Inflow && reg.bigEnd(idir) == domainBox.bigEnd(idir)) { + if (hi_bc[idir] == PhysBCType::inflow && reg.bigEnd(idir) == domainBox.bigEnd(idir)) { Box bx; // bx is the region we *protect* from zero'ing bx = amrex::adjCellHi(reg, idir); diff --git a/Source/SyncRegister.cpp b/Source/SyncRegister.cpp index 36769c58..e96d1944 100644 --- a/Source/SyncRegister.cpp +++ b/Source/SyncRegister.cpp @@ -68,7 +68,7 @@ SyncRegister::InitRHS (MultiFab& rhs, const Geometry& geom, const BCRec& phys_bc int nOutflow = 0; for (int dir = 0; dir < AMREX_SPACEDIM; dir++) { - if (phys_lo[dir] == Outflow || phys_hi[dir] == Outflow) + if (phys_lo[dir] == PhysBCType::outflow || phys_hi[dir] == PhysBCType::outflow) { outflow_dirs[nOutflow]=dir; nOutflow++; @@ -91,7 +91,7 @@ SyncRegister::InitRHS (MultiFab& rhs, const Geometry& geom, const BCRec& phys_bc const Box& vbx = mfi.validbox(); auto const& rhs_arr = rhs.array(mfi); - if (phys_lo[dir] == Outflow) + if (phys_lo[dir] == PhysBCType::outflow) { Box domlo(node_domain); domlo.setRange(dir,node_domain.smallEnd(dir),1); @@ -105,7 +105,7 @@ SyncRegister::InitRHS (MultiFab& rhs, const Geometry& geom, const BCRec& phys_bc }); } } - if (phys_hi[dir] == Outflow) + if (phys_hi[dir] == PhysBCType::outflow) { Box domhi(node_domain); domhi.setRange(dir,node_domain.bigEnd(dir),1); @@ -191,7 +191,7 @@ SyncRegister::InitRHS (MultiFab& rhs, const Geometry& geom, const BCRec& phys_bc amrex::ParallelFor(bx, [mask,tmp_arr] AMREX_GPU_DEVICE (int i, int j, int k) noexcept { - mask(i,j,k) = D_TERM( tmp_arr(i ,j ,k ) + tmp_arr(i-1,j ,k ), + mask(i,j,k) = AMREX_D_TERM( tmp_arr(i ,j ,k ) + tmp_arr(i-1,j ,k ), + tmp_arr(i ,j-1,k ) + tmp_arr(i-1,j-1,k ), + tmp_arr(i ,j ,k-1) + tmp_arr(i-1,j ,k-1) + tmp_arr(i ,j-1,k-1) + tmp_arr(i-1,j-1,k-1)); @@ -262,7 +262,7 @@ SyncRegister::InitRHS (MultiFab& rhs, const Geometry& geom, const BCRec& phys_bc FArrayBox& fab = fs[fsi]; const Box& bx = fab.box(); auto const& mask = fab.array(); - const Real maxcount = D_TERM(AMREX_SPACEDIM,*AMREX_SPACEDIM,*AMREX_SPACEDIM) - 0.5; + const Real maxcount = AMREX_D_TERM(AMREX_SPACEDIM,*AMREX_SPACEDIM,*AMREX_SPACEDIM) - 0.5; amrex::ParallelFor(bx, [mask,maxcount] AMREX_GPU_DEVICE (int i, int j, int k) noexcept { @@ -452,7 +452,7 @@ SyncRegister::FineAdd (MultiFab& Sync_resid_fine, const Geometry& crse_geom, Rea cbndfab.resize(cbndbox, 1); auto const& cbndfab_a = cbndfab.array(); Elixir cbndfab_e = cbndfab.elixir(); - amrex::GpuArray rratio = {D_DECL(ratio[0],ratio[1],ratio[2])}; + amrex::GpuArray rratio = {AMREX_D_DECL(ratio[0],ratio[1],ratio[2])}; #if AMREX_SPACEDIM == 2 ParallelFor(cbndbox, [rratio,cbndfab_a,finefab_a,dir,dim1] diff --git a/Tutorials/TaylorGreen/benchmarks/EXACT_2D.F b/Tutorials/TaylorGreen/benchmarks/EXACT_2D.F index be4a4d97..1a8296cb 100644 --- a/Tutorials/TaylorGreen/benchmarks/EXACT_2D.F +++ b/Tutorials/TaylorGreen/benchmarks/EXACT_2D.F @@ -9,6 +9,24 @@ #include #include +#ifdef BL_USE_FLOAT +#define REAL_T real +#define zero 0.0e0 +#define one 1.0e0 +#define two 2.0e0 +#define four 4.0e0 +#define half 0.5e0 +#define Pi 3.1415926535897932e0 +#else +#define REAL_T double precision +#define zero 0.0d0 +#define one 1.0d0 +#define two 2.0d0 +#define four 4.0d0 +#define half 0.5d0 +#define Pi 3.1415926535897932d0 +#endif + #define SDIM 2 c c ::: ----------------------------------------------------------- @@ -25,17 +43,21 @@ c ::: the pressure field. c subroutine FORT_VISCBENCH(time, nu, lo, hi, - & ncomp, state, DIMS(state), + & ncomp, state, + & state_l1,state_l2, + & state_h1,state_h2, & dx, xlo, xhi) implicit none integer ncomp integer lo(SDIM), hi(SDIM) - integer DIMDEC(state) + integer state_l1,state_l2 + integer state_h1,state_h2 REAL_T time, nu, dx(SDIM) REAL_T xlo(SDIM), xhi(SDIM) - REAL_T state(DIMV(state),ncomp) + REAL_T state(state_l1:state_h1, + & state_l2:state_h2,ncomp) c c ::::: local variables c diff --git a/Tutorials/TaylorGreen/benchmarks/EXACT_3D.F b/Tutorials/TaylorGreen/benchmarks/EXACT_3D.F index c4c2ff21..5582c3da 100644 --- a/Tutorials/TaylorGreen/benchmarks/EXACT_3D.F +++ b/Tutorials/TaylorGreen/benchmarks/EXACT_3D.F @@ -9,6 +9,24 @@ #include #include +#ifdef BL_USE_FLOAT +#define REAL_T real +#define zero 0.0e0 +#define one 1.0e0 +#define two 2.0e0 +#define four 4.0e0 +#define half 0.5e0 +#define Pi 3.1415926535897932e0 +#else +#define REAL_T double precision +#define zero 0.0d0 +#define one 1.0d0 +#define two 2.0d0 +#define four 4.0d0 +#define half 0.5d0 +#define Pi 3.1415926535897932d0 +#endif + #define SDIM 3 c c ::: ----------------------------------------------------------- @@ -25,21 +43,26 @@ c ::: the pressure field. c subroutine FORT_VISCBENCH(time, nu, unifdir, lo, hi, - & ncomp, state, DIMS(state), + & ncomp, state, + & state_l1,state_l2,state_l3, + & state_h1,state_h2,state_h3, & dx, xlo, xhi) implicit none integer ncomp, unifdir integer lo(SDIM), hi(SDIM) - integer DIMDEC(state) + integer state_l1,state_l2,state_l3 + integer state_h1,state_h2,state_h3 REAL_T time, nu, dx(SDIM) REAL_T xlo(SDIM), xhi(SDIM) - REAL_T state(DIMV(state),ncomp) + REAL_T state(state_l1:state_h1, + & state_l2:state_h2, + & state_l3:state_h3,ncomp) c c ::::: local variables c - integer i, j, k, n + integer i, j, k REAL_T x, y, z REAL_T hx, hy, hz REAL_T spx, spy, spz, cpx, cpy, cpz diff --git a/Tutorials/TaylorGreen/benchmarks/EXACT_F.H b/Tutorials/TaylorGreen/benchmarks/EXACT_F.H index 6f3f98ed..4ebd421b 100644 --- a/Tutorials/TaylorGreen/benchmarks/EXACT_F.H +++ b/Tutorials/TaylorGreen/benchmarks/EXACT_F.H @@ -22,7 +22,7 @@ c #endif // -// Use ARLIM in the following. +// Use AMREX_ARLIM in the following. // extern "C" @@ -31,14 +31,14 @@ extern "C" void FORT_VISCBENCH(const amrex::Real *time, const amrex::Real *nu, const int *unifdir, const int *lo, const int *hi, const int *ncomp, - const amrex::Real *state, ARLIM_P(lo), ARLIM_P(hi), + const amrex::Real *state, AMREX_ARLIM_P(lo), AMREX_ARLIM_P(hi), const amrex::Real *delta, const amrex::Real *xlo, const amrex::Real *xhi); #else void FORT_VISCBENCH(const amrex::Real *time, const amrex::Real *nu, const int *lo, const int *hi, const int *ncomp, - const amrex::Real *state, ARLIM_P(lo), ARLIM_P(hi), + const amrex::Real *state, AMREX_ARLIM_P(lo), AMREX_ARLIM_P(hi), const amrex::Real *delta, const amrex::Real *xlo, const amrex::Real *xhi); #endif diff --git a/Tutorials/TaylorGreen/benchmarks/ViscBench.cpp b/Tutorials/TaylorGreen/benchmarks/ViscBench.cpp index f457c1cb..6a761f56 100644 --- a/Tutorials/TaylorGreen/benchmarks/ViscBench.cpp +++ b/Tutorials/TaylorGreen/benchmarks/ViscBench.cpp @@ -187,14 +187,14 @@ main (int argc, FORT_VISCBENCH(&time, &mu, &unifDir, lo, hi, &nComp, ((*dataE[iLevel])[iGrid]).dataPtr(), - ARLIM(lo), ARLIM(hi), + AMREX_ARLIM(lo), AMREX_ARLIM(hi), delI.dataPtr(), xlo.dataPtr(), xhi.dataPtr()); #else FORT_VISCBENCH(&time, &mu, lo, hi, &nComp, ((*dataE[iLevel])[iGrid]).dataPtr(), - ARLIM(lo), ARLIM(hi), + AMREX_ARLIM(lo), AMREX_ARLIM(hi), delI.dataPtr(), xlo.dataPtr(), xhi.dataPtr()); #endif @@ -269,4 +269,3 @@ amrDatasHaveSameDerives(const AmrData& amrd1, return false; return true; } -