diff options
author | 2020-03-18 00:42:16 +0100 | |
---|---|---|
committer | 2020-03-17 16:42:16 -0700 | |
commit | 0555226e4a20b8ae5349e14f830e270c4577f558 (patch) | |
tree | e74f0fdcd37d46a411afeeec3c870579ac2b9a65 /Source/Particles/MultiParticleContainer.cpp | |
parent | 85d2f945f41382c8ebfe6696d8093b47b46d8ea1 (diff) | |
download | WarpX-0555226e4a20b8ae5349e14f830e270c4577f558.tar.gz WarpX-0555226e4a20b8ae5349e14f830e270c4577f558.tar.zst WarpX-0555226e4a20b8ae5349e14f830e270c4577f558.zip |
Add some WarpXUtilMsg::AlwaysAssert in particle containers (#811)
* replaced AMREX_ALWAYS_ASSERT_WITH_MESSAGE with WarpXUtilMsg::AlwaysAssert where needed
* reverted horrible mistake
Diffstat (limited to 'Source/Particles/MultiParticleContainer.cpp')
-rw-r--r-- | Source/Particles/MultiParticleContainer.cpp | 24 |
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; } |