RigidCLL.h
Go to the documentation of this file.00001 #ifndef RigidCLLH
00002 #define RigidCLLH
00003
00004 #include <vector>
00005 #include <list>
00006 #include <string>
00007
00019 using namespace std;
00020
00028 #ifndef RIGIDCLL_DEBUG
00029 #define RIGIDCLL_DEBUG 1
00030 #endif
00031
00037 typedef double RigidTransform[4][4];
00038
00044 class AtomInfo {
00045 public:
00046 unsigned int id;
00047 unsigned int rID;
00048 double op[3];
00049 double cp[3];
00050 double r;
00051 unsigned int c[3];
00066 AtomInfo(unsigned int identifier,unsigned int rigid,double x,double y,double z,double radius);
00067
00075 inline void move(RigidTransform t);
00076
00086 double distance(AtomInfo *a);
00087 };
00088
00094 ostream& operator<<(ostream& os,const AtomInfo &a);
00095
00101 class AtomPair {
00102 public:
00103 unsigned int a1;
00104 unsigned int r1;
00105 unsigned int a2;
00106 unsigned int r2;
00107 double d2;
00118 AtomPair(AtomInfo *atom1,AtomInfo *atom2,double dst2);
00119
00129 bool operator<(const AtomPair a) const;
00130
00142 bool operator==(AtomPair &a);
00143 };
00144
00150 ostream& operator<<(ostream& os,const AtomPair &a);
00151
00157 typedef struct {
00158 unsigned int firstAtom;
00159 unsigned int lastAtom;
00160 } RigidInfo;
00161
00167 class CellInfo {
00168 public:
00169 unsigned int mobileID;
00170 unsigned int fixedID;
00177 inline CellInfo();
00185 inline void Reset();
00186
00195 void AddFixedAtom(unsigned int id,unsigned int *fixedLL);
00196
00205 inline void AddMobileAtom(unsigned int id,unsigned int *mobileLL);
00206
00207 };
00208
00214 class RigidCLL {
00215
00216 private:
00217
00218 vector<AtomInfo> fixedAtoms;
00219 vector<AtomInfo> mobileAtoms;
00220 vector<RigidInfo> rigids;
00221 unsigned int* fixedLL;
00222 unsigned int* mobileLL;
00223 CellInfo ***grid;
00224 double o[3];
00225 unsigned int s[3];
00226 double cutoff;
00227 double d;
00228 double d2;
00229 unsigned int rID;
00230 RigidInfo cr;
00231 unsigned int nFixed;
00232 unsigned int nMobile;
00233 unsigned int lastInGrid;
00234 bool **checkInteraction;
00242 void InitRigidCLL();
00243
00254 inline void UpdateCell(AtomInfo *a);
00255
00264 void InsertFixedInGrid(unsigned int n);
00265
00274 inline void InsertMobileInGrid(unsigned int n);
00275
00276
00285 void DeleteGrid();
00286
00292 void DeleteInteractions();
00293
00305 void InitInteractions();
00306
00312 inline void ResetQuery();
00313
00324 inline void Move(RigidTransform *t);
00325
00343 inline bool Check27(AtomInfo *a1);
00344
00345 public:
00346
00352 RigidCLL();
00353
00362 RigidCLL(char *name);
00363
00369 ~RigidCLL();
00370
00382 unsigned int GetNumRigids();
00383
00384
00397 void SetCutOff(double c);
00398
00409 double GetCutOff();
00410
00418 double GetBBSize(unsigned int axis);
00419
00431 void AddFixedAtom(unsigned int id,double x,double y,double z,double r);
00432
00442 void AddFixedAtom(unsigned int id,double *p,double r);
00443
00452 unsigned int NewRigid();
00453
00465 void AddAtom(unsigned int id,double x,double y,double z,double r);
00466
00476 void AddAtom(unsigned int id,double *p,double r);
00477
00483 void EndRigid();
00484
00503 void ActivateInteraction(unsigned int r1,unsigned int r2);
00504
00521 void DeactivateInteraction(unsigned int r1,unsigned int r2);
00522
00536 void WarmUp(RigidTransform *t);
00537
00549 void Reset();
00550
00564 bool StericClash(RigidTransform *t);
00565
00584 bool CLLStericClash(RigidTransform *t);
00585
00598 bool BruteForceStericClash(RigidTransform *t);
00599
00600
00617 void Interactions(RigidTransform *t,list<AtomPair> *c);
00618
00638 void CLLInteractions(RigidTransform *t,list<AtomPair> *c);
00639
00656 void BruteForceInteractions(RigidTransform *t,list<AtomPair> *c);
00657 };
00658
00659 #endif
Follow us!