1#ifndef G_COMPONENT_CST_H
2#define G_COMPONENT_CST_H
25 Medium*
GetMedium(
const double x,
const double y,
const double z)
override;
29 double& ymin,
double& ymax,
double& zmin,
32 return m_elementMaterial.at(element);
34 void ElectricField(
const double x,
const double y,
const double z,
double& ex,
35 double& ey,
double& ez,
Medium*& m,
int& status)
override;
36 void ElectricField(
const double x,
const double y,
const double z,
double& ex,
37 double& ey,
double& ez,
double& v,
Medium*& m,
38 int& status)
override;
39 void WeightingField(
const double x,
const double y,
const double z,
40 double& wx,
double& wy,
double& wz,
41 const std::string& label)
override;
44 const std::string& label)
override;
89 bool Initialise(std::string elist, std::string nlist, std::string mplist,
90 std::string prnsol, std::string unit =
"cm");
101 bool Initialise(std::string dataFile, std::string unit =
"cm");
115 bool isBinary =
true);
119 void SetRangeZ(
const double zmin,
const double zmax);
183 int Index2Element(
const unsigned int i,
const unsigned int j,
184 const unsigned int k);
193 unsigned int& i,
unsigned int& j,
unsigned int& k);
200 double& dmax)
override;
229 unsigned int& i,
unsigned int& j,
unsigned int& k,
230 double* position_mapped,
bool* mirrored,
231 double& rcoordinate,
double& rotation);
234 std::vector<double> m_xlines;
235 std::vector<double> m_ylines;
236 std::vector<double> m_zlines;
239 std::map<std::string, std::vector<float> >
241 std::vector<unsigned char> m_elementMaterial;
249 bool disableFieldComponent[3];
251 static const unsigned int headerSize =
253 void ElectricFieldBinary(
const double x,
const double y,
const double z,
254 double& ex,
double& ey,
double& ez,
double& v,
256 const bool calculatePotential =
false);
257 float GetFieldComponent(
const unsigned int i,
const unsigned int j,
258 const unsigned int k,
const double rx,
259 const double ry,
const double rz,
260 const char component,
261 const std::vector<float>* potentials);
263 float GetPotential(
const unsigned int i,
const unsigned int j,
264 const unsigned int k,
const double rx,
const double ry,
265 const double rz,
const std::vector<float>* potentials);
267 void ShapeField(
float& ex,
float& ey,
float& ez,
const double rx,
268 const double ry,
const double rz,
const unsigned int i,
269 const unsigned int j,
const unsigned int k,
270 std::vector<float>* potentials);
276 void Element2Index(
int element,
unsigned int& i,
unsigned int& j,
279 int Index2Node(
const unsigned int i,
const unsigned int j,
280 const unsigned int k);
bool Coordinate2Index(const double x, const double y, const double z, unsigned int &i, unsigned int &j, unsigned int &k)
void GetNumberOfMeshLines(unsigned int &n_x, unsigned int &n_y, unsigned int &n_z)
void UpdatePeriodicity() override
Verify periodicities.
int GetElementMaterial(unsigned int element)
~ComponentCST()
Destructor.
void ElectricField(const double x, const double y, const double z, double &ex, double &ey, double &ez, Medium *&m, int &status) override
int Index2Element(const unsigned int i, const unsigned int j, const unsigned int k)
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")
Medium * GetMedium(const double x, const double y, const double z) override
Get the medium at a given location (x, y, z).
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 GetElementBoundaries(unsigned int element, double &xmin, double &xmax, double &ymin, double &ymax, double &zmin, double &zmax)
void GetAspectRatio(const unsigned int i, double &dmin, double &dmax) override
void SetRangeZ(const double zmin, const double zmax)
ComponentCST()
Constructor.
Base class for components based on finite-element field maps.
Abstract base class for media.
Helper struct for drawing the mesh with ViewFEMesh.