diff --git a/Source/driver/Castro.H b/Source/driver/Castro.H index a3c6983c4a..0a77218ee6 100644 --- a/Source/driver/Castro.H +++ b/Source/driver/Castro.H @@ -1381,9 +1381,10 @@ protected: /// amrex::MultiFab volume; amrex::Array area; - amrex::MultiFab dLogArea[1]; amrex::Vector< amrex::Vector > radius; - +#if AMREX_SPACEDIM <= 2 + amrex::Array dLogArea; +#endif /// /// For initialization of the C++ values of the runtime parameters diff --git a/Source/driver/Castro.cpp b/Source/driver/Castro.cpp index 2a47ac55dd..0133c68bfe 100644 --- a/Source/driver/Castro.cpp +++ b/Source/driver/Castro.cpp @@ -845,9 +845,18 @@ Castro::buildMetrics () area[dir].setVal(0.0); } - dLogArea[0].clear(); #if (AMREX_SPACEDIM <= 2) - geom.GetDLogA(dLogArea[0],grids,dmap,0,NUM_GROW); + for (int dir = 0; dir < AMREX_SPACEDIM; dir++) + { + dLogArea[dir].clear(); + geom.GetDLogA(dLogArea[dir],grids,dmap,dir,NUM_GROW); + } + for (int dir = AMREX_SPACEDIM; dir < 2; dir++) + { + dLogArea[dir].clear(); + dLogArea[dir].define(grids, dmap, 1, 0); + dLogArea[dir].setVal(0.0); + } #endif wall_time_start = 0.0; diff --git a/Source/hydro/Castro_ctu.cpp b/Source/hydro/Castro_ctu.cpp index 6c222cdddf..18756b0b71 100644 --- a/Source/hydro/Castro_ctu.cpp +++ b/Source/hydro/Castro_ctu.cpp @@ -101,7 +101,10 @@ Castro::ctu_ppm_states(const Box& bx, const Box& vbx, Array4 const& qzp, #endif #if AMREX_SPACEDIM < 3 - Array4 const& dloga, + Array4 const& dlogaX, +#endif +#if AMREX_SPACEDIM == 2 + Array4 const& dlogaY, #endif const Real dt) { @@ -118,7 +121,7 @@ Castro::ctu_ppm_states(const Box& bx, const Box& vbx, U_arr, rho_inv_arr, q_arr, qaux_arr, srcQ, qxm, qxp, #if AMREX_SPACEDIM <= 2 - dloga, + dlogaX, #endif vbx, dt); @@ -131,7 +134,7 @@ Castro::ctu_ppm_states(const Box& bx, const Box& vbx, U_arr, rho_inv_arr, q_arr, qaux_arr, srcQ, qym, qyp, #if AMREX_SPACEDIM <= 2 - dloga, + dlogaY, #endif vbx, dt); @@ -173,7 +176,10 @@ Castro::ctu_ppm_rad_states(const Box& bx, const Box& vbx, Array4 const& qzp, #endif #if AMREX_SPACEDIM < 3 - Array4 const& dloga, + Array4 const& dlogaX, +#endif +#if AMREX_SPACEDIM == 2 + Array4 const& dlogaY, #endif const Real dt) { @@ -187,7 +193,7 @@ Castro::ctu_ppm_rad_states(const Box& bx, const Box& vbx, U_arr, rho_inv_arr, q_arr, qaux_arr, srcQ, qxm, qxp, #if AMREX_SPACEDIM <= 2 - dloga, + dlogaX, #endif vbx, dt); @@ -200,7 +206,7 @@ Castro::ctu_ppm_rad_states(const Box& bx, const Box& vbx, U_arr, rho_inv_arr, q_arr, qaux_arr, srcQ, qym, qyp, #if AMREX_SPACEDIM <= 2 - dloga, + dlogaY, #endif vbx, dt); @@ -243,7 +249,10 @@ Castro::ctu_plm_states(const Box& bx, const Box& vbx, Array4 const& qzp, #endif #if AMREX_SPACEDIM < 3 - Array4 const& dloga, + Array4 const& dlogaX, +#endif +#if AMREX_SPACEDIM == 2 + Array4 const& dlogaY, #endif const Real dt) { @@ -273,7 +282,7 @@ Castro::ctu_plm_states(const Box& bx, const Box& vbx, U_arr, rho_inv_arr, q_arr, qaux_arr, qxm, qxp, #if AMREX_SPACEDIM < 3 - dloga, + dlogaX, #endif srcQ, vbx, dt); @@ -285,7 +294,7 @@ Castro::ctu_plm_states(const Box& bx, const Box& vbx, U_arr, rho_inv_arr, q_arr, qaux_arr, qym, qyp, #if AMREX_SPACEDIM < 3 - dloga, + dlogaY, #endif srcQ, vbx, dt); diff --git a/Source/hydro/Castro_ctu_hydro.cpp b/Source/hydro/Castro_ctu_hydro.cpp index d443bbe060..884cb59631 100644 --- a/Source/hydro/Castro_ctu_hydro.cpp +++ b/Source/hydro/Castro_ctu_hydro.cpp @@ -242,7 +242,10 @@ Castro::construct_ctu_hydro_source(Real time, Real dt) // NOLINT(readability-co #endif #if AMREX_SPACEDIM < 3 - Array4 const dLogArea_arr = (dLogArea[0]).array(mfi); + Array4 const dLogAreaX_arr = (dLogArea[0]).array(mfi); +#endif +#if AMREX_SPACEDIM == 2 + Array4 const dLogAreaY_arr = (dLogArea[1]).array(mfi); #endif const Box& xbx = amrex::surroundingNodes(bx, 0); @@ -342,8 +345,11 @@ Castro::construct_ctu_hydro_source(Real time, Real dt) // NOLINT(readability-co #if AMREX_SPACEDIM == 3 qzm_arr, qzp_arr, #endif -#if (AMREX_SPACEDIM < 3) - dLogArea_arr, +#if AMREX_SPACEDIM < 3 + dLogAreaX_arr, +#endif +#if AMREX_SPACEDIM == 2 + dLogAreaY_arr, #endif dt); @@ -361,7 +367,10 @@ Castro::construct_ctu_hydro_source(Real time, Real dt) // NOLINT(readability-co qzm_arr, qzp_arr, #endif #if AMREX_SPACEDIM < 3 - dLogArea_arr, + dLogAreaX_arr, +#endif +#if AMREX_SPACEDIM == 2 + dLogAreaY_arr, #endif dt); #else @@ -377,7 +386,10 @@ Castro::construct_ctu_hydro_source(Real time, Real dt) // NOLINT(readability-co qzm_arr, qzp_arr, #endif #if AMREX_SPACEDIM < 3 - dLogArea_arr, + dLogAreaX_arr, +#endif +#if AMREX_SPACEDIM == 2 + dLogAreaY_arr, #endif dt); #endif diff --git a/Source/hydro/Castro_hydro.H b/Source/hydro/Castro_hydro.H index aa8c9582c5..d82bfde073 100644 --- a/Source/hydro/Castro_hydro.H +++ b/Source/hydro/Castro_hydro.H @@ -218,7 +218,8 @@ /// @param qyp right interface state in y, q_{i,j-1/2,k,R} /// @param qzm left interface state in z, q_{i,j,k-1/2,L} /// @param qzp right interface state in z, q_{i,j,k-1/2,R} -/// @param dloga the geometric factor d(log area) +/// @param dlogaX the geometric factor d(log area) in x (r) dir +/// @param dlogaY the geometric factor d(log area) in y (theta) dir /// @param dt timestep /// void ctu_ppm_states(const amrex::Box& bx, const amrex::Box& vbx, @@ -238,7 +239,10 @@ amrex::Array4 const& qzp, #endif #if AMREX_SPACEDIM < 3 - amrex::Array4 const& dloga, + amrex::Array4 const& dlogaX, +#endif +#if AMREX_SPACEDIM == 2 + amrex::Array4 const& dlogaY, #endif const amrex::Real dt); @@ -259,7 +263,8 @@ /// @param qyp right interface state in y, q_{i,j-1/2,k,R} /// @param qzm left interface state in z, q_{i,j,k-1/2,L} /// @param qzp right interface state in z, q_{i,j,k-1/2,R} -/// @param dloga the geometric factor d(log area) +/// @param dlogaX the geometric factor d(log area) in x (r) dir +/// @param dlogaY the geometric factor d(log area) in y (theta) dir /// @param dt timestep /// void ctu_plm_states(const amrex::Box& bx, const amrex::Box& vbx, @@ -279,7 +284,10 @@ amrex::Array4 const& qzp, #endif #if AMREX_SPACEDIM < 3 - amrex::Array4 const& dloga, + amrex::Array4 const& dlogaX, +#endif +#if AMREX_SPACEDIM == 2 + amrex::Array4 const& dlogaY, #endif const amrex::Real dt); @@ -301,7 +309,8 @@ /// @param qyp right interface state in y, q_{i,j-1/2,k,R} /// @param qzm left interface state in z, q_{i,j,k-1/2,L} /// @param qzp right interface state in z, q_{i,j,k-1/2,R} -/// @param dloga the geometric factor d(log area) +/// @param dlogaX the geometric factor d(log area) in x (r) dir +/// @param dlogaY the geometric factor d(log area) in y (theta) dir /// @param dt timestep /// void ctu_ppm_rad_states(const amrex::Box& bx, const amrex::Box& vbx, @@ -321,7 +330,10 @@ amrex::Array4 const& qzp, #endif #if AMREX_SPACEDIM < 3 - amrex::Array4 const& dloga, + amrex::Array4 const& dlogaX, +#endif +#if AMREX_SPACEDIM == 2 + amrex::Array4 const& dlogaY, #endif const amrex::Real dt); #endif