Garfield++ v1r0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
MoleculeDef.h
Go to the documentation of this file.
1#ifndef MOLECULE_DEF_H
2#define MOLECULE_DEF_H
3
5
6/*
7Definition of molecule as a mixture of atoms.
8Only the basic information: the name, the notation,
9the mean charge and atomic weight and the parameters of mixture class.
10
11The principle of definitions of matters is the same as for atoms:
12a dictionary or a database. See details there. But the logbook is different,
13of course.
14
151998-2004 I. Smirnov
16*/
17
18namespace Heed {
19
20class VanDerVaals virt_common_base_col {
21 private:
22 double ah;
23 double bh;
24 double Vkh;
25 double Pkh;
26 double Tkh;
27
28 public:
29 VanDerVaals(double fPk, double fTk);
30 virtual ~VanDerVaals() {}
31 double a(void) const { return ah; }
32 double b(void) const { return bh; }
33 double Vk(void) const { return Vkh; }
34 double Pk(void) const { return Pkh; }
35 double Tk(void) const { return Tkh; }
36 /*
37 double pressure(double M, // the number of moles
38 double volume,
39 double T);
40 double volume(double T, // relative to T_k
41 double p, // relative to p_k
42 int &s_not_single);
43 */
44 // Return number of moles in the unit volume
45 double volume_of_mole(double T, double p, int& s_not_single);
46
47 macro_copy_header(VanDerVaals);
48};
49std::ostream& operator<<(std::ostream& file, const VanDerVaals& f);
50
51class MoleculeDef : public AtomMixDef {
52 String nameh;
53 String notationh;
54 // Number of atoms of particular sort in the molecule
55 // Obviously it is not normalized to one, but instead
56 // the sum is equal to tqatomh
57 DynLinArr<long> qatom_psh;
58 long Z_totalh;
59 double A_totalh;
60 // Total number of atoms in molecule
61 // Attention: this is not the number of different sorts of atoms
62 // The latter is qatom() from AtomMixDef
63 long tqatomh;
64 ActivePtr<VanDerVaals> awlsh;
65
66 public:
67 inline const String& name(void) const { return nameh; }
68 inline const String& notation(void) const { return notationh; }
69 inline const DynLinArr<long>& qatom_ps(void) const { return qatom_psh; }
70 inline long qatom_ps(long n) const { return qatom_psh[n]; }
71 inline long Z_total(void) const { return Z_totalh; }
72 inline double A_total(void) const { return A_totalh; }
73 inline long tqatom(void) const { return tqatomh; }
74 inline const ActivePtr<VanDerVaals>& awls(void) const { return awlsh; }
75 MoleculeDef(void);
76 MoleculeDef(const String& fname, const String& fnotation, long fqatom,
77 const DynLinArr<String>& fatom_not,
78 const DynLinArr<long>& fqatom_ps,
79 ActivePtr<VanDerVaals> fawls = ActivePtr<VanDerVaals>());
80 MoleculeDef(const String& fname, const String& fnotation,
81 const String& fatom_not, long fqatom_ps,
82 ActivePtr<VanDerVaals> fawls = ActivePtr<VanDerVaals>());
83 MoleculeDef(const String& fname, const String& fnotation,
84 const String& fatom_not1, long fqatom_ps1,
85 const String& fatom_not2, long fqatom_ps2,
86 ActivePtr<VanDerVaals> fawls = ActivePtr<VanDerVaals>());
87 MoleculeDef(const String& fname, const String& fnotation,
88 const String& fatom_not1, long fqatom_ps1,
89 const String& fatom_not2, long fqatom_ps2,
90 const String& fatom_not3, long fqatom_ps3,
91 ActivePtr<VanDerVaals> fawls = ActivePtr<VanDerVaals>());
93
94 void print(std::ostream& file, int l) const;
95 static void printall(std::ostream& file);
96 // Check that there is no molecule with the same name in the container
97 void verify(void);
99 // Initialize the logbook at the first request
100 // and keep it as internal static variable.
101 static const AbsList<MoleculeDef*>& get_const_logbook(void);
102 // Return the address of the molecule with this name.
103 // If there is no molecule with this notation, the function returns NULL
104 // but does not terminate the program as that for AtomDef. Be careful.
105 static MoleculeDef* get_MoleculeDef(const String& fnotation);
106
108};
109std::ostream& operator<<(std::ostream& file, const MoleculeDef& f);
110
111}
112
113#endif
std::string String
Definition: String.h:75
const ActivePtr< VanDerVaals > & awls(void) const
Definition: MoleculeDef.h:74
long tqatom(void) const
Definition: MoleculeDef.h:73
macro_copy_total(MoleculeDef)
static MoleculeDef * get_MoleculeDef(const String &fnotation)
const DynLinArr< long > & qatom_ps(void) const
Definition: MoleculeDef.h:69
static void printall(std::ostream &file)
static AbsList< MoleculeDef * > & get_logbook(void)
long Z_total(void) const
Definition: MoleculeDef.h:71
void print(std::ostream &file, int l) const
const String & name(void) const
Definition: MoleculeDef.h:67
long qatom_ps(long n) const
Definition: MoleculeDef.h:70
const String & notation(void) const
Definition: MoleculeDef.h:68
static const AbsList< MoleculeDef * > & get_const_logbook(void)
double A_total(void) const
Definition: MoleculeDef.h:72
macro_copy_header(VanDerVaals)
double volume_of_mole(double T, double p, int &s_not_single)
double Vk(void) const
Definition: MoleculeDef.h:33
VanDerVaals(double fPk, double fTk)
double a(void) const
Definition: MoleculeDef.h:31
double Tk(void) const
Definition: MoleculeDef.h:35
double b(void) const
Definition: MoleculeDef.h:32
double Pk(void) const
Definition: MoleculeDef.h:34
Definition: BGMesh.cpp:3
std::ostream & operator<<(std::ostream &file, const BGMesh &bgm)
Definition: BGMesh.cpp:22