Debian Codegraph @

include/BALL/MOLMEC/MMFF94/MMFF94Torsion.h

raw symbols SCIP
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4 // $Id: MMFF94Torsion.h,v 1.1.8.1 2007/03/25 21:25:19 oliver Exp $
5 //
6
7 #ifndef BALL_MOLMEC_MMFF94_MMFF94TORSION_H
8 #define BALL_MOLMEC_MMFF94_MMFF94TORSION_H
9
10 #ifndef BALL_MOLMEC_COMMON_FORCEFIELDCOMPONENT_H
11 # include <BALL/MOLMEC/COMMON/forceFieldComponent.h>
12 #endif
13
14 #ifndef BALL_MOLMEC_COMMON_FORCEFIELD_H
15 # include <BALL/MOLMEC/COMMON/forceField.h>
16 #endif
17
18 #ifndef BALL_MOLMEC_MMFF94_MMFF94PARAMETERS_H
19 # include <BALL/MOLMEC/MMFF94/MMFF94Parameters.h>
20 #endif
21
22 namespace BALL
23 {
24 /** MMFF94 bond stretch component
25 \ingroup MMFF94
26 */
27 class BALL_EXPORT MMFF94Torsion
28 : public ForceFieldComponent
29 {
30 public:
31
32 /// see MMFFTOR.PAR
33 struct BALL_EXPORT Torsion
34 {
35 Torsion();
36
37 Index type;
38 Atom* atom1;
39 Atom* atom2;
40 Atom* atom3;
41 Atom* atom4;
42 double v1, v2, v3;
43 // for debugging:
44 double energy;
45 double angle;
46 bool heuristic;
47 };
48
49 /** @name Type Definitions
50 */
51 //@{
52
53 /// flag to enable Torsions
54 #define MMFF94_TORSIONS_ENABLED "enable Torsions"
55 //@}
56
57 /** @name Constructors and Destructors
58 */
59 //@{
60
61 BALL_CREATE(MMFF94Torsion)
62
63 /** Default constructor.
64 */
65 MMFF94Torsion();
66
67 /** Constructor.
68 */
69 MMFF94Torsion(ForceField& force_field);
70
71 /** Copy constructor
72 */
73 MMFF94Torsion(const MMFF94Torsion& MMFF94_stretch);
74
75 /** Destructor.
76 */
77 virtual ~MMFF94Torsion();
78
79 //@}
80 /** @name Setup Methods
81 */
82 //@{
83
84 /** Setup method.
85 * @throws BALL::Exception::TooManyErrors
86 */
87 virtual bool setup();
88
89 //@}
90 /** @name Accessors
91 */
92 //@{
93
94 /** Calculates and returns the component's energy.
95 */
96 virtual double updateEnergy();
97
98 /** Calculates and returns the component's forces.
99 */
100 virtual void updateForces();
101
102 ///
103 Position getTorsionType(const vector<Atom*>& atoms) const;
104
105 ///
106 const vector<Torsion>& getTorsions() const { return torsions_;}
107
108 //@}
109
110 protected:
111
112 // Add a double precision TVector3 to a single precision Vector3
113 inline void AddDV3_(Vector3& f3, const TVector3<double> d3);
114
115 double getU_(Position e);
116 double getV_(Position e);
117 bool calculateHeuristic_(const Atom& aj, const Atom& ak, double& v1, double& v2, double& v3);
118
119 vector<Torsion> torsions_;
120 MMFF94TorsionParameters parameters_;
121 };
122 } // namespace BALL
123
124 #endif // BALL_MOLMEC_MMFF94_MMFF94TORSION_H