--- trunk/OOPSE/libmdtools/Molecule.hpp 2003/03/26 20:22:02 407 +++ trunk/OOPSE/libmdtools/Molecule.hpp 2004/04/12 20:32:20 1097 @@ -4,6 +4,7 @@ #include "Atom.hpp" #include "SRI.hpp" #include "MoleculeStamp.hpp" +#include "RigidBody.hpp" typedef struct{ @@ -11,16 +12,15 @@ typedef struct{ int nAtoms; // the number of atoms in the molecule int nBonds; // ... .. .. . .bonds .. .. . . . . int nBends; // . . . . .. . .bends . . . . .. . - int nTorsions // .. . . .. . . torsions . . .. . . - int nOriented; // .. . . . .. . oreineted atoms . . . - - - Atom** myAtoms; // the array of atoms + int nTorsions; // .. . . .. . . torsions . . .. . . + int nRigidBodies; // .. .. .. . rigid bodies ... .. + int nOriented; // .. . . . .. . oriented atoms . . . + + Atom** myAtoms; // the array of atoms Bond** myBonds; // arrays of all the short range interactions Bend** myBends; Torsion** myTorsions; - - + RigidBody** myRigidBodies; } molInit; class Molecule{ @@ -32,36 +32,61 @@ class Molecule{ (public) void initialize( molInit &theInit ); - int getNMembers( void ) { return nMembers; } - int getStartAtom( void ) { return startAtom; } - int getEndAtom( void ) { return endAtom; } - int getStampID( void ) { return stampID; } + 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 getNRigidBodies( void ) {return nRigidBodies;} + 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;} + RigidBody** getMyRigidBodies( void ) {return myRigidBodies;} - void setNMembers( int info ) { nMembers = info; } - void setStartAtom( int info ) { startAtom = info; } - void setEndAtom( int info ) { endAtom = info; } - void setStampID( int info ) { stampID = info; } + void setStampID( int info ) {stampID = info;} + + void calcForces( void ); + void atoms2rigidBodies( void ); + double getPotential( void ); + void printMe( void ); + void getCOM( double COM[3] ); + void moveCOM( double delta[3] ); + double getCOMvel( double COMvel[3] ); + + double getTotalMass(); + private: int stampID; // the ID in the BASS component stamp array int nAtoms; // the number of atoms in the molecule int nBonds; // ... .. .. . .bonds .. .. . . . . int nBends; // . . . . .. . .bends . . . . .. . - int nTorsions // .. . . .. . . torsions . . .. . . - int nOriented; // .. . . . .. . oreineted atoms . . . - + int nTorsions; // .. . . .. . . torsions . . .. . . + int nRigidBodies; // .. . . .. .rigid bodies . . .. . . + int nOriented; // .. . . . .. . oriented atoms . . . + int nMembers; // .. . . . . . .atoms (legacy code) . . . + int myIndex; // mostly just for debug (and for making pressure calcs work) + int globalIndex; + Atom** myAtoms; // the array of atoms - Bond** myBonds; // arrays of all the short range interactions + Bond** myBonds; // arrays of all the short range interactions Bend** myBends; Torsion** myTorsions; + RigidBody** myRigidBodies; - int startAtom; - int endAtom; - - }; #endif