Garfield 0.3
Toolkit for the detailed simulation of particle detectors based on ionization measurement in gases and semiconductors
Loading...
Searching...
No Matches
Garfield::ComponentNeBem2d Class Reference

Two-dimensional implementation of the nearly exact Boundary Element Method. More...

#include <ComponentNeBem2d.hh>

Inheritance diagram for Garfield::ComponentNeBem2d:
Garfield::Component

Classes

struct  Element
struct  Region
struct  Segment
struct  SpaceCharge
struct  Wire

Public Member Functions

 ComponentNeBem2d ()
 Constructor.
 ~ComponentNeBem2d ()
 Destructor.
void SetMedium (Medium *medium)
 Set the "background" medium.
bool AddSegment (const double x0, const double y0, const double x1, const double y1, const double v, const int ndiv=-1)
 Add a conducting straight-line segment.
bool AddWire (const double x, const double y, const double d, const double v, const int ntrap=5)
 Add a wire.
bool AddRegion (const std::vector< double > &xp, const std::vector< double > &yp, Medium *medium, const unsigned int bctype=4, const double v=0., const int ndiv=-1)
 Add a region bounded by a polygon.
void AddChargeDistribution (const double x, const double y, const double a, const double b, const double rho)
void SetRangeZ (const double zmin, const double zmax)
 Set the extent of the drift region along z.
bool Initialise ()
 Discretise the geometry and compute the solution.
void SetNumberOfDivisions (const unsigned int ndiv)
 Set the default number of elements per segment.
void SetNumberOfCollocationPoints (const unsigned int ncoll)
void EnableAutoResizing (const bool on=true)
void EnableRandomCollocation (const bool on=true)
void SetMaxNumberOfIterations (const unsigned int niter)
unsigned int GetNumberOfRegions () const
 Return the number of regions.
bool GetRegion (const unsigned int i, std::vector< double > &xv, std::vector< double > &yv, Medium *&medium, unsigned int &bctype, double &v)
 Return the properties of a given region.
unsigned int GetNumberOfSegments () const
 Return the number of conducting straight-line segments.
bool GetSegment (const unsigned int i, double &x0, double &y0, double &x1, double &x2, double &v) const
 Return the coordinates and voltage of a given straight-line segment.
unsigned int GetNumberOfWires () const
 Return the number of wires.
bool GetWire (const unsigned int i, double &x, double &y, double &d, double &v, double &q) const
 Return the coordinates, diameter, potential and charge of a given wire.
size_t GetNumberOfElements () const override
 Return the number of boundary elements.
bool GetElement (const unsigned int i, double &x0, double &y0, double &x1, double &y1, double &q) const
 Return the coordinates and charge of a given boundary element.
MediumGetMedium (const double x, const double y, const double z) override
 Get the medium at a given location (x, y, z).
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.
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).
bool GetVoltageRange (double &vmin, double &vmax) override
 Calculate the voltage range [V].
bool GetBoundingBox (double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) override
 Get the bounding box coordinates.
bool GetElementaryCell (double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) override
 Get the coordinates of the elementary cell.
bool CrossedWire (const double x0, const double y0, const double z0, const double x1, const double y1, const double z1, double &xc, double &yc, double &zc, const bool centre, double &rc) override
 Determine whether the line between two points crosses a wire.
bool InTrapRadius (const double q0, const double x0, const double y0, const double z0, double &xw, double &yx, double &rw) override
 Determine whether a particle is inside the trap radius of a wire.
std::array< double, 3 > ElectricField (const double x, const double y, const double z)
 Calculate the drift field [V/cm] at (x, y, z).
Public Member Functions inherited from Garfield::Component
 Component ()=delete
 Default constructor.
 Component (const std::string &name)
 Constructor.
virtual ~Component ()=default
 Destructor.
virtual void SetGeometry (Geometry *geo)
 Define the geometry.
virtual void Clear ()
 Reset.
std::array< double, 3 > ElectricField (const double x, const double y, const double z)
 Calculate the drift field [V/cm] at (x, y, z).
virtual double ElectricPotential (const double x, const double y, const double z)
 Calculate the (drift) electrostatic potential [V] at (x, y, z).
virtual void WeightingField (const double x, const double y, const double z, double &wx, double &wy, double &wz, const std::string &label)
 Calculate the weighting field at a given point and for a given electrode.
virtual double WeightingPotential (const double x, const double y, const double z, const std::string &label)
 Calculate the weighting potential at a given point.
virtual const std::vector< double > & DelayedSignalTimes (const std::string &)
 Return the time steps at which the delayed weighting potential/field are stored/evaluated.
virtual void DelayedWeightingField (const double x, const double y, const double z, const double t, double &wx, double &wy, double &wz, const std::string &label)
 Calculate the delayed weighting field at a given point and time and for a given electrode.
virtual double DelayedWeightingPotential (const double x, const double y, const double z, const double t, const std::string &label)
 Calculate the delayed weighting potential at a given point and time and for a given electrode.
virtual void DelayedWeightingPotentials (const double x, const double y, const double z, const std::string &label, std::vector< double > &dwp)
 Calculate the delayed weighting potentials at a given point and for a given electrode, for a set of pre-defined times.
virtual void MagneticField (const double x, const double y, const double z, double &bx, double &by, double &bz, int &status)
 Calculate the magnetic field at a given point.
void SetMagneticField (const double bx, const double by, const double bz)
 Set a constant magnetic field.
virtual bool IsReady ()
 Ready for use?
virtual bool Is3d ()
 Does the component have a 3D field (map)?
double CellSizeX ()
double CellSizeY ()
double CellSizeZ ()
virtual bool GetElementNodes (const size_t, std::vector< size_t > &) const
 Get the indices of the nodes constituting a given element.
virtual bool GetElementRegion (const size_t, size_t &, bool &) const
 Get the region/material of a mesh element and a flag whether it is associated to an active medium.
virtual size_t GetNumberOfNodes () const
 Return the number of mesh nodes.
virtual bool GetNode (const size_t i, double &x, double &y, double &z) const
 Get the coordinates of a mesh node.
double IntegrateFluxCircle (const double xc, const double yc, const double r, const unsigned int nI=50)
 Integrate the normal component of the electric field over a circle.
double IntegrateFluxSphere (const double xc, const double yc, const double zc, const double r, const unsigned int nI=20)
 Integrate the normal component of the electric field over a sphere.
double IntegrateFluxParallelogram (const double x0, const double y0, const double z0, const double dx1, const double dy1, const double dz1, const double dx2, const double dy2, const double dz2, const unsigned int nU=20, const unsigned int nV=20)
 Integrate the normal component of the electric field over a parallelogram.
double IntegrateWeightingFluxParallelogram (const std::string &label, const double x0, const double y0, const double z0, const double dx1, const double dy1, const double dz1, const double dx2, const double dy2, const double dz2, const unsigned int nU=20, const unsigned int nV=20)
 Integrate the normal component of the weighting field over a parallelogram.
double IntegrateFluxLine (const double x0, const double y0, const double z0, const double x1, const double y1, const double z1, const double xp, const double yp, const double zp, const unsigned int nI, const int isign=0)
 Integrate the electric field flux through a line from (x0,y0,z0) to (x1,y1,z1) along a direction (xp,yp,zp).
virtual bool CrossedPlane (const double x0, const double y0, const double z0, const double x1, const double y1, const double z1, double &xc, double &yc, double &zc)
 Determine whether the line between two points crosses a plane.
void EnablePeriodicityX (const bool on=true)
 Enable simple periodicity in the $x$ direction.
void EnablePeriodicityY (const bool on=true)
 Enable simple periodicity in the $y$ direction.
void EnablePeriodicityZ (const bool on=true)
 Enable simple periodicity in the $z$ direction.
void IsPeriodic (bool &perx, bool &pery, bool &perz)
 Return periodicity flags.
void EnableMirrorPeriodicityX (const bool on=true)
 Enable mirror periodicity in the $x$ direction.
void EnableMirrorPeriodicityY (const bool on=true)
 Enable mirror periodicity in the $y$ direction.
void EnableMirrorPeriodicityZ (const bool on=true)
 Enable mirror periodicity in the $y$ direction.
void IsMirrorPeriodic (bool &perx, bool &pery, bool &perz)
 Return mirror periodicity flags.
void EnableAxialPeriodicityX (const bool on=true)
 Enable axial periodicity in the $x$ direction.
void EnableAxialPeriodicityY (const bool on=true)
 Enable axial periodicity in the $y$ direction.
void EnableAxialPeriodicityZ (const bool on=true)
 Enable axial periodicity in the $z$ direction.
void IsAxiallyPeriodic (bool &perx, bool &pery, bool &perz)
 Return axial periodicity flags.
void EnableRotationSymmetryX (const bool on=true)
 Enable rotation symmetry around the $x$ axis.
void EnableRotationSymmetryY (const bool on=true)
 Enable rotation symmetry around the $y$ axis.
void EnableRotationSymmetryZ (const bool on=true)
 Enable rotation symmetry around the $z$ axis.
void IsRotationSymmetric (bool &rotx, bool &roty, bool &rotz)
 Return rotation symmetry flags.
void EnableTriangleSymmetricXY (const bool on=true, const bool oct=2)
 Enable triangular periodicity in the $xy$ plane.
void EnableTriangleSymmetricXZ (const bool on=true, const bool oct=2)
 Enable triangular periodicity in the $xz$ plane.
void EnableTriangleSymmetricYZ (const bool on=true, const bool oct=2)
 Enable triangular periodicity in the $yz$ plane.
void EnableDebugging (const bool on=true)
 Switch on debugging messages.
void DisableDebugging ()
 Switch off debugging messages.
virtual bool HasMagneticField () const
 Does the component have a non-zero magnetic field?
virtual bool HasTownsendMap () const
 Does the component have maps of the Townsend coefficient?
virtual bool HasAttachmentMap () const
 Does the component have maps of the attachment coefficient?
virtual bool HasMobilityMap () const
 Does the component have maps of the low-field mobility?
virtual bool HasVelocityMap () const
 Does the component have velocity maps?
virtual bool ElectronAttachment (const double, const double, const double, double &eta)
 Get the electron attachment coefficient.
virtual bool HoleAttachment (const double, const double, const double, double &eta)
 Get the hole attachment coefficient.
virtual bool ElectronMobility (const double, const double, const double, double &mu)
virtual bool HoleMobility (const double, const double, const double, double &mu)
 Get the hole Mobility coefficient.
virtual bool ElectronTownsend (const double, const double, const double, double &alpha)
 Get the electron Townsend coefficient.
virtual bool HoleTownsend (const double, const double, const double, double &alpha)
 Get the hole Townsend coefficient.
virtual bool ElectronVelocity (const double, const double, const double, double &vx, double &vy, double &vz)
 Get the electron drift velocity.
virtual bool HoleVelocity (const double, const double, const double, double &vx, double &vy, double &vz)
 Get the hole drift velocity.
virtual double StepSizeHint ()
virtual double CreateGPUTransferObject (ComponentGPU *&comp_gpu)
 Create and initialise GPU Transfer class.

Private Types

enum  BC { Voltage = 1 , Charge , Floating , Dielectric }
 Boundary condition type. More...

Private Member Functions

void EliminateOverlaps (std::vector< Segment > &segments)
 Split/merge overlapping segments.
bool Discretise (const Segment &segment, std::vector< Element > &elements, const double lambda, const unsigned int ndiv)
 Create elements from a straight-line segment.
bool ComputeInfluenceMatrix (std::vector< std::vector< double > > &infmat) const
bool InvertMatrix (std::vector< std::vector< double > > &influenceMatrix, std::vector< std::vector< double > > &inverseMatrix) const
bool LUDecomposition (std::vector< std::vector< double > > &mat, std::vector< int > &index) const
void LUSubstitution (const std::vector< std::vector< double > > &mat, const std::vector< int > &index, std::vector< double > &col) const
bool Solve (const std::vector< std::vector< double > > &inverseMatrix, const std::vector< double > &bc)
bool CheckConvergence (const double tol, std::vector< bool > &ok)
void SplitElement (Element &oldElement, std::vector< Element > &elements)
double LinePotential (const double a, const double x, const double y) const
 Potential of a line segment (half-width a) in local coordinates.
double WirePotential (const double r0, const double x, const double y) const
 Potential of a thin wire with radius r0.
void LineField (const double a, const double x, const double y, double &ex, double &ey) const
 Field of a line segment (half-width a) in local coordinates.
void WireField (const double r0, const double x, const double y, double &ex, double &ey) const
 Field of a thin wire with radius r0.
double BoxPotential (const double a, const double b, const double x, const double y, const double v0) const
 Potential of a uniformly charged rectangle.
void BoxField (const double a, const double b, const double x, const double y, double &ex, double &ey) const
 Field of a uniformly charged rectangle.
void Reset () override
 Reset the component.
void UpdatePeriodicity () override
 Verify periodicities.
void ToLocal (const double xIn, const double yIn, const double cphi, const double sphi, double &xOut, double &yOut) const
 Rotation from global to local coordinates.
void ToGlobal (const double xIn, const double yIn, const double cphi, const double sphi, double &xOut, double &yOut) const
 Rotation from local to global coordinates.
int Field (const double x, const double y, const double z, double &ex, double &ey, double &ez, double &v, Medium *&m, const bool opt)
 Evaluation of the electric field (and optionally potential).

Private Attributes

unsigned int m_nDivisions = 5
 Default number elements per segment.
unsigned int m_nCollocationPoints = 1
bool m_autoSize = false
bool m_randomCollocation = false
unsigned int m_nMaxIterations = 3
Mediumm_medium = nullptr
 Background medium.
bool m_useRangeZ = false
 Flag whether a z-range has been defined by the user.
double m_zmin = -1.
 Lower z limit.
double m_zmax = 1.
 Upper z limit.
std::vector< Regionm_regions
 Regions.
std::vector< Segmentm_segments
 User-specified conducting straight-line segments.
std::vector< Wirem_wires
 Wires.
std::vector< Elementm_elements
 Straight-line boundary elements.
std::vector< SpaceChargem_spaceCharge

Static Private Attributes

static const double InvEpsilon0
static const double InvTwoPiEpsilon0

Additional Inherited Members

Protected Attributes inherited from Garfield::Component
std::string m_className {"Component"}
 Class name.
Geometrym_geometry {nullptr}
 Pointer to the geometry.
std::array< double, 3 > m_b0 = {{0., 0., 0.}}
 Constant magnetic field.
bool m_ready {false}
 Ready for use?
bool m_debug {false}
 Switch on/off debugging messages.
std::array< bool, 3 > m_periodic = {{false, false, false}}
 Simple periodicity in x, y, z.
std::array< bool, 3 > m_mirrorPeriodic = {{false, false, false}}
 Mirror periodicity in x, y, z.
std::array< bool, 3 > m_axiallyPeriodic = {{false, false, false}}
 Axial periodicity in x, y, z.
std::array< bool, 3 > m_rotationSymmetric = {{false, false, false}}
 Rotation symmetry around x-axis, y-axis, z-axis.
std::array< bool, 3 > m_triangleSymmetric = {{false, false, false}}
 Triangle symmetric in the xy, xz, and yz plane.
int m_triangleSymmetricOct = 0
 Triangle symmetric octant of imported map (0 < phi < Pi/4 --> octant 1).
const std::array< int, 4 > m_triangleOctRules = {1, 4, 5, 8}
 Octants where |x| >= |y|.
bool m_outsideCone = false
std::vector< double > m_wdtimes
 Time steps at which the delayed weighting potentials/fields are stored.

Detailed Description

Two-dimensional implementation of the nearly exact Boundary Element Method.

Definition at line 12 of file ComponentNeBem2d.hh.

Member Enumeration Documentation

◆ BC

Boundary condition type.

Enumerator
Voltage 

Fixed potential.

Charge 

Fixed charge density (not implemented).

Floating 

Floating conductor (not implemented).

Dielectric 

Dielectric-dielectric interface.

Definition at line 131 of file ComponentNeBem2d.hh.

131 {
132 Voltage = 1,
133 Charge,
134 Floating,
136 };
@ Floating
Floating conductor (not implemented).
@ Charge
Fixed charge density (not implemented).
@ Dielectric
Dielectric-dielectric interface.

Constructor & Destructor Documentation

◆ ComponentNeBem2d()

Garfield::ComponentNeBem2d::ComponentNeBem2d ( )

Constructor.

◆ ~ComponentNeBem2d()

Garfield::ComponentNeBem2d::~ComponentNeBem2d ( )
inline

Destructor.

Definition at line 17 of file ComponentNeBem2d.hh.

17{}

Member Function Documentation

◆ AddChargeDistribution()

void Garfield::ComponentNeBem2d::AddChargeDistribution ( const double x,
const double y,
const double a,
const double b,
const double rho )

◆ AddRegion()

bool Garfield::ComponentNeBem2d::AddRegion ( const std::vector< double > & xp,
const std::vector< double > & yp,
Medium * medium,
const unsigned int bctype = 4,
const double v = 0.,
const int ndiv = -1 )

Add a region bounded by a polygon.

Parameters
xp,ypx/y-coordinates of the vertices of the polygon.
mediumpointer to the medium associated to the region.
bctype1: fixed voltage, 4: dielectric-dielectric interface.
vapplied potential.
ndivnumber of elements on each edge segment.

◆ AddSegment()

bool Garfield::ComponentNeBem2d::AddSegment ( const double x0,
const double y0,
const double x1,
const double y1,
const double v,
const int ndiv = -1 )

Add a conducting straight-line segment.

Parameters
x0,y0,x1,y1coordinates of start and end point.
vapplied potential.
ndivnumber of elements in which to split the segment.

◆ AddWire()

bool Garfield::ComponentNeBem2d::AddWire ( const double x,
const double y,
const double d,
const double v,
const int ntrap = 5 )

Add a wire.

Parameters
x,ycentre of the wire.
dwire diameter.
vapplied potential.
ntrapmultiple of the wire radius within which a particle is considered to be trapped by the wire.

◆ BoxField()

void Garfield::ComponentNeBem2d::BoxField ( const double a,
const double b,
const double x,
const double y,
double & ex,
double & ey ) const
private

Field of a uniformly charged rectangle.

◆ BoxPotential()

double Garfield::ComponentNeBem2d::BoxPotential ( const double a,
const double b,
const double x,
const double y,
const double v0 ) const
private

Potential of a uniformly charged rectangle.

◆ CheckConvergence()

bool Garfield::ComponentNeBem2d::CheckConvergence ( const double tol,
std::vector< bool > & ok )
private

◆ ComputeInfluenceMatrix()

bool Garfield::ComponentNeBem2d::ComputeInfluenceMatrix ( std::vector< std::vector< double > > & infmat) const
private

◆ CrossedWire()

bool Garfield::ComponentNeBem2d::CrossedWire ( const double x0,
const double y0,
const double z0,
const double x1,
const double y1,
const double z1,
double & xc,
double & yc,
double & zc,
const bool centre,
double & rc )
overridevirtual

Determine whether the line between two points crosses a wire.

Parameters
x0,y0,z0first point [cm].
x1,y1,z1second point [cm]
xc,yc,zcpoint [cm] where the line crosses the wire or the coordinates of the wire centre.
centreflag whether to return the coordinates of the line-wire crossing point or of the wire centre.
rcradius [cm] of the wire.

Reimplemented from Garfield::Component.

◆ Discretise()

bool Garfield::ComponentNeBem2d::Discretise ( const Segment & segment,
std::vector< Element > & elements,
const double lambda,
const unsigned int ndiv )
private

Create elements from a straight-line segment.

◆ ElectricField() [1/3]

std::array< double, 3 > Garfield::Component::ElectricField ( const double x,
const double y,
const double z )

Calculate the drift field [V/cm] at (x, y, z).

◆ ElectricField() [2/3]

void Garfield::ComponentNeBem2d::ElectricField ( const double x,
const double y,
const double z,
double & ex,
double & ey,
double & ez,
double & v,
Medium *& m,
int & status )
overridevirtual

Calculate the drift field [V/cm] and potential [V] at (x, y, z).

Implements Garfield::Component.

◆ ElectricField() [3/3]

void Garfield::ComponentNeBem2d::ElectricField ( const double x,
const double y,
const double z,
double & ex,
double & ey,
double & ez,
Medium *& m,
int & status )
overridevirtual

Calculate the drift field at given point.

Parameters
x,y,zcoordinates [cm].
ex,ey,ezcomponents of the electric field [V/cm].
mpointer to the medium at this location.
statusstatus flag

Status flags:

        0: Inside an active medium
      > 0: Inside a wire of type X
-4 ... -1: On the side of a plane where no wires are
       -5: Inside the mesh but not in an active medium
       -6: Outside the mesh
      -10: Unknown potential type (should not occur)
    other: Other cases (should not occur)

Implements Garfield::Component.

◆ EliminateOverlaps()

void Garfield::ComponentNeBem2d::EliminateOverlaps ( std::vector< Segment > & segments)
private

Split/merge overlapping segments.

◆ EnableAutoResizing()

void Garfield::ComponentNeBem2d::EnableAutoResizing ( const bool on = true)
inline

Definition at line 60 of file ComponentNeBem2d.hh.

◆ EnableRandomCollocation()

void Garfield::ComponentNeBem2d::EnableRandomCollocation ( const bool on = true)
inline

Definition at line 61 of file ComponentNeBem2d.hh.

◆ Field()

int Garfield::ComponentNeBem2d::Field ( const double x,
const double y,
const double z,
double & ex,
double & ey,
double & ez,
double & v,
Medium *& m,
const bool opt )
private

Evaluation of the electric field (and optionally potential).

◆ GetBoundingBox()

bool Garfield::ComponentNeBem2d::GetBoundingBox ( double & xmin,
double & ymin,
double & zmin,
double & xmax,
double & ymax,
double & zmax )
overridevirtual

Get the bounding box coordinates.

Reimplemented from Garfield::Component.

◆ GetElement()

bool Garfield::ComponentNeBem2d::GetElement ( const unsigned int i,
double & x0,
double & y0,
double & x1,
double & y1,
double & q ) const

Return the coordinates and charge of a given boundary element.

◆ GetElementaryCell()

bool Garfield::ComponentNeBem2d::GetElementaryCell ( double & xmin,
double & ymin,
double & zmin,
double & xmax,
double & ymax,
double & zmax )
overridevirtual

Get the coordinates of the elementary cell.

Reimplemented from Garfield::Component.

◆ GetMedium()

Medium * Garfield::ComponentNeBem2d::GetMedium ( const double x,
const double y,
const double z )
overridevirtual

Get the medium at a given location (x, y, z).

Reimplemented from Garfield::Component.

◆ GetNumberOfElements()

size_t Garfield::ComponentNeBem2d::GetNumberOfElements ( ) const
inlineoverridevirtual

Return the number of boundary elements.

Reimplemented from Garfield::Component.

Definition at line 83 of file ComponentNeBem2d.hh.

83{ return m_elements.size(); }
std::vector< Element > m_elements
Straight-line boundary elements.

◆ GetNumberOfRegions()

unsigned int Garfield::ComponentNeBem2d::GetNumberOfRegions ( ) const
inline

Return the number of regions.

Definition at line 67 of file ComponentNeBem2d.hh.

67{ return m_regions.size(); }
std::vector< Region > m_regions
Regions.

◆ GetNumberOfSegments()

unsigned int Garfield::ComponentNeBem2d::GetNumberOfSegments ( ) const
inline

Return the number of conducting straight-line segments.

Definition at line 73 of file ComponentNeBem2d.hh.

73{ return m_segments.size(); }
std::vector< Segment > m_segments
User-specified conducting straight-line segments.

◆ GetNumberOfWires()

unsigned int Garfield::ComponentNeBem2d::GetNumberOfWires ( ) const
inline

Return the number of wires.

Definition at line 78 of file ComponentNeBem2d.hh.

78{ return m_wires.size(); }
std::vector< Wire > m_wires
Wires.

◆ GetRegion()

bool Garfield::ComponentNeBem2d::GetRegion ( const unsigned int i,
std::vector< double > & xv,
std::vector< double > & yv,
Medium *& medium,
unsigned int & bctype,
double & v )

Return the properties of a given region.

◆ GetSegment()

bool Garfield::ComponentNeBem2d::GetSegment ( const unsigned int i,
double & x0,
double & y0,
double & x1,
double & x2,
double & v ) const

Return the coordinates and voltage of a given straight-line segment.

◆ GetVoltageRange()

bool Garfield::ComponentNeBem2d::GetVoltageRange ( double & vmin,
double & vmax )
overridevirtual

Calculate the voltage range [V].

Implements Garfield::Component.

◆ GetWire()

bool Garfield::ComponentNeBem2d::GetWire ( const unsigned int i,
double & x,
double & y,
double & d,
double & v,
double & q ) const

Return the coordinates, diameter, potential and charge of a given wire.

◆ Initialise()

bool Garfield::ComponentNeBem2d::Initialise ( )

Discretise the geometry and compute the solution.

◆ InTrapRadius()

bool Garfield::ComponentNeBem2d::InTrapRadius ( const double q0,
const double x0,
const double y0,
const double z0,
double & xw,
double & yw,
double & rw )
overridevirtual

Determine whether a particle is inside the trap radius of a wire.

Parameters
q0charge of the particle [in elementary charges].
x0,y0,z0position [cm] of the particle.
xw,ywcoordinates of the wire (if applicable).
rwradius of the wire (if applicable).

Reimplemented from Garfield::Component.

◆ InvertMatrix()

bool Garfield::ComponentNeBem2d::InvertMatrix ( std::vector< std::vector< double > > & influenceMatrix,
std::vector< std::vector< double > > & inverseMatrix ) const
private

◆ LineField()

void Garfield::ComponentNeBem2d::LineField ( const double a,
const double x,
const double y,
double & ex,
double & ey ) const
private

Field of a line segment (half-width a) in local coordinates.

◆ LinePotential()

double Garfield::ComponentNeBem2d::LinePotential ( const double a,
const double x,
const double y ) const
private

Potential of a line segment (half-width a) in local coordinates.

◆ LUDecomposition()

bool Garfield::ComponentNeBem2d::LUDecomposition ( std::vector< std::vector< double > > & mat,
std::vector< int > & index ) const
private

◆ LUSubstitution()

void Garfield::ComponentNeBem2d::LUSubstitution ( const std::vector< std::vector< double > > & mat,
const std::vector< int > & index,
std::vector< double > & col ) const
private

◆ Reset()

void Garfield::ComponentNeBem2d::Reset ( )
overrideprivatevirtual

Reset the component.

Implements Garfield::Component.

◆ SetMaxNumberOfIterations()

void Garfield::ComponentNeBem2d::SetMaxNumberOfIterations ( const unsigned int niter)

◆ SetMedium()

void Garfield::ComponentNeBem2d::SetMedium ( Medium * medium)
inline

Set the "background" medium.

Definition at line 20 of file ComponentNeBem2d.hh.

20{ m_medium = medium; }
Medium * m_medium
Background medium.

◆ SetNumberOfCollocationPoints()

void Garfield::ComponentNeBem2d::SetNumberOfCollocationPoints ( const unsigned int ncoll)

◆ SetNumberOfDivisions()

void Garfield::ComponentNeBem2d::SetNumberOfDivisions ( const unsigned int ndiv)

Set the default number of elements per segment.

◆ SetRangeZ()

void Garfield::ComponentNeBem2d::SetRangeZ ( const double zmin,
const double zmax )

Set the extent of the drift region along z.

◆ Solve()

bool Garfield::ComponentNeBem2d::Solve ( const std::vector< std::vector< double > > & inverseMatrix,
const std::vector< double > & bc )
private

◆ SplitElement()

void Garfield::ComponentNeBem2d::SplitElement ( Element & oldElement,
std::vector< Element > & elements )
private

◆ ToGlobal()

void Garfield::ComponentNeBem2d::ToGlobal ( const double xIn,
const double yIn,
const double cphi,
const double sphi,
double & xOut,
double & yOut ) const
private

Rotation from local to global coordinates.

◆ ToLocal()

void Garfield::ComponentNeBem2d::ToLocal ( const double xIn,
const double yIn,
const double cphi,
const double sphi,
double & xOut,
double & yOut ) const
private

Rotation from global to local coordinates.

◆ UpdatePeriodicity()

void Garfield::ComponentNeBem2d::UpdatePeriodicity ( )
overrideprivatevirtual

Verify periodicities.

Implements Garfield::Component.

◆ WireField()

void Garfield::ComponentNeBem2d::WireField ( const double r0,
const double x,
const double y,
double & ex,
double & ey ) const
private

Field of a thin wire with radius r0.

◆ WirePotential()

double Garfield::ComponentNeBem2d::WirePotential ( const double r0,
const double x,
const double y ) const
private

Potential of a thin wire with radius r0.

Member Data Documentation

◆ InvEpsilon0

const double Garfield::ComponentNeBem2d::InvEpsilon0
staticprivate

Definition at line 112 of file ComponentNeBem2d.hh.

◆ InvTwoPiEpsilon0

const double Garfield::ComponentNeBem2d::InvTwoPiEpsilon0
staticprivate

Definition at line 113 of file ComponentNeBem2d.hh.

◆ m_autoSize

bool Garfield::ComponentNeBem2d::m_autoSize = false
private

Definition at line 118 of file ComponentNeBem2d.hh.

◆ m_elements

std::vector<Element> Garfield::ComponentNeBem2d::m_elements
private

Straight-line boundary elements.

Definition at line 179 of file ComponentNeBem2d.hh.

◆ m_medium

Medium* Garfield::ComponentNeBem2d::m_medium = nullptr
private

Background medium.

Definition at line 123 of file ComponentNeBem2d.hh.

◆ m_nCollocationPoints

unsigned int Garfield::ComponentNeBem2d::m_nCollocationPoints = 1
private

Definition at line 117 of file ComponentNeBem2d.hh.

◆ m_nDivisions

unsigned int Garfield::ComponentNeBem2d::m_nDivisions = 5
private

Default number elements per segment.

Definition at line 116 of file ComponentNeBem2d.hh.

◆ m_nMaxIterations

unsigned int Garfield::ComponentNeBem2d::m_nMaxIterations = 3
private

Definition at line 120 of file ComponentNeBem2d.hh.

◆ m_randomCollocation

bool Garfield::ComponentNeBem2d::m_randomCollocation = false
private

Definition at line 119 of file ComponentNeBem2d.hh.

◆ m_regions

std::vector<Region> Garfield::ComponentNeBem2d::m_regions
private

Regions.

Definition at line 146 of file ComponentNeBem2d.hh.

◆ m_segments

std::vector<Segment> Garfield::ComponentNeBem2d::m_segments
private

User-specified conducting straight-line segments.

Definition at line 157 of file ComponentNeBem2d.hh.

◆ m_spaceCharge

std::vector<SpaceCharge> Garfield::ComponentNeBem2d::m_spaceCharge
private

Definition at line 187 of file ComponentNeBem2d.hh.

◆ m_useRangeZ

bool Garfield::ComponentNeBem2d::m_useRangeZ = false
private

Flag whether a z-range has been defined by the user.

Definition at line 125 of file ComponentNeBem2d.hh.

◆ m_wires

std::vector<Wire> Garfield::ComponentNeBem2d::m_wires
private

Wires.

Definition at line 167 of file ComponentNeBem2d.hh.

◆ m_zmax

double Garfield::ComponentNeBem2d::m_zmax = 1.
private

Upper z limit.

Definition at line 129 of file ComponentNeBem2d.hh.

◆ m_zmin

double Garfield::ComponentNeBem2d::m_zmin = -1.
private

Lower z limit.

Definition at line 127 of file ComponentNeBem2d.hh.


The documentation for this class was generated from the following file: