diff options
author | 2019-09-12 08:25:45 -0700 | |
---|---|---|
committer | 2019-09-12 08:25:45 -0700 | |
commit | 511e9355a86bc3412dd05c36498cf9cbad63bf7d (patch) | |
tree | 968db62b0d76ccd9477808db4aaa1d19892518fa /Source/Particles/MultiParticleContainer.cpp | |
parent | b2f98f30c048e42c6525114f34e926205639a83e (diff) | |
parent | 0bda5edfefde5773f5a773dcc8991649d33cc360 (diff) | |
download | WarpX-511e9355a86bc3412dd05c36498cf9cbad63bf7d.tar.gz WarpX-511e9355a86bc3412dd05c36498cf9cbad63bf7d.tar.zst WarpX-511e9355a86bc3412dd05c36498cf9cbad63bf7d.zip |
manually fix merge conflicts with dev
Diffstat (limited to 'Source/Particles/MultiParticleContainer.cpp')
-rw-r--r-- | Source/Particles/MultiParticleContainer.cpp | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/Source/Particles/MultiParticleContainer.cpp b/Source/Particles/MultiParticleContainer.cpp index e8125588d..8a4d1cf18 100644 --- a/Source/Particles/MultiParticleContainer.cpp +++ b/Source/Particles/MultiParticleContainer.cpp @@ -31,11 +31,12 @@ MultiParticleContainer::MultiParticleContainer (AmrCore* amr_core) else if (species_types[i] == PCTypes::Photon) { allcontainers[i].reset(new PhotonParticleContainer(amr_core, i, species_names[i])); } - allcontainers[i]->deposit_on_main_grid = deposit_on_main_grid[i]; + allcontainers[i]->m_deposit_on_main_grid = m_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) { - allcontainers[i].reset(new LaserParticleContainer(amr_core,i, lasers_names[i-nspecies])); + allcontainers[i].reset(new LaserParticleContainer(amr_core, i, lasers_names[i-nspecies])); } pc_tmp.reset(new PhysicalParticleContainer(amr_core)); @@ -72,14 +73,24 @@ MultiParticleContainer::ReadParameters () BL_ASSERT(species_names.size() == nspecies); // Get species to deposit on main grid - deposit_on_main_grid.resize(nspecies, 0); + m_deposit_on_main_grid.resize(nspecies, false); std::vector<std::string> tmp; 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"); int i = std::distance(species_names.begin(), it); - deposit_on_main_grid[i] = 1; + m_deposit_on_main_grid[i] = true; + } + + m_gather_from_main_grid.resize(nspecies, false); + 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); @@ -278,8 +289,8 @@ MultiParticleContainer::Evolve (int lev, if (rho) rho->setVal(0.0); if (crho) crho->setVal(0.0); for (auto& pc : allcontainers) { - pc->Evolve(lev, Ex, Ey, Ez, Bx, By, Bz, jx, jy, jz, cjx, cjy, cjz, - rho, crho, cEx, cEy, cEz, cBx, cBy, cBz, t, dt); + pc->Evolve(lev, Ex, Ey, Ez, Bx, By, Bz, jx, jy, jz, cjx, cjy, cjz, + rho, crho, cEx, cEy, cEz, cBx, cBy, cBz, t, dt); } } @@ -496,7 +507,7 @@ MultiParticleContainer::doContinuousInjection () const } /* \brief Get ID of product species of each species. - * The users specifies the name of the product species, + * The users specifies the name of the product species, * this routine get its ID. */ void @@ -504,8 +515,8 @@ MultiParticleContainer::mapSpeciesProduct () { for (int i=0; i<nspecies; i++){ auto& pc = allcontainers[i]; - // If species pc has ionization on, find species with name - // pc->ionization_product_name and store its ID into + // If species pc has ionization on, find species with name + // pc->ionization_product_name and store its ID into // pc->ionization_product. if (pc->do_field_ionization){ int i_product = getSpeciesID(pc->ionization_product_name); @@ -616,7 +627,7 @@ namespace } // --- product runtime attribs GpuArray<Real*,6> runtime_attribs_product; - bool do_boosted_product = WarpX::do_boosted_frame_diagnostic + bool do_boosted_product = WarpX::do_boosted_frame_diagnostic && pc_product->DoBoostedFrameDiags(); if (do_boosted_product) { std::map<std::string, int> comps_product = pc_product->getParticleComps(); @@ -663,7 +674,7 @@ namespace attribs_product[ia][ip] = attribs_source[ia][is]; } // Update xold etc. if boosted frame diagnostics required - // for product species. Fill runtime attribs with a copy of + // for product species. Fill runtime attribs with a copy of // current properties (xold = x etc.). if (do_boosted_product) { runtime_attribs_product[0][ip] = p_source.pos(0); @@ -686,7 +697,7 @@ MultiParticleContainer::doFieldIonization () // Loop over all species. // Ionized particles in pc_source create particles in pc_product for (auto& pc_source : allcontainers){ - + // Skip if not ionizable if (!pc_source->do_field_ionization){ continue; } @@ -700,7 +711,7 @@ MultiParticleContainer::doFieldIonization () // they do not exist (or if they were defined by default, i.e., // without runtime component). #ifdef _OPENMP - // Touch all tiles of source species in serial if runtime attribs + // Touch all tiles of source species in serial if runtime attribs for (MFIter mfi = pc_source->MakeMFIter(lev); mfi.isValid(); ++mfi) { const int grid_id = mfi.index(); const int tile_id = mfi.LocalTileIndex(); @@ -722,7 +733,7 @@ MultiParticleContainer::doFieldIonization () MFItInfo info; if (pc_source->do_tiling && Gpu::notInLaunchRegion()) { AMREX_ALWAYS_ASSERT_WITH_MESSAGE( - pc_product->do_tiling, + pc_product->do_tiling, "For ionization, either all or none of the " "particle species must use tiling."); info.EnableTiling(pc_source->tile_size); |