aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles/MultiParticleContainer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Particles/MultiParticleContainer.cpp')
-rw-r--r--Source/Particles/MultiParticleContainer.cpp24
1 files changed, 19 insertions, 5 deletions
diff --git a/Source/Particles/MultiParticleContainer.cpp b/Source/Particles/MultiParticleContainer.cpp
index 12b0a9d61..13390168f 100644
--- a/Source/Particles/MultiParticleContainer.cpp
+++ b/Source/Particles/MultiParticleContainer.cpp
@@ -180,7 +180,11 @@ MultiParticleContainer::ReadParameters ()
pp.queryarr("deposit_on_main_grid", tmp);
for (auto const& name : tmp) {
auto it = std::find(species_names.begin(), species_names.end(), name);
- AMREX_ALWAYS_ASSERT_WITH_MESSAGE(it != species_names.end(), "ERROR: species in particles.deposit_on_main_grid must be part of particles.species_names");
+ WarpXUtilMsg::AlwaysAssert(
+ it != species_names.end(),
+ "ERROR: species '" + name
+ + "' in particles.deposit_on_main_grid must be part of particles.species_names"
+ );
int i = std::distance(species_names.begin(), it);
m_deposit_on_main_grid[i] = true;
}
@@ -190,7 +194,11 @@ MultiParticleContainer::ReadParameters ()
pp.queryarr("gather_from_main_grid", tmp_gather);
for (auto const& name : tmp_gather) {
auto it = std::find(species_names.begin(), species_names.end(), name);
- AMREX_ALWAYS_ASSERT_WITH_MESSAGE(it != species_names.end(), "ERROR: species in particles.gather_from_main_grid must be part of particles.species_names");
+ WarpXUtilMsg::AlwaysAssert(
+ it != species_names.end(),
+ "ERROR: species '" + name
+ + "' in particles.gather_from_main_grid must be part of particles.species_names"
+ );
int i = std::distance(species_names.begin(), it);
m_gather_from_main_grid.at(i) = true;
}
@@ -203,7 +211,11 @@ MultiParticleContainer::ReadParameters ()
if (!rigid_injected_species.empty()) {
for (auto const& name : rigid_injected_species) {
auto it = std::find(species_names.begin(), species_names.end(), name);
- AMREX_ALWAYS_ASSERT_WITH_MESSAGE(it != species_names.end(), "ERROR: species in particles.rigid_injected_species must be part of particles.species_names");
+ WarpXUtilMsg::AlwaysAssert(
+ it != species_names.end(),
+ "ERROR: species '" + name
+ + "' in particles.rigid_injected_species must be part of particles.species_names"
+ );
int i = std::distance(species_names.begin(), it);
species_types[i] = PCTypes::RigidInjected;
}
@@ -214,9 +226,11 @@ MultiParticleContainer::ReadParameters ()
if (!photon_species.empty()) {
for (auto const& name : photon_species) {
auto it = std::find(species_names.begin(), species_names.end(), name);
- AMREX_ALWAYS_ASSERT_WITH_MESSAGE(
+ WarpXUtilMsg::AlwaysAssert(
it != species_names.end(),
- "ERROR: species in particles.rigid_injected_species must be part of particles.species_names");
+ "ERROR: species '" + name
+ + "' in particles.rigid_injected_species must be part of particles.species_names"
+ );
int i = std::distance(species_names.begin(), it);
species_types[i] = PCTypes::Photon;
}