Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

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     void computeForce(BigReal*, BigReal *);
00026     // The following is evil, but the compiler chokes otherwise. (JCP)
00027     static void loadTuplesForAtom(void*, AtomID, Molecule*);
00028     static void getMoleculePointers(Molecule*, int*, int32***, Dihedral**);
00029     static void getParameterPointers(Parameters*, const DihedralValue**);
00030     static void getTupleInfo(AtomSignature* sig, int *count, TupleSignature** t) {
00031         *count = sig->dihedralCnt;
00032         *t = sig->dihedralSigs;
00033     }
00034 
00035     // pressure profile parameters
00036     static int pressureProfileSlabs;
00037     static int pressureProfileAtomTypes;
00038     static BigReal pressureProfileThickness;
00039     static BigReal pressureProfileMin;
00040 
00041     // Internal data
00042     const DihedralValue *value;
00043 
00044   int hash() const { 
00045     return 0x7FFFFFFF &((atomID[0]<<24) + (atomID[1]<<16) + (atomID[2]<<8) + atomID[3]);
00046   }
00047 
00048   enum { dihedralEnergyIndex, 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 Thu Aug 28 04:07:40 2008 for NAMD by  doxygen 1.3.9.1