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

Comparing:
trunk/src/visitors/OtherVisitor.cpp (file contents), Revision 413 by tim, Wed Mar 9 17:30:29 2005 UTC vs.
branches/development/src/visitors/OtherVisitor.cpp (file contents), Revision 1465 by chuckv, Fri Jul 9 23:08:25 2010 UTC

# Line 6 | Line 6
6   * redistribute this software in source and binary code form, provided
7   * that the following conditions are met:
8   *
9 < * 1. Acknowledgement of the program authors must be made in any
10 < *    publication of scientific results based in part on use of the
11 < *    program.  An acceptable form of acknowledgement is citation of
12 < *    the article in which the program was described (Matthew
13 < *    A. Meineke, Charles F. Vardeman II, Teng Lin, Christopher
14 < *    J. Fennell and J. Daniel Gezelter, "OOPSE: An Object-Oriented
15 < *    Parallel Simulation Engine for Molecular Dynamics,"
16 < *    J. Comput. Chem. 26, pp. 252-271 (2005))
17 < *
18 < * 2. Redistributions of source code must retain the above copyright
9 > * 1. Redistributions of source code must retain the above copyright
10   *    notice, this list of conditions and the following disclaimer.
11   *
12 < * 3. Redistributions in binary form must reproduce the above copyright
12 > * 2. Redistributions in binary form must reproduce the above copyright
13   *    notice, this list of conditions and the following disclaimer in the
14   *    documentation and/or other materials provided with the
15   *    distribution.
# Line 37 | Line 28
28   * arising out of the use of or inability to use software, even if the
29   * University of Notre Dame has been advised of the possibility of
30   * such damages.
31 + *
32 + * SUPPORT OPEN SCIENCE!  If you use OpenMD or its source code in your
33 + * research, please cite the appropriate papers when you publish your
34 + * work.  Good starting points are:
35 + *                                                                      
36 + * [1]  Meineke, et al., J. Comp. Chem. 26, 252-271 (2005).            
37 + * [2]  Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006).          
38 + * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008).          
39 + * [4]  Vardeman & Gezelter, in progress (2009).                        
40   */
41   #include "selection/SelectionManager.hpp"
42   #include "visitors/OtherVisitor.hpp"
# Line 44 | Line 44
44   #include "primitives/RigidBody.hpp"
45   #include "primitives/Molecule.hpp"
46   #include "brains/SimInfo.hpp"
47 < namespace oopse {
47 > namespace OpenMD {
48  
49 < void WrappingVisitor::visit(Atom *atom) {
50 < internalVisit(atom);
51 < }
49 >  void WrappingVisitor::visit(Atom *atom) {
50 >    internalVisit(atom);
51 >  }
52  
53 < void WrappingVisitor::visit(DirectionalAtom *datom) {
54 < internalVisit(datom);
55 < }
53 >  void WrappingVisitor::visit(DirectionalAtom *datom) {
54 >    internalVisit(datom);
55 >  }
56  
57 < void WrappingVisitor::visit(RigidBody *rb) {
58 < internalVisit(rb);
59 < }
57 >  void WrappingVisitor::visit(RigidBody *rb) {
58 >    internalVisit(rb);
59 >  }
60  
61 < void WrappingVisitor::internalVisit(StuntDouble *sd) {
61 >  void WrappingVisitor::internalVisit(StuntDouble *sd) {
62      GenericData *                     data;
63      AtomData *                        atomData;
64      AtomInfo *                        atomInfo;
# Line 67 | Line 67 | void WrappingVisitor::internalVisit(StuntDouble *sd) {
67      data = sd->getPropertyByName("ATOMDATA");
68  
69      if (data != NULL) {
70 <        atomData = dynamic_cast<AtomData *>(data);
70 >      atomData = dynamic_cast<AtomData *>(data);
71  
72 <        if (atomData == NULL)
73 <            return;
72 >      if (atomData == NULL)
73 >        return;
74      } else
75 <        return;
75 >      return;
76  
77      Snapshot* currSnapshot = info->getSnapshotManager()->getCurrentSnapshot();
78      
79      for( atomInfo = atomData->beginAtomInfo(i); atomInfo; atomInfo = atomData->nextAtomInfo(i) ) {
80 <        currSnapshot->wrapVector(atomInfo->pos);
80 >      Vector3d newPos = atomInfo->pos - origin_;
81 >      currSnapshot->wrapVector(newPos);
82 >      atomInfo->pos = newPos;
83      }
84 < }
84 >  }
85  
86 < const std::string WrappingVisitor::toString() {
86 >  void WrappingVisitor::update() {
87 >    if (useCom_){
88 >      origin_ = info->getCom();
89 >    }
90 >  }
91 >  
92 >  const std::string WrappingVisitor::toString() {
93      char        buffer[65535];
94      std::string result;
95  
# Line 101 | Line 109 | const std::string WrappingVisitor::toString() {
109      result += buffer;
110  
111      return result;
112 < }
112 >  }
113  
114 < //----------------------------------------------------------------------------//
114 >  //----------------------------------------------------------------------------//
115  
116 < ReplicateVisitor::ReplicateVisitor(SimInfo *info, Vector3i opt) :
116 >  ReplicateVisitor::ReplicateVisitor(SimInfo *info, Vector3i opt) :
117      BaseVisitor() {
118 <    this->info = info;
119 <    visitorName = "ReplicateVisitor";
120 <    this->replicateOpt = opt;
118 >      this->info = info;
119 >      visitorName = "ReplicateVisitor";
120 >      this->replicateOpt = opt;
121  
122 <    //generate the replicate directions
123 <    for( int i = 0; i <= replicateOpt[0]; i++ ) {
122 >      //generate the replicate directions
123 >      for( int i = 0; i <= replicateOpt[0]; i++ ) {
124          for( int j = 0; j <= replicateOpt[1]; j++ ) {
125 <            for( int k = 0; k <= replicateOpt[2]; k++ ) {
126 <                //skip original frame
127 <                if (i == 0 && j == 0 && k == 0) {
128 <                    continue;
129 <                } else {
130 <                    dir.push_back(Vector3i(i, j, k));
131 <                }
132 <            }
125 >          for( int k = 0; k <= replicateOpt[2]; k++ ) {
126 >            //skip original frame
127 >            if (i == 0 && j == 0 && k == 0) {
128 >              continue;
129 >            } else {
130 >              dir.push_back(Vector3i(i, j, k));
131 >            }
132 >          }
133          }
134 <    }
134 >      }
135      
136 < }
136 >    }
137  
138 < void ReplicateVisitor::visit(Atom *atom) {
139 < internalVisit(atom);
140 < }
138 >  void ReplicateVisitor::visit(Atom *atom) {
139 >    internalVisit(atom);
140 >  }
141  
142 < void ReplicateVisitor::visit(DirectionalAtom *datom) {
143 < internalVisit(datom);
144 < }
142 >  void ReplicateVisitor::visit(DirectionalAtom *datom) {
143 >    internalVisit(datom);
144 >  }
145  
146 < void ReplicateVisitor::visit(RigidBody *rb) {
147 < internalVisit(rb);
148 < }
146 >  void ReplicateVisitor::visit(RigidBody *rb) {
147 >    internalVisit(rb);
148 >  }
149  
150 < void ReplicateVisitor::internalVisit(StuntDouble *sd) {
150 >  void ReplicateVisitor::internalVisit(StuntDouble *sd) {
151      GenericData *          data;
152      AtomData *             atomData;
153  
# Line 147 | Line 155 | void ReplicateVisitor::internalVisit(StuntDouble *sd)
155      data = sd->getPropertyByName("ATOMDATA");
156  
157      if (data != NULL) {
158 <        atomData = dynamic_cast<AtomData *>(data);
158 >      atomData = dynamic_cast<AtomData *>(data);
159  
160 <        if (atomData == NULL) {
161 <            return;
162 <        }
160 >      if (atomData == NULL) {
161 >        return;
162 >      }
163      } else {
164 <        return;
164 >      return;
165      }
166  
167      Snapshot* currSnapshot = info->getSnapshotManager()->getCurrentSnapshot();
# Line 162 | Line 170 | void ReplicateVisitor::internalVisit(StuntDouble *sd)
170      std::vector<AtomInfo *> atomInfoList = atomData->getData();
171  
172      replicate(atomInfoList, atomData, box);
173 < }
173 >  }
174  
175 < void ReplicateVisitor::replicate(std::vector<AtomInfo *>&infoList, AtomData *data, const Mat3x3d& box) {
175 >  void ReplicateVisitor::replicate(std::vector<AtomInfo *>&infoList, AtomData *data, const Mat3x3d& box) {
176      AtomInfo* newAtomInfo;
177      std::vector<Vector3i>::iterator dirIter;
178      std::vector<AtomInfo *>::iterator i;
179  
180      for( dirIter = dir.begin(); dirIter != dir.end(); ++dirIter ) {
181 <        for( i = infoList.begin(); i != infoList.end(); i++ ) {
182 <            newAtomInfo = new AtomInfo();
183 <            *newAtomInfo = *(*i);
176 <
177 <            for( int j = 0; j < 3; j++ )
178 <                newAtomInfo->pos[j] += (*dirIter)[0]*box(j, 0) + (*dirIter)[1]*box(j, 1) + (*dirIter)[2]*box(j, 2);
181 >      for( i = infoList.begin(); i != infoList.end(); i++ ) {
182 >        newAtomInfo = new AtomInfo();
183 >        *newAtomInfo = *(*i);
184  
185 <            data->addAtomInfo(newAtomInfo);
186 <        }
185 >        for( int j = 0; j < 3; j++ )
186 >          newAtomInfo->pos[j] += (*dirIter)[0]*box(j, 0) + (*dirIter)[1]*box(j, 1) + (*dirIter)[2]*box(j, 2);
187 >
188 >        data->addAtomInfo(newAtomInfo);
189 >      }
190      } // end for(dirIter)  
191 < }
191 >  }
192  
193 < const std::string ReplicateVisitor::toString() {
193 >  const std::string ReplicateVisitor::toString() {
194      char                            buffer[65535];
195      std::string                     result;
196      std::set<std::string>::iterator i;
# Line 213 | Line 221 | const std::string ReplicateVisitor::toString() {
221      result += buffer;
222  
223      return result;
224 < }
224 >  }
225  
226 < //----------------------------------------------------------------------------//
226 >  //------------------------------------------------------------------------//
227  
228 < XYZVisitor::XYZVisitor(SimInfo *info) :
229 <    BaseVisitor(), seleMan(info), evaluator(info){
228 >  XYZVisitor::XYZVisitor(SimInfo *info) : BaseVisitor(), seleMan(info),
229 >                                          evaluator(info), doPositions_(true),
230 >                                          doVelocities_(false),
231 >                                          doForces_(false), doVectors_(false),
232 >                                          doCharges_(false) {
233      this->info = info;
234      visitorName = "XYZVisitor";
235 <
235 >    
236      evaluator.loadScriptString("select all");
237 <
237 >    
238      if (!evaluator.isDynamic()) {
239 <        seleMan.setSelectionSet(evaluator.evaluate());
239 >      seleMan.setSelectionSet(evaluator.evaluate());
240      }
241 <
242 < }
243 <
244 < XYZVisitor::XYZVisitor(SimInfo *info, const std::string& script) :
245 <    BaseVisitor(), seleMan(info), evaluator(info) {
241 >  }
242 >  
243 >  XYZVisitor::XYZVisitor(SimInfo *info, const std::string& script) :
244 >    BaseVisitor(), seleMan(info), evaluator(info), doPositions_(true),
245 >    doVelocities_(false), doForces_(false), doVectors_(false),
246 >    doCharges_(false) {
247 >    
248      this->info = info;
249      visitorName = "XYZVisitor";
250 <
250 >    
251      evaluator.loadScriptString(script);
252 <
252 >    
253      if (!evaluator.isDynamic()) {
254 <        seleMan.setSelectionSet(evaluator.evaluate());
254 >      seleMan.setSelectionSet(evaluator.evaluate());
255      }
256 <          
244 < }
256 >  }
257      
258 < void XYZVisitor::visit(Atom *atom) {
258 >  void XYZVisitor::visit(Atom *atom) {
259      if (isSelected(atom))
260 <        internalVisit(atom);
261 < }
260 >      internalVisit(atom);
261 >  }
262  
263 < void XYZVisitor::visit(DirectionalAtom *datom) {
263 >  void XYZVisitor::visit(DirectionalAtom *datom) {
264      if (isSelected(datom))
265 <        internalVisit(datom);
266 < }
267 <
268 < void XYZVisitor::visit(RigidBody *rb) {
265 >      internalVisit(datom);
266 >  }
267 >  
268 >  void XYZVisitor::visit(RigidBody *rb) {
269      if (isSelected(rb))
270 <        internalVisit(rb);
271 < }
272 <
273 < void XYZVisitor::update() {
270 >      internalVisit(rb);
271 >  }
272 >  
273 >  void XYZVisitor::update() {
274      //if dynamic, we need to re-evaluate the selection
275      if (evaluator.isDynamic()) {
276 <       seleMan.setSelectionSet(evaluator.evaluate());
276 >      seleMan.setSelectionSet(evaluator.evaluate());
277      }
278 < }
279 <
280 < void XYZVisitor::internalVisit(StuntDouble *sd) {
278 >  }
279 >  
280 >  void XYZVisitor::internalVisit(StuntDouble *sd) {
281      GenericData *                     data;
282      AtomData *                        atomData;
283      AtomInfo *                        atomInfo;
284      std::vector<AtomInfo *>::iterator i;
285      char                              buffer[1024];
286 <
286 >    
287      //if there is not atom data, just skip it
288      data = sd->getPropertyByName("ATOMDATA");
289 <
289 >    
290      if (data != NULL) {
291 <        atomData = dynamic_cast<AtomData *>(data);
292 <
293 <        if (atomData == NULL)
294 <            return;
291 >      atomData = dynamic_cast<AtomData *>(data);
292 >      
293 >      if (atomData == NULL)
294 >        return;
295      } else
296 <        return;
296 >      return;
297  
298      for( atomInfo = atomData->beginAtomInfo(i); atomInfo;
299 <        atomInfo = atomData->nextAtomInfo(i) ) {
300 <        sprintf(buffer,
301 <                "%s%15.8f%15.8f%15.8f%15.8f%15.8f%15.8f",
302 <                atomInfo->atomTypeName.c_str(),
303 <                atomInfo->pos[0],
304 <                atomInfo->pos[1],
305 <                atomInfo->pos[2],
306 <                atomInfo->dipole[0],
307 <                atomInfo->dipole[1],
308 <                atomInfo->dipole[2]);
309 <        frame.push_back(buffer);
310 <    }
311 < }
299 >         atomInfo = atomData->nextAtomInfo(i) ) {
300 >    
301 >      std::string line;
302 >      sprintf(buffer, "%s", atomInfo->atomTypeName.c_str());
303 >      line += buffer;
304 >      
305 >      if (doPositions_){
306 >        sprintf(buffer, "%15.8f%15.8f%15.8f", atomInfo->pos[0],
307 >                atomInfo->pos[1], atomInfo->pos[2]);
308 >        line += buffer;
309 >      }      
310 >      if (doCharges_ && atomInfo->hasCharge) {
311 >        sprintf(buffer, "%15.8f", atomInfo->charge);
312 >        line += buffer;
313 >      }
314 >      if (doVectors_ && atomInfo->hasVector) {
315 >        sprintf(buffer, "%15.8f%15.8f%15.8f", atomInfo->vec[0],
316 >                atomInfo->vec[1], atomInfo->vec[2]);
317 >        line += buffer;
318 >      }
319 >      if (doVelocities_ && atomInfo->hasVelocity) {
320 >        sprintf(buffer, "%15.8f%15.8f%15.8f", atomInfo->vel[0],
321 >                atomInfo->vel[1], atomInfo->vel[2]);
322 >        line += buffer;
323 >      }
324 >      if (doForces_ && atomInfo->hasForce) {
325 >        sprintf(buffer, "%15.8f%15.8f%15.8f", atomInfo->frc[0],
326 >                atomInfo->frc[1], atomInfo->frc[2]);
327 >        line += buffer;
328 >      }      
329 >      frame.push_back(line);
330 >    }    
331 >  }
332  
333 < bool XYZVisitor::isSelected(StuntDouble *sd) {
333 >  bool XYZVisitor::isSelected(StuntDouble *sd) {
334      return seleMan.isSelected(sd);
335 < }
335 >  }
336  
337 < void XYZVisitor::writeFrame(std::ostream &outStream) {
337 >  void XYZVisitor::writeFrame(std::ostream &outStream) {
338      std::vector<std::string>::iterator i;
339      char buffer[1024];
340 <
340 >    
341      if (frame.size() == 0)
342 <        std::cerr << "Current Frame does not contain any atoms" << std::endl;
343 <
342 >      std::cerr << "Current Frame does not contain any atoms" << std::endl;
343 >    
344      //total number of atoms  
345      outStream << frame.size() << std::endl;
346 <
346 >    
347      //write comment line
348      Snapshot* currSnapshot = info->getSnapshotManager()->getCurrentSnapshot();
349      Mat3x3d box = currSnapshot->getHmat();
# Line 322 | Line 354 | void XYZVisitor::writeFrame(std::ostream &outStream) {
354              box(0, 0), box(0, 1), box(0, 2),
355              box(1, 0), box(1, 1), box(1, 2),
356              box(2, 0), box(2, 1), box(2, 2));
357 <
357 >    
358      outStream << buffer << std::endl;
359 <
359 >    
360      for( i = frame.begin(); i != frame.end(); ++i )
361 <        outStream << *i << std::endl;
362 < }
363 <
364 < const std::string XYZVisitor::toString() {
361 >      outStream << *i << std::endl;
362 >  }
363 >  
364 >  std::string XYZVisitor::trimmedName(const std::string&atomTypeName) {    
365 >    return atomTypeName.substr(0, atomTypeName.find('-'));
366 >  }
367 >  
368 >  const std::string XYZVisitor::toString() {
369      char        buffer[65535];
370      std::string result;
371 <
371 >    
372      sprintf(buffer,
373              "------------------------------------------------------------------\n");
374      result += buffer;
375 <
375 >    
376      sprintf(buffer, "Visitor name: %s\n", visitorName.c_str());
377      result += buffer;
378 <
378 >    
379      sprintf(buffer,
380              "Visitor Description: assemble the atom data and output xyz file\n");
381      result += buffer;
# Line 347 | Line 383 | const std::string XYZVisitor::toString() {
383      sprintf(buffer,
384              "------------------------------------------------------------------\n");
385      result += buffer;
386 <
386 >    
387      return result;
388 < }
389 <
390 < //----------------------------------------------------------------------------//
391 <
392 < void PrepareVisitor::internalVisit(Atom *atom) {
388 >  }
389 >  
390 >  //----------------------------------------------------------------------------//
391 >  
392 >  void PrepareVisitor::internalVisit(Atom *atom) {
393      GenericData *data;
394      AtomData *   atomData;
395 <
395 >    
396      //if visited property is  existed, remove it
397      data = atom->getPropertyByName("VISITED");
398 <
398 >    
399      if (data != NULL) {
400 <    atom->removeProperty("VISITED");
400 >      atom->removeProperty("VISITED");
401      }
402 <
402 >    
403      //remove atomdata
404      data = atom->getPropertyByName("ATOMDATA");
405  
406      if (data != NULL) {
407 <        atomData = dynamic_cast<AtomData *>(data);
407 >      atomData = dynamic_cast<AtomData *>(data);
408  
409 <        if (atomData != NULL)
410 <            atom->removeProperty("ATOMDATA");
409 >      if (atomData != NULL)
410 >        atom->removeProperty("ATOMDATA");
411      }
412 < }
412 >  }
413  
414 < void PrepareVisitor::internalVisit(RigidBody *rb) {
414 >  void PrepareVisitor::internalVisit(RigidBody *rb) {
415      GenericData* data;
416      AtomData* atomData;
417      std::vector<Atom *> myAtoms;
# Line 385 | Line 421 | void PrepareVisitor::internalVisit(RigidBody *rb) {
421      data = rb->getPropertyByName("VISITED");
422  
423      if (data != NULL) {
424 <    rb->removeProperty("VISITED");
424 >      rb->removeProperty("VISITED");
425      }
426  
427      //remove atomdata
428      data = rb->getPropertyByName("ATOMDATA");
429  
430      if (data != NULL) {
431 <        atomData = dynamic_cast<AtomData *>(data);
431 >      atomData = dynamic_cast<AtomData *>(data);
432  
433 <        if (atomData != NULL)
434 <            rb->removeProperty("ATOMDATA");
433 >      if (atomData != NULL)
434 >        rb->removeProperty("ATOMDATA");
435      }
436  
437      myAtoms = rb->getAtoms();
438  
439      for( atomIter = myAtoms.begin(); atomIter != myAtoms.end(); ++atomIter )
440 <        internalVisit(*atomIter);
441 < }
440 >      internalVisit(*atomIter);
441 >  }
442  
443 < const std::string PrepareVisitor::toString() {
444 <     char buffer[65535];
445 <     std::string result;
443 >  const std::string PrepareVisitor::toString() {
444 >    char buffer[65535];
445 >    std::string result;
446  
447 <     sprintf(buffer,
448 <             "------------------------------------------------------------------\n");
449 <     result += buffer;
447 >    sprintf(buffer,
448 >            "------------------------------------------------------------------\n");
449 >    result += buffer;
450  
451 <     sprintf(buffer, "Visitor name: %s", visitorName.c_str());
452 <     result += buffer;
451 >    sprintf(buffer, "Visitor name: %s", visitorName.c_str());
452 >    result += buffer;
453  
454 <     sprintf(buffer,
455 <             "Visitor Description: prepare for operation of other vistors\n");
456 <     result += buffer;
454 >    sprintf(buffer,
455 >            "Visitor Description: prepare for operation of other vistors\n");
456 >    result += buffer;
457  
458 <     sprintf(buffer,
459 <             "------------------------------------------------------------------\n");
460 <     result += buffer;
458 >    sprintf(buffer,
459 >            "------------------------------------------------------------------\n");
460 >    result += buffer;
461  
462 <     return result;
463 < }
462 >    return result;
463 >  }
464  
465 < //----------------------------------------------------------------------------//
465 >  //----------------------------------------------------------------------------//
466  
467 < WaterTypeVisitor::WaterTypeVisitor() {
467 >  WaterTypeVisitor::WaterTypeVisitor() {
468      visitorName = "WaterTypeVisitor";
469      waterTypeList.insert("TIP3P_RB_0");
470      waterTypeList.insert("TIP4P_RB_0");
471 +    waterTypeList.insert("TIP4P-Ew_RB_0");
472      waterTypeList.insert("TIP5P_RB_0");
473 +    waterTypeList.insert("TIP5P-E_RB_0");
474      waterTypeList.insert("SPCE_RB_0");
475 < }
475 >    waterTypeList.insert("SPC_RB_0");
476 >  }
477  
478 < void WaterTypeVisitor::visit(RigidBody *rb) {
478 >  void WaterTypeVisitor::visit(RigidBody *rb) {
479      std::string rbName;
480      std::vector<Atom *> myAtoms;
481      std::vector<Atom *>::iterator atomIter;
# Line 446 | Line 485 | void WaterTypeVisitor::visit(RigidBody *rb) {
485      std::vector<AtomInfo *>::iterator i;
486  
487      rbName = rb->getType();
488 <
488 >    
489      if (waterTypeList.find(rbName) != waterTypeList.end()) {
490 <        myAtoms = rb->getAtoms();
490 >      myAtoms = rb->getAtoms();
491  
492 <        for( atomIter = myAtoms.begin(); atomIter != myAtoms.end();
493 <            ++atomIter ) {
494 <            data = (*atomIter)->getPropertyByName("ATOMDATA");
495 <
496 <            if (data != NULL) {
497 <                atomData = dynamic_cast<AtomData *>(data);
498 <
499 <                if (atomData == NULL)
500 <                    continue;
501 <            } else
502 <                continue;
503 <
504 <            for( atomInfo = atomData->beginAtomInfo(i); atomInfo;
505 <                 atomInfo = atomData->nextAtomInfo(i) ) {
506 <              atomInfo->atomTypeName = trimmedName(atomInfo->atomTypeName);
507 <            } //end for(atomInfo)
508 <        }     //end for(atomIter)
492 >      for( atomIter = myAtoms.begin(); atomIter != myAtoms.end();
493 >           ++atomIter ) {
494 >        data = (*atomIter)->getPropertyByName("ATOMDATA");
495 >        
496 >        if (data != NULL) {
497 >          atomData = dynamic_cast<AtomData *>(data);
498 >          
499 >          if (atomData == NULL)
500 >            continue;
501 >        } else
502 >          continue;
503 >        
504 >        for( atomInfo = atomData->beginAtomInfo(i); atomInfo;
505 >             atomInfo = atomData->nextAtomInfo(i) ) {
506 >          atomInfo->atomTypeName = trimmedName(atomInfo->atomTypeName);
507 >        } //end for(atomInfo)
508 >      }     //end for(atomIter)
509      }         //end if (waterTypeList.find(rbName) != waterTypeList.end())
510 < }
510 >  }
511  
512    std::string WaterTypeVisitor::trimmedName(const std::string&atomTypeName) {
513      return atomTypeName.substr(0, atomTypeName.find('_'));
514    }
515  
516 < const std::string WaterTypeVisitor::toString() {
516 >  const std::string WaterTypeVisitor::toString() {
517      char buffer[65535];
518      std::string result;
519  
# Line 494 | Line 533 | const std::string WaterTypeVisitor::toString() {
533      result += buffer;
534  
535      return result;
536 < }
536 >  }
537  
538 < } //namespace oopse
538 > } //namespace OpenMD

Comparing:
trunk/src/visitors/OtherVisitor.cpp (property svn:keywords), Revision 413 by tim, Wed Mar 9 17:30:29 2005 UTC vs.
branches/development/src/visitors/OtherVisitor.cpp (property svn:keywords), Revision 1465 by chuckv, Fri Jul 9 23:08:25 2010 UTC

# Line 0 | Line 1
1 + Author Id Revision Date

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines