WarpX
Resampling.H
Go to the documentation of this file.
1 /* Copyright 2019-2020 Neil Zaim
2  *
3  * This file is part of WarpX.
4  *
5  * License: BSD-3-Clause-LBNL
6  */
7 #ifndef WARPX_RESAMPLING_H_
8 #define WARPX_RESAMPLING_H_
9 
10 #include "ResamplingTrigger.H"
11 
12 class WarpXParIter; // forward declaration
13 class WarpXParticleContainer; // forward declaration
14 
19 {
23  virtual void operator() (WarpXParIter& /*pti*/, const int /*lev*/, WarpXParticleContainer */*pc*/) const = 0;
24 
28  virtual ~ResamplingAlgorithm () = default;
29 };
30 
38 {
39 public:
40 
44  Resampling () = default;
45 
52  Resampling (const std::string species_name);
53 
61  bool triggered (const int timestep, const amrex::Real global_numparts) const;
62 
70  void operator() (WarpXParIter& pti, const int lev, WarpXParticleContainer * const pc) const;
71 
72 private:
74  std::unique_ptr<ResamplingAlgorithm> m_resampling_algorithm;
75 };
76 
77 #endif //WARPX_RESAMPLING_H_
virtual ~ResamplingAlgorithm()=default
Virtual destructor of the abstract ResamplingAlgorithm class.
This is a general class used for resampling that is instantiated as a member of MultiParticleContaine...
Definition: Resampling.H:37
virtual void operator()(WarpXParIter &, const int, WarpXParticleContainer *) const =0
Virtual operator() of the abstract ResamplingAlgorithm class.
This class is used to determine if resampling should be done at a given timestep for a given species...
Definition: ResamplingTrigger.H:20
An empty base class from which specific resampling algorithms are derived.
Definition: Resampling.H:18
ResamplingTrigger m_resampling_trigger
Definition: Resampling.H:73
std::unique_ptr< ResamplingAlgorithm > m_resampling_algorithm
Definition: Resampling.H:74
Definition: WarpXParticleContainer.H:76
Definition: WarpXParticleContainer.H:131