Garfield++ 4.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
|
Abstract base class for solids. More...
#include <Solid.hh>
Public Types | |
enum | BoundaryCondition { Unknown = 0 , Voltage , Charge , Float , Dielectric , DielectricCharge , ParallelField , PerpendicularField } |
Public Member Functions | |
Solid ()=delete | |
Default constructor. | |
Solid (const double cx, const double cy, const double cz, const std::string &name) | |
Constructor. | |
virtual | ~Solid () |
Destructor. | |
virtual bool | IsInside (const double x, const double y, const double z, const bool tesselated=false) const =0 |
virtual bool | GetBoundingBox (double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) const =0 |
Return the bounding box of the solid. | |
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 | IsExtrusion () const |
Return true if the solid is an extrusion. | |
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 | GetHalfLengthZ () const |
Return the half-length along z. | |
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. | |
virtual bool | GetProfile (std::vector< double > &xv, std::vector< double > &yv) const |
Get the vertices defining an extrusion. | |
unsigned int | GetId () const |
Get the ID of the solid. | |
virtual bool | SolidPanels (std::vector< Panel > &panels)=0 |
Retrieve the surface panels of the solid. | |
virtual void | SetDiscretisationLevel (const double dis)=0 |
Set the discretisation level (for all panels). | |
virtual double | GetDiscretisationLevel (const Panel &panel)=0 |
Retrieve the discretisation level of a panel. | |
virtual void | Cut (const double x0, const double y0, const double z0, const double xn, const double yn, const double zn, std::vector< Panel > &panels)=0 |
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. | |
Static Public Member Functions | |
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 | |
void | ToLocal (const double x, const double y, const double z, double &u, double &v, double &w) const |
void | ToGlobal (const double u, const double v, const double w, double &x, double &y, double &z) const |
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 | |
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. | |
Enumerator | |
---|---|
Unknown | |
Voltage | |
Charge | |
Float | |
Dielectric | |
DielectricCharge | |
ParallelField | |
PerpendicularField |
Definition at line 151 of file Solid.hh.
|
delete |
Default constructor.
|
inline |
|
inlinevirtual |
|
pure virtual |
Implemented in Garfield::SolidBox, Garfield::SolidExtrusion, Garfield::SolidHole, Garfield::SolidRidge, Garfield::SolidSphere, Garfield::SolidTube, and Garfield::SolidWire.
Referenced by Garfield::ViewGeometry::Plot2d().
|
inline |
|
inline |
|
inline |
Retrieve the type of boundary condition.
Definition at line 180 of file Solid.hh.
|
inline |
|
pure virtual |
Return the bounding box of the solid.
Implemented in Garfield::SolidBox, Garfield::SolidExtrusion, Garfield::SolidHole, Garfield::SolidRidge, Garfield::SolidSphere, Garfield::SolidTube, and Garfield::SolidWire.
Referenced by Garfield::GeometrySimple::AddSolid().
|
inline |
Retrieve the centre point of the solid.
Definition at line 71 of file Solid.hh.
Referenced by Garfield::ComponentNeBem3d::Initialise(), and Garfield::ViewGeometry::Plot3d().
|
inline |
Get the colour of the solid.
Definition at line 192 of file Solid.hh.
Referenced by Garfield::ViewGeometry::Plot3d().
|
inline |
|
pure virtual |
Retrieve the discretisation level of a panel.
Implemented in Garfield::SolidBox, Garfield::SolidExtrusion, Garfield::SolidHole, Garfield::SolidRidge, Garfield::SolidSphere, Garfield::SolidTube, and Garfield::SolidWire.
|
inlinevirtual |
Return the half-length along x.
Reimplemented in Garfield::SolidBox, Garfield::SolidHole, and Garfield::SolidRidge.
Definition at line 95 of file Solid.hh.
Referenced by Garfield::ViewGeometry::Plot3d().
|
inlinevirtual |
Return the half-length along y.
Reimplemented in Garfield::SolidBox, Garfield::SolidHole, and Garfield::SolidRidge.
Definition at line 99 of file Solid.hh.
Referenced by Garfield::ViewGeometry::Plot3d().
|
inlinevirtual |
Return the half-length along z.
Reimplemented in Garfield::SolidBox, Garfield::SolidExtrusion, Garfield::SolidHole, Garfield::SolidTube, and Garfield::SolidWire.
Definition at line 103 of file Solid.hh.
Referenced by Garfield::ViewGeometry::Plot3d().
|
inline |
Get the ID of the solid.
Definition at line 137 of file Solid.hh.
Referenced by Garfield::SolidBox::Cut(), Garfield::SolidExtrusion::Cut(), Garfield::SolidHole::Cut(), Garfield::SolidRidge::Cut(), Garfield::SolidSphere::Cut(), Garfield::SolidTube::Cut(), Garfield::ComponentNeBem3d::GetVolume(), Garfield::ComponentNeBem3d::Initialise(), Garfield::SolidBox::SolidPanels(), Garfield::SolidExtrusion::SolidPanels(), Garfield::SolidHole::SolidPanels(), Garfield::SolidRidge::SolidPanels(), and Garfield::SolidTube::SolidPanels().
|
inlinevirtual |
Return the inner radius.
Reimplemented in Garfield::SolidSphere.
Definition at line 107 of file Solid.hh.
Referenced by Garfield::ViewGeometry::Plot3d().
|
inline |
Return the label.
Definition at line 68 of file Solid.hh.
Referenced by Garfield::ComponentNeBem3d::Initialise().
|
inlinevirtual |
Return the lower radius (of a hole).
Reimplemented in Garfield::SolidHole.
Definition at line 117 of file Solid.hh.
Referenced by Garfield::ViewGeometry::Plot3d().
|
inline |
|
inlinevirtual |
Return the outer radius.
Reimplemented in Garfield::SolidSphere.
Definition at line 111 of file Solid.hh.
Referenced by Garfield::ViewGeometry::Plot3d().
|
virtual |
Get the vertices defining an extrusion.
Reimplemented in Garfield::SolidExtrusion.
Definition at line 40 of file Solid.cc.
Referenced by Garfield::ViewGeometry::Plot3d().
|
inlinevirtual |
Return the radius.
Reimplemented in Garfield::SolidSphere, Garfield::SolidTube, and Garfield::SolidWire.
Definition at line 115 of file Solid.hh.
Referenced by Garfield::ViewGeometry::Plot3d().
|
inlinevirtual |
Return the height of a ridge.
Reimplemented in Garfield::SolidRidge.
Definition at line 129 of file Solid.hh.
Referenced by Garfield::ViewGeometry::Plot3d().
|
inlinevirtual |
Return the x-offset of a ridge.
Reimplemented in Garfield::SolidRidge.
Definition at line 125 of file Solid.hh.
Referenced by Garfield::ViewGeometry::Plot3d().
|
inlinevirtual |
Return the upper radius (of a hole).
Reimplemented in Garfield::SolidHole.
Definition at line 121 of file Solid.hh.
Referenced by Garfield::ViewGeometry::Plot3d().
|
static |
Definition at line 52 of file Solid.cc.
Referenced by Garfield::SolidBox::Cut(), Garfield::SolidExtrusion::Cut(), Garfield::SolidRidge::Cut(), Garfield::SolidSphere::Cut(), and Garfield::SolidTube::Cut().
|
inlinevirtual |
Return true if the solid is a box.
Reimplemented in Garfield::SolidBox.
Definition at line 51 of file Solid.hh.
Referenced by Garfield::ViewGeometry::Plot3d().
|
inlinevirtual |
Return true if the solid is an extrusion.
Reimplemented in Garfield::SolidExtrusion.
Definition at line 61 of file Solid.hh.
Referenced by Garfield::ViewGeometry::Plot3d().
|
inlinevirtual |
Return true if the solid is a hole.
Reimplemented in Garfield::SolidHole.
Definition at line 57 of file Solid.hh.
Referenced by Garfield::ViewGeometry::Plot3d().
|
pure virtual |
Check whether a given point is inside the solid. If requested, use the tesselated approximation of the solid (if applicable).
Implemented in Garfield::SolidBox, Garfield::SolidExtrusion, Garfield::SolidHole, Garfield::SolidRidge, Garfield::SolidSphere, Garfield::SolidTube, and Garfield::SolidWire.
|
inlinevirtual |
Return true if the solid is a ridge.
Reimplemented in Garfield::SolidRidge.
Definition at line 59 of file Solid.hh.
Referenced by Garfield::ViewGeometry::Plot3d().
|
inlinevirtual |
Return true if the solid is a sphere.
Reimplemented in Garfield::SolidSphere.
Definition at line 55 of file Solid.hh.
Referenced by Garfield::ViewGeometry::Plot3d().
|
inlinevirtual |
Return true if the solid is a tube.
Reimplemented in Garfield::SolidTube.
Definition at line 53 of file Solid.hh.
Referenced by Garfield::ViewGeometry::Plot3d().
|
inlinevirtual |
Return true if the solid is a wire.
Reimplemented in Garfield::SolidWire.
Definition at line 63 of file Solid.hh.
Referenced by Garfield::ViewGeometry::Plot3d().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
protected |
Definition at line 12 of file Solid.cc.
Referenced by Garfield::SolidBox::SolidBox(), Garfield::SolidExtrusion::SolidExtrusion(), Garfield::SolidHole::SolidHole(), Garfield::SolidRidge::SolidRidge(), Garfield::SolidTube::SolidTube(), and Garfield::SolidWire::SolidWire().
|
pure virtual |
Set the discretisation level (for all panels).
Implemented in Garfield::SolidBox, Garfield::SolidExtrusion, Garfield::SolidHole, Garfield::SolidRidge, Garfield::SolidSphere, Garfield::SolidTube, and Garfield::SolidWire.
|
inline |
|
pure virtual |
Retrieve the surface panels of the solid.
Implemented in Garfield::SolidBox, Garfield::SolidExtrusion, Garfield::SolidHole, Garfield::SolidRidge, Garfield::SolidSphere, Garfield::SolidTube, and Garfield::SolidWire.
Referenced by Garfield::ComponentNeBem3d::Initialise().
|
inlineprotected |
Transform a point from local coordinates (u, v, w) to global coordinates (x, y, z).
Definition at line 246 of file Solid.hh.
Referenced by Garfield::SolidBox::Cut(), Garfield::SolidExtrusion::Cut(), Garfield::SolidHole::Cut(), Garfield::SolidRidge::Cut(), Garfield::SolidTube::Cut(), Garfield::SolidBox::SolidPanels(), Garfield::SolidExtrusion::SolidPanels(), Garfield::SolidHole::SolidPanels(), Garfield::SolidRidge::SolidPanels(), and Garfield::SolidTube::SolidPanels().
|
inlineprotected |
Transform a point from global coordinates (x, y, z) to local coordinates (u, v, w).
Definition at line 234 of file Solid.hh.
Referenced by Garfield::SolidHole::GetDiscretisationLevel(), Garfield::SolidBox::IsInside(), Garfield::SolidExtrusion::IsInside(), Garfield::SolidHole::IsInside(), Garfield::SolidRidge::IsInside(), Garfield::SolidTube::IsInside(), and Garfield::SolidWire::IsInside().
|
inlineprotected |
Transform a vector from global to local coordinates.
Definition at line 253 of file Solid.hh.
Referenced by Garfield::SolidBox::GetDiscretisationLevel(), Garfield::SolidExtrusion::GetDiscretisationLevel(), Garfield::SolidHole::GetDiscretisationLevel(), Garfield::SolidRidge::GetDiscretisationLevel(), and Garfield::SolidTube::GetDiscretisationLevel().
|
protected |
Type of boundary condition.
Definition at line 221 of file Solid.hh.
Referenced by GetBoundaryConditionType(), SetBoundaryChargeDensity(), SetBoundaryDielectric(), SetBoundaryFloat(), SetBoundaryParallelField(), SetBoundaryPerpendicularField(), and SetBoundaryPotential().
|
protected |
Surface charge density.
Definition at line 225 of file Solid.hh.
Referenced by GetBoundaryChargeDensity(), and SetBoundaryChargeDensity().
|
protected |
Class name.
Definition at line 212 of file Solid.hh.
Referenced by Garfield::SolidBox::GetDiscretisationLevel(), Garfield::SolidHole::GetDiscretisationLevel(), Garfield::SolidRidge::GetDiscretisationLevel(), GetProfile(), and SetDirection().
|
protected |
Colour.
Definition at line 230 of file Solid.hh.
Referenced by Garfield::SolidBox::Cut(), Garfield::SolidExtrusion::Cut(), Garfield::SolidHole::Cut(), Garfield::SolidRidge::Cut(), Garfield::SolidSphere::Cut(), Garfield::SolidTube::Cut(), GetColour(), SetColour(), Garfield::SolidBox::SolidPanels(), Garfield::SolidExtrusion::SolidPanels(), Garfield::SolidHole::SolidPanels(), Garfield::SolidRidge::SolidPanels(), and Garfield::SolidTube::SolidPanels().
|
protected |
Azimuthal angle.
Definition at line 207 of file Solid.hh.
Referenced by Garfield::SolidBox::GetBoundingBox(), Garfield::SolidHole::GetBoundingBox(), Garfield::SolidRidge::GetBoundingBox(), Garfield::SolidTube::GetBoundingBox(), Garfield::SolidWire::GetBoundingBox(), GetOrientation(), SetDirection(), Garfield::SolidBox::SolidPanels(), Garfield::SolidExtrusion::SolidPanels(), Garfield::SolidHole::SolidPanels(), Garfield::SolidRidge::SolidPanels(), Garfield::SolidTube::SolidPanels(), ToGlobal(), ToLocal(), and VectorToLocal().
|
protected |
Polar angle.
Definition at line 209 of file Solid.hh.
Referenced by Garfield::SolidBox::GetBoundingBox(), Garfield::SolidHole::GetBoundingBox(), Garfield::SolidRidge::GetBoundingBox(), Garfield::SolidTube::GetBoundingBox(), Garfield::SolidWire::GetBoundingBox(), GetOrientation(), SetDirection(), Garfield::SolidBox::SolidPanels(), Garfield::SolidExtrusion::SolidPanels(), Garfield::SolidHole::SolidPanels(), Garfield::SolidRidge::SolidPanels(), Garfield::SolidTube::SolidPanels(), ToGlobal(), ToLocal(), and VectorToLocal().
|
protected |
Centre of the solid.
Definition at line 202 of file Solid.hh.
Referenced by Garfield::SolidBox::GetBoundingBox(), Garfield::SolidExtrusion::GetBoundingBox(), Garfield::SolidHole::GetBoundingBox(), Garfield::SolidRidge::GetBoundingBox(), Garfield::SolidSphere::GetBoundingBox(), Garfield::SolidTube::GetBoundingBox(), Garfield::SolidWire::GetBoundingBox(), GetCentre(), Garfield::SolidSphere::IsInside(), Garfield::SolidExtrusion::SolidExtrusion(), ToGlobal(), and ToLocal().
|
protected |
Definition at line 202 of file Solid.hh.
Referenced by Garfield::SolidBox::GetBoundingBox(), Garfield::SolidExtrusion::GetBoundingBox(), Garfield::SolidHole::GetBoundingBox(), Garfield::SolidRidge::GetBoundingBox(), Garfield::SolidSphere::GetBoundingBox(), Garfield::SolidTube::GetBoundingBox(), Garfield::SolidWire::GetBoundingBox(), GetCentre(), Garfield::SolidSphere::IsInside(), Garfield::SolidExtrusion::SolidExtrusion(), ToGlobal(), and ToLocal().
|
protected |
Definition at line 202 of file Solid.hh.
Referenced by Garfield::SolidBox::GetBoundingBox(), Garfield::SolidExtrusion::GetBoundingBox(), Garfield::SolidHole::GetBoundingBox(), Garfield::SolidRidge::GetBoundingBox(), Garfield::SolidSphere::GetBoundingBox(), Garfield::SolidTube::GetBoundingBox(), Garfield::SolidWire::GetBoundingBox(), GetCentre(), Garfield::SolidSphere::IsInside(), Garfield::SolidExtrusion::SolidExtrusion(), ToGlobal(), and ToLocal().
|
protected |
Debug flag.
Definition at line 218 of file Solid.hh.
Referenced by EnableDebugging(), Garfield::SolidBox::GetDiscretisationLevel(), Garfield::SolidHole::GetDiscretisationLevel(), and Garfield::SolidRidge::GetDiscretisationLevel().
|
protected |
Direction vector.
Definition at line 205 of file Solid.hh.
Referenced by GetDirection(), SetDirection(), Garfield::SolidExtrusion::SolidPanels(), Garfield::SolidHole::SolidPanels(), Garfield::SolidRidge::SolidPanels(), and Garfield::SolidTube::SolidPanels().
|
protected |
Definition at line 205 of file Solid.hh.
Referenced by GetDirection(), SetDirection(), Garfield::SolidExtrusion::SolidPanels(), Garfield::SolidHole::SolidPanels(), Garfield::SolidRidge::SolidPanels(), and Garfield::SolidTube::SolidPanels().
|
protected |
Definition at line 205 of file Solid.hh.
Referenced by GetDirection(), SetDirection(), Garfield::SolidExtrusion::SolidPanels(), Garfield::SolidHole::SolidPanels(), Garfield::SolidRidge::SolidPanels(), and Garfield::SolidTube::SolidPanels().
|
protected |
|
protected |
|
protected |
Definition at line 207 of file Solid.hh.
Referenced by GetOrientation(), SetDirection(), Garfield::SolidBox::SolidPanels(), Garfield::SolidExtrusion::SolidPanels(), Garfield::SolidHole::SolidPanels(), Garfield::SolidRidge::SolidPanels(), Garfield::SolidTube::SolidPanels(), ToGlobal(), ToLocal(), and VectorToLocal().
|
protected |
Definition at line 209 of file Solid.hh.
Referenced by GetOrientation(), SetDirection(), Garfield::SolidBox::SolidPanels(), Garfield::SolidExtrusion::SolidPanels(), Garfield::SolidHole::SolidPanels(), Garfield::SolidRidge::SolidPanels(), Garfield::SolidTube::SolidPanels(), ToGlobal(), ToLocal(), and VectorToLocal().
|
protected |
Potential at the surface.
Definition at line 223 of file Solid.hh.
Referenced by GetBoundaryPotential(), and SetBoundaryPotential().