ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/Molecule.hpp
(Generate patch)

Comparing trunk/OOPSE/libmdtools/Molecule.hpp (file contents):
Revision 490 by gezelter, Fri Apr 11 15:16:59 2003 UTC vs.
Revision 1167 by tim, Wed May 12 16:38:45 2004 UTC

# Line 1 | Line 1
1   #ifndef _MOLECULE_H_
2   #define _MOLECULE_H_
3  
4 + #include <set>
5 + #include <vector>
6 +
7   #include "Atom.hpp"
8   #include "SRI.hpp"
9   #include "MoleculeStamp.hpp"
10 < #include "Exclude.hpp"
10 > #include "RigidBody.hpp"
11 > #include "CutoffGroup.hpp"
12  
13 + using namespace std;
14 +
15   typedef struct{
16    
17    int stampID;   // the ID in the BASS component stamp array
# Line 13 | Line 19 | typedef struct{
19    int nBonds;    // ... .. ..  . .bonds .. .. . . . .
20    int nBends;    // . . . . .. . .bends . . . . .. .
21    int nTorsions; // .. . . .. . . torsions . . .. . .
22 +  int nRigidBodies; // .. .. .. . rigid bodies ... ..
23    int nOriented; // .. . . . .. . oriented atoms . . .
24 <  int nExcludes; // . . .. . . . .exclude pairs.. . . .
18 <
24 >  
25    Atom** myAtoms;      // the array of atoms
20  Exclude** myExcludes;// the array of Excluded pairs
26    Bond** myBonds;      // arrays of all the short range interactions
27    Bend** myBends;
28    Torsion** myTorsions;
29 <
30 <
29 >  vector<RigidBody*>   myRigidBodies;
30 >  vector<StuntDouble*> myIntegrableObjects;
31 >  vector<CutoffGroup*> myCutoffGroups;
32   } molInit;
33  
34   class Molecule{
# Line 35 | Line 41 | class Molecule{ (public)
41    void initialize( molInit &theInit );
42  
43    void setMyIndex( int theIndex ){ myIndex = theIndex;}
38  void setGlobalIndex( int theIndex ) { globalIndex = theIndex; }
39
44    int getMyIndex( void ) { return myIndex; }
45 +
46    int getGlobalIndex( void ) { return globalIndex; }
47 <
43 <  int getNAtoms   ( void ) {return nAtoms;}
44 <  int getNBonds   ( void ) {return nBonds;}
45 <  int getNBends   ( void ) {return nBends;}
46 <  int getNTorsions( void ) {return nTorsions;}
47 <  int getNOriented( void ) {return nOriented;}
48 <  int getNExcludes( void ) {return nExcludes;}
49 <  int getNMembers ( void ) {return nMembers;}
50 <  int getStampID  ( void ) {return stampID;}
47 >  void setGlobalIndex( int theIndex ) { globalIndex = theIndex; }
48  
49 <  Atom**     getMyAtoms   ( void ) {return myAtoms;}
50 <  Bond**     getMyBonds   ( void ) {return myBonds;}
51 <  Bend**     getMyBends   ( void ) {return myBends;}
52 <  Torsion**  getMyTorsions( void ) {return myTorsions;}
53 <  Exclude**  getMyExcludes( void ) {return myExcludes;}
54 <  
55 <  void setStampID( int info ) {stampID = info;}
56 <  
49 >  int getNAtoms   ( void )    {return nAtoms;}
50 >  int getNBonds   ( void )    {return nBonds;}
51 >  int getNBends   ( void )    {return nBends;}
52 >  int getNTorsions( void )    {return nTorsions;}
53 >  int getNRigidBodies( void ) {return myRigidBodies.size();}
54 >  int getNOriented( void )    {return nOriented;}
55 >  int getNMembers ( void )    {return nMembers;}
56 >  int getStampID  ( void )    {return stampID;}
57  
58 +  Atom**      getMyAtoms   ( void )    {return myAtoms;}
59 +  Bond**      getMyBonds   ( void )    {return myBonds;}
60 +  Bend**      getMyBends   ( void )    {return myBends;}
61 +  Torsion**   getMyTorsions( void )    {return myTorsions;}
62 +  vector<RigidBody*> getMyRigidBodies( void ) {return myRigidBodies;}
63 +  vector<StuntDouble*>& getIntegrableObjects(void) {return myIntegrableObjects;}
64  
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 +  
77 +  void setStampID( int info ) {stampID = info;}
78 +
79    void calcForces( void );
80 +  void atoms2rigidBodies( void );
81    double getPotential( void );
82    
83    void printMe( void );
# Line 68 | Line 85 | class Molecule{ (public)
85    void getCOM( double COM[3] );
86    void moveCOM( double delta[3] );
87    double getCOMvel( double COMvel[3] );
88 +  
89 +  double getTotalMass();
90  
91   private:
92  
# Line 76 | Line 95 | class Molecule{ (public)
95    int nBonds;    // ... .. ..  . .bonds .. .. . . . .
96    int nBends;    // . . . . .. . .bends . . . . .. .
97    int nTorsions; // .. . . .. . . torsions . . .. . .
98 +  int nRigidBodies; // .. . . .. .rigid bodies . . .. . .
99    int nOriented; // .. . . . .. . oriented atoms . . .
100    int nMembers;  // .. . . . . . .atoms (legacy code) . . .
101 <  int nExcludes; // . . . . .. .. excludes .. . .
102 <
101 >  int nCutoffGroups;
102 >  
103    int myIndex; // mostly just for debug (and for making pressure calcs work)
104    int globalIndex;
105  
# Line 87 | Line 107 | class Molecule{ (public)
107    Bond** myBonds;     // arrays of all the short range interactions
108    Bend** myBends;
109    Torsion** myTorsions;
110 <  Exclude** myExcludes; // array of the excluded pairs of long range forces
111 <  
110 >  vector<RigidBody*>   myRigidBodies;
111 >  vector<StuntDouble*> myIntegrableObjects;
112 >  vector<CutoffGroup*> myCutoffGroups;
113 >
114 >
115   };
116  
117   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines