ComputeQM.h

Go to the documentation of this file.
00001 
00007 #ifndef COMPUTEQM_H
00008 #define COMPUTEQM_H
00009 
00010 #include "ComputeHomePatches.h"
00011 #include "NamdTypes.h"
00012 
00013 class SubmitReduction;
00014 class QMForceMsg;
00015 class QMCoordMsg;
00016 class ComputeQMAtom;
00017 class QMGrpCalcMsg;
00018 
00019 struct patchDataStrc {
00020     Box<Patch, CompAtom >* posBoxP;
00021     CompAtom* compAtomP;
00022     HomePatch* homePatchP;
00023     patchDataStrc(Box<Patch, CompAtom >* pbP, CompAtom* caP, HomePatch* hpP) {
00024         posBoxP = pbP;
00025         compAtomP = caP;
00026         homePatchP = hpP;
00027     }
00028 };
00029 
00030 struct LSSSubsDat {
00031     
00032     int origID, newID;
00033     int newVdWType;
00034     Real newCharge;
00035     
00036     LSSSubsDat() {}
00037     LSSSubsDat(const LSSSubsDat &ref) {
00038         origID = ref.origID;
00039         newID = ref.newID;
00040         newVdWType = ref.newVdWType;
00041         newCharge = ref.newCharge;
00042     }
00043     LSSSubsDat(int newOrigID) {
00044         origID = newOrigID;
00045     }
00046     LSSSubsDat(int newOrigID, int ID, int vdw, Real charge) {
00047         origID = newOrigID;
00048         newID = ID;
00049         newVdWType = vdw;
00050         newCharge = charge;
00051     }
00052     
00053     LSSSubsDat& operator=(const LSSSubsDat& ref) {
00054         origID = ref.origID;
00055         newID = ref.newID;
00056         newVdWType = ref.newVdWType;
00057         newCharge = ref.newCharge;
00058         return *this ;
00059     }
00060     
00061     bool operator<(const LSSSubsDat& ref) {
00062         return (origID < ref.origID);
00063     }
00064     bool operator==(const LSSSubsDat& ref) {
00065         return (origID == ref.origID) ;
00066     }
00067 } ;
00068 
00069 struct meMMQMGrp {
00070     
00071     int mmIndx;
00072     Real qmGrp;
00073     
00074     meMMQMGrp() {}
00075     meMMQMGrp(const meMMQMGrp &ref) {
00076         mmIndx = ref.mmIndx;
00077         qmGrp = ref.qmGrp;
00078     }
00079     meMMQMGrp(int newmmIndx) {
00080         mmIndx = newmmIndx;
00081     }
00082     meMMQMGrp(int newmmIndx, Real newQMGrp) {
00083         mmIndx = newmmIndx;
00084         qmGrp = newQMGrp;
00085     }
00086     
00087     meMMQMGrp& operator=(const meMMQMGrp& ref) {
00088         mmIndx = ref.mmIndx;
00089         qmGrp = ref.qmGrp;
00090         return *this ;
00091     }
00092     
00093     bool operator<(const meMMQMGrp& ref) {
00094         return (mmIndx < ref.mmIndx);
00095     }
00096     bool operator==(const meMMQMGrp& ref) {
00097         return (mmIndx == ref.mmIndx) ;
00098     }
00099 } ;
00100 
00101 struct QMForce {
00102   int replace;
00103   Force force;
00104   int homeIndx;
00105   float charge;
00106   int id;
00107   QMForce() : replace(0), force(0), homeIndx(-1), charge(0), id(-1) {;}
00108 };
00109 
00110 typedef AtomID Origin;
00111 typedef AtomID Target;
00112 typedef std::pair<Origin,Target> cSMDPair;
00113 
00114 class ComputeQM : public ComputeHomePatches {
00115 public:
00116   ComputeQM(ComputeID c);
00117   virtual ~ComputeQM();
00118   
00119   void initialize();
00120   
00121   void doWork();
00122   
00123   void saveResults(QMForceMsg *);
00124   void processFullQM(QMCoordMsg *) ;
00125   
00126  private:
00127   SubmitReduction *reduction;
00128   
00129   SimParameters* simParams;
00130   Molecule *molPtr;
00131   
00132   int numQMAtms;
00133   int numQMGrps;
00134   const Real *qmAtomGroup ;
00135   const Real *qmGrpIDArray;
00136   const Real *qmAtmChrg ;
00137   const int *qmAtmIndx ;
00138   
00139   Bool noPC;
00140   int meNumMMIndx ;
00141   int *meMMindx;
00142   Real *meQMGrp;
00143   SortedArray< meMMQMGrp > meQMBonds;
00144   
00145   Bool customPC;
00146   ResizeArray< SortedArray<int> > customPCLists ;
00147   
00148   BigReal cutoff;
00149   
00150   ExtForce *oldForces;
00151   
00152   std::vector<patchDataStrc> patchData;
00153   
00154   // This is only used in case we have a stride in point charge selection.
00155   SortedArray<int> pcIDSortList ;
00156   
00157 };
00158 
00159 
00160 
00161 SortedArray<LSSSubsDat> &lssSubs(ComputeQMMgr *mgr) ;
00162 
00163 #endif
00164 

Generated on Mon Nov 20 01:17:12 2017 for NAMD by  doxygen 1.4.7