Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/TremoloParser.cpp

    rf9b967 rd103d3  
    100100FormatParser< tremolo >::~FormatParser()
    101101{
    102   LOG(1, "INFO: Clearing usedFields.");
     102  std::cerr << "Clearing usedFields." << std::endl;
    103103  usedFields.clear();
    104104  additionalAtomData.clear();
     
    118118  // reset atomIdMap, for we now get new serials
    119119  atomIdMap.clear();
    120   LOG(1, "INFO: Clearing usedFields.");
     120        std::cerr << "Clearing usedFields." << std::endl;
    121121  usedFields.clear();
    122122
     
    225225 */
    226226void FormatParser< tremolo >::saveLine(ostream* file, atom* currentAtom) {
    227   vector<string>::iterator it;
     227  //vector<string>::iterator it;
     228  // TODO: Is unique for FormatParser< tremolo >::usedFields still required?
     229  vector<string>::iterator it = unique(usedFields.begin(), usedFields.end()); // skips all duplicates in the vector
    228230
    229231  TremoloKey::atomDataKey currentField;
     
    347349
    348350  lineStream << line.substr(offset);
    349   LOG(1, "INFO: Clearing usedFields in parseAtomDataKeysLine.");
     351        std::cerr << "Clearing usedFields in parseAtomDataKeysLine." << std::endl;
    350352  usedFields.clear();
    351353  while (lineStream.good()) {
     
    386388  stringstream lineStream;
    387389  atom* newAtom = World::getInstance().createAtom();
    388   const atomId_t atomid = newAtom->getId();
    389   additionalAtomData[atomid] = TremoloAtomInfoContainer(); // fill with default values
    390   TremoloAtomInfoContainer *atomInfo = &additionalAtomData[atomid];
     390  TremoloAtomInfoContainer *atomInfo = NULL;
     391  additionalAtomData[newAtom->getId()] = TremoloAtomInfoContainer(); // fill with default values
     392  atomInfo = &additionalAtomData[newAtom->getId()];
    391393  TremoloKey::atomDataKey currentField;
    392394  ConvertTo<double> toDouble;
     
    444446        ASSERT(tok_iter != tokens.end(), "FormatParser< tremolo >::readAtomDataLine() - no value for "+keyName+"!");
    445447        LOG(4, "INFO: Parsing key " << keyName << " with next token " << *tok_iter);
    446         atomIdMap[toInt(*tok_iter)] = atomid;
     448        atomIdMap[toInt(*tok_iter)] = newAtom->getId();
    447449        tok_iter++;
    448450        break;
     
    455457        }
    456458        readNeighbors(&lineStream,
    457             atoi(it->substr(it->find("=") + 1, 1).c_str()), atomid);
     459            atoi(it->substr(it->find("=") + 1, 1).c_str()), newAtom->getId());
    458460        break;
    459461      default :
     
    465467    }
    466468  }
    467   LOG(3, "INFO: Parsed atom " << atomid << ".");
    468   if (newmol != NULL)
     469  if (newmol != NULL) {
     470    //LOG(0, "New Atom: " << *newAtom << " with type " << newAtom->getType()->getName());
    469471    newmol->AddAtom(newAtom);
     472  }
    470473}
    471474
     
    648651          ++tok_iter) {
    649652        if ((*tok_iter).find("particle_type") != string::npos) {
    650           LOG(3, "INFO: found token '" << *tok_iter << "' containing keyword 'particle_type'.");
     653          LOG(3, "INFO: found line '" << line << "' containing keyword 'particle_type'.");
    651654          tokenizer token((*tok_iter), equalitysep);
    652655          ASSERT(token.begin() != token.end(),
     
    657660        }
    658661        if ((*tok_iter).find("element_name") != string::npos) {
    659           LOG(3, "INFO: found token '" << *tok_iter << "' containing keyword 'element_name'.");
     662          LOG(3, "INFO: found line '" << line << "' containing keyword 'element_name'.");
    660663          tokenizer token((*tok_iter), equalitysep);
    661664          ASSERT(token.begin() != token.end(),
     
    674677        }
    675678      } else {
    676         ELOG(3, "Line does not contain both 'particle_type' and 'element_name' as keys." );
     679        ELOG(1, "INFO: Desired element " << element_type << " is not known." );
    677680      }
    678681    }
Note: See TracChangeset for help on using the changeset viewer.