1#ifndef G_COMPONENT_CHARGED_RING_H
2#define G_COMPONENT_CHARGED_RING_H
23 void SetArea(
const double xmin,
const double ymin,
const double zmin,
24 const double xmax,
const double ymax,
const double zmax);
31 void ElectricField(
const double x,
const double y,
const double z,
double& ex,
32 double& ey,
double& ez,
Medium*& m,
int& status)
override;
33 void ElectricField(
const double x,
const double y,
const double z,
double& ex,
34 double& ey,
double& ez,
double& v,
Medium*& m,
35 int& status)
override;
41 double& ymax,
double& zmax)
override;
60 Ring(
double z_,
double r_,
double charge_) {
85 std::array<double, 3>
m_xmin = {{0., 0., 0.}};
86 std::array<double, 3>
m_xmax = {{0., 0., 0.}};
98 bool InArea(
const double x,
const double y,
const double z) {
124 const double r,
const double z,
125 double& eFieldZ,
double& eFieldR);
127 double& eFieldZ,
double& eFieldR)
const;
bool GetBoundingBox(double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) override
Get the bounding box coordinates.
static void GetCoulombBallField(const Ring &ring, const double r, const double z, double &eFieldZ, double &eFieldR)
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.
bool GetVoltageRange(double &vmin, double &vmax) override
Calculate the voltage range [V].
std::array< double, 3 > m_xmax
static const std::array< std::array< double, 3 >, elliptic_size > m_elliptic
void Reset() override
Reset the component.
void GetChargedRingField(const Ring &ring, double r, double z, double &eFieldZ, double &eFieldR) const
double m_dSelfFieldTolerance
std::array< double, 2 > m_centre
centre of cylindrical symmetry (x,y)
void UpdatePeriodicity() override
Verify periodicities.
bool m_hasArea
Did we specify the active area explicitly?
bool InArea(const double x, const double y, const double z)
~ComponentChargedRing()
Destructor.
std::vector< Ring > m_vRings
void UpdateCentre(double x, double y)
Set the axis of symmetry.
double m_dSpacingTolerance
void SetSelfFieldTolerance(const double self_field_tolerance)
function to set the tolerance below which divergences are caught
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).
const std::vector< Ring > & GetRings() const
std::array< double, 3 > m_xmin
Active area.
static const constexpr std::size_t elliptic_size
std::size_t GetNumberOfRings() const
void SetSpacingTolerance(const double spacing_tolerance)
function to set the tolerance below which two rings are considered the same.
ComponentChargedRing()
Constructor.
void SetMedium(Medium *medium)
Set the medium in the active area.
void UnsetArea()
Remove the explicit limits of the active area.
bool AddChargedRing(const double x, const double y, const double z, const double N)
Add a ring of charge N*e at x,y,z.
Medium * GetMedium(const double x, const double y, const double z) override
Get the medium at a given location (x, y, z).
void GetEllipticIntegrals(double x, double &K, double &E) const
Gets elliptic integrals via list.
Medium * m_medium
Medium in the active area.
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).
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.
Ring(double z_, double r_, double charge_)