diff options
author | 2019-09-10 14:06:41 -0600 | |
---|---|---|
committer | 2019-09-10 14:06:41 -0600 | |
commit | 47b04802720c085710ca0c87e29f04363bb4e920 (patch) | |
tree | 169700ee031f681e619d329333b0b8c2fa86405f /Source/Particles/MultiParticleContainer.cpp | |
parent | 5979ed85e2e671b0b15c267a755aec56390807c8 (diff) | |
parent | 30f1ec11f1f2f1f4bd57145fa3bb0ab7d11b59bd (diff) | |
download | WarpX-47b04802720c085710ca0c87e29f04363bb4e920.tar.gz WarpX-47b04802720c085710ca0c87e29f04363bb4e920.tar.zst WarpX-47b04802720c085710ca0c87e29f04363bb4e920.zip |
Merge pull request #328 from ax3l/topic-perParticleGatherFromMainGrid
Particles: gather_from_main_grid
Diffstat (limited to 'Source/Particles/MultiParticleContainer.cpp')
-rw-r--r-- | Source/Particles/MultiParticleContainer.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/Particles/MultiParticleContainer.cpp b/Source/Particles/MultiParticleContainer.cpp index 7803bdae1..aa434a474 100644 --- a/Source/Particles/MultiParticleContainer.cpp +++ b/Source/Particles/MultiParticleContainer.cpp @@ -21,6 +21,7 @@ MultiParticleContainer::MultiParticleContainer (AmrCore* amr_core) allcontainers[i].reset(new RigidInjectedParticleContainer(amr_core, i, species_names[i])); } allcontainers[i]->deposit_on_main_grid = deposit_on_main_grid[i]; + allcontainers[i]->m_gather_from_main_grid = m_gather_from_main_grid[i]; } for (int i = nspecies; i < nspecies+nlasers; ++i) { @@ -69,6 +70,16 @@ MultiParticleContainer::ReadParameters () deposit_on_main_grid[i] = 1; } + m_gather_from_main_grid.resize(nspecies, 0); + std::vector<std::string> tmp_gather; + 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"); + int i = std::distance(species_names.begin(), it); + m_gather_from_main_grid.at(i) = true; + } + species_types.resize(nspecies, PCTypes::Physical); std::vector<std::string> rigid_injected_species; |