Garfield++ v2r0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
ComponentElmer.hh
Go to the documentation of this file.
1// Copied and modified ComponentAnsys123.hh
2
3#ifndef G_COMPONENT_ELMER_H
4#define G_COMPONENT_ELMER_H
5
7
8namespace Garfield {
9
10/// Component for importing field maps computed by Elmer.
11
13
14 public:
15 /// Default constructor
17 /// Constructor with a set of field map files, see Initialise().
18 ComponentElmer(const std::string& header, const std::string& elist,
19 const std::string& nlist, const std::string& mplist,
20 const std::string& volt, const std::string& unit);
21 /// Destructor
23
24 void ElectricField(const double x, const double y, const double z, double& ex,
25 double& ey, double& ez, Medium*& m, int& status);
26 void ElectricField(const double x, const double y, const double z, double& ex,
27 double& ey, double& ez, double& v, Medium*& m,
28 int& status);
29
30 void WeightingField(const double x, const double y, const double z,
31 double& wx, double& wy, double& wz,
32 const std::string& label);
33 double WeightingPotential(const double x, const double y, const double z,
34 const std::string& label);
35
36 Medium* GetMedium(const double x, const double y, const double z);
37
38 virtual bool IsInBoundingBox(const double x, const double y,
39 const double z) const {
40 return x >= xMinBoundingBox && x <= xMaxBoundingBox &&
41 y >= yMinBoundingBox && y <= yMaxBoundingBox &&
43 }
44
45 /** Import a field map from a set of files.
46 * \param header name of the header file
47 (contains the number of elements and nodes).
48 * \param elist name of the file that contains the list of mesh elements
49 * \param nlist name of the file that contains the list of mesh nodes
50 * \param mplist name of the file that contains the material properties
51 * \param volt output of the field solver (list of voltages)
52 * \param unit length unit to be used
53 */
54 bool Initialise(const std::string& header = "mesh.header",
55 const std::string& elist = "mesh.elements",
56 const std::string& nlist = "mesh.nodes",
57 const std::string& mplist = "dielectrics.dat",
58 const std::string& volt = "out.result",
59 const std::string& unit = "cm");
60 /// Import a list of voltages to be used as weighting field.
61 bool SetWeightingField(std::string prnsol, std::string label);
62
63 protected:
64 // Verify periodicities
66
67 double GetElementVolume(const unsigned int i);
68 void GetAspectRatio(const unsigned int i, double& dmin, double& dmax);
69};
70}
71#endif
Component for importing field maps computed by Elmer.
double WeightingPotential(const double x, const double y, const double z, const std::string &label)
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, Medium *&m, int &status)
bool Initialise(const std::string &header="mesh.header", const std::string &elist="mesh.elements", const std::string &nlist="mesh.nodes", const std::string &mplist="dielectrics.dat", const std::string &volt="out.result", const std::string &unit="cm")
void GetAspectRatio(const unsigned int i, double &dmin, double &dmax)
virtual bool IsInBoundingBox(const double x, const double y, const double z) const
bool SetWeightingField(std::string prnsol, std::string label)
Import a list of voltages to be used as weighting field.
ComponentElmer()
Default constructor.
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.
double GetElementVolume(const unsigned int i)
Base class for components based on finite-element field maps.
Abstract base class for media.
Definition: Medium.hh:11