6#ifndef G_COMPONENT_CST_H
7#define G_COMPONENT_CST_H
23 void ShiftComponent(
const double xShift,
const double yShift,
const double zShift);
28 double &ymin,
double &ymax,
double &zmin,
double &zmax);
30 void ElectricField(
const double x,
const double y,
const double z,
double& ex,
31 double& ey,
double& ez,
Medium*& m,
int& status);
32 void ElectricField(
const double x,
const double y,
const double z,
double& ex,
33 double& ey,
double& ez,
double& v,
Medium*& m,
35 void WeightingField(
const double x,
const double y,
const double z,
36 double& wx,
double& wy,
double& wz,
37 const std::string label);
40 const std::string label);
85 std::string prnsol, std::string unit =
"cm");
93 bool Initialise(std::string dataFile, std::string unit =
"cm");
104 bool SetWeightingField(std::string prnsol, std::string label,
bool isBinary =
true);
114 void SetRangeZ(
const double zmin,
const double zmax);
126 disableFieldComponent[0] =
true;
129 disableFieldComponent[1] =
true;
132 disableFieldComponent[2] =
true;
173 int Index2Element(
const unsigned int i,
const unsigned int j,
const unsigned int k);
180 unsigned int &i,
unsigned int &j,
unsigned int &k);
207 unsigned int &i,
unsigned int &j,
unsigned int &k,
208 double *position_mapped,
bool *mirrored,
209 double &rcoordinate,
double &rotation);
212 std::vector<double> m_xlines;
213 std::vector<double> m_ylines;
214 std::vector<double> m_zlines;
215 std::vector<float> m_potential;
216 std::map<std::string,std::vector<float> > m_weightingFields;
217 std::vector<unsigned char> m_elementMaterial;
222 bool disableFieldComponent[3];
224 static const unsigned int headerSize = 1000;
225 void ElectricFieldBinary(
const double x,
const double y,
const double z,
double& ex,
226 double& ey,
double& ez,
double& v,
Medium*& m,
227 int& status,
const bool calculatePotential =
false);
228 float GetFieldComponent(
const unsigned int i,
const unsigned int j,
const unsigned int k,
229 const double rx,
const double ry,
const double rz,
230 const char component,
const std::vector<float>* potentials);
232 float GetPotential(
const unsigned int i,
const unsigned int j,
const unsigned int k,
233 const double rx,
const double ry ,
const double rz,
const std::vector<float>* potentials);
235 void ShapeField(
float &ex,
float &ey,
float &ez,
236 const double rx,
const double ry,
const double rz,
237 const unsigned int i,
const unsigned int j,
const unsigned int k,
238 std::vector<float>* potentials);
244 void Element2Index(
int element,
unsigned int& i,
unsigned int& j,
unsigned int& k);
246 int Index2Node(
const unsigned int i,
const unsigned int j,
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)
int GetElementMaterial(unsigned int element)
void ElectricField(const double x, const double y, const double z, double &ex, double &ey, double &ez, Medium *&m, int &status)
int Index2Element(const unsigned int i, const unsigned int j, const unsigned int k)
void GetAspectRatio(const int i, double &dmin, double &dmax)
double WeightingPotential(const double x, const double y, const double z, const std::string label)
bool Initialise(std::string elist, std::string nlist, std::string mplist, std::string prnsol, std::string unit="cm")
bool SetWeightingField(std::string prnsol, std::string label, bool isBinary=true)
void ShiftComponent(const double xShift, const double yShift, const double zShift)
void GetElementBoundaries(unsigned int element, double &xmin, double &xmax, double &ymin, double &ymax, double &zmin, double &zmax)
void WeightingField(const double x, const double y, const double z, double &wx, double &wy, double &wz, const std::string label)
bool IsInBoundingBox(const double x, const double y, const double z)
double GetElementVolume(const int i)
void SetRangeZ(const double zmin, const double zmax)
Medium * GetMedium(const double &x, const double &y, const double &z)