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 &mO, BigReal &mH,
43  BigReal &mOrmT, BigReal &mHrmT, BigReal &ra,
44  BigReal &rb, BigReal &rc, BigReal &rra);
45 
47 int settle1(const Vector *ref, Vector *pos, Vector *vel, BigReal invdt,
48  BigReal mOrmT, BigReal mHrmT, BigReal ra,
49  BigReal rb, BigReal rc, BigReal rra);
50 
51 template <int veclen>
52 void settle1_SIMD(const Vector *ref, Vector *pos,
53  BigReal mOrmT, BigReal mHrmT, BigReal ra,
54  BigReal rb, BigReal rc, BigReal rra);
55 
56 struct RattleParam {
57  int ia;
58  int ib;
62 };
63 
64 template <int veclen>
65 void rattlePair(const RattleParam* rattleParam,
66  const BigReal *refx, const BigReal *refy, const BigReal *refz,
67  BigReal *posx, BigReal *posy, BigReal *posz, bool& consFailure);
68 
69 void rattleN(const int icnt, const RattleParam* rattleParam,
70  const BigReal *refx, const BigReal *refy, const BigReal *refz,
71  BigReal *posx, BigReal *posy, BigReal *posz,
72  const BigReal tol2, const int maxiter,
73  bool& done, bool& consFailure);
74 //#ifdef NAMD_MSHAKE
75 void MSHAKEIterate(const int icnt, const RattleParam* rattleParam,
76  const BigReal *refx, const BigReal *refy, const BigReal *refz,
77  BigReal *posx, BigReal *posy, BigReal *posz,
78  const BigReal tol2, const int maxiter,
79  bool& done, bool& consFailure);
80 void LINCS(const int icnt, const RattleParam* rattleParam,
81  const BigReal *refx, const BigReal *refy, const BigReal *refz,
82  BigReal *posx, BigReal *posy, BigReal *posz,
83  const BigReal tol2, const int maxiter,
84  bool& done, bool& consFailure);
85 //#endif
86 extern int settle2(BigReal mO, BigReal mH, const Vector *pos,
87  Vector *vel, BigReal dt, Tensor *virial);
88 
89 void settle1_SOA(
90  const double * __restrict ref_x,
91  const double * __restrict ref_y,
92  const double * __restrict ref_z,
93  double * __restrict pos_x,
94  double * __restrict pos_y,
95  double * __restrict pos_z,
96  int numWaters,
97  BigReal mOrmT,
98  BigReal mHrmT,
99  BigReal ra,
100  BigReal rb,
101  BigReal rc,
102  BigReal rra
103  );
104 
105 #endif
int ib
Definition: Settle.h:58
void settle1init(BigReal pmO, BigReal pmH, BigReal hhdist, BigReal ohdist, BigReal &mO, BigReal &mH, BigReal &mOrmT, BigReal &mHrmT, BigReal &ra, BigReal &rb, BigReal &rc, BigReal &rra)
initialize cached water properties
Definition: Settle.C:46
Definition: Vector.h:72
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:554
void settle1_SOA(const double *__restrict ref_x, const double *__restrict ref_y, const double *__restrict ref_z, double *__restrict pos_x, double *__restrict pos_y, double *__restrict pos_z, int numWaters, BigReal mOrmT, BigReal mHrmT, BigReal ra, BigReal rb, BigReal rc, BigReal rra)
Definition: Settle.C:1487
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:63
BigReal dsq
Definition: Settle.h:59
void settle1_SIMD(const Vector *ref, Vector *pos, BigReal mOrmT, BigReal mHrmT, BigReal ra, BigReal rb, BigReal rc, BigReal rra)
Definition: Settle.C:293
void LINCS(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:936
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:1359
int settle2(BigReal mO, BigReal mH, const Vector *pos, Vector *vel, BigReal dt, Tensor *virial)
Definition: Settle.C:1473
void MSHAKEIterate(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:830
BigReal rmb
Definition: Settle.h:61
Definition: Tensor.h:15
BigReal rma
Definition: Settle.h:60
int ia
Definition: Settle.h:57
double BigReal
Definition: common.h:123