ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/applications/dump2Xyz/Dump2XYZ.cpp
(Generate patch)

Comparing branches/development/src/applications/dump2Xyz/Dump2XYZ.cpp (file contents):
Revision 1706 by gezelter, Fri Apr 27 20:44:16 2012 UTC vs.
Revision 1769 by gezelter, Mon Jul 9 14:15:52 2012 UTC

# Line 67 | Line 67 | int main(int argc, char* argv[]){
67   using namespace std;
68   int main(int argc, char* argv[]){
69    
70  //register force fields
71  registerForceFields();
72  
70    gengetopt_args_info args_info;
71    string dumpFileName;
72    string xyzFileName;
# Line 184 | Line 181 | int main(int argc, char* argv[]){
181                                   250);
182    } else if (args_info.refsele_given || args_info.originsele_given) {
183      cerr << "Both of --refsele and --originsele should appear by pair"
184 <              << endl;
184 >         << endl;
185      exit(1);
186    }
187    
# Line 229 | Line 226 | int main(int argc, char* argv[]){
226    Molecule::IntegrableObjectIterator  iiter;
227    Molecule::RigidBodyIterator rbIter;
228    Molecule* mol;
229 <  StuntDouble* integrableObject;
229 >  StuntDouble* sd;
230    RigidBody* rb;
231    Vector3d molCom;
232    Vector3d newMolCom;
# Line 247 | Line 244 | int main(int argc, char* argv[]){
244        currentSnapshot = info->getSnapshotManager()->getCurrentSnapshot();    
245        for (mol = info->beginMolecule(miter); mol != NULL;
246             mol = info->nextMolecule(miter)) {
247 <          molCom = mol->getCom();
248 <          newMolCom = molCom;
249 <          currentSnapshot->wrapVector(newMolCom);
250 <          displacement = newMolCom - molCom;
251 <        for (integrableObject = mol->beginIntegrableObject(iiter);
252 <             integrableObject != NULL;
253 <             integrableObject = mol->nextIntegrableObject(iiter)) {  
254 <          integrableObject->setPos(integrableObject->getPos() + displacement);
247 >        
248 >        molCom = mol->getCom();
249 >        newMolCom = molCom;
250 >        currentSnapshot->wrapVector(newMolCom);
251 >        displacement = newMolCom - molCom;
252 >
253 >        for (sd = mol->beginIntegrableObject(iiter); sd != NULL;
254 >             sd = mol->nextIntegrableObject(iiter)) {  
255 >
256 >          sd->setPos(sd->getPos() + displacement);
257 >          
258          }
259        }    
260      }
261 +
262      //update atoms of rigidbody
263      for (mol = info->beginMolecule(miter); mol != NULL;
264           mol = info->nextMolecule(miter)) {
# Line 265 | Line 266 | int main(int argc, char* argv[]){
266        //change the positions of atoms which belong to the rigidbodies
267        for (rb = mol->beginRigidBody(rbIter); rb != NULL;
268             rb = mol->nextRigidBody(rbIter)) {
269 +
270          rb->updateAtoms();
271          if (printVel) rb->updateAtomVel();
272 +
273        }
274      }
275      
276      //prepare visit
277      for (mol = info->beginMolecule(miter); mol != NULL;
278           mol = info->nextMolecule(miter)) {
279 <      for (integrableObject = mol->beginIntegrableObject(iiter);
280 <           integrableObject != NULL;
281 <           integrableObject = mol->nextIntegrableObject(iiter)) {
282 <        integrableObject->accept(prepareVisitor);
279 >
280 >      for (sd = mol->beginIntegrableObject(iiter); sd != NULL;
281 >           sd = mol->nextIntegrableObject(iiter)) {
282 >
283 >        sd->accept(prepareVisitor);
284 >
285        }
286      }
287      
# Line 287 | Line 292 | int main(int argc, char* argv[]){
292      //visit stuntdouble
293      for (mol = info->beginMolecule(miter); mol != NULL;
294           mol = info->nextMolecule(miter)) {
295 <      for (integrableObject = mol->beginIntegrableObject(iiter);
296 <           integrableObject != NULL;
297 <           integrableObject = mol->nextIntegrableObject(iiter)) {
298 <        integrableObject->accept(compositeVisitor);
295 >
296 >      for (sd = mol->beginIntegrableObject(iiter); sd != NULL;
297 >           sd = mol->nextIntegrableObject(iiter)) {
298 >
299 >        sd->accept(compositeVisitor);
300 >
301        }
302      }
303      

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines