diff --git a/Exec/science/subch_planar/Problem_Derive.cpp b/Exec/science/subch_planar/Problem_Derive.cpp index 3275166238..9cb25c92e7 100644 --- a/Exec/science/subch_planar/Problem_Derive.cpp +++ b/Exec/science/subch_planar/Problem_Derive.cpp @@ -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]; @@ -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]; @@ -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]; @@ -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]; @@ -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]; @@ -719,4 +714,4 @@ void ca_dergradrhooverrho(const Box& bx, FArrayBox& derfab, int /*dcomp*/, int / }); -} +} \ No newline at end of file diff --git a/Exec/science/subch_planar/problem_initialize_state_data.H b/Exec/science/subch_planar/problem_initialize_state_data.H index f002f1339c..48f0aceac3 100644 --- a/Exec/science/subch_planar/problem_initialize_state_data.H +++ b/Exec/science/subch_planar/problem_initialize_state_data.H @@ -25,7 +25,9 @@ void problem_initialize_state_data (int i, int j, int k, Real z = problo[2] + dx[2] * (static_cast(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;