From acd20380e74d3eeacd18414a98dd36a63435150a Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Fri, 17 May 2024 11:45:20 -0400 Subject: [PATCH 1/4] add some color to the output --- Source/MaestroAdvance.cpp | 6 +++--- Source/MaestroAdvanceAvg.cpp | 6 +++--- Source/MaestroEvolve.cpp | 3 ++- Source/MaestroInit.cpp | 10 +++++++--- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/Source/MaestroAdvance.cpp b/Source/MaestroAdvance.cpp index be84cca1a..4c378ab82 100644 --- a/Source/MaestroAdvance.cpp +++ b/Source/MaestroAdvance.cpp @@ -109,9 +109,9 @@ void Maestro::AdvanceTimeStep(bool is_initIter) { bool is_predictor; - Print() << "\nTimestep " << istep << " starts with TIME = " << t_old - << " DT = " << dt << std::endl - << std::endl; + amrex::Print() << amrex::Font::Bold << amrex::FGColor::Green + << "\nTimestep " << istep << " starts with TIME = " << t_old + << " DT = " << dt << amrex::ResetDisplay << std::endl << std::endl; if (maestro_verbose > 0) { Print() << "Cell Count:" << std::endl; diff --git a/Source/MaestroAdvanceAvg.cpp b/Source/MaestroAdvanceAvg.cpp index 4bc0cc41e..172a0d20b 100644 --- a/Source/MaestroAdvanceAvg.cpp +++ b/Source/MaestroAdvanceAvg.cpp @@ -86,9 +86,9 @@ void Maestro::AdvanceTimeStepAverage(bool is_initIter) { bool is_predictor; - Print() << "\nTimestep " << istep << " starts with TIME = " << t_old - << " DT = " << dt << std::endl - << std::endl; + amrex::Print() << amrex::Font::Bold << amrex::FGColor::Green + << "\nTimestep " << istep << " starts with TIME = " << t_old + << " DT = " << dt << amrex::ResetDisplay << std::endl << std::endl; if (maestro_verbose > 0) { Print() << "Cell Count:" << std::endl; diff --git a/Source/MaestroEvolve.cpp b/Source/MaestroEvolve.cpp index 6aa86858e..0e94a2986 100644 --- a/Source/MaestroEvolve.cpp +++ b/Source/MaestroEvolve.cpp @@ -10,7 +10,8 @@ void Maestro::Evolve() { // timer for profiling BL_PROFILE_VAR("Maestro::Evolve()", Evolve); - Print() << "Calling Evolve()" << std::endl; + amrex::Print() << "\n"; + amrex::Print() << amrex::Font::Bold << amrex::FGColor::Green << "Beginning main evolution" << amrex::ResetDisplay << std::endl; // check to make sure spherical is only used for 3d if (spherical && AMREX_SPACEDIM != 3) { diff --git a/Source/MaestroInit.cpp b/Source/MaestroInit.cpp index 8871a33c3..6a99c4bbd 100644 --- a/Source/MaestroInit.cpp +++ b/Source/MaestroInit.cpp @@ -141,7 +141,8 @@ void Maestro::Init() { // initial projection if (do_initial_projection) { - Print() << "Doing initial projection" << std::endl; + amrex::Print() << "\n"; + amrex::Print() << amrex::Font::Bold << amrex::FGColor::Green << "Doing initial projection" << amrex::ResetDisplay << std::endl; InitProj(); if (plot_int > 0 || plot_deltat > 0) { @@ -166,7 +167,8 @@ void Maestro::Init() { // divu iters - also update dt at end of each divu_iter if (init_divu_iter > 0) { for (int i = 1; i <= init_divu_iter; ++i) { - Print() << "Doing initial divu iteration #" << i << std::endl; + amrex::Print() << "\n"; + amrex::Print() << amrex::Font::Bold << amrex::FGColor::Green << "Doing initial divu iteration #" << i << amrex::ResetDisplay << std::endl; DivuIter(i); } @@ -198,7 +200,9 @@ void Maestro::Init() { // initial (pressure) iters for (int i = 1; i <= init_iter; ++i) { - Print() << "Doing initial pressure iteration #" << i << std::endl; + amrex::Print() << "\n"; + amrex::Print() << amrex::Font::Bold << amrex::FGColor::Green + << "Doing initial pressure iteration #" << i << amrex::ResetDisplay << std::endl; InitIter(); } From 078eb95f188ee0c44734693541af13b2fdd5f9b4 Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Fri, 17 May 2024 12:48:17 -0400 Subject: [PATCH 2/4] highlight an error too --- Source/MaestroBurner.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/MaestroBurner.cpp b/Source/MaestroBurner.cpp index 5b405d5b6..12a8cbc32 100644 --- a/Source/MaestroBurner.cpp +++ b/Source/MaestroBurner.cpp @@ -190,7 +190,8 @@ void Maestro::Burner(const Vector& s_in, Vector& s_out, if (std::abs(sumX - 1.0) > reaction_sum_tol) { #ifndef AMREX_USE_GPU - amrex::Print() << "ERROR: abundances do not sum to 1"; + amrex::Print() << amrex::Font::Bold << amrex::FGColor::Green + << "ERROR: abundances do not sum to 1" << amrex::ResetDisplay; #endif burn_failed = 1.0_rt; } From 65253187f88cbd746c68adcf0fc112d019421327 Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Fri, 17 May 2024 13:04:12 -0400 Subject: [PATCH 3/4] Print -> cout --- Source/MaestroBurner.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/MaestroBurner.cpp b/Source/MaestroBurner.cpp index 12a8cbc32..816199b32 100644 --- a/Source/MaestroBurner.cpp +++ b/Source/MaestroBurner.cpp @@ -190,8 +190,8 @@ void Maestro::Burner(const Vector& s_in, Vector& s_out, if (std::abs(sumX - 1.0) > reaction_sum_tol) { #ifndef AMREX_USE_GPU - amrex::Print() << amrex::Font::Bold << amrex::FGColor::Green - << "ERROR: abundances do not sum to 1" << amrex::ResetDisplay; + std::cout << amrex::Font::Bold << amrex::FGColor::Green + << "ERROR: abundances do not sum to 1" << amrex::ResetDisplay << std::endl; #endif burn_failed = 1.0_rt; } From 23ea36bd36e7882ce1e391087cdb342692a38a6e Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Fri, 17 May 2024 15:00:44 -0400 Subject: [PATCH 4/4] fix xrb_mixed compilation + clang-tidy --- Exec/science/xrb_mixed/MaestroInitData.cpp | 2 +- Exec/science/xrb_mixed/MaestroSponge.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Exec/science/xrb_mixed/MaestroInitData.cpp b/Exec/science/xrb_mixed/MaestroInitData.cpp index 34fa4e476..0f2521aea 100644 --- a/Exec/science/xrb_mixed/MaestroInitData.cpp +++ b/Exec/science/xrb_mixed/MaestroInitData.cpp @@ -157,7 +157,7 @@ void Maestro::InitLevelData(const int lev, [[maybe_unused]] const Real time, con } } -void Maestro::InitLevelDataSphr(const int lev, const Real time, MultiFab& scal, +void Maestro::InitLevelDataSphr(const int lev, const Real time, MultiFab& scal, // NOLINT(readability-convert-member-functions-to-static) MultiFab& vel) { amrex::ignore_unused(lev); diff --git a/Exec/science/xrb_mixed/MaestroSponge.cpp b/Exec/science/xrb_mixed/MaestroSponge.cpp index 79f414351..8e372b09a 100644 --- a/Exec/science/xrb_mixed/MaestroSponge.cpp +++ b/Exec/science/xrb_mixed/MaestroSponge.cpp @@ -60,7 +60,7 @@ void Maestro::SpongeInit(const BaseState& rho0_s) { } if (maestro_verbose >= 1) { - if (xrb_use_bottom_sponge) { + if (problem_rp::xrb_use_bottom_sponge) { Print() << "inner sponge: r_sp , r_tp : " << r_sp << ", " << r_tp << std::endl; }