00001
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 #ifndef FIELDDIAGPLOT_HPP
00044 #define FIELDDIAGPLOT_HPP 1
00045
00046
00047 #include "frame.hpp"
00048 #include "xygraph.hpp"
00049 #include "vec3d.hpp"
00050 #include "geometry.hpp"
00051 #include "scalarfield.hpp"
00052 #include "efield.hpp"
00053 #include "vectorfield.hpp"
00054
00055
00056 enum field_diag_type_e {
00057 FIELDD_DIAG_NONE = 0,
00058 FIELDD_DIAG_EPOT,
00059 FIELDD_DIAG_EFIELD,
00060 FIELDD_DIAG_EFIELD_X,
00061 FIELDD_DIAG_EFIELD_Y,
00062 FIELDD_DIAG_EFIELD_Z,
00063 FIELDD_DIAG_SCHARGE,
00064 FIELDD_DIAG_BFIELD,
00065 FIELDD_DIAG_BFIELD_X,
00066 FIELDD_DIAG_BFIELD_Y,
00067 FIELDD_DIAG_BFIELD_Z
00068 };
00069
00070
00071 enum field_loc_type_e {
00072 FIELDD_LOC_NONE = 0,
00073 FIELDD_LOC_X,
00074 FIELDD_LOC_Y,
00075 FIELDD_LOC_Z,
00076 FIELDD_LOC_DIST
00077 };
00078
00079
00084 class FieldDiagPlot {
00085
00086 Frame *_frame;
00087
00088 const Geometry *_geom;
00089 const ScalarField *_epot;
00090 const Efield *_efield;
00091 const ScalarField *_scharge;
00092 const VectorField *_bfield;
00093
00094 size_t _N;
00095 Vec3D _x1;
00096 Vec3D _x2;
00097
00098 field_diag_type_e _diag[2];
00099 field_loc_type_e _loc[2];
00100
00101 XYGraph *_graph[2];
00102
00103
00104 void build_data( std::vector<double> coord[4],
00105 std::vector<double> fielddata[2] ) const;
00106 std::string diagnostic_label( field_diag_type_e diag ) const;
00107
00108 public:
00109
00112 FieldDiagPlot( Frame *frame, const Geometry *geom );
00113
00116 ~FieldDiagPlot();
00117
00120 void set_epot( const ScalarField *epot ) {
00121 _epot = epot;
00122 }
00123
00126 void set_efield( const Efield *efield ) {
00127 _efield = efield;
00128 }
00129
00132 void set_scharge( const ScalarField *scharge ) {
00133 _scharge = scharge;
00134 }
00135
00138 void set_bfield( const VectorField *bfield ) {
00139 _bfield = bfield;
00140 }
00141
00148 void set_coordinates( size_t N, const Vec3D &x1, const Vec3D &x2 ) {
00149 _N = N;
00150 _x1 = x1;
00151 _x2 = x2;
00152 }
00153
00156 const Vec3D &start( void ) {
00157 return( _x1 );
00158 }
00159
00162 const Vec3D &end( void ) {
00163 return( _x2 );
00164 }
00165
00168 const size_t &N( void ) {
00169 return( _N );
00170 }
00171
00179 void set_diagnostic( const field_diag_type_e diag[2], const field_loc_type_e loc[2] ) {
00180 _diag[0] = diag[0];
00181 _diag[1] = diag[1];
00182 _loc[0] = loc[0];
00183 _loc[1] = loc[1];
00184 }
00185
00188 const field_diag_type_e &get_diagnostic_type( int i ) {
00189 return( _diag[i] );
00190 }
00191
00194 const field_loc_type_e &get_location_type( int i ) {
00195 return( _loc[i] );
00196 }
00197
00200 void export_data( const std::string &filename ) const;
00201
00204 void build_plot( void );
00205 };
00206
00207
00208
00209 #endif
00210
00211
00212
00213
00214