Ignore:
Timestamp:
Nov 3, 2011, 7:44:01 PM (14 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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/molecule_graph.cpp

    r50e4e5 r47d041  
    5757  int AtomNo;
    5858
    59   DoLog(1) && (Log() << Verbose(1) << "Begin of FillBondStructureFromReference." << endl);
     59  LOG(1, "Begin of FillBondStructureFromReference.");
    6060  // fill ListOfLocalAtoms if NULL was given
    6161  if (!FillListOfLocalAtoms(ListOfLocalAtoms, reference->getAtomCount())) {
    62     DoLog(1) && (Log() << Verbose(1) << "Filling of ListOfLocalAtoms failed." << endl);
     62    LOG(1, "Filling of ListOfLocalAtoms failed.");
    6363    return false;
    6464  }
    6565
    6666  if (status) {
    67     DoLog(1) && (Log() << Verbose(1) << "Creating adjacency list for molecule " << getName() << "." << endl);
     67    LOG(1, "Creating adjacency list for molecule " << getName() << ".");
    6868    // remove every bond from the list
    6969    for_each(begin(), end(),
     
    8383            AddBond((*iter), OtherWalker, (*Runner)->BondDegree);
    8484        } else {
    85           DoLog(1) && (Log() << Verbose(1) << "OtherWalker = ListOfLocalAtoms[" << (*Runner)->GetOtherAtom((*iter)->GetTrueFather())->getNr() << "] is NULL!" << endl);
     85          LOG(1, "OtherWalker = ListOfLocalAtoms[" << (*Runner)->GetOtherAtom((*iter)->GetTrueFather())->getNr() << "] is NULL!");
    8686          status = false;
    8787        }
     
    9494    delete[](ListOfLocalAtoms);
    9595  }
    96   DoLog(1) && (Log() << Verbose(1) << "End of FillBondStructureFromReference." << endl);
     96  LOG(1, "End of FillBondStructureFromReference.");
    9797  return status;
    9898};
     
    117117void molecule::OutputBondsList() const
    118118{
    119   DoLog(1) && (Log() << Verbose(1) << endl << "From contents of bond chain list:");
    120   for(molecule::const_iterator AtomRunner = molecule::begin(); AtomRunner != molecule::end(); ++AtomRunner) {
    121     const BondList& ListOfBonds = (*AtomRunner)->getListOfBonds();
    122     for(BondList::const_iterator BondRunner = ListOfBonds.begin();
    123         BondRunner != ListOfBonds.end();
    124         ++BondRunner)
    125       if ((*BondRunner)->leftatom == *AtomRunner) {
    126         DoLog(0) && (Log() << Verbose(0) << *(*BondRunner) << "\t" << endl);
    127       }
    128   }
    129   DoLog(0) && (Log() << Verbose(0) << endl);
    130 }
    131 ;
     119  if (DoLog(1)) {
     120    std::stringstream output;
     121    output << std::endl << "From contents of bond chain list:";
     122    for(molecule::const_iterator AtomRunner = molecule::begin(); AtomRunner != molecule::end(); ++AtomRunner) {
     123      const BondList& ListOfBonds = (*AtomRunner)->getListOfBonds();
     124      for(BondList::const_iterator BondRunner = ListOfBonds.begin();
     125          BondRunner != ListOfBonds.end();
     126          ++BondRunner)
     127        if ((*BondRunner)->leftatom == *AtomRunner) {
     128          output << *(*BondRunner) << "\t";
     129        }
     130    }
     131    LOG(1, output.str());
     132  }
     133}
    132134
    133135
     
    149151    line = filename;
    150152  AdjacencyFile.open(line.c_str(), ios::out);
    151   DoLog(1) && (Log() << Verbose(1) << "Saving adjacency list ... " << endl);
     153  LOG(1, "Saving adjacency list ... ");
    152154  if (AdjacencyFile.good()) {
    153155    AdjacencyFile << "m\tn" << endl;
    154156    for_each(atoms.begin(),atoms.end(),bind2nd(mem_fun(&atom::OutputAdjacency),&AdjacencyFile));
    155157    AdjacencyFile.close();
    156     DoLog(1) && (Log() << Verbose(1) << "\t... done." << endl);
     158    LOG(1, "\t... done.");
    157159  } else {
    158     DoLog(1) && (Log() << Verbose(1) << "\t... failed to open file " << line << "." << endl);
     160    LOG(1, "\t... failed to open file " << line << ".");
    159161    status = false;
    160162  }
     
    181183    line = filename;
    182184  BondFile.open(line.c_str(), ios::out);
    183   DoLog(1) && (Log() << Verbose(1) << "Saving adjacency list ... " << endl);
     185  LOG(1, "Saving adjacency list ... ");
    184186  if (BondFile.good()) {
    185187    BondFile << "m\tn" << endl;
    186188    for_each(atoms.begin(),atoms.end(),bind2nd(mem_fun(&atom::OutputBonds),&BondFile));
    187189    BondFile.close();
    188     DoLog(1) && (Log() << Verbose(1) << "\t... done." << endl);
     190    LOG(1, "\t... done.");
    189191  } else {
    190     DoLog(1) && (Log() << Verbose(1) << "\t... failed to open file " << line << "." << endl);
     192    LOG(1, "\t... failed to open file " << line << ".");
    191193    status = false;
    192194  }
     
    242244
    243245  if (LookupTable != NULL) {
    244     Log() << Verbose(0) << "Pointer for Lookup table is not NULL! Aborting ..." <<endl;
     246    ELOG(1, "Pointer for Lookup table is not NULL! Aborting ...");
    245247    return false;
    246248  }
     
    253255  }
    254256  if (count <= 0) {
    255     Log() << Verbose(0) << "Count of lookup list is 0 or less." << endl;
     257    ELOG(1, "Count of lookup list is 0 or less.");
    256258    return false;
    257259  }
     
    260262  LookupTable = new atom *[count];
    261263  if (LookupTable == NULL) {
    262     eLog() << Verbose(0) << "LookupTable memory allocation failed!" << endl;
     264    ELOG(0, "LookupTable memory allocation failed!");
    263265    performCriticalExit();
    264266    status = false;
     
    272274        LookupTable[AtomNo] = (*iter);
    273275      } else {
    274         Log() << Verbose(0) << "Walker " << *(*iter) << " exceeded range of nuclear ids [0, " << count << ")." << endl;
     276        ELOG(1, "Walker " << *(*iter) << " exceeded range of nuclear ids [0, " << count << ").");
    275277        status = false;
    276278        break;
     
    306308  BondGraph *BG = World::getInstance().getBondGraph();
    307309
    308   DoLog(2) && (Log() << Verbose(2) << "Begin of ScanForPeriodicCorrection." << endl);
     310  LOG(2, "Begin of ScanForPeriodicCorrection.");
    309311
    310312  ColorList = new enum GraphEdge::Shading[getAtomCount()];
     
    324326        for (int i=NDIM;i--;) {
    325327          tmp = fabs(Binder->leftatom->at(i) - Binder->rightatom->at(i));
    326           //Log() << Verbose(3) << "Checking " << i << "th distance of " << *Binder->leftatom << " to " << *Binder->rightatom << ": " << tmp << "." << endl;
     328          //LOG(3, "Checking " << i << "th distance of " << *Binder->leftatom << " to " << *Binder->rightatom << ": " << tmp << ".");
    327329          const range<double> MinMaxDistance(
    328330              BG->getMinMaxDistance(Binder->leftatom, Binder->rightatom));
    329331          if (!MinMaxDistance.isInRange(tmp)) {
    330             DoLog(2) && (Log() << Verbose(2) << "Correcting at bond " << *Binder << "." << endl);
     332            LOG(2, "Correcting at bond " << *Binder << ".");
    331333            flag = true;
    332334            break;
     
    346348      }
    347349      Translationvector *= matrix;
    348       //Log() << Verbose(3) << "Translation vector is ";
    349       Log() << Verbose(0) << Translationvector <<  endl;
     350      LOG(3, "INFO: Translation vector is " << Translationvector << ".");
    350351      // apply to all atoms of first component via BFS
    351352      for (int i=getAtomCount();i--;)
     
    355356        Walker = AtomStack->front();
    356357        AtomStack->pop_front();
    357         //Log() << Verbose (3) << "Current Walker is: " << *Walker << "." << endl;
     358        //LOG(3, "INFO: Current Walker is: " << *Walker << ".");
    358359        ColorList[Walker->getNr()] = GraphEdge::black;    // mark as explored
    359360        *Walker += Translationvector; // translate
     
    381382//      }
    382383    } else {
    383       DoLog(3) && (Log() << Verbose(3) << "No corrections for this fragment." << endl);
     384      LOG(3, "No corrections for this fragment.");
    384385    }
    385386    //delete(CompStack);
     
    388389  delete(AtomStack);
    389390  delete[](ColorList);
    390   DoLog(2) && (Log() << Verbose(2) << "End of ScanForPeriodicCorrection." << endl);
     391  LOG(2, "End of ScanForPeriodicCorrection.");
    391392
    392393  return flag;
Note: See TracChangeset for help on using the changeset viewer.