diff options
author | 2022-03-08 18:38:25 +0100 | |
---|---|---|
committer | 2022-03-08 09:38:25 -0800 | |
commit | 0a64c2b8a42d766e5a893fcab2d4573b33cca74f (patch) | |
tree | 16f5979ff152251fc443f2e5ee67f929d6534228 /Source/Particles/ParticleBoundaryBuffer.cpp | |
parent | 7425721ccced342615c054ea8147fbdc484d6620 (diff) | |
download | WarpX-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/Particles/ParticleBoundaryBuffer.cpp')
-rw-r--r-- | Source/Particles/ParticleBoundaryBuffer.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/Source/Particles/ParticleBoundaryBuffer.cpp b/Source/Particles/ParticleBoundaryBuffer.cpp index 2f105de55..6837aef31 100644 --- a/Source/Particles/ParticleBoundaryBuffer.cpp +++ b/Source/Particles/ParticleBoundaryBuffer.cpp @@ -10,6 +10,7 @@ #include "Particles/ParticleBoundaryBuffer.H" #include "Particles/MultiParticleContainer.H" #include "Particles/Gather/ScalarFieldGather.H" +#include "Utils/TextMsg.H" #include <AMReX_Geometry.H> #include <AMReX_ParmParse.H> @@ -100,9 +101,11 @@ void ParticleBoundaryBuffer::printNumParticles () const { for (int i = 0; i < numSpecies(); ++i) { int np = buffer[i].isDefined() ? buffer[i].TotalNumberOfParticles(false) : 0; - amrex::Print() << "Species " << getSpeciesNames()[i] << " has " - << np << " particles in the boundary buffer " - << "for side " << iside << " of dim " << idim << "\n"; + amrex::Print() << Utils::TextMsg::Info( + "Species " + getSpeciesNames()[i] + " has " + + std::to_string(np) + " particles in the boundary buffer " + + "for side " + std::to_string(iside) + " of dim " + std::to_string(idim) + ); } } } @@ -111,8 +114,10 @@ void ParticleBoundaryBuffer::printNumParticles () const { for (int i = 0; i < numSpecies(); ++i) { int np = buffer[i].isDefined() ? buffer[i].TotalNumberOfParticles(false) : 0; - amrex::Print() << "Species " << getSpeciesNames()[i] << " has " - << np << " particles in the EB boundary buffer \n"; + amrex::Print() << Utils::TextMsg::Info( + "Species " + getSpeciesNames()[i] + " has " + + std::to_string(np) + " particles in the EB boundary buffer" + ); } #endif } @@ -269,10 +274,10 @@ ParticleBoundaryBuffer::getParticleBuffer(const std::string species_name, int bo auto& buffer = m_particle_containers[boundary]; auto index = WarpX::GetInstance().GetPartContainer().getSpeciesID(species_name); - AMREX_ALWAYS_ASSERT_WITH_MESSAGE(m_do_boundary_buffer[boundary][index], + WARPX_ALWAYS_ASSERT_WITH_MESSAGE(m_do_boundary_buffer[boundary][index], "Attempted to get particle buffer for boundary " - + boundary + ", which is not used!"); - AMREX_ALWAYS_ASSERT_WITH_MESSAGE(buffer[index].isDefined(), + + std::to_string(boundary) + ", which is not used!"); + WARPX_ALWAYS_ASSERT_WITH_MESSAGE(buffer[index].isDefined(), "Tried to get a buffer that is not defined!"); return buffer[index]; |