Garfield++ 3.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
ComponentComsol.hh
Go to the documentation of this file.
1#pragma once
2
4
5namespace Garfield {
6
7/// Component for importing and interpolating Comsol field maps.
8
10 public:
11 /// Default constructor
13 ComponentComsol(std::string mesh, std::string mplist, std::string field);
14 /// Destructor
16
17 void ElectricField(const double x, const double y, const double z, double& ex,
18 double& ey, double& ez, Medium*& m, int& status) override;
19 void ElectricField(const double x, const double y, const double z, double& ex,
20 double& ey, double& ez, double& v, Medium*& m,
21 int& status) override;
22
23 void WeightingField(const double x, const double y, const double z,
24 double& wx, double& wy, double& wz,
25 const std::string& label) override;
26
27 double WeightingPotential(const double x, const double y, const double z,
28 const std::string& label) override;
29
30 Medium* GetMedium(const double x, const double y, const double z) override;
31
32 bool Initialise(std::string header = "mesh.mphtxt",
33 std::string mplist = "dielectrics.dat",
34 std::string field = "field.txt");
35
36 bool SetWeightingField(std::string file, std::string label);
37
38 protected:
40
41 double GetElementVolume(const unsigned int i) override;
42 void GetAspectRatio(const unsigned int i, double& dmin,
43 double& dmax) override;
44
45 struct nodeCmp {
47 const ComponentFieldMap::Node& rhs) const {
48 double dx = round(lhs.x * 1e6) - round(rhs.x * 1e6);
49 double dy = round(lhs.y * 1e6) - round(rhs.y * 1e6);
50 double dz = round(lhs.z * 1e6) - round(rhs.z * 1e6);
51 return dx < 0 || (dx == 0 && (dy < 0 || (dy == 0 && dz < 0)));
52 }
53 };
54};
55}
Component for importing and interpolating Comsol field maps.
void UpdatePeriodicity() override
Verify periodicities.
Medium * GetMedium(const double x, const double y, const double z) override
Get the medium at a given location (x, y, z).
void WeightingField(const double x, const double y, const double z, double &wx, double &wy, double &wz, const std::string &label) override
double WeightingPotential(const double x, const double y, const double z, const std::string &label) override
ComponentComsol()
Default constructor.
void ElectricField(const double x, const double y, const double z, double &ex, double &ey, double &ez, Medium *&m, int &status) override
double GetElementVolume(const unsigned int i) override
void GetAspectRatio(const unsigned int i, double &dmin, double &dmax) override
bool SetWeightingField(std::string file, std::string label)
bool Initialise(std::string header="mesh.mphtxt", std::string mplist="dielectrics.dat", std::string field="field.txt")
Base class for components based on finite-element field maps.
Abstract base class for media.
Definition: Medium.hh:13
bool operator()(const ComponentFieldMap::Node &lhs, const ComponentFieldMap::Node &rhs) const