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 getMoleculePointers(Molecule*, int*, int32***, Angle**);
00027 static void getParameterPointers(Parameters*, const AngleValue**);
00028 static void getTupleInfo(AtomSignature* sig, int *count, TupleSignature** t) {
00029 *count = sig->angleCnt;
00030 *t = sig->angleSigs;
00031 }
00032
00033
00034 static int pressureProfileSlabs;
00035 static int pressureProfileAtomTypes;
00036 static BigReal pressureProfileThickness;
00037 static BigReal pressureProfileMin;
00038
00039
00040 const AngleValue *value;
00041
00042 int hash() const {
00043 return 0x7FFFFFFF & ((atomID[0]<<22) + (atomID[1]<<11) + (atomID[2]));
00044 }
00045
00046 enum { angleEnergyIndex, TENSOR(virialIndex), reductionDataSize };
00047 enum { reductionChecksumLabel = REDUCTION_ANGLE_CHECKSUM };
00048 static void submitReductionData(BigReal*,SubmitReduction*);
00049
00050 inline AngleElem();
00051 inline AngleElem(AtomID atom0, const TupleSignature *sig, const AngleValue *v);
00052 inline AngleElem(const Angle *a, const AngleValue *v);
00053 inline AngleElem(AtomID atom0, AtomID atom1, AtomID atom2);
00054 ~AngleElem() { };
00055
00056 inline int operator==(const AngleElem &a) const;
00057 inline int operator<(const AngleElem &a) const;
00058 };
00059
00060 class ComputeAngles : public ComputeHomeTuples<AngleElem,Angle,AngleValue>
00061 {
00062 public:
00063
00064 ComputeAngles(ComputeID c, PatchIDList &p) : ComputeHomeTuples<AngleElem,Angle,AngleValue>(c,p) { ; }
00065
00066 };
00067
00068 class ComputeSelfAngles : public ComputeSelfTuples<AngleElem,Angle,AngleValue>
00069 {
00070 public:
00071
00072 ComputeSelfAngles(ComputeID c, PatchID p) : ComputeSelfTuples<AngleElem,Angle,AngleValue>(c,p) { ; }
00073
00074 };
00075
00076 #include "ComputeAngles.inl"
00077
00078 #endif
00079