Garfield++ 4.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/// The principle of definitions of matters is the same as for atoms:
45/// a dictionary or a database. See details there. But the logbook is different,
46/// of course.
47///
48/// 1998-2004 I. Smirnov
49
50class MoleculeDef : public AtomMixDef {
51 std::string nameh = "none";
52 std::string notationh = "none";
53 /// Number of atoms of particular sort in the molecule.
54 /// Obviously it is not normalized to one, but instead
55 /// the sum is equal to tqatomh
56 std::vector<long> qatom_psh;
57 long Z_totalh = 0;
58 double A_totalh = 0.;
59 /// Total number of atoms in molecule
60 /// Attention: this is not the number of different sorts of atoms
61 /// The latter is qatom() from AtomMixDef
62 long tqatomh = 0;
63 std::shared_ptr<VanDerWaals> m_vdw;
64
65 public:
66 const std::string& name() const { return nameh; }
67 const std::string& notation() const { return notationh; }
68 const std::vector<long>& qatom_ps() const { return qatom_psh; }
69 long qatom_ps(long n) const { return qatom_psh[n]; }
70 long Z_total() const { return Z_totalh; }
71 double A_total() const { return A_totalh; }
72 long tqatom() const { return tqatomh; }
73 const std::shared_ptr<VanDerWaals>& vdw() const { return m_vdw; }
75 MoleculeDef(const std::string& fname, const std::string& fnotation,
76 long fqatom, const std::vector<std::string>& fatom_not,
77 const std::vector<long>& fqatom_ps,
78 std::shared_ptr<VanDerWaals> fvdw = {});
79 MoleculeDef(const std::string& fname, const std::string& fnotation,
80 const std::string& fatom_not, long fqatom_ps,
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 std::shared_ptr<VanDerWaals> fvdw = {});
86 MoleculeDef(const std::string& fname, const std::string& fnotation,
87 const std::string& fatom_not1, long fqatom_ps1,
88 const std::string& fatom_not2, long fqatom_ps2,
89 const std::string& fatom_not3, long fqatom_ps3,
90 std::shared_ptr<VanDerWaals> fvdw = {});
92
93 void print(std::ostream& file, int l) const;
94 static void printall(std::ostream& file);
95 /// Check that there is no molecule with the same name in the container
96 void verify();
97 static std::list<MoleculeDef*>& get_logbook();
98 /// Initialize the logbook at the first request
99 /// and keep it as internal static variable.
100 static const std::list<MoleculeDef*>& get_const_logbook();
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 MoleculeDef* get_MoleculeDef(const std::string& fnotation);
105
106 MoleculeDef* copy() const { return new MoleculeDef(*this); }
107};
108std::ostream& operator<<(std::ostream& file, const MoleculeDef& f);
109}
110
111#endif
const std::vector< long > & qatom_ps() const
Definition: MoleculeDef.h:68
const std::string & name() const
Definition: MoleculeDef.h:66
void verify()
Check that there is no molecule with the same name in the container.
static MoleculeDef * get_MoleculeDef(const std::string &fnotation)
static void printall(std::ostream &file)
MoleculeDef * copy() const
Definition: MoleculeDef.h:106
long tqatom() const
Definition: MoleculeDef.h:72
void print(std::ostream &file, int l) const
long qatom_ps(long n) const
Definition: MoleculeDef.h:69
long Z_total() const
Definition: MoleculeDef.h:70
const std::string & notation() const
Definition: MoleculeDef.h:67
static std::list< MoleculeDef * > & get_logbook()
static const std::list< MoleculeDef * > & get_const_logbook()
double A_total() const
Definition: MoleculeDef.h:71
const std::shared_ptr< VanDerWaals > & vdw() const
Definition: MoleculeDef.h:73
Helper class for Van-der-Waals equation.
Definition: MoleculeDef.h:10
double a() const
Definition: MoleculeDef.h:20
VanDerWaals * copy() const
Definition: MoleculeDef.cpp:43
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)
Definition: MoleculeDef.cpp:26
double Pk() const
Definition: MoleculeDef.h:23
Definition: BGMesh.cpp:6
std::ostream & operator<<(std::ostream &file, const BGMesh &bgm)
Definition: BGMesh.cpp:37