1#ifndef G_COMPONENT_NEBEM3DMAP_H
2#define G_COMPONENT_NEBEM3DMAP_H
17 void ElectricField(
const double x,
const double y,
const double z,
double& ex,
18 double& ey,
double& ez,
double& v, Medium*& m,
19 int& status)
override;
20 void ElectricField(
const double x,
const double y,
const double z,
double& ex,
21 double& ey,
double& ez, Medium*& m,
int& status)
override;
24 double& wx,
double& wy,
double& wz,
25 const std::string& label)
override;
27 const std::string& label)
override;
29 void MagneticField(
const double x,
const double y,
const double z,
double& bx,
30 double& by,
double& bz,
int& status)
override;
37 Medium*
GetMedium(
const double x,
const double y,
const double z)
override;
41 double& eymax,
double& ezmin,
double& ezmax);
43 double& ymax,
double& zmax)
override;
46 bool LoadMapInfo(
const std::string& MapInfoFile, std::string& MapVersion,
47 int& OptMap,
int& OptStaggerMap,
unsigned int& NbOfXCells,
48 unsigned int& NbOfYCells,
unsigned int& NbOfZCells,
49 double& Xmin,
double& Xmax,
double& Ymin,
double& Ymax,
50 double& Zmin,
double& Zmax,
double& XStagger,
51 double& YStagger,
double& ZStagger,
52 std::string& MapDataFile);
59 void SetMesh(
const unsigned int nx,
const unsigned int ny,
60 const unsigned int nz,
const double xmin,
const double xmax,
61 const double ymin,
const double ymax,
const double zmin,
80 const bool withPotential,
const bool withRegion,
81 const double scaleX = 1.,
const double scaleE = 1.,
82 const double scaleP = 1.);
85 const double scaleX = 1.,
const double scaleB = 1.);
88 bool GetElement(
const double xi,
const double yi,
const double zi,
89 unsigned int& i,
unsigned int& j,
unsigned int& k,
90 bool& xMirrored,
bool& yMirrored,
bool& zMirrored)
const;
92 bool GetElement(
const unsigned int i,
const unsigned int j,
93 const unsigned int k,
double& v,
double& ex,
double& ey,
110 std::vector<std::vector<std::vector<Element> > >
m_efields;
112 std::vector<std::vector<std::vector<Element> > >
m_bfields;
134 bool LoadData(
const std::string& filename, std::string format,
135 const bool withPotential,
const bool withRegion,
136 const double scaleX,
const double scaleF,
const double scaleP,
143 double Reduce(
const double xin,
const double xmin,
const double xmax,
144 const bool simplePeriodic,
const bool mirrorPeriodic,
145 bool& isMirrored)
const;
148 double TriLinInt(
const double xd,
const double yd,
const double zd,
149 const double c000,
const double c100,
const double c010,
150 const double c001,
const double c110,
const double c101,
151 const double c011,
const double c111);
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.
~ComponentNeBem3dMap()
Destructor.
void UpdatePeriodicity() override
void SetMedium(const unsigned int i, Medium *m)
Set the medium in region i.
void MagneticField(const double x, const double y, const double z, double &bx, double &by, double &bz, int &status) override
std::vector< Medium * > m_media
void PrintRegions() const
Print all regions.
std::vector< std::vector< std::vector< Element > > > m_efields
Electric field values and potentials at each mesh element.
bool LoadData(const std::string &filename, std::string format, const bool withPotential, const bool withRegion, const double scaleX, const double scaleF, const double scaleP, const char field)
Read data from file.
bool LoadMapInfo(const std::string &MapInfoFile, std::string &MapVersion, int &OptMap, int &OptStaggerMap, unsigned int &NbOfXCells, unsigned int &NbOfYCells, unsigned int &NbOfZCells, double &Xmin, double &Xmax, double &Ymin, double &Ymax, double &Zmin, double &Zmax, double &XStagger, double &YStagger, double &ZStagger, std::string &MapDataFile)
Map related information.
void ElectricField(const double x, const double y, const double z, double &ex, double &ey, double &ez, double &v, Medium *&m, int &status) override
bool GetBoundingBox(double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) override
ComponentNeBem3dMap()
Constructor.
double WeightingPotential(const double x, const double y, const double z, const std::string &label) override
void WeightingField(const double x, const double y, const double z, double &wx, double &wy, double &wz, const std::string &label) override
Medium * GetMedium(const double x, const double y, const double z) override
double Reduce(const double xin, const double xmin, const double xmax, const bool simplePeriodic, const bool mirrorPeriodic, bool &isMirrored) const
Reduce a coordinate to the basic cell (in case of periodicity).
Medium * GetMedium(const unsigned int i) const
Get the medium in region i.
double TriLinInt(const double xd, const double yd, const double zd, const double c000, const double c100, const double c010, const double c001, const double c110, const double c101, const double c011, const double c111)
Interpolate tri-linear.
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.
bool GetElectricFieldRange(double &exmin, double &exmax, double &eymin, double &eymax, double &ezmin, double &ezmax)
void ElectricField(const double x, const double y, const double z, double &ex, double &ey, double &ez, Medium *&m, int &status) override
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.)
Import electric field and potential values from a file.
bool GetVoltageRange(double &vmin, double &vmax) override
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)
Define the grid.
bool GetElement(const unsigned int i, const unsigned int j, const unsigned int k, double &v, double &ex, double &ey, double &ez) const
Return the field for an element with given index.
void SetWeightingFieldOffset(const double x, const double y, const double z)
Offset coordinates in the weighting field, such that the same numerical weighting field map can be us...
std::vector< std::vector< std::vector< Element > > > m_bfields
Magnetic field values at each mesh element.
std::vector< std::vector< std::vector< int > > > m_regions
Region indices.