Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

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     void computeForce(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, TENSOR(virialIndex), reductionDataSize };
00049   enum { reductionChecksumLabel = REDUCTION_BOND_CHECKSUM };
00050   static void submitReductionData(BigReal*,SubmitReduction*);
00051 
00052   inline BondElem();
00053   inline BondElem(AtomID atom0, const TupleSignature *sig, const BondValue *v);
00054   inline BondElem(const Bond *a, const BondValue *v);
00055   inline BondElem(AtomID atom0, AtomID atom1);
00056   ~BondElem() {};
00057 
00058   inline int operator==(const BondElem &a) const;
00059   inline int operator<(const BondElem &a) const;
00060 };
00061 
00062 class ComputeBonds : public ComputeHomeTuples<BondElem,Bond,BondValue>
00063 {
00064 public:
00065 
00066   ComputeBonds(ComputeID c, PatchIDList p) : ComputeHomeTuples<BondElem,Bond,BondValue>(c,p) { ; }
00067 
00068 };
00069 
00070 class ComputeSelfBonds : public ComputeSelfTuples<BondElem,Bond,BondValue>
00071 {
00072 public:
00073 
00074   ComputeSelfBonds(ComputeID c, PatchID p) : ComputeSelfTuples<BondElem,Bond,BondValue>(c,p) { ; }
00075 
00076 };
00077 
00078 #include "ComputeBonds.inl"
00079 
00080 #endif
00081 

Generated on Sun Feb 12 04:07:53 2012 for NAMD by  doxygen 1.3.9.1