OPALX (Object Oriented Parallel Accelerator Library for Exascale) MINIorX
OPALX
ParticleContainer.hpp
Go to the documentation of this file.
1
2#ifndef OPAL_PARTICLE_CONTAINER_H
3#define OPAL_PARTICLE_CONTAINER_H
4
5#include <memory>
6
8
10
11template <typename T>
13
15
16// Define the ParticlesContainer class
17template <typename T, unsigned Dim = 3>
18class ParticleContainer : public ippl::ParticleBase<ippl::ParticleSpatialLayout<T, Dim>> {
20
21public:
23 using bin_index_type = short int; // Needed in AdaptBins class
24
25public:
28
31
34
37
40
43
46
49
51 //typename Base::particle_position_type Etmp; // TODO: might not need this...
52
55
57 this->initialize(pl_m);
59 setupBCs();
60 }
61
63 }
64
66 // register the particle attributes
67 this->addAttribute(Q);
68 this->addAttribute(M);
69 this->addAttribute(dt);
70 this->addAttribute(Phi);
71 this->addAttribute(Bin);
72 this->addAttribute(Sp);
73 this->addAttribute(P);
74 this->addAttribute(E);
75 //this->addAttribute(Etmp);
76 this->addAttribute(B);
77 }
78
79 void setupBCs() {
81 }
82
84 return pl_m;
85 }
86
88 size_t Np = this->getTotalNum();
89 Np = (Np == 0) ? 1 : Np; // only used for normalization in the moments class --> avoid division by zero
90
91 size_t Nlocal = this->getLocalNum();
92 distMoments_m.computeMoments(this->R.getView(), this->P.getView(), this->M.getView(), Np, Nlocal);
93 }
94
97 }
98
101 }
102
105 }
106
109 }
110
113 }
114
116 size_t Nlocal = this->getLocalNum();
117 distMoments_m.computeMinMaxPosition(this->R.getView(), Nlocal);
118 }
119
122 }
123
126 }
127
130 }
131
132 double getMeanKineticEnergy() const {
134 }
135
136 double getStdKineticEnergy() const {
138 }
139
141 return distMoments_m.getMeans();
142 }
143
145 return distMoments_m.getCentroid();
146 }
147
150 }
151
152 double getDx() const {
153 return distMoments_m.getDx();
154 }
155
156 double getDDx() const {
157 return distMoments_m.getDDx();
158 }
159
160 double getDy() const {
161 return distMoments_m.getDy();
162 }
163
164 double getDDy() const {
165 return distMoments_m.getDDy();
166 }
167
168 double getDebyeLength() const {
170 }
171
172 double getMeanGammaZ() const {
174 }
175
176 double getTemperature() const {
178 }
179
180 double getPlasmaParameter() const {
182 }
183
184 double computeDebyeLength(double density){
185 size_t Np = this->getTotalNum();
186 Np = (Np == 0) ? 1 : Np; // only used for normalization in the moments class --> avoid division by zero
187
188 size_t Nlocal = this->getLocalNum();
189 distMoments_m.computeDebyeLength(this->P.getView(), Np, Nlocal, density);
191 }
192
193private:
196 }
197
199
201};
202
203#endif
boost::numeric::ublas::matrix< double > matrix_t
Definition: BoostMatrix.h:23
typename ippl::ParticleSpatialLayout< T, Dim, Mesh_t< Dim > > PLayout_t
ippl::detail::size_type size_type
@ PERIODIC
Definition: ParticleBC.h:12
std::size_t size_type
Definition: IpplTypes.h:13
double getMeanKineticEnergy() const
Vector_t< double, 3 > getMinPosition() const
Vector_t< double, 3 > getMeanMomentum() const
Vector_t< double, 3 > getStandardDeviationPosition() const
Vector_t< double, 3 > getNormalizedEmittance() const
void computeDebyeLength(ippl::ParticleAttrib< Vector_t< double, 3 > >::view_type &Pview, size_t Np, size_t Nlocal, double density)
double getTemperature() const
matrix_t getMoments6x6() const
double getDebyeLength() const
double getStdKineticEnergy() const
Vector_t< double, 3 > getStandardDeviationMomentum() const
void computeMoments(ippl::ParticleAttrib< Vector_t< double, 3 > >::view_type &Rview, ippl::ParticleAttrib< Vector_t< double, 3 > >::view_type &Pview, ippl::ParticleAttrib< double >::view_type &Mview, size_t Np, size_t Nlocal)
Vector_t< double, 3 > getMeanPosition() const
Vector_t< double, 3 > getStandardDeviationRP() const
double getPlasmaParameter() const
void computeMinMaxPosition(ippl::ParticleAttrib< Vector_t< double, 3 > >::view_type &Rview, size_t Nlcoal)
Vector_t< double, 3 > getMaxPosition() const
Vector_t< double, 6 > getCentroid() const
Vector_t< double, 6 > getMeans() const
double getMeanGammaZ() const
Vector_t< double, 3 > getMeanP() const
Vector_t< double, 6 > getMeans() const
Vector_t< double, 3 > getMaxR() const
ippl::ParticleAttrib< double > M
mass
double getMeanGammaZ() const
ippl::ParticleAttrib< double > dt
timestep in [s]
double getPlasmaParameter() const
ippl::ParticleAttrib< double > Phi
the scalar potential in [Cb/s]
Vector_t< double, 3 > getRmsP() const
Vector_t< double, 3 > getMinR() const
Vector_t< double, 3 > getRmsRP() const
Base::particle_position_type B
electric field for gun simulation with bins
ippl::ParticleAttrib< double > Q
charge in [Cb]
double computeDebyeLength(double density)
Vector_t< double, 6 > getCentroid() const
Vector_t< double, 3 > getNormEmit() const
matrix_t getCovMatrix() const
double getMeanKineticEnergy() const
PLayout_t< T, Dim > pl_m
ippl::ParticleAttrib< bin_index_type > Bin
the energy bin the particle is in
Vector_t< double, 3 > getMeanR() const
Vector_t< double, 3 > getRmsR() const
short int bin_index_type
Defines which type to use as a particle bin.
Base::particle_position_type E
electric field at particle position
Base::particle_position_type P
particle momenta [\beta\gamma]
double getTemperature() const
double getStdKineticEnergy() const
ippl::ParticleAttrib< short > Sp
the particle specis
ParticleContainer(Mesh_t< Dim > &mesh, FieldLayout_t< Dim > &FL)
DistributionMoments distMoments_m
double getDebyeLength() const
PLayout_t< T, Dim > & getPL()
void setParticleBC(const bc_container_type &bcs)
Definition: ParticleBase.h:178
void addAttribute(detail::ParticleAttribBase< MemorySpace > &pa)
typename PLayout::particle_position_type particle_position_type
Definition: ParticleBase.h:93
particle_position_type R
view of particle positions
Definition: ParticleBase.h:115