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
gtkplotter.hpp
Go to the documentation of this file.
1 
5 /* Copyright (c) 2005-2013 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 GTKPLOTTER_HPP
44 #define GTKPLOTTER_HPP 1
45 
46 
47 #include <vector>
48 #include <gtk/gtk.h>
49 #include "geometry.hpp"
50 #include "meshscalarfield.hpp"
51 #include "epot_field.hpp"
52 #include "epot_efield.hpp"
53 #include "vectorfield.hpp"
54 #include "particledatabase.hpp"
55 #include "particlediagplot.hpp"
56 #include "fielddiagplot.hpp"
57 #include "gtkwindow.hpp"
58 
59 
66 class GTKPlotter {
67 
68  static bool _gtk_initialized;
69  static bool _opengl;
70 
71  std::vector<GTKWindow *> _windows;
72 
73  const std::vector<double> *_sdata;
74  const Geometry *_geom;
75  const EpotField *_epot;
76  const EpotEfield *_efield;
77  const MeshScalarField *_scharge;
78  const MeshScalarField *_tdens;
79  const VectorField *_bfield;
80  const ParticleDataBase *_pdb;
81 
82 public:
83 
86  GTKPlotter( int *argc, char ***argv );
87 
90  ~GTKPlotter();
91 
96  void run();
97 
100  const std::vector<double> *get_surface_triangle_data( void ) const;
101 
104  const Geometry *get_geometry( void ) const;
105 
108  const EpotField *get_epot( void ) const;
109 
112  const EpotEfield *get_efield( void ) const;
113 
116  const MeshScalarField *get_scharge( void ) const;
117 
120  const MeshScalarField *get_trajdens( void ) const;
121 
124  const VectorField *get_bfield( void ) const;
125 
128  const ParticleDataBase *get_particledatabase( void ) const;
129 
132  void set_surface_triangle_data( const std::vector<double> *data );
133 
136  void set_geometry( const Geometry *geom );
137 
140  void set_epot( const EpotField *epot );
141 
144  void set_efield( const EpotEfield *efield );
145 
148  void set_scharge( const MeshScalarField *scharge );
149 
152  void set_trajdens( const MeshScalarField *tdens );
153 
156  void set_bfield( const VectorField *bfield );
157 
160  void set_particledatabase( const ParticleDataBase *pdb );
161 
164  bool opengl( void ) const;
165 
170  void force_software_renderer( void ) const;
171 
175 
179 
185  trajectory_diagnostic_e diagy );
186 
189  GTKWindow *new_field_plot_window( size_t N, const Vec3D &x1, const Vec3D &x2,
190  const field_diag_type_e diag[2],
191  const field_loc_type_e loc[2] );
192 
195  void delete_window( GTKWindow *window );
196 };
197 
198 
199 #endif
200 
Vector field based on interpolation of electric potential.
Definition: epot_efield.hpp:72
Electric potential field.
Definition: epot_field.hpp:55
GTK Plotter class.
Definition: gtkplotter.hpp:66
void set_geometry(const Geometry *geom)
Set pointer to geometry.
Definition: gtkplotter.cpp:234
GTKWindow * new_field_plot_window(size_t N, const Vec3D &x1, const Vec3D &x2, const field_diag_type_e diag[2], const field_loc_type_e loc[2])
Create new field plot window.
Definition: gtkplotter.cpp:150
const VectorField * get_bfield(void) const
Get pointer to B-field.
Definition: gtkplotter.cpp:216
void set_surface_triangle_data(const std::vector< double > *data)
Set surface data.
Definition: gtkplotter.cpp:228
const ParticleDataBase * get_particledatabase(void) const
Get pointer to particle database.
Definition: gtkplotter.cpp:222
void force_software_renderer(void) const
Force the use of software renderer.
Definition: gtkplotter.cpp:92
void set_trajdens(const MeshScalarField *tdens)
Set pointer to trajectory density field.
Definition: gtkplotter.cpp:258
void set_particledatabase(const ParticleDataBase *pdb)
Set pointer to particle database.
Definition: gtkplotter.cpp:270
bool opengl(void) const
Return if OpenGL has been initialized.
Definition: gtkplotter.cpp:98
const Geometry * get_geometry(void) const
Get pointer to geometry.
Definition: gtkplotter.cpp:186
const EpotField * get_epot(void) const
Get pointer to electric potential.
Definition: gtkplotter.cpp:192
const EpotEfield * get_efield(void) const
Get pointer to E-field.
Definition: gtkplotter.cpp:198
const MeshScalarField * get_scharge(void) const
Get pointer to space charge density field.
Definition: gtkplotter.cpp:204
GTKPlotter(int *argc, char ***argv)
Constructor.
Definition: gtkplotter.cpp:64
GTKWindow * new_geometry_3d_plot_window(void)
Create new 3D geometry plot window.
Definition: gtkplotter.cpp:125
void set_bfield(const VectorField *bfield)
Set pointer to B-field.
Definition: gtkplotter.cpp:264
GTKWindow * new_particle_plot_window(coordinate_axis_e axis, double level, particle_diag_plot_type_e type, trajectory_diagnostic_e diagx, trajectory_diagnostic_e diagy)
Create new particle plot window.
Definition: gtkplotter.cpp:134
void set_scharge(const MeshScalarField *scharge)
Set pointer to space charge density field.
Definition: gtkplotter.cpp:252
const std::vector< double > * get_surface_triangle_data(void) const
Get pointer to surface data.
Definition: gtkplotter.cpp:180
void run()
Run gtkplotter.
Definition: gtkplotter.cpp:104
~GTKPlotter()
Destructor.
Definition: gtkplotter.cpp:86
void set_efield(const EpotEfield *efield)
Set pointer to E-field.
Definition: gtkplotter.cpp:246
GTKWindow * new_geometry_plot_window(void)
Create new 2D geometry plot window.
Definition: gtkplotter.cpp:116
void delete_window(GTKWindow *window)
Delete window.
Definition: gtkplotter.cpp:164
const MeshScalarField * get_trajdens(void) const
Get pointer to trajectory density field.
Definition: gtkplotter.cpp:210
void set_epot(const EpotField *epot)
Set pointer to electric potential.
Definition: gtkplotter.cpp:240
Base class for interactive plotters.
Definition: gtkwindow.hpp:49
Geometry defining class.
Definition: geometry.hpp:180
Scalar field class.
Definition: meshscalarfield.hpp:70
Particle database base class.
Definition: particledatabase.hpp:191
Three dimensional vector.
Definition: vec3d.hpp:58
Vector field.
Definition: vectorfield.hpp:56
Electric potential base electric field.
Electric potential field.
Field diagnostic plotter.
field_loc_type_e
Location type for field diagnostics.
Definition: fielddiagplot.hpp:74
Geometry definition
Window for GTK plots.
Mesh based scalar fields.
Particle databases
Particle diagnostic plot
particle_diag_plot_type_e
Particle diagnostic plot type.
Definition: particlediagplot.hpp:61
field_type_e
Field type.
Definition: types.hpp:94
coordinate_axis_e
Coordinate axis identifier.
Definition: types.hpp:170
trajectory_diagnostic_e
Type of diagnostic for trajectories.
Definition: types.hpp:196
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.