Garfield++ 5.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
MoleculeDef.h
Go to the documentation of this file.
1#ifndef MOLECULE_DEF_H
2#define MOLECULE_DEF_H
3
4#include <memory>
6
7namespace Heed {
8
9/// Helper class for Van-der-Waals equation.
11 private:
12 double ah;
13 double bh;
14 double Vkh;
15 double Pkh;
16 double Tkh;
17
18 public:
19 VanDerWaals(double fPk, double fTk);
20 double a() const { return ah; }
21 double b() const { return bh; }
22 double Vk() const { return Vkh; }
23 double Pk() const { return Pkh; }
24 double Tk() const { return Tkh; }
25 /*
26 double pressure(double M, // the number of moles
27 double volume,
28 double T);
29 double volume(double T, // relative to T_k
30 double p, // relative to p_k
31 int &s_not_single);
32 */
33 // Return number of moles in the unit volume
34 double volume_of_mole(double T, double p, int& s_not_single);
35
36 VanDerWaals* copy() const;
37};
38std::ostream& operator<<(std::ostream& file, const VanDerWaals& f);
39
40/// Definition of molecule as a mixture of atoms.
41/// Only the basic information: the name, the notation,
42/// the mean charge and atomic weight and the parameters of mixture class.
43///
44/// 1998-2004 I. Smirnov
45
46class MoleculeDef : public AtomMixDef {
47 std::string nameh = "none";
48 std::string notationh = "none";
49 /// Number of atoms of particular sort in the molecule.
50 /// Obviously it is not normalized to one, but instead
51 /// the sum is equal to tqatomh
52 std::vector<long> qatom_psh;
53 long Z_totalh = 0;
54 double A_totalh = 0.;
55 /// Total number of atoms in molecule
56 /// Attention: this is not the number of different sorts of atoms
57 /// The latter is qatom() from AtomMixDef
58 long tqatomh = 0;
59 std::shared_ptr<VanDerWaals> m_vdw;
60
61 public:
62 const std::string& name() const { return nameh; }
63 const std::string& notation() const { return notationh; }
64 const std::vector<long>& qatom_ps() const { return qatom_psh; }
65 long qatom_ps(long n) const { return qatom_psh[n]; }
66 long Z_total() const { return Z_totalh; }
67 double A_total() const { return A_totalh; }
68 long tqatom() const { return tqatomh; }
69 const std::shared_ptr<VanDerWaals>& vdw() const { return m_vdw; }
70 MoleculeDef() = default;
71 MoleculeDef(const std::string& fname, const std::string& fnotation,
72 long fqatom, const std::vector<std::string>& fatom_not,
73 const std::vector<long>& fqatom_ps,
74 std::shared_ptr<VanDerWaals> fvdw = {});
75 MoleculeDef(const std::string& fname, const std::string& fnotation,
76 const std::string& fatom_not, long fqatom_ps,
77 std::shared_ptr<VanDerWaals> fvdw = {});
78 MoleculeDef(const std::string& fname, const std::string& fnotation,
79 const std::string& fatom_not1, long fqatom_ps1,
80 const std::string& fatom_not2, long fqatom_ps2,
81 std::shared_ptr<VanDerWaals> fvdw = {});
82 MoleculeDef(const std::string& fname, const std::string& fnotation,
83 const std::string& fatom_not1, long fqatom_ps1,
84 const std::string& fatom_not2, long fqatom_ps2,
85 const std::string& fatom_not3, long fqatom_ps3,
86 std::shared_ptr<VanDerWaals> fvdw = {});
87 ~MoleculeDef() = default;
88
89 void print(std::ostream& file, int l) const;
90
91 MoleculeDef* copy() const { return new MoleculeDef(*this); }
92};
93std::ostream& operator<<(std::ostream& file, const MoleculeDef& f);
94
95/// Library of molecules.
96
98
99public:
100 static const std::list<MoleculeDef>& getMolecules();
101 /// Return the address of the molecule with this name.
102 /// If there is no molecule with this notation, the function returns NULL
103 /// but does not terminate the program as that for AtomDef. Be careful.
104 static const MoleculeDef* getMolecule(const std::string& fnotation);
105 /// Print all registered molecules.
106 static void printMolecules(std::ostream& file);
107private:
108 static std::list<MoleculeDef> molecules;
109};
110
111}
112
113#endif
AtomMixDef()=default
Default constructor.
MoleculeDef()=default
const std::vector< long > & qatom_ps() const
Definition MoleculeDef.h:64
const std::string & name() const
Definition MoleculeDef.h:62
MoleculeDef * copy() const
Definition MoleculeDef.h:91
long tqatom() const
Definition MoleculeDef.h:68
void print(std::ostream &file, int l) const
~MoleculeDef()=default
long qatom_ps(long n) const
Definition MoleculeDef.h:65
long Z_total() const
Definition MoleculeDef.h:66
const std::string & notation() const
Definition MoleculeDef.h:63
double A_total() const
Definition MoleculeDef.h:67
const std::shared_ptr< VanDerWaals > & vdw() const
Definition MoleculeDef.h:69
Library of molecules.
Definition MoleculeDef.h:97
static const MoleculeDef * getMolecule(const std::string &fnotation)
static const std::list< MoleculeDef > & getMolecules()
static void printMolecules(std::ostream &file)
Print all registered molecules.
Helper class for Van-der-Waals equation.
Definition MoleculeDef.h:10
double a() const
Definition MoleculeDef.h:20
VanDerWaals * copy() const
double b() const
Definition MoleculeDef.h:21
double Vk() const
Definition MoleculeDef.h:22
double Tk() const
Definition MoleculeDef.h:24
double volume_of_mole(double T, double p, int &s_not_single)
VanDerWaals(double fPk, double fTk)
double Pk() const
Definition MoleculeDef.h:23
Definition BGMesh.cpp:6
std::ostream & operator<<(std::ostream &file, const BGMesh &bgm)
Definition BGMesh.cpp:37