Changeset 47d041 for src/linkedcell.cpp


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, Candidate_v1.7.0, 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/linkedcell.cpp

    r50e4e5 r47d041  
    5959  max.Zero();
    6060  min.Zero();
    61   DoLog(1) && (Log() << Verbose(1) << "Begin of LinkedCell" << endl);
     61  LOG(1, "Begin of LinkedCell");
    6262  if (set.IsEmpty()) {
    63     DoeLog(1) && (eLog()<< Verbose(1) << "set is NULL or contains no linked cell nodes!" << endl);
     63    ELOG(1, "set is NULL or contains no linked cell nodes!");
    6464    return;
    6565  }
     
    8282    set.GoToNext();
    8383  }
    84   DoLog(2) && (Log() << Verbose(2) << "Bounding box is " << min << " and " << max << "." << endl);
     84  LOG(2, "Bounding box is " << min << " and " << max << ".");
    8585
    8686  // 2. find then number of cells per axis
     
    8888    N[i] = static_cast<int>(floor((max[i] - min[i])/RADIUS)+1);
    8989  }
    90   DoLog(2) && (Log() << Verbose(2) << "Number of cells per axis are " << N[0] << ", " << N[1] << " and " << N[2] << "." << endl);
     90  LOG(2, "Number of cells per axis are " << N[0] << ", " << N[1] << " and " << N[2] << ".");
    9191
    9292  // 3. allocate the lists
    93   DoLog(2) && (Log() << Verbose(2) << "Allocating cells ... ");
     93  LOG(2, "INFO: Allocating cells ... ");
    9494  if (LC != NULL) {
    95     DoeLog(1) && (eLog()<< Verbose(1) << "Linked Cell list is already allocated, I do nothing." << endl);
     95    ELOG(1, "Linked Cell list is already allocated, I do nothing.");
    9696    return;
    9797  }
     
    101101    LC [index].clear();
    102102  }
    103   DoLog(0) && (Log() << Verbose(0) << "done."  << endl);
     103  LOG(0, "done.");
    104104
    105105  // 4. put each atom into its respective cell
    106   DoLog(2) && (Log() << Verbose(2) << "Filling cells ... ");
     106  LOG(2, "INFO: Filling cells ... ");
    107107  set.GoToFirst();
    108108  while (!set.IsEnd()) {
     
    113113    index = n[0] * N[1] * N[2] + n[1] * N[2] + n[2];
    114114    LC[index].push_back(Walker);
    115     //Log() << Verbose(2) << *Walker << " goes into cell " << n[0] << ", " << n[1] << ", " << n[2] << " with No. " << index << "." << endl;
     115    //LOG(2, *Walker << " goes into cell " << n[0] << ", " << n[1] << ", " << n[2] << " with No. " << index << ".");
    116116    set.GoToNext();
    117117  }
    118   DoLog(0) && (Log() << Verbose(0) << "done."  << endl);
    119   DoLog(1) && (Log() << Verbose(1) << "End of LinkedCell" << endl);
     118  LOG(0, "done.");
     119  LOG(1, "End of LinkedCell");
    120120};
    121121
     
    143143    status = status && ((n[i] >=0) && (n[i] < N[i]));
    144144//  if (!status)
    145 //    DoeLog(1) && (eLog()<< Verbose(1) << "indices are out of bounds!" << endl);
     145//    ELOG(1, "indices are out of bounds!");
    146146  return status;
    147147};
     
    216216    return status;
    217217  } else {
    218     DoeLog(1) && (eLog()<< Verbose(1) << "Node at " << *Walker << " is out of bounds." << endl);
     218    ELOG(1, "Node at " << *Walker << " is out of bounds.");
    219219    return false;
    220220  }
     
    239239    if (upper[i] < 0)
    240240      upper[i] = 0;
    241     //Log() << Verbose(0) << "axis " << i << " has bounds [" << lower[i] << "," << upper[i] << "]" << endl;
     241    //LOG(0, "axis " << i << " has bounds [" << lower[i] << "," << upper[i] << "]");
    242242  }
    243243};
     
    257257  GetNeighbourBounds(Nlower, Nupper, step);
    258258
    259   //Log() << Verbose(0) << endl;
    260259  for (n[0] = Nlower[0]; n[0] <= Nupper[0]; n[0]++)
    261260    for (n[1] = Nlower[1]; n[1] <= Nupper[1]; n[1]++)
    262261      for (n[2] = Nlower[2]; n[2] <= Nupper[2]; n[2]++) {
    263262        const TesselPointSTLList *List = GetCurrentCell();
    264         //Log() << Verbose(1) << "Current cell is " << n[0] << ", " << n[1] << ", " << n[2] << " with No. " << index << "." << endl;
     263        //LOG(1, "Current cell is " << n[0] << ", " << n[1] << ", " << n[2] << " with No. " << index << ".");
    265264        if (List != NULL) {
    266265          for (TesselPointSTLList::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
     
    336335  const double dist = SetClosestIndexToOutsideVector(center);
    337336  if (dist > 2.*radius) {
    338     DoeLog(1) && (eLog()<< Verbose(1) << "Vector " << *center << " is too far away from any atom in LinkedCell's bounding box." << endl);
     337    ELOG(1, "Vector " << *center << " is too far away from any atom in LinkedCell's bounding box.");
    339338    return TesselList;
    340339  } else
    341     DoLog(1) && (Log() << Verbose(1) << "Distance of closest cell to center of sphere with radius " << radius << " is " << dist << "." << endl);
     340    LOG(1, "Distance of closest cell to center of sphere with radius " << radius << " is " << dist << ".");
    342341
    343342  // gather all neighbours first, then look who fulfills distance criteria
    344343  NeighbourList = GetallNeighbours(2.*radius-dist);
    345   //Log() << Verbose(1) << "I found " << NeighbourList->size() << " neighbours to check." << endl;
     344  //LOG(1, "I found " << NeighbourList->size() << " neighbours to check.");
    346345  if (NeighbourList != NULL) {
    347346    for (TesselPointSTLList::const_iterator Runner = NeighbourList->begin(); Runner != NeighbourList->end(); Runner++) {
    348347      Walker = *Runner;
    349       //Log() << Verbose(1) << "Current neighbour is at " << *Walker->node << "." << endl;
     348      //LOG(1, "Current neighbour is at " << *Walker->node << ".");
    350349      if ((Walker->DistanceSquared(*center) - radiusSquared) < MYEPSILON) {
    351350        TesselList->push_back(Walker);
     
    354353    delete(NeighbourList);
    355354  } else
    356     DoeLog(2) && (eLog()<< Verbose(2) << "Around vector " << *center << " there are no atoms." << endl);
     355    ELOG(2, "Around vector " << *center << " there are no atoms.");
    357356  return TesselList;
    358357};
Note: See TracChangeset for help on using the changeset viewer.