Garfield++ v2r0
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
5
6namespace Heed {
7
8/// Helper class for Van-der-Waals equation.
10 private:
11 double ah;
12 double bh;
13 double Vkh;
14 double Pkh;
15 double Tkh;
16
17 public:
18 VanDerWaals(double fPk, double fTk);
19 virtual ~VanDerWaals() {}
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 virtual 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;
52 std::string notationh;
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;
58 double A_totalh;
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;
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 ActivePtr<VanDerWaals>& awls() const { return awlsh; }
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,
79 MoleculeDef(const std::string& fname, const std::string& fnotation,
80 const std::string& fatom_not, long fqatom_ps,
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,
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,
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 virtual MoleculeDef* copy() const { return new MoleculeDef(*this); }
107};
108std::ostream& operator<<(std::ostream& file, const MoleculeDef& f);
109}
110
111#endif
Active pointer or automatic container or controlling pointer.
Definition: AbsPtr.h:199
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)
long tqatom() const
Definition: MoleculeDef.h:72
void print(std::ostream &file, int l) const
virtual MoleculeDef * copy() const
Definition: MoleculeDef.h:106
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
const ActivePtr< VanDerWaals > & awls() const
Definition: MoleculeDef.h:73
static std::list< MoleculeDef * > & get_logbook()
static const std::list< MoleculeDef * > & get_const_logbook()
double A_total() const
Definition: MoleculeDef.h:71
Helper class for Van-der-Waals equation.
Definition: MoleculeDef.h:9
double a() const
Definition: MoleculeDef.h:20
virtual 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
virtual ~VanDerWaals()
Definition: MoleculeDef.h:19
double Pk() const
Definition: MoleculeDef.h:23
Definition: BGMesh.cpp:5
std::ostream & operator<<(std::ostream &file, const BGMesh &bgm)
Definition: BGMesh.cpp:36