diff options
author | 2020-03-06 16:23:07 -0800 | |
---|---|---|
committer | 2020-03-06 16:23:07 -0800 | |
commit | 7cf6255e2ad481368dc040d0c4fe08009e1429b9 (patch) | |
tree | 6da917b08ab2b8e21c4693dc7cb4e5399d3da00e /Source/Particles/MultiParticleContainer.cpp | |
parent | 78ebcd8dac413fea9743ca69fd1684283438c5db (diff) | |
download | WarpX-7cf6255e2ad481368dc040d0c4fe08009e1429b9.tar.gz WarpX-7cf6255e2ad481368dc040d0c4fe08009e1429b9.tar.zst WarpX-7cf6255e2ad481368dc040d0c4fe08009e1429b9.zip |
Remove old electrostatic code (#780)
* Create inputs
* fixed stuff
* Make smaller test
* Re-use EvolveEM for ES calculation
* Use correct variable const_dt
* Avoid out of bound and modify computation of electrostatic field
* Update test file
* Remove tab
* Minor refactoring of space-charge calculation
* Remove old electrostatic files
* Fix electrostatic test
* Rename WarpXEvolveEM to WarpXEvolve
* Use if conditions instead of ifdef
* Correct initialization of `do_electrostatic`
* Fix static variable
* Add documentation for `do_electrostatic`
* Remove more electrostatic code
Co-authored-by: dbizzozero <dbizzozero@users.noreply.github.com>
Diffstat (limited to 'Source/Particles/MultiParticleContainer.cpp')
-rw-r--r-- | Source/Particles/MultiParticleContainer.cpp | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/Source/Particles/MultiParticleContainer.cpp b/Source/Particles/MultiParticleContainer.cpp index 62f244341..15069d5ce 100644 --- a/Source/Particles/MultiParticleContainer.cpp +++ b/Source/Particles/MultiParticleContainer.cpp @@ -273,75 +273,6 @@ MultiParticleContainer::InitData () } - -#ifdef WARPX_DO_ELECTROSTATIC -void -MultiParticleContainer::FieldGatherES (const Vector<std::array<std::unique_ptr<MultiFab>, 3> >& E, - const amrex::Vector<std::unique_ptr<amrex::FabArray<amrex::BaseFab<int> > > >& masks) -{ - for (auto& pc : allcontainers) { - pc->FieldGatherES(E, masks); - } -} - -void -MultiParticleContainer::EvolveES (const Vector<std::array<std::unique_ptr<MultiFab>, 3> >& E, - Vector<std::unique_ptr<MultiFab> >& rho, - Real t, Real dt) -{ - - int nlevs = rho.size(); - int ng = rho[0]->nGrow(); - - for (unsigned i = 0; i < nlevs; i++) { - rho[i]->setVal(0.0, ng); - } - - for (auto& pc : allcontainers) { - pc->EvolveES(E, rho, t, dt); - } - - for (unsigned i = 0; i < nlevs; i++) { - const Geometry& gm = allcontainers[0]->Geom(i); - rho[i]->SumBoundary(gm.periodicity()); - } -} - -void -MultiParticleContainer:: -DepositCharge (Vector<std::unique_ptr<MultiFab> >& rho, bool local) -{ - int nlevs = rho.size(); - int ng = rho[0]->nGrow(); - - for (unsigned i = 0; i < nlevs; i++) { - rho[i]->setVal(0.0, ng); - } - - for (unsigned i = 0, n = allcontainers.size(); i < n; ++i) { - allcontainers[i]->DepositCharge(rho, true); - } - - if (!local) { - for (unsigned i = 0; i < nlevs; i++) { - const Geometry& gm = allcontainers[0]->Geom(i); - rho[i]->SumBoundary(gm.periodicity()); - } - } -} - -amrex::Real -MultiParticleContainer::sumParticleCharge (bool local) -{ - amrex::Real total_charge = allcontainers[0]->sumParticleCharge(local); - for (unsigned i = 1, n = allcontainers.size(); i < n; ++i) { - total_charge += allcontainers[i]->sumParticleCharge(local); - } - return total_charge; -} - -#endif // WARPX_DO_ELECTROSTATIC - void MultiParticleContainer::FieldGather (int lev, const MultiFab& Ex, const MultiFab& Ey, |