particles.hpp
Go to the documentation of this file.
General callback functors.
Definition: callback.hpp:61
void set_status(particle_status_e status)
Set particle status.
Definition: particles.hpp:699
ParticleBase(std::istream &s)
Constructor for loading particle from a file.
Definition: particles.hpp:682
double IQ() const
Return current or charge carried by trajectory or particle cloud [A/C].
Definition: particles.hpp:706
void save(std::ostream &s) const
Saves data to stream.
Definition: particles.hpp:722
particle_status_e get_status()
Return particle status.
Definition: particles.hpp:695
double qm() const
Return charge per mass ratio (q/m) [C/kg].
Definition: particles.hpp:718
double & operator[](int i)
Operator for pointing to coordinate data.
Definition: particles.hpp:187
static int trajectory_intersections_at_plane(std::vector< ParticleP2D > &intsc, int crd, double val, const ParticleP2D &x1, const ParticleP2D &x2, int extrapolate=0)
Return the number of trajectory intersections with plane crd = val on the trajectory from x1 to x2....
Definition: particles.cpp:120
const double & operator[](int i) const
Operator for pointing to coordinate data.
Definition: particles.hpp:191
ParticleP2D(std::istream &s)
Constructor for loading particle point from a file.
Definition: particles.hpp:120
static size_t size()
Returns number of coordinates used for particle point.
Definition: particles.hpp:138
Vec3D velocity() const
Returns the velocity of particle point in Vec3D.
Definition: particles.hpp:179
ParticleP2D(double t, double x, double vx, double y, double vy)
Constructor for 2D particle point.
Definition: particles.hpp:114
Vec3D location() const
Returns the location of particle point in Vec3D.
Definition: particles.hpp:175
const double & operator()(int i) const
Operator for pointing to coordinate data.
Definition: particles.hpp:199
double & operator()(int i)
Operator for pointing to coordinate data.
Definition: particles.hpp:195
static const std::string IQ_unit()
Return string representation for unit of current.
Definition: particles.hpp:167
static size_t dim()
Returns number of dimensions for geometry.
Definition: particles.hpp:134
static int get_derivatives(double t, const double *x, double *dxdt, void *data)
Returns time derivatives dxdt of coordinates at time t and coordinates x = (x,vx,y,...
Definition: particles.cpp:67
static geom_mode_e geom_mode()
Returns geometry mode.
Definition: particles.hpp:130
const double & operator()(int i) const
Operator for pointing to coordinate data.
Definition: particles.hpp:559
double & operator()(int i)
Operator for pointing to coordinate data.
Definition: particles.hpp:555
ParticleP3D(std::istream &s)
Constructor for loading particle point from a file.
Definition: particles.hpp:476
static size_t size()
Returns number of coordinates used for particle point.
Definition: particles.hpp:496
Vec3D location() const
Returns the location of particle point in Vec3D.
Definition: particles.hpp:535
static geom_mode_e geom_mode()
Returns geometry mode.
Definition: particles.hpp:488
double & operator[](int i)
Operator for pointing to coordinate data.
Definition: particles.hpp:547
static int trajectory_intersections_at_plane(std::vector< ParticleP3D > &intsc, int crd, double val, const ParticleP3D &x1, const ParticleP3D &x2, int extrapolate=0)
Return the number of trajectory intersections with plane crd = val on the trajectory from x1 to x2....
Definition: particles.cpp:287
static int get_derivatives(double t, const double *x, double *dxdt, void *data)
Returns time derivatives dxdt of coordinates at time t and coordinates x = (x,vx,y,...
Definition: particles.cpp:227
static const std::string IQ_unit()
Return string representation for unit of current.
Definition: particles.hpp:527
ParticleP3D(double t, double x, double vx, double y, double vy, double z, double vz)
Constructor for 3D particle point.
Definition: particles.hpp:470
const double & operator[](int i) const
Operator for pointing to coordinate data.
Definition: particles.hpp:551
static size_t dim()
Returns number of dimensions for geometry.
Definition: particles.hpp:492
Vec3D velocity() const
Returns the velocity of particle point in Vec3D.
Definition: particles.hpp:539
const double & operator[](int i) const
Operator for pointing to coordinate data.
Definition: particles.hpp:369
static geom_mode_e geom_mode()
Returns geometry mode.
Definition: particles.hpp:303
Vec3D velocity() const
Returns the velocity of particle point in Vec3D.
Definition: particles.hpp:357
ParticlePCyl(std::istream &s)
Constructor for loading particle point from a file.
Definition: particles.hpp:292
static int get_derivatives(double t, const double *x, double *dxdt, void *data)
Returns time derivatives dxdt of coordinates at time t and coordinates x = (x,vx,r,...
Definition: particles.cpp:147
static int trajectory_intersections_at_plane(std::vector< ParticlePCyl > &intsc, int crd, double val, const ParticlePCyl &x1, const ParticlePCyl &x2, int extrapolate=0)
Return the number of trajectory intersections with plane crd = val on the trajectory from x1 to x2....
Definition: particles.cpp:200
static const std::string IQ_unit()
Return string representation for unit of current.
Definition: particles.hpp:345
static size_t size()
Returns number of coordinates used for particle point.
Definition: particles.hpp:311
double & operator()(int i)
Operator for pointing to coordinate data.
Definition: particles.hpp:373
const double & operator()(int i) const
Operator for pointing to coordinate data.
Definition: particles.hpp:377
double & operator[](int i)
Operator for pointing to coordinate data.
Definition: particles.hpp:365
static size_t dim()
Returns number of dimensions for geometry.
Definition: particles.hpp:307
Vec3D location() const
Returns the location of particle point in Vec3D.
Definition: particles.hpp:353
void save(std::ostream &s) const
Saves data to stream.
Definition: particles.hpp:414
ParticlePCyl(double t, double x, double vx, double r, double vr, double w)
Constructor for cylindrical particle point.
Definition: particles.hpp:286
void reset_trajectory(void)
Resets the particle trajectory.
Definition: particles.hpp:834
double & operator[](int i)
Operator for pointing to coordinate data.
Definition: particles.hpp:782
const PP & x() const
Return const reference to coordinate data.
Definition: particles.hpp:802
void debug_print(std::ostream &os) const
Print debugging information to os.
Definition: particles.hpp:854
Particle(std::istream &s)
Constructor for loading particle from a file.
Definition: particles.hpp:758
size_t traj_size(void) const
Return number of trajectory points of particle.
Definition: particles.hpp:814
Vec3D location() const
Returns the location of particle in Vec3D.
Definition: particles.hpp:790
const double & operator[](int i) const
Operator for pointing to coordinate data.
Definition: particles.hpp:786
void clear_trajectory(void)
Clears the particle trajectory.
Definition: particles.hpp:826
const double & operator()(int i) const
Operator for pointing to coordinate data.
Definition: particles.hpp:778
const PP & traj(int i) const
Return const reference to trajectory data.
Definition: particles.hpp:810
double & operator()(int i)
Operator for pointing to coordinate data.
Definition: particles.hpp:774
Vec3D velocity() const
Returns the velocity of particle in Vec3D.
Definition: particles.hpp:794
void add_trajectory_point(const PP &x)
Add trajectory point to the end of the trajectory.
Definition: particles.hpp:818
void copy_trajectory(const std::vector< PP > &traj)
Define trajectory by copying.
Definition: particles.hpp:822
Particle(double IQ, double q, double m, const PP &x)
Constructor for particle.
Definition: particles.hpp:753
Physical constants.
void write_double(std::ostream &s, double value)
Write double value into stream os.
Definition: file.cpp:88
void write_int32(std::ostream &s, int32_t value)
Write int32_t value into stream os.
Definition: file.cpp:70
Geometry definition
Mesh based scalar fields.
Particle< ParticlePCyl > ParticleCyl
Particle class in Cylindrical symmetry.
Definition: particles.hpp:915
const VectorField * _bfield
Magnetic field or NULL.
Definition: particles.hpp:931
const VectorField * _efield
Electric field or NULL.
Definition: particles.hpp:930
const CallbackFunctorD_V * _bsup_cb
B-field plasma suppression callback.
Definition: particles.hpp:934
void set_relativistic(bool enable)
Set relativistic particle iteration.
Definition: particles.hpp:950
bool _relativistic
Do relativistic particle calc?
Definition: particles.hpp:935
MeshScalarField * _scharge
Space charge field or NULL.
Definition: particles.hpp:929
void set_bfield_suppression_callback(const CallbackFunctorD_V *bsup_cb)
Set B-field potential dependent suppression callback.
Definition: particles.hpp:944
Three dimensional vectors.
Vector field base.