ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/Molecule.hpp
Revision: 1167
Committed: Wed May 12 16:38:45 2004 UTC (20 years, 1 month ago) by tim
File size: 3556 byte(s)
Log Message:
get rid of rc and massratio from simState, creat cutoff group forevery atom
which does not belong to
cutoff group defined at mdl file

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