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 489 by mmeineke, Thu Apr 10 20:08:56 2003 UTC vs.
Revision 1157 by tim, Tue May 11 20:33:41 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.. . . .
25 <
24 >  int nCutoffGroups;
25 >  
26    Atom** myAtoms;      // the array of atoms
20  Exclude** myExcludes;// the array of Excluded pairs
27    Bond** myBonds;      // arrays of all the short range interactions
28    Bend** myBends;
29    Torsion** myTorsions;
30 <
31 <
30 >  vector<RigidBody*>   myRigidBodies;
31 >  vector<StuntDouble*> myIntegrableObjects;
32 >  vector<CutoffGroup*> myCutoffGroups;
33   } molInit;
34  
35   class Molecule{
# Line 35 | Line 42 | class Molecule{ (public)
42    void initialize( molInit &theInit );
43  
44    void setMyIndex( int theIndex ){ myIndex = theIndex;}
38  void setGlobalIndex( int theIndex ) {globalIndex = theIndex; }
39
45    int getMyIndex( void ) { return myIndex; }
46 +
47    int getGlobalIndex( void ) { return globalIndex; }
48 <
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;}
48 >  void setGlobalIndex( int theIndex ) { globalIndex = theIndex; }
49  
50 <  Atom**     getMyAtoms   ( void ) {return myAtoms;}
51 <  Bond**     getMyBonds   ( void ) {return myBonds;}
52 <  Bend**     getMyBends   ( void ) {return myBends;}
53 <  Torsion**  getMyTorsions( void ) {return myTorsions;}
54 <  Exclude**  getMyExcludes( void ) {return myExcludes;}
55 <  
56 <  void setStampID( int info ) {stampID = info;}
57 <  
50 >  int getNAtoms   ( void )    {return nAtoms;}
51 >  int getNBonds   ( void )    {return nBonds;}
52 >  int getNBends   ( void )    {return nBends;}
53 >  int getNTorsions( void )    {return nTorsions;}
54 >  int getNRigidBodies( void ) {return myRigidBodies.size();}
55 >  int getNOriented( void )    {return nOriented;}
56 >  int getNMembers ( void )    {return nMembers;}
57 >  int getStampID  ( void )    {return stampID;}
58  
59 +  Atom**      getMyAtoms   ( void )    {return myAtoms;}
60 +  Bond**      getMyBonds   ( void )    {return myBonds;}
61 +  Bend**      getMyBends   ( void )    {return myBends;}
62 +  Torsion**   getMyTorsions( void )    {return myTorsions;}
63 +  vector<RigidBody*> getMyRigidBodies( void ) {return myRigidBodies;}
64 +  vector<StuntDouble*>& getIntegrableObjects(void) {return myIntegrableObjects;}
65  
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 +  
82 +  void setStampID( int info ) {stampID = info;}
83 +
84    void calcForces( void );
85 +  void atoms2rigidBodies( void );
86    double getPotential( void );
87    
88    void printMe( void );
# Line 68 | Line 90 | class Molecule{ (public)
90    void getCOM( double COM[3] );
91    void moveCOM( double delta[3] );
92    double getCOMvel( double COMvel[3] );
93 +  
94 +  double getTotalMass();
95  
72  void atomicRollCall(int* molMembership);
73
96   private:
97  
98    int stampID;   // the ID in the BASS component stamp array
# Line 78 | Line 100 | class Molecule{ (public)
100    int nBonds;    // ... .. ..  . .bonds .. .. . . . .
101    int nBends;    // . . . . .. . .bends . . . . .. .
102    int nTorsions; // .. . . .. . . torsions . . .. . .
103 +  int nRigidBodies; // .. . . .. .rigid bodies . . .. . .
104    int nOriented; // .. . . . .. . oriented atoms . . .
105    int nMembers;  // .. . . . . . .atoms (legacy code) . . .
106 <  int nExcludes; // . . . . .. .. excludes .. . .
107 <
106 >  int nCutoffGroups;
107 >  
108    int myIndex; // mostly just for debug (and for making pressure calcs work)
109    int globalIndex;
110  
# Line 89 | Line 112 | class Molecule{ (public)
112    Bond** myBonds;     // arrays of all the short range interactions
113    Bend** myBends;
114    Torsion** myTorsions;
115 <  Exclude** myExcludes; // array of the excluded pairs of long range forces
116 <  
115 >  vector<RigidBody*>   myRigidBodies;
116 >  vector<StuntDouble*> myIntegrableObjects;
117 >  vector<CutoffGroup*> myCutoffGroups;
118 >  set<int> cutoffAtomSet;  //global index of atoms belonging to cutoff group
119 >
120 >
121   };
122  
123   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines