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

Comparing branches/development/src/visitors/OtherVisitor.cpp (file contents):
Revision 1873 by gezelter, Fri May 10 14:59:13 2013 UTC vs.
Revision 1874 by gezelter, Wed May 15 15:09:35 2013 UTC

# Line 185 | Line 185 | namespace OpenMD {
185      std::vector<AtomInfo *>::iterator i;
186  
187      for( dirIter = dir.begin(); dirIter != dir.end(); ++dirIter ) {
188 <      for( i = infoList.begin(); i != infoList.end(); i++ ) {
188 >      for( i = infoList.begin(); i != infoList.end(); ++i ) {
189          newAtomInfo = new AtomInfo();
190          *newAtomInfo = *(*i);
191  
# Line 200 | Line 200 | namespace OpenMD {
200    const std::string ReplicateVisitor::toString() {
201      char                            buffer[65535];
202      std::string                     result;
203    std::set<std::string>::iterator i;
203  
204 +
205      sprintf(buffer,
206 <            "------------------------------------------------------------------\n");
206 >            "--------------------------------------------------------------\n");
207      result += buffer;
208  
209      sprintf(buffer, "Visitor name: %s\n", visitorName.c_str());
# Line 224 | Line 224 | namespace OpenMD {
224      result += buffer;
225  
226      sprintf(buffer,
227 <            "------------------------------------------------------------------\n");
227 >            "--------------------------------------------------------------\n");
228      result += buffer;
229  
230      return result;
# Line 236 | Line 236 | namespace OpenMD {
236                                            evaluator(info), doPositions_(true),
237                                            doVelocities_(false),
238                                            doForces_(false), doVectors_(false),
239 <                                          doCharges_(false) {
239 >                                          doCharges_(false),
240 >                                          doElectricFields_(false) {
241      this->info = info;
242      visitorName = "XYZVisitor";
243      
# Line 250 | Line 251 | namespace OpenMD {
251    XYZVisitor::XYZVisitor(SimInfo *info, const std::string& script) :
252      BaseVisitor(), seleMan(info), evaluator(info), doPositions_(true),
253      doVelocities_(false), doForces_(false), doVectors_(false),
254 <    doCharges_(false) {
254 >    doCharges_(false), doElectricFields_(false) {
255      
256      this->info = info;
257      visitorName = "XYZVisitor";
# Line 350 | Line 351 | namespace OpenMD {
351      std::vector<std::string>::iterator i;
352      char buffer[1024];
353      
354 <    if (frame.size() == 0)
354 >    if (frame.empty())
355        std::cerr << "Current Frame does not contain any atoms" << std::endl;
356      
357      //total number of atoms  
# Line 403 | Line 404 | namespace OpenMD {
404    
405    void PrepareVisitor::internalVisit(Atom *atom) {
406      GenericData *data;
406    AtomData *   atomData;
407      
408      //if visited property is  existed, remove it
409      data = atom->getPropertyByName("VISITED");
# Line 416 | Line 416 | namespace OpenMD {
416      data = atom->getPropertyByName("ATOMDATA");
417  
418      if (data != NULL) {
419 <      atomData = dynamic_cast<AtomData *>(data);
419 >      AtomData* atomData = dynamic_cast<AtomData *>(data);
420  
421        if (atomData != NULL)
422          atom->removeProperty("ATOMDATA");
# Line 491 | Line 491 | namespace OpenMD {
491      std::string rbName;
492      std::vector<Atom *> myAtoms;
493      std::vector<Atom *>::iterator atomIter;
494    GenericData* data;
495    AtomData* atomData;
496    AtomInfo* atomInfo;
494      std::vector<AtomInfo *>::iterator i;
495 +    AtomData* atomData;
496  
497      rbName = rb->getType();
498      
499      if (waterTypeList.find(rbName) != waterTypeList.end()) {
500        myAtoms = rb->getAtoms();
501 <
501 >      
502        for( atomIter = myAtoms.begin(); atomIter != myAtoms.end();
503             ++atomIter ) {
504 <        data = (*atomIter)->getPropertyByName("ATOMDATA");
504 >        GenericData* data = (*atomIter)->getPropertyByName("ATOMDATA");
505          
506          if (data != NULL) {
507            atomData = dynamic_cast<AtomData *>(data);
# Line 513 | Line 511 | namespace OpenMD {
511          } else
512            continue;
513          
514 <        for( atomInfo = atomData->beginAtomInfo(i); atomInfo;
514 >        for( AtomInfo* atomInfo = atomData->beginAtomInfo(i); atomInfo;
515               atomInfo = atomData->nextAtomInfo(i) ) {
516            atomInfo->atomTypeName = trimmedName(atomInfo->atomTypeName);
517 <        } //end for(atomInfo)
518 <      }     //end for(atomIter)
519 <    }         //end if (waterTypeList.find(rbName) != waterTypeList.end())
517 >        }
518 >      }  
519 >    }
520    }
521  
522    std::string WaterTypeVisitor::trimmedName(const std::string&atomTypeName) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines