NAMD
ComputeQM.h
Go to the documentation of this file.
1 
7 #ifndef COMPUTEQM_H
8 #define COMPUTEQM_H
9 
10 #include "ComputeHomePatches.h"
11 #include "NamdTypes.h"
12 
13 class SubmitReduction;
14 class QMForceMsg;
15 class QMCoordMsg;
16 class ComputeQMAtom;
17 class QMGrpCalcMsg;
18 
19 struct patchDataStrc {
24  posBoxP = pbP;
25  compAtomP = caP;
26  homePatchP = hpP;
27  }
28 };
29 
30 struct LSSSubsDat {
31 
32  int origID, newID;
35 
37  LSSSubsDat(const LSSSubsDat &ref) {
38  origID = ref.origID;
39  newID = ref.newID;
40  newVdWType = ref.newVdWType;
41  newCharge = ref.newCharge;
42  }
43  LSSSubsDat(int newOrigID) {
44  origID = newOrigID;
45  }
46  LSSSubsDat(int newOrigID, int ID, int vdw, Real charge) {
47  origID = newOrigID;
48  newID = ID;
49  newVdWType = vdw;
50  newCharge = charge;
51  }
52 
54  origID = ref.origID;
55  newID = ref.newID;
56  newVdWType = ref.newVdWType;
57  newCharge = ref.newCharge;
58  return *this ;
59  }
60 
61  bool operator<(const LSSSubsDat& ref) {
62  return (origID < ref.origID);
63  }
64  bool operator==(const LSSSubsDat& ref) {
65  return (origID == ref.origID) ;
66  }
67 } ;
68 
69 struct meMMQMGrp {
70 
71  int mmIndx;
73 
74  meMMQMGrp() {}
75  meMMQMGrp(const meMMQMGrp &ref) {
76  mmIndx = ref.mmIndx;
77  qmGrp = ref.qmGrp;
78  }
79  meMMQMGrp(int newmmIndx) {
80  mmIndx = newmmIndx;
81  }
82  meMMQMGrp(int newmmIndx, Real newQMGrp) {
83  mmIndx = newmmIndx;
84  qmGrp = newQMGrp;
85  }
86 
87  meMMQMGrp& operator=(const meMMQMGrp& ref) {
88  mmIndx = ref.mmIndx;
89  qmGrp = ref.qmGrp;
90  return *this ;
91  }
92 
93  bool operator<(const meMMQMGrp& ref) {
94  return (mmIndx < ref.mmIndx);
95  }
96  bool operator==(const meMMQMGrp& ref) {
97  return (mmIndx == ref.mmIndx) ;
98  }
99 } ;
100 
101 struct QMForce {
102  int replace;
104  int homeIndx;
105  float charge;
106  int id;
107  QMForce() : replace(0), force(0), homeIndx(-1), charge(0), id(-1) {;}
108 };
109 
110 typedef AtomID Origin;
111 typedef AtomID Target;
112 typedef std::pair<Origin,Target> cSMDPair;
113 
115 public:
116  ComputeQM(ComputeID c);
117  virtual ~ComputeQM();
118 
119  void initialize();
120 
121  void doWork();
122 
123  void saveResults(QMForceMsg *);
124  void processFullQM(QMCoordMsg *) ;
125 
126  private:
127  SubmitReduction *reduction;
128 
129  SimParameters* simParams;
130  Molecule *molPtr;
131 
132  int numQMAtms;
133  int numQMGrps;
134  const Real *qmAtomGroup ;
135  const Real *qmGrpIDArray;
136  const Real *qmAtmChrg ;
137  const int *qmAtmIndx ;
138 
139  Bool noPC;
140  int meNumMMIndx ;
141  int *meMMindx;
142  Real *meQMGrp;
143  SortedArray< meMMQMGrp > meQMBonds;
144 
145  Bool customPC;
146  ResizeArray< SortedArray<int> > customPCLists ;
147 
148  BigReal cutoff;
149 
150  ExtForce *oldForces;
151 
152  std::vector<patchDataStrc> patchData;
153 
154  // This is only used in case we have a stride in point charge selection.
155  SortedArray<int> pcIDSortList ;
156 
157 };
158 
159 
160 
162 
163 #endif
164 
meMMQMGrp(const meMMQMGrp &ref)
Definition: ComputeQM.h:75
int replace
Definition: ComputeQM.h:102
HomePatch * homePatchP
Definition: ComputeQM.h:22
SortedArray< LSSSubsDat > & lssSubs(ComputeQMMgr *mgr)
Definition: ComputeQM.C:595
int ComputeID
Definition: NamdTypes.h:183
int AtomID
Definition: NamdTypes.h:29
Box< Patch, CompAtom > * posBoxP
Definition: ComputeQM.h:20
virtual ~ComputeQM()
Definition: ComputeQM.C:609
Definition: Vector.h:64
float Real
Definition: common.h:109
meMMQMGrp & operator=(const meMMQMGrp &ref)
Definition: ComputeQM.h:87
int origID
Definition: ComputeQM.h:32
void doWork()
Definition: ComputeQM.C:675
meMMQMGrp()
Definition: ComputeQM.h:74
LSSSubsDat & operator=(const LSSSubsDat &ref)
Definition: ComputeQM.h:53
int newVdWType
Definition: ComputeQM.h:33
patchDataStrc(Box< Patch, CompAtom > *pbP, CompAtom *caP, HomePatch *hpP)
Definition: ComputeQM.h:23
int id
Definition: ComputeQM.h:106
LSSSubsDat(const LSSSubsDat &ref)
Definition: ComputeQM.h:37
int mmIndx
Definition: ComputeQM.h:71
AtomID Origin
Definition: ComputeQM.h:110
int Bool
Definition: common.h:133
float charge
Definition: ComputeQM.h:105
Force force
Definition: ComputeQM.h:103
Real qmGrp
Definition: ComputeQM.h:72
void processFullQM(QMCoordMsg *)
Definition: ComputeQM.C:1292
ComputeQM(ComputeID c)
Definition: ComputeQM.C:599
bool operator==(const meMMQMGrp &ref)
Definition: ComputeQM.h:96
void saveResults(QMForceMsg *)
Definition: ComputeQM.C:2673
bool operator==(const LSSSubsDat &ref)
Definition: ComputeQM.h:64
Real newCharge
Definition: ComputeQM.h:34
LSSSubsDat()
Definition: ComputeQM.h:36
meMMQMGrp(int newmmIndx)
Definition: ComputeQM.h:79
AtomID Target
Definition: ComputeQM.h:111
QMForce()
Definition: ComputeQM.h:107
void initialize()
Definition: ComputeQM.C:615
LSSSubsDat(int newOrigID, int ID, int vdw, Real charge)
Definition: ComputeQM.h:46
std::pair< Origin, Target > cSMDPair
Definition: ComputeQM.h:112
k< npairi;++k){TABENERGY(const int numtypes=simParams->tableNumTypes;const float table_spacing=simParams->tableSpacing;const int npertype=(int)(namdnearbyint(simParams->tableMaxDist/simParams->tableSpacing)+1);) int table_i=(r2iilist[2 *k] >> 14)+r2_delta_expc;const int j=pairlisti[k];#define p_j BigReal diffa=r2list[k]-r2_table[table_i];#define table_four_i TABENERGY(register const int tabtype=-1-(lj_pars->A< 0?lj_pars->A:0);) BigReal kqq=kq_i *p_j-> charge
int homeIndx
Definition: ComputeQM.h:104
CompAtom * compAtomP
Definition: ComputeQM.h:21
bool operator<(const LSSSubsDat &ref)
Definition: ComputeQM.h:61
int newID
Definition: ComputeQM.h:32
bool operator<(const meMMQMGrp &ref)
Definition: ComputeQM.h:93
meMMQMGrp(int newmmIndx, Real newQMGrp)
Definition: ComputeQM.h:82
LSSSubsDat(int newOrigID)
Definition: ComputeQM.h:43
double BigReal
Definition: common.h:114