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/Collision/MCCProcess.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/Collision/MCCProcess.cpp')
-rw-r--r-- | Source/Particles/Collision/MCCProcess.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Source/Particles/Collision/MCCProcess.cpp b/Source/Particles/Collision/MCCProcess.cpp index 9f027d056..4fa0bc744 100644 --- a/Source/Particles/Collision/MCCProcess.cpp +++ b/Source/Particles/Collision/MCCProcess.cpp @@ -5,6 +5,8 @@ * License: BSD-3-Clause-LBNL */ #include "MCCProcess.H" + +#include "Utils/TextMsg.H" #include "WarpX.H" MCCProcess::MCCProcess ( @@ -12,8 +14,9 @@ MCCProcess::MCCProcess ( const std::string& cross_section_file, const amrex::Real energy ) { - amrex::Print() << "Reading file " << cross_section_file << " for " - << scattering_process << " scattering cross-sections.\n"; + amrex::Print() << Utils::TextMsg::Info( + "Reading file " + cross_section_file + " for " + + scattering_process + " scattering cross-sections."); // read the cross-section data file into memory readCrossSectionFile(cross_section_file, m_energies, m_sigmas_h); @@ -57,7 +60,7 @@ MCCProcess::init (const std::string& scattering_process, const amrex::Real energ // cost is > 0 - this is to prevent the possibility of negative left // over energy after a collision event if (m_exe_h.m_energy_penalty > 0) { - AMREX_ALWAYS_ASSERT_WITH_MESSAGE( + WARPX_ALWAYS_ASSERT_WITH_MESSAGE( (getCrossSection(m_exe_h.m_energy_penalty) == 0), "Cross-section > 0 at energy cost for collision." ); @@ -118,7 +121,7 @@ MCCProcess::sanityCheckEnergyGrid ( // confirm that the input data for the cross-section was provided with // equal energy steps, otherwise the linear interpolation will fail for (unsigned i = 1; i < energies.size(); i++) { - AMREX_ALWAYS_ASSERT_WITH_MESSAGE( + WARPX_ALWAYS_ASSERT_WITH_MESSAGE( (std::abs(energies[i] - energies[i-1] - dE) < dE / 100.0), "Energy grid not evenly spaced." ); |