Garfield 0.3
Toolkit for the detailed simulation of particle detectors based on ionization measurement in gases and semiconductors
Loading...
Searching...
No Matches
ComponentFieldMap.hh
Go to the documentation of this file.
1#if defined(__GPUCOMPILE__) || !defined(G_COMPONENT_FIELD_MAP_H)
2
3#if !defined(__GPUCOMPILE__) && !defined(G_COMPONENT_FIELD_MAP_H)
4#define G_COMPONENT_FIELD_MAP_H
5#endif
6
7#ifdef __GPUCOMPILE__
8#else
9
10#include <array>
11#include <map>
12#include <memory>
13#include <string>
14#include <vector>
15
16#include "Garfield/Component.hh"
18#include "TMatrixD.h"
19#include "TVectorD.h"
20
21#endif
22
23#ifndef __GPUCOMPILE__
24
25namespace Garfield {
26
28
29class ComponentFieldMap : public Component {
30 public:
34 ComponentFieldMap(const std::string& name);
37
39 bool Check();
40
42 void PrintRange();
43
47 void DriftMedium(const size_t imat);
49 void NotDriftMedium(const size_t imat);
51 size_t GetNumberOfMaterials() const { return m_materials.size(); }
53 double GetPermittivity(const size_t imat) const;
55 double GetConductivity(const size_t imat) const;
57 void SetMedium(const size_t imat, Medium* medium);
59 Medium* GetMedium(const size_t imat) const;
60 using Component::GetMedium;
63 void SetGas(Medium* medium);
64
65 size_t GetNumberOfElements() const override { return m_elements.size(); }
66 bool GetElementNodes(const size_t i,
67 std::vector<size_t>& nodes) const override;
68 bool GetElementRegion(const size_t i, size_t& mat,
69 bool& drift) const override;
71 bool GetElement(const size_t i, double& vol, double& dmin,
72 double& dmax) const;
73 size_t GetNumberOfNodes() const override { return m_nodes.size(); }
74 bool GetNode(const size_t i, double& x, double& y, double& z) const override;
76 double GetPotential(const size_t i) const;
77
78 // Options
79 void EnableCheckMapIndices(const bool on = true) {
81 }
82
83 void EnableDeleteBackgroundElements(const bool on = true) {
85 }
86
89 void EnableTetrahedralTreeForElementSearch(const bool on = true) {
91 }
92
95 void EnableConvergenceWarnings(const bool on = true) {
97 }
98
99 Medium* GetMedium(const double x, const double y, const double z) override;
100 void ElectricField(const double x, const double y, const double z, double& ex,
101 double& ey, double& ez, Medium*& m, int& status) override;
102 void ElectricField(const double x, const double y, const double z, double& ex,
103 double& ey, double& ez, double& v, Medium*& m,
104 int& status) override;
105 using Component::ElectricField;
106#endif
108 void WeightingField(const double x, const double y, const double z,
109 double& wx, double& wy, double& wz,
110#ifdef __GPUCOMPILE__
111 size_t label);
112#else
113 const std::string& label) override;
114double WeightingPotential(const double x, const double y, const double z,
115 const std::string& label) override;
116
117double DelayedWeightingPotential(double x, double y, double z, const double t,
118 const std::string& label) override;
119void DelayedWeightingPotentials(const double x, const double y, const double z,
120 const std::string& label,
121 std::vector<double>& dwp) override;
122
123bool IsInBoundingBox(const double x, const double y, const double z) const {
124 return x >= m_minBoundingBox[0] && x <= m_maxBoundingBox[0] &&
125 y >= m_minBoundingBox[1] && y <= m_maxBoundingBox[1] &&
126 z >= m_minBoundingBox[2] && y <= m_maxBoundingBox[2];
127}
128
129bool Is3d() override { return m_is3d; }
130bool GetBoundingBox(double& xmin, double& ymin, double& zmin, double& xmax,
131 double& ymax, double& zmax) override;
132bool GetElementaryCell(double& xmin, double& ymin, double& zmin, double& xmax,
133 double& ymax, double& zmax) override;
134
135std::map<std::string, std::vector<double> > GetWeightingPotentials() {
136 return m_wpot;
137}
138
139bool GetVoltageRange(double& vmin, double& vmax) override {
140 vmin = m_mapvmin;
141 vmax = m_mapvmax;
142 return true;
143}
144
152void CopyWeightingPotential(const std::string& label,
153 const std::string& labelSource, const double x,
154 const double y, const double z, const double alpha,
155 const double beta, const double gamma);
156
158double CreateGPUTransferObject(ComponentGPU*& comp_gpu) override;
159#endif
160 protected:
161 bool m_is3d = true;
162
169
170 // Elements
171 struct Element {
172 // Nodes
173 int emap[10];
174 // Material
175 unsigned int matmap;
176 };
177#ifdef __GPUCOMPILE__
178 Element* m_elements = nullptr;
179 int* m_elementIndices = nullptr;
180 int numElements = 0;
181#else
182std::vector<Element> m_elements;
183std::vector<int> m_elementIndices;
184#endif
185
186// Degeneracy flags.
187#ifdef __GPUCOMPILE__
188 bool* m_degenerate;
189#else
190std::vector<bool> m_degenerate;
191#endif
192
193// Bounding boxes of the elements.
194#ifdef __GPUCOMPILE__
195 cuda_t** m_bbMin = nullptr;
196 cuda_t** m_bbMax = nullptr;
197#else
198std::vector<std::array<double, 3> > m_bbMin;
199std::vector<std::array<double, 3> > m_bbMax;
200#endif
201
202#ifdef __GPUCOMPILE__
203 cuda_t*** m_w12 = nullptr;
204#else
205std::vector<std::array<std::array<double, 3>, 4> > m_w12;
206#endif
207
208 // Nodes
209 struct Node {
210 // Coordinates
211 double x, y, z;
212 };
213#ifdef __GPUCOMPILE__
214 Node* m_nodes = nullptr;
215 int numNodes = 0;
216#else
217std::vector<Node> m_nodes;
218#endif
219
220// TODO GPU: m_dwpot not yet implemented
221#ifndef __GPUCOMPILE__
222 // Potentials.
223 std::vector<double> m_pot;
224 // Weighting potentials.
225 std::map<std::string, std::vector<double> > m_wpot;
226 // Delayed weighting potentials.
227 std::map<std::string, std::vector<std::vector<double> > > m_dwpot;
228#else
229double* m_pot = nullptr;
230int m_numpot = 0;
231
232// The number of weighting potentials
233int m_num_wpots = 0;
234// The number of entries in each weighting potential
235int* m_num_entries_wpot = nullptr;
236double** m_wpot = nullptr;
237#endif
238
239 // Materials
240 struct Material {
241 // Permittivity
242 double eps;
243 // Resistivity
244 double ohm;
246#ifdef __GPUCOMPILE__
247 MediumGPU* medium;
248#else
249 // Associated medium
250 Medium* medium;
251#endif
252 };
253
254#ifdef __GPUCOMPILE__
256 int numMaterials;
257#else
258std::vector<Material> m_materials;
259#endif
260
261#ifndef __GPUCOMPILE__
262 // Weighting potential copy
264 // Source
265 std::string source;
266 TMatrixD rot = TMatrixD(3, 3);
267 TVectorD trans = TVectorD(3);
268 };
269
270 // Weighting potential copies.
271 std::map<std::string, WeightingFieldCopy> m_wfieldCopies;
272
273 // Bounding box
274 bool m_hasBoundingBox = false;
275 std::array<double, 3> m_minBoundingBox = {{0., 0., 0.}};
276 std::array<double, 3> m_maxBoundingBox = {{0., 0., 0.}};
277
280#endif
281
282#ifdef __GPUCOMPILE__
283 double m_mapmin[3];
284 double m_mapmax[3];
285 double m_mapamin[3];
286 double m_mapamax[3];
287#else
288// Ranges and periodicities
289std::array<double, 3> m_mapmin = {{0., 0., 0.}};
290std::array<double, 3> m_mapmax = {{0., 0., 0.}};
291std::array<double, 3> m_mapamin = {{0., 0., 0.}};
292std::array<double, 3> m_mapamax = {{0., 0., 0.}};
293#endif
294
295#ifndef __GPUCOMPILE__
296 std::array<double, 3> m_mapna = {{0., 0., 0.}};
297 std::array<double, 3> m_cells = {{0., 0., 0.}};
298
299 double m_mapvmin = 0.;
300 double m_mapvmax = 0.;
301
302 std::array<bool, 3> m_setang;
303
304 // Option to delete meshing in conductors
306
307 // Warnings flag
308 bool m_warning = false;
309 unsigned int m_nWarnings = 0;
310
311 // Print warnings about failed convergence when refining
312 // isoparametric coordinates.
314
315 // Get the scaling factor for a given length unit.
316 static double ScalingFactor(std::string unit);
317
318 // Reset the component.
319 void Reset() override;
320
321 void Prepare();
322
323 // Calculate x, y, z, V and angular ranges.
324 virtual void SetRange();
325
326 // Periodicities
327 void UpdatePeriodicity() override {
330 }
333
336
337#endif
340 int Field(const double x, const double y, const double z, double& fx,
341 double& fy, double& fz, int& iel,
342#ifdef __GPUCOMPILE__
343 const double* potentials, const int numPotentials
344#else
345 const std::vector<double>& potentials
346#endif
347 ) const;
348#ifndef __GPUCOMPILE__
350 double Potential(const double x, const double y, const double z,
351 const std::vector<double>& potentials) const;
353 static double Potential3(const std::array<double, 6>& v,
354 const std::array<double, 3>& t);
356 static void Field3(const std::array<double, 6>& v,
357 const std::array<double, 3>& t, double jac[4][4],
358 const double det, double& ex, double& ey);
360 static double Potential5(const std::array<double, 8>& v,
361 const std::array<double, 2>& t);
363 static void Field5(const std::array<double, 8>& v,
364 const std::array<double, 2>& t, double jac[4][4],
365 const double det, double& ex, double& ey);
367 static double Potential13(const std::array<double, 10>& v,
368 const std::array<double, 4>& t);
369#endif
371 __DEVICE__ static void Field13(
372#ifndef __GPUCOMPILE__
373 const std::array<double, 10>& v, const std::array<double, 4>& t,
374#else
375 const double v[10], const double t[4],
376#endif
377 double jac[4][4], const double det, double& ex, double& ey, double& ez);
378#ifndef __GPUCOMPILE__
380 int FindElement5(const double x, const double y, double& t1, double& t2,
381 double& t3, double& t4, double jac[4][4], double& det) const;
382#endif
385 int FindElement13(const double x, const double y, const double z, double& t1,
386 double& t2, double& t3, double& t4, double jac[4][4],
387 double& det) const;
388#ifndef __GPUCOMPILE__
390 int FindElementCube(const double x, const double y, const double z,
391 double& t1, double& t2, double& t3, TMatrixD*& jac,
392 std::vector<TMatrixD*>& dN) const;
393#endif
394
397 void MapCoordinates(double& xpos, double& ypos, double& zpos, bool& xmirrored,
398 bool& ymirrored, bool& zmirrored, double& rcoordinate,
399 double& rotation) const;
402 void UnmapFields(double& ex, double& ey, double& ez, const double xpos,
403 const double ypos, const double zpos, const bool xmirrored,
404 const bool ymirrored, const bool zmirrored,
405 const double rcoordinate, const double rotation) const;
406
407#ifndef __GPUCOMPILE__
408 static int ReadInteger(char* token, int def, bool& error);
409 static double ReadDouble(char* token, double def, bool& error);
410
411 virtual double GetElementVolume(const size_t i) const;
412 virtual void GetAspectRatio(const size_t i, double& dmin, double& dmax) const;
413
414 void PrintWarning(const std::string& header);
415 void PrintNotReady(const std::string& header) const;
416 void PrintCouldNotOpen(const std::string& header,
417 const std::string& filename) const;
418 void PrintElement(const std::string& header, const double x, const double y,
419 const double z, const double t1, const double t2,
420 const double t3, const double t4, const size_t i,
421 const std::vector<double>& potential) const;
423 void TimeInterpolation(const double t, double& f0, double& f1, int& i0,
424 int& i1);
425#endif
426
427 protected:
430
431 // Tetrahedral tree
433#ifdef __GPUCOMPILE__
434 GARFIELD_CLASS_NAME(TetrahedralTree) * m_octree = nullptr;
435#else
436std::unique_ptr<GARFIELD_CLASS_NAME(TetrahedralTree)> m_octree;
437#endif
438
439 protected:
440#ifndef __GPUCOMPILE__
442 int Coordinates3(const double x, const double y, double& t1, double& t2,
443 double& t3, double& t4, double jac[4][4], double& det,
444 const std::array<double, 8>& xn,
445 const std::array<double, 8>& yn) const;
447 int Coordinates4(const double x, const double y, double& t1, double& t2,
448 double& t3, double& t4, double& det,
449 const std::array<double, 8>& xn,
450 const std::array<double, 8>& yn) const;
452 int Coordinates5(const double x, const double y, double& t1, double& t2,
453 double& t3, double& t4, double jac[4][4], double& det,
454 const std::array<double, 8>& xn,
455 const std::array<double, 8>& yn) const;
456#endif
457
460 void Coordinates12(const double x, const double y, const double z, double& t1,
461 double& t2, double& t3, double& t4,
462#ifdef __GPUCOMPILE__
463 const double xn[10], const double yn[10],
464 const double zn[10], const double w[4][3]
465#else
466 const std::array<double, 10>& xn,
467 const std::array<double, 10>& yn,
468 const std::array<double, 10>& zn,
469 const std::array<std::array<double, 3>, 4>& w
470#endif
471 ) const;
472
475 int Coordinates13(const double x, const double y, const double z, double& t1,
476 double& t2, double& t3, double& t4, double jac[4][4],
477 double& det,
478#ifdef __GPUCOMPILE__
479 const double xn[10], const double yn[10],
480 const double zn[10], cuda_t** w
481#else
482 const std::array<double, 10>& xn,
483 const std::array<double, 10>& yn,
484 const std::array<double, 10>& zn,
485 const std::array<std::array<double, 3>, 4>& w
486#endif
487 ) const;
488
489#ifndef __GPUCOMPILE__
491 int CoordinatesCube(const double x, const double y, const double z,
492 double& t1, double& t2, double& t3, TMatrixD*& jac,
493 std::vector<TMatrixD*>& dN, const Element& element) const;
494
496 static void Jacobian3(const std::array<double, 8>& xn,
497 const std::array<double, 8>& yn, const double u,
498 const double v, const double w, double& det,
499 double jac[4][4]);
501 static void Jacobian5(const std::array<double, 8>& xn,
502 const std::array<double, 8>& yn, const double u,
503 const double v, double& det, double jac[4][4]);
504#endif
505
508 static void Jacobian13(
509#ifdef __GPUCOMPILE__
510 const double xn[10], const double yn[10], const double zn[10],
511#else
512 const std::array<double, 10>& xn, const std::array<double, 10>& yn,
513 const std::array<double, 10>& zn,
514#endif
515 const double fourt0, const double fourt1, const double fourt2,
516 const double fourt3, double& det, double jac[4][4]);
517
518#ifndef __GPUCOMPILE__
520 void JacobianCube(const Element& element, const double t1, const double t2,
521 const double t3, TMatrixD*& jac,
522 std::vector<TMatrixD*>& dN) const;
523
524 static std::array<std::array<double, 3>, 4> Weights12(
525 const std::array<double, 10>& xn, const std::array<double, 10>& yn,
526 const std::array<double, 10>& zn);
527
530
533};
534} // namespace Garfield
535
536#endif
537#endif
#define GARFIELD_CLASS_NAME(name)
#define __DEVICE__
static double Potential3(const std::array< double, 6 > &v, const std::array< double, 3 > &t)
Interpolate the potential in a triangle.
std::map< std::string, std::vector< double > > GetWeightingPotentials()
bool m_checkMultipleElement
Scan for multiple elements that contain a point.
int FindElement5(const double x, const double y, double &t1, double &t2, double &t3, double &t4, double jac[4][4], double &det) const
Find the element for a point in curved quadratic quadrilaterals.
std::unique_ptr< GARFIELD_CLASS_NAME(TetrahedralTree)> m_octree
double GetConductivity(const size_t imat) const
Return the conductivity of a field map material.
double DelayedWeightingPotential(double x, double y, double z, const double t, const std::string &label) override
double WeightingPotential(const double x, const double y, const double z, const std::string &label) override
void PrintRange()
Show x, y, z, V and angular ranges.
void ElectricField(const double x, const double y, const double z, double &ex, double &ey, double &ez, double &v, Medium *&m, int &status) override
void PrintMaterials()
List all currently defined materials.
bool GetVoltageRange(double &vmin, double &vmax) override
bool SetDefaultDriftMedium()
Find lowest epsilon, check for eps = 0, set default drift media flags.
std::map< std::string, WeightingFieldCopy > m_wfieldCopies
void TimeInterpolation(const double t, double &f0, double &f1, int &i0, int &i1)
Interpolation of potential between two time slices.
static double Potential5(const std::array< double, 8 > &v, const std::array< double, 2 > &t)
Interpolate the potential in a curved quadrilateral.
void NotDriftMedium(const size_t imat)
Flag a field map materials as a non-drift medium.
std::array< double, 3 > m_mapamin
void ElectricField(const double x, const double y, const double z, double &ex, double &ey, double &ez, Medium *&m, int &status) override
void EnableDeleteBackgroundElements(const bool on=true)
Option to eliminate mesh elements in conductors (default: on).
double GetPotential(const size_t i) const
Return the potential at a given node.
__DEVICE__ void MapCoordinates(double &xpos, double &ypos, double &zpos, bool &xmirrored, bool &ymirrored, bool &zmirrored, double &rcoordinate, double &rotation) const
Move (xpos, ypos, zpos) to field map coordinates.
void JacobianCube(const Element &element, const double t1, const double t2, const double t3, TMatrixD *&jac, std::vector< TMatrixD * > &dN) const
Calculate Jacobian for a cube.
static void Field3(const std::array< double, 6 > &v, const std::array< double, 3 > &t, double jac[4][4], const double det, double &ex, double &ey)
Interpolate the field in a triangle.
void DriftMedium(const size_t imat)
Flag a field map material as a drift medium.
std::vector< std::array< double, 3 > > m_bbMax
void PrintWarning(const std::string &header)
bool GetElementNodes(const size_t i, std::vector< size_t > &nodes) const override
static double Potential13(const std::array< double, 10 > &v, const std::array< double, 4 > &t)
Interpolate the potential in a curved quadratic tetrahedron.
bool GetElementRegion(const size_t i, size_t &mat, bool &drift) const override
Medium * GetMedium(const double x, const double y, const double z) override
std::array< double, 3 > m_maxBoundingBox
std::array< double, 3 > m_mapmin
__DEVICE__ int Field(const double x, const double y, const double z, double &fx, double &fy, double &fz, int &iel, const std::vector< double > &potentials) const
Compute the electric/weighting field.
void SetMedium(const size_t imat, Medium *medium)
Associate a field map material with a Medium object.
size_t GetNumberOfMaterials() const
Return the number of materials in the field map.
std::array< double, 3 > m_minBoundingBox
double Potential(const double x, const double y, const double z, const std::vector< double > &potentials) const
Compute the electrostatic/weighting potential.
static double ScalingFactor(std::string unit)
bool m_cacheElemBoundingBoxes
Flag to check if bounding boxes of elements are cached.
size_t GetNumberOfNodes() const override
static double ReadDouble(char *token, double def, bool &error)
double GetPermittivity(const size_t imat) const
Return the relative permittivity of a field map material.
bool GetBoundingBox(double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) override
ComponentFieldMap(const std::string &name)
Constructor.
std::vector< Material > m_materials
static void Field5(const std::array< double, 8 > &v, const std::array< double, 2 > &t, double jac[4][4], const double det, double &ex, double &ey)
Interpolate the field in a curved quadrilateral.
size_t GetNumberOfElements() const override
void CopyWeightingPotential(const std::string &label, const std::string &labelSource, const double x, const double y, const double z, const double alpha, const double beta, const double gamma)
Makes a weighting potential copy of a imported map which can be translated and rotated.
virtual void GetAspectRatio(const size_t i, double &dmin, double &dmax) const
virtual ~ComponentFieldMap()
Destructor.
int Coordinates5(const double x, const double y, double &t1, double &t2, double &t3, double &t4, double jac[4][4], double &det, const std::array< double, 8 > &xn, const std::array< double, 8 > &yn) const
Calculate local coordinates for curved quadratic quadrilaterals.
std::array< double, 3 > m_mapna
virtual double GetElementVolume(const size_t i) const
std::vector< std::array< std::array< double, 3 >, 4 > > m_w12
ComponentFieldMap()=delete
Default constructor.
void EnableTetrahedralTreeForElementSearch(const bool on=true)
Enable or disable the usage of the tetrahedral tree for searching the element in the mesh.
__DEVICE__ int Coordinates13(const double x, const double y, const double z, double &t1, double &t2, double &t3, double &t4, double jac[4][4], double &det, const std::array< double, 10 > &xn, const std::array< double, 10 > &yn, const std::array< double, 10 > &zn, const std::array< std::array< double, 3 >, 4 > &w) const
Calculate local coordinates for curved quadratic tetrahedra.
bool GetElement(const size_t i, double &vol, double &dmin, double &dmax) const
Return the volume and aspect ratio of a mesh element.
__DEVICE__ void Coordinates12(const double x, const double y, const double z, double &t1, double &t2, double &t3, double &t4, const std::array< double, 10 > &xn, const std::array< double, 10 > &yn, const std::array< double, 10 > &zn, const std::array< std::array< double, 3 >, 4 > &w) const
Calculate local coordinates in linear tetrahedra.
__DEVICE__ void WeightingField(const double x, const double y, const double z, double &wx, double &wy, double &wz, const std::string &label) override
void PrintCouldNotOpen(const std::string &header, const std::string &filename) const
std::map< std::string, std::vector< double > > m_wpot
bool Check()
Check element aspect ratio.
int FindElementCube(const double x, const double y, const double z, double &t1, double &t2, double &t3, TMatrixD *&jac, std::vector< TMatrixD * > &dN) const
Find the element for a point in a cube.
static std::array< std::array< double, 3 >, 4 > Weights12(const std::array< double, 10 > &xn, const std::array< double, 10 > &yn, const std::array< double, 10 > &zn)
bool InitializeTetrahedralTree()
Initialize the tetrahedral tree.
int Coordinates3(const double x, const double y, double &t1, double &t2, double &t3, double &t4, double jac[4][4], double &det, const std::array< double, 8 > &xn, const std::array< double, 8 > &yn) const
Calculate local coordinates for curved quadratic triangles.
static void Jacobian5(const std::array< double, 8 > &xn, const std::array< double, 8 > &yn, const double u, const double v, double &det, double jac[4][4])
Calculate Jacobian for curved quadratic quadrilaterals.
void DelayedWeightingPotentials(const double x, const double y, const double z, const std::string &label, std::vector< double > &dwp) override
std::vector< int > m_elementIndices
static int ReadInteger(char *token, int def, bool &error)
void SetGas(Medium *medium)
Associate all field map materials with a relative permittivity of unity to a given Medium class.
bool GetElementaryCell(double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) override
std::vector< Element > m_elements
int CoordinatesCube(const double x, const double y, const double z, double &t1, double &t2, double &t3, TMatrixD *&jac, std::vector< TMatrixD * > &dN, const Element &element) const
Calculate local coordinates for a cube.
std::array< double, 3 > m_mapamax
bool GetNode(const size_t i, double &x, double &y, double &z) const override
static __DEVICE__ void Jacobian13(const std::array< double, 10 > &xn, const std::array< double, 10 > &yn, const std::array< double, 10 > &zn, const double fourt0, const double fourt1, const double fourt2, const double fourt3, double &det, double jac[4][4])
Calculate Jacobian for curved quadratic tetrahedra.
std::array< double, 3 > m_cells
void CalculateElementBoundingBoxes()
Calculate the bounding boxes of all elements after initialization.
void EnableConvergenceWarnings(const bool on=true)
Enable or disable warnings that the calculation of the local coordinates did not achieve the requeste...
std::array< bool, 3 > m_setang
Medium * GetMedium(const size_t imat) const
Return the Medium associated to a field map material.
bool IsInBoundingBox(const double x, const double y, const double z) const
__DEVICE__ int FindElement13(const double x, const double y, const double z, double &t1, double &t2, double &t3, double &t4, double jac[4][4], double &det) const
Find the element for a point in curved quadratic tetrahedra.
void PrintElement(const std::string &header, const double x, const double y, const double z, const double t1, const double t2, const double t3, const double t4, const size_t i, const std::vector< double > &potential) const
void EnableCheckMapIndices(const bool on=true)
int Coordinates4(const double x, const double y, double &t1, double &t2, double &t3, double &t4, double &det, const std::array< double, 8 > &xn, const std::array< double, 8 > &yn) const
Calculate local coordinates for linear quadrilaterals.
std::array< double, 3 > m_mapmax
__DEVICE__ void UnmapFields(double &ex, double &ey, double &ez, const double xpos, const double ypos, const double zpos, const bool xmirrored, const bool ymirrored, const bool zmirrored, const double rcoordinate, const double rotation) const
Move (ex, ey, ez) to global coordinates.
std::map< std::string, std::vector< std::vector< double > > > m_dwpot
static void Jacobian3(const std::array< double, 8 > &xn, const std::array< double, 8 > &yn, const double u, const double v, const double w, double &det, double jac[4][4])
Calculate Jacobian for curved quadratic triangles.
double CreateGPUTransferObject(ComponentGPU *&comp_gpu) override
Create and initialise GPU Transfer class.
std::vector< std::array< double, 3 > > m_bbMin
void PrintNotReady(const std::string &header) const
static __DEVICE__ void Field13(const std::array< double, 10 > &v, const std::array< double, 4 > &t, double jac[4][4], const double det, double &ex, double &ey, double &ez)
Interpolate the field in a curved quadratic tetrahedron.