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

Extrusion. More...

#include <SolidExtrusion.hh>

Inheritance diagram for Garfield::SolidExtrusion:
Garfield::Solid

Public Member Functions

 SolidExtrusion (const double lz, const std::vector< double > &xp, const std::vector< double > &yp)
 Constructor from half-length and profile.
 SolidExtrusion (const double lz, const std::vector< double > &xp, const std::vector< double > &yp, const double cx, const double cy, const double cz, const double dx, const double dy, const double dz)
 Constructor from half-length, profile, offset and orientation.
 ~SolidExtrusion ()
 Destructor.
bool IsInside (const double x, const double y, const double z, const bool tesselated) const override
 Check whether a given point is inside the solid.
bool GetBoundingBox (double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) const override
 Return the bounding box of the solid.
bool IsExtrusion () const override
 Return true if the solid is an extrusion.
double GetHalfLengthZ () const override
 Return the half-length along z.
bool GetProfile (std::vector< double > &xp, std::vector< double > &yp) const override
 Get the vertices defining an extrusion.
void SetHalfLengthZ (const double lz)
 Set the half-length of the extrusion.
void SetProfile (const std::vector< double > &xp, const std::vector< double > &yp)
 Set the coordinates of the extrusion profile.
void SetTopLid (const bool closed)
 Request the extrusion to be closed with a lid at +z.
void SetBottomLid (const bool closed)
 Request the extrusion to be closed with a lid at -z.
bool SolidPanels (std::vector< Panel > &panels) override
 Retrieve the surface panels of the solid.
void SetDiscretisationLevel (const double dis) override
 Set the discretisation level (for all panels).
double GetDiscretisationLevel (const Panel &panel) override
 Retrieve the discretisation level of a panel.
void Cut (const double x0, const double y0, const double z0, const double xn, const double yn, const double zn, std::vector< Panel > &panels) override
Public Member Functions inherited from Garfield::Solid
 Solid ()=delete
 Default constructor.
 Solid (const double cx, const double cy, const double cz, const std::string &name)
 Constructor.
virtual ~Solid ()
 Destructor.
virtual bool IsBox () const
 Return true if the solid is a box.
virtual bool IsTube () const
 Return true if the solid is a tube.
virtual bool IsSphere () const
 Return true if the solid is a sphere.
virtual bool IsHole () const
 Return true if the solid is a hole.
virtual bool IsRidge () const
 Return true if the solid is a ridge.
virtual bool IsWire () const
 Return true if the solid is a wire.
void SetLabel (const std::string &label)
 Set a label.
std::string GetLabel () const
 Return the label.
bool GetCentre (double &x, double &y, double &z) const
 Retrieve the centre point of the solid.
bool GetDirection (double &dx, double &dy, double &dz) const
 Retrieve the direction vector.
bool GetOrientation (double &ctheta, double &stheta, double &cphi, double &sphi) const
 Retrieve the orientation (azimuthal and polar angles) of the solid.
virtual double GetHalfLengthX () const
 Return the half-length along x.
virtual double GetHalfLengthY () const
 Return the half-length along y.
virtual double GetInnerRadius () const
 Return the inner radius.
virtual double GetOuterRadius () const
 Return the outer radius.
virtual double GetRadius () const
 Return the radius.
virtual double GetLowerRadius () const
 Return the lower radius (of a hole).
virtual double GetUpperRadius () const
 Return the upper radius (of a hole).
virtual double GetRidgeOffset () const
 Return the x-offset of a ridge.
virtual double GetRidgeHeight () const
 Return the height of a ridge.
unsigned int GetId () const
 Get the ID of the solid.
void SetBoundaryPotential (const double v)
 Apply Dirichlet boundary conditions (fixed voltage).
void SetBoundaryChargeDensity (const double q)
 Apply fixed-charge boundary conditions.
void SetBoundaryFloat ()
 Make the potential at the surface of the solid floating.
void SetBoundaryDielectric ()
 Make the surfaces of the solid dielectric-dielectric interfaces.
void SetBoundaryParallelField ()
void SetBoundaryPerpendicularField ()
BoundaryCondition GetBoundaryConditionType () const
 Retrieve the type of boundary condition.
double GetBoundaryPotential () const
 Retrieve the potential.
double GetBoundaryChargeDensity () const
 Retrieve the surface charge density.
void EnableDebugging (const bool on=true)
 Switch debugging messages on/off.
void SetColour (const int col)
 Set the colour of the solid.
int GetColour () const
 Get the colour of the solid.

Private Attributes

double m_lZ = 0.
 Half length.
std::vector< double > m_xp
 X coordinates of the profile.
std::vector< double > m_yp
 Y coordinates of the profile.
bool m_toplid = true
 Have a top lid?
bool m_botlid = true
 Have a bottom lid?
bool m_clockwise = true
 Orientation of the polygon.
std::array< double, 3 > m_dis {{-1, -1, -1}}
 Discretisation levels.

Additional Inherited Members

Public Types inherited from Garfield::Solid
enum  BoundaryCondition {
  Unknown = 0 , Voltage , Charge , Float ,
  Dielectric , DielectricCharge , ParallelField , PerpendicularField
}
Static Public Member Functions inherited from Garfield::Solid
static bool Intersect (const double x1, const double y1, const double z1, const double x2, const double y2, const double z2, const double x0, const double y0, const double z0, const double a, const double b, const double c, double &xc, double &yc, double &zc)
Protected Member Functions inherited from Garfield::Solid
void ToLocal (const double x, const double y, const double z, double &u, double &v, double &w) const
 Transform a point from global coordinates (x, y, z) to local coordinates (u, v, w).
void ToGlobal (const double u, const double v, const double w, double &x, double &y, double &z) const
 Transform a point from local coordinates (u, v, w) to global coordinates (x, y, z).
void VectorToLocal (const double x, const double y, const double z, double &u, double &v, double &w)
 Transform a vector from global to local coordinates.
void SetDirection (const double dx, const double dy, const double dz)
Protected Attributes inherited from Garfield::Solid
double m_cX = 0.
 Centre of the solid.
double m_cY = 0.
double m_cZ = 0.
double m_dX = 0.
 Direction vector.
double m_dY = 0.
double m_dZ = 1.
double m_cPhi = 1.
 Azimuthal angle.
double m_sPhi = 0.
double m_cTheta = 1.
 Polar angle.
double m_sTheta = 0.
std::string m_className = "Solid"
 Class name.
std::string m_label = ""
 Label.
bool m_debug = false
 Debug flag.
BoundaryCondition m_bctype = Unknown
 Type of boundary condition.
double m_volt = 0.
 Potential at the surface.
double m_charge = 0.
 Surface charge density.
double m_eps = 0.
 Dielectric constant.
int m_colour = -1
 Colour.

Detailed Description

Extrusion.

Definition at line 12 of file SolidExtrusion.hh.

Constructor & Destructor Documentation

◆ SolidExtrusion() [1/2]

Garfield::SolidExtrusion::SolidExtrusion ( const double lz,
const std::vector< double > & xp,
const std::vector< double > & yp )

Constructor from half-length and profile.

◆ SolidExtrusion() [2/2]

Garfield::SolidExtrusion::SolidExtrusion ( const double lz,
const std::vector< double > & xp,
const std::vector< double > & yp,
const double cx,
const double cy,
const double cz,
const double dx,
const double dy,
const double dz )

Constructor from half-length, profile, offset and orientation.

◆ ~SolidExtrusion()

Garfield::SolidExtrusion::~SolidExtrusion ( )
inline

Destructor.

Definition at line 23 of file SolidExtrusion.hh.

23{}

Member Function Documentation

◆ Cut()

void Garfield::SolidExtrusion::Cut ( const double x0,
const double y0,
const double z0,
const double xn,
const double yn,
const double zn,
std::vector< Panel > & panels )
overridevirtual

Implements Garfield::Solid.

◆ GetBoundingBox()

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

Return the bounding box of the solid.

Implements Garfield::Solid.

◆ GetDiscretisationLevel()

double Garfield::SolidExtrusion::GetDiscretisationLevel ( const Panel & panel)
overridevirtual

Retrieve the discretisation level of a panel.

Implements Garfield::Solid.

◆ GetHalfLengthZ()

double Garfield::SolidExtrusion::GetHalfLengthZ ( ) const
inlineoverridevirtual

Return the half-length along z.

Reimplemented from Garfield::Solid.

Definition at line 31 of file SolidExtrusion.hh.

31{ return m_lZ; }
double m_lZ
Half length.

◆ GetProfile()

bool Garfield::SolidExtrusion::GetProfile ( std::vector< double > & xv,
std::vector< double > & yv ) const
inlineoverridevirtual

Get the vertices defining an extrusion.

Reimplemented from Garfield::Solid.

Definition at line 32 of file SolidExtrusion.hh.

33 {
34 xp = m_xp;
35 yp = m_yp;
36 return !m_xp.empty();
37 }
std::vector< double > m_yp
Y coordinates of the profile.
std::vector< double > m_xp
X coordinates of the profile.

◆ IsExtrusion()

bool Garfield::SolidExtrusion::IsExtrusion ( ) const
inlineoverridevirtual

Return true if the solid is an extrusion.

Reimplemented from Garfield::Solid.

Definition at line 29 of file SolidExtrusion.hh.

29{ return true; }

◆ IsInside()

bool Garfield::SolidExtrusion::IsInside ( const double x,
const double y,
const double z,
const bool tesselated ) const
overridevirtual

Check whether a given point is inside the solid.

If requested, use the tesselated approximation of the solid (if applicable).

Implements Garfield::Solid.

◆ SetBottomLid()

void Garfield::SolidExtrusion::SetBottomLid ( const bool closed)
inline

Request the extrusion to be closed with a lid at -z.

Definition at line 45 of file SolidExtrusion.hh.

45{ m_botlid = closed; }
bool m_botlid
Have a bottom lid?

◆ SetDiscretisationLevel()

void Garfield::SolidExtrusion::SetDiscretisationLevel ( const double dis)
inlineoverridevirtual

Set the discretisation level (for all panels).

Implements Garfield::Solid.

Definition at line 48 of file SolidExtrusion.hh.

48{ m_dis.fill(dis); }
std::array< double, 3 > m_dis
Discretisation levels.

◆ SetHalfLengthZ()

void Garfield::SolidExtrusion::SetHalfLengthZ ( const double lz)

Set the half-length of the extrusion.

◆ SetProfile()

void Garfield::SolidExtrusion::SetProfile ( const std::vector< double > & xp,
const std::vector< double > & yp )

Set the coordinates of the extrusion profile.

◆ SetTopLid()

void Garfield::SolidExtrusion::SetTopLid ( const bool closed)
inline

Request the extrusion to be closed with a lid at +z.

Definition at line 43 of file SolidExtrusion.hh.

43{ m_toplid = closed; }
bool m_toplid
Have a top lid?

◆ SolidPanels()

bool Garfield::SolidExtrusion::SolidPanels ( std::vector< Panel > & panels)
overridevirtual

Retrieve the surface panels of the solid.

Implements Garfield::Solid.

Member Data Documentation

◆ m_botlid

bool Garfield::SolidExtrusion::m_botlid = true
private

Have a bottom lid?

Definition at line 66 of file SolidExtrusion.hh.

◆ m_clockwise

bool Garfield::SolidExtrusion::m_clockwise = true
private

Orientation of the polygon.

Definition at line 69 of file SolidExtrusion.hh.

◆ m_dis

std::array<double, 3> Garfield::SolidExtrusion::m_dis {{-1, -1, -1}}
private

Discretisation levels.

Definition at line 72 of file SolidExtrusion.hh.

72{{-1, -1, -1}};

◆ m_lZ

double Garfield::SolidExtrusion::m_lZ = 0.
private

Half length.

Definition at line 57 of file SolidExtrusion.hh.

◆ m_toplid

bool Garfield::SolidExtrusion::m_toplid = true
private

Have a top lid?

Definition at line 64 of file SolidExtrusion.hh.

◆ m_xp

std::vector<double> Garfield::SolidExtrusion::m_xp
private

X coordinates of the profile.

Definition at line 59 of file SolidExtrusion.hh.

◆ m_yp

std::vector<double> Garfield::SolidExtrusion::m_yp
private

Y coordinates of the profile.

Definition at line 61 of file SolidExtrusion.hh.


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