Navigation

Main Page
Download
Support
Installation
Tutorial
Examples
Reference Manual
   Version 1.0.6dev
      Class Index
      File List
   Version 1.0.6
   Version 1.0.5new_solver
   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
geomplot.hpp
Go to the documentation of this file.
1 
5 /* Copyright (c) 2005-2012,2017 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 GEOMPLOT_HPP
44 #define GEOMPLOT_HPP 1
45 
46 
47 #include "types.hpp"
48 #include "frame.hpp"
49 #include "geometry.hpp"
50 #include "meshscalarfield.hpp"
51 #include "vectorfield.hpp"
52 #include "epot_field.hpp"
53 #include "particledatabase.hpp"
54 #include "solidgraph.hpp"
55 #include "eqpotgraph.hpp"
56 #include "particlegraph.hpp"
57 #include "meshgraph.hpp"
58 #include "fieldgraph.hpp"
59 
60 
61 
62 
70 class GeomPlot {
71 
72  Frame *_frame;
73 
74  const Geometry &_geom;
75  const EpotField *_epot;
76  const MeshScalarField *_scharge;
77  const MeshScalarField *_tdens;
78  const VectorField *_bfield;
79  const VectorField *_efield;
80  const ParticleDataBase *_pdb;
81 
82  FieldGraph *_fieldgraph;
83 
84  SolidGraph *_solidgraph;
85  EqPotGraph *_eqpotgraph;
86  ParticleGraph *_particlegraph;
87  MeshGraph *_meshgraph;
88 
89  view_e _view;
90  int _level;
91  int _vb[3];
92 
93  uint32_t _eqlines_auto;
94  std::vector<double> _eqlines_manual;
95  uint32_t _particle_div;
96  uint32_t _particle_offset;
97  bool _scharge_field;
98  bool _qm_discretation;
99  bool _mesh;
100 
101  bool _cache;
102 
103  void reset_graphs( void );
104 
105 public:
106 
114  GeomPlot( Frame &frame, const Geometry &geom );
115 
118  ~GeomPlot();
119 
122  void build_plot( void );
123 
128  void disable_cache( void );
129 
132  void set_epot( const EpotField *epot );
133 
136  void set_eqlines_manual( const std::vector<double> &pot );
137 
140  std::vector<double> get_eqlines_manual( void ) const {
141  return( _eqlines_manual );
142  }
143 
151  void set_eqlines_auto( uint32_t N );
152 
155  uint32_t get_eqlines_auto( void ) const {
156  return( _eqlines_auto );
157  }
158 
161  void set_bfield( const VectorField *bfield );
162 
165  const VectorField *get_bfield( void ) const {
166  return( _bfield );
167  }
168 
171  void set_efield( const VectorField *efield );
172 
175  const VectorField *get_efield( void ) const {
176  return( _efield );
177  }
178 
181  void set_trajdens( const MeshScalarField *tdens );
182 
185  const MeshScalarField *get_trajdens( void ) const {
186  return( _tdens );
187  }
188 
191  void set_scharge( const MeshScalarField *scharge );
192 
195  const MeshScalarField *get_scharge( void ) const {
196  return( _scharge );
197  }
198 
201  void set_fieldgraph_plot( field_type_e fieldplot );
202 
205  const FieldGraph *fieldgraph( void ) const {
206  return( _fieldgraph );
207  }
208 
212  return( _fieldgraph );
213  }
214 
217  void enable_colormap_legend( bool enable ) {
218  _frame->enable_colormap_legend( enable );
219  }
220 
224  set_particledatabase( pdb );
225  }
226 
229  void set_particledatabase( const ParticleDataBase *pdb );
230 
240  void set_particle_div( uint32_t particle_div, uint32_t particle_offset = 0 );
241 
244  uint32_t get_particle_div( void ) const {
245  return( _particle_div );
246  }
247 
250  uint32_t get_particle_offset( void ) const {
251  return( _particle_offset );
252  }
253 
260  void set_qm_discretation( bool enable );
261 
264  bool get_qm_discretation( void ) const {
265  return( _qm_discretation );
266  }
267 
273  void set_mesh( bool enable );
274 
277  bool get_mesh( void ) const {
278  return( _mesh );
279  }
280 
288  void set_view( view_e view, int level = -1 );
289 
296  void set_view_si( view_e view, double level );
297 
300  view_e get_view( void ) const {
301  return( _view );
302  }
303 
306  int get_level( void ) const {
307  return( _level );
308  }
309 
312  double get_level_si( void ) const {
313  return( _geom.origo(_vb[2])+_level*_geom.h() );
314  }
315 
318  int vb( int i ) const {
319  return( _vb[i] );
320  }
321 
324  void get_vb( int vb[3] ) const {
325  vb[0] = _vb[0];
326  vb[1] = _vb[1];
327  vb[2] = _vb[2];
328  }
329 
332  Frame &frame( void ) {
333  return( *_frame );
334  }
335 };
336 
337 
338 #endif
339 
Electric potential field.
Definition: epot_field.hpp:55
Equipotential line plot.
Definition: eqpotgraph.hpp:58
Class for drawing fields with colormap.
Definition: fieldgraph.hpp:59
General purpose plotter frame for cairographics surfaces.
Definition: frame.hpp:107
void enable_colormap_legend(bool enable)
Set colormap legend enable/disable.
Definition: frame.cpp:720
Geometry plotter class.
Definition: geomplot.hpp:70
const MeshScalarField * get_trajdens(void) const
Get trajectory density field.
Definition: geomplot.hpp:185
uint32_t get_particle_offset(void) const
Get particle offset.
Definition: geomplot.hpp:250
~GeomPlot()
Destructor for geometry plotter.
Definition: geomplot.cpp:78
void set_epot(const EpotField *epot)
Set electric potential.
Definition: geomplot.cpp:121
void enable_colormap_legend(bool enable)
Set colormap legend enable/disable.
Definition: geomplot.hpp:217
const MeshScalarField * get_scharge(void) const
Get space charge density field.
Definition: geomplot.hpp:195
void disable_cache(void)
Disable plotting caches from use.
Definition: geomplot.cpp:93
void set_mesh(bool enable)
Set mesh plotting.
Definition: geomplot.cpp:315
Frame & frame(void)
Get a reference to the frame.
Definition: geomplot.hpp:332
const VectorField * get_bfield(void) const
Get magnetic field.
Definition: geomplot.hpp:165
std::vector< double > get_eqlines_manual(void) const
Get a vector of manual equipotential lines.
Definition: geomplot.hpp:140
void set_view_si(view_e view, double level)
Set view in SI units.
Definition: geomplot.cpp:444
const VectorField * get_efield(void) const
Get electric field.
Definition: geomplot.hpp:175
uint32_t get_particle_div(void) const
Get particle divisor.
Definition: geomplot.hpp:244
double get_level_si(void) const
Get level of view in SI units.
Definition: geomplot.hpp:312
void set_particle_database(const ParticleDataBase *pdb)
Set particle database used for particle plotting.
Definition: geomplot.hpp:223
uint32_t get_eqlines_auto(void) const
Get the number of automatic equipotential lines.
Definition: geomplot.hpp:155
void get_vb(int vb[3]) const
Get the view base vector.
Definition: geomplot.hpp:324
void set_bfield(const VectorField *bfield)
Set magnetic field.
Definition: geomplot.cpp:185
void set_efield(const VectorField *efield)
Set electric field.
Definition: geomplot.cpp:199
void set_view(view_e view, int level=-1)
Set view.
Definition: geomplot.cpp:333
void set_eqlines_auto(uint32_t N)
Set the number of automatic equipotential lines.
Definition: geomplot.cpp:157
int get_level(void) const
Get level of view in mesh squares.
Definition: geomplot.hpp:306
void set_fieldgraph_plot(field_type_e fieldplot)
Set field graph plotting type.
Definition: geomplot.cpp:213
void set_trajdens(const MeshScalarField *tdens)
Set trajectory density field.
Definition: geomplot.cpp:165
void set_scharge(const MeshScalarField *scharge)
Set space charge density field.
Definition: geomplot.cpp:175
void set_particledatabase(const ParticleDataBase *pdb)
Set particle database used for particle plotting.
Definition: geomplot.cpp:277
bool get_qm_discretation(void) const
Get q/m particle discretation.
Definition: geomplot.hpp:264
bool get_mesh(void) const
Get mesh plotting.
Definition: geomplot.hpp:277
int vb(int i) const
Get component i of view base vector.
Definition: geomplot.hpp:318
void build_plot(void)
Rebuild plot.
Definition: geomplot.cpp:466
void set_particle_div(uint32_t particle_div, uint32_t particle_offset=0)
Set particle divisor and offset.
Definition: geomplot.cpp:297
GeomPlot(Frame &frame, const Geometry &geom)
Constructor for new geometry plot.
Definition: geomplot.cpp:47
FieldGraph * fieldgraph(void)
Get field graph object.
Definition: geomplot.hpp:211
void set_qm_discretation(bool enable)
Set q/m particle discretation.
Definition: geomplot.cpp:306
view_e get_view(void) const
Get view.
Definition: geomplot.hpp:300
const FieldGraph * fieldgraph(void) const
Get field graph object.
Definition: geomplot.hpp:205
void set_eqlines_manual(const std::vector< double > &pot)
Set a vector of manual equipotential lines.
Definition: geomplot.cpp:149
Geometry defining class.
Definition: geometry.hpp:180
Class for drawing mesh.
Definition: meshgraph.hpp:55
Scalar field class.
Definition: meshscalarfield.hpp:70
double h(void) const
Returns mesh cell size.
Definition: mesh.hpp:146
Vec3D origo(void) const
Returns origo vector of geometry.
Definition: mesh.hpp:128
Particle database base class.
Definition: particledatabase.hpp:191
Class for drawing particle trajectories.
Definition: particlegraph.hpp:68
A 2D cut view of the geometry solids.
Definition: solidgraph.hpp:60
Vector field.
Definition: vectorfield.hpp:56
Electric potential field.
Graph for plotting equipotential lines
Graph for plotting fields
Frame for plots
Geometry definition
view_e
View types.
Definition: graph3d.hpp:54
Graph of rectangular mesh for geometry plots
Mesh based scalar fields.
Particle databases
Graph for particle plots
Graph for plotting solids
Base types.
field_type_e
Field type.
Definition: types.hpp:94
Vector field base.


Reference manual for Ion Beam Simulator 1.0.6dev
Generated by Doxygen 1.9.1 on Thu Sep 11 2025 09:37:24.