13 double p1 = x, p2 = y, p3 = z;
14 double u1x = 1., u2x = 0., u3x = 0.;
15 double u1y = 0., u2y = 1., u3y = 0.;
16 double u1z = 0., u2z = 0., u3z = 1.;
18 MapCoordinates(p1, p2, p3, u1x, u2x, u3x, u1y, u2y, u3y, u1z, u2z, u3z,
24 std::cerr <<
" ComponentBase pointer is NULL for point (" << x <<
", "
25 << y <<
"," << z <<
")\n";
32 std::cerr <<
" Coordinates: \n";
33 std::cerr <<
" Global: (" << x <<
", " << y <<
", " << z <<
")\n";
34 std::cerr <<
" Local: (" << p1 <<
", " << p2 <<
", " << p3 <<
")\n";
35 std::cerr <<
" Local base vectors: \n";
36 std::cerr <<
" u1: (" << u1x <<
", " << u1y <<
", " << u1z <<
")\n";
37 std::cerr <<
" u2: (" << u2x <<
", " << u2y <<
", " << u2z <<
")\n";
38 std::cerr <<
" u3: (" << u3x <<
", " << u3y <<
", " << u3z <<
")\n";
45 const double z,
double& ex,
double& ey,
46 double& ez,
Medium*& m,
int& status) {
52 const double z,
double& ex,
double& ey,
53 double& ez,
double& v,
Medium*& m,
55 double p1 = x, p2 = y, p3 = z;
56 double u1x = 1., u2x = 0., u3x = 0.;
57 double u1y = 0., u2y = 1., u3y = 0.;
58 double u1z = 0., u2z = 0., u3z = 1.;
59 double e1 = 0., e2 = 0., e3 = 0.;
62 MapCoordinates(p1, p2, p3, u1x, u2x, u3x, u1y, u2y, u3y, u1z, u2z, u3z,
68 std::cerr <<
" ComponentBase pointer is NULL for point (" << x <<
", "
69 << y <<
"," << z <<
")\n";
78 std::cerr <<
" Coordinates: \n";
79 std::cerr <<
" Global: (" << x <<
", " << y <<
", " << z <<
")\n";
80 std::cerr <<
" Local: (" << p1 <<
", " << p2 <<
", " << p3 <<
")\n";
81 std::cerr <<
" Local base vectors: \n";
82 std::cerr <<
" u1: (" << u1x <<
", " << u1y <<
", " << u1z <<
")\n";
83 std::cerr <<
" u2: (" << u2x <<
", " << u2y <<
", " << u2z <<
")\n";
84 std::cerr <<
" u3: (" << u3x <<
", " << u3y <<
", " << u3z <<
")\n";
87 pComponent->
ElectricField(p1, p2, p3, e1, e2, e3, v, m, status);
88 UnmapField(e1, e2, e3, u1x, u2x, u3x, u1y, u2y, u3y, u1z, u2z, u3z, ex, ey,
93 const double z,
double& wx,
94 double& wy,
double& wz,
95 const std::string& label) {
96 double p1 = x, p2 = y, p3 = z;
97 double u1x = 1., u2x = 0., u3x = 0.;
98 double u1y = 0., u2y = 1., u3y = 0.;
99 double u1z = 0., u2z = 0., u3z = 1.;
100 double w1 = 0., w2 = 0., w3 = 0.;
102 std::string label_ = label;
104 MapCoordinates(p1, p2, p3, u1x, u2x, u3x, u1y, u2y, u3y, u1z, u2z, u3z,
110 std::cerr <<
" ComponentBase pointer is NULL for point (" << x <<
", "
111 << y <<
"," << z <<
")\n";
119 std::cerr <<
" Coordinates: \n";
120 std::cerr <<
" Global: (" << x <<
", " << y <<
", " << z <<
")\n";
121 std::cerr <<
" Local: (" << p1 <<
", " << p2 <<
", " << p3 <<
")\n";
122 std::cerr <<
" Local base vectors: \n";
123 std::cerr <<
" u1: (" << u1x <<
", " << u1y <<
", " << u1z <<
")\n";
124 std::cerr <<
" u2: (" << u2x <<
", " << u2y <<
", " << u2z <<
")\n";
125 std::cerr <<
" u3: (" << u3x <<
", " << u3y <<
", " << u3z <<
")\n";
129 UnmapField(w1, w2, w3, u1x, u2x, u3x, u1y, u2y, u3y, u1z, u2z, u3z, wx, wy,
135 const std::string& label) {
136 double p1 = x, p2 = y, p3 = z;
137 double u1x = 1., u2x = 0., u3x = 0.;
138 double u1y = 0., u2y = 1., u3y = 0.;
139 double u1z = 0., u2z = 0., u3z = 1.;
141 std::string label_ = label;
142 MapCoordinates(p1, p2, p3, u1x, u2x, u3x, u1y, u2y, u3y, u1z, u2z, u3z,
147 std::cerr <<
m_className <<
"::WeightingPotential:\n";
148 std::cerr <<
" ComponentBase pointer is NULL for point (" << x <<
", "
149 << y <<
"," << z <<
")\n";
155 std::cerr <<
m_className <<
"::WeightingPotential:\n";
156 std::cerr <<
" Coordinates: \n";
157 std::cerr <<
" Global: (" << x <<
", " << y <<
", " << z <<
")\n";
158 std::cerr <<
" Local: (" << p1 <<
", " << p2 <<
", " << p3 <<
")\n";
159 std::cerr <<
" Local base vectors: \n";
160 std::cerr <<
" u1: (" << u1x <<
", " << u1y <<
", " << u1z <<
")\n";
161 std::cerr <<
" u2: (" << u2x <<
", " << u2y <<
", " << u2z <<
")\n";
162 std::cerr <<
" u3: (" << u3x <<
", " << u3y <<
", " << u3z <<
")\n";
170 std::cerr <<
m_className <<
"::UpdatePeriodicity:\n";
171 std::cerr <<
" Periodicities should be implemented by overloading the "
172 <<
"MapCoordinates function.\n";
Abstract base class for components.
virtual void ElectricField(const double x, const double y, const double z, double &ex, double &ey, double &ez, Medium *&m, int &status)=0
virtual double WeightingPotential(const double x, const double y, const double z, const std::string &label)
virtual void WeightingField(const double x, const double y, const double z, double &wx, double &wy, double &wz, const std::string &label)
std::string m_className
Class name.
bool m_debug
Switch on/off debugging messages.
virtual Medium * GetMedium(const double x, const double y, const double z)
Get the medium at a given location (x, y, z).
Medium * GetMedium(const double x, const double y, const double z)
Get the medium at a given location (x, y, z).
void UnmapField(const double e1, const double e2, const double e3, const double u1x, const double u2x, const double u3x, const double u1y, const double u2y, const double u3y, const double u1z, const double u2z, const double u3z, double &ex, double &ey, double &ez) const
void ElectricField(const double x, const double y, const double z, double &ex, double &ey, double &ez, Medium *&m, int &status)
void WeightingField(const double x, const double y, const double z, double &wx, double &wy, double &wz, const std::string &label)
void UpdatePeriodicity()
Verify periodicities.
virtual ~ComponentUserMapBase()
double WeightingPotential(const double x, const double y, const double z, const std::string &label)
virtual void MapCoordinates(double &p1, double &p2, double &p3, double &u1x, double &u2x, double &u3x, double &u1y, double &u2y, double &u3y, double &u1z, double &u2z, double &u3z, ComponentBase *&pComponent)=0
Abstract base class for media.