43 |
|
#include "utils/simError.h" |
44 |
|
#include "io/DumpReader.hpp" |
45 |
|
#include "primitives/Molecule.hpp" |
46 |
< |
|
46 |
> |
#include "utils/NumericConstant.hpp" |
47 |
|
namespace oopse { |
48 |
|
|
49 |
|
|
112 |
|
for (int i = 0; i < nFrames; i += step_) { |
113 |
|
reader.readFrame(i); |
114 |
|
currentSnapshot_ = info_->getSnapshotManager()->getCurrentSnapshot(); |
115 |
< |
Mat3x3d orderTensor(0.0); |
115 |
> |
|
116 |
|
|
117 |
|
for (mol = info_->beginMolecule(mi); mol != NULL; mol = info_->nextMolecule(mi)) { |
118 |
|
//change the positions of atoms which belong to the rigidbodies |
122 |
|
|
123 |
|
} |
124 |
|
|
125 |
+ |
Mat3x3d orderTensor(0.0); |
126 |
|
for (std::vector<std::pair<StuntDouble*, StuntDouble*> >::iterator j = sdPairs_.begin(); j != sdPairs_.end(); ++j) { |
127 |
|
Vector3d vec = j->first->getPos() - j->second->getPos(); |
128 |
+ |
currentSnapshot_->wrapVector(vec); |
129 |
|
vec.normalize(); |
130 |
|
orderTensor +=outProduct(vec, vec); |
131 |
|
} |
156 |
|
double angle = 0.0; |
157 |
|
for (std::vector<std::pair<StuntDouble*, StuntDouble*> >::iterator j = sdPairs_.begin(); j != sdPairs_.end(); ++j) { |
158 |
|
Vector3d vec = j->first->getPos() - j->second->getPos(); |
159 |
+ |
currentSnapshot_->wrapVector(vec); |
160 |
|
vec.normalize(); |
161 |
|
|
162 |
|
angle += acos(dot(vec, director)) ; |
163 |
|
} |
164 |
< |
angle /= sdPairs_.size(); |
164 |
> |
angle = angle / (sdPairs_.size() * NumericConstant::PI) * 180.0; |
165 |
|
|
166 |
|
OrderParam param; |
167 |
|
param.p2 = p2; |
172 |
|
|
173 |
|
} |
174 |
|
|
175 |
< |
writeOrderParam(); |
175 |
> |
writeP2(); |
176 |
|
|
177 |
|
} |
178 |
|
|
179 |
< |
void P2OrderParameter::writeOrderParam() { |
179 |
> |
void P2OrderParameter::writeP2() { |
180 |
|
|
181 |
|
std::ofstream os(getOutputFileName().c_str()); |
182 |
|
os << "#radial distribution function\n"; |