Debian Codegraph @

include/BALL/MOLMEC/AMBER/amberTorsion.h

raw symbols SCIP
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4
5 // Molecular Mechanics: Amber force field, bond stretch component
6
7 #ifndef BALL_MOLMEC_AMBER_AMBERTORSION_H
8 #define BALL_MOLMEC_AMBER_AMBERTORSION_H
9
10 #ifndef BALL_COMMON_H
11 # include <BALL/common.h>
12 #endif
13
14 #ifndef BALL_MOLMEC_PARAMETER_COSINETORSION_H
15 # include <BALL/MOLMEC/PARAMETER/cosineTorsion.h>
16 #endif
17
18 #ifndef BALL_MOLMEC_COMMON_FORCEFIELDCOMPONENT_H
19 # include <BALL/MOLMEC/COMMON/forceFieldComponent.h>
20 #endif
21
22 #ifndef BALL_MOLMEC_COMMON_FORCEFIELD_H
23 # include <BALL/MOLMEC/COMMON/forceField.h>
24 #endif
25
26 namespace BALL
27 {
28 /** Amber bond stretch component
29 \ingroup AMBER
30 */
31 class BALL_EXPORT AmberTorsion
32 : public ForceFieldComponent
33 {
34 public:
35
36 /// flag to enable Torsions
37 #define AMBER_TORSIONS_ENABLED "enable Torsions"
38
39 /** @name Type Definitions
40 */
41 //@{
42
43 struct SingleAmberTorsion
44 {
45 Atom* atom1;
46 Atom* atom2;
47 Atom* atom3;
48 Atom* atom4;
49
50 float V;
51 unsigned char f;
52 float phase;
53
54 SingleAmberTorsion()
55 : atom1(0),
56 atom2(0),
57 atom3(0),
58 atom4(0),
59 V(0),
60 f(0),
61 phase(0)
62 {
63 }
64
65
66 SingleAmberTorsion(CosineTorsion::SingleData& t)
67 {
68 atom1 = t.atom1;
69 atom2 = t.atom2;
70 atom3 = t.atom3;
71 atom4 = t.atom4;
72
73 V = t.values.V / t.values.n;
74 f = (unsigned char)t.values.f;
75 phase = ((2.0 * BALL::Constants::PI)/360.0) * t.values.phase;
76 }
77 };
78
79 //@}
80
81 /** @name Constructors and Destructors
82 */
83 //@{
84
85 BALL_CREATE(AmberTorsion)
86
87 /** Default constructor.
88 */
89 AmberTorsion();
90
91 /** Constructor.
92 */
93 AmberTorsion(ForceField& force_field);
94
95 /** Copy constructor
96 */
97 AmberTorsion(const AmberTorsion& amber_stretch);
98
99 /** Destructor.
100 */
101 virtual ~AmberTorsion();
102
103 //@}
104 /** @name Setup Methods
105 */
106 //@{
107
108 /** Setup method.
109 * @throws BALL::Exception::TooManyErrors
110 */
111 virtual bool setup();
112
113 //@}
114 /** @name Accessors
115 */
116 //@{
117
118 /** Calculates and returns the component's energy.
119 */
120 virtual double updateEnergy();
121
122 /** Calculates and returns the component's forces.
123 */
124 virtual void updateForces();
125
126 //@}
127
128 private:
129
130 /*_ @name Private Attributes
131 */
132 //_@{
133
134 /*_ array with the torsions
135 */
136 vector<SingleAmberTorsion> torsion_;
137
138 CosineTorsion torsion_parameters_;
139
140 CosineTorsion improper_parameters_;
141
142 ParameterSection impropers_;
143
144 //_@}
145
146 };
147 } // namespace BALL
148
149 #endif // BALL_MOLMEC_AMBER_AMBERTORSION_H