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 |
|
|
110 |
|
|
111 |
|
LinearAtomVisitor* linearVisitor = new LinearAtomVisitor(info); |
112 |
|
compositeVisitor->addVisitor(linearVisitor, 750); |
113 |
+ |
if (args_info.gb_given) { |
114 |
+ |
linearVisitor->addGayBerneAtomType(args_info.gb_arg); |
115 |
+ |
} |
116 |
|
|
117 |
|
GBLipidAtomVisitor* gbLipidVisitor = new GBLipidAtomVisitor(info); |
118 |
|
compositeVisitor->addVisitor(gbLipidVisitor, 740); |
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){ |
170 |
|
|
171 |
|
//create xyzVisitor |
172 |
|
XYZVisitor* xyzVisitor; |
173 |
+ |
|
174 |
|
if (args_info.selection_given) { |
175 |
|
xyzVisitor = new XYZVisitor(info, args_info.selection_arg); |
176 |
|
} else { |
177 |
|
xyzVisitor = new XYZVisitor(info); |
178 |
+ |
} |
179 |
+ |
|
180 |
+ |
if(args_info.printPosOnly_flag){ |
181 |
+ |
bool posOnly = true; |
182 |
+ |
xyzVisitor->setPosOnly(posOnly); |
183 |
|
} |
184 |
+ |
|
185 |
|
compositeVisitor->addVisitor(xyzVisitor, 200); |
186 |
|
|
187 |
|
std::cout << compositeVisitor->toString(); |
204 |
|
Molecule* mol; |
205 |
|
StuntDouble* integrableObject; |
206 |
|
RigidBody* rb; |
207 |
+ |
Vector3d molCom; |
208 |
+ |
Vector3d newMolCom; |
209 |
+ |
Vector3d displacement; |
210 |
+ |
Mat3x3d hmat; |
211 |
+ |
Snapshot* currentSnapshot; |
212 |
|
|
213 |
|
for (int i = 0; i < nframes; i += args_info.frame_arg){ |
214 |
|
dumpReader->readFrame(i); |
215 |
< |
|
215 |
> |
|
216 |
> |
//wrapping the molecule |
217 |
> |
if(args_info.periodicBox_flag) { |
218 |
> |
currentSnapshot = info->getSnapshotManager()->getCurrentSnapshot(); |
219 |
> |
for (mol = info->beginMolecule(miter); mol != NULL; mol = info->nextMolecule(miter)) { |
220 |
> |
molCom = mol->getCom(); |
221 |
> |
newMolCom = molCom; |
222 |
> |
currentSnapshot->wrapVector(newMolCom); |
223 |
> |
displacement = newMolCom - molCom; |
224 |
> |
for (integrableObject = mol->beginIntegrableObject(iiter); integrableObject != NULL; |
225 |
> |
integrableObject = mol->nextIntegrableObject(iiter)) { |
226 |
> |
integrableObject->setPos(integrableObject->getPos() + displacement); |
227 |
> |
} |
228 |
> |
} |
229 |
> |
} |
230 |
|
//update atoms of rigidbody |
231 |
|
for (mol = info->beginMolecule(miter); mol != NULL; mol = info->nextMolecule(miter)) { |
232 |
|
|