ComputeBonds.h

Go to the documentation of this file.
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     // ComputeHomeTuples interface
00023     enum { size = 2 };
00024     AtomID atomID[size];
00025     int    localIndex[size];
00026     TuplePatchElem *p[size];
00027     Real scale;
00028     static void computeForce(BondElem*, int, BigReal*, BigReal *);
00029 
00030     static void getMoleculePointers(Molecule*, int*, int32***, Bond**);
00031     static void getParameterPointers(Parameters*, const BondValue**);
00032     static void getTupleInfo(AtomSignature* sig, int *count, TupleSignature** t) {
00033         *count = sig->bondCnt;
00034         *t = sig->bondSigs;
00035     }
00036 
00037     // pressure profile parameters
00038     static int pressureProfileSlabs;
00039     static int pressureProfileAtomTypes;
00040     static BigReal pressureProfileThickness;
00041     static BigReal pressureProfileMin;
00042 
00043     int hash() const { return 0x7FFFFFFF & ( (atomID[0]<<16) + (atomID[1])); }
00044 
00045     // Internal data
00046     const BondValue *value;
00047 
00048   enum { bondEnergyIndex, bondEnergyIndex_f, bondEnergyIndex_ti_1, 
00049          bondEnergyIndex_ti_2, 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 

Generated on Sat Nov 18 01:17:12 2017 for NAMD by  doxygen 1.4.7