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
geomplot.hpp
Go to the documentation of this file.
1 
5 /* Copyright (c) 2005-2012 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 
130  void set_epot( const EpotField *epot );
131 
134  void set_eqlines_manual( const std::vector<double> &pot );
135 
138  std::vector<double> get_eqlines_manual( void ) const {
139  return( _eqlines_manual );
140  }
141 
149  void set_eqlines_auto( uint32_t N );
150 
153  uint32_t get_eqlines_auto( void ) const {
154  return( _eqlines_auto );
155  }
156 
159  void set_bfield( const VectorField *bfield );
160 
163  const VectorField *get_bfield( void ) const {
164  return( _bfield );
165  }
166 
169  void set_efield( const VectorField *efield );
170 
173  const VectorField *get_efield( void ) const {
174  return( _efield );
175  }
176 
179  void set_trajdens( const MeshScalarField *tdens );
180 
183  const MeshScalarField *get_trajdens( void ) const {
184  return( _tdens );
185  }
186 
189  void set_scharge( const MeshScalarField *scharge );
190 
193  const MeshScalarField *get_scharge( void ) const {
194  return( _scharge );
195  }
196 
199  void set_fieldgraph_plot( field_type_e fieldplot );
200 
203  const FieldGraph *fieldgraph( void ) const {
204  return( _fieldgraph );
205  }
206 
210  return( _fieldgraph );
211  }
212 
215  void enable_colormap_legend( bool enable ) {
216  _frame->enable_colormap_legend( enable );
217  }
218 
222  set_particledatabase( pdb );
223  }
224 
227  void set_particledatabase( const ParticleDataBase *pdb );
228 
236  void set_particle_div( uint32_t particle_div, uint32_t particle_offset = 0 );
237 
240  uint32_t get_particle_div( void ) const {
241  return( _particle_div );
242  }
243 
246  uint32_t get_particle_offset( void ) const {
247  return( _particle_offset );
248  }
249 
256  void set_qm_discretation( bool enable );
257 
260  bool get_qm_discretation( void ) const {
261  return( _qm_discretation );
262  }
263 
269  void set_mesh( bool enable );
270 
273  bool get_mesh( void ) const {
274  return( _mesh );
275  }
276 
284  void set_view( view_e view, int level = -1 );
285 
292  void set_view_si( view_e view, double level );
293 
296  view_e get_view( void ) const {
297  return( _view );
298  }
299 
302  int get_level( void ) const {
303  return( _level );
304  }
305 
308  double get_level_si( void ) const {
309  return( _geom.origo(_vb[2])+_level*_geom.h() );
310  }
311 
314  int vb( int i ) const {
315  return( _vb[i] );
316  }
317 
320  void get_vb( int vb[3] ) const {
321  vb[0] = _vb[0];
322  vb[1] = _vb[1];
323  vb[2] = _vb[2];
324  }
325 
326 };
327 
328 
329 #endif
330 
Graph for plotting solids
Geometry definition
void set_particledatabase(const ParticleDataBase *pdb)
Set particle database used for particle plotting.
Definition: geomplot.cpp:277
void set_bfield(const VectorField *bfield)
Set magnetic field.
Definition: geomplot.cpp:185
void set_view(view_e view, int level=-1)
Set view.
Definition: geomplot.cpp:333
Vector field.
Definition: vectorfield.hpp:56
uint32_t get_particle_offset(void) const
Get particle offset.
Definition: geomplot.hpp:246
A 2D cut view of the geometry solids.
Definition: solidgraph.hpp:60
Frame for plots
void set_trajdens(const MeshScalarField *tdens)
Set trajectory density field.
Definition: geomplot.cpp:165
Electric potential field.
view_e
View types.
Definition: graph3d.hpp:54
int vb(int i) const
Get component i of view base vector.
Definition: geomplot.hpp:314
void get_vb(int vb[3]) const
Get the view base vector.
Definition: geomplot.hpp:320
view_e get_view(void) const
Get view.
Definition: geomplot.hpp:296
void enable_colormap_legend(bool enable)
Set colormap legend enable/disable.
Definition: frame.cpp:720
Vec3D origo(void) const
Returns origo vector of geometry.
Definition: mesh.hpp:128
Graph for particle plots
Particle databases
Base types.
Equipotential line plot.
Definition: eqpotgraph.hpp:58
void disable_cache(void)
Disable plotting caches from use.
Definition: geomplot.cpp:93
double get_level_si(void) const
Get level of view in SI units.
Definition: geomplot.hpp:308
Scalar field class.
Definition: meshscalarfield.hpp:70
const VectorField * get_efield(void) const
Get electric field.
Definition: geomplot.hpp:173
Class for drawing fields with colormap.
Definition: fieldgraph.hpp:59
const MeshScalarField * get_scharge(void) const
Get space charge density field.
Definition: geomplot.hpp:193
bool get_mesh(void) const
Get mesh plotting.
Definition: geomplot.hpp:273
Geometry defining class.
Definition: geometry.hpp:179
bool get_qm_discretation(void) const
Get q/m particle discretation.
Definition: geomplot.hpp:260
const VectorField * get_bfield(void) const
Get magnetic field.
Definition: geomplot.hpp:163
~GeomPlot()
Destructor for geometry plotter.
Definition: geomplot.cpp:78
int get_level(void) const
Get level of view in mesh squares.
Definition: geomplot.hpp:302
void build_plot(void)
Rebuild plot.
Definition: geomplot.cpp:466
double h(void) const
Returns mesh cell size.
Definition: mesh.hpp:146
void set_fieldgraph_plot(field_type_e fieldplot)
Set field graph plotting type.
Definition: geomplot.cpp:213
void set_eqlines_auto(uint32_t N)
Set the number of automatic equipotential lines.
Definition: geomplot.cpp:157
void set_efield(const VectorField *efield)
Set electric field.
Definition: geomplot.cpp:199
Class for drawing particle trajectories.
Definition: particlegraph.hpp:68
void set_view_si(view_e view, double level)
Set view in SI units.
Definition: geomplot.cpp:444
uint32_t get_eqlines_auto(void) const
Get the number of automatic equipotential lines.
Definition: geomplot.hpp:153
Graph of rectangular mesh for geometry plots
const MeshScalarField * get_trajdens(void) const
Get trajectory density field.
Definition: geomplot.hpp:183
field_type_e
Field type.
Definition: types.hpp:94
void set_mesh(bool enable)
Set mesh plotting.
Definition: geomplot.cpp:315
Electric potential field.
Definition: epot_field.hpp:55
void set_eqlines_manual(const std::vector< double > &pot)
Set a vector of manual equipotential lines.
Definition: geomplot.cpp:149
Graph for plotting fields
FieldGraph * fieldgraph(void)
Get field graph object.
Definition: geomplot.hpp:209
uint32_t get_particle_div(void) const
Get particle divisor.
Definition: geomplot.hpp:240
std::vector< double > get_eqlines_manual(void) const
Get a vector of manual equipotential lines.
Definition: geomplot.hpp:138
General purpose plotter frame for cairographics surfaces.
Definition: frame.hpp:107
GeomPlot(Frame &frame, const Geometry &geom)
Constructor for new geometry plot.
Definition: geomplot.cpp:47
void enable_colormap_legend(bool enable)
Set colormap legend enable/disable.
Definition: geomplot.hpp:215
const FieldGraph * fieldgraph(void) const
Get field graph object.
Definition: geomplot.hpp:203
Class for drawing mesh.
Definition: meshgraph.hpp:55
void set_particle_div(uint32_t particle_div, uint32_t particle_offset=0)
Set particle divisor and offset.
Definition: geomplot.cpp:297
void set_qm_discretation(bool enable)
Set q/m particle discretation.
Definition: geomplot.cpp:306
void set_scharge(const MeshScalarField *scharge)
Set space charge density field.
Definition: geomplot.cpp:175
Graph for plotting equipotential lines
void set_particle_database(const ParticleDataBase *pdb)
Set particle database used for particle plotting.
Definition: geomplot.hpp:221
Geometry plotter class.
Definition: geomplot.hpp:70
Particle database base class.
Definition: particledatabase.hpp:191
Mesh based scalar fields.
Vector field base.


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