From fc38b7d75cd17859dc9dce6c567a23343705f925 Mon Sep 17 00:00:00 2001 From: Zhi Date: Mon, 7 Oct 2024 15:17:18 -0400 Subject: [PATCH] remove 2d spherical abort and add some asserts setup --- Source/driver/Castro.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Source/driver/Castro.cpp b/Source/driver/Castro.cpp index d3fe48b979..8e6902bbea 100644 --- a/Source/driver/Castro.cpp +++ b/Source/driver/Castro.cpp @@ -306,7 +306,15 @@ Castro::read_params () #elif (AMREX_SPACEDIM == 2) if ( dgeom.IsSPHERICAL() ) { - amrex::Abort("We don't support spherical coordinate systems in 2D"); + if ( (dgeom.ProbLo(1) >= 0.0_rt) && (dgeom.ProbHi(1) <= 3.14159265359_rt) ) + { + amrex::Abort("Theta must be within [0, Pi] for spherical coordinate system in 2D"); + } + + if ( dgeom.ProbLo(0) > static_cast(NUM_GROW)*dgeom.CellSize(0) ) + { + amrex::Abort("R-min must be large enough so ghost cells doesn't extend to negative R"); + } } #elif (AMREX_SPACEDIM == 3) if ( dgeom.IsRZ() )