1#ifndef G_COMPONENT_CST_H
2#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);
108 const double z)
const {
115 void SetRangeZ(
const double zmin,
const double zmax);
127 disableFieldComponent[0] =
true;
130 disableFieldComponent[1] =
true;
133 disableFieldComponent[2] =
true;
174 int Index2Element(
const unsigned int i,
const unsigned int j,
const unsigned int k);
181 unsigned int &i,
unsigned int &j,
unsigned int &k);
186 void GetAspectRatio(
const unsigned int i,
double& dmin,
double& dmax);
208 unsigned int &i,
unsigned int &j,
unsigned int &k,
209 double *position_mapped,
bool *mirrored,
210 double &rcoordinate,
double &rotation);
213 std::vector<double> m_xlines;
214 std::vector<double> m_ylines;
215 std::vector<double> m_zlines;
216 std::vector<float> m_potential;
217 std::map<std::string,std::vector<float> > m_weightingFields;
218 std::vector<unsigned char> m_elementMaterial;
223 bool disableFieldComponent[3];
225 static const unsigned int headerSize = 1000;
226 void ElectricFieldBinary(
const double x,
const double y,
const double z,
double& ex,
227 double& ey,
double& ez,
double& v,
Medium*& m,
228 int& status,
const bool calculatePotential =
false);
229 float GetFieldComponent(
const unsigned int i,
const unsigned int j,
const unsigned int k,
230 const double rx,
const double ry,
const double rz,
231 const char component,
const std::vector<float>* potentials);
233 float GetPotential(
const unsigned int i,
const unsigned int j,
const unsigned int k,
234 const double rx,
const double ry ,
const double rz,
const std::vector<float>* potentials);
236 void ShapeField(
float &ex,
float &ey,
float &ez,
237 const double rx,
const double ry,
const double rz,
238 const unsigned int i,
const unsigned int j,
const unsigned int k,
239 std::vector<float>* potentials);
245 void Element2Index(
int element,
unsigned int& i,
unsigned int& j,
unsigned int& k);
247 int Index2Node(
const unsigned int i,
const unsigned int j,
const unsigned int k);
void UpdatePeriodicity()
Verify periodicities.
void WeightingField(const double x, const double y, const double z, double &wx, double &wy, double &wz, const std::string &label)
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)
bool Initialise(std::string elist, std::string nlist, std::string mplist, std::string prnsol, std::string unit="cm")
double GetElementVolume(const unsigned int i)
virtual bool IsInBoundingBox(const double x, const double y, const double z) const
void GetAspectRatio(const unsigned int i, double &dmin, double &dmax)
Medium * GetMedium(const double x, const double y, const double z)
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)
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 SetRange()
Calculate x, y, z, V and angular ranges.
void SetRangeZ(const double zmin, const double zmax)
Base class for components based on finite-element field maps.
Abstract base class for media.
Helper struct for drawing the mesh with ViewFEMesh.