From 7cf6255e2ad481368dc040d0c4fe08009e1429b9 Mon Sep 17 00:00:00 2001 From: Remi Lehe Date: Fri, 6 Mar 2020 16:23:07 -0800 Subject: 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 --- Source/Particles/MultiParticleContainer.cpp | 69 ----------------------------- 1 file changed, 69 deletions(-) (limited to 'Source/Particles/MultiParticleContainer.cpp') 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, 3> >& E, - const amrex::Vector > > >& masks) -{ - for (auto& pc : allcontainers) { - pc->FieldGatherES(E, masks); - } -} - -void -MultiParticleContainer::EvolveES (const Vector, 3> >& E, - Vector >& 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 >& 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, -- cgit v1.2.3