aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles/PhysicalParticleContainer.H
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Particles/PhysicalParticleContainer.H')
-rw-r--r--Source/Particles/PhysicalParticleContainer.H57
1 files changed, 49 insertions, 8 deletions
diff --git a/Source/Particles/PhysicalParticleContainer.H b/Source/Particles/PhysicalParticleContainer.H
index ace1ec7f8..b558323a3 100644
--- a/Source/Particles/PhysicalParticleContainer.H
+++ b/Source/Particles/PhysicalParticleContainer.H
@@ -1,12 +1,13 @@
#ifndef WARPX_PhysicalParticleContainer_H_
#define WARPX_PhysicalParticleContainer_H_
-#include <map>
+#include <PlasmaInjector.H>
+#include <WarpXParticleContainer.H>
+#include <NCIGodfreyFilter.H>
#include <AMReX_IArrayBox.H>
-#include <PlasmaInjector.H>
-#include <WarpXParticleContainer.H>
+#include <map>
class PhysicalParticleContainer
: public WarpXParticleContainer
@@ -87,9 +88,9 @@ public:
DtType a_dt_type=DtType::Full) override;
virtual void PushPX(WarpXParIter& pti,
- amrex::Cuda::ManagedDeviceVector<amrex::Real>& xp,
- amrex::Cuda::ManagedDeviceVector<amrex::Real>& yp,
- amrex::Cuda::ManagedDeviceVector<amrex::Real>& zp,
+ amrex::Cuda::ManagedDeviceVector<amrex::ParticleReal>& xp,
+ amrex::Cuda::ManagedDeviceVector<amrex::ParticleReal>& yp,
+ amrex::Cuda::ManagedDeviceVector<amrex::ParticleReal>& zp,
amrex::Real dt, DtType a_dt_type=DtType::Full);
virtual void PushP (int lev, amrex::Real dt,
@@ -100,8 +101,21 @@ public:
const amrex::MultiFab& By,
const amrex::MultiFab& Bz) override;
- void copy_attribs(WarpXParIter& pti,const amrex::Real* xp,
- const amrex::Real* yp, const amrex::Real* zp);
+ void PartitionParticlesInBuffers(
+ long& nfine_current,
+ long& nfine_gather,
+ long const np,
+ WarpXParIter& pti,
+ int const lev,
+ amrex::iMultiFab const* current_masks,
+ amrex::iMultiFab const* gather_masks,
+ RealVector& uxp,
+ RealVector& uyp,
+ RealVector& uzp,
+ RealVector& wp );
+
+ void copy_attribs(WarpXParIter& pti,const amrex::ParticleReal* xp,
+ const amrex::ParticleReal* yp, const amrex::ParticleReal* zp);
virtual void PostRestart () final {}
@@ -131,6 +145,33 @@ public:
virtual void ConvertUnits (ConvertDirection convert_dir) override;
+/**
+ * \brief Apply NCI Godfrey filter to all components of E and B before gather
+ * \param lev MR level
+ * \param box box onto which the filter is applied
+ * \param exeli safeguard to avoid destructing arrays between ParIter iterations on GPU
+ * \param filtered_Ex Array containing filtered value
+ * \param Ex Field array before filtering (not modified)
+ * \param ex_ptr pointer to the array used for field gather.
+ *
+ * The NCI Godfrey filter is applied on Ex, the result is stored in filtered_Ex
+ * and the pointer is modified (before this function is called, it points to Ex
+ * and after this function is called, it points to Ex_filtered)
+ */
+ void applyNCIFilter (
+ int lev, const amrex::Box& box,
+ amrex::Elixir& exeli, amrex::Elixir& eyeli, amrex::Elixir& ezeli,
+ amrex::Elixir& bxeli, amrex::Elixir& byeli, amrex::Elixir& bzeli,
+ amrex::FArrayBox& filtered_Ex, amrex::FArrayBox& filtered_Ey,
+ amrex::FArrayBox& filtered_Ez, amrex::FArrayBox& filtered_Bx,
+ amrex::FArrayBox& filtered_By, amrex::FArrayBox& filtered_Bz,
+ const amrex::FArrayBox& Ex, const amrex::FArrayBox& Ey,
+ const amrex::FArrayBox& Ez, const amrex::FArrayBox& Bx,
+ const amrex::FArrayBox& By, const amrex::FArrayBox& Bz,
+ amrex::FArrayBox const * & exfab, amrex::FArrayBox const * & eyfab,
+ amrex::FArrayBox const * & ezfab, amrex::FArrayBox const * & bxfab,
+ amrex::FArrayBox const * & byfab, amrex::FArrayBox const * & bzfab);
+
protected:
std::string species_name;