| 1 |
mmeineke |
377 |
#ifndef _MOLECULE_H_ |
| 2 |
|
|
#define _MOLECULE_H_ |
| 3 |
|
|
|
| 4 |
tim |
1157 |
#include <set> |
| 5 |
|
|
#include <vector> |
| 6 |
|
|
|
| 7 |
mmeineke |
377 |
#include "Atom.hpp" |
| 8 |
|
|
#include "SRI.hpp" |
| 9 |
mmeineke |
407 |
#include "MoleculeStamp.hpp" |
| 10 |
gezelter |
1097 |
#include "RigidBody.hpp" |
| 11 |
tim |
1157 |
#include "CutoffGroup.hpp" |
| 12 |
tim |
1234 |
#include "ConstraintPair.hpp" |
| 13 |
mmeineke |
377 |
|
| 14 |
tim |
1157 |
using namespace std; |
| 15 |
|
|
|
| 16 |
mmeineke |
407 |
typedef struct{ |
| 17 |
|
|
|
| 18 |
|
|
int stampID; // the ID in the BASS component stamp array |
| 19 |
|
|
int nAtoms; // the number of atoms in the molecule |
| 20 |
|
|
int nBonds; // ... .. .. . .bonds .. .. . . . . |
| 21 |
|
|
int nBends; // . . . . .. . .bends . . . . .. . |
| 22 |
gezelter |
416 |
int nTorsions; // .. . . .. . . torsions . . .. . . |
| 23 |
gezelter |
1097 |
int nRigidBodies; // .. .. .. . rigid bodies ... .. |
| 24 |
gezelter |
416 |
int nOriented; // .. . . . .. . oriented atoms . . . |
| 25 |
tim |
1157 |
|
| 26 |
mmeineke |
412 |
Atom** myAtoms; // the array of atoms |
| 27 |
mmeineke |
407 |
Bond** myBonds; // arrays of all the short range interactions |
| 28 |
|
|
Bend** myBends; |
| 29 |
|
|
Torsion** myTorsions; |
| 30 |
gezelter |
1104 |
vector<RigidBody*> myRigidBodies; |
| 31 |
|
|
vector<StuntDouble*> myIntegrableObjects; |
| 32 |
tim |
1157 |
vector<CutoffGroup*> myCutoffGroups; |
| 33 |
tim |
1234 |
vector<ConstraintPair*> myConstraintPairs; |
| 34 |
mmeineke |
407 |
} molInit; |
| 35 |
|
|
|
| 36 |
mmeineke |
377 |
class Molecule{ |
| 37 |
|
|
|
| 38 |
|
|
public: |
| 39 |
|
|
|
| 40 |
mmeineke |
407 |
Molecule( void ); |
| 41 |
|
|
~Molecule( void ); |
| 42 |
mmeineke |
377 |
|
| 43 |
mmeineke |
407 |
void initialize( molInit &theInit ); |
| 44 |
chuckv |
438 |
|
| 45 |
|
|
void setMyIndex( int theIndex ){ myIndex = theIndex;} |
| 46 |
tim |
1108 |
int getMyIndex( void ) { return myIndex; } |
| 47 |
|
|
|
| 48 |
|
|
int getGlobalIndex( void ) { return globalIndex; } |
| 49 |
gezelter |
490 |
void setGlobalIndex( int theIndex ) { globalIndex = theIndex; } |
| 50 |
mmeineke |
489 |
|
| 51 |
gezelter |
1097 |
int getNAtoms ( void ) {return nAtoms;} |
| 52 |
|
|
int getNBonds ( void ) {return nBonds;} |
| 53 |
|
|
int getNBends ( void ) {return nBends;} |
| 54 |
|
|
int getNTorsions( void ) {return nTorsions;} |
| 55 |
gezelter |
1104 |
int getNRigidBodies( void ) {return myRigidBodies.size();} |
| 56 |
gezelter |
1097 |
int getNOriented( void ) {return nOriented;} |
| 57 |
|
|
int getNMembers ( void ) {return nMembers;} |
| 58 |
|
|
int getStampID ( void ) {return stampID;} |
| 59 |
mmeineke |
407 |
|
| 60 |
gezelter |
1097 |
Atom** getMyAtoms ( void ) {return myAtoms;} |
| 61 |
|
|
Bond** getMyBonds ( void ) {return myBonds;} |
| 62 |
|
|
Bend** getMyBends ( void ) {return myBends;} |
| 63 |
|
|
Torsion** getMyTorsions( void ) {return myTorsions;} |
| 64 |
gezelter |
1104 |
vector<RigidBody*> getMyRigidBodies( void ) {return myRigidBodies;} |
| 65 |
tim |
1108 |
vector<StuntDouble*>& getIntegrableObjects(void) {return myIntegrableObjects;} |
| 66 |
tim |
1157 |
|
| 67 |
tim |
1234 |
//beginCutoffGroup return the first group and initialize the iterator |
| 68 |
tim |
1157 |
CutoffGroup* beginCutoffGroup(vector<CutoffGroup*>::iterator& i){ |
| 69 |
|
|
i = myCutoffGroups.begin(); |
| 70 |
|
|
return i != myCutoffGroups.end()? *i : NULL; |
| 71 |
|
|
} |
| 72 |
|
|
|
| 73 |
tim |
1234 |
//nextCutoffGroup return next cutoff group based on the iterator |
| 74 |
tim |
1157 |
CutoffGroup* nextCutoffGroup(vector<CutoffGroup*>::iterator& i){ |
| 75 |
|
|
i++; |
| 76 |
|
|
return i != myCutoffGroups.end()? *i : NULL; |
| 77 |
|
|
} |
| 78 |
|
|
|
| 79 |
|
|
int getNCutoffGroups() {return nCutoffGroups;} |
| 80 |
tim |
1234 |
|
| 81 |
|
|
int getNConstrains() {return myConstraintPairs.size();} |
| 82 |
|
|
vector<ConstraintPair*>& getConstraintPairs() {return myConstraintPairs;} |
| 83 |
mmeineke |
377 |
|
| 84 |
tim |
1234 |
|
| 85 |
gezelter |
1097 |
void setStampID( int info ) {stampID = info;} |
| 86 |
mmeineke |
423 |
|
| 87 |
|
|
void calcForces( void ); |
| 88 |
gezelter |
1097 |
void atoms2rigidBodies( void ); |
| 89 |
mmeineke |
423 |
double getPotential( void ); |
| 90 |
mmeineke |
377 |
|
| 91 |
mmeineke |
435 |
void printMe( void ); |
| 92 |
mmeineke |
377 |
|
| 93 |
mmeineke |
449 |
void getCOM( double COM[3] ); |
| 94 |
mmeineke |
452 |
void moveCOM( double delta[3] ); |
| 95 |
gezelter |
475 |
double getCOMvel( double COMvel[3] ); |
| 96 |
tim |
658 |
|
| 97 |
|
|
double getTotalMass(); |
| 98 |
gezelter |
446 |
|
| 99 |
mmeineke |
377 |
private: |
| 100 |
|
|
|
| 101 |
mmeineke |
407 |
int stampID; // the ID in the BASS component stamp array |
| 102 |
|
|
int nAtoms; // the number of atoms in the molecule |
| 103 |
|
|
int nBonds; // ... .. .. . .bonds .. .. . . . . |
| 104 |
|
|
int nBends; // . . . . .. . .bends . . . . .. . |
| 105 |
gezelter |
416 |
int nTorsions; // .. . . .. . . torsions . . .. . . |
| 106 |
gezelter |
1097 |
int nRigidBodies; // .. . . .. .rigid bodies . . .. . . |
| 107 |
gezelter |
416 |
int nOriented; // .. . . . .. . oriented atoms . . . |
| 108 |
mmeineke |
423 |
int nMembers; // .. . . . . . .atoms (legacy code) . . . |
| 109 |
tim |
1157 |
int nCutoffGroups; |
| 110 |
|
|
|
| 111 |
gezelter |
483 |
int myIndex; // mostly just for debug (and for making pressure calcs work) |
| 112 |
mmeineke |
489 |
int globalIndex; |
| 113 |
chuckv |
438 |
|
| 114 |
mmeineke |
407 |
Atom** myAtoms; // the array of atoms |
| 115 |
mmeineke |
423 |
Bond** myBonds; // arrays of all the short range interactions |
| 116 |
mmeineke |
407 |
Bend** myBends; |
| 117 |
|
|
Torsion** myTorsions; |
| 118 |
gezelter |
1104 |
vector<RigidBody*> myRigidBodies; |
| 119 |
|
|
vector<StuntDouble*> myIntegrableObjects; |
| 120 |
tim |
1157 |
vector<CutoffGroup*> myCutoffGroups; |
| 121 |
tim |
1234 |
vector<ConstraintPair*> myConstraintPairs; |
| 122 |
gezelter |
1104 |
|
| 123 |
mmeineke |
377 |
}; |
| 124 |
|
|
|
| 125 |
|
|
#endif |