Skip to content

Commit

Permalink
add subch_planar 1D support (#2952)
Browse files Browse the repository at this point in the history
  • Loading branch information
brady-ryan authored Sep 16, 2024
1 parent 7059f8b commit 896016e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
27 changes: 11 additions & 16 deletions Exec/science/subch_planar/Problem_Derive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ void ca_dergradpoverp(const Box& bx, FArrayBox& derfab, int /*dcomp*/, int /*nco

#if AMREX_SPACEDIM == 3
amrex::Error("3D not supported");
#endif
#if AMREX_SPACEDIM == 1
amrex::Error("1D not supported");
#elif AMREX_SPACEDIM == 1
return; // Skip for 1D
#endif

Real dxinv = 1.0_rt / dx[0];
Expand Down Expand Up @@ -226,9 +225,8 @@ void ca_dergradpoverp1(const Box& bx, FArrayBox& derfab, int /*dcomp*/, int /*nc

#if AMREX_SPACEDIM == 3
amrex::Error("3D not supported");
#endif
#if AMREX_SPACEDIM == 1
amrex::Error("1D not supported");
#elif AMREX_SPACEDIM == 1
return; // Skip for 1D
#endif

Real dxinv = 1.0_rt / dx[0];
Expand Down Expand Up @@ -434,9 +432,8 @@ void ca_dergradpx(const Box& bx, FArrayBox& derfab, int /*dcomp*/, int /*ncomp*/

#if AMREX_SPACEDIM == 3
amrex::Error("3D not supported");
#endif
#if AMREX_SPACEDIM == 1
amrex::Error("1D not supported");
#elif AMREX_SPACEDIM == 1
return; // Skip for 1D
#endif

Real dxinv = 1.0_rt / dx[0];
Expand Down Expand Up @@ -545,9 +542,8 @@ void ca_dergradpy(const Box& bx, FArrayBox& derfab, int /*dcomp*/, int /*ncomp*/

#if AMREX_SPACEDIM == 3
amrex::Error("3D not supported");
#endif
#if AMREX_SPACEDIM == 1
amrex::Error("1D not supported");
#elif AMREX_SPACEDIM == 1
return; // Skip for 1D
#endif

Real dxinv = 1.0_rt / dx[0];
Expand Down Expand Up @@ -658,9 +654,8 @@ void ca_dergradrhooverrho(const Box& bx, FArrayBox& derfab, int /*dcomp*/, int /

#if AMREX_SPACEDIM == 3
amrex::Error("3D not supported");
#endif
#if AMREX_SPACEDIM == 1
amrex::Error("1D not supported");
#elif AMREX_SPACEDIM == 1
return; // Skip for 1D
#endif

Real dxinv = 1.0_rt / dx[0];
Expand Down Expand Up @@ -719,4 +714,4 @@ void ca_dergradrhooverrho(const Box& bx, FArrayBox& derfab, int /*dcomp*/, int /

});

}
}
4 changes: 3 additions & 1 deletion Exec/science/subch_planar/problem_initialize_state_data.H
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ void problem_initialize_state_data (int i, int j, int k,
Real z = problo[2] + dx[2] * (static_cast<Real>(k) + 0.5_rt);
#endif

#if AMREX_SPACEDIM == 2
#if AMREX_SPACEDIM == 1
Real height = x;
#elif AMREX_SPACEDIM == 2
Real height = y;
#else
Real height = z;
Expand Down

0 comments on commit 896016e

Please sign in to comment.