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
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
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
00035 static int pressureProfileSlabs;
00036 static int pressureProfileAtomTypes;
00037 static BigReal pressureProfileThickness;
00038 static BigReal pressureProfileMin;
00039
00040
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, TENSOR(virialIndex), reductionDataSize };
00048 enum { reductionChecksumLabel = REDUCTION_DIHEDRAL_CHECKSUM };
00049 static void submitReductionData(BigReal*,SubmitReduction*);
00050
00051 inline DihedralElem();
00052 inline DihedralElem(AtomID atom0, const TupleSignature *sig, const DihedralValue *v);
00053 inline DihedralElem(const Dihedral *a, const DihedralValue *v);
00054 inline DihedralElem(AtomID atom0, AtomID atom1, AtomID atom2, AtomID atom3);
00055 ~DihedralElem() {};
00056
00057 inline int operator==(const DihedralElem &a) const;
00058 inline int operator<(const DihedralElem &a) const;
00059 };
00060
00061 class ComputeDihedrals : public ComputeHomeTuples<DihedralElem,Dihedral,DihedralValue>
00062 {
00063 public:
00064
00065 ComputeDihedrals(ComputeID c, PatchIDList &p) : ComputeHomeTuples<DihedralElem,Dihedral,DihedralValue>(c,p) { ; }
00066
00067 };
00068
00069 class ComputeSelfDihedrals : public ComputeSelfTuples<DihedralElem,Dihedral,DihedralValue>
00070 {
00071 public:
00072
00073 ComputeSelfDihedrals(ComputeID c, PatchID p) : ComputeSelfTuples<DihedralElem,Dihedral,DihedralValue>(c,p) { ; }
00074
00075 };
00076
00077 #include "ComputeDihedrals.inl"
00078
00079 #endif
00080