36 |
|
* [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). |
37 |
|
* [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). |
38 |
|
* [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). |
39 |
< |
* [4] Vardeman & Gezelter, in progress (2009). |
39 |
> |
* [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). |
40 |
> |
* [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). |
41 |
|
*/ |
42 |
|
|
43 |
|
#include <math.h> |
51 |
|
#include "primitives/Molecule.hpp" |
52 |
|
#include "utils/simError.h" |
53 |
|
#include "utils/PhysicalConstants.hpp" |
54 |
+ |
#include "types/MultipoleAdapter.hpp" |
55 |
|
|
56 |
|
namespace OpenMD { |
57 |
|
|
210 |
|
|
211 |
|
RealType volume = this->getVolume(); |
212 |
|
Snapshot* curSnapshot = info_->getSnapshotManager()->getCurrentSnapshot(); |
213 |
< |
Mat3x3d tau = curSnapshot->statData.getTau(); |
213 |
> |
Mat3x3d tau = curSnapshot->getTau(); |
214 |
|
|
215 |
|
pressureTensor = (p_global + PhysicalConstants::energyConvert* tau)/volume; |
216 |
|
|
365 |
|
} |
366 |
|
} |
367 |
|
|
368 |
< |
if (atom->isDipole() ) { |
368 |
> |
MultipoleAdapter ma = MultipoleAdapter(atom->getAtomType()); |
369 |
> |
if (ma.isDipole() ) { |
370 |
|
Vector3d u_i = atom->getElectroFrame().getColumn(2); |
371 |
< |
GenericData* data = dynamic_cast<DirectionalAtomType*>(atom->getAtomType())->getPropertyByName("Dipole"); |
372 |
< |
if (data != NULL) { |
373 |
< |
moment = (dynamic_cast<DoubleGenericData*>(data))->getData(); |
371 |
< |
|
372 |
< |
moment *= debyeToCm; |
373 |
< |
dipoleVector += u_i * moment; |
374 |
< |
} |
371 |
> |
moment = ma.getDipoleMoment(); |
372 |
> |
moment *= debyeToCm; |
373 |
> |
dipoleVector += u_i * moment; |
374 |
|
} |
375 |
|
} |
376 |
|
} |