ComputeDihedrals.h

Go to the documentation of this file.
00001 
00007 #ifndef COMPUTEDIHEDRALS_H
00008 #define COMPUTEDIHEDRALS_H
00009 
00010 #include "ComputeHomeTuples.h"
00011 #include "ComputeSelfTuples.h"
00012 #include "ReductionMgr.h"
00013 
00014 class Molecule;
00015 class DihedralValue;
00016 
00017 class DihedralElem {
00018 public:
00019     // ComputeHomeTuples interface
00020     enum { size = 4 };
00021     AtomID atomID[size];
00022     int    localIndex[size];
00023     TuplePatchElem *p[size];
00024     Real scale;
00025     static void computeForce(DihedralElem*, int, BigReal*, BigReal *);
00026 
00027     static void getMoleculePointers(Molecule*, int*, int32***, Dihedral**);
00028     static void getParameterPointers(Parameters*, const DihedralValue**);
00029     static void getTupleInfo(AtomSignature* sig, int *count, TupleSignature** t) {
00030         *count = sig->dihedralCnt;
00031         *t = sig->dihedralSigs;
00032     }
00033 
00034     // pressure profile parameters
00035     static int pressureProfileSlabs;
00036     static int pressureProfileAtomTypes;
00037     static BigReal pressureProfileThickness;
00038     static BigReal pressureProfileMin;
00039 
00040     // Internal data
00041     const DihedralValue *value;
00042 
00043   int hash() const { 
00044     return 0x7FFFFFFF &((atomID[0]<<24) + (atomID[1]<<16) + (atomID[2]<<8) + atomID[3]);
00045   }
00046 
00047   enum { dihedralEnergyIndex, dihedralEnergyIndex_f, dihedralEnergyIndex_ti_1, 
00048          dihedralEnergyIndex_ti_2,TENSOR(virialIndex), reductionDataSize };
00049   enum { reductionChecksumLabel = REDUCTION_DIHEDRAL_CHECKSUM };
00050   static void submitReductionData(BigReal*,SubmitReduction*);
00051 
00052   inline DihedralElem();
00053   inline DihedralElem(AtomID atom0, const TupleSignature *sig, const DihedralValue *v);
00054   inline DihedralElem(const Dihedral *a, const DihedralValue *v);
00055   inline DihedralElem(AtomID atom0, AtomID atom1, AtomID atom2, AtomID atom3);
00056   ~DihedralElem() {};
00057 
00058   inline int operator==(const DihedralElem &a) const;
00059   inline int operator<(const DihedralElem &a) const;
00060 };
00061 
00062 class ComputeDihedrals : public ComputeHomeTuples<DihedralElem,Dihedral,DihedralValue>
00063 {
00064 public:
00065 
00066   ComputeDihedrals(ComputeID c, PatchIDList &p) : ComputeHomeTuples<DihedralElem,Dihedral,DihedralValue>(c,p) { ; }
00067 
00068 };
00069 
00070 class ComputeSelfDihedrals : public ComputeSelfTuples<DihedralElem,Dihedral,DihedralValue>
00071 {
00072 public:
00073 
00074   ComputeSelfDihedrals(ComputeID c, PatchID p) : ComputeSelfTuples<DihedralElem,Dihedral,DihedralValue>(c,p) { ; }
00075 
00076 };
00077 
00078 #include "ComputeDihedrals.inl"
00079 
00080 #endif
00081 

Generated on Tue Sep 26 01:17:11 2017 for NAMD by  doxygen 1.4.7