--- trunk/OOPSE/libmdtools/Molecule.hpp 2004/04/13 16:26:03 1104 +++ 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 "RigidBody.hpp" +#include "CutoffGroup.hpp" +using namespace std; + typedef struct{ int stampID; // the ID in the BASS component stamp array @@ -15,13 +21,15 @@ typedef struct{ int nTorsions; // .. . . .. . . torsions . . .. . . int nRigidBodies; // .. .. .. . rigid bodies ... .. int nOriented; // .. . . . .. . oriented atoms . . . - + int nCutoffGroups; + Atom** myAtoms; // the array of atoms Bond** myBonds; // arrays of all the short range interactions Bend** myBends; Torsion** myTorsions; vector myRigidBodies; vector myIntegrableObjects; + vector myCutoffGroups; } molInit; class Molecule{ @@ -34,11 +42,11 @@ 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; } - + void setGlobalIndex( int theIndex ) { globalIndex = theIndex; } + int getNAtoms ( void ) {return nAtoms;} int getNBonds ( void ) {return nBonds;} int getNBends ( void ) {return nBends;} @@ -53,6 +61,23 @@ class Molecule{ (public) 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;} @@ -78,7 +103,8 @@ class Molecule{ (public) int nRigidBodies; // .. . . .. .rigid bodies . . .. . . int nOriented; // .. . . . .. . oriented atoms . . . int nMembers; // .. . . . . . .atoms (legacy code) . . . - + int nCutoffGroups; + int myIndex; // mostly just for debug (and for making pressure calcs work) int globalIndex; @@ -88,7 +114,10 @@ class Molecule{ (public) Torsion** myTorsions; vector myRigidBodies; vector myIntegrableObjects; + vector myCutoffGroups; + set cutoffAtomSet; //global index of atoms belonging to cutoff group + }; #endif