From c63eb40bfc5abc2ca20feaf3bd286dd6cc23ec55 Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Tue, 23 Jan 2024 09:18:28 -0500 Subject: [PATCH] swap the order of Poisson and the first burn for Strang it should not matter which comes first, since reactions don't change density, but this swap will allow us to precompute the shock flag with sources before the first burn. --- Source/sources/Castro_sources.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Source/sources/Castro_sources.cpp b/Source/sources/Castro_sources.cpp index f99aac52dc..d035037aca 100644 --- a/Source/sources/Castro_sources.cpp +++ b/Source/sources/Castro_sources.cpp @@ -529,6 +529,15 @@ Castro::pre_advance_operators (Real time, Real dt) advance_status status {}; + // If we are using gravity, solve for the potential and + // gravitational field. note: since reactions don't change + // density, we can do this before or after the burn. + +#ifdef GRAVITY + construct_old_gravity(time); +#endif + + // If we are Strang splitting the reactions, do the old-time contribution now. #ifndef TRUE_SDC @@ -541,11 +550,6 @@ Castro::pre_advance_operators (Real time, Real dt) #endif #endif - // If we are using gravity, solve for the potential and gravitational field. - -#ifdef GRAVITY - construct_old_gravity(time); -#endif // Initialize the new-time data. This copy needs to come after all Strang-split operators.