Skip to content

Commit

Permalink
remove 2d spherical geometry abort and add some asserts for 2d spheri…
Browse files Browse the repository at this point in the history
…cal geometry setup. (#2973)
  • Loading branch information
zhichen3 authored Oct 7, 2024
1 parent f79e5a8 commit 68c1a15
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
10 changes: 9 additions & 1 deletion Source/driver/Castro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) > M_PI) )
{
amrex::Abort("Theta must be within [0, Pi] for spherical coordinate system in 2D");
}

if ( dgeom.ProbLo(0) < static_cast<Real>(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() )
Expand Down
7 changes: 0 additions & 7 deletions Source/gravity/Gravity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,6 @@ Gravity::read_params ()
amrex::Abort("Options are ConstantGrav, PoissonGrav, or MonopoleGrav");
}

if ( gravity::gravity_type == "ConstantGrav")
{
if ( dgeom.IsSPHERICAL() ) {
amrex::Abort("Can't use constant direction gravity with non-Cartesian coordinates");
}
}

#if (AMREX_SPACEDIM == 1)
if (gravity::gravity_type == "PoissonGrav")
{
Expand Down

0 comments on commit 68c1a15

Please sign in to comment.