Skip to content

Commit

Permalink
have dlogarea in both x and y direction
Browse files Browse the repository at this point in the history
  • Loading branch information
zhichen3 committed Nov 14, 2024
1 parent b38a018 commit c2ddb0c
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Source/driver/Castro.H
Original file line number Diff line number Diff line change
Expand Up @@ -1381,7 +1381,7 @@ protected:
///
amrex::MultiFab volume;
amrex::Array<amrex::MultiFab,3> area;
amrex::MultiFab dLogArea[1];
amrex::MultiFab dLogArea;
amrex::Vector< amrex::Vector<amrex::Real> > radius;


Expand Down
7 changes: 5 additions & 2 deletions Source/driver/Castro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -845,9 +845,12 @@ 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);
}
#endif

wall_time_start = 0.0;
Expand Down
21 changes: 12 additions & 9 deletions Source/hydro/Castro_ctu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ 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,
Array4<Real const> const& dlogaY,
#endif
const Real dt) {

Expand All @@ -118,7 +119,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 +132,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 +174,8 @@ 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,
Array4<Real const> const& dlogaY,
#endif
const Real dt) {

Expand All @@ -187,7 +189,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 +202,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 +245,8 @@ 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,
Array4<Real const> const& dlogaY,
#endif
const Real dt) {

Expand Down Expand Up @@ -273,7 +276,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 +288,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
12 changes: 8 additions & 4 deletions Source/hydro/Castro_ctu_hydro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ 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);
Array4<Real const> const dLogAreaY_arr = (dLogArea[1]).array(mfi);
#endif

const Box& xbx = amrex::surroundingNodes(bx, 0);
Expand Down Expand Up @@ -343,7 +344,8 @@ 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,
dLogAreaY_arr,
#endif
dt);

Expand All @@ -361,7 +363,8 @@ 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,
dLogAreaY_arr,
#endif
dt);
#else
Expand All @@ -377,7 +380,8 @@ 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,
dLogAreaY_arr,
#endif
dt);
#endif
Expand Down
18 changes: 12 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,8 @@
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,
amrex::Array4<amrex::Real const> const& dlogaY,
#endif
const amrex::Real dt);

Expand All @@ -259,7 +261,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 +282,8 @@
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,
amrex::Array4<amrex::Real const> const& dlogaY,
#endif
const amrex::Real dt);

Expand All @@ -301,7 +305,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 +326,8 @@
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,
amrex::Array4<amrex::Real const> const& dlogaY,
#endif
const amrex::Real dt);
#endif
Expand Down

0 comments on commit c2ddb0c

Please sign in to comment.