ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-4/src/applications/dump2Xyz/Dump2XYZ.cpp
(Generate patch)

Comparing trunk/OOPSE-4/src/applications/dump2Xyz/Dump2XYZ.cpp (file contents):
Revision 2749 by tim, Wed May 10 01:44:48 2006 UTC vs.
Revision 2764 by tim, Tue May 23 18:46:11 2006 UTC

# Line 152 | Line 152 | int main(int argc, char* argv[]){
152    
153    //create wrapping visitor
154    
155 <  if(args_info.periodicBox_flag){
156 <    WrappingVisitor* wrappingVisitor = new WrappingVisitor(info);
157 <    compositeVisitor->addVisitor(wrappingVisitor, 400);
158 <  }
155 >  //if(args_info.periodicBox_flag){
156 >  //  WrappingVisitor* wrappingVisitor = new WrappingVisitor(info);
157 >  //  compositeVisitor->addVisitor(wrappingVisitor, 400);
158 >  //}
159  
160    //create replicate visitor
161    if(args_info.repeatX_given > 0 || args_info.repeatY_given > 0 ||args_info.repeatY_given > 0){
# Line 202 | Line 202 | int main(int argc, char* argv[]){
202    Molecule* mol;
203    StuntDouble* integrableObject;
204    RigidBody* rb;
205 +  Vector3d molCom;
206 +  Vector3d newMolCom;
207 +  Vector3d displacement;
208 +  Mat3x3d hmat;
209 +  Snapshot* currentSnapshot;
210        
211    for (int i = 0; i < nframes; i += args_info.frame_arg){
212      dumpReader->readFrame(i);
213 <    
213 >
214 >    //wrapping the molecule
215 >    if(args_info.periodicBox_flag) {
216 >      currentSnapshot = info->getSnapshotManager()->getCurrentSnapshot();    
217 >      for (mol = info->beginMolecule(miter); mol != NULL; mol = info->nextMolecule(miter)) {
218 >          molCom = mol->getCom();
219 >          newMolCom = molCom;
220 >          currentSnapshot->wrapVector(newMolCom);
221 >          displacement = newMolCom - molCom;
222 >        for (integrableObject = mol->beginIntegrableObject(iiter); integrableObject != NULL;
223 >             integrableObject = mol->nextIntegrableObject(iiter)) {  
224 >          integrableObject->setPos(integrableObject->getPos() + displacement);
225 >        }
226 >      }    
227 >    }
228      //update atoms of rigidbody
229      for (mol = info->beginMolecule(miter); mol != NULL; mol = info->nextMolecule(miter)) {
230        

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines