--- branches/development/src/brains/Thermo.cpp 2010/10/02 19:54:41 1503 +++ branches/development/src/brains/Thermo.cpp 2012/05/18 21:44:02 1710 @@ -36,7 +36,8 @@ * [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). * [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). - * [4] Vardeman & Gezelter, in progress (2009). + * [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). + * [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). */ #include @@ -50,6 +51,7 @@ #include "primitives/Molecule.hpp" #include "utils/simError.h" #include "utils/PhysicalConstants.hpp" +#include "types/MultipoleAdapter.hpp" namespace OpenMD { @@ -208,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; @@ -363,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; } } }