68 |
|
|
69 |
|
gengetopt_args_info args_info; |
70 |
|
std::string dumpFileName; |
71 |
– |
std::string mdFileName; |
71 |
|
std::string xyzFileName; |
72 |
|
|
73 |
|
//parse the command line option |
83 |
|
exit(1); |
84 |
|
} |
85 |
|
|
87 |
– |
mdFileName = dumpFileName; |
88 |
– |
mdFileName = mdFileName.substr(0, mdFileName.rfind(".")) + ".md"; |
89 |
– |
|
86 |
|
if (args_info.output_given){ |
87 |
|
xyzFileName = args_info.output_arg; |
88 |
|
} else { |
92 |
|
|
93 |
|
//parse md file and set up the system |
94 |
|
SimCreator creator; |
95 |
< |
SimInfo* info = creator.createSim(mdFileName, false); |
95 |
> |
SimInfo* info = creator.createSim(dumpFileName, false); |
96 |
|
|
97 |
< |
|
102 |
< |
|
97 |
> |
|
98 |
|
//create visitor list |
99 |
|
CompositeVisitor* compositeVisitor = new CompositeVisitor(); |
100 |
|
|
147 |
|
|
148 |
|
//create wrapping visitor |
149 |
|
|
150 |
< |
if(args_info.periodicBox_flag){ |
151 |
< |
WrappingVisitor* wrappingVisitor = new WrappingVisitor(info); |
152 |
< |
compositeVisitor->addVisitor(wrappingVisitor, 400); |
153 |
< |
} |
150 |
> |
//if(args_info.periodicBox_flag){ |
151 |
> |
// WrappingVisitor* wrappingVisitor = new WrappingVisitor(info); |
152 |
> |
// compositeVisitor->addVisitor(wrappingVisitor, 400); |
153 |
> |
//} |
154 |
|
|
155 |
|
//create replicate visitor |
156 |
|
if(args_info.repeatX_given > 0 || args_info.repeatY_given > 0 ||args_info.repeatY_given > 0){ |
197 |
|
Molecule* mol; |
198 |
|
StuntDouble* integrableObject; |
199 |
|
RigidBody* rb; |
200 |
+ |
Vector3d molCom; |
201 |
+ |
Vector3d newMolCom; |
202 |
+ |
Vector3d displacement; |
203 |
+ |
Mat3x3d hmat; |
204 |
+ |
Snapshot* currentSnapshot; |
205 |
|
|
206 |
|
for (int i = 0; i < nframes; i += args_info.frame_arg){ |
207 |
|
dumpReader->readFrame(i); |
208 |
< |
|
208 |
> |
|
209 |
> |
//wrapping the molecule |
210 |
> |
if(args_info.periodicBox_flag) { |
211 |
> |
currentSnapshot = info->getSnapshotManager()->getCurrentSnapshot(); |
212 |
> |
for (mol = info->beginMolecule(miter); mol != NULL; mol = info->nextMolecule(miter)) { |
213 |
> |
molCom = mol->getCom(); |
214 |
> |
newMolCom = molCom; |
215 |
> |
currentSnapshot->wrapVector(newMolCom); |
216 |
> |
displacement = newMolCom - molCom; |
217 |
> |
for (integrableObject = mol->beginIntegrableObject(iiter); integrableObject != NULL; |
218 |
> |
integrableObject = mol->nextIntegrableObject(iiter)) { |
219 |
> |
integrableObject->setPos(integrableObject->getPos() + displacement); |
220 |
> |
} |
221 |
> |
} |
222 |
> |
} |
223 |
|
//update atoms of rigidbody |
224 |
|
for (mol = info->beginMolecule(miter); mol != NULL; mol = info->nextMolecule(miter)) { |
225 |
|
|