1#ifndef G_COMPONENT_CST_H
2#define G_COMPONENT_CST_H
26 unsigned int& nz)
const;
28 bool GetElement(
const size_t i,
size_t& mat,
bool& drift,
29 std::vector<size_t>& nodes)
const override;
31 bool GetNode(
const size_t i,
double& x,
double& y,
double& z)
const override;
34 double& ymin,
double& ymax,
double& zmin,
37 Medium*
GetMedium(
const double x,
const double y,
const double z)
override;
38 void ElectricField(
const double x,
const double y,
const double z,
double& ex,
39 double& ey,
double& ez,
Medium*& m,
int& status)
override;
40 void ElectricField(
const double x,
const double y,
const double z,
double& ex,
41 double& ey,
double& ez,
double& v,
Medium*& m,
42 int& status)
override;
43 void WeightingField(
const double x,
const double y,
const double z,
44 double& wx,
double& wy,
double& wz,
45 const std::string& label)
override;
48 const std::string& label)
override;
93 bool Initialise(std::string elist, std::string nlist, std::string mplist,
94 std::string prnsol, std::string unit =
"cm");
105 bool Initialise(std::string dataFile, std::string unit =
"cm");
119 bool isBinary =
true);
123 void SetRangeZ(
const double zmin,
const double zmax);
187 int Index2Element(
const unsigned int i,
const unsigned int j,
188 const unsigned int k)
const;
197 unsigned int& i,
unsigned int& j,
unsigned int& k)
const;
204 double& dmax)
override;
224 unsigned int& i,
unsigned int& j,
unsigned int& k,
225 double* position_mapped,
bool* mirrored)
const;
228 std::vector<double> m_xlines;
229 std::vector<double> m_ylines;
230 std::vector<double> m_zlines;
232 std::vector<float> m_potential;
234 std::map<std::string, std::vector<float> > m_weightingFields;
236 std::vector<unsigned char> m_elementMaterial;
238 unsigned int m_nx = 0;
239 unsigned int m_ny = 0;
240 unsigned int m_nz = 0;
241 size_t m_nElements = 0;
244 bool disableFieldComponent[3] = {
false,
false,
false};
245 bool doShaping =
false;
247 void ElectricFieldBinary(
const double x,
const double y,
const double z,
248 double& ex,
double& ey,
double& ez,
double& v,
249 Medium*& m,
int& status,
250 const bool calculatePotential =
false)
const;
251 float GetFieldComponent(
const unsigned int i,
const unsigned int j,
252 const unsigned int k,
const double rx,
253 const double ry,
const double rz,
254 const char component,
255 const std::vector<float>& potentials)
const;
257 float GetPotential(
const unsigned int i,
const unsigned int j,
258 const unsigned int k,
259 const double rx,
const double ry,
const double rz,
260 const std::vector<float>& potentials)
const;
262 void ShapeField(
float& ex,
float& ey,
float& ez,
const double rx,
263 const double ry,
const double rz,
const unsigned int i,
264 const unsigned int j,
const unsigned int k,
265 const std::vector<float>& potentials)
const;
271 void Element2Index(
const size_t element,
unsigned int& i,
unsigned int& j,
272 unsigned int& k)
const;
274 int Index2Node(
const unsigned int i,
const unsigned int j,
275 const unsigned int k)
const;
277 void Node2Index(
const size_t node,
unsigned int& i,
unsigned int& j,
278 unsigned int& k)
const;
bool Coordinate2Index(const double x, const double y, const double z, unsigned int &i, unsigned int &j, unsigned int &k) const
void UpdatePeriodicity() override
Verify periodicities.
~ComponentCST()
Destructor.
bool GetElement(const size_t i, size_t &mat, bool &drift, std::vector< size_t > &nodes) const override
Return the material and node indices of a mesh element.
void ElectricField(const double x, const double y, const double z, double &ex, double &ey, double &ez, Medium *&m, int &status) override
size_t GetNumberOfElements() const override
Return the number of mesh elements.
size_t GetNumberOfNodes() const override
double GetElementVolume(const unsigned int i) override
void WeightingField(const double x, const double y, const double z, double &wx, double &wy, double &wz, const std::string &label) override
bool Initialise(std::string elist, std::string nlist, std::string mplist, std::string prnsol, std::string unit="cm")
bool GetNode(const size_t i, double &x, double &y, double &z) const override
Medium * GetMedium(const double x, const double y, const double z) override
Get the medium at a given location (x, y, z).
void GetElementBoundaries(unsigned int element, double &xmin, double &xmax, double &ymin, double &ymax, double &zmin, double &zmax) const
void GetNumberOfMeshLines(unsigned int &nx, unsigned int &ny, unsigned int &nz) const
bool SetWeightingField(std::string prnsol, std::string label, bool isBinary=true)
double WeightingPotential(const double x, const double y, const double z, const std::string &label) override
void ShiftComponent(const double xShift, const double yShift, const double zShift)
void SetRange() override
Calculate x, y, z, V and angular ranges.
void GetAspectRatio(const unsigned int i, double &dmin, double &dmax) override
void SetRangeZ(const double zmin, const double zmax)
ComponentCST()
Constructor.
int Index2Element(const unsigned int i, const unsigned int j, const unsigned int k) const
Base class for components based on finite-element field maps.
Abstract base class for media.