Changeset 47d041 for src/Parser


Ignore:
Timestamp:
Nov 3, 2011, 7:44:01 PM (13 years ago)
Author:
Frederik Heber <heber@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
Children:
41a467
Parents:
50e4e5
git-author:
Frederik Heber <heber@…> (10/27/11 11:53:58)
git-committer:
Frederik Heber <heber@…> (11/03/11 19:44:01)
Message:

HUGE: Removed all calls to Log(), eLog(), replaced by LOG() and ELOG().

  • Replaced DoLog(.) && (Log() << Verbose(.) << ... << std::endl) by Log(., ...).
  • Replaced Log() << Verbose(.) << .. << by Log(., ...)
  • on multiline used stringstream to generate and message which was finally used in LOG(., output.str())
  • there should be no more occurence of Log(). LOG() and ELOG() must be used instead.
  • Eventually, this will allow for storing all errors and re-printing them on program exit which would be very helpful to ascertain error-free runs for the user.
Location:
src/Parser
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/ChangeTracker.cpp

    r50e4e5 r47d041  
    6363 */
    6464void ChangeTracker::saveStatus() {
    65   DoLog(0) && (Log() << Verbose(0) << "Saving changes." << std::endl);
     65  LOG(0, "Saving changes.");
    6666  if (hasChanged()) {
    6767    notifyAll();
  • src/Parser/FormatParserStorage.cpp

    r50e4e5 r47d041  
    183183{
    184184  if (ParserLookupNames.find(type) == ParserLookupNames.end()) {
    185     DoeLog(1) && (eLog() << Verbose(1) << "Unknown type " << type << "." << endl);
     185    ELOG(1, "Unknown type " << type << ".");
    186186    return ParserTypes_end;
    187187  } else
     
    192192{
    193193  if (ParserLookupSuffixes.find(type) == ParserLookupSuffixes.end()) {
    194     DoeLog(1) && (eLog() << Verbose(1) << "Unknown type " << type << "." << endl);
     194    ELOG(1, "Unknown type " << type << ".");
    195195    return ParserTypes_end;
    196196  } else
     
    201201{
    202202  if (ParserNames.find(type) == ParserNames.end()) {
    203     DoeLog(1) && (eLog() << Verbose(1) << "Unknown type " << type << "." << endl);
     203    ELOG(1, "Unknown type " << type << ".");
    204204    return unknownTypeString;
    205205  } else
     
    210210{
    211211  if (ParserSuffixes.find(type) == ParserSuffixes.end()) {
    212     DoeLog(1) && (eLog() << Verbose(1) << "Unknown type " << type << "." << endl);
     212    ELOG(1, "Unknown type " << type << ".");
    213213    return unknownTypeString;
    214214  } else
  • src/Parser/FormatParser_Parameters.cpp

    r50e4e5 r47d041  
    150150  std::string line;
    151151  std::getline( ist, line );
    152   //DoLog(0) && (Log() << Verbose(0) << "INFO: full line of parameters is '" << line << "'" << std::endl);
     152  //LOG(0, "INFO: full line of parameters is '" << line << "'");
    153153  tokenizer tokens(line, semicolonsep);
    154154  ASSERT(tokens.begin() != tokens.end(),
  • src/Parser/MpqcParser.cpp

    r50e4e5 r47d041  
    121121        newAtom->setPosition(X);
    122122        newmol->AddAtom(newAtom);
    123         DoLog(1) && (Log() << Verbose(1) << "Adding atom " << *newAtom << std::endl);
     123        LOG(1, "Adding atom " << *newAtom);
    124124      }
    125125    }
     
    156156          linestream >> getParams();
    157157        } else { // unknown keys are simply ignored as long as parser is incomplete
    158           DoLog(2) && (Log() << Verbose(2) << "INFO: '"+key+"' is unknown and ignored." << std::endl);
     158          LOG(2, "INFO: '"+key+"' is unknown and ignored.");
    159159        }
    160160      }
     
    233233  // first without hessian
    234234  if (file->fail()) {
    235     DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open mpqc output file." << endl);
     235    ELOG(1, "Cannot open mpqc output file.");
    236236  } else {
    237237    *file << "% Created by MoleCuilder" << endl;
     
    300300      *file << "\t)" << endl;
    301301    } else {
    302       DoeLog(0) && (eLog() << Verbose(0)
    303           << "Unknown level of theory requested for MPQC output file." << std::endl);
     302      ELOG(0, "Unknown level of theory requested for MPQC output file.");
    304303    }
    305304    *file << ")" << endl;
  • src/Parser/MpqcParser_Parameters.cpp

    r50e4e5 r47d041  
    185185bool MpqcParser_Parameters::checkWorldElementsAgainstCurrentBasis() const
    186186{
    187   DoeLog(0) && (eLog() << Verbose(0)
    188       << "MpqcParser_Parameters::checkWorldElementsAgainstCurrentBasis() - not implemented yet."
    189       << std::endl);
     187  ELOG(0, "MpqcParser_Parameters::checkWorldElementsAgainstCurrentBasis() - not implemented yet.");
    190188
    191189  return false;
  • src/Parser/PcpParser.cpp

    r50e4e5 r47d041  
    154154{
    155155  if (file->fail()) {
    156     DoeLog(1) && (eLog()<< Verbose(1) << "could not access given file" << endl);
     156    ELOG(1, "could not access given file");
    157157    return;
    158158  }
     
    175175  // 1. parse in options
    176176  if (!ParseForParameter(verbose,FileBuffer, "mainname", 0, 1, 1, string_type, (Paths.mainname), 1, critical)) {
    177     DoeLog(1) && (eLog()<< Verbose(1) << "mainname is missing, is file empty?" << endl);
     177    ELOG(1, "mainname is missing, is file empty?");
    178178  } else {
    179179    ParseForParameter(verbose,FileBuffer, "defaultpath", 0, 1, 1, string_type, (Paths.defaultpath), 1, critical);
     
    389389void FormatParser< pcp >::save(std::ostream* file, const std::vector<atom *> &atoms)
    390390{
    391   DoLog(0) && (Log() << Verbose(0) << "Saving changes to pcp." << std::endl);
     391  LOG(0, "Saving changes to pcp.");
    392392
    393393  const RealSpaceMatrix &domain = World::getInstance().getDomain().getM();
     
    486486    OutputAtoms(file, atoms, ZtoIndexMap);
    487487  } else {
    488     DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open output file." << endl);
     488    ELOG(1, "Cannot open output file.");
    489489  }
    490490}
     
    616616  } else {
    617617    if ((Thermostats->TargetTemp != 0))
    618       DoLog(2) && (Log() << Verbose(2) <<  "No thermostat chosen despite finite temperature MD, falling back to None." << endl);
     618      LOG(2,  "No thermostat chosen despite finite temperature MD, falling back to None.");
    619619    Thermostats->chooseNone();
    620620  }
  • src/Parser/PdbParser.cpp

    r50e4e5 r47d041  
    9393  string token;
    9494  if (location != string::npos) {
    95     //DoLog(1) && (Log() << Verbose(1) << "Found space at position " << space_location << std::endl);
     95    //LOG(1, "Found space at position " << space_location);
    9696    token = line.substr(0,space_location);
    9797  } else {
     
    9999  }
    100100
    101   //DoLog(1) && (Log() << Verbose(1) << "Token is " << token << std::endl);
     101  //LOG(1, "Token is " << token);
    102102  if (knownTokens.count(token) == 0)
    103103    return PdbKey::NoToken;
     
    155155          default:
    156156            // TODO: put a throw here
    157             DoeLog(2) && (eLog() << Verbose(2) << "Unknown token: '" << line << "' for time step " << step << "." << std::endl);
     157            ELOG(2, "Unknown token: '" << line << "' for time step " << step << ".");
    158158            //ASSERT(0, "FormatParser< pdb >::load() - Unknown token in line "+toString(linecount)+": "+line+".");
    159159            break;
     
    180180void FormatParser< pdb >::save(ostream* file, const std::vector<atom *> &AtomList)
    181181{
    182   DoLog(0) && (Log() << Verbose(0) << "Saving changes to pdb." << std::endl);
     182  LOG(0, "Saving changes to pdb.");
    183183
    184184  // check for maximum number of time steps
     
    479479{
    480480  pair<std::map<size_t,size_t>::iterator, bool > inserter;
    481 //  DoLog(1) && (Log() << Verbose(1) << "FormatParser< pdb >::setAtomId() - Inserting ("
    482 //      << localatomid << " -> " << atomid << ")." << std::endl);
     481//  LOG(1, "FormatParser< pdb >::setAtomId() - Inserting (" << localatomid << " -> " << atomid << ").");
    483482  inserter = atomIdMap.insert( make_pair(localatomid, atomid) );
    484483  ASSERT(inserter.second, "FormatParser< pdb >::setAtomId: atomId already present in Map.");
     
    623622//    SerialSet.insert(id);
    624623//    atomInfo.set(PdbKey::serial, toString(id));
    625 //    DoeLog(2) && (eLog() << Verbose(2)
    626 //        << "Serial " << atomInfo.get<std::string>(PdbKey::serial) << " already present, "
    627 //        << "assigning " << toString(id) << " instead." << std::endl);
     624//    ELOG(2, "Serial " << atomInfo.get<std::string>(PdbKey::serial) << " already present, "
     625//        << "assigning " << toString(id) << " instead.");
    628626//  }
    629627
    630628  // check whether serial exists, if so, assign next available
    631629
    632 //  DoLog(2) && (Log() << Verbose(2) << "Split line:"
     630//  LOG(2, "Split line:"
    633631//      << line.substr(6,5) << "|"
    634632//      << line.substr(12,4) << "|"
     
    644642//      << line.substr(60,6) << "|"
    645643//      << line.substr(76,2) << "|"
    646 //      << line.substr(78,2) << std::endl);
     644//      << line.substr(78,2));
    647645
    648646  if (FirstTimestep) {
     
    746744  const PdbAtomInfoContainer &atomInfo = additionalAtomData.at(newAtom->getId()); // operator[] const does not exist
    747745
    748   DoLog(1) && (Log() << Verbose(1) << "We know about atom " << newAtom->getId() << ":" << std::endl);
    749   DoLog(1) && (Log() << Verbose(1) << "\ttoken is " << atomInfo.get<std::string>(PdbKey::token) << std::endl);
    750   DoLog(1) && (Log() << Verbose(1) << "\tserial is " << atomInfo.get<int>(PdbKey::serial) << std::endl);
    751   DoLog(1) && (Log() << Verbose(1) << "\tname is " << atomInfo.get<std::string>(PdbKey::name) << std::endl);
    752   DoLog(1) && (Log() << Verbose(1) << "\taltLoc is " << atomInfo.get<std::string>(PdbKey::altLoc) << std::endl);
    753   DoLog(1) && (Log() << Verbose(1) << "\tresName is " << atomInfo.get<std::string>(PdbKey::resName) << std::endl);
    754   DoLog(1) && (Log() << Verbose(1) << "\tchainID is " << atomInfo.get<std::string>(PdbKey::chainID) << std::endl);
    755   DoLog(1) && (Log() << Verbose(1) << "\tresSeq is " << atomInfo.get<int>(PdbKey::resSeq) << std::endl);
    756   DoLog(1) && (Log() << Verbose(1) << "\tiCode is " << atomInfo.get<std::string>(PdbKey::iCode) << std::endl);
    757   DoLog(1) && (Log() << Verbose(1) << "\tX is " << atomInfo.get<double>(PdbKey::X) << std::endl);
    758   DoLog(1) && (Log() << Verbose(1) << "\tY is " << atomInfo.get<double>(PdbKey::Y) << std::endl);
    759   DoLog(1) && (Log() << Verbose(1) << "\tZ is " << atomInfo.get<double>(PdbKey::Z) << std::endl);
    760   DoLog(1) && (Log() << Verbose(1) << "\toccupancy is " << atomInfo.get<double>(PdbKey::occupancy) << std::endl);
    761   DoLog(1) && (Log() << Verbose(1) << "\ttempFactor is " << atomInfo.get<double>(PdbKey::tempFactor) << std::endl);
    762   DoLog(1) && (Log() << Verbose(1) << "\telement is '" << *(newAtom->getType()) << "'" << std::endl);
    763   DoLog(1) && (Log() << Verbose(1) << "\tcharge is " << atomInfo.get<int>(PdbKey::charge) << std::endl);
     746  LOG(1, "We know about atom " << newAtom->getId() << ":");
     747  LOG(1, "\ttoken is " << atomInfo.get<std::string>(PdbKey::token));
     748  LOG(1, "\tserial is " << atomInfo.get<int>(PdbKey::serial));
     749  LOG(1, "\tname is " << atomInfo.get<std::string>(PdbKey::name));
     750  LOG(1, "\taltLoc is " << atomInfo.get<std::string>(PdbKey::altLoc));
     751  LOG(1, "\tresName is " << atomInfo.get<std::string>(PdbKey::resName));
     752  LOG(1, "\tchainID is " << atomInfo.get<std::string>(PdbKey::chainID));
     753  LOG(1, "\tresSeq is " << atomInfo.get<int>(PdbKey::resSeq));
     754  LOG(1, "\tiCode is " << atomInfo.get<std::string>(PdbKey::iCode));
     755  LOG(1, "\tX is " << atomInfo.get<double>(PdbKey::X));
     756  LOG(1, "\tY is " << atomInfo.get<double>(PdbKey::Y));
     757  LOG(1, "\tZ is " << atomInfo.get<double>(PdbKey::Z));
     758  LOG(1, "\toccupancy is " << atomInfo.get<double>(PdbKey::occupancy));
     759  LOG(1, "\ttempFactor is " << atomInfo.get<double>(PdbKey::tempFactor));
     760  LOG(1, "\telement is '" << *(newAtom->getType()) << "'");
     761  LOG(1, "\tcharge is " << atomInfo.get<int>(PdbKey::charge));
    764762}
    765763
     
    855853
    856854      status = status && (atomInfo.get<std::string>(PdbKey::serial) == OtheratomInfo.get<std::string>(PdbKey::serial));
    857       if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in serials!" << std::endl);
     855      if (!status) ELOG(1, "Mismatch in serials!");
    858856      status = status && (atomInfo.get<std::string>(PdbKey::name) == OtheratomInfo.get<std::string>(PdbKey::name));
    859       if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in names!" << std::endl);
     857      if (!status) ELOG(1, "Mismatch in names!");
    860858      status = status && (atomInfo.get<std::string>(PdbKey::altLoc) == OtheratomInfo.get<std::string>(PdbKey::altLoc));
    861       if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in altLocs!" << std::endl);
     859      if (!status) ELOG(1, "Mismatch in altLocs!");
    862860      status = status && (atomInfo.get<std::string>(PdbKey::resName) == OtheratomInfo.get<std::string>(PdbKey::resName));
    863       if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in resNames!" << std::endl);
     861      if (!status) ELOG(1, "Mismatch in resNames!");
    864862      status = status && (atomInfo.get<std::string>(PdbKey::chainID) == OtheratomInfo.get<std::string>(PdbKey::chainID));
    865       if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in chainIDs!" << std::endl);
     863      if (!status) ELOG(1, "Mismatch in chainIDs!");
    866864      status = status && (atomInfo.get<std::string>(PdbKey::resSeq) == OtheratomInfo.get<std::string>(PdbKey::resSeq));
    867       if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in resSeqs!" << std::endl);
     865      if (!status) ELOG(1, "Mismatch in resSeqs!");
    868866      status = status && (atomInfo.get<std::string>(PdbKey::iCode) == OtheratomInfo.get<std::string>(PdbKey::iCode));
    869       if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in iCodes!" << std::endl);
     867      if (!status) ELOG(1, "Mismatch in iCodes!");
    870868      status = status && (atomInfo.get<std::string>(PdbKey::occupancy) == OtheratomInfo.get<std::string>(PdbKey::occupancy));
    871       if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in occupancies!" << std::endl);
     869      if (!status) ELOG(1, "Mismatch in occupancies!");
    872870      status = status && (atomInfo.get<std::string>(PdbKey::tempFactor) == OtheratomInfo.get<std::string>(PdbKey::tempFactor));
    873       if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in tempFactors!" << std::endl);
     871      if (!status) ELOG(1, "Mismatch in tempFactors!");
    874872      status = status && (atomInfo.get<std::string>(PdbKey::charge) == OtheratomInfo.get<std::string>(PdbKey::charge));
    875       if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in charges!" << std::endl);
     873      if (!status) ELOG(1, "Mismatch in charges!");
    876874    }
    877875  }
  • src/Parser/Psi3Parser.cpp

    r50e4e5 r47d041  
    121121      newAtom->setPosition(X);
    122122      newmol->AddAtom(newAtom);
    123       DoLog(1) && (Log() << Verbose(1) << "Adding atom " << *newAtom << std::endl);
     123      LOG(1, "Adding atom " << *newAtom);
    124124    }
    125125    if ((Psi3Section) && (!GeometrySection)) {
     
    171171  // first without hessian
    172172  if (file->fail()) {
    173     DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open psi3 output file." << std::endl);
     173    ELOG(1, "Cannot open psi3 output file.");
    174174  } else {
    175175    *file << "% Created by MoleCuilder" << std::endl;
     
    214214        && (reference != getParams().getReferenceName(Psi3Parser_Parameters::TWOCON)))
    215215    {
    216       DoeLog(0) && (eLog() << Verbose(0)
    217           << "Unknown level of reference requested for Psi3 output file." << std::endl);
     216      ELOG(0, "Unknown level of reference requested for Psi3 output file.");
    218217    }
    219218    *file << "\t" << getParams().getParameterName(Psi3Parser_Parameters::freeze_coreParam)
  • src/Parser/Psi3Parser_Parameters.cpp

    r50e4e5 r47d041  
    269269bool Psi3Parser_Parameters::checkWorldElementsAgainstCurrentBasis() const
    270270{
    271   DoeLog(0) && (eLog() << Verbose(0)
    272       << "Psi3Parser_Parameters::checkWorldElementsAgainstCurrentBasis() - not implemented yet."
    273       << std::endl);
     271  ELOG(0, "Psi3Parser_Parameters::checkWorldElementsAgainstCurrentBasis() - not implemented yet.");
    274272
    275273  return false;
  • src/Parser/TremoloParser.cpp

    r50e4e5 r47d041  
    140140  newmol->getAtomCount();
    141141
    142   DoLog(3) && (Log() << Verbose(3) << "usedFields after load contains: " << usedFields << std::endl);
     142  LOG(3, "usedFields after load contains: " << usedFields);
    143143
    144144  processNeighborInformation();
     
    154154 */
    155155void FormatParser< tremolo >::save(ostream* file, const std::vector<atom *> &AtomList) {
    156   DoLog(0) && (Log() << Verbose(0) << "Saving changes to tremolo." << std::endl);
     156  LOG(0, "Saving changes to tremolo.");
    157157
    158158  vector<atom*>::const_iterator atomIt;
     
    161161
    162162
    163   DoLog(3) && (Log() << Verbose(3) << "usedFields before save contains: " << usedFields << std::endl);
    164 
    165   DoLog(3) && (Log() << Verbose(3) << "additionalAtomData contains: " << additionalAtomData << std::endl);
    166 
    167   DoLog(3) && (Log() << Verbose(3) << "additionalAtomData contains: " << additionalAtomData << std::endl);
     163  LOG(3, "usedFields before save contains: " << usedFields);
     164
     165  LOG(3, "additionalAtomData contains: " << additionalAtomData);
     166
     167  LOG(3, "additionalAtomData contains: " << additionalAtomData);
    168168
    169169  *file << "# ATOMDATA";
     
    231231  TremoloKey::atomDataKey currentField;
    232232
    233   DoLog(4) && (Log() << Verbose(4) << "INFO: Saving atom " << *currentAtom << ", its father id is " << currentAtom->GetTrueFather()->getId() << std::endl);
     233  LOG(4, "INFO: Saving atom " << *currentAtom << ", its father id is " << currentAtom->GetTrueFather()->getId());
    234234
    235235  for (it = usedFields.begin(); it != usedFields.end(); it++) {
     
    238238      case TremoloKey::x :
    239239        // for the moment, assume there are always three dimensions
    240         DoLog(3) && (Log() << Verbose(3) << "Writing for type " << knownKeyNames[currentField] << ": " << currentAtom->getPosition() << std::endl);
     240        LOG(3, "Writing for type " << knownKeyNames[currentField] << ": " << currentAtom->getPosition());
    241241        *file << currentAtom->at(0) << "\t";
    242242        *file << currentAtom->at(1) << "\t";
     
    245245      case TremoloKey::u :
    246246        // for the moment, assume there are always three dimensions
    247         DoLog(3) && (Log() << Verbose(3) << "Writing for type " << knownKeyNames[currentField] << ": " << currentAtom->getAtomicVelocity() << std::endl);
     247        LOG(3, "Writing for type " << knownKeyNames[currentField] << ": " << currentAtom->getAtomicVelocity());
    248248        *file << currentAtom->getAtomicVelocity()[0] << "\t";
    249249        *file << currentAtom->getAtomicVelocity()[1] << "\t";
     
    253253        if (additionalAtomData.count(currentAtom->getId())) {
    254254          if (additionalAtomData[currentAtom->getId()].get(currentField) != "-") {
    255             DoLog(3) && (Log() << Verbose(3) << "Writing for type " << knownKeyNames[currentField] << ": " << additionalAtomData[currentAtom->getId()].get(currentField) << std::endl);
     255            LOG(3, "Writing for type " << knownKeyNames[currentField] << ": " << additionalAtomData[currentAtom->getId()].get(currentField));
    256256            *file << additionalAtomData[currentAtom->getId()].get(currentField) << "\t";
    257257          } else {
    258             DoLog(3) && (Log() << Verbose(3) << "Writing for type " << knownKeyNames[currentField] << " default value: " << currentAtom->getType()->getSymbol() << std::endl);
     258            LOG(3, "Writing for type " << knownKeyNames[currentField] << " default value: " << currentAtom->getType()->getSymbol());
    259259            *file << currentAtom->getType()->getSymbol() << "\t";
    260260          }
    261261        } else if (additionalAtomData.count(currentAtom->GetTrueFather()->getId())) {
    262262          if (additionalAtomData[currentAtom->GetTrueFather()->getId()].get(currentField) != "-") {
    263             DoLog(3) && (Log() << Verbose(3) << "Writing for type " << knownKeyNames[currentField] << " stuff from father: " << additionalAtomData[currentAtom->GetTrueFather()->getId()].get(currentField) << std::endl);
     263            LOG(3, "Writing for type " << knownKeyNames[currentField] << " stuff from father: " << additionalAtomData[currentAtom->GetTrueFather()->getId()].get(currentField));
    264264            *file << additionalAtomData[currentAtom->GetTrueFather()->getId()].get(currentField) << "\t";
    265265          } else {
    266             DoLog(3) && (Log() << Verbose(3) << "Writing for type " << knownKeyNames[currentField] << " default value from father: " << currentAtom->GetTrueFather()->getType()->getSymbol() << std::endl);
     266            LOG(3, "Writing for type " << knownKeyNames[currentField] << " default value from father: " << currentAtom->GetTrueFather()->getType()->getSymbol());
    267267            *file << currentAtom->GetTrueFather()->getType()->getSymbol() << "\t";
    268268          }
    269269        } else {
    270           DoLog(3) && (Log() << Verbose(3) << "Writing for type " << knownKeyNames[currentField] << " its default value: " << currentAtom->getType()->getSymbol() << std::endl);
     270          LOG(3, "Writing for type " << knownKeyNames[currentField] << " its default value: " << currentAtom->getType()->getSymbol());
    271271          *file << currentAtom->getType()->getSymbol() << "\t";
    272272        }
    273273        break;
    274274      case TremoloKey::Id :
    275         DoLog(3) && (Log() << Verbose(3) << "Writing for type " << knownKeyNames[currentField] << ": " << currentAtom->getId()+1 << std::endl);
     275        LOG(3, "Writing for type " << knownKeyNames[currentField] << ": " << currentAtom->getId()+1);
    276276        *file << currentAtom->getId()+1 << "\t";
    277277        break;
    278278      case TremoloKey::neighbors :
    279         DoLog(3) && (Log() << Verbose(3) << "Writing type " << knownKeyNames[currentField] << std::endl);
     279        LOG(3, "Writing type " << knownKeyNames[currentField]);
    280280        writeNeighbors(file, atoi(it->substr(it->find("=") + 1, 1).c_str()), currentAtom);
    281281        break;
    282282      case TremoloKey::resSeq :
    283283        if (additionalAtomData.count(currentAtom->getId())) {
    284           DoLog(3) && (Log() << Verbose(3) << "Writing for type " << knownKeyNames[currentField] << ": " << additionalAtomData[currentAtom->getId()].get(currentField) << std::endl);
     284          LOG(3, "Writing for type " << knownKeyNames[currentField] << ": " << additionalAtomData[currentAtom->getId()].get(currentField));
    285285          *file << additionalAtomData[currentAtom->getId()].get(currentField);
    286286        } else if (currentAtom->getMolecule() != NULL) {
    287           DoLog(3) && (Log() << Verbose(3) << "Writing for type " << knownKeyNames[currentField] << " its own id: " << currentAtom->getMolecule()->getId()+1 << std::endl);
     287          LOG(3, "Writing for type " << knownKeyNames[currentField] << " its own id: " << currentAtom->getMolecule()->getId()+1);
    288288          *file << setw(4) << currentAtom->getMolecule()->getId()+1;
    289289        } else {
    290           DoLog(3) && (Log() << Verbose(3) << "Writing for type " << knownKeyNames[currentField] << " default value: " << defaultAdditionalData.get(currentField) << std::endl);
     290          LOG(3, "Writing for type " << knownKeyNames[currentField] << " default value: " << defaultAdditionalData.get(currentField));
    291291          *file << defaultAdditionalData.get(currentField);
    292292        }
     
    295295      default :
    296296        if (additionalAtomData.count(currentAtom->getId())) {
    297           DoLog(3) && (Log() << Verbose(3) << "Writing for type " << knownKeyNames[currentField] << ": " << additionalAtomData[currentAtom->getId()].get(currentField) << std::endl);
     297          LOG(3, "Writing for type " << knownKeyNames[currentField] << ": " << additionalAtomData[currentAtom->getId()].get(currentField));
    298298          *file << additionalAtomData[currentAtom->getId()].get(currentField);
    299299        } else if (additionalAtomData.count(currentAtom->GetTrueFather()->getId())) {
    300           DoLog(3) && (Log() << Verbose(3) << "Writing for type " << knownKeyNames[currentField] << " stuff from father: " << additionalAtomData[currentAtom->GetTrueFather()->getId()].get(currentField) << std::endl);
     300          LOG(3, "Writing for type " << knownKeyNames[currentField] << " stuff from father: " << additionalAtomData[currentAtom->GetTrueFather()->getId()].get(currentField));
    301301          *file << additionalAtomData[currentAtom->GetTrueFather()->getId()].get(currentField);
    302302        } else {
    303           DoLog(3) && (Log() << Verbose(3) << "Writing for type " << knownKeyNames[currentField] << " the default: " << defaultAdditionalData.get(currentField) << std::endl);
     303          LOG(3, "Writing for type " << knownKeyNames[currentField] << " the default: " << defaultAdditionalData.get(currentField));
    304304          *file << defaultAdditionalData.get(currentField);
    305305        }
     
    360360    usedFields.push_back(keyword);
    361361  }
    362   //DoLog(1) && (Log() << Verbose(1) << "INFO: " << usedFields << std::endl);
     362  //LOG(1, "INFO: " << usedFields);
    363363}
    364364
     
    409409    currentField = knownKeys[keyName];
    410410    const string word = *tok_iter;
    411     DoLog(4) && (Log() << Verbose(4) << "INFO: Parsing key " << keyName << " with remaining data " << word << std::endl);
     411    LOG(4, "INFO: Parsing key " << keyName << " with remaining data " << word);
    412412    switch (currentField) {
    413413      case TremoloKey::x :
     
    415415        for (int i=0;i<NDIM;i++) {
    416416          ASSERT(tok_iter != tokens.end(), "FormatParser< tremolo >::readAtomDataLine() - no value for x["+toString(i)+"]!");
    417           DoLog(4) && (Log() << Verbose(4) << "INFO: Parsing key " << keyName << " with next token " << *tok_iter << std::endl);
     417          LOG(4, "INFO: Parsing key " << keyName << " with next token " << *tok_iter);
    418418          newAtom->set(i, toDouble(*tok_iter));
    419419          tok_iter++;
     
    424424        for (int i=0;i<NDIM;i++) {
    425425          ASSERT(tok_iter != tokens.end(), "FormatParser< tremolo >::readAtomDataLine() - no value for u["+toString(i)+"]!");
    426           DoLog(4) && (Log() << Verbose(4) << "INFO: Parsing key " << keyName << " with next token " << *tok_iter << std::endl);
     426          LOG(4, "INFO: Parsing key " << keyName << " with next token " << *tok_iter);
    427427          tempVector[i] = toDouble(*tok_iter);
    428428          tok_iter++;
     
    433433      {
    434434        ASSERT(tok_iter != tokens.end(), "FormatParser< tremolo >::readAtomDataLine() - no value for "+keyName+"!");
    435         DoLog(4) && (Log() << Verbose(4) << "INFO: Parsing key " << keyName << " with next token " << *tok_iter << std::endl);
     435        LOG(4, "INFO: Parsing key " << keyName << " with next token " << *tok_iter);
    436436        std::string element(knownTypes[(*tok_iter)]);
    437437        // put type name into container for later use
    438438        atomInfo->set(currentField, *tok_iter);
    439         DoLog(4) && (Log() << Verbose(4) << "INFO: Parsing element " << (*tok_iter) << " as " << element << " according to KnownTypes." << std::endl);
     439        LOG(4, "INFO: Parsing element " << (*tok_iter) << " as " << element << " according to KnownTypes.");
    440440        tok_iter++;
    441441        newAtom->setType(World::getInstance().getPeriode()->FindElement(element));
     
    445445      case TremoloKey::Id :
    446446        ASSERT(tok_iter != tokens.end(), "FormatParser< tremolo >::readAtomDataLine() - no value for "+keyName+"!");
    447         DoLog(4) && (Log() << Verbose(4) << "INFO: Parsing key " << keyName << " with next token " << *tok_iter << std::endl);
     447        LOG(4, "INFO: Parsing key " << keyName << " with next token " << *tok_iter);
    448448        atomIdMap[toInt(*tok_iter)] = newAtom->getId();
    449449        tok_iter++;
     
    452452        for (int i=0;i<atoi(it->substr(it->find("=") + 1, 1).c_str());i++) {
    453453          ASSERT(tok_iter != tokens.end(), "FormatParser< tremolo >::readAtomDataLine() - no value for "+keyName+"!");
    454           DoLog(4) && (Log() << Verbose(4) << "INFO: Parsing key " << keyName << " with next token " << *tok_iter << std::endl);
     454          LOG(4, "INFO: Parsing key " << keyName << " with next token " << *tok_iter);
    455455          lineStream << *tok_iter << "\t";
    456456          tok_iter++;
     
    461461      default :
    462462        ASSERT(tok_iter != tokens.end(), "FormatParser< tremolo >::readAtomDataLine() - no value for "+keyName+"!");
    463         DoLog(4) && (Log() << Verbose(4) << "INFO: Parsing key " << keyName << " with next token " << *tok_iter << std::endl);
     463        LOG(4, "INFO: Parsing key " << keyName << " with next token " << *tok_iter);
    464464        atomInfo->set(currentField, *tok_iter);
    465465        tok_iter++;
     
    468468  }
    469469  if (newmol != NULL) {
    470     //DoLog(0) && (Log() << Verbose(0) << "New Atom: " << *newAtom << " with type " << newAtom->getType()->getName() << std::endl);
     470    //LOG(0, "New Atom: " << *newAtom << " with type " << newAtom->getType()->getName());
    471471    newmol->AddAtom(newAtom);
    472472  }
     
    486486    // 0 is used to fill empty neighbor positions in the tremolo file.
    487487    if (neighborId > 0) {
    488       DoLog(4) && (Log() << Verbose(4)
    489           << "Atom with global id " << atomId
    490           << " has neighbour with serial " << neighborId
    491           << std::endl);
     488      LOG(4, "INFO: Atom with global id " << atomId
     489          << " has neighbour with serial " << neighborId);
    492490      additionalAtomData[atomId].neighbors.push_back(neighborId);
    493491    }
     
    530528        neighbor != currentInfo->second.neighbors.end(); neighbor++
    531529      ) {
    532 //        DoLog(1) && (Log() << Verbose(1) << "Creating bond between ("
     530//        LOG(1, "INFO: Creating bond between ("
    533531//            << currentInfo->first
    534532//            << ") and ("
    535 //            << atomIdMap[*neighbor] << "|" << *neighbor << ")" << std::endl);
     533//            << atomIdMap[*neighbor] << "|" << *neighbor << ")");
    536534        World::getInstance().getAtom(AtomById(currentInfo->first))
    537535            ->addBond(WorldTime::getTime(), World::getInstance().getAtom(AtomById(atomIdMap[*neighbor])));
     
    630628  knownTypes.clear();
    631629
    632   DoLog(3) && (Log() << Verbose(3) << "additionalAtomData contains: " << additionalAtomData << std::endl);
     630  LOG(3, "additionalAtomData contains: " << additionalAtomData);
    633631
    634632  // parse in file
     
    640638  while (file.good()) {
    641639    std::getline( file, line );
    642     DoLog(4) && (Log() << Verbose(4) << "INFO: full line of parameters is '" << line << "'" << std::endl);
     640    LOG(4, "INFO: full line of parameters is '" << line << "'");
    643641    if (line.find("particle:") != string::npos) {
    644       DoLog(3) && (Log() << Verbose(3) << "INFO: found line '" << line << "' containing keyword 'particle:'." << std::endl);
     642      LOG(3, "INFO: found line '" << line << "' containing keyword 'particle:'.");
    645643      tokenizer tokens(line, tokensep);
    646644      ASSERT(tokens.begin() != tokens.end(),
     
    653651          ++tok_iter) {
    654652        if ((*tok_iter).find("particle_type") != string::npos) {
    655           DoLog(3) && (Log() << Verbose(3) << "INFO: found line '" << line << "' containing keyword 'particle_type'." << std::endl);
     653          LOG(3, "INFO: found line '" << line << "' containing keyword 'particle_type'.");
    656654          tokenizer token((*tok_iter), equalitysep);
    657655          ASSERT(token.begin() != token.end(),
     
    662660        }
    663661        if ((*tok_iter).find("element_name") != string::npos) {
    664           DoLog(3) && (Log() << Verbose(3) << "INFO: found line '" << line << "' containing keyword 'element_name'." << std::endl);
     662          LOG(3, "INFO: found line '" << line << "' containing keyword 'element_name'.");
    665663          tokenizer token((*tok_iter), equalitysep);
    666664          ASSERT(token.begin() != token.end(),
     
    673671      if ((particle_type != "NULL") && (element_type != "NULL")) {
    674672        if (periode->FindElement(element_type) != NULL) {
    675           DoLog(1) && (Log() << Verbose(1) << "INFO: Added Type " << particle_type << " as reference to element " << element_type << "." << std::endl);
     673          LOG(1, "INFO: Added Type " << particle_type << " as reference to element " << element_type << ".");
    676674          knownTypes.insert( make_pair (particle_type, element_type) );
    677675        } else {
    678           DoeLog(1) && (Log() << Verbose(1) << "INFO: Either Type " << particle_type << " or " << element_type << " could not be recognized." << std::endl);
     676          ELOG(1, "INFO: Either Type " << particle_type << " or " << element_type << " could not be recognized." );
    679677        }
    680678      } else {
    681         DoeLog(1) && (Log() << Verbose(1) << "INFO: Desired element " << element_type << " is not known." << std::endl);
     679        ELOG(1, "INFO: Desired element " << element_type << " is not known." );
    682680      }
    683681    }
  • src/Parser/XyzParser.cpp

    r50e4e5 r47d041  
    139139 */
    140140void FormatParser< xyz >::save(ostream* file, const std::vector<atom *> &atoms) {
    141   DoLog(0) && (Log() << Verbose(0) << "Saving changes to xyz." << std::endl);
     141  LOG(0, "Saving changes to xyz.");
    142142
    143143  // get max and min trajectories
Note: See TracChangeset for help on using the changeset viewer.