62 void Plot(
const std::string& option =
"v",
63 const std::string& drawopt =
"arr");
70 void PlotProfile(
const double x0,
const double y0,
const double z0,
71 const double x1,
const double y1,
const double z1,
72 const std::string& option =
"v",
73 const bool normalised =
true);
80 const std::string& option);
88 const std::string& drawopt,
const double t = 0.);
98 const double y0,
const double z0,
99 const double x1,
const double y1,
101 const std::string& option =
"v",
102 const bool normalised =
true);
106 const bool samplePotential =
true) {
108 m_samplePotential = samplePotential;
122 const std::vector<double>& y0,
123 const std::vector<double>& z0,
124 const bool electron =
true,
const bool axis =
true,
125 const short col = kOrange - 3);
128 const double x1,
const double y1,
const double z1,
129 std::vector<double>& xf, std::vector<double>& yf,
130 std::vector<double>& zf,
131 const unsigned int nPoints = 20)
const;
134 const double x1,
const double y1,
const double z1,
135 std::vector<double>& xf, std::vector<double>& yf,
136 std::vector<double>& zf,
137 const double interval = 10.)
const;
140 enum class Parameter {
152 bool m_useAutoRange =
true;
153 bool m_samplePotential =
true;
154 bool m_useStatus =
false;
158 Sensor* m_sensor =
nullptr;
159 Component* m_component =
nullptr;
162 double m_vmin = 0., m_vmax = 100.;
163 double m_emin = 0., m_emax = 10000.;
164 double m_wmin = 0., m_wmax = 100.;
165 double m_bmin = 0., m_bmax = 10.;
168 unsigned int m_nContours = 20;
170 unsigned int m_nSamples1d = 1000;
171 unsigned int m_nSamples2dX = 200;
172 unsigned int m_nSamples2dY = 200;
174 bool SetPlotLimits();
175 void Draw2d(
const std::string& option,
const bool contour,
176 const bool wfield,
const std::string& electrode,
177 const std::string& drawopt,
const double t = 0.);
178 void DrawProfile(
const double x0,
const double y0,
const double z0,
179 const double x1,
const double y1,
const double z1,
180 const std::string& option,
const bool wfield,
181 const std::string& electrode,
const bool normalised);
182 Parameter GetPar(
const std::string& option, std::string& title,
184 double Efield(
const double x,
const double y,
const double z,
185 const Parameter par)
const;
186 double Wfield(
const double x,
const double y,
const double z,
187 const Parameter par,
const std::string& electrode,
const double t = 0.)
const;
188 double Bfield(
const double x,
const double y,
const double z,
189 const Parameter par)
const;
Abstract base class for components.
ViewBase()=delete
Default constructor.
void SetMagneticFieldRange(const double bmin, const double bmax)
Set the plot limits for the magnetic field.
void PlotProfileWeightingField(const std::string &label, const double x0, const double y0, const double z0, const double x1, const double y1, const double z1, const std::string &option="v", const bool normalised=true)
void SetElectricFieldRange(const double emin, const double emax)
Set the plot limits for the electric field.
void SetNumberOfSamples2d(const unsigned int nx, const unsigned int ny)
Set the number of points used for drawing 2D functions.
bool FixedFluxIntervals(const double x0, const double y0, const double z0, const double x1, const double y1, const double z1, std::vector< double > &xf, std::vector< double > &yf, std::vector< double > &zf, const double interval=10.) const
Generate points along a line, spaced by a given flux interval.
void SetComponent(Component *c)
Set the component for which to plot the field.
void SetNumberOfSamples1d(const unsigned int n)
Set the number of points used for drawing 1D functions.
void PlotFieldLines(const std::vector< double > &x0, const std::vector< double > &y0, const std::vector< double > &z0, const bool electron=true, const bool axis=true, const short col=kOrange - 3)
Draw electric field lines from a set of starting points.
void PlotWeightingField(const std::string &label, const std::string &option, const std::string &drawopt, const double t=0.)
void SetVoltageRange(const double vmin, const double vmax)
Set the plot limits for the potential.
void PlotProfile(const double x0, const double y0, const double z0, const double x1, const double y1, const double z1, const std::string &option="v", const bool normalised=true)
bool EqualFluxIntervals(const double x0, const double y0, const double z0, const double x1, const double y1, const double z1, std::vector< double > &xf, std::vector< double > &yf, std::vector< double > &zf, const unsigned int nPoints=20) const
Generates point along a line, spaced by equal flux intervals.
void PlotContour(const std::string &option="v")
void Plot(const std::string &option="v", const std::string &drawopt="arr")
void SetNumberOfContours(const unsigned int n)
Set the number of contour levels.
void SetWeightingFieldRange(const double wmin, const double wmax)
Set the plot limits for the weighting field.
void SetSensor(Sensor *s)
Set the sensor for which to plot the field.
void EnableAutoRange(const bool on=true, const bool samplePotential=true)
~ViewField()=default
Destructor.
void PlotContourWeightingField(const std::string &label, const std::string &option)
void AcknowledgeStatus(const bool on, const double v0=0.)