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 |
|
|
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 |
|
} |