Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pass in the correct dloga when doing tracing #2994

Merged
merged 9 commits into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Source/driver/Castro.H
Original file line number Diff line number Diff line change
Expand Up @@ -1381,9 +1381,10 @@ protected:
///
amrex::MultiFab volume;
amrex::Array<amrex::MultiFab,3> area;
amrex::MultiFab dLogArea[1];
amrex::Vector< amrex::Vector<amrex::Real> > radius;

#if AMREX_SPACEDIM <= 2
amrex::Array<amrex::MultiFab,2> dLogArea;
#endif

///
/// For initialization of the C++ values of the runtime parameters
Expand Down
13 changes: 11 additions & 2 deletions Source/driver/Castro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
27 changes: 18 additions & 9 deletions Source/hydro/Castro_ctu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ Castro::ctu_ppm_states(const Box& bx, const Box& vbx,
Array4<Real> const& qzp,
#endif
#if AMREX_SPACEDIM < 3
Array4<Real const> const& dloga,
Array4<Real const> const& dlogaX,
#endif
#if AMREX_SPACEDIM == 2
Array4<Real const> const& dlogaY,
#endif
const Real dt) {

Expand All @@ -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);

Expand All @@ -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);

Expand Down Expand Up @@ -173,7 +176,10 @@ Castro::ctu_ppm_rad_states(const Box& bx, const Box& vbx,
Array4<Real> const& qzp,
#endif
#if AMREX_SPACEDIM < 3
Array4<Real const> const& dloga,
Array4<Real const> const& dlogaX,
#endif
#if AMREX_SPACEDIM == 2
Array4<Real const> const& dlogaY,
#endif
const Real dt) {

Expand All @@ -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);

Expand All @@ -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);

Expand Down Expand Up @@ -243,7 +249,10 @@ Castro::ctu_plm_states(const Box& bx, const Box& vbx,
Array4<Real> const& qzp,
#endif
#if AMREX_SPACEDIM < 3
Array4<Real const> const& dloga,
Array4<Real const> const& dlogaX,
#endif
#if AMREX_SPACEDIM == 2
Array4<Real const> const& dlogaY,
#endif
const Real dt) {

Expand Down Expand Up @@ -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);

Expand All @@ -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);

Expand Down
22 changes: 17 additions & 5 deletions Source/hydro/Castro_ctu_hydro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,10 @@ Castro::construct_ctu_hydro_source(Real time, Real dt) // NOLINT(readability-co
#endif

#if AMREX_SPACEDIM < 3
Array4<Real const> const dLogArea_arr = (dLogArea[0]).array(mfi);
Array4<Real const> const dLogAreaX_arr = (dLogArea[0]).array(mfi);
#endif
#if AMREX_SPACEDIM == 2
Array4<Real const> const dLogAreaY_arr = (dLogArea[1]).array(mfi);
#endif

const Box& xbx = amrex::surroundingNodes(bx, 0);
Expand Down Expand Up @@ -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);

Expand All @@ -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
Expand All @@ -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
Expand Down
24 changes: 18 additions & 6 deletions Source/hydro/Castro_hydro.H
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -238,7 +239,10 @@
amrex::Array4<amrex::Real> const& qzp,
#endif
#if AMREX_SPACEDIM < 3
amrex::Array4<amrex::Real const> const& dloga,
amrex::Array4<amrex::Real const> const& dlogaX,
#endif
#if AMREX_SPACEDIM == 2
amrex::Array4<amrex::Real const> const& dlogaY,
#endif
const amrex::Real dt);

Expand All @@ -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,
Expand All @@ -279,7 +284,10 @@
amrex::Array4<amrex::Real> const& qzp,
#endif
#if AMREX_SPACEDIM < 3
amrex::Array4<amrex::Real const> const& dloga,
amrex::Array4<amrex::Real const> const& dlogaX,
#endif
#if AMREX_SPACEDIM == 2
amrex::Array4<amrex::Real const> const& dlogaY,
#endif
const amrex::Real dt);

Expand All @@ -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,
Expand All @@ -321,7 +330,10 @@
amrex::Array4<amrex::Real> const& qzp,
#endif
#if AMREX_SPACEDIM < 3
amrex::Array4<amrex::Real const> const& dloga,
amrex::Array4<amrex::Real const> const& dlogaX,
#endif
#if AMREX_SPACEDIM == 2
amrex::Array4<amrex::Real const> const& dlogaY,
#endif
const amrex::Real dt);
#endif
Expand Down