ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/Molecule.hpp
Revision: 1157
Committed: Tue May 11 20:33:41 2004 UTC (20 years, 2 months ago) by tim
File size: 3772 byte(s)
Log Message:
adding cutoffGroup into OOPSE

File Contents

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