--- trunk/OOPSE/libmdtools/Molecule.cpp 2003/07/15 15:50:55 610 +++ trunk/OOPSE/libmdtools/Molecule.cpp 2003/10/28 16:03:37 829 @@ -1,4 +1,4 @@ -#include +#include #include "Molecule.hpp" @@ -198,3 +198,19 @@ double Molecule::getCOMvel( double COMvel[3] ) { return mtot; } + +double Molecule::getTotalMass() +{ + int natoms; + Atom** atoms; + double totalMass; + + natoms = getNAtoms(); + atoms = getMyAtoms(); + totalMass = 0; + for(int i =0; i < natoms; i++){ + totalMass += atoms[i]->getMass(); + } + + return totalMass; +}