15 std::vector<double>
xv;
17 std::vector<double>
yv;
19 std::vector<double>
zv;
33 Solid(
const double cx,
const double cy,
const double cz,
34 const std::string& name)
43 virtual bool IsInside(
const double x,
const double y,
44 const double z)
const = 0;
47 double& xmax,
double& ymax,
48 double& zmax)
const = 0;
50 virtual bool IsBox()
const {
return false; }
52 virtual bool IsTube()
const {
return false; }
54 virtual bool IsSphere()
const {
return false; }
56 virtual bool IsHole()
const {
return false; }
58 virtual bool IsRidge()
const {
return false; }
61 bool GetCentre(
double& x,
double& y,
double& z)
const {
79 return NotImplemented(
"GetHalfLengthX");
83 return NotImplemented(
"GetHalfLengthY");
87 return NotImplemented(
"GetHalfLengthZ");
91 return NotImplemented(
"GetInnerRadius");
95 return NotImplemented(
"GetOuterRadius");
98 virtual double GetRadius()
const {
return NotImplemented(
"GetRadius"); }
101 return NotImplemented(
"GetLowerRadius");
105 return NotImplemented(
"GetUpperRadius");
109 return NotImplemented(
"GetRidgeOffset");
113 return NotImplemented(
"GetRidgeHeight");
117 unsigned int GetId()
const {
return m_id; }
190 void ToLocal(
const double x,
const double y,
const double z,
double& u,
191 double& v,
double& w)
const {
192 const double dx = x -
m_cX;
193 const double dy = y -
m_cY;
194 const double dz = z -
m_cZ;
202 void ToGlobal(
const double u,
const double v,
const double w,
double& x,
203 double& y,
double& z)
const {
210 double& u,
double& v,
double& w) {
216 void SetDirection(
const double dx,
const double dy,
const double dz);
219 double NotImplemented(
const std::string& fcn)
const;
221 static unsigned int s_id;
Abstract base class for solids.
void SetBoundaryChargeDensity(const double q)
Apply fixed-charge boundary conditions.
void EnableDebugging(const bool on=true)
Switch debugging messages on/off.
virtual double GetUpperRadius() const
Return the upper radius (of a hole).
double m_charge
Surface charge density.
virtual bool IsTube() const
Return true if the solid is a tube.
virtual bool IsRidge() const
Return true if the solid is a ridge.
virtual double GetHalfLengthX() const
Return the half-length along x.
virtual bool IsHole() const
Return true if the solid is a hole.
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 SetBoundaryPotential(const double v)
Apply Dirichlet boundary conditions (fixed voltage).
double m_eps
Dielectric constant.
double m_cTheta
Polar angle.
virtual double GetHalfLengthZ() const
Return the half-length along z.
virtual ~Solid()
Destructor.
virtual bool IsInside(const double x, const double y, const double z) const =0
Check whether a given point is inside the solid.
virtual bool IsBox() const
Return true if the solid is a box.
virtual double GetHalfLengthY() const
Return the half-length along y.
double m_dX
Direction vector.
bool GetCentre(double &x, double &y, double &z) const
Retrieve the centre point of the solid.
virtual double GetDiscretisationLevel(const Panel &panel)=0
Retrieve the discretization level of a panel.
unsigned int GetId() const
Get the ID of the solid.
double GetBoundaryChargeDensity() const
Retrieve the surface charge density.
void ToLocal(const double x, const double y, const double z, double &u, double &v, double &w) const
void SetDirection(const double dx, const double dy, const double dz)
BoundaryCondition GetBoundaryConditionType() const
Retrieve the type of boundary condition.
Solid(const double cx, const double cy, const double cz, const std::string &name)
Constructor.
virtual double GetRidgeOffset() const
Return the x-offset of a ridge.
double m_volt
Potential at the surface.
BoundaryCondition m_bctype
Type of boundary condition.
virtual double GetLowerRadius() const
Return the lower radius (of a hole).
virtual double GetOuterRadius() const
Return the outer radius.
double GetBoundaryPotential() const
Retrieve the potential.
void SetBoundaryParallelField()
bool GetOrientation(double &ctheta, double &stheta, double &cphi, double &sphi) const
Retrieve the orientation (azimuthal and polar angles) of the solid.
void SetBoundaryPerpendicularField()
void ToGlobal(const double u, const double v, const double w, double &x, double &y, double &z) const
virtual double GetRadius() const
Return the radius.
virtual bool IsSphere() const
Return true if the solid is a sphere.
virtual bool GetBoundingBox(double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) const =0
Return the bounding box of the solid.
double m_cX
Centre of the solid.
virtual double GetInnerRadius() const
Return the inner radius.
virtual double GetRidgeHeight() const
Return the height of a ridge.
double m_cPhi
Azimuthal angle.
void SetBoundaryFloat()
Make the potential at the surface of the solid floating.
virtual bool SolidPanels(std::vector< Panel > &panels)=0
Retrieve the surface panels of the solid.
std::string m_className
Class name.
Solid()=delete
Default constructor.
void SetBoundaryDielectric()
Make the surfaces of the solid dielectric-dielectric interfaces.
std::vector< double > zv
Z-coordinates of vertices.
int volume
Reference to solid to which the panel belongs.
double a
Perpendicular vector.
double colour
Colour index.
std::vector< double > xv
X-coordinates of vertices.
std::vector< double > yv
Y-coordinates of vertices.