1#ifndef G_COMPONENT_NEBEM_3D_H
2#define G_COMPONENT_NEBEM_3D_H
21 Medium*
GetMedium(
const double x,
const double y,
const double z)
override;
24 void AddPlaneX(
const double x,
const double voltage);
26 void AddPlaneY(
const double y,
const double voltage);
28 void AddPlaneZ(
const double z,
const double voltage);
36 bool GetPlaneX(
const unsigned int i,
double& x,
double& v)
const;
38 bool GetPlaneY(
const unsigned int i,
double& y,
double& v)
const;
40 bool GetPlaneZ(
const unsigned int i,
double& z,
double& v)
const;
43 bool GetPrimitive(
const unsigned int i,
double& a,
double& b,
double& c,
44 std::vector<double>& xv, std::vector<double>& yv,
45 std::vector<double>& zv,
int& interface,
double& v,
46 double& q,
double& lambda)
const;
47 bool GetPrimitive(
const unsigned int i,
double& a,
double& b,
double& c,
48 std::vector<double>& xv, std::vector<double>& yv,
49 std::vector<double>& zv,
int& vol1,
int& vol2)
const;
50 bool GetVolume(
const unsigned int vol,
int& shape,
int& material,
double& eps,
51 double& potential,
double& charge,
int& bc);
52 int GetVolume(
const double x,
const double y,
const double z);
55 bool GetElement(
const unsigned int i, std::vector<double>& xv,
56 std::vector<double>& yv, std::vector<double>& zv,
57 int& interface,
double& bc,
double& lambda)
const;
69 const unsigned int nmax);
76 const unsigned int NewBC,
const unsigned int NewPP);
94 const unsigned int OptReadInflMatrix,
95 const unsigned int OptStoreInvMatrix,
96 const unsigned int OptReadInvMatrix,
97 const unsigned int OptStorePrimitives,
98 const unsigned int OptReadPrimitives,
99 const unsigned int OptStoreElements,
100 const unsigned int OptReadElements,
101 const unsigned int OptFormattedFile,
102 const unsigned int OptUnformattedFile);
120 const unsigned int OptValidateSolution,
121 const unsigned int OptForceValidation,
122 const unsigned int OptRepeatLHMatrix);
126 const unsigned int OptCreateFastPF,
127 const unsigned int OptReadFastPF);
134 const unsigned int OptWtFldFastVol,
135 const unsigned int OptCreateWtFldFastPF,
136 const unsigned int OptReadWtFldFastPF);
138 const unsigned int VersionWtFldFV);
140 const unsigned int NbBlocksWtFldFV);
157 const unsigned int nz);
160 unsigned int& nz)
const {
200 void ElectricField(
const double x,
const double y,
const double z,
double& ex,
201 double& ey,
double& ez, Medium*& m,
int& status)
override;
202 void ElectricField(
const double x,
const double y,
const double z,
double& ex,
203 double& ey,
double& ez,
double& v, Medium*& m,
204 int& status)
override;
205 using Component::ElectricField;
209 double& wx,
double& wy,
double& wz,
210 const std::string& label)
override;
212 const std::string& label)
override;
223 std::vector<double>
xv;
225 std::vector<double>
yv;
227 std::vector<double>
zv;
252 std::array<std::array<double, 3>, 3>
dcos;
254 std::vector<double>
xv;
256 std::vector<double>
yv;
258 std::vector<double>
zv;
276 std::array<bool, 6>
m_ynplan{{
false,
false,
false,
false,
false,
false}};
278 std::array<double, 6>
m_coplan{{0., 0., 0., 0., 0., 0.}};
280 std::array<double, 6>
m_vtplan{{0., 0., 0., 0., 0., 0.}};
376 std::vector<Panel>& panelsOut,
377 std::vector<int>& itypo);
380 const std::vector<double>& yl1,
381 const std::vector<double>& xl2,
382 const std::vector<double>& yl2,
const Panel& originalPanel,
383 std::vector<Panel>& newPanels)
const;
386 const std::vector<double>& xp1,
const std::vector<double>& yp1,
387 const std::vector<double>& xl1,
const std::vector<double>& yl1,
388 const std::vector<double>& xl2,
const std::vector<double>& yl2,
389 const std::vector<int>& flags1,
const std::vector<int>& flags2,
390 const std::vector<int>& links1,
const std::vector<int>& links2,
391 std::vector<bool>& mark1,
int ip1,
const Panel& originalPanel,
392 std::vector<Panel>& newPanels)
const;
395 const std::vector<double>& xp1,
const std::vector<double>& yp1,
396 const std::vector<double>& xp2,
const std::vector<double>& yp2,
397 const std::vector<double>& xl1,
const std::vector<double>& yl1,
398 const std::vector<double>& xl2,
const std::vector<double>& yl2,
399 const std::vector<int>& flags1,
const std::vector<int>& links1,
400 const std::vector<int>& links2, std::vector<bool>& mark1,
int ip1,
401 int ip2,
const Panel& originalPanel, std::vector<Panel>& newPanels)
const;
405 std::vector<Panel>& panelsOut)
const;
410 std::vector<Panel>& panelsOut,
const double epsang)
const;
412 unsigned int NbOfSegments(
const double length,
const double target)
const;
414 std::vector<Element>& elements)
const;
416 std::vector<Element>& elements)
const;
418 std::vector<Element>& elements)
const;
bool GetPlaneZ(const unsigned int i, double &z, double &v) const
Retrieve the parameters of a plane at constant z.
bool GetPlaneY(const unsigned int i, double &y, double &v) const
Retrieve the parameters of a plane at constant y.
void SetSystemChargeZero(const unsigned int OptSystemChargeZero)
Other functions to be, are void SetPlotOptions(OptGnuplot=0, OptGnuplotPrimitives=0,...
void SetWtFldPrimAfter(const int n)
Set the number of repetitions after which primitive properties are used for the weighting field.
void ShiftPanels(std::vector< Panel > &panels) const
Reduce panels to the basic period.
unsigned int m_versionWtFldFV[11]
void AddPlaneZ(const double z, const double voltage)
Add a plane at constant z.
bool SplitTrapezium(const Panel panelIn, std::vector< Panel > &stack, std::vector< Panel > &panelsOut, const double epsang) const
Check whether a polygon contains parallel lines.
std::vector< Primitive > m_primitives
List of primitives.
ComponentNeBem3d()
Constructor.
unsigned int m_optChargingUp
bool DiscretizeTriangle(const Primitive &primitive, const double targetSize, std::vector< Element > &elements) const
bool GetPeriodicityX(double &s) const
Get the periodic length in the x-direction.
void SetPrimAfter(const int n)
Set the number of repetitions after which primitive properties are used for the physical field.
unsigned int m_optStoreInflMatrix
unsigned int m_optStoreInvMatrix
static constexpr double MinDist
unsigned int m_optValidateSolution
unsigned int GetNumberOfPrimitives() const
std::map< std::string, int > m_wfields
Electrode labels and corresponding neBEM weighting field indices.
void SetFastVolBlocks(const unsigned int NbBlocksFV)
void SetStoreElements(const unsigned int OptStoreElements)
std::array< double, 3 > m_periodicLength
Periodic lengths.
void SetWtFldFastVolVersion(const unsigned int IdWtField, const unsigned int VersionWtFldFV)
unsigned int m_optReadInflMatrix
unsigned int m_optCreateFastPF
bool GetPeriodicityZ(double &s) const
Get the periodic length in the z-direction.
bool DiscretizeWire(const Primitive &primitive, const double targetSize, std::vector< Element > &elements) const
unsigned int m_optStoreUnformatted
void SetUnformattedFile(const unsigned int OptUnformattedFile)
unsigned int m_optReadPrimitives
void SetMirrorPeriodicityX(const double s)
Set the periodic length [cm] in the x-direction.
unsigned int m_minNbElementsOnLength
Smallest number of elements produced along the axis of a primitive.
void TraceNonOverlap(const std::vector< double > &xp1, const std::vector< double > &yp1, const std::vector< double > &xl1, const std::vector< double > &yl1, const std::vector< double > &xl2, const std::vector< double > &yl2, const std::vector< int > &flags1, const std::vector< int > &flags2, const std::vector< int > &links1, const std::vector< int > &links2, std::vector< bool > &mark1, int ip1, const Panel &originalPanel, std::vector< Panel > &newPanels) const
void SetOptRmPrim(const unsigned int n)
Set option related to removal of primitives.
void SetPeriodicityX(const double s)
Set the periodic length [cm] in the x-direction.
void SetWtFldFastVolOptions(const unsigned int IdWtField, const unsigned int OptWtFldFastVol, const unsigned int OptCreateWtFldFastPF, const unsigned int OptReadWtFldFastPF)
void UpdatePeriodicity() override
bool GetVoltageRange(double &vmin, double &vmax) override
unsigned int m_optSystemChargeZero
void SetStoreReadOptions(const unsigned int OptStoreInflMatrix, const unsigned int OptReadInflMatrix, const unsigned int OptStoreInvMatrix, const unsigned int OptReadInvMatrix, const unsigned int OptStorePrimitives, const unsigned int OptReadPrimitives, const unsigned int OptStoreElements, const unsigned int OptReadElements, const unsigned int OptFormattedFile, const unsigned int OptUnformattedFile)
unsigned int GetNumberOfPlanesY() const
Get the number of equipotential planes at constant y.
bool GetPeriodicityY(double &s) const
Get the periodic length in the y-direction.
bool EliminateOverlaps(const Panel &panel1, const Panel &panel2, std::vector< Panel > &panelsOut, std::vector< int > &itypo)
Isolate the parts of polygon 1 that are not hidden by 2 and vice versa.
void SetReadPrimitives(const unsigned int OptReadPrimitives)
unsigned int GetNumberOfPlanesZ() const
Get the number of equipotential planes at constant z.
unsigned int m_maxNbElementsOnLength
Largest number of elements produced along the axis of a primitive.
unsigned int m_optStorePrimitives
void SetNumberOfThreads(const unsigned int n)
Set the number of threads to be used by neBEM.
void SetReadInvMatrix(const unsigned int OptReadInvMatrix)
unsigned int m_optStoreElements
void AddPlaneY(const double y, const double voltage)
Add a plane at constant y.
void AddPlaneX(const double x, const double voltage)
Add a plane at constant x.
void SetForceValidation(const unsigned int OptForceValidation)
double m_targetElementSize
Target size of elements [cm].
unsigned int m_optForceValidation
unsigned int m_optReadElements
void SetRepeatLHMatrix(const unsigned int OptRepeatLHMatrix)
unsigned int m_optReadWtFldFastPF[11]
void SetValidateSolution(const unsigned int OptValidateSolution)
void SetMirrorPeriodicityZ(const double s)
Set the periodic length [cm] in the z-direction.
void SetPeriodicityZ(const double s)
Set the periodic length [cm] in the z-direction.
bool GetVolume(const unsigned int vol, int &shape, int &material, double &eps, double &potential, double &charge, int &bc)
bool DiscretizeRectangle(const Primitive &prim, const double targetSize, std::vector< Element > &elements) const
void SetPeriodicityY(const double s)
Set the periodic length [cm] in the y-direction.
std::array< bool, 6 > m_ynplan
Plane existence.
void UseSVDInversion()
Invert the influence matrix using singular value decomposition.
Medium * GetMedium(const double x, const double y, const double z) override
int GetVolume(const double x, const double y, const double z)
unsigned int m_optCreateWtFldFastPF[11]
unsigned int m_optKnownCharge
std::vector< Element > m_elements
List of elements.
void SetNewMesh(const unsigned int NewMesh)
void TraceOverlap(const std::vector< double > &xp1, const std::vector< double > &yp1, const std::vector< double > &xp2, const std::vector< double > &yp2, const std::vector< double > &xl1, const std::vector< double > &yl1, const std::vector< double > &xl2, const std::vector< double > &yl2, const std::vector< int > &flags1, const std::vector< int > &links1, const std::vector< int > &links2, std::vector< bool > &mark1, int ip1, int ip2, const Panel &originalPanel, std::vector< Panel > &newPanels) const
bool GetPrimitive(const unsigned int i, double &a, double &b, double &c, std::vector< double > &xv, std::vector< double > &yv, std::vector< double > &zv, int &vol1, int &vol2) const
unsigned int GetNumberOfPlanesX() const
Get the number of equipotential planes at constant x.
bool GetElement(const unsigned int i, std::vector< double > &xv, std::vector< double > &yv, std::vector< double > &zv, int &interface, double &bc, double &lambda) const
void SetTargetElementSize(const double length)
Set the default value of the target linear size of the elements produced by neBEM's discretisation pr...
std::array< double, 6 > m_coplan
Plane coordinates.
void SetStoreInvMatrix(const unsigned int OptStoreInvMatrix)
unsigned int m_nCopiesZ
Number of periodic copies along z.
void SetWtFldFastVolBlocks(const unsigned int IdWtField, const unsigned int NbBlocksWtFldFV)
void SetMirrorPeriodicityY(const double s)
Set the periodic length [cm] in the y-direction.
void SetPeriodicCopies(const unsigned int nx, const unsigned int ny, const unsigned int nz)
Set the parameters defining the number of periodic copies that neBEM will use when dealing with peri...
void SetComputeOptions(const unsigned int OptSystemChargeZero, const unsigned int OptValidateSolution, const unsigned int OptForceValidation, const unsigned int OptRepeatLHMatrix)
~ComponentNeBem3d()
Destructor.
bool GetPrimitive(const unsigned int i, double &a, double &b, double &c, std::vector< double > &xv, std::vector< double > &yv, std::vector< double > &zv, int &interface, double &v, double &q, double &lambda) const
unsigned int m_nbBlocksFV
std::array< double, 6 > m_vtplan
Plane potentials.
unsigned int m_nbBlocksWtFldFV[11]
unsigned int m_nCopiesY
Number of periodic copies along y.
void SetFastVolOptions(const unsigned int OptFastVol, const unsigned int OptCreateFastPF, const unsigned int OptReadFastPF)
void SetMinMaxNumberOfElements(const unsigned int nmin, const unsigned int nmax)
Set the smallest and largest allowed number of elements along the lenght of a primitive.
unsigned int m_optReadFastPF
void SetReadInflMatrix(const unsigned int OptReadInflMatrix)
void SetChargingUpOptions(const unsigned int OptChargingUp)
void SetNewBC(const unsigned int NewBC)
void SetModelOptions(const unsigned int NewModel, const unsigned int NewMesh, const unsigned int NewBC, const unsigned int NewPP)
void SetFastVolVersion(const unsigned int VersionFV)
unsigned int m_optReadInvMatrix
unsigned int NbOfSegments(const double length, const double target) const
void ElectricField(const double x, const double y, const double z, double &ex, double &ey, double &ez, double &v, Medium *&m, int &status) override
unsigned int m_optWtFldFastVol[11]
size_t GetNumberOfElements() const override
void ElectricField(const double x, const double y, const double z, double &ex, double &ey, double &ez, Medium *&m, int &status) override
void SetStoreInflMatrix(const unsigned int OptStoreInflMatrix)
Set storing options (OptStoreInflMatrix, OptStoreInvMatrix, OptStoreInvMatrix, OptStoreInvMatrix) Opt...
void UseLUInversion()
Invert the influence matrix using lower-upper (LU) decomposition.
bool TraceEnclosed(const std::vector< double > &xl1, const std::vector< double > &yl1, const std::vector< double > &xl2, const std::vector< double > &yl2, const Panel &originalPanel, std::vector< Panel > &newPanels) const
bool Initialise()
Retrieve surface panels, remove contacts and cut polygons to rectangles and right-angle triangles.
unsigned int m_optStoreFormatted
void SetNewPP(const unsigned int NewPP)
void SetNewModel(const unsigned int NewModel)
void SetReadElements(const unsigned int OptReadElements)
unsigned int m_optRepeatLHMatrix
bool MakePrimitives(const Panel &panelIn, std::vector< Panel > &panelsOut) const
Split a polygon into rectangles and right-angled triangles.
bool GetPlaneX(const unsigned int i, double &x, double &v) const
Retrieve the parameters of a plane at constant x.
int InterfaceType(const Solid::BoundaryCondition bc) const
unsigned int m_nCopiesX
Number of periodic copies along x.
double WeightingPotential(const double x, const double y, const double z, const std::string &label) override
unsigned int m_optFastVol
void SetKnownChargeOptions(const unsigned int OptKnownCharge)
void GetPeriodicCopies(unsigned int &nx, unsigned int &ny, unsigned int &nz) const
Retrieve the number of periodic copies used by neBEM.
void SetStorePrimitives(const unsigned int OptStorePrimitives)
void WeightingField(const double x, const double y, const double z, double &wx, double &wy, double &wz, const std::string &label) override
void SetFormattedFile(const unsigned int OptFormattedFile)
ComponentNeBem3d * gComponentNeBem3d
double bc
Boundary condition.
std::vector< double > xv
X-coordinates of vertices.
double lambda
Ratio of dielectric permittivities.
double solution
Solution (accumulated charge).
std::vector< double > zv
Z-coordinates of vertices.
std::array< double, 3 > collocationPoint
Collocation point.
std::array< std::array< double, 3 >, 3 > dcos
Direction cosines.
std::array< double, 3 > origin
Local origin.
double assigned
Fixed charge density.
std::vector< double > yv
Y-coordinates of vertices.
double elementSize
Target element size.
double a
Perpendicular vector.
double lambda
Ratio of dielectric constants.
std::vector< double > zv
Z-coordinates of vertices.
std::vector< double > xv
X-coordinates of vertices.
std::vector< double > yv
Y-coordinates of vertices.