aboutsummaryrefslogtreecommitdiff
path: root/Source/Diagnostics/ParticleIO.cpp
diff options
context:
space:
mode:
authorGravatar Luca Fedeli <luca.fedeli@cea.fr> 2022-03-08 18:38:25 +0100
committerGravatar GitHub <noreply@github.com> 2022-03-08 09:38:25 -0800
commit0a64c2b8a42d766e5a893fcab2d4573b33cca74f (patch)
tree16f5979ff152251fc443f2e5ee67f929d6534228 /Source/Diagnostics/ParticleIO.cpp
parent7425721ccced342615c054ea8147fbdc484d6620 (diff)
downloadWarpX-0a64c2b8a42d766e5a893fcab2d4573b33cca74f.tar.gz
WarpX-0a64c2b8a42d766e5a893fcab2d4573b33cca74f.tar.zst
WarpX-0a64c2b8a42d766e5a893fcab2d4573b33cca74f.zip
Make error and info messages visually uniform (#2939)
* initial work to add msg formatter * wip * replace AMREX_ALWAYS_ASSERT_WITH_MESSAGE with WarpX equivalent
Diffstat (limited to 'Source/Diagnostics/ParticleIO.cpp')
-rw-r--r--Source/Diagnostics/ParticleIO.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/Source/Diagnostics/ParticleIO.cpp b/Source/Diagnostics/ParticleIO.cpp
index ed705d28c..f889bae65 100644
--- a/Source/Diagnostics/ParticleIO.cpp
+++ b/Source/Diagnostics/ParticleIO.cpp
@@ -14,6 +14,7 @@
#include "Particles/RigidInjectedParticleContainer.H"
#include "Particles/SpeciesPhysicalProperties.H"
#include "Particles/WarpXParticleContainer.H"
+#include "Utils/TextMsg.H"
#include "Utils/WarpXConst.H"
#include "Utils/WarpXProfilerWrapper.H"
#include "WarpX.H"
@@ -151,10 +152,11 @@ MultiParticleContainer::Restart (const std::string& dir)
for (auto const& comp : pc->getParticleRuntimeComps()) {
auto search = std::find(real_comp_names.begin(), real_comp_names.end(), comp.first);
if (search == real_comp_names.end()) {
- std::stringstream ss;
- ss << "Species " << species_names[i] << "needs runtime real component " << comp.first;
- ss << ", but it was not found in the checkpoint file. \n";
- amrex::Abort(ss.str());
+ amrex::Abort(Utils::TextMsg::Err(
+ "Species " + species_names[i]
+ + "needs runtime real component " + comp.first
+ + ", but it was not found in the checkpoint file."
+ ));
}
}
@@ -163,9 +165,11 @@ MultiParticleContainer::Restart (const std::string& dir)
auto current_comp_names = pc->getParticleComps();
auto search = current_comp_names.find(comp_name);
if (search == current_comp_names.end()) {
- amrex::Print() << "Runtime real component " << comp_name
- << " was found in the checkpoint file, but it has not been added yet. "
- << " Adding it now. \n";
+ amrex::Print() << Utils::TextMsg::Info(
+ "Runtime real component " + comp_name
+ + " was found in the checkpoint file, but it has not been added yet. "
+ + " Adding it now."
+ );
pc->AddRealComp(comp_name);
}
}
@@ -195,9 +199,11 @@ MultiParticleContainer::Restart (const std::string& dir)
auto current_comp_names = pc->getParticleiComps();
auto search = current_comp_names.find(comp_name);
if (search == current_comp_names.end()) {
- amrex::Print() << "Runtime int component " << comp_name
- << " was found in the checkpoint file, but it has not been added yet. "
- << " Adding it now. \n";
+ amrex::Print()<< Utils::TextMsg::Info(
+ "Runtime int component " + comp_name
+ + " was found in the checkpoint file, but it has not been added yet. "
+ + " Adding it now."
+ );
pc->AddIntComp(comp_name);
}
}