| 35 |
|
* |
| 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). |
| 38 |
> |
* [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008). |
| 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> |
| 56 |
|
myTypes_.clear(); |
| 57 |
|
} |
| 58 |
|
|
| 59 |
< |
bool ReplacementVisitor::isReplacedAtom(const std::string& atomType) { |
| 59 |
> |
bool ReplacementVisitor::isReplacedAtom(const std::string &atomType) { |
| 60 |
|
std::set<std::string>::iterator strIter; |
| 61 |
|
strIter = myTypes_.find(atomType); |
| 62 |
|
return strIter != myTypes_.end() ? true : false; |
| 63 |
|
} |
| 64 |
|
|
| 65 |
< |
void ReplacementVisitor::addSite(const std::string& name, |
| 66 |
< |
const Vector3d refPos) { |
| 65 |
> |
void ReplacementVisitor::addSite(const std::string &name, |
| 66 |
> |
const Vector3d &refPos) { |
| 67 |
|
AtomInfo* atomInfo = new AtomInfo(); |
| 68 |
|
atomInfo->atomTypeName = name; |
| 69 |
|
atomInfo->pos = refPos; |
| 70 |
|
sites_->addAtomInfo(atomInfo); |
| 71 |
|
} |
| 72 |
< |
void ReplacementVisitor::addSite(const std::string& name, |
| 73 |
< |
const Vector3d refPos, |
| 74 |
< |
const Vector3d refVec) { |
| 72 |
> |
void ReplacementVisitor::addSite(const std::string &name, |
| 73 |
> |
const Vector3d &refPos, |
| 74 |
> |
const Vector3d &refVec) { |
| 75 |
|
AtomInfo* atomInfo = new AtomInfo(); |
| 76 |
|
atomInfo->atomTypeName = name; |
| 77 |
|
atomInfo->pos = refPos; |
| 81 |
|
} |
| 82 |
|
|
| 83 |
|
void ReplacementVisitor::visit(DirectionalAtom *datom) { |
| 83 |
– |
std::vector<AtomInfo*>atoms; |
| 84 |
|
|
| 85 |
|
RotMat3x3d A; |
| 86 |
|
RotMat3x3d Atrans; |
| 120 |
|
|
| 121 |
|
pos = datom->getPos(); |
| 122 |
|
vel = datom->getVel(); |
| 123 |
< |
frc = datom->getFrc(); |
| 124 |
< |
trq = datom->getTrq(); |
| 123 |
> |
|
| 124 |
|
j = datom->getJ(); |
| 125 |
|
I = datom->getI(); |
| 126 |
|
A = datom->getA(); |
| 127 |
+ |
|
| 128 |
|
skewMat(0, 0) = 0; |
| 129 |
|
skewMat(0, 1) = j[2] / I(2, 2); |
| 130 |
|
skewMat(0, 2) = -j[1] / I(1, 1); |
| 134 |
|
skewMat(2, 0) = j[1] / I(1, 1); |
| 135 |
|
skewMat(2, 1) = -j[0] / I(0, 0); |
| 136 |
|
skewMat(2, 2) = 0; |
| 137 |
– |
|
| 137 |
|
Mat3x3d mat = (A * skewMat).transpose(); |
| 138 |
|
|
| 139 |
|
// We need A^T to convert from body-fixed to space-fixed: |