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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Tesselation/BoundaryTriangleSet.cpp

    r50e4e5 r47d041  
    7979  // set endpoints
    8080  int Counter = 0;
    81   DoLog(0) && (Log() << Verbose(0) << "New triangle " << Nr << " with end points: " << endl);
     81  LOG(0, "New triangle " << Nr << " with end points: ");
    8282  for (PointMap::iterator runner = OrderMap.begin(); runner != OrderMap.end(); runner++) {
    8383    endpoints[Counter] = runner->second;
    84     DoLog(0) && (Log() << Verbose(0) << " " << *endpoints[Counter] << endl);
     84    LOG(0, " " << *endpoints[Counter]);
    8585    Counter++;
    8686  }
     
    9999    if (lines[i] != NULL) {
    100100      if (lines[i]->triangles.erase(Nr)) {
    101         //Log() << Verbose(0) << "Triangle Nr." << Nr << " erased in line " << *lines[i] << "." << endl;
     101        //LOG(0, "Triangle Nr." << Nr << " erased in line " << *lines[i] << ".");
    102102      }
    103103      if (lines[i]->triangles.empty()) {
    104         //Log() << Verbose(0) << *lines[i] << " is no more attached to any triangle, erasing." << endl;
     104        //LOG(0, *lines[i] << " is no more attached to any triangle, erasing.");
    105105        delete (lines[i]);
    106106        lines[i] = NULL;
     
    108108    }
    109109  }
    110   //Log() << Verbose(0) << "Erasing triangle Nr." << Nr << " itself." << endl;
     110  //LOG(0, "Erasing triangle Nr." << Nr << " itself.");
    111111}
    112112;
     
    127127  if (NormalVector.ScalarProduct(OtherVector) > 0.)
    128128    NormalVector.Scale(-1.);
    129   DoLog(1) && (Log() << Verbose(1) << "Normal Vector is " << NormalVector << "." << endl);
     129  LOG(1, "Normal Vector is " << NormalVector << ".");
    130130}
    131131;
     
    154154    Intersection = Plane(NormalVector, (endpoints[0]->node->getPosition())).GetIntersection(centerLine);
    155155
    156     DoLog(1) && (Log() << Verbose(1) << "INFO: Triangle is " << *this << "." << endl);
    157     DoLog(1) && (Log() << Verbose(1) << "INFO: Line is from " << MolCenter << " to " << x << "." << endl);
    158     DoLog(1) && (Log() << Verbose(1) << "INFO: Intersection is " << Intersection << "." << endl);
     156    LOG(1, "INFO: Triangle is " << *this << ".");
     157    LOG(1, "INFO: Line is from " << MolCenter << " to " << x << ".");
     158    LOG(1, "INFO: Intersection is " << Intersection << ".");
    159159
    160160    if (Intersection.DistanceSquared(endpoints[0]->node->getPosition()) < MYEPSILON) {
    161       DoLog(1) && (Log() << Verbose(1) << "Intersection coindices with first endpoint." << endl);
     161      LOG(1, "Intersection coindices with first endpoint.");
    162162      return true;
    163163    }   else if (Intersection.DistanceSquared(endpoints[1]->node->getPosition()) < MYEPSILON) {
    164       DoLog(1) && (Log() << Verbose(1) << "Intersection coindices with second endpoint." << endl);
     164      LOG(1, "Intersection coindices with second endpoint.");
    165165      return true;
    166166    }   else if (Intersection.DistanceSquared(endpoints[2]->node->getPosition()) < MYEPSILON) {
    167       DoLog(1) && (Log() << Verbose(1) << "Intersection coindices with third endpoint." << endl);
     167      LOG(1, "Intersection coindices with third endpoint.");
    168168      return true;
    169169    }
     
    177177      CrossPoint -= (endpoints[i%3]->node->getPosition());  // cross point was returned as absolute vector
    178178      const double s = CrossPoint.ScalarProduct(helper)/helper.NormSquared();
    179       DoLog(1) && (Log() << Verbose(1) << "INFO: Factor s is " << s << "." << endl);
     179      LOG(1, "INFO: Factor s is " << s << ".");
    180180      if ((s < -MYEPSILON) || ((s-1.) > MYEPSILON)) {
    181         DoLog(1) && (Log() << Verbose(1) << "INFO: Crosspoint " << CrossPoint << "outside of triangle." << endl);
     181        LOG(1, "INFO: Crosspoint " << CrossPoint << "outside of triangle.");
    182182        return false;
    183183      }
    184184      i++;
    185185    } while (i < 3);
    186     DoLog(1) && (Log() << Verbose(1) << "INFO: Crosspoint " << CrossPoint << " inside of triangle." << endl);
     186    LOG(1, "INFO: Crosspoint " << CrossPoint << " inside of triangle.");
    187187    return true;
    188188  }
    189189  catch (LinearAlgebraException &excp) {
    190     Log() << Verbose(1) << boost::diagnostic_information(excp);
    191     DoeLog(1) && (eLog() << Verbose(1) << "Alas! Intersection with plane failed - at least numerically - the intersection is not on the plane!" << endl);
     190    LOG(1, boost::diagnostic_information(excp));
     191    ELOG(1, "Alas! Intersection with plane failed - at least numerically - the intersection is not on the plane!");
    192192    return false;
    193193  }
     
    213213
    214214  // 1. get intersection with plane
    215   DoLog(1) && (Log() << Verbose(1) << "INFO: Looking for closest point of triangle " << *this << " to " << x << "." << endl);
     215  LOG(1, "INFO: Looking for closest point of triangle " << *this << " to " << x << ".");
    216216  GetCenter(Direction);
    217217  try {
     
    228228  InPlane += ClosestPoint;
    229229
    230   DoLog(2) && (Log() << Verbose(2) << "INFO: Triangle is " << *this << "." << endl);
    231   DoLog(2) && (Log() << Verbose(2) << "INFO: Line is from " << Direction << " to " << x << "." << endl);
    232   DoLog(2) && (Log() << Verbose(2) << "INFO: In-plane part is " << InPlane << "." << endl);
     230  LOG(2, "INFO: Triangle is " << *this << ".");
     231  LOG(2, "INFO: Line is from " << Direction << " to " << x << ".");
     232  LOG(2, "INFO: In-plane part is " << InPlane << ".");
    233233
    234234  // Calculate cross point between one baseline and the desired point such that distance is shortest
     
    247247    CrossPoint[i] -= (endpoints[i%3]->node->getPosition());  // cross point was returned as absolute vector
    248248    const double s = CrossPoint[i].ScalarProduct(Direction)/Direction.NormSquared();
    249     DoLog(2) && (Log() << Verbose(2) << "INFO: Factor s is " << s << "." << endl);
     249    LOG(2, "INFO: Factor s is " << s << ".");
    250250    if ((s >= -MYEPSILON) && ((s-1.) <= MYEPSILON)) {
    251251          CrossPoint[i] += (endpoints[i%3]->node->getPosition());  // make cross point absolute again
    252       DoLog(2) && (Log() << Verbose(2) << "INFO: Crosspoint is " << CrossPoint[i] << ", intersecting BoundaryLine between " << endpoints[i % 3]->node->getPosition() << " and " << endpoints[(i + 1) % 3]->node->getPosition() << "." << endl);
     252      LOG(2, "INFO: Crosspoint is " << CrossPoint[i] << ", intersecting BoundaryLine between " << endpoints[i % 3]->node->getPosition() << " and " << endpoints[(i + 1) % 3]->node->getPosition() << ".");
    253253      const double distance = CrossPoint[i].DistanceSquared(x);
    254254      if ((ShortestDistance < 0.) || (ShortestDistance > distance)) {
     
    279279    }
    280280  }
    281   DoLog(1) && (Log() << Verbose(1) << "INFO: Closest Point is " << ClosestPoint << " with shortest squared distance is " << ShortestDistance << "." << endl);
     281  LOG(1, "INFO: Closest Point is " << ClosestPoint << " with shortest squared distance is " << ShortestDistance << ".");
    282282  return ShortestDistance;
    283283}
     
    333333{
    334334  Info FunctionInfo(__func__);
    335   DoLog(1) && (Log() << Verbose(1) << "INFO: Checking " << Points[0] << "," << Points[1] << "," << Points[2] << " against " << endpoints[0] << "," << endpoints[1] << "," << endpoints[2] << "." << endl);
     335  LOG(1, "INFO: Checking " << Points[0] << "," << Points[1] << "," << Points[2] << " against " << endpoints[0] << "," << endpoints[1] << "," << endpoints[2] << ".");
    336336  return (((endpoints[0] == Points[0]) || (endpoints[0] == Points[1]) || (endpoints[0] == Points[2])) && ((endpoints[1] == Points[0]) || (endpoints[1] == Points[1]) || (endpoints[1] == Points[2])) && ((endpoints[2] == Points[0]) || (endpoints[2] == Points[1]) || (endpoints[2] == Points[2])
    337337
     
    400400    (center) += (endpoints[i]->node->getPosition());
    401401  center.Scale(1. / 3.);
    402   DoLog(1) && (Log() << Verbose(1) << "INFO: Center is at " << center << "." << endl);
     402  LOG(1, "INFO: Center is at " << center << ".");
    403403}
    404404
Note: See TracChangeset for help on using the changeset viewer.