OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
AmrPartBunch.h
Go to the documentation of this file.
1 #ifndef AMR_PART_BUNCH_H
2 #define AMR_PART_BUNCH_H
3 
5 #include "Amr/AmrObject.h"
6 
7 class AmrPartBunch : public PartBunchBase<double, 3>
8 {
9 public:
11 
12 public:
13 
14  AmrPartBunch(const PartData *ref);
15 
16  AmrPartBunch(const PartData *ref, pbase_t* pbase_p);
17 
18  ~AmrPartBunch();
19 
21 
22  const pbase_t *getAmrParticleBase() const;
23 
24  void initialize(FieldLayout_t *fLayout);
25 
26  // does actually another repartition
27  void do_binaryRepart();
28 
29  Vector_t get_hr() const;
30 
31  void set_meshEnlargement(double dh);
32 
34 
35  double getRho(int x, int y, int z);
36 
38 
39 
40  void boundp();
41 
42  void computeSelfFields();
43 
44  void computeSelfFields(int bin);
45 
46  void computeSelfFields_cycl(double gamma);
47 
48  void computeSelfFields_cycl(int bin);
49 
52  this->amrobj_mp = fs->getAmrObject();
53  }
54 
55  virtual void setBinCharge(int bin, double q) { };
56  virtual void setBinCharge(int bin) { };
57 
58  /*
59  * AmrPartBunch only
60  */
61 
62  const AmrObject* getAmrObject() const {
63  return this->amrobj_mp;
64  }
65 
67  return fs_m->solver_m;
68  }
69 
70  const PoissonSolver *getFieldSolver() const {
71  return fs_m->solver_m;
72  }
73 
75  for (int i = 0; i < 3; ++i)
76  hr_m[i] = hr[i];
77  }
78 
83  void setAmrDomainRatio(const std::vector<double>& ratio);
84 
85  void gatherLevelStatistics();
86 
91  const size_t& getLevelStatistics(int l) const;
92 
93 
100  void updateLorentzFactor(int bin=0);
101 
109  void updateLorentzFactor(double gamma);
110 
111  //FIXME BCs
113  void setBCAllOpen() {}
114  void setBCForDCBeam() {}
115 
116 
117 private:
119 
121 
122  void updateFields(const Vector_t& hr, const Vector_t& origin);
123 
124 private:
125 
126  /* pointer to AMR object that is part
127  * of solver_m (AmrPoissonSolver) in src/Structure/FieldSolver.h
128  */
131 
132  /* We need this due to H5PartWrapper etc, but it's always nullptr.
133  * Thus, don't use it.
134  */
136 
137  std::unique_ptr<size_t[]> globalPartPerLevel_m;
138 };
139 
140 #endif
void gatherLevelStatistics()
void setBCForDCBeam()
Definition: AmrPartBunch.h:114
double getRho(int x, int y, int z)
virtual void setBinCharge(int bin)
Set the charge of all other the ones in bin to zero.
Definition: AmrPartBunch.h:56
Vector_t get_hr() const
The FieldSolver definition.
Definition: FieldSolver.h:43
void updateFields(const Vector_t &hr, const Vector_t &origin)
const size_t & getLevelStatistics(int l) const
void updateFieldContainers_m()
Particle reference data.
Definition: PartData.h:38
AmrPartBunch(const PartData *ref)
Definition: AmrPartBunch.cpp:5
AmrObject * getAmrObject()
Definition: FieldSolver.h:104
const PoissonSolver * getFieldSolver() const
Definition: AmrPartBunch.h:70
AmrParticle_t pbase_t
Definition: AmrPartBunch.h:10
void computeSelfFields()
void setBCAllOpen()
Definition: AmrPartBunch.h:113
FRONT * fs
Definition: hypervolume.cpp:59
pbase_t * amrpbase_mp
Definition: AmrPartBunch.h:130
void updateDomainLength(Vektor< int, 3 > &grid)
FieldLayout_t & getFieldLayout()
PoissonSolver * getFieldSolver()
Definition: AmrPartBunch.h:66
pbase_t * getAmrParticleBase()
std::pair< Vector_t, Vector_t > VectorPair_t
Definition: PartBunchBase.h:37
Class: DataSink.
Definition: OpalData.h:29
virtual void setBinCharge(int bin, double q)
Set the charge of one bin to the value of q and all other to zero.
Definition: AmrPartBunch.h:55
PoissonSolver * solver_m
the actual solver, should be a base object
Definition: FieldSolver.h:114
void setAmrDomainRatio(const std::vector< double > &ratio)
void computeSelfFields_cycl(double gamma)
void updateLorentzFactor(int bin=0)
void setBCAllPeriodic()
Definition: AmrPartBunch.h:112
FieldSolver * fs_m
stores the used field solver
void setSolver(FieldSolver *fs)
Definition: AmrPartBunch.h:50
void setBaseLevelMeshSpacing(const Vector_t &hr)
Definition: AmrPartBunch.h:74
void do_binaryRepart()
FieldLayout_t * fieldlayout_m
Definition: AmrPartBunch.h:135
const AmrObject * getAmrObject() const
Definition: AmrPartBunch.h:62
Vector_t hr_m
meshspacing of cartesian mesh
VectorPair_t getEExtrema()
calculates back the max/min of the efield on the grid
void set_meshEnlargement(double dh)
virtual void setSolver(FieldSolver *fs)
AmrObject * amrobj_mp
Definition: AmrPartBunch.h:129
std::unique_ptr< size_t[]> globalPartPerLevel_m
Definition: AmrPartBunch.h:137
void initialize(FieldLayout_t *fLayout)