Public Member Functions | List of all members
Particle< PP > Class Template Reference

Particle class in some geometry. More...

#include <particles.hpp>

Inheritance diagram for Particle< PP >:
ParticleBase

Public Member Functions

 Particle (double IQ, double q, double m, const PP &x)
 Constructor for particle.
 Particle (std::istream &s)
 Constructor for loading particle from a file.
 ~Particle ()
 Destructor.
double & operator() (int i)
 Operator for pointing to coordinate data.
const double & operator() (int i) const
 Operator for pointing to coordinate data.
double & operator[] (int i)
 Operator for pointing to coordinate data.
const double & operator[] (int i) const
 Operator for pointing to coordinate data.
Vec3D location () const
 Returns the location of particle in Vec3D.
Vec3D velocity () const
 Returns the velocity of particle in Vec3D.
PP & x ()
 Return reference to coordinate data.
const PP & x () const
 Return const reference to coordinate data.
PP & traj (int i)
 Return reference to trajectory data.
const PP & traj (int i) const
 Return const reference to trajectory data.
size_t traj_size (void) const
 Return number of trajectory points of particle.
void add_trajectory_point (const PP &x)
 Add trajectory point to the end of the trajectory.
void copy_trajectory (const std::vector< PP > &traj)
 Define trajectory by copying.
void clear_trajectory (void)
 Clears the particle trajectory.
void save (std::ostream &s) const
 Saves data to stream.
void debug_print (std::ostream &os) const
 Print debugging information to os.
- Public Member Functions inherited from ParticleBase
particle_status_e get_status ()
 Return particle status.
void set_status (particle_status_e status)
 Set particle status.
double IQ () const
 Return current or charge carried by trajectory or particle cloud [A/C].
double q () const
 Return particle charge (q) [C].
double m () const
 Return particle mass (m) [kg].
double qm () const
 Return charge per mass ratio (q/m) [C/kg].

Additional Inherited Members

- Protected Member Functions inherited from ParticleBase
 ParticleBase (double IQ, double q, double m)
 ParticleBase (std::istream &s)
 Constructor for loading particle from a file.
 ~ParticleBase ()
- Protected Attributes inherited from ParticleBase
particle_status_e _status
 Status of particle.
double _IQ
 Current or charge of particle.
double _q
 Charge q [C].
double _m
 Mass m [kg].

Detailed Description

template<class PP>
class Particle< PP >

Particle class in some geometry.

Contains a templated description of one particle in some geometry. The geometry is selected throught templation, where PP is either ParticleP2D, ParticlePCyl or ParticleP3D. The particle classes for defined geometry modes can be used through defined types Particle2D, ParticleCyl and Particle3D.

Constructor & Destructor Documentation

template<class PP>
Particle< PP >::Particle ( double  IQ,
double  q,
double  m,
const PP &  x 
)
inline

Constructor for particle.

Make new particle with

Parameters
IQCurrent or charge of the macroparticle (A/C).
qcharge state of microscopic particle (C).
mmass of microscopic particle (kg).
xparticle coordinates (m and m/s).
template<class PP>
Particle< PP >::Particle ( std::istream &  s)
inline

Constructor for loading particle from a file.

template<class PP>
Particle< PP >::~Particle ( )
inline

Destructor.

Member Function Documentation

template<class PP>
void Particle< PP >::add_trajectory_point ( const PP &  x)
inline

Add trajectory point to the end of the trajectory.

template<class PP>
void Particle< PP >::clear_trajectory ( void  )
inline

Clears the particle trajectory.

template<class PP>
void Particle< PP >::copy_trajectory ( const std::vector< PP > &  traj)
inline

Define trajectory by copying.

template<class PP>
void Particle< PP >::debug_print ( std::ostream &  os) const
inline

Print debugging information to os.

template<class PP>
Vec3D Particle< PP >::location ( ) const
inline

Returns the location of particle in Vec3D.

template<class PP>
double& Particle< PP >::operator() ( int  i)
inline

Operator for pointing to coordinate data.

template<class PP>
const double& Particle< PP >::operator() ( int  i) const
inline

Operator for pointing to coordinate data.

template<class PP>
double& Particle< PP >::operator[] ( int  i)
inline

Operator for pointing to coordinate data.

template<class PP>
const double& Particle< PP >::operator[] ( int  i) const
inline

Operator for pointing to coordinate data.

template<class PP>
void Particle< PP >::save ( std::ostream &  s) const
inline

Saves data to stream.

Reimplemented from ParticleBase.

template<class PP>
PP& Particle< PP >::traj ( int  i)
inline

Return reference to trajectory data.

template<class PP>
const PP& Particle< PP >::traj ( int  i) const
inline

Return const reference to trajectory data.

template<class PP>
size_t Particle< PP >::traj_size ( void  ) const
inline

Return number of trajectory points of particle.

template<class PP>
Vec3D Particle< PP >::velocity ( ) const
inline

Returns the velocity of particle in Vec3D.

template<class PP>
PP& Particle< PP >::x ( )
inline

Return reference to coordinate data.

template<class PP>
const PP& Particle< PP >::x ( ) const
inline

Return const reference to coordinate data.


The documentation for this class was generated from the following file: