Debian Codegraph @

include/BALL/MOLMEC/PARAMETER/lennardJones.h

raw symbols SCIP
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4
5 // Molecular Mechanics Parameter: class describing the atom type section of a parameter file
6
7 #ifndef BALL_MOLMEC_PARAMETER_LENNARDJONES_H
8 #define BALL_MOLMEC_PARAMETER_LENNARDJONES_H
9
10 #ifndef BALL_FORMAT_PARAMETERSECTION_H
11 # include <BALL/FORMAT/parameterSection.h>
12 #endif
13
14 #ifndef BALL_MOLMEC_PARAMETER_ATOMTYPES_H
15 # include <BALL/MOLMEC/PARAMETER/atomTypes.h>
16 #endif
17
18 namespace BALL
19 {
20 /** Lennard Jones parameter section.
21 This section reads parameters for a Lennard Jones potental (usually a
22 6-12 Potential). Parameters may be given in three different formats
23 (no mixing of formats is allowed).
24 - <b> A </b> and <b> B </b> are given directly ( \link A_B_FORMAT A_B_FORMAT \endlink )
25 - well depth and minimum radii ( \link EPSILON_R_FORMAT EPSILON_R_FORMAT \endlink )
26 - Slater-Kirkwood parameters ( \link SLATER_KIRKWOOD_FORMAT SLATER_KIRKWOOD_FORMAT \endlink )
27
28 If the Slater-Kirkwood format is used, the values for \f$A_{ij}\f$ and \f$B_{ij}\f$ are calculated
29 as follows (see e.g. Brooks et al., J. Comput. Chem, 4(2):187-217 (1983))
30 \f[
31 B_{ij} = \frac{3}{2} \left(\frac{1}{4 \pi \varepsilon_0}\right)^\frac{1}{2}
32 \frac{e \hbar \sqrt{m_e} \alpha_i \alpha_j}{\sqrt{\frac{\alpha_i}{N_i} + \sqrt{\frac{\alpha_j}{N_j}}}}
33 \f]
34 \par
35 \f[
36 A_{ij} = \frac{1}2{} B_{ij} (R_i + R_j)^6
37 \f]
38 \par
39
40 \ingroup MolmecParameters
41 */
42 class BALL_EXPORT LennardJones
43 : public ParameterSection
44 {
45 public:
46
47 /** @name Enums
48 */
49 //@{
50
51 enum FormatType
52 {
53 A_B_FORMAT,
54 EPSILON_R_FORMAT,
55 SLATER_KIRKWOOD_FORMAT
56 };
57
58 //@}
59 /** @name Type definitions
60 */
61 //@{
62
63 /**
64 */
65 struct BALL_EXPORT Values
66 {
67 float A;
68 float B;
69 };
70
71 struct BALL_EXPORT Data
72 {
73 Atom* atom1;
74 Atom* atom2;
75 Values values;
76 };
77
78 //@}
79
80
81 /** @name Constructors and Destructors
82 */
83 //@{
84
85 /** Default constructor.
86 */
87 LennardJones() ;
88
89 /** Copy constructor.
90 */
91 LennardJones(const LennardJones& lj) ;
92
93 /** Destructor.
94 */
95 virtual ~LennardJones() ;
96
97 /** Clear method.
98 */
99 virtual void clear() ;
100
101 //@}
102
103 /** Reads a parameter section from an INI file.
104 This method reads the section given in section\_name from
105 ini\_file, interprets (if given) a format line, reads the data from
106 this section according to the format, and builds some
107 datastructures for fast and easy access to this data.
108 */
109 virtual bool extractSection(ForceFieldParameters& parameters,
110 const String& section_name) ;
111
112 ///
113 virtual bool extractSection(Parameters& parameters,
114 const String& section_name) ;
115
116 /** Queries whether a parameter set is defined for the given atom types.
117 */
118 bool hasParameters(Atom::Type I, Atom::Type J) const ;
119
120 /** Returns the parameters for a given atom type combination.
121 */
122 Values getParameters(Atom::Type I, Atom::Type J) const ;
123
124 /** Assign the parameters for a given atom type combination.
125 If no parameters are defined for this combination, false is
126 returned and nothing is changed.
127 */
128 bool assignParameters(Values& parameters, Atom::Type I, Atom::Type J)
129 const ;
130
131 /** @name Assignment
132 */
133 //@{
134
135 /** Assignment operator
136 */
137 const LennardJones& operator = (const LennardJones& lj) ;
138
139 //@}
140 /** @name Predicates
141 */
142 //@{
143
144 /** Equality operator
145 */
146 bool operator == (const LennardJones& lj) const ;
147
148 //@}
149
150 protected:
151
152 Size number_of_atom_types_;
153
154 std::vector<float> A_;
155
156 std::vector<float> B_;
157
158 std::vector<float> N_;
159
160 std::vector<float> Aij_;
161
162 std::vector<float> Bij_;
163
164 std::vector<bool> is_defined_;
165
166 FormatType format_;
167
168 std::vector<String> names_;
169 };
170 } // namespace BALL
171
172 #endif // BALL_MOLMEC_PARAMETER_LENNARDJONES_H