--- branches/development/src/brains/Thermo.cpp 2011/11/22 20:38:56 1665 +++ branches/development/src/brains/Thermo.cpp 2012/05/18 21:44:02 1710 @@ -51,6 +51,7 @@ #include "primitives/Molecule.hpp" #include "utils/simError.h" #include "utils/PhysicalConstants.hpp" +#include "types/MultipoleAdapter.hpp" namespace OpenMD { @@ -209,7 +210,7 @@ namespace OpenMD { RealType volume = this->getVolume(); Snapshot* curSnapshot = info_->getSnapshotManager()->getCurrentSnapshot(); - Mat3x3d tau = curSnapshot->statData.getTau(); + Mat3x3d tau = curSnapshot->getTau(); pressureTensor = (p_global + PhysicalConstants::energyConvert* tau)/volume; @@ -364,15 +365,12 @@ namespace OpenMD { } } - if (atom->isDipole() ) { + MultipoleAdapter ma = MultipoleAdapter(atom->getAtomType()); + if (ma.isDipole() ) { Vector3d u_i = atom->getElectroFrame().getColumn(2); - GenericData* data = dynamic_cast(atom->getAtomType())->getPropertyByName("Dipole"); - if (data != NULL) { - moment = (dynamic_cast(data))->getData(); - - moment *= debyeToCm; - dipoleVector += u_i * moment; - } + moment = ma.getDipoleMoment(); + moment *= debyeToCm; + dipoleVector += u_i * moment; } } }