IPPL (Independent Parallel Particle Layer)
IPPL
Loading...
Searching...
No Matches
ParticleContainer.hpp
Go to the documentation of this file.
1#ifndef IPPL_PARTICLE_CONTAINER_H
2#define IPPL_PARTICLE_CONTAINER_H
3
4#include <memory>
5
7
8// Define the ParticlesContainer class
9template <typename T, unsigned Dim = 3>
10class ParticleContainer : public ippl::ParticleBase<ippl::ParticleSpatialLayout<T, Dim>> {
12
13public:
15 typename Base::particle_position_type P; // particle velocity
16 typename Base::particle_position_type E; // electric field at particle position
17private:
19
20public:
22 : pl_m(FL, mesh) {
23 this->initialize(pl_m);
25 setupBCs();
26 }
27
29
30 std::shared_ptr<PLayout_t<T, Dim>> getPL() { return pl_m; }
31 void setPL(std::shared_ptr<PLayout_t<T, Dim>>& pl) { pl_m = pl; }
32
34 //only needed for vis
35 P.set_name("velocity");
36 q.set_name("charge");
37 E.set_name("electric_field");
38 // register the particle attributes
39 this->addAttribute(q);
40 this->addAttribute(P);
41 this->addAttribute(E);
42 }
44
45private:
47};
48
49#endif
ippl::FieldLayout< Dim > FieldLayout_t
Definition datatypes.h:21
typename ippl::ParticleSpatialLayout< T, Dim, Mesh_t< Dim > > PLayout_t
Definition datatypes.h:15
ippl::UniformCartesian< double, Dim > Mesh_t
Definition datatypes.h:12
@ PERIODIC
Definition ParticleBC.h:12
void addAttribute(detail::ParticleAttribBase< MemorySpace > &pa)
typename ippl::ParticleSpatialLayout< T, Dim >::particle_position_type particle_position_type
std::shared_ptr< PLayout_t< T, Dim > > getPL()
void setPL(std::shared_ptr< PLayout_t< T, Dim > > &pl)
ippl::ParticleBase< ippl::ParticleSpatialLayout< T, Dim > > Base
Base::particle_position_type E
Base::particle_position_type P
ippl::ParticleAttrib< double > q
ParticleContainer(Mesh_t< Dim > &mesh, FieldLayout_t< Dim > &FL)