1#ifndef G_COMPONENT_CONSTANT_H
2#define G_COMPONENT_CONSTANT_H
28 const std::string label);
35 void SetArea(
const double xmin,
const double ymin,
const double zmin,
36 const double xmax,
const double ymax,
const double zmax);
43 void ElectricField(
const double x,
const double y,
const double z,
double& ex,
44 double& ey,
double& ez,
Medium*& m,
int& status)
override;
45 void ElectricField(
const double x,
const double y,
const double z,
double& ex,
46 double& ey,
double& ez,
double& v,
Medium*& m,
47 int& status)
override;
51 double& wx,
double& wy,
double& wz,
52 const std::string& label)
override;
54 const std::string& label)
override;
57 double& ymax,
double& zmax)
override;
61 std::array<double, 3>
m_efield = {{0., 0., 0.}};
75 std::array<double, 3>
m_wfield = {{0., 0., 0.}};
84 std::array<double, 3>
m_xmin = {{0., 0., 0.}};
85 std::array<double, 3>
m_xmax = {{0., 0., 0.}};
94 bool InArea(
const double x,
const double y,
const double z) {
double WeightingPotential(const double x, const double y, const double z, const std::string &label) override
Calculate the weighting potential at a given point.
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
Calculate the drift field at given point.
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 UpdatePeriodicity() override
Verify periodicities.
void SetElectricField(const double ex, const double ey, const double ez)
Set the components of the electric field [V / cm].
bool m_hasWeightingPotential
void WeightingField(const double x, const double y, const double z, double &wx, double &wy, double &wz, const std::string &label) override
Calculate the weighting field at a given point and for a given electrode.
std::array< double, 3 > m_efield
void ElectricField(const double x, const double y, const double z, double &ex, double &ey, double &ez, double &v, Medium *&m, int &status) override
Calculate the drift field [V/cm] and potential [V] at (x, y, z).
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)
Set the limits of the active area explicitly (instead of using a Geometry object).
bool GetBoundingBox(double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) override
Get the bounding box coordinates.
std::array< double, 3 > m_wfield
std::array< double, 3 > m_xmin
std::array< double, 3 > m_xmax
void SetPotential(const double x, const double y, const double z, const double v=0.)
Specify the potential at a given point.
void Reset() override
Reset the component.
void SetWeightingPotential(const double x, const double y, const double z, const double v=0.)
Specify the weighting potential at a given point.
bool InArea(const double x, const double y, const double z)
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.
virtual void ElectricField(const double x, const double y, const double z, double &ex, double &ey, double &ez, Medium *&m, int &status)=0
Calculate the drift field at given point.
Component()=delete
Default constructor.
Abstract base class for components.