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