From e8db3be8b50da6bbb4b9e8c94400d978359c7777 Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Fri, 17 May 2024 14:05:24 -0400 Subject: [PATCH] add some color to the output (#463) --- Source/MaestroAdvance.cpp | 6 +++--- Source/MaestroAdvanceAvg.cpp | 6 +++--- Source/MaestroBurner.cpp | 3 ++- Source/MaestroEvolve.cpp | 3 ++- Source/MaestroInit.cpp | 10 +++++++--- 5 files changed, 17 insertions(+), 11 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/MaestroBurner.cpp b/Source/MaestroBurner.cpp index 5b405d5b6..816199b32 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"; + 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; } 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(); }