NAMD
Settle.h
Go to the documentation of this file.
1 
7 #ifndef SETTLE_H__
8 #define SETTLE_H__
9 
10 #include "Vector.h"
11 #include "Tensor.h"
12 
13 /*
14 
15 Oxygen at a0, hydrogens at b0, c0, center of mass at the origin.
16 
17  |
18  |
19  |
20  a0 .-------
21  | |
22  | ra
23  | |
24 ---------------------------------------
25  | | |
26  rb |---rc---|
27  | | |
28  b0 .-----------| c0 .
29 
30 SETTLE for step one of velocity verlet.
31 ref: positions before unconstrained step
32 mass: masses
33 pos: on input: positions after unconstrained step; on output: the new
34  positions.
35 vel: on input: velocities after unconstrained step; on output: the new
36  velocities.
37 ra, rb, rc: canonical positions of water atoms; see above diagram
38 */
39 
41 void settle1init(BigReal pmO, BigReal pmH, BigReal hhdist, BigReal ohdist,
42  BigReal &mOrmT, BigReal &mHrmT, BigReal &ra,
43  BigReal &rb, BigReal &rc, BigReal &rra);
44 
46 int settle1(const Vector *ref, Vector *pos, Vector *vel, BigReal invdt,
47  BigReal mOrmT, BigReal mHrmT, BigReal ra,
48  BigReal rb, BigReal rc, BigReal rra);
49 
50 template <int veclen>
51 void settle1_SIMD(const Vector *ref, Vector *pos,
52  BigReal mOrmT, BigReal mHrmT, BigReal ra,
53  BigReal rb, BigReal rc, BigReal rra);
54 
55 struct RattleParam {
56  int ia;
57  int ib;
61 };
62 
63 template <int veclen>
64 void rattlePair(const RattleParam* rattleParam,
65  const BigReal *refx, const BigReal *refy, const BigReal *refz,
66  BigReal *posx, BigReal *posy, BigReal *posz, bool& consFailure);
67 
68 void rattleN(const int icnt, const RattleParam* rattleParam,
69  const BigReal *refx, const BigReal *refy, const BigReal *refz,
70  BigReal *posx, BigReal *posy, BigReal *posz,
71  const BigReal tol2, const int maxiter,
72  bool& done, bool& consFailure);
73 
74 extern int settle2(BigReal mO, BigReal mH, const Vector *pos,
75  Vector *vel, BigReal dt, Tensor *virial);
76 #endif
int ib
Definition: Settle.h:57
void rattlePair(const RattleParam *rattleParam, const BigReal *refx, const BigReal *refy, const BigReal *refz, BigReal *posx, BigReal *posy, BigReal *posz, bool &consFailure)
Definition: Settle.C:546
Definition: Vector.h:64
BigReal dsq
Definition: Settle.h:58
int settle2(BigReal mO, BigReal mH, const Vector *pos, Vector *vel, BigReal dt, Tensor *virial)
Definition: Settle.C:705
int settle1(const Vector *ref, Vector *pos, Vector *vel, BigReal invdt, BigReal mOrmT, BigReal mHrmT, BigReal ra, BigReal rb, BigReal rc, BigReal rra)
optimized settle1 algorithm, reuses water properties as much as possible
Definition: Settle.C:55
BigReal rmb
Definition: Settle.h:60
Definition: Tensor.h:15
BigReal rma
Definition: Settle.h:59
void settle1init(BigReal pmO, BigReal pmH, BigReal hhdist, BigReal ohdist, BigReal &mOrmT, BigReal &mHrmT, BigReal &ra, BigReal &rb, BigReal &rc, BigReal &rra)
initialize cached water properties
Definition: Settle.C:40
int ia
Definition: Settle.h:56
void settle1_SIMD(const Vector *ref, Vector *pos, BigReal mOrmT, BigReal mHrmT, BigReal ra, BigReal rb, BigReal rc, BigReal rra)
Definition: Settle.C:285
void rattleN(const int icnt, const RattleParam *rattleParam, const BigReal *refx, const BigReal *refy, const BigReal *refz, BigReal *posx, BigReal *posy, BigReal *posz, const BigReal tol2, const int maxiter, bool &done, bool &consFailure)
Definition: Settle.C:591
double BigReal
Definition: common.h:114