NAMD
LincsSolver.h
Go to the documentation of this file.
1 #ifndef LINCSSOLVER_H_
2 #define LINCSSOLVER_H_
3 #include "common.h"
4 typedef struct sparseMatrix sparseMatrix;
6 typedef struct atomData atomData;
14 {
15  private:
16  sparseMatrix* B;
17  constraintTuple* constraintList;
18  int* globalIndex;
19  int* patchID;
20  int* offset;
21  BigReal* inv_mass;
22  BigReal* ref;
23 
24  int num_atoms;
25  int num_constraints;
26  int maxLoops;
27  BigReal tol;
28 
29  int Map(int);
30  void multiplyR(BigReal* dest, BigReal* src);
31  void multiplyC(BigReal* dest, BigReal* src);
32  void matMultiply(BigReal* dest, BigReal* src);
33  void vecAdd(BigReal* dest, BigReal* src1, BigReal* src2, BigReal a);
34  BigReal vecDot(BigReal*, BigReal*);
35  void conjugateGradient(BigReal*, BigReal*);
36  int partition(int left, int right);
37  void sortAtom(int left, int right);
38  void sortConstraints();
39  void copy(void*, void*);
40  void destroy();
41  void buildBMatrix();
42  #ifdef DEBUG
43  void showDataRead(void*,void*);
44  void checkConvergence();
45  #endif
46  public:
48  void solve();
49 
52  LincsSolver(int loop=10000, BigReal r=1e-12) : B(NULL), constraintList(NULL), globalIndex(NULL),
53  patchID(NULL), offset(NULL), inv_mass(NULL), ref(NULL), num_atoms(0), num_constraints(0), maxLoops(loop), tol(r) {}
55  {
56  destroy();
57  }
58 };
59 #endif
void solve()
interface to run the solver with CG.
Definition: LincsSolver.C:432
void setUpSolver(atomData *, constraintTuple *)
interface to set up the solver with two given arrays of data.
Definition: LincsSolver.C:419
LincsSolver(int loop=10000, BigReal r=1e-12)
Definition: LincsSolver.h:52
double BigReal
Definition: common.h:123