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/boundary.cpp

    r50e4e5 r47d041  
    8484  } else {
    8585    BoundaryPoints = BoundaryPtr;
    86     DoLog(0) && (Log() << Verbose(0) << "Using given boundary points set." << endl);
     86    LOG(0, "Using given boundary points set.");
    8787  }
    8888  // determine biggest "diameter" of cluster for each axis
     
    9191  for (int axis = 0; axis < NDIM; axis++)
    9292    { // regard each projected plane
    93       //Log() << Verbose(1) << "Current axis is " << axis << "." << endl;
     93      //LOG(1, "Current axis is " << axis << ".");
    9494      for (int j = 0; j < 2; j++)
    9595        { // and for both axis on the current plane
    9696          component = (axis + j + 1) % NDIM;
    9797          Othercomponent = (axis + 1 + ((j + 1) & 1)) % NDIM;
    98           //Log() << Verbose(1) << "Current component is " << component << ", Othercomponent is " << Othercomponent << "." << endl;
     98          //LOG(1, "Current component is " << component << ", Othercomponent is " << Othercomponent << ".");
    9999          for (Boundaries::const_iterator runner = BoundaryPoints[axis].begin(); runner != BoundaryPoints[axis].end(); runner++) {
    100               //Log() << Verbose(1) << "Current runner is " << *(runner->second.second) << "." << endl;
     100              //LOG(1, "Current runner is " << *(runner->second.second) << ".");
    101101              // seek for the neighbours pair where the Othercomponent sign flips
    102102              Neighbour = runner;
     
    111111                    Neighbour = BoundaryPoints[axis].begin();
    112112                  DistanceVector = (runner->second.second->getPosition()) - (Neighbour->second.second->getPosition());
    113                   //Log() << Verbose(2) << "OldComponent is " << OldComponent << ", new one is " << DistanceVector.x[Othercomponent] << "." << endl;
     113                  //LOG(2, "OldComponent is " << OldComponent << ", new one is " << DistanceVector.x[Othercomponent] << ".");
    114114                } while ((runner != Neighbour) && (fabs(OldComponent / fabs(
    115115                  OldComponent) - DistanceVector[Othercomponent] / fabs(
     
    120120                    OtherNeighbour = BoundaryPoints[axis].end();
    121121                  OtherNeighbour--;
    122                   //Log() << Verbose(1) << "The pair, where the sign of OtherComponent flips, is: " << *(Neighbour->second.second) << " and " << *(OtherNeighbour->second.second) << "." << endl;
     122                  //LOG(1, "The pair, where the sign of OtherComponent flips, is: " << *(Neighbour->second.second) << " and " << *(OtherNeighbour->second.second) << ".");
    123123                  // now we have found the pair: Neighbour and OtherNeighbour
    124124                  OtherVector = (runner->second.second->getPosition()) - (OtherNeighbour->second.second->getPosition());
    125                   //Log() << Verbose(1) << "Distances to Neighbour and OtherNeighbour are " << DistanceVector.x[component] << " and " << OtherVector.x[component] << "." << endl;
    126                   //Log() << Verbose(1) << "OtherComponents to Neighbour and OtherNeighbour are " << DistanceVector.x[Othercomponent] << " and " << OtherVector.x[Othercomponent] << "." << endl;
     125                  //LOG(1, "Distances to Neighbour and OtherNeighbour are " << DistanceVector.x[component] << " and " << OtherVector.x[component] << ".");
     126                  //LOG(1, "OtherComponents to Neighbour and OtherNeighbour are " << DistanceVector.x[Othercomponent] << " and " << OtherVector.x[Othercomponent] << ".");
    127127                  // do linear interpolation between points (is exact) to extract exact intersection between Neighbour and OtherNeighbour
    128128                  w1 = fabs(OtherVector[Othercomponent]);
     
    131131                      * OtherVector[component]) / (w1 + w2));
    132132                  // mark if it has greater diameter
    133                   //Log() << Verbose(1) << "Comparing current greatest " << GreatestDiameter[component] << " to new " << tmp << "." << endl;
     133                  //LOG(1, "Comparing current greatest " << GreatestDiameter[component] << " to new " << tmp << ".");
    134134                  GreatestDiameter[component] = (GreatestDiameter[component]
    135135                      > tmp) ? GreatestDiameter[component] : tmp;
    136136                } //else
    137               //Log() << Verbose(1) << "Saw no sign flip, probably top or bottom node." << endl;
     137              //LOG(1, "Saw no sign flip, probably top or bottom node.");
    138138            }
    139139        }
    140140    }
    141   Log() << Verbose(0) << "RESULT: The biggest diameters are "
     141  LOG(0, "RESULT: The biggest diameters are "
    142142      << GreatestDiameter[0] << " and " << GreatestDiameter[1] << " and "
    143143      << GreatestDiameter[2] << " " << (IsAngstroem ? "angstrom"
    144       : "atomiclength") << "." << endl;
     144      : "atomiclength") << ".");
    145145
    146146  // free reference lists
     
    186186    AngleReferenceNormalVector[(axis + 2) % NDIM] = 1.;
    187187
    188     DoLog(1) && (Log() << Verbose(1) << "Axisvector is " << AxisVector << " and AngleReferenceVector is " << AngleReferenceVector << ", and AngleReferenceNormalVector is " << AngleReferenceNormalVector << "." << endl);
     188    LOG(1, "Axisvector is " << AxisVector << " and AngleReferenceVector is " << AngleReferenceVector << ", and AngleReferenceNormalVector is " << AngleReferenceNormalVector << ".");
    189189
    190190    // 3b. construct set of all points, transformed into cylindrical system and with left and right neighbours
     
    200200        angle = 0.; // otherwise it's a vector in Axis Direction and unimportant for boundary issues
    201201
    202       //Log() << Verbose(1) << "Checking sign in quadrant : " << ProjectedVector.Projection(&AngleReferenceNormalVector) << "." << endl;
     202      //LOG(1, "Checking sign in quadrant : " << ProjectedVector.Projection(&AngleReferenceNormalVector) << ".");
    203203      if (ProjectedVector.ScalarProduct(AngleReferenceNormalVector) > 0) {
    204204        angle = 2. * M_PI - angle;
    205205      }
    206     DoLog(1) && (Log() << Verbose(1) << "Inserting " << **iter << ": (r, alpha) = (" << radius << "," << angle << "): " << ProjectedVector << endl);
     206    LOG(1, "Inserting " << **iter << ": (r, alpha) = (" << radius << "," << angle << "): " << ProjectedVector);
    207207      BoundaryTestPair = BoundaryPoints[axis].insert(BoundariesPair(angle, TesselPointDistancePair (radius, (*iter))));
    208208      if (!BoundaryTestPair.second) { // same point exists, check first r, then distance of original vectors to center of gravity
    209         DoLog(2) && (Log() << Verbose(2) << "Encountered two vectors whose projection onto axis " << axis << " is equal: " << endl);
    210         DoLog(2) && (Log() << Verbose(2) << "Present vector: " << *BoundaryTestPair.first->second.second << endl);
    211         DoLog(2) && (Log() << Verbose(2) << "New vector: " << **iter << endl);
     209        LOG(2, "Encountered two vectors whose projection onto axis " << axis << " is equal: ");
     210        LOG(2, "Present vector: " << *BoundaryTestPair.first->second.second);
     211        LOG(2, "New vector: " << **iter);
    212212        const double ProjectedVectorNorm = ProjectedVector.NormSquared();
    213213        if ((ProjectedVectorNorm - BoundaryTestPair.first->second.first) > MYEPSILON) {
    214214          BoundaryTestPair.first->second.first = ProjectedVectorNorm;
    215215          BoundaryTestPair.first->second.second = (*iter);
    216           DoLog(2) && (Log() << Verbose(2) << "Keeping new vector due to larger projected distance " << ProjectedVectorNorm << "." << endl);
     216          LOG(2, "Keeping new vector due to larger projected distance " << ProjectedVectorNorm << ".");
    217217        } else if (fabs(ProjectedVectorNorm - BoundaryTestPair.first->second.first) < MYEPSILON) {
    218218          helper = (*iter)->getPosition() - (*MolCenter);
     
    221221          if (helper.NormSquared() < oldhelperNorm) {
    222222            BoundaryTestPair.first->second.second = (*iter);
    223             DoLog(2) && (Log() << Verbose(2) << "Keeping new vector due to larger distance to molecule center " << helper.NormSquared() << "." << endl);
     223            LOG(2, "Keeping new vector due to larger distance to molecule center " << helper.NormSquared() << ".");
    224224          } else {
    225             DoLog(2) && (Log() << Verbose(2) << "Keeping present vector due to larger distance to molecule center " << oldhelperNorm << "." << endl);
     225            LOG(2, "Keeping present vector due to larger distance to molecule center " << oldhelperNorm << ".");
    226226          }
    227227        } else {
    228           DoLog(2) && (Log() << Verbose(2) << "Keeping present vector due to larger projected distance " << ProjectedVectorNorm << "." << endl);
     228          LOG(2, "Keeping present vector due to larger projected distance " << ProjectedVectorNorm << ".");
    229229        }
    230230      }
     
    232232    // printing all inserted for debugging
    233233    //    {
    234     //      Log() << Verbose(1) << "Printing list of candidates for axis " << axis << " which we have inserted so far." << endl;
     234    //      std::stringstream output;
     235    //      output << "Printing list of candidates for axis " << axis << " which we have inserted so far: ";
    235236    //      int i=0;
    236237    //      for(Boundaries::iterator runner = BoundaryPoints[axis].begin(); runner != BoundaryPoints[axis].end(); runner++) {
    237238    //        if (runner != BoundaryPoints[axis].begin())
    238     //          Log() << Verbose(0) << ", " << i << ": " << *runner->second.second;
     239    //          output << ", " << i << ": " << *runner->second.second;
    239240    //        else
    240     //          Log() << Verbose(0) << i << ": " << *runner->second.second;
     241    //          output << i << ": " << *runner->second.second;
    241242    //        i++;
    242243    //      }
    243     //      Log() << Verbose(0) << endl;
     244    //      LOG(1, output.str());
    244245    //    }
    245246    // 3c. throw out points whose distance is less than the mean of left and right neighbours
    246247    bool flag = false;
    247     DoLog(1) && (Log() << Verbose(1) << "Looking for candidates to kick out by convex condition ... " << endl);
     248    LOG(1, "Looking for candidates to kick out by convex condition ... ");
    248249    do { // do as long as we still throw one out per round
    249250      flag = false;
     
    273274          SideA = left->second.second->getPosition() - (*MolCenter);
    274275          SideA.ProjectOntoPlane(AxisVector);
    275           //          Log() << Verbose(1) << "SideA: " << SideA << endl;
     276          //          LOG(1, "SideA: " << SideA);
    276277
    277278          SideB = right->second.second->getPosition() -(*MolCenter);
    278279          SideB.ProjectOntoPlane(AxisVector);
    279           //          Log() << Verbose(1) << "SideB: " << SideB << endl;
     280          //          LOG(1, "SideB: " << SideB);
    280281
    281282          SideC = left->second.second->getPosition() - right->second.second->getPosition();
    282283          SideC.ProjectOntoPlane(AxisVector);
    283           //          Log() << Verbose(1) << "SideC: " << SideC << endl;
     284          //          LOG(1, "SideC: " << SideC);
    284285
    285286          SideH = runner->second.second->getPosition() -(*MolCenter);
    286287          SideH.ProjectOntoPlane(AxisVector);
    287           //          Log() << Verbose(1) << "SideH: " << SideH << endl;
     288          //          LOG(1, "SideH: " << SideH);
    288289
    289290          // calculate each length
     
    298299          const double delta = SideC.Angle(SideH);
    299300          const double MinDistance = a * sin(beta) / (sin(delta)) * (((alpha < M_PI / 2.) || (gamma < M_PI / 2.)) ? 1. : -1.);
    300           //Log() << Verbose(1) << " I calculated: a = " << a << ", h = " << h << ", beta(" << left->second.second->Name << "," << left->second.second->Name << "-" << right->second.second->Name << ") = " << beta << ", delta(" << left->second.second->Name << "," << runner->second.second->Name << ") = " << delta << ", Min = " << MinDistance << "." << endl;
    301           DoLog(1) && (Log() << Verbose(1) << "Checking CoG distance of runner " << *runner->second.second << " " << h << " against triangle's side length spanned by (" << *left->second.second << "," << *right->second.second << ") of " << MinDistance << "." << endl);
     301          //LOG(1, " I calculated: a = " << a << ", h = " << h << ", beta(" << left->second.second->Name << "," << left->second.second->Name << "-" << right->second.second->Name << ") = " << beta << ", delta(" << left->second.second->Name << "," << runner->second.second->Name << ") = " << delta << ", Min = " << MinDistance << ".");
     302          LOG(1, "Checking CoG distance of runner " << *runner->second.second << " " << h << " against triangle's side length spanned by (" << *left->second.second << "," << *right->second.second << ") of " << MinDistance << ".");
    302303          if ((fabs(h / fabs(h) - MinDistance / fabs(MinDistance)) < MYEPSILON) && ((h - MinDistance)) < -MYEPSILON) {
    303304            // throw out point
    304             DoLog(1) && (Log() << Verbose(1) << "Throwing out " << *runner->second.second << "." << endl);
     305            LOG(1, "Throwing out " << *runner->second.second << ".");
    305306            BoundaryPoints[axis].erase(runner);
    306307            runner = right;
     
    340341  } else {
    341342    BoundaryPoints = BoundaryPts;
    342     DoLog(0) && (Log() << Verbose(0) << "Using given boundary points set." << endl);
     343    LOG(0, "Using given boundary points set.");
    343344  }
    344345
    345346// printing all inserted for debugging
    346   for (int axis=0; axis < NDIM; axis++) {
    347     DoLog(1) && (Log() << Verbose(1) << "Printing list of candidates for axis " << axis << " which we have inserted so far." << endl);
    348     int i=0;
    349     for(Boundaries::iterator runner = BoundaryPoints[axis].begin(); runner != BoundaryPoints[axis].end(); runner++) {
    350       if (runner != BoundaryPoints[axis].begin())
    351         DoLog(0) && (Log() << Verbose(0) << ", " << i << ": " << *runner->second.second);
    352       else
    353         DoLog(0) && (Log() << Verbose(0) << i << ": " << *runner->second.second);
    354       i++;
    355     }
    356     DoLog(0) && (Log() << Verbose(0) << endl);
     347  if (DoLog(1)) {
     348    for (int axis=0; axis < NDIM; axis++) {
     349      std::stringstream output;
     350      output << "Printing list of candidates for axis " << axis << " which we have inserted so far: ";
     351      int i=0;
     352      for(Boundaries::iterator runner = BoundaryPoints[axis].begin(); runner != BoundaryPoints[axis].end(); runner++) {
     353        if (runner != BoundaryPoints[axis].begin())
     354          output << ", " << i << ": " << *runner->second.second;
     355        else
     356          output << i << ": " << *runner->second.second;
     357        i++;
     358      }
     359      LOG(1, output.str());
     360    }
    357361  }
    358362
     
    361365    for (Boundaries::iterator runner = BoundaryPoints[axis].begin(); runner != BoundaryPoints[axis].end(); runner++)
    362366        if (!TesselStruct->AddBoundaryPoint(runner->second.second, 0))
    363           DoLog(2) && (Log()<< Verbose(2) << "Point " << *(runner->second.second) << " is already present." << endl);
    364 
    365   DoLog(0) && (Log() << Verbose(0) << "I found " << TesselStruct->PointsOnBoundaryCount << " points on the convex boundary." << endl);
     367          LOG(2, "Point " << *(runner->second.second) << " is already present.");
     368
     369  LOG(0, "I found " << TesselStruct->PointsOnBoundaryCount << " points on the convex boundary.");
    366370  // now we have the whole set of edge points in the BoundaryList
    367371
    368372  // listing for debugging
    369   //  Log() << Verbose(1) << "Listing PointsOnBoundary:";
     373  //if (DoLog(1)) {
     374  //  std::stringstream output;
     375  //  output << "Listing PointsOnBoundary:";
    370376  //  for(PointMap::iterator runner = PointsOnBoundary.begin(); runner != PointsOnBoundary.end(); runner++) {
    371   //    Log() << Verbose(0) << " " << *runner->second;
     377  //    output << " " << *runner->second;
    372378  //  }
    373   //  Log() << Verbose(0) << endl;
     379  //  LOG(1, output.str());
     380  //}
    374381
    375382  // 3a. guess starting triangle
     
    382389  // 3c. check whether all atoms lay inside the boundary, if not, add to boundary points, segment triangle into three with the new point
    383390  if (!TesselStruct->InsertStraddlingPoints(cloud, LCList))
    384     DoeLog(1) && (eLog()<< Verbose(1) << "Insertion of straddling points failed!" << endl);
    385 
    386   DoLog(0) && (Log() << Verbose(0) << "I created " << TesselStruct->TrianglesOnBoundary.size() << " intermediate triangles with " << TesselStruct->LinesOnBoundary.size() << " lines and " << TesselStruct->PointsOnBoundary.size() << " points." << endl);
     391    ELOG(1, "Insertion of straddling points failed!");
     392
     393  LOG(0, "I created " << TesselStruct->TrianglesOnBoundary.size() << " intermediate triangles with " << TesselStruct->LinesOnBoundary.size() << " lines and " << TesselStruct->PointsOnBoundary.size() << " points.");
    387394
    388395  // 4. Store triangles in tecplot file
     
    396403    for (LineMap::iterator LineRunner = TesselStruct->LinesOnBoundary.begin(); LineRunner != TesselStruct->LinesOnBoundary.end(); LineRunner++) {
    397404      line = LineRunner->second;
    398       DoLog(1) && (Log() << Verbose(1) << "INFO: Current line is " << *line << "." << endl);
     405      LOG(1, "INFO: Current line is " << *line << ".");
    399406      if (!line->CheckConvexityCriterion()) {
    400         DoLog(1) && (Log() << Verbose(1) << "... line " << *line << " is concave, flipping it." << endl);
     407        LOG(1, "... line " << *line << " is concave, flipping it.");
    401408
    402409        // flip the line
    403410        if (TesselStruct->PickFarthestofTwoBaselines(line) == 0.)
    404           DoeLog(1) && (eLog()<< Verbose(1) << "Correction of concave baselines failed!" << endl);
     411          ELOG(1, "Correction of concave baselines failed!");
    405412        else {
    406413          TesselStruct->FlipBaseline(line);
    407           DoLog(1) && (Log() << Verbose(1) << "INFO: Correction of concave baselines worked." << endl);
     414          LOG(1, "INFO: Correction of concave baselines worked.");
    408415          LineRunner = TesselStruct->LinesOnBoundary.begin(); // LineRunner may have been erase if line was deleted from LinesOnBoundary
    409416        }
     
    414421  // 3e. we need another correction here, for TesselPoints that are below the surface (i.e. have an odd number of concave triangles surrounding it)
    415422//  if (!TesselStruct->CorrectConcaveTesselPoints(out))
    416 //    Log() << Verbose(1) << "Correction of concave tesselpoints failed!" << endl;
    417 
    418   DoLog(0) && (Log() << Verbose(0) << "I created " << TesselStruct->TrianglesOnBoundary.size() << " triangles with " << TesselStruct->LinesOnBoundary.size() << " lines and " << TesselStruct->PointsOnBoundary.size() << " points." << endl);
     423//    ELOG(1, "Correction of concave tesselpoints failed!");
     424
     425  LOG(0, "I created " << TesselStruct->TrianglesOnBoundary.size() << " triangles with " << TesselStruct->LinesOnBoundary.size() << " lines and " << TesselStruct->PointsOnBoundary.size() << " points.");
    419426
    420427  // 4. Store triangles in tecplot file
     
    440447
    441448  if ((TesselStruct == NULL) || (TesselStruct->PointsOnBoundary.empty())) {
    442     DoeLog(1) && (eLog()<< Verbose(1) << "TesselStruct is empty." << endl);
     449    ELOG(1, "TesselStruct is empty.");
    443450    return false;
    444451  }
     
    446453  PointMap::iterator PointRunner;
    447454  while (!TesselStruct->PointsOnBoundary.empty()) {
    448     DoLog(1) && (Log() << Verbose(1) << "Remaining points are: ");
    449     for (PointMap::iterator PointSprinter = TesselStruct->PointsOnBoundary.begin(); PointSprinter != TesselStruct->PointsOnBoundary.end(); PointSprinter++)
    450       DoLog(0) && (Log() << Verbose(0) << *(PointSprinter->second) << "\t");
    451     DoLog(0) && (Log() << Verbose(0) << endl);
     455    if (DoLog(1)) {
     456      std::stringstream output;
     457      output << "Remaining points are: ";
     458      for (PointMap::iterator PointSprinter = TesselStruct->PointsOnBoundary.begin(); PointSprinter != TesselStruct->PointsOnBoundary.end(); PointSprinter++)
     459        output << *(PointSprinter->second) << "\t";
     460      LOG(1, output.str());
     461    }
    452462
    453463    PointRunner = TesselStruct->PointsOnBoundary.begin();
     
    505515  // check whether there is something to work on
    506516  if (TesselStruct == NULL) {
    507     DoeLog(1) && (eLog()<< Verbose(1) << "TesselStruct is empty!" << endl);
     517    ELOG(1, "TesselStruct is empty!");
    508518    return volume;
    509519  }
     
    521531      PointAdvance++;
    522532      point = PointRunner->second;
    523       DoLog(1) && (Log() << Verbose(1) << "INFO: Current point is " << *point << "." << endl);
     533      LOG(1, "INFO: Current point is " << *point << ".");
    524534      for (LineMap::iterator LineRunner = point->lines.begin(); LineRunner != point->lines.end(); LineRunner++) {
    525535        line = LineRunner->second;
    526         DoLog(1) && (Log() << Verbose(1) << "INFO: Current line of point " << *point << " is " << *line << "." << endl);
     536        LOG(1, "INFO: Current line of point " << *point << " is " << *line << ".");
    527537        if (!line->CheckConvexityCriterion()) {
    528538          // remove the point if needed
    529           DoLog(1) && (Log() << Verbose(1) << "... point " << *point << " cannot be on convex envelope." << endl);
     539          LOG(1, "... point " << *point << " cannot be on convex envelope.");
    530540          volume += TesselStruct->RemovePointFromTesselatedSurface(point);
    531541          sprintf(dummy, "-first-%d", ++run);
     
    548558      LineAdvance++;
    549559      line = LineRunner->second;
    550       DoLog(1) && (Log() << Verbose(1) << "INFO: Picking farthest baseline for line is " << *line << "." << endl);
     560      LOG(1, "INFO: Picking farthest baseline for line is " << *line << ".");
    551561      // take highest of both lines
    552562      if (TesselStruct->IsConvexRectangle(line) == NULL) {
     
    571581//    LineAdvance++;
    572582//    line = LineRunner->second;
    573 //    Log() << Verbose(1) << "INFO: Current line is " << *line << "." << endl;
     583//    LOG(1, "INFO: Current line is " << *line << ".");
    574584//    //if (LineAdvance != TesselStruct->LinesOnBoundary.end())
    575 //      //Log() << Verbose(1) << "INFO: Next line will be " << *(LineAdvance->second) << "." << endl;
     585//      //LOG(1, "INFO: Next line will be " << *(LineAdvance->second) << ".");
    576586//    if (!line->CheckConvexityCriterion(out)) {
    577 //      Log() << Verbose(1) << "... line " << *line << " is concave, flipping it." << endl;
     587//      LOG(1, "INFO: ... line " << *line << " is concave, flipping it.");
    578588//
    579589//      // take highest of both lines
     
    589599
    590600  // end
    591   DoLog(0) && (Log() << Verbose(0) << "Volume is " << volume << "." << endl);
     601  LOG(0, "Volume is " << volume << ".");
    592602  return volume;
    593603};
     
    622632      const double h = x.Norm(); // distance of CoG to triangle
    623633      const double PyramidVolume = (1. / 3.) * G * h; // this formula holds for _all_ pyramids (independent of n-edge base or (not) centered peak)
    624       Log() << Verbose(1) << "Area of triangle is " << setprecision(10) << G << " "
     634      LOG(1, "INFO: Area of triangle is " << setprecision(10) << G << " "
    625635          << (IsAngstroem ? "angstrom" : "atomiclength") << "^2, height is "
    626636          << h << " and the volume is " << PyramidVolume << " "
    627           << (IsAngstroem ? "angstrom" : "atomiclength") << "^3." << endl;
     637          << (IsAngstroem ? "angstrom" : "atomiclength") << "^3.");
    628638      volume += PyramidVolume;
    629639    }
    630   Log() << Verbose(0) << "RESULT: The summed volume is " << setprecision(6)
    631       << volume << " " << (IsAngstroem ? "angstrom" : "atomiclength") << "^3."
    632       << endl;
     640  LOG(0, "RESULT: The summed volume is " << setprecision(6)
     641      << volume << " " << (IsAngstroem ? "angstrom" : "atomiclength") << "^3.");
    633642
    634643  return volume;
     
    722731      totalmass += (*iter)->getType()->getMass();
    723732  }
    724   DoLog(0) && (Log() << Verbose(0) << "RESULT: The summed mass is " << setprecision(10) << totalmass << " atomicmassunit." << endl);
    725   DoLog(0) && (Log() << Verbose(0) << "RESULT: The average density is " << setprecision(10) << totalmass / clustervolume << " atomicmassunit/" << (IsAngstroem ? "angstrom" : "atomiclength") << "^3." << endl);
     733  LOG(0, "RESULT: The summed mass is " << setprecision(10) << totalmass << " atomicmassunit.");
     734  LOG(0, "RESULT: The average density is " << setprecision(10) << totalmass / clustervolume << " atomicmassunit/" << (IsAngstroem ? "angstrom" : "atomiclength") << "^3.");
    726735
    727736  // solve cubic polynomial
    728   DoLog(1) && (Log() << Verbose(1) << "Solving equidistant suspension in water problem ..." << endl);
     737  LOG(1, "Solving equidistant suspension in water problem ...");
    729738  if (IsAngstroem)
    730739    cellvolume = (TotalNoClusters * totalmass / SOLVENTDENSITY_A - (totalmass / clustervolume)) / (celldensity - 1);
    731740  else
    732741    cellvolume = (TotalNoClusters * totalmass / SOLVENTDENSITY_a0 - (totalmass / clustervolume)) / (celldensity - 1);
    733   DoLog(1) && (Log() << Verbose(1) << "Cellvolume needed for a density of " << celldensity << " g/cm^3 is " << cellvolume << " " << (IsAngstroem ? "angstrom" : "atomiclength") << "^3." << endl);
     742  LOG(1, "Cellvolume needed for a density of " << celldensity << " g/cm^3 is " << cellvolume << " " << (IsAngstroem ? "angstrom" : "atomiclength") << "^3.");
    734743
    735744  double minimumvolume = TotalNoClusters * (GreatestDiameter[0] * GreatestDiameter[1] * GreatestDiameter[2]);
    736   DoLog(1) && (Log() << Verbose(1) << "Minimum volume of the convex envelope contained in a rectangular box is " << minimumvolume << " atomicmassunit/" << (IsAngstroem ? "angstrom" : "atomiclength") << "^3." << endl);
     745  LOG(1, "Minimum volume of the convex envelope contained in a rectangular box is " << minimumvolume << " atomicmassunit/" << (IsAngstroem ? "angstrom" : "atomiclength") << "^3.");
    737746  if (minimumvolume > cellvolume) {
    738     DoeLog(1) && (eLog()<< Verbose(1) << "the containing box already has a greater volume than the envisaged cell volume!" << endl);
    739     DoLog(0) && (Log() << Verbose(0) << "Setting Box dimensions to minimum possible, the greatest diameters." << endl);
     747    ELOG(1, "the containing box already has a greater volume than the envisaged cell volume!");
     748    LOG(0, "Setting Box dimensions to minimum possible, the greatest diameters.");
    740749    for (int i = 0; i < NDIM; i++)
    741750      BoxLengths[i] = GreatestDiameter[i];
     
    749758    double x2 = 0.;
    750759    if (gsl_poly_solve_cubic(BoxLengths[0], BoxLengths[1], BoxLengths[2], &x0, &x1, &x2) == 1) // either 1 or 3 on return
    751       DoLog(0) && (Log() << Verbose(0) << "RESULT: The resulting spacing is: " << x0 << " ." << endl);
     760      LOG(0, "RESULT: The resulting spacing is: " << x0 << " .");
    752761    else {
    753       DoLog(0) && (Log() << Verbose(0) << "RESULT: The resulting spacings are: " << x0 << " and " << x1 << " and " << x2 << " ." << endl);
     762      LOG(0, "RESULT: The resulting spacings are: " << x0 << " and " << x1 << " and " << x2 << " .");
    754763      x0 = x2; // sorted in ascending order
    755764    }
     
    762771
    763772    // set new box dimensions
    764     DoLog(0) && (Log() << Verbose(0) << "Translating to box with these boundaries." << endl);
     773    LOG(0, "Translating to box with these boundaries.");
    765774    mol->SetBoxDimension(&BoxLengths);
    766775    mol->CenterInBox();
     
    769778  // update Box of atoms by boundary
    770779  mol->SetBoxDimension(&BoxLengths);
    771   DoLog(0) && (Log() << Verbose(0) << "RESULT: The resulting cell dimensions are: " << BoxLengths[0] << " and " << BoxLengths[1] << " and " << BoxLengths[2] << " with total volume of " << cellvolume << " " << (IsAngstroem ? "angstrom" : "atomiclength") << "^3." << endl);
     780  LOG(0, "RESULT: The resulting cell dimensions are: " << BoxLengths[0] << " and " << BoxLengths[1] << " and " << BoxLengths[2] << " with total volume of " << cellvolume << " " << (IsAngstroem ? "angstrom" : "atomiclength") << "^3.");
    772781};
    773782
     
    809818  for (MoleculeList::iterator ListRunner = List->ListOfMolecules.begin(); ListRunner != List->ListOfMolecules.end(); ListRunner++)
    810819    if ((*ListRunner)->getAtomCount() > 0) {
    811       DoLog(1) && (Log() << Verbose(1) << "Pre-creating linked cell lists for molecule " << *ListRunner << "." << endl);
     820      LOG(1, "Pre-creating linked cell lists for molecule " << *ListRunner << ".");
    812821      PointCloudAdaptor< molecule > cloud(*ListRunner, (*ListRunner)->name);
    813822      LCList[(*ListRunner)] = new LinkedCell(cloud, 10.); // get linked cell list
    814       DoLog(1) && (Log() << Verbose(1) << "Pre-creating tesselation for molecule " << *ListRunner << "." << endl);
     823      LOG(1, "Pre-creating tesselation for molecule " << *ListRunner << ".");
    815824      TesselStruct[(*ListRunner)] = NULL;
    816825      FindNonConvexBorder((*ListRunner), TesselStruct[(*ListRunner)], (const LinkedCell *&)LCList[(*ListRunner)], 5., NULL);
     
    820829  filler->CenterEdge(&Inserter);
    821830  const int FillerCount = filler->getAtomCount();
    822   DoLog(2) && (Log() << Verbose(2) << "INFO: Filler molecule has the following bonds:" << endl);
     831  LOG(2, "INFO: Filler molecule has the following bonds:");
    823832  for(molecule::iterator AtomRunner = filler->begin(); AtomRunner != filler->end(); ++AtomRunner) {
    824833    const BondList& ListOfBonds = (*AtomRunner)->getListOfBonds();
     
    827836        ++BondRunner) {
    828837      if ((*BondRunner)->leftatom == *AtomRunner)
    829         DoLog(2) && (Log() << Verbose(2) << "  " << *(*BondRunner) << endl);
     838        LOG(2, "  " << *(*BondRunner));
    830839    }
    831840  }
     
    837846  for(int i=0;i<NDIM;i++)
    838847    N[i] = (int) ceil(1./FillerDistance[i]);
    839   DoLog(1) && (Log() << Verbose(1) << "INFO: Grid steps are " << N[0] << ", " << N[1] << ", " << N[2] << "." << endl);
     848  LOG(1, "INFO: Grid steps are " << N[0] << ", " << N[1] << ", " << N[2] << ".");
    840849
    841850  // initialize seed of random number generator to current time
     
    854863        for (int i=0;i<NDIM;i++)
    855864          FillerTranslations[i] = RandomMolDisplacement*(random()/((rng_max-rng_min)/2.) - 1.);
    856         DoLog(2) && (Log() << Verbose(2) << "INFO: Current Position is " << CurrentPosition << "+" << FillerTranslations << "." << endl);
     865        LOG(2, "INFO: Current Position is " << CurrentPosition << "+" << FillerTranslations << ".");
    857866
    858867        // go through all atoms
     
    907916          // insert into Filling
    908917          if (FillIt) {
    909             DoLog(1) && (Log() << Verbose(1) << "INFO: Position at " << Inserter << " is outer point." << endl);
     918            LOG(1, "INFO: Position at " << Inserter << " is outer point.");
    910919            // copy atom ...
    911920            CopyAtoms[(*iter)->getNr()] = (*iter)->clone();
    912921            (*CopyAtoms[(*iter)->getNr()]).setPosition(Inserter);
    913922            Filling->AddAtom(CopyAtoms[(*iter)->getNr()]);
    914             DoLog(1) && (Log() << Verbose(1) << "Filling atom " << **iter << ", translated to " << AtomTranslations << ", at final position is " << (CopyAtoms[(*iter)->getNr()]->getPosition()) << "." << endl);
     923            LOG(1, "Filling atom " << **iter << ", translated to " << AtomTranslations << ", at final position is " << (CopyAtoms[(*iter)->getNr()]->getPosition()) << ".");
    915924          } else {
    916             DoLog(1) && (Log() << Verbose(1) << "INFO: Position at " << Inserter << " is inner point, within boundary or outside of MaxDistance." << endl);
     925            LOG(1, "INFO: Position at " << Inserter << " is inner point, within boundary or outside of MaxDistance.");
    917926            CopyAtoms[(*iter)->getNr()] = NULL;
    918927            continue;
     
    928937              Binder = (*BondRunner);
    929938              if ((CopyAtoms[Binder->leftatom->getNr()] != NULL) && (CopyAtoms[Binder->rightatom->getNr()] != NULL)) {
    930                 Log()  << Verbose(3) << "Adding Bond between " << *CopyAtoms[Binder->leftatom->getNr()] << " and " << *CopyAtoms[Binder->rightatom->getNr()]<< "." << endl;
     939                LOG(3, "Adding Bond between " << *CopyAtoms[Binder->leftatom->getNr()] << " and " << *CopyAtoms[Binder->rightatom->getNr()]<< ".");
    931940                Filling->AddBond(CopyAtoms[Binder->leftatom->getNr()], CopyAtoms[Binder->rightatom->getNr()], Binder->BondDegree);
    932941              }
     
    9971006  }
    9981007  if (Filling->empty()) {
    999     DoLog(0) && (Log() << Verbose(0) << "Removing molecule " << Filling->getName() << ", all atoms have been removed." << std::endl);
     1008    LOG(0, "Removing molecule " << Filling->getName() << ", all atoms have been removed.");
    10001009    World::getInstance().destroyMolecule(Filling);
    10011010    Filling = NULL;
     
    10341043  const bool result = (liste->size() == compareTo);
    10351044  if (!result) {
    1036     DoLog(0) && (Log() << Verbose(0) << "Skipping because of the following atoms:" << std::endl);
     1045    LOG(0, "Skipping because of the following atoms:");
    10371046    for (TesselPointSTLList::const_iterator iter = liste->begin();
    10381047        iter != liste->end();
    10391048        ++iter) {
    1040       DoLog(0) && (Log() << Verbose(0) << **iter << std::endl);
     1049      LOG(0, **iter);
    10411050    }
    10421051  }
     
    11061115  for (std::vector<molecule *>::iterator ListRunner = List.begin(); ListRunner != List.end(); ListRunner++)
    11071116    if ((*ListRunner)->getAtomCount() > 0) {
    1108       DoLog(1) && (Log() << Verbose(1) << "Pre-creating linked cell lists for molecule " << *ListRunner << "." << endl);
     1117      LOG(1, "Pre-creating linked cell lists for molecule " << *ListRunner << ".");
    11091118      PointCloudAdaptor< molecule > cloud(*ListRunner, (*ListRunner)->name);
    11101119      LCList[(*ListRunner)] = new LinkedCell(cloud, 10.); // get linked cell list
     
    11161125  delete gravity;
    11171126  //const int FillerCount = filler->getAtomCount();
    1118   DoLog(2) && (Log() << Verbose(2) << "INFO: Filler molecule has the following bonds:" << endl);
     1127  LOG(2, "INFO: Filler molecule has the following bonds:");
    11191128  for(molecule::iterator AtomRunner = filler->begin(); AtomRunner != filler->end(); ++AtomRunner) {
    11201129    const BondList& ListOfBonds = (*AtomRunner)->getListOfBonds();
     
    11231132        ++BondRunner)
    11241133      if ((*BondRunner)->leftatom == *AtomRunner)
    1125         DoLog(2) && (Log() << Verbose(2) << "  " << *(*BondRunner) << endl);
     1134        LOG(2, "  " << *(*BondRunner));
    11261135  }
    11271136
     
    11301139  for(int i=0;i<NDIM;i++)
    11311140    N[i] = (int) ceil(1./FillerDistance[i]);
    1132   DoLog(1) && (Log() << Verbose(1) << "INFO: Grid steps are " << N[0] << ", " << N[1] << ", " << N[2] << "." << endl);
     1141  LOG(1, "INFO: Grid steps are " << N[0] << ", " << N[1] << ", " << N[2] << ".");
    11331142
    11341143  // initialize seed of random number generator to current time
     
    11471156        for (int i=0;i<NDIM;i++) // have the random values [-1,1]*RandomMolDisplacement
    11481157          FillerTranslations[i] = RandomMolDisplacement*(random()/((rng_max-rng_min)/2.) - 1.);
    1149         DoLog(2) && (Log() << Verbose(2) << "INFO: Current Position is " << CurrentPosition << "+" << FillerTranslations << "." << endl);
     1158        LOG(2, "INFO: Current Position is " << CurrentPosition << "+" << FillerTranslations << ".");
    11501159
    11511160        // ... and rotation matrix
     
    11731182        if (FillIt) {
    11741183          Inserter = CurrentPosition + FillerTranslations;
    1175           DoLog(1) && (Log() << Verbose(1) << "INFO: Position at " << Inserter << " is void point." << endl);
     1184          LOG(1, "INFO: Position at " << Inserter << " is void point.");
    11761185          // fill!
    11771186          Filling = filler->CopyMolecule();
     
    11951204          }
    11961205        } else {
    1197          DoLog(1) && (Log() << Verbose(1) << "INFO: Position at " << Inserter << " is non-void point, within boundary or outside of MaxDistance." << endl);
     1206         LOG(1, "INFO: Position at " << Inserter << " is non-void point, within boundary or outside of MaxDistance.");
    11981207          continue;
    11991208        }
     
    12211230  }
    12221231
    1223   DoLog(0) && (Log() << Verbose(0) << MolList->ListOfMolecules.size() << " molecules have been inserted." << std::endl);
     1232  LOG(0, MolList->ListOfMolecules.size() << " molecules have been inserted.");
    12241233
    12251234  for (std::map<molecule *, LinkedCell *>::iterator ListRunner = LCList.begin(); !LCList.empty(); ListRunner = LCList.begin()) {
     
    12501259
    12511260  if (TesselStruct == NULL) {
    1252     DoLog(1) && (Log() << Verbose(1) << "Allocating Tesselation struct ..." << endl);
     1261    LOG(1, "Allocating Tesselation struct ...");
    12531262    TesselStruct= new Tesselation;
    12541263  } else {
    12551264    delete(TesselStruct);
    1256     DoLog(1) && (Log() << Verbose(1) << "Re-Allocating Tesselation struct ..." << endl);
     1265    LOG(1, "Re-Allocating Tesselation struct ...");
    12571266    TesselStruct = new Tesselation;
    12581267  }
     
    12671276  // 1. get starting triangle
    12681277  if (!TesselStruct->FindStartingTriangle(RADIUS, LCList)) {
    1269     DoeLog(0) && (eLog() << Verbose(0) << "No valid starting triangle found." << endl);
     1278    ELOG(0, "No valid starting triangle found.");
    12701279    //performCriticalExit();
    12711280  }
     
    12801289    (cerr << "There are " <<  TesselStruct->TrianglesOnBoundary.size() << " triangles and " << TesselStruct->OpenLines.size() << " open lines to scan for candidates." << endl);
    12811290    // 2a. print OpenLines without candidates
    1282     DoLog(1) && (Log() << Verbose(1) << "There are the following open lines to scan for a candidates:" << endl);
     1291    LOG(1, "There are the following open lines to scan for a candidates:");
    12831292    for (CandidateMap::iterator Runner = TesselStruct->OpenLines.begin(); Runner != TesselStruct->OpenLines.end(); Runner++)
    12841293      if (Runner->second->pointlist.empty())
    1285         DoLog(1) && (Log() << Verbose(1) << " " << *(Runner->second) << endl);
     1294        LOG(1, " " << *(Runner->second));
    12861295
    12871296    // 2b. find best candidate for each OpenLine
     
    12891298
    12901299    // 2c. print OpenLines with candidates again
    1291     DoLog(1) && (Log() << Verbose(1) << "There are " << TesselStruct->OpenLines.size() << " open lines to scan for the best candidates:" << endl);
     1300    LOG(1, "There are " << TesselStruct->OpenLines.size() << " open lines to scan for the best candidates:");
    12921301    for (CandidateMap::iterator Runner = TesselStruct->OpenLines.begin(); Runner != TesselStruct->OpenLines.end(); Runner++)
    1293       DoLog(1) && (Log() << Verbose(1) << " " << *(Runner->second) << endl);
     1302      LOG(1, " " << *(Runner->second));
    12941303
    12951304    // 2d. search for smallest ShortestAngle among all candidates
     
    12991308        baseline = Runner->second;
    13001309        ShortestAngle = baseline->ShortestAngle;
    1301         DoLog(1) && (Log() << Verbose(1) << "New best candidate is " << *baseline->BaseLine << " with point " << *(*baseline->pointlist.begin()) << " and angle " << baseline->ShortestAngle << endl);
     1310        LOG(1, "New best candidate is " << *baseline->BaseLine << " with point " << *(*baseline->pointlist.begin()) << " and angle " << baseline->ShortestAngle);
    13021311      }
    13031312    }
     
    13241333//  class TesselPoint *Runner = NULL;
    13251334//    Runner = *iter;
    1326 //    Log() << Verbose(1) << "Checking on " << Runner->Name << " ... " << endl;
     1335//    LOG(1, "Checking on " << Runner->Name << " ... ");
    13271336//    if (!->IsInnerPoint(Runner, LCList)) {
    1328 //      Log() << Verbose(2) << Runner->Name << " is outside of envelope, adding via degenerated triangles." << endl;
     1337//      LOG(2, Runner->Name << " is outside of envelope, adding via degenerated triangles.");
    13291338//      ->AddBoundaryPointByDegeneratedTriangle(Runner, LCList);
    13301339//    } else {
    1331 //      Log() << Verbose(2) << Runner->Name << " is inside of or on envelope." << endl;
     1340//      LOG(2, Runner->Name << " is inside of or on envelope.");
    13321341//    }
    13331342//  }
Note: See TracChangeset for help on using the changeset viewer.