NAMD
ComputeCrossterms.h
Go to the documentation of this file.
1 
7 #ifndef COMPUTECROSSTERMS_H
8 #define COMPUTECROSSTERMS_H
9 
10 #include "ComputeHomeTuples.h"
11 #include "ComputeSelfTuples.h"
12 #include "ReductionMgr.h"
13 
14 class Molecule;
15 class CrosstermValue;
16 
18 public:
19  // ComputeHomeTuples interface
20  enum { size = 8 };
25  static void computeForce(CrosstermElem*, int, BigReal*, BigReal *);
26 
27  static void getMoleculePointers(Molecule*, int*, int32***, Crossterm**);
28  static void getParameterPointers(Parameters*, const CrosstermValue**);
29  static void getTupleInfo(AtomSignature* sig, int *count, TupleSignature** t) {
30  *count = sig->crosstermCnt;
31  *t = sig->crosstermSigs;
32  }
33 
34  // pressure profile parameters
39 
40  // Internal data
42 
43  int hash() const {
44  return 0x7FFFFFFF &((atomID[0]<<24) + (atomID[1]<<16) + (atomID[2]<<8) + atomID[3]);
45  }
48  TENSOR(virialIndex), reductionDataSize };
51 
52  CrosstermElem() { ; }
53 
54  CrosstermElem(AtomID atom0, const TupleSignature *sig, const CrosstermValue *v){
55  atomID[0] = atom0;
56  atomID[1] = atom0 + sig->offset[0];
57  atomID[2] = atom0 + sig->offset[1];
58  atomID[3] = atom0 + sig->offset[2];
59  atomID[4] = atom0 + sig->offset[3];
60  atomID[5] = atom0 + sig->offset[4];
61  atomID[6] = atom0 + sig->offset[5];
62  atomID[7] = atom0 + sig->offset[6];
63  value = &v[sig->tupleParamType];
64 
65  }
66 
67  CrosstermElem(const Crossterm *a, const CrosstermValue *v) {
68  atomID[0] = a->atom1;
69  atomID[1] = a->atom2;
70  atomID[2] = a->atom3;
71  atomID[3] = a->atom4;
72  atomID[4] = a->atom5;
73  atomID[5] = a->atom6;
74  atomID[6] = a->atom7;
75  atomID[7] = a->atom8;
76  value = &v[a->crossterm_type];
77  }
78 
79  CrosstermElem(AtomID atom0, AtomID atom1, AtomID atom2, AtomID atom3,
80  AtomID atom4, AtomID atom5, AtomID atom6, AtomID atom7) {
81  atomID[0] = atom0;
82  atomID[1] = atom1;
83  atomID[2] = atom2;
84  atomID[3] = atom3;
85  atomID[4] = atom4;
86  atomID[5] = atom5;
87  atomID[6] = atom6;
88  atomID[7] = atom7;
89  }
91 
92  int operator==(const CrosstermElem &a) const {
93  return (a.atomID[0] == atomID[0] && a.atomID[1] == atomID[1] &&
94  a.atomID[2] == atomID[2] && a.atomID[3] == atomID[3] &&
95  a.atomID[4] == atomID[4] && a.atomID[5] == atomID[5] &&
96  a.atomID[6] == atomID[6] && a.atomID[7] == atomID[7]);
97  }
98 
99  int operator<(const CrosstermElem &a) const {
100  return (atomID[0] < a.atomID[0] ||
101  (atomID[0] == a.atomID[0] &&
102  (atomID[1] < a.atomID[1] ||
103  (atomID[1] == a.atomID[1] &&
104  (atomID[2] < a.atomID[2] ||
105  (atomID[2] == a.atomID[2] &&
106  (atomID[3] < a.atomID[3] ||
107  (atomID[3] == a.atomID[3] &&
108  (atomID[4] < a.atomID[4] ||
109  (atomID[4] == a.atomID[4] &&
110  (atomID[5] < a.atomID[5] ||
111  (atomID[5] == a.atomID[5] &&
112  (atomID[6] < a.atomID[6] ||
113  (atomID[6] == a.atomID[6] &&
114  atomID[7] < a.atomID[7]
115  ))))))))))))));
116  }
117 };
118 
119 class ComputeCrossterms : public ComputeHomeTuples<CrosstermElem,Crossterm,CrosstermValue>
120 {
121 public:
122 
124 
125 };
126 
127 class ComputeSelfCrossterms : public ComputeSelfTuples<CrosstermElem,Crossterm,CrosstermValue>
128 {
129 public:
130 
132 
133 };
134 
135 #endif
136 
Index crossterm_type
Definition: structures.h:89
const CrosstermValue * value
CrosstermElem(AtomID atom0, AtomID atom1, AtomID atom2, AtomID atom3, AtomID atom4, AtomID atom5, AtomID atom6, AtomID atom7)
short int32
Definition: dumpdcd.c:24
int ComputeID
Definition: NamdTypes.h:183
int AtomID
Definition: NamdTypes.h:29
AtomID atomID[size]
float Real
Definition: common.h:109
int32 atom5
Definition: structures.h:85
int32 atom8
Definition: structures.h:88
static int pressureProfileSlabs
TupleSignature * crosstermSigs
Definition: structures.h:337
int32 atom1
Definition: structures.h:81
static void submitReductionData(BigReal *, SubmitReduction *)
int operator<(const CrosstermElem &a) const
int32 atom4
Definition: structures.h:84
static int pressureProfileAtomTypes
int32 atom3
Definition: structures.h:83
static void getParameterPointers(Parameters *, const CrosstermValue **)
TuplePatchElem * p[size]
static BigReal pressureProfileMin
int32 atom2
Definition: structures.h:82
int32 atom7
Definition: structures.h:87
static void getTupleInfo(AtomSignature *sig, int *count, TupleSignature **t)
int localIndex[size]
int PatchID
Definition: NamdTypes.h:182
int hash() const
ComputeSelfCrossterms(ComputeID c, PatchID p)
static void getMoleculePointers(Molecule *, int *, int32 ***, Crossterm **)
CrosstermElem(AtomID atom0, const TupleSignature *sig, const CrosstermValue *v)
static void computeForce(CrosstermElem *, int, BigReal *, BigReal *)
Index tupleParamType
Definition: structures.h:202
int32 atom6
Definition: structures.h:86
ComputeCrossterms(ComputeID c, PatchIDList &p)
int operator==(const CrosstermElem &a) const
CrosstermElem(const Crossterm *a, const CrosstermValue *v)
double BigReal
Definition: common.h:114
static BigReal pressureProfileThickness