1#ifndef G_COMPONENT_CONSTANT_H
2#define G_COMPONENT_CONSTANT_H
21 Medium*
GetMedium(
const double x,
const double y,
const double z)
override;
22 void ElectricField(
const double x,
const double y,
const double z,
double& ex,
23 double& ey,
double& ez,
Medium*& m,
int& status)
override;
24 void ElectricField(
const double x,
const double y,
const double z,
double& ex,
25 double& ey,
double& ez,
double& v,
Medium*& m,
26 int& status)
override;
28 void WeightingField(
const double x,
const double y,
const double z,
29 double& wx,
double& wy,
double& wz,
30 const std::string& label)
override;
32 const std::string& label)
override;
35 double& xmax,
double& ymax,
double& zmax)
override;
40 void SetPotential(
const double x,
const double y,
const double z,
45 const std::string label);
52 void SetArea(
const double xmin,
const double ymin,
const double zmin,
53 const double xmax,
const double ymax,
const double zmax);
61 std::array<double, 3> m_efield = {{0., 0., 0.}};
64 bool m_hasPotential =
false;
66 double m_x0 = 0., m_y0 = 0., m_z0 = 0.;
71 bool m_hasWeightingField =
false;
73 std::string m_label =
"";
75 std::array<double, 3> m_wfield = {{0., 0., 0.}};
77 bool m_hasWeightingPotential =
false;
79 double m_wx0 = 0., m_wy0 = 0., m_wz0 = 0.;
84 std::array<double, 3> m_xmin = {{0., 0., 0.}};
85 std::array<double, 3> m_xmax = {{0., 0., 0.}};
87 bool m_hasArea =
false;
89 Medium* m_medium =
nullptr;
91 void Reset()
override;
92 void UpdatePeriodicity()
override;
94 bool InArea(
const double x,
const double y,
const double z) {
95 if (x < m_xmin[0] || x > m_xmax[0] ||
96 y < m_xmin[1] || y > m_xmax[1] ||
97 z < m_xmin[2] || z > m_xmax[2]) {
Component with constant electric field.
double WeightingPotential(const double x, const double y, const double z, const std::string &label) override
bool GetVoltageRange(double &vmin, double &vmax) override
Calculate the voltage range [V].
void ElectricField(const double x, const double y, const double z, double &ex, double &ey, double &ez, Medium *&m, int &status) override
Medium * GetMedium(const double x, const double y, const double z) override
Get the medium at a given location (x, y, z).
~ComponentConstant()
Destructor.
void SetElectricField(const double ex, const double ey, const double ez)
Set the components of the electric field [V / cm].
void WeightingField(const double x, const double y, const double z, double &wx, double &wy, double &wz, const std::string &label) override
void UnsetArea()
Remove the explicit limits of the active area.
void SetArea(const double xmin, const double ymin, const double zmin, const double xmax, const double ymax, const double zmax)
bool GetBoundingBox(double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) override
Get the bounding box coordinates.
void SetPotential(const double x, const double y, const double z, const double v=0.)
Specify the potential at a given point.
void SetWeightingPotential(const double x, const double y, const double z, const double v=0.)
Specify the weighting potential at a given point.
void SetWeightingField(const double wx, const double wy, const double wz, const std::string label)
Set the components of the weighting field [1 / cm].
void SetMedium(Medium *medium)
Set the medium in the active area.
ComponentConstant()
Constructor.
Abstract base class for components.
Abstract base class for media.