| 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 <cstring> |
| 44 |
|
#include "visitors/AtomVisitor.hpp" |
| 45 |
|
#include "primitives/DirectionalAtom.hpp" |
| 46 |
|
#include "primitives/RigidBody.hpp" |
| 47 |
+ |
#include "types/MultipoleAdapter.hpp" |
| 48 |
+ |
#include "types/GayBerneAdapter.hpp" |
| 49 |
|
|
| 50 |
|
namespace OpenMD { |
| 51 |
|
void BaseAtomVisitor::visit(RigidBody *rb) { |
| 82 |
|
AtomData *atomData; |
| 83 |
|
AtomInfo *atomInfo; |
| 84 |
|
Vector3d pos; |
| 85 |
< |
|
| 85 |
> |
Vector3d vel; |
| 86 |
> |
Vector3d frc; |
| 87 |
> |
Vector3d u; |
| 88 |
> |
|
| 89 |
|
if (isVisited(atom)) |
| 90 |
|
return; |
| 91 |
|
|
| 95 |
|
atomData->setID("ATOMDATA"); |
| 96 |
|
|
| 97 |
|
pos = atom->getPos(); |
| 98 |
+ |
vel = atom->getVel(); |
| 99 |
+ |
frc = atom->getFrc(); |
| 100 |
|
atomInfo->atomTypeName = atom->getType(); |
| 101 |
|
atomInfo->pos[0] = pos[0]; |
| 102 |
|
atomInfo->pos[1] = pos[1]; |
| 103 |
|
atomInfo->pos[2] = pos[2]; |
| 104 |
< |
atomInfo->dipole[0] = 0.0; |
| 105 |
< |
atomInfo->dipole[1] = 0.0; |
| 106 |
< |
atomInfo->dipole[2] = 0.0; |
| 104 |
> |
atomInfo->vel[0] = vel[0]; |
| 105 |
> |
atomInfo->vel[1] = vel[1]; |
| 106 |
> |
atomInfo->vel[2] = vel[2]; |
| 107 |
> |
atomInfo->hasVelocity = true; |
| 108 |
> |
atomInfo->frc[0] = frc[0]; |
| 109 |
> |
atomInfo->frc[1] = frc[1]; |
| 110 |
> |
atomInfo->frc[2] = frc[2]; |
| 111 |
> |
atomInfo->hasForce = true; |
| 112 |
> |
atomInfo->vec[0] = 0.0; |
| 113 |
> |
atomInfo->vec[1] = 0.0; |
| 114 |
> |
atomInfo->vec[2] = 0.0; |
| 115 |
|
|
| 116 |
|
atomData->addAtomInfo(atomInfo); |
| 117 |
|
|
| 124 |
|
AtomData *atomData; |
| 125 |
|
AtomInfo *atomInfo; |
| 126 |
|
Vector3d pos; |
| 127 |
+ |
Vector3d vel; |
| 128 |
+ |
Vector3d frc; |
| 129 |
|
Vector3d u; |
| 130 |
|
|
| 131 |
|
if (isVisited(datom)) |
| 132 |
|
return; |
| 133 |
< |
|
| 133 |
> |
|
| 134 |
|
pos = datom->getPos(); |
| 135 |
< |
if (datom->getAtomType()->isGayBerne()) { |
| 136 |
< |
u = datom->getA().transpose()*V3Z; |
| 137 |
< |
} else if (datom->getAtomType()->isMultipole()) { |
| 138 |
< |
u = datom->getElectroFrame().getColumn(2); |
| 135 |
> |
vel = datom->getVel(); |
| 136 |
> |
frc = datom->getFrc(); |
| 137 |
> |
|
| 138 |
> |
GayBerneAdapter gba = GayBerneAdapter(datom->getAtomType()); |
| 139 |
> |
MultipoleAdapter ma = MultipoleAdapter(datom->getAtomType()); |
| 140 |
> |
|
| 141 |
> |
if (gba.isGayBerne()) { |
| 142 |
> |
u = datom->getA().transpose()*V3Z; |
| 143 |
> |
} else if (ma.isDipole()) { |
| 144 |
> |
u = datom->getDipole(); |
| 145 |
> |
} else if (ma.isQuadrupole()) { |
| 146 |
> |
//u = datom->getQuadrupole().getColumn(2); |
| 147 |
> |
u = datom->getA().transpose()*V3Z; |
| 148 |
|
} |
| 149 |
|
atomData = new AtomData; |
| 150 |
|
atomData->setID("ATOMDATA"); |
| 154 |
|
atomInfo->pos[0] = pos[0]; |
| 155 |
|
atomInfo->pos[1] = pos[1]; |
| 156 |
|
atomInfo->pos[2] = pos[2]; |
| 157 |
< |
atomInfo->dipole[0] = u[0]; |
| 158 |
< |
atomInfo->dipole[1] = u[1]; |
| 159 |
< |
atomInfo->dipole[2] = u[2]; |
| 157 |
> |
atomInfo->vel[0] = vel[0]; |
| 158 |
> |
atomInfo->vel[1] = vel[1]; |
| 159 |
> |
atomInfo->vel[2] = vel[2]; |
| 160 |
> |
atomInfo->hasVelocity = true; |
| 161 |
> |
atomInfo->frc[0] = frc[0]; |
| 162 |
> |
atomInfo->frc[1] = frc[1]; |
| 163 |
> |
atomInfo->frc[2] = frc[2]; |
| 164 |
> |
atomInfo->hasForce = true; |
| 165 |
> |
atomInfo->vec[0] = u[0]; |
| 166 |
> |
atomInfo->vec[1] = u[1]; |
| 167 |
> |
atomInfo->vec[2] = u[2]; |
| 168 |
> |
atomInfo->hasVector = true; |
| 169 |
|
|
| 170 |
|
atomData->addAtomInfo(atomInfo); |
| 171 |
|
|