diff --git a/src/doctest.h b/src/doctest.h index 477fb623..3733f4c5 100644 --- a/src/doctest.h +++ b/src/doctest.h @@ -2299,9 +2299,9 @@ class DOCTEST_INTERFACE Context { #endif // DOCTEST_CONFIG_WITH_VARIADIC_MACROS // for subcases -#define DOCTEST_SUBCASE(name) \ - if (const doctest::detail::Subcase& DOCTEST_ANONYMOUS( \ - _DOCTEST_ANON_SUBCASE_) DOCTEST_UNUSED = \ +#define DOCTEST_SUBCASE(name) \ + if (const doctest::detail::Subcase \ + & DOCTEST_ANONYMOUS(_DOCTEST_ANON_SUBCASE_) DOCTEST_UNUSED = \ doctest::detail::Subcase(name, __FILE__, __LINE__)) // for grouping tests in test suites by using code blocks @@ -2488,7 +2488,7 @@ constexpr T to_lvalue = x; #expr, DOCTEST_TOSTR(DOCTEST_HANDLE_BRACED_VA_ARGS(as))); \ try { \ expr; \ - } catch (const DOCTEST_HANDLE_BRACED_VA_ARGS(as) &) { \ + } catch (const DOCTEST_HANDLE_BRACED_VA_ARGS(as)&) { \ _DOCTEST_RB.m_threw = true; \ _DOCTEST_RB.m_threw_as = true; \ } catch (...) { \ @@ -4348,10 +4348,9 @@ void Color::init() { #endif // DOCTEST_CONFIG_COLORS_WINDOWS } -void Color::use( - Code +void Color::use(Code #ifndef DOCTEST_CONFIG_COLORS_NONE - code + code #endif // DOCTEST_CONFIG_COLORS_NONE ) { const ContextState* p = contextState; diff --git a/src/evolve.cpp b/src/evolve.cpp index 1d265424..32edb62a 100644 --- a/src/evolve.cpp +++ b/src/evolve.cpp @@ -121,11 +121,13 @@ int Evolve::EvolveIt( // } // } + int evoFileStatus = 0; if (it % Nskip_timestep == 0) { if (DATA.outputEvolutionData == 1) { grid_info.OutputEvolutionDataXYEta(*fpCurr, tau); } else if (DATA.outputEvolutionData == 2) { - grid_info.OutputEvolutionDataXYEta_chun(*fpCurr, tau); + evoFileStatus = + grid_info.OutputEvolutionDataXYEta_chun(*fpCurr, tau); } else if (DATA.outputEvolutionData == 3) { grid_info.OutputEvolutionDataXYEta_photon(*fpCurr, tau); } else if (DATA.outputEvolutionData == 4) { @@ -144,6 +146,10 @@ int Evolve::EvolveIt( grid_info.OutputEvolution_Knudsen_Reynoldsnumbers(*fpCurr, tau); } } + if (evoFileStatus == -1) { + DATA.reRunHydro = true; + return (-1); + } if (it == iFreezeStart || it == iFreezeStart + 10 || it == iFreezeStart + 30 || it == iFreezeStart + 50) { diff --git a/src/grid_info.cpp b/src/grid_info.cpp index 4da55d41..b381a8ba 100644 --- a/src/grid_info.cpp +++ b/src/grid_info.cpp @@ -420,7 +420,7 @@ void Cell_info::OutputEvolutionDataXYEta_memory( } //! This function outputs hydro evolution file in binary format -void Cell_info::OutputEvolutionDataXYEta_chun(Fields &arena, double tau) { +int Cell_info::OutputEvolutionDataXYEta_chun(Fields &arena, double tau) { // the format of the file is as follows, // itau ix iy ieta e P T cs^2 ux uy ueta // if turn_on_shear == 1: @@ -524,7 +524,7 @@ void Cell_info::OutputEvolutionDataXYEta_chun(Fields &arena, double tau) { << DATA.output_evolution_e_cut << " GeV/fm^3, are reaching the grid edge! " << "ix = " << ix << ", iy = " << iy << std::endl; - exit(-1); + return (-1); } eos.getThermalVariables(e_local, rhob_local, thermalVec); @@ -623,6 +623,7 @@ void Cell_info::OutputEvolutionDataXYEta_chun(Fields &arena, double tau) { } } fclose(out_file_xyeta); + return 0; } //! This function outputs hydro evolution file in binary format for photon diff --git a/src/grid_info.h b/src/grid_info.h index fa7a02ab..e81bf38d 100644 --- a/src/grid_info.h +++ b/src/grid_info.h @@ -54,7 +54,7 @@ class Cell_info { void OutputEvolutionDataXYEta(Fields &arena, double tau); //! This function outputs hydro evolution file in binary format - void OutputEvolutionDataXYEta_chun(Fields &arena, double tau); + int OutputEvolutionDataXYEta_chun(Fields &arena, double tau); //! This function outputs hydro evolution file in binary format for photon //! production diff --git a/src/main.cpp b/src/main.cpp index 56234777..ac0f5b89 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -33,15 +33,18 @@ int main(int argc, char *argv[]) { music_hydro.setReRunHydro(false); int running_mode = music_hydro.get_running_mode(); + int evoStatus = 0; if (running_mode == 1 || running_mode == 2) { music_hydro.initialize_hydro(); - music_hydro.run_hydro(); + evoStatus = music_hydro.run_hydro(); bReRunHydro = music_hydro.getReRunHydro(); } - if (running_mode == 1 || running_mode == 3 || running_mode == 4 - || running_mode == 13 || running_mode == 14) { - music_hydro.run_Cooper_Frye(); + if (evoStatus == 1) { + if (running_mode == 1 || running_mode == 3 || running_mode == 4 + || running_mode == 13 || running_mode == 14) { + music_hydro.run_Cooper_Frye(); + } } if (running_mode == 71) { diff --git a/src/music.cpp b/src/music.cpp index ec9bac9f..c9a5927d 100644 --- a/src/music.cpp +++ b/src/music.cpp @@ -101,10 +101,12 @@ int MUSIC::run_hydro() { if (hydro_info_ptr == nullptr && DATA.store_hydro_info_in_memory == 1) { hydro_info_ptr = std::make_shared(); } - evolve_local.EvolveIt( + int evoStatus = evolve_local.EvolveIt( arenaFieldsPrev, arenaFieldsCurr, arenaFieldsNext, (*hydro_info_ptr)); - flag_hydro_run = 1; - return (0); + if (evoStatus == 1) { + flag_hydro_run = 1; + } + return (evoStatus); } //! this is a shell function to run Cooper-Frye