00001
00007 #ifndef COMPUTEANGLE_H
00008 #define COMPUTEANGLE_H
00009
00010 #include "ComputeHomeTuples.h"
00011 #include "ComputeSelfTuples.h"
00012 #include "ReductionMgr.h"
00013
00014 class Molecule;
00015
00016 class AngleElem {
00017 public:
00018
00019 enum { size = 3 };
00020 AtomID atomID[size];
00021 int localIndex[size];
00022 TuplePatchElem *p[size];
00023 Real scale;
00024 void computeForce(BigReal*, BigReal *);
00025
00026 static void loadTuplesForAtom(void*, AtomID, Molecule*);
00027 static void getMoleculePointers(Molecule*, int*, int32***, Angle**);
00028 static void getParameterPointers(Parameters*, const AngleValue**);
00029 static void getTupleInfo(AtomSignature* sig, int *count, TupleSignature** t) {
00030 *count = sig->angleCnt;
00031 *t = sig->angleSigs;
00032 }
00033
00034
00035 static int pressureProfileSlabs;
00036 static int pressureProfileAtomTypes;
00037 static BigReal pressureProfileThickness;
00038 static BigReal pressureProfileMin;
00039
00040
00041 const AngleValue *value;
00042
00043 int hash() const {
00044 return 0x7FFFFFFF & ((atomID[0]<<22) + (atomID[1]<<11) + (atomID[2]));
00045 }
00046
00047 enum { angleEnergyIndex, TENSOR(virialIndex), reductionDataSize };
00048 enum { reductionChecksumLabel = REDUCTION_ANGLE_CHECKSUM };
00049 static void submitReductionData(BigReal*,SubmitReduction*);
00050
00051 inline AngleElem();
00052 inline AngleElem(AtomID atom0, const TupleSignature *sig, const AngleValue *v);
00053 inline AngleElem(const Angle *a, const AngleValue *v);
00054 inline AngleElem(AtomID atom0, AtomID atom1, AtomID atom2);
00055 ~AngleElem() { };
00056
00057 inline int operator==(const AngleElem &a) const;
00058 inline int operator<(const AngleElem &a) const;
00059 };
00060
00061 class ComputeAngles : public ComputeHomeTuples<AngleElem,Angle,AngleValue>
00062 {
00063 public:
00064
00065 ComputeAngles(ComputeID c, PatchIDList p) : ComputeHomeTuples<AngleElem,Angle,AngleValue>(c,p) { ; }
00066
00067 };
00068
00069 class ComputeSelfAngles : public ComputeSelfTuples<AngleElem,Angle,AngleValue>
00070 {
00071 public:
00072
00073 ComputeSelfAngles(ComputeID c, PatchID p) : ComputeSelfTuples<AngleElem,Angle,AngleValue>(c,p) { ; }
00074
00075 };
00076
00077 #include "ComputeAngles.inl"
00078
00079 #endif
00080