Navigation

Main Page
Download
Support
Installation
Tutorial
Examples
Reference Manual
   Version 1.0.5new_solver
      Class Index
      File List
   Version 1.0.5dev
   Version 1.0.5b
   Version 1.0.4dev
   Version 1.0.4
Publications


Hosted by Get Ion Beam Simulator at SourceForge.net. Fast, secure and Free Open Source software downloads
particledatabase.hpp
Go to the documentation of this file.
1 
5 /* Copyright (c) 2005-2014 Taneli Kalvas. All rights reserved.
6  *
7  * You can redistribute this software and/or modify it under the terms
8  * of the GNU General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * This library is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this library (file "COPYING" included in the package);
19  * if not, write to the Free Software Foundation, Inc., 51 Franklin
20  * Street, Fifth Floor, Boston, MA 02110-1301 USA
21  *
22  * If you have questions about your rights to use or distribute this
23  * software, please contact Berkeley Lab's Technology Transfer
24  * Department at TTD@lbl.gov. Other questions, comments and bug
25  * reports should be sent directly to the author via email at
26  * taneli.kalvas@jyu.fi.
27  *
28  * NOTICE. This software was developed under partial funding from the
29  * U.S. Department of Energy. As such, the U.S. Government has been
30  * granted for itself and others acting on its behalf a paid-up,
31  * nonexclusive, irrevocable, worldwide license in the Software to
32  * reproduce, prepare derivative works, and perform publicly and
33  * display publicly. Beginning five (5) years after the date
34  * permission to assert copyright is obtained from the U.S. Department
35  * of Energy, and subject to any subsequent five (5) year renewals,
36  * the U.S. Government is granted for itself and others acting on its
37  * behalf a paid-up, nonexclusive, irrevocable, worldwide license in
38  * the Software to reproduce, prepare derivative works, distribute
39  * copies to the public, perform publicly and display publicly, and to
40  * permit others to do so.
41  */
42 
43 #ifndef PARTICLEDATABASE_HPP
44 #define PARTICLEDATABASE_HPP 1
45 
46 
47 #include "scalarfield.hpp"
48 #include "vectorfield.hpp"
49 #include "particles.hpp"
51 #include "particlestatistics.hpp"
52 #include "constants.hpp"
53 #include "types.hpp"
54 
55 
59 public:
60 
64 
65  virtual void operator()( ParticleBase *particle, ParticlePBase *xcur, ParticlePBase *xend ) = 0;
66 };
67 
68 
72 public:
73 
77 
80  virtual void operator()( ParticleBase *particle, class ParticleDataBase *pdb ) = 0;
81 };
82 
83 
87 public:
88 
92 
104  virtual void operator()( ParticleBase *particle, ParticlePBase *x, uint32_t tri,
105  double s, double t ) = 0;
106 };
107 
108 
119 
120  double _phi;
121  const MeshScalarField &_epot;
123 public:
124 
127  PPlasmaBfieldSuppression( const MeshScalarField &epot, double phi )
128  : _phi(phi), _epot(epot) {}
129 
133 
136  virtual double operator()( const Vec3D &x ) const {
137  if( _epot( x ) > _phi )
138  return( 0.0 );
139  return( 1.0 );
140  }
141 };
142 
143 
154 
155  double _phi;
156  const MeshScalarField &_epot;
158 public:
159 
162  NPlasmaBfieldSuppression( const MeshScalarField &epot, double phi )
163  : _phi(phi), _epot(epot) {}
164 
168 
171  virtual double operator()( const Vec3D &x ) const {
172  if( _epot( x ) < _phi )
173  return( 0.0 );
174  return( 1.0 );
175  }
176 };
177 
178 
179 /* ******************************************************************************************* *
180  * ParticleDataBase classes *
181  * ******************************************************************************************* */
182 
183 
192 
193  class ParticleDataBaseImp *_imp;
194 
195 protected:
196 
197 /* ************************************** *
198  * Constructors *
199  * ************************************** */
200 
204 
207  ParticleDataBase( const ParticleDataBase &pdb );
208 
211  const ParticleDataBase &operator=( const ParticleDataBase &pdb );
212 
218 
219 public:
220 
221 /* ************************************** *
222  * Destructor *
223  * ************************************** */
224 
227  virtual ~ParticleDataBase();
228 
229 /* ****************************************** *
230  * Particle iteration settings and statictics *
231  * ****************************************** */
232 
238  void set_thread_count( uint32_t threadcount ) {}
239 
245  void set_accuracy( double epsabs, double epsrel );
246 
256  void set_bfield_suppression( const CallbackFunctorD_V *functor );
257 
261 
265 
269 
272  void set_relativistic( bool enable );
273 
278  void set_surface_collision( bool surface_collision );
279 
285  void set_polyint( bool polyint );
286 
295  bool get_polyint( void ) const;
296 
302 
306 
312 
316 
321  void set_max_steps( uint32_t maxsteps );
322 
327  void set_max_time( double maxt );
328 
335  void set_save_all_points( bool save_points );
336 
345  void set_save_trajectories( uint32_t div );
346 
353  uint32_t get_save_trajectories( void ) const;
354 
363  void set_mirror( const bool mirror[6] );
364 
371  void get_mirror( bool mirror[6] ) const;
372 
375  int get_iteration_number( void ) const;
376 
390  double get_rhosum( void ) const;
391 
394  void set_rhosum( double rhosum );
395 
398  const ParticleStatistics &get_statistics( void ) const;
399 
400 /* ************************************** *
401  * Information and queries *
402  * ************************************** */
403 
406  geom_mode_e geom_mode() const;
407 
410  size_t size( void ) const;
411 
414  virtual ParticleBase &particle( uint32_t i ) = 0;
415 
418  virtual const ParticleBase &particle( uint32_t i ) const = 0;
419 
422  double traj_length( uint32_t i ) const;
423 
426  size_t traj_size( uint32_t i ) const;
427 
430  virtual const ParticlePBase &trajectory_point( uint32_t i, uint32_t j ) const = 0;
431 
434  void trajectory_point( double &t, Vec3D &loc, Vec3D &vel, uint32_t i, uint32_t j ) const;
435 
440  coordinate_axis_e axis,
441  double val,
442  const std::vector<trajectory_diagnostic_e> &diagnostics ) const;
443 
456  void build_trajectory_density_field( MeshScalarField &tdens ) const;
457 
458 /* ************************************** *
459  * Particle and trajectory clearing *
460  * ************************************** */
461 
467  void clear( void );
468 
474  void clear_trajectories( void );
475 
481  void clear_trajectory( size_t a );
482 
483 /* ************************************** *
484  * Particle definition *
485  * ************************************** */
486 
489  void reserve( size_t size );
490 
491 /* ************************************** *
492  * Particle iterators *
493  * ************************************** */
494 
508  void iterate_trajectories( MeshScalarField &scharge, const VectorField &efield,
509  const VectorField &bfield );
510 
517  void step_particles( MeshScalarField &scharge, const VectorField &efield,
518  const VectorField &bfield, double dt );
519 
520 /* ************************************** *
521  * Debugging, plotting and saving *
522  * ************************************** */
523 
526  virtual void save( const std::string &filename ) const = 0;
527 
530  virtual void save( std::ostream &os ) const = 0;
531 
534  virtual void debug_print( std::ostream &os ) const = 0;
535 };
536 
537 
550 
551  class ParticleDataBase2DImp *_imp;
552 
553 public:
554 
555 /* ************************************** *
556  * Constructors and destructor *
557  * ************************************** */
558 
561  ParticleDataBase2D( const Geometry &geom );
562 
566 
569  ParticleDataBase2D( std::istream &s, const Geometry &geom );
570 
574 
577  const ParticleDataBase2D &operator=( const ParticleDataBase2D &pdb );
578 
579 /* ************************************** *
580  * Information and queries *
581  * ************************************** */
582 
585  virtual Particle2D &particle( uint32_t i );
586 
589  virtual const Particle2D &particle( uint32_t i ) const;
590 
593  virtual const ParticleP2D &trajectory_point( uint32_t i, uint32_t j ) const;
594 
596 
600  void trajectories_at_plane( std::vector<Particle2D> &tdata,
601  coordinate_axis_e axis,
602  double val ) const;
603 
605 
606 /* ************************************** *
607  * Particle definition *
608  * ************************************** */
609 
621  void add_particle( double IQ, double q, double m, const ParticleP2D &x );
622 
627  void add_particle( const Particle2D &p );
628 
629 /* ************************************** *
630  * Particle beam definition *
631  * ************************************** */
632 
652  void add_2d_beam_with_energy( uint32_t N, double J, double q, double m,
653  double E, double Tp, double Tt,
654  double x1, double y1, double x2, double y2 );
655 
671  void add_2d_beam_with_velocity( uint32_t N, double J, double q, double m,
672  double v, double dvp, double dvt,
673  double x1, double y1, double x2, double y2 );
674 
691  void add_2d_KV_beam_with_emittance( uint32_t N, double I, double q, double m,
692  double a, double b, double e,
693  double Ex, double x0, double y0 );
694 
711  void add_2d_gaussian_beam_with_emittance( uint32_t N, double I, double q, double m,
712  double a, double b, double e,
713  double Ex, double x0, double y0 );
714 
715 /* ************************************** *
716  * Debugging, plotting and saving *
717  * ************************************** */
718 
721  virtual void save( const std::string &filename ) const;
722 
725  virtual void save( std::ostream &s ) const;
726 
729  virtual void debug_print( std::ostream &os ) const;
730 };
731 
732 
733 
734 
747 
748  class ParticleDataBaseCylImp *_imp;
749 
750 public:
751 
752 /* ************************************** *
753  * Constructors and destructor *
754  * ************************************** */
755 
758  ParticleDataBaseCyl( const Geometry &geom );
759 
763 
766  ParticleDataBaseCyl( std::istream &s, const Geometry &geom );
767 
771 
775 
776 /* ************************************** *
777  * Information and queries *
778  * ************************************** */
779 
782  virtual ParticleCyl &particle( uint32_t i );
783 
786  virtual const ParticleCyl &particle( uint32_t i ) const;
787 
790  virtual const ParticlePCyl &trajectory_point( uint32_t i, uint32_t j ) const;
791 
793 
797  void trajectories_at_plane( std::vector<ParticleCyl> &tdata,
798  coordinate_axis_e axis,
799  double val ) const;
800 
802 
825  void export_path_manager_data( const std::string &filename,
826  double ref_E, double ref_q, double ref_m,
827  double val, uint32_t Np ) const;
828 
829 /* ************************************** *
830  * Particle definition *
831  * ************************************** */
832 
844  void add_particle( double IQ, double q, double m, const ParticlePCyl &x );
845 
850  void add_particle( const ParticleCyl &p );
851 
852  /* ************************************** *
853  * Particle beam definition *
854  * ************************************** */
855 
875  void add_2d_beam_with_energy( uint32_t N, double J, double q, double m,
876  double E, double Tp, double Tt,
877  double x1, double y1, double x2, double y2 );
878 
898  void add_2d_beam_with_total_energy( uint32_t N, double J, double q, double m,
899  double Etot, const ScalarField &epot,
900  double Tp, double Tt,
901  double x1, double y1, double x2, double y2 );
902 
918  void add_2d_beam_with_velocity( uint32_t N, double J, double q, double m,
919  double v, double dvp, double dvt,
920  double x1, double y1, double x2, double y2 );
921 
924  void add_2d_full_gaussian_beam( uint32_t N, double I, double q, double m,
925  double Ex, double Tp, double Tt,
926  double x0, double dr );
927 
946  void add_2d_gaussian_beam_with_emittance( uint32_t N, double I, double q, double m,
947  double a, double b, double e,
948  double Ex, double x0 );
949 
950 /* ************************************** *
951  * Debugging, plotting and saving *
952  * ************************************** */
953 
956  virtual void save( const std::string &filename ) const;
957 
960  virtual void save( std::ostream &s ) const;
961 
964  virtual void debug_print( std::ostream &os ) const;
965 };
966 
967 
968 
981 
982  class ParticleDataBase3DImp *_imp;
983 
984 public:
985 
986 /* ************************************** *
987  * Constructors and destructor *
988  * ************************************** */
989 
992  ParticleDataBase3D( const Geometry &geom );
993 
997 
1000  ParticleDataBase3D( std::istream &s, const Geometry &geom );
1001 
1005 
1008  const ParticleDataBase3D &operator=( const ParticleDataBase3D &pdb );
1009 
1010 /* ************************************** *
1011  * Information and queries *
1012  * ************************************** */
1013 
1016  virtual Particle3D &particle( uint32_t i );
1017 
1020  virtual const Particle3D &particle( uint32_t i ) const;
1021 
1024  virtual const ParticleP3D &trajectory_point( uint32_t i, uint32_t j ) const;
1025 
1027 
1031  void trajectories_at_plane( std::vector<Particle3D> &tdata,
1032  coordinate_axis_e axis,
1033  double val ) const;
1034 
1036 
1037 /* ************************************** *
1038  * Particle definition *
1039  * ************************************** */
1040 
1052  void add_particle( double IQ, double q, double m, const ParticleP3D &x );
1053 
1058  void add_particle( const Particle3D &p );
1059 
1060 /* ************************************** *
1061  * Particle beam definition *
1062  * ************************************** */
1063 
1064 
1087  void add_cylindrical_beam_with_total_energy( uint32_t N, double J, double q, double m,
1088  double Etot, const ScalarField &epot,
1089  double Tp, double Tt, Vec3D c,
1090  Vec3D dir1, Vec3D dir2, double r );
1091 
1115  void add_cylindrical_beam_with_energy( uint32_t N, double J, double q, double m,
1116  double E, double Tp, double Tt, Vec3D c,
1117  Vec3D dir1, Vec3D dir2, double r );
1118 
1141  void add_cylindrical_beam_with_velocity( uint32_t N, double J, double q, double m,
1142  double v, double dvp, double dvt, Vec3D c,
1143  Vec3D dir1, Vec3D dir2, double r );
1144 
1153  void add_rectangular_beam_with_energy( uint32_t N, double J, double q, double m,
1154  double E, double Tp, double Tt, Vec3D c,
1155  Vec3D dir1, Vec3D dir2, double size1, double size2 );
1156 
1165  void add_rectangular_beam_with_velocity( uint32_t N, double J, double q, double m,
1166  double v, double dvp, double dvt, Vec3D c,
1167  Vec3D dir1, Vec3D dir2, double size1, double size2 );
1168 
1169 
1189  void add_3d_KV_beam_with_emittance( uint32_t N, double I, double q, double m,
1190  double E0,
1191  double a1, double b1, double e1,
1192  double a2, double b2, double e2,
1193  Vec3D c, Vec3D dir1, Vec3D dir2 );
1194 
1213  void add_3d_waterbag_beam_with_emittance( uint32_t N, double I, double q, double m,
1214  double E0,
1215  double a1, double b1, double e1,
1216  double a2, double b2, double e2,
1217  Vec3D c, Vec3D dir1, Vec3D dir2 );
1218 
1237  void add_3d_gaussian_beam_with_emittance( uint32_t N, double I, double q, double m,
1238  double E0,
1239  double a1, double b1, double e1,
1240  double a2, double b2, double e2,
1241  Vec3D c, Vec3D dir1, Vec3D dir2 );
1242 
1243 
1244 /* ************************************** *
1245  * Information and queries *
1246  * ************************************** */
1247 
1248 
1267  const Vec3D &c, const Vec3D &o, const Vec3D &p,
1268  const std::vector<trajectory_diagnostic_e> &diagnostics ) const;
1269 
1270 
1294  void export_path_manager_data( const std::string &filename,
1295  double ref_E, double ref_q, double ref_m,
1296  const Vec3D &c, const Vec3D &o, const Vec3D &p ) const;
1297 
1298 /* ************************************** *
1299  * Debugging, plotting and saving *
1300  * ************************************** */
1301 
1304  virtual void save( const std::string &filename ) const;
1305 
1308  virtual void save( std::ostream &s ) const;
1309 
1312  virtual void debug_print( std::ostream &os ) const;
1313 };
1314 
1315 #endif
1316 
void trajectories_at_plane(TrajectoryDiagnosticData &tdata, coordinate_axis_e axis, double val, const std::vector< trajectory_diagnostic_e > &diagnostics) const
Gets trajectory diagnostic diagnostics at plane axis = val in trajectory diagnostic data object tdata...
Definition: particledatabase.cpp:252
void add_2d_beam_with_velocity(uint32_t N, double J, double q, double m, double v, double dvp, double dvt, double x1, double y1, double x2, double y2)
Add a 2d beam with velocities.
Definition: particledatabase.cpp:394
virtual void save(const std::string &filename) const =0
Saves data to a new file filename.
Particle point class for cylindrical coordinates.
Definition: particles.hpp:274
virtual ~TrajectorySurfaceCollisionCallback()
Virtual destructor.
Definition: particledatabase.hpp:91
virtual const ParticlePCyl & trajectory_point(uint32_t i, uint32_t j) const
Gets the particle i trajectory point j as particle point.
Definition: particledatabase.cpp:513
const ParticleDataBase2D & operator=(const ParticleDataBase2D &pdb)
Assignment.
Definition: particledatabase.cpp:346
virtual const ParticleP3D & trajectory_point(uint32_t i, uint32_t j) const
Gets the particle i trajectory point j as particle point.
Definition: particledatabase.cpp:675
void get_mirror(bool mirror[6]) const
Get particle mirroring on boundaries.
Definition: particledatabase.cpp:192
Trajectory diagnostics.
Scalar fields.
~NPlasmaBfieldSuppression()
Destructor.
Definition: particledatabase.hpp:167
virtual void debug_print(std::ostream &os) const =0
Print debugging information to os.
Vector field.
Definition: vectorfield.hpp:56
scharge_deposition_e get_scharge_deposition(void) const
Get space charge deposition type.
Definition: particledatabase.cpp:150
void add_3d_waterbag_beam_with_emittance(uint32_t N, double I, double q, double m, double E0, double a1, double b1, double e1, double a2, double b2, double e2, Vec3D c, Vec3D dir1, Vec3D dir2)
Add a 3d beam with defined waterbag emittance.
Definition: particledatabase.cpp:751
geom_mode_e geom_mode() const
Return geometry mode.
Definition: particledatabase.cpp:222
virtual ~ParticleDataBase()
Virtual destructor.
Definition: particledatabase.cpp:61
ParticleDataBase2D(const Geometry &geom)
Constructor.
Definition: particledatabase.cpp:311
void set_thread_count(uint32_t threadcount)
Set the number of threads used for calculation.
Definition: particledatabase.hpp:238
virtual void debug_print(std::ostream &os) const
Print debugging information to os.
Definition: particledatabase.cpp:607
void add_cylindrical_beam_with_total_energy(uint32_t N, double J, double q, double m, double Etot, const ScalarField &epot, double Tp, double Tt, Vec3D c, Vec3D dir1, Vec3D dir2, double r)
Add a cylindrical beam with energies.
Definition: particledatabase.cpp:709
void add_particle(double IQ, double q, double m, const ParticlePCyl &x)
Add one particle.
Definition: particledatabase.cpp:535
void step_particles(MeshScalarField &scharge, const VectorField &efield, const VectorField &bfield, double dt)
Step particles forward by time step dt.
Definition: particledatabase.cpp:298
Magnetic field plasma suppression for negative ion extraction.
Definition: particledatabase.hpp:153
const ParticleDataBaseCyl & operator=(const ParticleDataBaseCyl &pdb)
Assignment.
Definition: particledatabase.cpp:491
Particle point class for 3D.
Definition: particles.hpp:458
virtual const ParticlePBase & trajectory_point(uint32_t i, uint32_t j) const =0
Gets the particle i trajectory point j as particle point.
Particle and particle point objects
void set_save_all_points(bool save_points)
Set trajectory saving.
Definition: particledatabase.cpp:168
void add_2d_beam_with_total_energy(uint32_t N, double J, double q, double m, double Etot, const ScalarField &epot, double Tp, double Tt, double x1, double y1, double x2, double y2)
Add a 2d beam with total energy.
Definition: particledatabase.cpp:555
void add_particle(double IQ, double q, double m, const ParticleP3D &x)
Add one particle.
Definition: particledatabase.cpp:689
void trajectories_at_free_plane(TrajectoryDiagnosticData &tdata, const Vec3D &c, const Vec3D &o, const Vec3D &p, const std::vector< trajectory_diagnostic_e > &diagnostics) const
Get trajectory diagnostic on a plane.
Definition: particledatabase.cpp:771
void trajectories_at_plane(std::vector< ParticleCyl > &tdata, coordinate_axis_e axis, double val) const
Gets trajectory data at plane axis = val as particles in vector tdata.
Definition: particledatabase.cpp:519
Particle point base class
Definition: particles.hpp:91
geom_mode_e
Geometry mode enum.
Definition: types.hpp:59
ParticleDataBase2D implementation.
Definition: particledatabaseimp.hpp:776
void set_max_steps(uint32_t maxsteps)
Set maximum number of steps to iterate.
Definition: particledatabase.cpp:156
const ParticleDataBase3D & operator=(const ParticleDataBase3D &pdb)
Assignment.
Definition: particledatabase.cpp:653
Trajectory end callback.
Definition: particledatabase.hpp:71
void export_path_manager_data(const std::string &filename, double ref_E, double ref_q, double ref_m, const Vec3D &c, const Vec3D &o, const Vec3D &p) const
Export particle data as Path Manager data.
Definition: particledatabase.cpp:779
double get_rhosum(void) const
Return sum of defined beam space charge density.
Definition: particledatabase.cpp:204
Base types.
~ParticleDataBase3D()
Destructor.
Definition: particledatabase.cpp:647
void build_trajectory_density_field(MeshScalarField &tdens) const
Build trajectory density field.
Definition: particledatabase.cpp:285
const ParticleDataBase & operator=(const ParticleDataBase &pdb)
Assignment.
Definition: particledatabase.cpp:66
void add_3d_KV_beam_with_emittance(uint32_t N, double I, double q, double m, double E0, double a1, double b1, double e1, double a2, double b2, double e2, Vec3D c, Vec3D dir1, Vec3D dir2)
Add a 3d beam with defined KV emittance.
Definition: particledatabase.cpp:741
Scalar field class.
Definition: meshscalarfield.hpp:70
void add_2d_beam_with_energy(uint32_t N, double J, double q, double m, double E, double Tp, double Tt, double x1, double y1, double x2, double y2)
Add a 2d beam with energies.
Definition: particledatabase.cpp:564
void set_trajectory_surface_collision_callback(TrajectorySurfaceCollisionCallback *tsur_cb)
Set trajectory surface collision callback.
Definition: particledatabase.cpp:102
void add_2d_gaussian_beam_with_emittance(uint32_t N, double I, double q, double m, double a, double b, double e, double Ex, double x0, double y0)
Add a 2d beam with defined gaussian emittance.
Definition: particledatabase.cpp:418
Particle database class for three dimensions.
Definition: particledatabase.hpp:980
virtual void save(const std::string &filename) const
Saves data to a new file filename.
Definition: particledatabase.cpp:426
void clear_trajectory(size_t a)
Clears particle a in the particle trajectory database.
Definition: particledatabase.cpp:273
Particle base class
Definition: particles.hpp:652
virtual void debug_print(std::ostream &os) const
Print debugging information to os.
Definition: particledatabase.cpp:806
Trajectory handler callback.
Definition: particledatabase.hpp:58
void add_2d_KV_beam_with_emittance(uint32_t N, double I, double q, double m, double a, double b, double e, double Ex, double x0, double y0)
Add a 2d beam with defined KV emittance.
Definition: particledatabase.cpp:410
Geometry defining class.
Definition: geometry.hpp:179
void set_surface_collision(bool surface_collision)
Set surface collision model to be used.
Definition: particledatabase.cpp:114
double traj_length(uint32_t i) const
Returns the length of trajectory i.
Definition: particledatabase.cpp:234
void set_rhosum(double rhosum)
Set sum of defined beam space charge density.
Definition: particledatabase.cpp:210
virtual void debug_print(std::ostream &os) const
Print debugging information to os.
Definition: particledatabase.cpp:445
Magnetic field plasma suppression for positive ion extraction.
Definition: particledatabase.hpp:118
void set_relativistic(bool enable)
Set relativistic particle iteration.
Definition: particledatabase.cpp:108
Definition: callback.hpp:61
void reserve(size_t size)
Reserve memory for size particles.
Definition: particledatabase.cpp:279
void set_scharge_deposition(scharge_deposition_e type)
Set space charge deposition type.
Definition: particledatabase.cpp:144
Class for trajectory diagnostic data.
Definition: trajectorydiagnostics.hpp:127
void set_polyint(bool polyint)
Set the interpolation type to polynomial(true) or linear(false).
Definition: particledatabase.cpp:120
void add_3d_gaussian_beam_with_emittance(uint32_t N, double I, double q, double m, double E0, double a1, double b1, double e1, double a2, double b2, double e2, Vec3D c, Vec3D dir1, Vec3D dir2)
Add a 3d beam with defined gaussian emittance.
Definition: particledatabase.cpp:761
void set_implementation_pointer(class ParticleDataBaseImp *imp)
Set particle database implementation pointer.
Definition: particledatabase.cpp:72
void set_trajectory_end_callback(TrajectoryEndCallback *tend_cb)
Set trajectory end callback.
Definition: particledatabase.cpp:96
void add_rectangular_beam_with_velocity(uint32_t N, double J, double q, double m, double v, double dvp, double dvt, Vec3D c, Vec3D dir1, Vec3D dir2, double size1, double size2)
Add a rectangular beam with velocities.
Definition: particledatabase.cpp:725
virtual ~TrajectoryEndCallback()
Virtual destructor.
Definition: particledatabase.hpp:76
ParticleDataBaseCyl implementation.
Definition: particledatabaseimp.hpp:822
void add_cylindrical_beam_with_energy(uint32_t N, double J, double q, double m, double E, double Tp, double Tt, Vec3D c, Vec3D dir1, Vec3D dir2, double r)
Add a cylindrical beam with energies.
Definition: particledatabase.cpp:717
void add_2d_gaussian_beam_with_emittance(uint32_t N, double I, double q, double m, double a, double b, double e, double Ex, double x0)
Add a 2d beam with defined gaussian emittance.
Definition: particledatabase.cpp:580
void iterate_trajectories(MeshScalarField &scharge, const VectorField &efield, const VectorField &bfield)
Iterate particles through the geometry.
Definition: particledatabase.cpp:291
ParticleDataBase3D(const Geometry &geom)
Constructor.
Definition: particledatabase.cpp:618
void add_cylindrical_beam_with_velocity(uint32_t N, double J, double q, double m, double v, double dvp, double dvt, Vec3D c, Vec3D dir1, Vec3D dir2, double r)
Add a cylindrical beam with velocities.
Definition: particledatabase.cpp:701
Definition: particledatabaseimp.hpp:56
int get_iteration_number(void) const
Get the number of iteration rounds done.
Definition: particledatabase.cpp:198
scharge_deposition_e
Space charge depostition type.
Definition: types.hpp:161
size_t size(void) const
Returns particle count.
Definition: particledatabase.cpp:228
Particle iteration statistics.
Definition: particlestatistics.hpp:57
void add_2d_full_gaussian_beam(uint32_t N, double I, double q, double m, double Ex, double Tp, double Tt, double x0, double dr)
Add a 2d beam with gaussian profile and velocity distribution.
Definition: particledatabase.cpp:572
Particle point class for 2D.
Definition: particles.hpp:102
void clear_trajectories(void)
Clears the particle trajectory database.
Definition: particledatabase.cpp:267
ParticleDataBaseCyl(const Geometry &geom)
Constructor.
Definition: particledatabase.cpp:456
virtual double operator()(const Vec3D &x) const
Suppression function.
Definition: particledatabase.hpp:136
PPlasmaBfieldSuppression(const MeshScalarField &epot, double phi)
Constructor setting electric potential field and potential limit.
Definition: particledatabase.hpp:127
virtual ~TrajectoryHandlerCallback()
Virtual destructor.
Definition: particledatabase.hpp:63
void set_accuracy(double epsabs, double epsrel)
Set the accuracy requirement for calculation.
Definition: particledatabase.cpp:78
ParticleDataBase3D implementation.
Definition: particledatabaseimp.hpp:878
void set_max_time(double maxt)
Set maximum lifetime of particle in simulation.
Definition: particledatabase.cpp:162
void set_trajectory_interpolation(trajectory_interpolation_e intrp)
Set trajectory interpolation type.
Definition: particledatabase.cpp:132
void export_path_manager_data(const std::string &filename, double ref_E, double ref_q, double ref_m, double val, uint32_t Np) const
Export particle data as Path Manager data.
Definition: particledatabase.cpp:527
coordinate_axis_e
Coordinate axis identifier.
Definition: types.hpp:170
NPlasmaBfieldSuppression(const MeshScalarField &epot, double phi)
Constructor setting electric potential field and potential limit.
Definition: particledatabase.hpp:162
virtual void operator()(ParticleBase *particle, class ParticleDataBase *pdb)=0
Operator called when particle calculation ends.
void trajectories_at_plane(std::vector< Particle2D > &tdata, coordinate_axis_e axis, double val) const
Gets trajectory data at plane axis = val as particles in vector tdata.
Definition: particledatabase.cpp:374
Physical constants.
uint32_t get_save_trajectories(void) const
Get trajectory saving.
Definition: particledatabase.cpp:180
void clear(void)
Clears the particle database of all particles.
Definition: particledatabase.cpp:261
Particle database class for cylindrical systems.
Definition: particledatabase.hpp:746
virtual ParticleCyl & particle(uint32_t i)
Returns a reference to particle i.
Definition: particledatabase.cpp:501
trajectory_interpolation_e get_trajectory_interpolation(void) const
Get trajectory interpolation type.
Definition: particledatabase.cpp:138
void trajectories_at_plane(std::vector< Particle3D > &tdata, coordinate_axis_e axis, double val) const
Gets trajectory data at plane axis = val as particles in vector tdata.
Definition: particledatabase.cpp:681
virtual double operator()(const Vec3D &x) const
Suppression function.
Definition: particledatabase.hpp:171
virtual const ParticleP2D & trajectory_point(uint32_t i, uint32_t j) const
Gets the particle i trajectory point j as particle point.
Definition: particledatabase.cpp:368
void add_2d_beam_with_energy(uint32_t N, double J, double q, double m, double E, double Tp, double Tt, double x1, double y1, double x2, double y2)
Add a 2d beam with energies.
Definition: particledatabase.cpp:402
virtual ParticleBase & particle(uint32_t i)=0
Returns a reference to particle i.
void set_bfield_suppression(const CallbackFunctorD_V *functor)
Set magnetic field suppression location depedent callback functor.
Definition: particledatabase.cpp:84
virtual Particle3D & particle(uint32_t i)
Returns a reference to particle i.
Definition: particledatabase.cpp:663
~ParticleDataBase2D()
Destructor.
Definition: particledatabase.cpp:340
virtual void save(const std::string &filename) const
Saves data to a new file filename.
Definition: particledatabase.cpp:588
void add_rectangular_beam_with_energy(uint32_t N, double J, double q, double m, double E, double Tp, double Tt, Vec3D c, Vec3D dir1, Vec3D dir2, double size1, double size2)
Add a rectangular beam with energies.
Definition: particledatabase.cpp:733
Three dimensional vector.
Definition: vec3d.hpp:58
~ParticleDataBaseCyl()
Destructor.
Definition: particledatabase.cpp:485
~PPlasmaBfieldSuppression()
Destructor.
Definition: particledatabase.hpp:132
void add_2d_beam_with_velocity(uint32_t N, double J, double q, double m, double v, double dvp, double dvt, double x1, double y1, double x2, double y2)
Add a 2d beam with velocities.
Definition: particledatabase.cpp:547
const ParticleStatistics & get_statistics(void) const
Get particle iterator statistics.
Definition: particledatabase.cpp:216
void set_save_trajectories(uint32_t div)
Set trajectory saving.
Definition: particledatabase.cpp:174
void set_mirror(const bool mirror[6])
Set particle mirroring on boundaries.
Definition: particledatabase.cpp:186
Trajectory surface collision callback.
Definition: particledatabase.hpp:86
Particle statistics
bool get_polyint(void) const
Get current interpolation type.
Definition: particledatabase.cpp:126
Particle database class for two dimensions.
Definition: particledatabase.hpp:549
size_t traj_size(uint32_t i) const
Returns number of trajectory points for particle i.
Definition: particledatabase.cpp:240
Scalar field.
Definition: scalarfield.hpp:55
void set_trajectory_handler_callback(TrajectoryHandlerCallback *thand_cb)
Set trajectory handler callback.
Definition: particledatabase.cpp:90
Particle database base class.
Definition: particledatabase.hpp:191
trajectory_interpolation_e
Trajectory interpolation type.
Definition: types.hpp:153
virtual void operator()(ParticleBase *particle, ParticlePBase *x, uint32_t tri, double s, double t)=0
Operator called when particle collides with surface.
void add_particle(double IQ, double q, double m, const ParticleP2D &x)
Add one particle.
Definition: particledatabase.cpp:382
virtual Particle2D & particle(uint32_t i)
Returns a reference to particle i.
Definition: particledatabase.cpp:356
virtual void save(const std::string &filename) const
Saves data to a new file filename.
Definition: particledatabase.cpp:787
Vector field base.
ParticleDataBase()
Constructor.
Definition: particledatabase.cpp:49


Reference manual for Ion Beam Simulator 1.0.5new_solver
Generated by Doxygen 1.8.5 on Tue May 19 2015 09:15:42.