1#ifndef G_COMPONENT_VOXEL_H
2#define G_COMPONENT_VOXEL_H
18 void ElectricField(
const double x,
const double y,
const double z,
double& ex,
19 double& ey,
double& ez,
double& v,
Medium*& m,
21 void ElectricField(
const double x,
const double y,
const double z,
double& ex,
22 double& ey,
double& ez,
Medium*& m,
int& status);
24 void WeightingField(
const double x,
const double y,
const double z,
25 double& wx,
double& wy,
double& wz,
26 const std::string& label);
28 void MagneticField(
const double x,
const double y,
const double z,
29 double& bx,
double& by,
double& bz,
int& status);
40 double& eymax,
double& ezmin,
double& ezmax);
41 bool GetBoundingBox(
double& xmin,
double& ymin,
double& zmin,
double& xmax,
42 double& ymax,
double& zmax);
50 void SetMesh(
const unsigned int nx,
const unsigned int ny,
51 const unsigned int nz,
const double xmin,
const double xmax,
52 const double ymin,
const double ymax,
const double zmin,
71 const bool withPotential,
const bool withRegion,
72 const double scaleX = 1.,
const double scaleE = 1.,
73 const double scaleP = 1.);
76 const double scaleX = 1.,
const double scaleB = 1.);
79 bool GetElement(
const double xi,
const double yi,
const double zi,
80 unsigned int& i,
unsigned int& j,
unsigned int& k,
81 bool& xMirrored,
bool& yMirrored,
bool& zMirrored)
const;
83 bool GetElement(
const unsigned int i,
const unsigned int j,
84 const unsigned int k,
double& v,
double& ex,
double& ey,
95 std::vector<Medium*> m_media;
101 std::vector<std::vector<std::vector<Element> > > m_efields;
103 std::vector<std::vector<std::vector<Element> > > m_bfields;
105 std::vector<std::vector<std::vector<int> > > m_regions;
107 unsigned int m_nX, m_nY, m_nZ;
108 double m_xMin, m_yMin, m_zMin;
109 double m_xMax, m_yMax, m_zMax;
117 double m_wField_xOffset;
118 double m_wField_yOffset;
119 double m_wField_zOffset;
122 double m_pMin, m_pMax;
125 bool LoadData(
const std::string& filename, std::string format,
126 const bool withPotential,
const bool withRegion,
127 const double scaleX,
const double scaleF,
const double scaleP,
132 void UpdatePeriodicity();
134 double Reduce(
const double xin,
const double xmin,
const double xmax,
135 const bool simplePeriodic,
const bool mirrorPeriodic,
136 bool& isMirrored)
const;
Abstract base class for components.
Component for interpolating field maps stored in a regular mesh.
ComponentVoxel()
Constructor.
~ComponentVoxel()
Destructor.
void WeightingField(const double x, const double y, const double z, double &wx, double &wy, double &wz, const std::string &label)
void SetWeightingFieldOffset(const double x, const double y, const double z)
bool GetBoundingBox(double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax)
Get the bounding box coordinates.
void PrintRegions() const
Print all regions.
bool GetElectricFieldRange(double &exmin, double &exmax, double &eymin, double &eymax, double &ezmin, double &ezmax)
bool GetElement(const double xi, const double yi, const double zi, unsigned int &i, unsigned int &j, unsigned int &k, bool &xMirrored, bool &yMirrored, bool &zMirrored) const
Return the indices of the element at a given point.
bool GetVoltageRange(double &vmin, double &vmax)
Calculate the voltage range [V].
void SetMedium(const unsigned int i, Medium *m)
Set the medium in region i.
Medium * GetMedium(const double x, const double y, const double z)
Get the medium at a given location (x, y, z).
void ElectricField(const double x, const double y, const double z, double &ex, double &ey, double &ez, double &v, Medium *&m, int &status)
void SetMesh(const unsigned int nx, const unsigned int ny, const unsigned int nz, const double xmin, const double xmax, const double ymin, const double ymax, const double zmin, const double zmax)
void MagneticField(const double x, const double y, const double z, double &bx, double &by, double &bz, int &status)
bool LoadElectricField(const std::string &filename, const std::string &format, const bool withPotential, const bool withRegion, const double scaleX=1., const double scaleE=1., const double scaleP=1.)
bool LoadMagneticField(const std::string &filename, const std::string &format, const double scaleX=1., const double scaleB=1.)
Import magnetic field values from a file.
Abstract base class for media.