--- trunk/OOPSE/libmdtools/Molecule.hpp 2003/04/10 20:08:56 489 +++ trunk/OOPSE/libmdtools/Molecule.hpp 2004/05/11 20:33:41 1157 @@ -1,11 +1,17 @@ #ifndef _MOLECULE_H_ #define _MOLECULE_H_ +#include +#include + #include "Atom.hpp" #include "SRI.hpp" #include "MoleculeStamp.hpp" -#include "Exclude.hpp" +#include "RigidBody.hpp" +#include "CutoffGroup.hpp" +using namespace std; + typedef struct{ int stampID; // the ID in the BASS component stamp array @@ -13,16 +19,17 @@ typedef struct{ int nBonds; // ... .. .. . .bonds .. .. . . . . int nBends; // . . . . .. . .bends . . . . .. . int nTorsions; // .. . . .. . . torsions . . .. . . + int nRigidBodies; // .. .. .. . rigid bodies ... .. int nOriented; // .. . . . .. . oriented atoms . . . - int nExcludes; // . . .. . . . .exclude pairs.. . . . - + int nCutoffGroups; + Atom** myAtoms; // the array of atoms - Exclude** myExcludes;// the array of Excluded pairs Bond** myBonds; // arrays of all the short range interactions Bend** myBends; Torsion** myTorsions; - - + vector myRigidBodies; + vector myIntegrableObjects; + vector myCutoffGroups; } molInit; class Molecule{ @@ -35,32 +42,47 @@ class Molecule{ (public) void initialize( molInit &theInit ); void setMyIndex( int theIndex ){ myIndex = theIndex;} - void setGlobalIndex( int theIndex ) {globalIndex = theIndex; } - int getMyIndex( void ) { return myIndex; } + int getGlobalIndex( void ) { return globalIndex; } - - int getNAtoms ( void ) {return nAtoms;} - int getNBonds ( void ) {return nBonds;} - int getNBends ( void ) {return nBends;} - int getNTorsions( void ) {return nTorsions;} - int getNOriented( void ) {return nOriented;} - int getNExcludes( void ) {return nExcludes;} - int getNMembers ( void ) {return nMembers;} - int getStampID ( void ) {return stampID;} + void setGlobalIndex( int theIndex ) { globalIndex = theIndex; } - Atom** getMyAtoms ( void ) {return myAtoms;} - Bond** getMyBonds ( void ) {return myBonds;} - Bend** getMyBends ( void ) {return myBends;} - Torsion** getMyTorsions( void ) {return myTorsions;} - Exclude** getMyExcludes( void ) {return myExcludes;} - - void setStampID( int info ) {stampID = info;} - + int getNAtoms ( void ) {return nAtoms;} + int getNBonds ( void ) {return nBonds;} + int getNBends ( void ) {return nBends;} + int getNTorsions( void ) {return nTorsions;} + int getNRigidBodies( void ) {return myRigidBodies.size();} + int getNOriented( void ) {return nOriented;} + int getNMembers ( void ) {return nMembers;} + int getStampID ( void ) {return stampID;} + Atom** getMyAtoms ( void ) {return myAtoms;} + Bond** getMyBonds ( void ) {return myBonds;} + Bend** getMyBends ( void ) {return myBends;} + Torsion** getMyTorsions( void ) {return myTorsions;} + vector getMyRigidBodies( void ) {return myRigidBodies;} + vector& getIntegrableObjects(void) {return myIntegrableObjects;} + CutoffGroup* beginCutoffGroup(vector::iterator& i){ + i = myCutoffGroups.begin(); + return i != myCutoffGroups.end()? *i : NULL; + } + CutoffGroup* nextCutoffGroup(vector::iterator& i){ + i++; + return i != myCutoffGroups.end()? *i : NULL; + } + + bool belongToCutoffGroup(int index){ + return cutoffAtomSet.find(index) != cutoffAtomSet.end()? true: false; + } + + int getNCutoffGroups() {return nCutoffGroups;} + + void setStampID( int info ) {stampID = info;} + void calcForces( void ); + void atoms2rigidBodies( void ); double getPotential( void ); void printMe( void ); @@ -68,9 +90,9 @@ class Molecule{ (public) void getCOM( double COM[3] ); void moveCOM( double delta[3] ); double getCOMvel( double COMvel[3] ); + + double getTotalMass(); - void atomicRollCall(int* molMembership); - private: int stampID; // the ID in the BASS component stamp array @@ -78,10 +100,11 @@ class Molecule{ (public) int nBonds; // ... .. .. . .bonds .. .. . . . . int nBends; // . . . . .. . .bends . . . . .. . int nTorsions; // .. . . .. . . torsions . . .. . . + int nRigidBodies; // .. . . .. .rigid bodies . . .. . . int nOriented; // .. . . . .. . oriented atoms . . . int nMembers; // .. . . . . . .atoms (legacy code) . . . - int nExcludes; // . . . . .. .. excludes .. . . - + int nCutoffGroups; + int myIndex; // mostly just for debug (and for making pressure calcs work) int globalIndex; @@ -89,8 +112,12 @@ class Molecule{ (public) Bond** myBonds; // arrays of all the short range interactions Bend** myBends; Torsion** myTorsions; - Exclude** myExcludes; // array of the excluded pairs of long range forces - + vector myRigidBodies; + vector myIntegrableObjects; + vector myCutoffGroups; + set cutoffAtomSet; //global index of atoms belonging to cutoff group + + }; #endif