| 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(); | 
| 372 | 
< | 
             | 
| 373 | 
< | 
            moment *= debyeToCm; | 
| 374 | 
< | 
            dipoleVector += u_i * moment; | 
| 375 | 
< | 
          } | 
| 371 | 
> | 
          moment = ma.getDipoleMoment(); | 
| 372 | 
> | 
          moment *= debyeToCm; | 
| 373 | 
> | 
          dipoleVector += u_i * moment; | 
| 374 | 
  | 
        } | 
| 375 | 
  | 
      } | 
| 376 | 
  | 
    } |