Changeset a67d19 for src


Ignore:
Timestamp:
Apr 22, 2010, 2:00:03 PM (16 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, Candidate_v1.7.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:
299554
Parents:
6613ec
Message:

Huge change: Log() << Verbose(.) --> DoLog(.) && (Log() << Verbose(.) << ...);

Most of the files are affected, but this is necessary as if DoLog() says verbosity is not enough, all the stream operators won"t get executed which saves substantial amount of computation time.

Signed-off-by: Frederik Heber <heber@…>

Location:
src
Files:
33 edited

Legend:

Unmodified
Added
Removed
  • src/analysis_correlation.cpp

    r6613ec ra67d19  
    4646      while (Walker->next != (*MolWalker)->end) {
    4747        Walker = Walker->next;
    48         Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl;
     48        DoLog(3) && (Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl);
    4949        if ((type1 == NULL) || (Walker->type == type1)) {
    5050          for (MoleculeList::const_iterator MolOtherWalker = MolWalker; MolOtherWalker != molecules->ListOfMolecules.end(); MolOtherWalker++)
    5151            if ((*MolOtherWalker)->ActiveFlag) {
    52               Log() << Verbose(2) << "Current other molecule is " << *MolOtherWalker << "." << endl;
     52              DoLog(2) && (Log() << Verbose(2) << "Current other molecule is " << *MolOtherWalker << "." << endl);
    5353              atom *OtherWalker = (*MolOtherWalker)->start;
    5454              while (OtherWalker->next != (*MolOtherWalker)->end) { // only go up to Walker
    5555                OtherWalker = OtherWalker->next;
    56                 Log() << Verbose(3) << "Current otheratom is " << *OtherWalker << "." << endl;
     56                DoLog(3) && (Log() << Verbose(3) << "Current otheratom is " << *OtherWalker << "." << endl);
    5757                if (Walker->nr < OtherWalker->nr)
    5858                  if ((type2 == NULL) || (OtherWalker->type == type2)) {
     
    104104      while (Walker->next != (*MolWalker)->end) {
    105105        Walker = Walker->next;
    106         Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl;
     106        DoLog(3) && (Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl);
    107107        if ((type1 == NULL) || (Walker->type == type1)) {
    108108          periodicX.CopyVector(Walker->node);
     
    117117                for (MoleculeList::const_iterator MolOtherWalker = MolWalker; MolOtherWalker != molecules->ListOfMolecules.end(); MolOtherWalker++)
    118118                  if ((*MolOtherWalker)->ActiveFlag) {
    119                     Log() << Verbose(2) << "Current other molecule is " << *MolOtherWalker << "." << endl;
     119                    DoLog(2) && (Log() << Verbose(2) << "Current other molecule is " << *MolOtherWalker << "." << endl);
    120120                    atom *OtherWalker = (*MolOtherWalker)->start;
    121121                    while (OtherWalker->next != (*MolOtherWalker)->end) { // only go up to Walker
    122122                      OtherWalker = OtherWalker->next;
    123                       Log() << Verbose(3) << "Current otheratom is " << *OtherWalker << "." << endl;
     123                      DoLog(3) && (Log() << Verbose(3) << "Current otheratom is " << *OtherWalker << "." << endl);
    124124                      if (Walker->nr < OtherWalker->nr)
    125125                        if ((type2 == NULL) || (OtherWalker->type == type2)) {
     
    164164
    165165  if (molecules->ListOfMolecules.empty()) {
    166     Log() << Verbose(1) <<"No molecule given." << endl;
     166    DoLog(1) && (Log() << Verbose(1) <<"No molecule given." << endl);
    167167    return outmap;
    168168  }
     
    170170  for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++)
    171171    if ((*MolWalker)->ActiveFlag) {
    172       Log() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl;
    173       atom *Walker = (*MolWalker)->start;
    174       while (Walker->next != (*MolWalker)->end) {
    175         Walker = Walker->next;
    176         Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl;
     172      DoLog(2) && (Log() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl);
     173      atom *Walker = (*MolWalker)->start;
     174      while (Walker->next != (*MolWalker)->end) {
     175        Walker = Walker->next;
     176        DoLog(3) && (Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl);
    177177        if ((type == NULL) || (Walker->type == type)) {
    178178          distance = Walker->node->PeriodicDistance(point, World::get()->cell_size);
    179           Log() << Verbose(4) << "Current distance is " << distance << "." << endl;
     179          DoLog(4) && (Log() << Verbose(4) << "Current distance is " << distance << "." << endl);
    180180          outmap->insert ( pair<double, pair<atom *, const Vector*> >(distance, pair<atom *, const Vector*> (Walker, point) ) );
    181181        }
     
    204204
    205205  if (molecules->ListOfMolecules.empty()) {
    206     Log() << Verbose(1) <<"No molecule given." << endl;
     206    DoLog(1) && (Log() << Verbose(1) <<"No molecule given." << endl);
    207207    return outmap;
    208208  }
     
    212212      double * FullMatrix = ReturnFullMatrixforSymmetric(World::get()->cell_size);
    213213      double * FullInverseMatrix = InverseMatrix(FullMatrix);
    214       Log() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl;
    215       atom *Walker = (*MolWalker)->start;
    216       while (Walker->next != (*MolWalker)->end) {
    217         Walker = Walker->next;
    218         Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl;
     214      DoLog(2) && (Log() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl);
     215      atom *Walker = (*MolWalker)->start;
     216      while (Walker->next != (*MolWalker)->end) {
     217        Walker = Walker->next;
     218        DoLog(3) && (Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl);
    219219        if ((type == NULL) || (Walker->type == type)) {
    220220          periodicX.CopyVector(Walker->node);
     
    228228                checkX.MatrixMultiplication(FullMatrix);
    229229                distance = checkX.Distance(point);
    230                 Log() << Verbose(4) << "Current distance is " << distance << "." << endl;
     230                DoLog(4) && (Log() << Verbose(4) << "Current distance is " << distance << "." << endl);
    231231                outmap->insert ( pair<double, pair<atom *, const Vector*> >(distance, pair<atom *, const Vector*> (Walker, point) ) );
    232232              }
     
    263263  for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++)
    264264    if ((*MolWalker)->ActiveFlag) {
    265       Log() << Verbose(1) << "Current molecule is " << (*MolWalker)->name << "." << endl;
     265      DoLog(1) && (Log() << Verbose(1) << "Current molecule is " << (*MolWalker)->name << "." << endl);
    266266      atom *Walker = (*MolWalker)->start;
    267267      while (Walker->next != (*MolWalker)->end) {
     
    276276      }
    277277    } else
    278       Log() << Verbose(1) << "molecule " << (*MolWalker)->name << " is not active." << endl;
     278      DoLog(1) && (Log() << Verbose(1) << "molecule " << (*MolWalker)->name << " is not active." << endl);
    279279
    280280
     
    307307
    308308  if ((Surface == NULL) || (LC == NULL) || (molecules->ListOfMolecules.empty())) {
    309     Log() << Verbose(1) <<"No Tesselation, no LinkedCell or no molecule given." << endl;
     309    DoLog(1) && (Log() << Verbose(1) <<"No Tesselation, no LinkedCell or no molecule given." << endl);
    310310    return outmap;
    311311  }
     
    317317      double * FullMatrix = ReturnFullMatrixforSymmetric(World::get()->cell_size);
    318318      double * FullInverseMatrix = InverseMatrix(FullMatrix);
    319       Log() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl;
    320       atom *Walker = (*MolWalker)->start;
    321       while (Walker->next != (*MolWalker)->end) {
    322         Walker = Walker->next;
    323         Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl;
     319      DoLog(2) && (Log() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl);
     320      atom *Walker = (*MolWalker)->start;
     321      while (Walker->next != (*MolWalker)->end) {
     322        Walker = Walker->next;
     323        DoLog(3) && (Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl);
    324324        if ((type == NULL) || (Walker->type == type)) {
    325325          periodicX.CopyVector(Walker->node);
  • src/analyzer.cpp

    r6613ec ra67d19  
    6363  int counter = 0;
    6464
    65   Log() << Verbose(0) << "ANOVA Analyzer" << endl;
    66   Log() << Verbose(0) << "==============" << endl;
     65  DoLog(0) && (Log() << Verbose(0) << "ANOVA Analyzer" << endl);
     66  DoLog(0) && (Log() << Verbose(0) << "==============" << endl);
    6767
    6868  // Get the command line options
    6969  if (argc < 4) {
    70     Log() << Verbose(0) << "Usage: " << argv[0] << " <inputdir> <prefix> <outputdir> [elementsdb]" << endl;
    71     Log() << Verbose(0) << "<inputdir>\ttherein the output of a molecuilder fragmentation is expected, each fragment with a subdir containing an energy.all and a forces.all file." << endl;
    72     Log() << Verbose(0) << "<prefix>\tprefix of energy and forces file." << endl;
    73     Log() << Verbose(0) << "<outputdir>\tcreated plotfiles and datafiles are placed into this directory " << endl;
    74     Log() << Verbose(0) << "[elementsdb]\tpath to elements database, needed for shieldings." << endl;
     70    DoLog(0) && (Log() << Verbose(0) << "Usage: " << argv[0] << " <inputdir> <prefix> <outputdir> [elementsdb]" << endl);
     71    DoLog(0) && (Log() << Verbose(0) << "<inputdir>\ttherein the output of a molecuilder fragmentation is expected, each fragment with a subdir containing an energy.all and a forces.all file." << endl);
     72    DoLog(0) && (Log() << Verbose(0) << "<prefix>\tprefix of energy and forces file." << endl);
     73    DoLog(0) && (Log() << Verbose(0) << "<outputdir>\tcreated plotfiles and datafiles are placed into this directory " << endl);
     74    DoLog(0) && (Log() << Verbose(0) << "[elementsdb]\tpath to elements database, needed for shieldings." << endl);
    7575    return 1;
    7676  } else {
     
    8181
    8282  if (argc > 4) {
    83     Log() << Verbose(0) << "Loading periodentafel." << endl;
     83    DoLog(0) && (Log() << Verbose(0) << "Loading periodentafel." << endl);
    8484    periode = Malloc<periodentafel>(1, "main - periode");
    8585    periode->LoadPeriodentafel(argv[4]);
     
    248248  // +++++++++++++++ ANALYZING ++++++++++++++++++++++++++++++
    249249
    250   Log() << Verbose(0) << "Analyzing ..." << endl;
     250  DoLog(0) && (Log() << Verbose(0) << "Analyzing ..." << endl);
    251251
    252252  // ======================================= Creating the data files ==============================================================
     
    559559  delete(periode);
    560560  Free(&dir);
    561   Log() << Verbose(0) << "done." << endl;
     561  DoLog(0) && (Log() << Verbose(0) << "done." << endl);
    562562  return 0;
    563563};
  • src/atom_bondedparticle.cpp

    r6613ec ra67d19  
    4444void BondedParticle::OutputBondOfAtom() const
    4545{
    46   Log() << Verbose(4) << "Atom " << Name << "/" << nr << " with " << ListOfBonds.size() << " bonds: " << endl;
     46  DoLog(4) && (Log() << Verbose(4) << "Atom " << Name << "/" << nr << " with " << ListOfBonds.size() << " bonds: " << endl);
    4747  int TotalDegree = 0;
    4848  for (BondList::const_iterator Runner = ListOfBonds.begin(); Runner != ListOfBonds.end(); ++Runner) {
    49     Log() << Verbose(4) << **Runner << endl;
     49    DoLog(4) && (Log() << Verbose(4) << **Runner << endl);
    5050    TotalDegree += (*Runner)->BondDegree;
    5151  }
    52   Log() << Verbose(4) << " -- TotalDegree: " << TotalDegree << endl;
     52  DoLog(4) && (Log() << Verbose(4) << " -- TotalDegree: " << TotalDegree << endl);
    5353};
    5454
  • src/atom_graphnode.cpp

    r6613ec ra67d19  
    2727void GraphNode::OutputGraphInfo() const
    2828{
    29   Log() << Verbose(2) << "Atom " << Name << " is " << ((SeparationVertex) ? "a" : "not a") << " separation vertex, components are ";
     29  DoLog(2) && (Log() << Verbose(2) << "Atom " << Name << " is " << ((SeparationVertex) ? "a" : "not a") << " separation vertex, components are ");
    3030  OutputComponentNumber();
    31   Log() << Verbose(3) << " with Lowpoint " << LowpointNr << " and Graph Nr. " << GraphNr << "." << endl;
     31  DoLog(3) && (Log() << Verbose(3) << " with Lowpoint " << LowpointNr << " and Graph Nr. " << GraphNr << "." << endl);
    3232};
    3333
     
    4040  if (ComponentNr != NULL) {
    4141    for (int i=0; ComponentNr[i] != -1; i++)
    42       Log() << Verbose(2) << ComponentNr[i] << " ";
     42      DoLog(2) && (Log() << Verbose(2) << ComponentNr[i] << " ");
    4343  }
    4444};
  • src/atom_trajectoryparticle.cpp

    r6613ec ra67d19  
    198198    // throw a dice to determine whether it gets hit by a heat bath particle
    199199    if (((((rand()/(double)RAND_MAX))*configuration->TempFrequency) < 1.)) {
    200       Log() << Verbose(3) << "Particle " << *this << " was hit (sigma " << sigma << "): " << sqrt(U[0]*U[0]+U[1]*U[1]+U[2]*U[2]) << " -> ";
     200      DoLog(3) && (Log() << Verbose(3) << "Particle " << *this << " was hit (sigma " << sigma << "): " << sqrt(U[0]*U[0]+U[1]*U[1]+U[2]*U[2]) << " -> ");
    201201      // pick three random numbers from a Boltzmann distribution around the desired temperature T for each momenta axis
    202202      for (int d=0; d<NDIM; d++) {
    203203        U[d] = gsl_ran_gaussian (r, sigma);
    204204      }
    205       Log() << Verbose(2) << sqrt(U[0]*U[0]+U[1]*U[1]+U[2]*U[2]) << endl;
     205      DoLog(2) && (Log() << Verbose(2) << sqrt(U[0]*U[0]+U[1]*U[1]+U[2]*U[2]) << endl);
    206206    }
    207207    for (int d=0; d<NDIM; d++)
  • src/bondgraph.cpp

    r6613ec ra67d19  
    5050  // allocate MatrixContainer
    5151  if (BondLengthMatrix != NULL) {
    52     Log() << Verbose(1) << "MatrixContainer for Bond length already present, removing." << endl;
     52    DoLog(1) && (Log() << Verbose(1) << "MatrixContainer for Bond length already present, removing." << endl);
    5353    delete(BondLengthMatrix);
    5454  }
     
    5757  // parse in matrix
    5858  if ((status = TempContainer->ParseMatrix(filename.c_str(), 0, 1, 0))) {
    59     Log() << Verbose(1) << "Parsing bond length matrix successful." << endl;
     59    DoLog(1) && (Log() << Verbose(1) << "Parsing bond length matrix successful." << endl);
    6060  } else {
    6161    DoeLog(1) && (eLog()<< Verbose(1) << "Parsing bond length matrix failed." << endl);
  • src/boundary.cpp

    r6613ec ra67d19  
    5757  } else {
    5858    BoundaryPoints = BoundaryPtr;
    59     Log() << Verbose(0) << "Using given boundary points set." << endl;
     59    DoLog(0) && (Log() << Verbose(0) << "Using given boundary points set." << endl);
    6060  }
    6161  // determine biggest "diameter" of cluster for each axis
     
    163163    AngleReferenceNormalVector.x[(axis + 2) % NDIM] = 1.;
    164164
    165     Log() << Verbose(1) << "Axisvector is " << AxisVector << " and AngleReferenceVector is " << AngleReferenceVector << ", and AngleReferenceNormalVector is " << AngleReferenceNormalVector << "." << endl;
     165    DoLog(1) && (Log() << Verbose(1) << "Axisvector is " << AxisVector << " and AngleReferenceVector is " << AngleReferenceVector << ", and AngleReferenceNormalVector is " << AngleReferenceNormalVector << "." << endl);
    166166
    167167    // 3b. construct set of all points, transformed into cylindrical system and with left and right neighbours
     
    184184        angle = 2. * M_PI - angle;
    185185      }
    186       Log() << Verbose(1) << "Inserting " << *Walker << ": (r, alpha) = (" << radius << "," << angle << "): " << ProjectedVector << endl;
     186      DoLog(1) && (Log() << Verbose(1) << "Inserting " << *Walker << ": (r, alpha) = (" << radius << "," << angle << "): " << ProjectedVector << endl);
    187187      BoundaryTestPair = BoundaryPoints[axis].insert(BoundariesPair(angle, DistancePair (radius, Walker)));
    188188      if (!BoundaryTestPair.second) { // same point exists, check first r, then distance of original vectors to center of gravity
    189         Log() << Verbose(2) << "Encountered two vectors whose projection onto axis " << axis << " is equal: " << endl;
    190         Log() << Verbose(2) << "Present vector: " << *BoundaryTestPair.first->second.second << endl;
    191         Log() << Verbose(2) << "New vector: " << *Walker << endl;
     189        DoLog(2) && (Log() << Verbose(2) << "Encountered two vectors whose projection onto axis " << axis << " is equal: " << endl);
     190        DoLog(2) && (Log() << Verbose(2) << "Present vector: " << *BoundaryTestPair.first->second.second << endl);
     191        DoLog(2) && (Log() << Verbose(2) << "New vector: " << *Walker << endl);
    192192        const double ProjectedVectorNorm = ProjectedVector.NormSquared();
    193193        if ((ProjectedVectorNorm - BoundaryTestPair.first->second.first) > MYEPSILON) {
    194194          BoundaryTestPair.first->second.first = ProjectedVectorNorm;
    195195          BoundaryTestPair.first->second.second = Walker;
    196           Log() << Verbose(2) << "Keeping new vector due to larger projected distance " << ProjectedVectorNorm << "." << endl;
     196          DoLog(2) && (Log() << Verbose(2) << "Keeping new vector due to larger projected distance " << ProjectedVectorNorm << "." << endl);
    197197        } else if (fabs(ProjectedVectorNorm - BoundaryTestPair.first->second.first) < MYEPSILON) {
    198198          helper.CopyVector(&Walker->x);
     
    203203          if (helper.NormSquared() < oldhelperNorm) {
    204204            BoundaryTestPair.first->second.second = Walker;
    205             Log() << Verbose(2) << "Keeping new vector due to larger distance to molecule center " << helper.NormSquared() << "." << endl;
     205            DoLog(2) && (Log() << Verbose(2) << "Keeping new vector due to larger distance to molecule center " << helper.NormSquared() << "." << endl);
    206206          } else {
    207             Log() << Verbose(2) << "Keeping present vector due to larger distance to molecule center " << oldhelperNorm << "." << endl;
     207            DoLog(2) && (Log() << Verbose(2) << "Keeping present vector due to larger distance to molecule center " << oldhelperNorm << "." << endl);
    208208          }
    209209        } else {
    210           Log() << Verbose(2) << "Keeping present vector due to larger projected distance " << ProjectedVectorNorm << "." << endl;
     210          DoLog(2) && (Log() << Verbose(2) << "Keeping present vector due to larger projected distance " << ProjectedVectorNorm << "." << endl);
    211211        }
    212212      }
     
    227227    // 3c. throw out points whose distance is less than the mean of left and right neighbours
    228228    bool flag = false;
    229     Log() << Verbose(1) << "Looking for candidates to kick out by convex condition ... " << endl;
     229    DoLog(1) && (Log() << Verbose(1) << "Looking for candidates to kick out by convex condition ... " << endl);
    230230    do { // do as long as we still throw one out per round
    231231      flag = false;
     
    282282          const double MinDistance = a * sin(beta) / (sin(delta)) * (((alpha < M_PI / 2.) || (gamma < M_PI / 2.)) ? 1. : -1.);
    283283          //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;
    284           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;
     284          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);
    285285          if ((fabs(h / fabs(h) - MinDistance / fabs(MinDistance)) < MYEPSILON) && ((h - MinDistance)) < -MYEPSILON) {
    286286            // throw out point
    287             Log() << Verbose(1) << "Throwing out " << *runner->second.second << "." << endl;
     287            DoLog(1) && (Log() << Verbose(1) << "Throwing out " << *runner->second.second << "." << endl);
    288288            BoundaryPoints[axis].erase(runner);
    289289            flag = true;
     
    320320      BoundaryPoints = GetBoundaryPoints(mol, TesselStruct);
    321321  } else {
    322       Log() << Verbose(0) << "Using given boundary points set." << endl;
     322      DoLog(0) && (Log() << Verbose(0) << "Using given boundary points set." << endl);
    323323  }
    324324
     
    326326  for (int axis=0; axis < NDIM; axis++)
    327327    {
    328       Log() << Verbose(1) << "Printing list of candidates for axis " << axis << " which we have inserted so far." << endl;
     328      DoLog(1) && (Log() << Verbose(1) << "Printing list of candidates for axis " << axis << " which we have inserted so far." << endl);
    329329      int i=0;
    330330      for(Boundaries::iterator runner = BoundaryPoints[axis].begin(); runner != BoundaryPoints[axis].end(); runner++) {
    331331        if (runner != BoundaryPoints[axis].begin())
    332           Log() << Verbose(0) << ", " << i << ": " << *runner->second.second;
     332          DoLog(0) && (Log() << Verbose(0) << ", " << i << ": " << *runner->second.second);
    333333        else
    334           Log() << Verbose(0) << i << ": " << *runner->second.second;
     334          DoLog(0) && (Log() << Verbose(0) << i << ": " << *runner->second.second);
    335335        i++;
    336336      }
    337       Log() << Verbose(0) << endl;
     337      DoLog(0) && (Log() << Verbose(0) << endl);
    338338    }
    339339
     
    344344          DoeLog(2) && (eLog()<< Verbose(2) << "Point " << *(runner->second.second) << " is already present!" << endl);
    345345
    346   Log() << Verbose(0) << "I found " << TesselStruct->PointsOnBoundaryCount << " points on the convex boundary." << endl;
     346  DoLog(0) && (Log() << Verbose(0) << "I found " << TesselStruct->PointsOnBoundaryCount << " points on the convex boundary." << endl);
    347347  // now we have the whole set of edge points in the BoundaryList
    348348
     
    364364    DoeLog(1) && (eLog()<< Verbose(1) << "Insertion of straddling points failed!" << endl);
    365365
    366   Log() << Verbose(0) << "I created " << TesselStruct->TrianglesOnBoundary.size() << " intermediate triangles with " << TesselStruct->LinesOnBoundary.size() << " lines and " << TesselStruct->PointsOnBoundary.size() << " points." << endl;
     366  DoLog(0) && (Log() << Verbose(0) << "I created " << TesselStruct->TrianglesOnBoundary.size() << " intermediate triangles with " << TesselStruct->LinesOnBoundary.size() << " lines and " << TesselStruct->PointsOnBoundary.size() << " points." << endl);
    367367
    368368  // 4. Store triangles in tecplot file
     
    395395    for (LineMap::iterator LineRunner = TesselStruct->LinesOnBoundary.begin(); LineRunner != TesselStruct->LinesOnBoundary.end(); LineRunner++) {
    396396      line = LineRunner->second;
    397       Log() << Verbose(1) << "INFO: Current line is " << *line << "." << endl;
     397      DoLog(1) && (Log() << Verbose(1) << "INFO: Current line is " << *line << "." << endl);
    398398      if (!line->CheckConvexityCriterion()) {
    399         Log() << Verbose(1) << "... line " << *line << " is concave, flipping it." << endl;
     399        DoLog(1) && (Log() << Verbose(1) << "... line " << *line << " is concave, flipping it." << endl);
    400400
    401401        // flip the line
     
    404404        else {
    405405          TesselStruct->FlipBaseline(line);
    406           Log() << Verbose(1) << "INFO: Correction of concave baselines worked." << endl;
     406          DoLog(1) && (Log() << Verbose(1) << "INFO: Correction of concave baselines worked." << endl);
    407407        }
    408408      }
     
    414414//    Log() << Verbose(1) << "Correction of concave tesselpoints failed!" << endl;
    415415
    416   Log() << Verbose(0) << "I created " << TesselStruct->TrianglesOnBoundary.size() << " triangles with " << TesselStruct->LinesOnBoundary.size() << " lines and " << TesselStruct->PointsOnBoundary.size() << " points." << endl;
     416  DoLog(0) && (Log() << Verbose(0) << "I created " << TesselStruct->TrianglesOnBoundary.size() << " triangles with " << TesselStruct->LinesOnBoundary.size() << " lines and " << TesselStruct->PointsOnBoundary.size() << " points." << endl);
    417417
    418418  // 4. Store triangles in tecplot file
     
    462462  PointMap::iterator PointRunner;
    463463  while (!TesselStruct->PointsOnBoundary.empty()) {
    464     Log() << Verbose(1) << "Remaining points are: ";
     464    DoLog(1) && (Log() << Verbose(1) << "Remaining points are: ");
    465465    for (PointMap::iterator PointSprinter = TesselStruct->PointsOnBoundary.begin(); PointSprinter != TesselStruct->PointsOnBoundary.end(); PointSprinter++)
    466       Log() << Verbose(0) << *(PointSprinter->second) << "\t";
    467     Log() << Verbose(0) << endl;
     466      DoLog(0) && (Log() << Verbose(0) << *(PointSprinter->second) << "\t");
     467    DoLog(0) && (Log() << Verbose(0) << endl);
    468468
    469469    PointRunner = TesselStruct->PointsOnBoundary.begin();
     
    537537      PointAdvance++;
    538538      point = PointRunner->second;
    539       Log() << Verbose(1) << "INFO: Current point is " << *point << "." << endl;
     539      DoLog(1) && (Log() << Verbose(1) << "INFO: Current point is " << *point << "." << endl);
    540540      for (LineMap::iterator LineRunner = point->lines.begin(); LineRunner != point->lines.end(); LineRunner++) {
    541541        line = LineRunner->second;
    542         Log() << Verbose(1) << "INFO: Current line of point " << *point << " is " << *line << "." << endl;
     542        DoLog(1) && (Log() << Verbose(1) << "INFO: Current line of point " << *point << " is " << *line << "." << endl);
    543543        if (!line->CheckConvexityCriterion()) {
    544544          // remove the point if needed
    545           Log() << Verbose(1) << "... point " << *point << " cannot be on convex envelope." << endl;
     545          DoLog(1) && (Log() << Verbose(1) << "... point " << *point << " cannot be on convex envelope." << endl);
    546546          volume += TesselStruct->RemovePointFromTesselatedSurface(point);
    547547          sprintf(dummy, "-first-%d", ++run);
     
    564564      LineAdvance++;
    565565      line = LineRunner->second;
    566       Log() << Verbose(1) << "INFO: Picking farthest baseline for line is " << *line << "." << endl;
     566      DoLog(1) && (Log() << Verbose(1) << "INFO: Picking farthest baseline for line is " << *line << "." << endl);
    567567      // take highest of both lines
    568568      if (TesselStruct->IsConvexRectangle(line) == NULL) {
     
    605605
    606606  // end
    607   Log() << Verbose(0) << "Volume is " << volume << "." << endl;
     607  DoLog(0) && (Log() << Verbose(0) << "Volume is " << volume << "." << endl);
    608608  return volume;
    609609};
     
    734734      totalmass += Walker->type->mass;
    735735  }
    736   Log() << Verbose(0) << "RESULT: The summed mass is " << setprecision(10) << totalmass << " atomicmassunit." << endl;
    737   Log() << Verbose(0) << "RESULT: The average density is " << setprecision(10) << totalmass / clustervolume << " atomicmassunit/" << (IsAngstroem ? "angstrom" : "atomiclength") << "^3." << endl;
     736  DoLog(0) && (Log() << Verbose(0) << "RESULT: The summed mass is " << setprecision(10) << totalmass << " atomicmassunit." << endl);
     737  DoLog(0) && (Log() << Verbose(0) << "RESULT: The average density is " << setprecision(10) << totalmass / clustervolume << " atomicmassunit/" << (IsAngstroem ? "angstrom" : "atomiclength") << "^3." << endl);
    738738
    739739  // solve cubic polynomial
    740   Log() << Verbose(1) << "Solving equidistant suspension in water problem ..." << endl;
     740  DoLog(1) && (Log() << Verbose(1) << "Solving equidistant suspension in water problem ..." << endl);
    741741  if (IsAngstroem)
    742742    cellvolume = (TotalNoClusters * totalmass / SOLVENTDENSITY_A - (totalmass / clustervolume)) / (celldensity - 1);
    743743  else
    744744    cellvolume = (TotalNoClusters * totalmass / SOLVENTDENSITY_a0 - (totalmass / clustervolume)) / (celldensity - 1);
    745   Log() << Verbose(1) << "Cellvolume needed for a density of " << celldensity << " g/cm^3 is " << cellvolume << " " << (IsAngstroem ? "angstrom" : "atomiclength") << "^3." << endl;
     745  DoLog(1) && (Log() << Verbose(1) << "Cellvolume needed for a density of " << celldensity << " g/cm^3 is " << cellvolume << " " << (IsAngstroem ? "angstrom" : "atomiclength") << "^3." << endl);
    746746
    747747  double minimumvolume = TotalNoClusters * (GreatestDiameter[0] * GreatestDiameter[1] * GreatestDiameter[2]);
    748   Log() << Verbose(1) << "Minimum volume of the convex envelope contained in a rectangular box is " << minimumvolume << " atomicmassunit/" << (IsAngstroem ? "angstrom" : "atomiclength") << "^3." << endl;
     748  DoLog(1) && (Log() << Verbose(1) << "Minimum volume of the convex envelope contained in a rectangular box is " << minimumvolume << " atomicmassunit/" << (IsAngstroem ? "angstrom" : "atomiclength") << "^3." << endl);
    749749  if (minimumvolume > cellvolume) {
    750750    DoeLog(1) && (eLog()<< Verbose(1) << "the containing box already has a greater volume than the envisaged cell volume!" << endl);
    751     Log() << Verbose(0) << "Setting Box dimensions to minimum possible, the greatest diameters." << endl;
     751    DoLog(0) && (Log() << Verbose(0) << "Setting Box dimensions to minimum possible, the greatest diameters." << endl);
    752752    for (int i = 0; i < NDIM; i++)
    753753      BoxLengths.x[i] = GreatestDiameter[i];
     
    761761    double x2 = 0.;
    762762    if (gsl_poly_solve_cubic(BoxLengths.x[0], BoxLengths.x[1], BoxLengths.x[2], &x0, &x1, &x2) == 1) // either 1 or 3 on return
    763       Log() << Verbose(0) << "RESULT: The resulting spacing is: " << x0 << " ." << endl;
     763      DoLog(0) && (Log() << Verbose(0) << "RESULT: The resulting spacing is: " << x0 << " ." << endl);
    764764    else {
    765       Log() << Verbose(0) << "RESULT: The resulting spacings are: " << x0 << " and " << x1 << " and " << x2 << " ." << endl;
     765      DoLog(0) && (Log() << Verbose(0) << "RESULT: The resulting spacings are: " << x0 << " and " << x1 << " and " << x2 << " ." << endl);
    766766      x0 = x2; // sorted in ascending order
    767767    }
     
    774774
    775775    // set new box dimensions
    776     Log() << Verbose(0) << "Translating to box with these boundaries." << endl;
     776    DoLog(0) && (Log() << Verbose(0) << "Translating to box with these boundaries." << endl);
    777777    mol->SetBoxDimension(&BoxLengths);
    778778    mol->CenterInBox();
     
    780780  // update Box of atoms by boundary
    781781  mol->SetBoxDimension(&BoxLengths);
    782   Log() << Verbose(0) << "RESULT: The resulting cell dimensions are: " << BoxLengths.x[0] << " and " << BoxLengths.x[1] << " and " << BoxLengths.x[2] << " with total volume of " << cellvolume << " " << (IsAngstroem ? "angstrom" : "atomiclength") << "^3." << endl;
     782  DoLog(0) && (Log() << Verbose(0) << "RESULT: The resulting cell dimensions are: " << BoxLengths.x[0] << " and " << BoxLengths.x[1] << " and " << BoxLengths.x[2] << " with total volume of " << cellvolume << " " << (IsAngstroem ? "angstrom" : "atomiclength") << "^3." << endl);
    783783};
    784784
     
    822822  for (MoleculeList::iterator ListRunner = List->ListOfMolecules.begin(); ListRunner != List->ListOfMolecules.end(); ListRunner++)
    823823    if ((*ListRunner)->AtomCount > 0) {
    824       Log() << Verbose(1) << "Pre-creating linked cell lists for molecule " << *ListRunner << "." << endl;
     824      DoLog(1) && (Log() << Verbose(1) << "Pre-creating linked cell lists for molecule " << *ListRunner << "." << endl);
    825825      LCList[(*ListRunner)] = new LinkedCell((*ListRunner), 10.); // get linked cell list
    826       Log() << Verbose(1) << "Pre-creating tesselation for molecule " << *ListRunner << "." << endl;
     826      DoLog(1) && (Log() << Verbose(1) << "Pre-creating tesselation for molecule " << *ListRunner << "." << endl);
    827827      TesselStruct[(*ListRunner)] = NULL;
    828828      FindNonConvexBorder((*ListRunner), TesselStruct[(*ListRunner)], (const LinkedCell *&)LCList[(*ListRunner)], 5., NULL);
     
    832832  filler->CenterEdge(&Inserter);
    833833  filler->Center.Zero();
    834   Log() << Verbose(2) << "INFO: Filler molecule has the following bonds:" << endl;
     834  DoLog(2) && (Log() << Verbose(2) << "INFO: Filler molecule has the following bonds:" << endl);
    835835  Binder = filler->first;
    836836  while(Binder->next != filler->last) {
    837837    Binder = Binder->next;
    838     Log() << Verbose(2) << "  " << *Binder << endl;
     838    DoLog(2) && (Log() << Verbose(2) << "  " << *Binder << endl);
    839839  }
    840840
     
    847847  for(int i=0;i<NDIM;i++)
    848848    N[i] = (int) ceil(1./FillerDistance.x[i]);
    849   Log() << Verbose(1) << "INFO: Grid steps are " << N[0] << ", " << N[1] << ", " << N[2] << "." << endl;
     849  DoLog(1) && (Log() << Verbose(1) << "INFO: Grid steps are " << N[0] << ", " << N[1] << ", " << N[2] << "." << endl);
    850850
    851851  // initialize seed of random number generator to current time
     
    862862        for (int i=0;i<NDIM;i++)
    863863          FillerTranslations.x[i] = RandomMolDisplacement*(rand()/(RAND_MAX/2.) - 1.);
    864         Log() << Verbose(2) << "INFO: Current Position is " << CurrentPosition << "+" << FillerTranslations << "." << endl;
     864        DoLog(2) && (Log() << Verbose(2) << "INFO: Current Position is " << CurrentPosition << "+" << FillerTranslations << "." << endl);
    865865
    866866        // go through all atoms
     
    917917          // insert into Filling
    918918          if (FillIt) {
    919             Log() << Verbose(1) << "INFO: Position at " << Inserter << " is outer point." << endl;
     919            DoLog(1) && (Log() << Verbose(1) << "INFO: Position at " << Inserter << " is outer point." << endl);
    920920            // copy atom ...
    921921            CopyAtoms[Walker->nr] = new atom(Walker);
    922922            CopyAtoms[Walker->nr]->x.CopyVector(&Inserter);
    923923            Filling->AddAtom(CopyAtoms[Walker->nr]);
    924             Log() << Verbose(4) << "Filling atom " << *Walker << ", translated to " << AtomTranslations << ", at final position is " << (CopyAtoms[Walker->nr]->x) << "." << endl;
     924            DoLog(4) && (Log() << Verbose(4) << "Filling atom " << *Walker << ", translated to " << AtomTranslations << ", at final position is " << (CopyAtoms[Walker->nr]->x) << "." << endl);
    925925          } else {
    926             Log() << Verbose(1) << "INFO: Position at " << Inserter << " is inner point, within boundary or outside of MaxDistance." << endl;
     926            DoLog(1) && (Log() << Verbose(1) << "INFO: Position at " << Inserter << " is inner point, within boundary or outside of MaxDistance." << endl);
    927927            CopyAtoms[Walker->nr] = NULL;
    928928            continue;
     
    965965
    966966  if (TesselStruct == NULL) {
    967     Log() << Verbose(1) << "Allocating Tesselation struct ..." << endl;
     967    DoLog(1) && (Log() << Verbose(1) << "Allocating Tesselation struct ..." << endl);
    968968    TesselStruct= new Tesselation;
    969969  } else {
    970970    delete(TesselStruct);
    971     Log() << Verbose(1) << "Re-Allocating Tesselation struct ..." << endl;
     971    DoLog(1) && (Log() << Verbose(1) << "Re-Allocating Tesselation struct ..." << endl);
    972972    TesselStruct = new Tesselation;
    973973  }
     
    990990  while ((!TesselStruct->OpenLines.empty()) && (OneLoopWithoutSuccessFlag)) {
    991991    // 2a. print OpenLines
    992     Log() << Verbose(1) << "There are " << TesselStruct->OpenLines.size() << " open lines to scan for candidates:" << endl;
     992    DoLog(1) && (Log() << Verbose(1) << "There are " << TesselStruct->OpenLines.size() << " open lines to scan for candidates:" << endl);
    993993    for (CandidateMap::iterator Runner = TesselStruct->OpenLines.begin(); Runner != TesselStruct->OpenLines.end(); Runner++)
    994       Log() << Verbose(1) << " " << *(Runner->second) << endl;
     994      DoLog(1) && (Log() << Verbose(1) << " " << *(Runner->second) << endl);
    995995
    996996    // 2b. find best candidate for each OpenLine
     
    998998
    999999    // 2c. print OpenLines with candidates again
    1000     Log() << Verbose(1) << "There are " << TesselStruct->OpenLines.size() << " open lines to scan for the best candidates:" << endl;
     1000    DoLog(1) && (Log() << Verbose(1) << "There are " << TesselStruct->OpenLines.size() << " open lines to scan for the best candidates:" << endl);
    10011001    for (CandidateMap::iterator Runner = TesselStruct->OpenLines.begin(); Runner != TesselStruct->OpenLines.end(); Runner++)
    1002       Log() << Verbose(1) << " " << *(Runner->second) << endl;
     1002      DoLog(1) && (Log() << Verbose(1) << " " << *(Runner->second) << endl);
    10031003
    10041004    // 2d. search for smallest ShortestAngle among all candidates
     
    10081008        baseline = Runner->second;
    10091009        ShortestAngle = baseline->ShortestAngle;
    1010         Log() << Verbose(1) << "New best candidate is " << *baseline->BaseLine << " with point " << *(*baseline->pointlist.begin()) << " and angle " << baseline->ShortestAngle << endl;
     1010        DoLog(1) && (Log() << Verbose(1) << "New best candidate is " << *baseline->BaseLine << " with point " << *(*baseline->pointlist.begin()) << " and angle " << baseline->ShortestAngle << endl);
    10111011      }
    10121012    }
  • src/builder.cpp

    r6613ec ra67d19  
    132132          if (!valid) DoeLog(2) && (eLog()<< Verbose(2) << "Resulting position out of cell." << endl);
    133133          second = mol->AskAtom("Enter atom number: ");
    134           Log() << Verbose(0) << "Enter relative coordinates." << endl;
     134          DoLog(0) && (Log() << Verbose(0) << "Enter relative coordinates." << endl);
    135135          first->x.AskPosition(World::get()->cell_size, false);
    136136          for (int i=NDIM;i--;) {
     
    175175            continue;
    176176          }
    177           Log() << Verbose(0) << "resulting relative coordinates: ";
     177          DoLog(0) && (Log() << Verbose(0) << "resulting relative coordinates: ");
    178178          z.Output();
    179           Log() << Verbose(0) << endl;
     179          DoLog(0) && (Log() << Verbose(0) << endl);
    180180          */
    181181          // calc axis vector
     
    185185          Log() << Verbose(0) << "x: ",
    186186          x.Output();
    187           Log() << Verbose(0) << endl;
     187          DoLog(0) && (Log() << Verbose(0) << endl);
    188188          z.MakeNormalVector(&second->x,&third->x,&fourth->x);
    189189          Log() << Verbose(0) << "z: ",
    190190          z.Output();
    191           Log() << Verbose(0) << endl;
     191          DoLog(0) && (Log() << Verbose(0) << endl);
    192192          y.MakeNormalVector(&x,&z);
    193193          Log() << Verbose(0) << "y: ",
    194194          y.Output();
    195           Log() << Verbose(0) << endl;
     195          DoLog(0) && (Log() << Verbose(0) << endl);
    196196
    197197          // rotate vector around first angle
     
    200200          Log() << Verbose(0) << "Rotated vector: ",
    201201          first->x.Output();
    202           Log() << Verbose(0) << endl;
     202          DoLog(0) && (Log() << Verbose(0) << endl);
    203203          // remove the projection onto the rotation plane of the second angle
    204204          n.CopyVector(&y);
     
    206206          Log() << Verbose(0) << "N1: ",
    207207          n.Output();
    208           Log() << Verbose(0) << endl;
     208          DoLog(0) && (Log() << Verbose(0) << endl);
    209209          first->x.SubtractVector(&n);
    210210          Log() << Verbose(0) << "Subtracted vector: ",
    211211          first->x.Output();
    212           Log() << Verbose(0) << endl;
     212          DoLog(0) && (Log() << Verbose(0) << endl);
    213213          n.CopyVector(&z);
    214214          n.Scale(first->x.ScalarProduct(&z));
    215215          Log() << Verbose(0) << "N2: ",
    216216          n.Output();
    217           Log() << Verbose(0) << endl;
     217          DoLog(0) && (Log() << Verbose(0) << endl);
    218218          first->x.SubtractVector(&n);
    219219          Log() << Verbose(0) << "2nd subtracted vector: ",
    220220          first->x.Output();
    221           Log() << Verbose(0) << endl;
     221          DoLog(0) && (Log() << Verbose(0) << endl);
    222222
    223223          // rotate another vector around second angle
     
    226226          Log() << Verbose(0) << "2nd Rotated vector: ",
    227227          n.Output();
    228           Log() << Verbose(0) << endl;
     228          DoLog(0) && (Log() << Verbose(0) << endl);
    229229
    230230          // add the two linear independent vectors
     
    234234          first->x.AddVector(&second->x);
    235235
    236           Log() << Verbose(0) << "resulting coordinates: ";
     236          DoLog(0) && (Log() << Verbose(0) << "resulting coordinates: ");
    237237          first->x.Output();
    238           Log() << Verbose(0) << endl;
     238          DoLog(0) && (Log() << Verbose(0) << endl);
    239239        } while (!(valid = mol->CheckBounds((const Vector *)&first->x)));
    240240        first->type = periode->AskElement();  // give type
     
    388388      cout << Verbose(0) << "Offset vector: ";
    389389      x.Output();
    390       Log() << Verbose(0) << endl;
     390      DoLog(0) && (Log() << Verbose(0) << endl);
    391391      n.Normalize();
    392392      break;
    393393  };
    394   Log() << Verbose(0) << "Alignment vector: ";
     394  DoLog(0) && (Log() << Verbose(0) << "Alignment vector: ");
    395395  n.Output();
    396   Log() << Verbose(0) << endl;
     396  DoLog(0) && (Log() << Verbose(0) << endl);
    397397  mol->Align(&n);
    398398};
     
    407407  char choice;  // menu choice char
    408408
    409   Log() << Verbose(0) << "===========MIRROR ATOMS=========================" << endl;
    410   Log() << Verbose(0) << " a - state three atoms defining mirror plane" << endl;
    411   Log() << Verbose(0) << " b - state normal vector of mirror plane" << endl;
    412   Log() << Verbose(0) << " c - state two atoms in normal direction" << endl;
    413   Log() << Verbose(0) << "all else - go back" << endl;
    414   Log() << Verbose(0) << "===============================================" << endl;
    415   Log() << Verbose(0) << "INPUT: ";
     409  DoLog(0) && (Log() << Verbose(0) << "===========MIRROR ATOMS=========================" << endl);
     410  DoLog(0) && (Log() << Verbose(0) << " a - state three atoms defining mirror plane" << endl);
     411  DoLog(0) && (Log() << Verbose(0) << " b - state normal vector of mirror plane" << endl);
     412  DoLog(0) && (Log() << Verbose(0) << " c - state two atoms in normal direction" << endl);
     413  DoLog(0) && (Log() << Verbose(0) << "all else - go back" << endl);
     414  DoLog(0) && (Log() << Verbose(0) << "===============================================" << endl);
     415  DoLog(0) && (Log() << Verbose(0) << "INPUT: ");
    416416  cin >> choice;
    417417
     
    426426      break;
    427427    case 'b': // normal vector of mirror plane
    428       Log() << Verbose(0) << "Enter normal vector of mirror plane." << endl;
     428      DoLog(0) && (Log() << Verbose(0) << "Enter normal vector of mirror plane." << endl);
    429429      n.AskPosition(World::get()->cell_size,0);
    430430      n.Normalize();
     
    439439      break;
    440440  };
    441   Log() << Verbose(0) << "Normal vector: ";
     441  DoLog(0) && (Log() << Verbose(0) << "Normal vector: ");
    442442  n.Output();
    443   Log() << Verbose(0) << endl;
     443  DoLog(0) && (Log() << Verbose(0) << endl);
    444444  mol->Mirror((const Vector *)&n);
    445445};
     
    455455  char choice;  // menu choice char
    456456
    457   Log() << Verbose(0) << "===========REMOVE ATOMS=========================" << endl;
    458   Log() << Verbose(0) << " a - state atom for removal by number" << endl;
    459   Log() << Verbose(0) << " b - keep only in radius around atom" << endl;
    460   Log() << Verbose(0) << " c - remove this with one axis greater value" << endl;
    461   Log() << Verbose(0) << "all else - go back" << endl;
    462   Log() << Verbose(0) << "===============================================" << endl;
    463   Log() << Verbose(0) << "INPUT: ";
     457  DoLog(0) && (Log() << Verbose(0) << "===========REMOVE ATOMS=========================" << endl);
     458  DoLog(0) && (Log() << Verbose(0) << " a - state atom for removal by number" << endl);
     459  DoLog(0) && (Log() << Verbose(0) << " b - keep only in radius around atom" << endl);
     460  DoLog(0) && (Log() << Verbose(0) << " c - remove this with one axis greater value" << endl);
     461  DoLog(0) && (Log() << Verbose(0) << "all else - go back" << endl);
     462  DoLog(0) && (Log() << Verbose(0) << "===============================================" << endl);
     463  DoLog(0) && (Log() << Verbose(0) << "INPUT: ");
    464464  cin >> choice;
    465465
     
    468468    case 'a':
    469469      if (mol->RemoveAtom(mol->AskAtom("Enter number of atom within molecule: ")))
    470         Log() << Verbose(1) << "Atom removed." << endl;
     470        DoLog(1) && (Log() << Verbose(1) << "Atom removed." << endl);
    471471      else
    472         Log() << Verbose(1) << "Atom not found." << endl;
     472        DoLog(1) && (Log() << Verbose(1) << "Atom not found." << endl);
    473473      break;
    474474    case 'b':
    475475      second = mol->AskAtom("Enter number of atom as reference point: ");
    476       Log() << Verbose(0) << "Enter radius: ";
     476      DoLog(0) && (Log() << Verbose(0) << "Enter radius: ");
    477477      cin >> tmp1;
    478478      first = mol->start;
     
    486486      break;
    487487    case 'c':
    488       Log() << Verbose(0) << "Which axis is it: ";
     488      DoLog(0) && (Log() << Verbose(0) << "Which axis is it: ");
    489489      cin >> axis;
    490       Log() << Verbose(0) << "Lower boundary: ";
     490      DoLog(0) && (Log() << Verbose(0) << "Lower boundary: ");
    491491      cin >> tmp1;
    492       Log() << Verbose(0) << "Upper boundary: ";
     492      DoLog(0) && (Log() << Verbose(0) << "Upper boundary: ");
    493493      cin >> tmp2;
    494494      first = mol->start;
     
    520520  char choice;  // menu choice char
    521521
    522   Log() << Verbose(0) << "===========MEASURE ATOMS=========================" << endl;
    523   Log() << Verbose(0) << " a - calculate bond length between one atom and all others" << endl;
    524   Log() << Verbose(0) << " b - calculate bond length between two atoms" << endl;
    525   Log() << Verbose(0) << " c - calculate bond angle" << endl;
    526   Log() << Verbose(0) << " d - calculate principal axis of the system" << endl;
    527   Log() << Verbose(0) << " e - calculate volume of the convex envelope" << endl;
    528   Log() << Verbose(0) << " f - calculate temperature from current velocity" << endl;
    529   Log() << Verbose(0) << " g - output all temperatures per step from velocities" << endl;
    530   Log() << Verbose(0) << "all else - go back" << endl;
    531   Log() << Verbose(0) << "===============================================" << endl;
    532   Log() << Verbose(0) << "INPUT: ";
     522  DoLog(0) && (Log() << Verbose(0) << "===========MEASURE ATOMS=========================" << endl);
     523  DoLog(0) && (Log() << Verbose(0) << " a - calculate bond length between one atom and all others" << endl);
     524  DoLog(0) && (Log() << Verbose(0) << " b - calculate bond length between two atoms" << endl);
     525  DoLog(0) && (Log() << Verbose(0) << " c - calculate bond angle" << endl);
     526  DoLog(0) && (Log() << Verbose(0) << " d - calculate principal axis of the system" << endl);
     527  DoLog(0) && (Log() << Verbose(0) << " e - calculate volume of the convex envelope" << endl);
     528  DoLog(0) && (Log() << Verbose(0) << " f - calculate temperature from current velocity" << endl);
     529  DoLog(0) && (Log() << Verbose(0) << " g - output all temperatures per step from velocities" << endl);
     530  DoLog(0) && (Log() << Verbose(0) << "all else - go back" << endl);
     531  DoLog(0) && (Log() << Verbose(0) << "===============================================" << endl);
     532  DoLog(0) && (Log() << Verbose(0) << "INPUT: ");
    533533  cin >> choice;
    534534
    535535  switch(choice) {
    536536    default:
    537       Log() << Verbose(1) << "Not a valid choice." << endl;
     537      DoLog(1) && (Log() << Verbose(1) << "Not a valid choice." << endl);
    538538      break;
    539539    case 'a':
     
    567567      x.SubtractVector((const Vector *)&second->x);
    568568      tmp1 = x.Norm();
    569       Log() << Verbose(1) << "Distance vector is ";
     569      DoLog(1) && (Log() << Verbose(1) << "Distance vector is ");
    570570      x.Output();
    571       Log() << Verbose(0) << "." << endl << "Norm of distance is " << tmp1 << "." << endl;
     571      DoLog(0) && (Log() << Verbose(0) << "." << endl << "Norm of distance is " << tmp1 << "." << endl);
    572572      break;
    573573
    574574    case 'c':
    575       Log() << Verbose(0) << "Evaluating bond angle between three - first, central, last - atoms." << endl;
     575      DoLog(0) && (Log() << Verbose(0) << "Evaluating bond angle between three - first, central, last - atoms." << endl);
    576576      first = mol->AskAtom("Enter first atom: ");
    577577      second = mol->AskAtom("Enter central atom: ");
     
    582582      y.CopyVector((const Vector *)&third->x);
    583583      y.SubtractVector((const Vector *)&second->x);
    584       Log() << Verbose(0) << "Bond angle between first atom Nr." << first->nr << ", central atom Nr." << second->nr << " and last atom Nr." << third->nr << ": ";
    585       Log() << Verbose(0) << (acos(x.ScalarProduct((const Vector *)&y)/(y.Norm()*x.Norm()))/M_PI*180.) << " degrees" << endl;
     584      DoLog(0) && (Log() << Verbose(0) << "Bond angle between first atom Nr." << first->nr << ", central atom Nr." << second->nr << " and last atom Nr." << third->nr << ": ");
     585      DoLog(0) && (Log() << Verbose(0) << (acos(x.ScalarProduct((const Vector *)&y)/(y.Norm()*x.Norm()))/M_PI*180.) << " degrees" << endl);
    586586      break;
    587587    case 'd':
    588       Log() << Verbose(0) << "Evaluating prinicipal axis." << endl;
    589       Log() << Verbose(0) << "Shall we rotate? [0/1]: ";
     588      DoLog(0) && (Log() << Verbose(0) << "Evaluating prinicipal axis." << endl);
     589      DoLog(0) && (Log() << Verbose(0) << "Shall we rotate? [0/1]: ");
    590590      cin >> Z;
    591591      if ((Z >=0) && (Z <=1))
     
    596596    case 'e':
    597597      {
    598         Log() << Verbose(0) << "Evaluating volume of the convex envelope.";
     598        DoLog(0) && (Log() << Verbose(0) << "Evaluating volume of the convex envelope.");
    599599        class Tesselation *TesselStruct = NULL;
    600600        const LinkedCell *LCList = NULL;
     
    602602        FindConvexBorder(mol, TesselStruct, LCList, NULL);
    603603        double clustervolume = VolumeOfConvexEnvelope(TesselStruct, configuration);
    604         Log() << Verbose(0) << "The tesselated surface area is " << clustervolume << "." << endl;\
     604        DoLog(0) && (Log() << Verbose(0) << "The tesselated surface area is " << clustervolume << "." << endl);\
    605605        delete(LCList);
    606606        delete(TesselStruct);
     
    613613      {
    614614        char filename[255];
    615         Log() << Verbose(0) << "Please enter filename: " << endl;
     615        DoLog(0) && (Log() << Verbose(0) << "Please enter filename: " << endl);
    616616        cin >> filename;
    617         Log() << Verbose(1) << "Storing temperatures in " << filename << "." << endl;
     617        DoLog(1) && (Log() << Verbose(1) << "Storing temperatures in " << filename << "." << endl);
    618618        ofstream *output = new ofstream(filename, ios::trunc);
    619619        if (!mol->OutputTemperatureFromTrajectories(output, 0, mol->MDSteps))
    620           Log() << Verbose(2) << "File could not be written." << endl;
     620          DoLog(2) && (Log() << Verbose(2) << "File could not be written." << endl);
    621621        else
    622           Log() << Verbose(2) << "File stored." << endl;
     622          DoLog(2) && (Log() << Verbose(2) << "File stored." << endl);
    623623        output->close();
    624624        delete(output);
     
    637637  clock_t start, end;
    638638
    639   Log() << Verbose(0) << "Fragmenting molecule with current connection matrix ..." << endl;
    640   Log() << Verbose(0) << "What's the desired bond order: ";
     639  DoLog(0) && (Log() << Verbose(0) << "Fragmenting molecule with current connection matrix ..." << endl);
     640  DoLog(0) && (Log() << Verbose(0) << "What's the desired bond order: ");
    641641  cin >> Order1;
    642642  if (mol->first->next != mol->last) {  // there are bonds
     
    644644    mol->FragmentMolecule(Order1, configuration);
    645645    end = clock();
    646     Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl;
     646    DoLog(0) && (Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl);
    647647  } else
    648     Log() << Verbose(0) << "Connection matrix has not yet been generated!" << endl;
     648    DoLog(0) && (Log() << Verbose(0) << "Connection matrix has not yet been generated!" << endl);
    649649};
    650650
     
    665665  bool valid;
    666666
    667   Log() << Verbose(0) << "=========MANIPULATE ATOMS======================" << endl;
    668   Log() << Verbose(0) << "a - add an atom" << endl;
    669   Log() << Verbose(0) << "r - remove an atom" << endl;
    670   Log() << Verbose(0) << "b - scale a bond between atoms" << endl;
    671   Log() << Verbose(0) << "t - turn an atom round another bond" << endl;
    672   Log() << Verbose(0) << "u - change an atoms element" << endl;
    673   Log() << Verbose(0) << "l - measure lengths, angles, ... for an atom" << endl;
    674   Log() << Verbose(0) << "all else - go back" << endl;
    675   Log() << Verbose(0) << "===============================================" << endl;
     667  DoLog(0) && (Log() << Verbose(0) << "=========MANIPULATE ATOMS======================" << endl);
     668  DoLog(0) && (Log() << Verbose(0) << "a - add an atom" << endl);
     669  DoLog(0) && (Log() << Verbose(0) << "r - remove an atom" << endl);
     670  DoLog(0) && (Log() << Verbose(0) << "b - scale a bond between atoms" << endl);
     671  DoLog(0) && (Log() << Verbose(0) << "t - turn an atom round another bond" << endl);
     672  DoLog(0) && (Log() << Verbose(0) << "u - change an atoms element" << endl);
     673  DoLog(0) && (Log() << Verbose(0) << "l - measure lengths, angles, ... for an atom" << endl);
     674  DoLog(0) && (Log() << Verbose(0) << "all else - go back" << endl);
     675  DoLog(0) && (Log() << Verbose(0) << "===============================================" << endl);
    676676  if (molecules->NumberOfActiveMolecules() > 1)
    677677    DoeLog(2) && (eLog()<< Verbose(2) << "There is more than one molecule active! Atoms will be added to each." << endl);
    678   Log() << Verbose(0) << "INPUT: ";
     678  DoLog(0) && (Log() << Verbose(0) << "INPUT: ");
    679679  cin >> choice;
    680680
    681681  switch (choice) {
    682682    default:
    683       Log() << Verbose(0) << "Not a valid choice." << endl;
     683      DoLog(0) && (Log() << Verbose(0) << "Not a valid choice." << endl);
    684684      break;
    685685
     
    688688        if ((*ListRunner)->ActiveFlag) {
    689689        mol = *ListRunner;
    690         Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;
     690        DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl);
    691691        AddAtoms(periode, mol);
    692692      }
     
    697697        if ((*ListRunner)->ActiveFlag) {
    698698        mol = *ListRunner;
    699         Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;
    700         Log() << Verbose(0) << "Scaling bond length between two atoms." << endl;
     699        DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl);
     700        DoLog(0) && (Log() << Verbose(0) << "Scaling bond length between two atoms." << endl);
    701701        first = mol->AskAtom("Enter first (fixed) atom: ");
    702702        second = mol->AskAtom("Enter second (shifting) atom: ");
     
    705705          minBond += (first->x.x[i]-second->x.x[i])*(first->x.x[i] - second->x.x[i]);
    706706        minBond = sqrt(minBond);
    707         Log() << Verbose(0) << "Current Bond length between " << first->type->name << " Atom " << first->nr << " and " << second->type->name << " Atom " << second->nr << ": " << minBond << " a.u." << endl;
    708         Log() << Verbose(0) << "Enter new bond length [a.u.]: ";
     707        DoLog(0) && (Log() << Verbose(0) << "Current Bond length between " << first->type->name << " Atom " << first->nr << " and " << second->type->name << " Atom " << second->nr << ": " << minBond << " a.u." << endl);
     708        DoLog(0) && (Log() << Verbose(0) << "Enter new bond length [a.u.]: ");
    709709        cin >> bond;
    710710        for (int i=NDIM;i--;) {
     
    720720        if ((*ListRunner)->ActiveFlag) {
    721721        mol = *ListRunner;
    722         Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;
    723        Log() << Verbose(0) << "Angstroem -> Bohrradius: 1.8897261\t\tBohrradius -> Angstroem: 0.52917721" << endl;
    724        Log() << Verbose(0) << "Enter three factors: ";
     722        DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl);
     723       DoLog(0) && (Log() << Verbose(0) << "Angstroem -> Bohrradius: 1.8897261\t\tBohrradius -> Angstroem: 0.52917721" << endl);
     724       DoLog(0) && (Log() << Verbose(0) << "Enter three factors: ");
    725725       factor = new double[NDIM];
    726726       cin >> factor[0];
     
    737737        if ((*ListRunner)->ActiveFlag) {
    738738        mol = *ListRunner;
    739         Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;
     739        DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl);
    740740        MeasureAtoms(periode, mol, configuration);
    741741      }
     
    746746        if ((*ListRunner)->ActiveFlag) {
    747747        mol = *ListRunner;
    748         Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;
     748        DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl);
    749749        RemoveAtoms(mol);
    750750      }
     
    755755        if ((*ListRunner)->ActiveFlag) {
    756756          mol = *ListRunner;
    757           Log() << Verbose(0) << "Turning atom around another bond - first is atom to turn, second (central) and third specify bond" << endl;
     757          DoLog(0) && (Log() << Verbose(0) << "Turning atom around another bond - first is atom to turn, second (central) and third specify bond" << endl);
    758758          first = mol->AskAtom("Enter turning atom: ");
    759759          second = mol->AskAtom("Enter central atom: ");
     
    789789        int Z;
    790790        mol = *ListRunner;
    791         Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;
     791        DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl);
    792792        first = NULL;
    793793        do {
    794           Log() << Verbose(0) << "Change the element of which atom: ";
     794          DoLog(0) && (Log() << Verbose(0) << "Change the element of which atom: ");
    795795          cin >> Z;
    796796        } while ((first = mol->FindAtom(Z)) == NULL);
    797         Log() << Verbose(0) << "New element by atomic number Z: ";
     797        DoLog(0) && (Log() << Verbose(0) << "New element by atomic number Z: ");
    798798        cin >> Z;
    799799        first->type = periode->FindElement(Z);
    800         Log() << Verbose(0) << "Atom " << first->nr << "'s element is " << first->type->name << "." << endl;
     800        DoLog(0) && (Log() << Verbose(0) << "Atom " << first->nr << "'s element is " << first->type->name << "." << endl);
    801801      }
    802802      break;
     
    819819  MoleculeLeafClass *Subgraphs = NULL;
    820820
    821   Log() << Verbose(0) << "=========MANIPULATE GLOBALLY===================" << endl;
    822   Log() << Verbose(0) << "c - scale by unit transformation" << endl;
    823   Log() << Verbose(0) << "d - duplicate molecule/periodic cell" << endl;
    824   Log() << Verbose(0) << "f - fragment molecule many-body bond order style" << endl;
    825   Log() << Verbose(0) << "g - center atoms in box" << endl;
    826   Log() << Verbose(0) << "i - realign molecule" << endl;
    827   Log() << Verbose(0) << "m - mirror all molecules" << endl;
    828   Log() << Verbose(0) << "o - create connection matrix" << endl;
    829   Log() << Verbose(0) << "t - translate molecule by vector" << endl;
    830   Log() << Verbose(0) << "all else - go back" << endl;
    831   Log() << Verbose(0) << "===============================================" << endl;
     821  DoLog(0) && (Log() << Verbose(0) << "=========MANIPULATE GLOBALLY===================" << endl);
     822  DoLog(0) && (Log() << Verbose(0) << "c - scale by unit transformation" << endl);
     823  DoLog(0) && (Log() << Verbose(0) << "d - duplicate molecule/periodic cell" << endl);
     824  DoLog(0) && (Log() << Verbose(0) << "f - fragment molecule many-body bond order style" << endl);
     825  DoLog(0) && (Log() << Verbose(0) << "g - center atoms in box" << endl);
     826  DoLog(0) && (Log() << Verbose(0) << "i - realign molecule" << endl);
     827  DoLog(0) && (Log() << Verbose(0) << "m - mirror all molecules" << endl);
     828  DoLog(0) && (Log() << Verbose(0) << "o - create connection matrix" << endl);
     829  DoLog(0) && (Log() << Verbose(0) << "t - translate molecule by vector" << endl);
     830  DoLog(0) && (Log() << Verbose(0) << "all else - go back" << endl);
     831  DoLog(0) && (Log() << Verbose(0) << "===============================================" << endl);
    832832  if (molecules->NumberOfActiveMolecules() > 1)
    833833    DoeLog(2) && (eLog()<< Verbose(2) << "There is more than one molecule active! Atoms will be added to each." << endl);
    834   Log() << Verbose(0) << "INPUT: ";
     834  DoLog(0) && (Log() << Verbose(0) << "INPUT: ");
    835835  cin >> choice;
    836836
    837837  switch (choice) {
    838838    default:
    839       Log() << Verbose(0) << "Not a valid choice." << endl;
     839      DoLog(0) && (Log() << Verbose(0) << "Not a valid choice." << endl);
    840840      break;
    841841
     
    844844        if ((*ListRunner)->ActiveFlag) {
    845845        mol = *ListRunner;
    846         Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;
    847         Log() << Verbose(0) << "State the axis [(+-)123]: ";
     846        DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl);
     847        DoLog(0) && (Log() << Verbose(0) << "State the axis [(+-)123]: ");
    848848        cin >> axis;
    849         Log() << Verbose(0) << "State the factor: ";
     849        DoLog(0) && (Log() << Verbose(0) << "State the factor: ");
    850850        cin >> faktor;
    851851
     
    903903        if ((*ListRunner)->ActiveFlag) {
    904904        mol = *ListRunner;
    905         Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;
     905        DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl);
    906906        CenterAtoms(mol);
    907907      }
     
    912912        if ((*ListRunner)->ActiveFlag) {
    913913        mol = *ListRunner;
    914         Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;
     914        DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl);
    915915        AlignAtoms(periode, mol);
    916916      }
     
    921921        if ((*ListRunner)->ActiveFlag) {
    922922        mol = *ListRunner;
    923         Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;
     923        DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl);
    924924        MirrorAtoms(mol);
    925925      }
     
    932932          double bonddistance;
    933933          clock_t start,end;
    934           Log() << Verbose(0) << "What's the maximum bond distance: ";
     934          DoLog(0) && (Log() << Verbose(0) << "What's the maximum bond distance: ");
    935935          cin >> bonddistance;
    936936          start = clock();
    937937          mol->CreateAdjacencyList(bonddistance, configuration->GetIsAngstroem(), &BondGraph::CovalentMinMaxDistance, NULL);
    938938          end = clock();
    939           Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl;
     939          DoLog(0) && (Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl);
    940940        }
    941941      break;
     
    945945        if ((*ListRunner)->ActiveFlag) {
    946946        mol = *ListRunner;
    947         Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;
    948         Log() << Verbose(0) << "Enter translation vector." << endl;
     947        DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl);
     948        DoLog(0) && (Log() << Verbose(0) << "Enter translation vector." << endl);
    949949        x.AskPosition(World::get()->cell_size,0);
    950950        mol->Center.AddVector((const Vector *)&x);
     
    974974  molecule *mol = NULL;
    975975
    976   Log() << Verbose(0) << "==========EDIT MOLECULES=====================" << endl;
    977   Log() << Verbose(0) << "c - create new molecule" << endl;
    978   Log() << Verbose(0) << "l - load molecule from xyz file" << endl;
    979   Log() << Verbose(0) << "n - change molecule's name" << endl;
    980   Log() << Verbose(0) << "N - give molecules filename" << endl;
    981   Log() << Verbose(0) << "p - parse atoms in xyz file into molecule" << endl;
    982   Log() << Verbose(0) << "r - remove a molecule" << endl;
    983   Log() << Verbose(0) << "all else - go back" << endl;
    984   Log() << Verbose(0) << "===============================================" << endl;
    985   Log() << Verbose(0) << "INPUT: ";
     976  DoLog(0) && (Log() << Verbose(0) << "==========EDIT MOLECULES=====================" << endl);
     977  DoLog(0) && (Log() << Verbose(0) << "c - create new molecule" << endl);
     978  DoLog(0) && (Log() << Verbose(0) << "l - load molecule from xyz file" << endl);
     979  DoLog(0) && (Log() << Verbose(0) << "n - change molecule's name" << endl);
     980  DoLog(0) && (Log() << Verbose(0) << "N - give molecules filename" << endl);
     981  DoLog(0) && (Log() << Verbose(0) << "p - parse atoms in xyz file into molecule" << endl);
     982  DoLog(0) && (Log() << Verbose(0) << "r - remove a molecule" << endl);
     983  DoLog(0) && (Log() << Verbose(0) << "all else - go back" << endl);
     984  DoLog(0) && (Log() << Verbose(0) << "===============================================" << endl);
     985  DoLog(0) && (Log() << Verbose(0) << "INPUT: ");
    986986  cin >> choice;
    987987
    988988  switch (choice) {
    989989    default:
    990       Log() << Verbose(0) << "Not a valid choice." << endl;
     990      DoLog(0) && (Log() << Verbose(0) << "Not a valid choice." << endl);
    991991      break;
    992992    case 'c':
     
    998998      {
    999999        char filename[MAXSTRINGSIZE];
    1000         Log() << Verbose(0) << "Format should be XYZ with: ShorthandOfElement\tX\tY\tZ" << endl;
     1000        DoLog(0) && (Log() << Verbose(0) << "Format should be XYZ with: ShorthandOfElement\tX\tY\tZ" << endl);
    10011001        mol = new molecule(periode);
    10021002        do {
    1003           Log() << Verbose(0) << "Enter file name: ";
     1003          DoLog(0) && (Log() << Verbose(0) << "Enter file name: ");
    10041004          cin >> filename;
    10051005        } while (!mol->AddXYZFile(filename));
     
    10221022        char filename[MAXSTRINGSIZE];
    10231023        do {
    1024           Log() << Verbose(0) << "Enter index of molecule: ";
     1024          DoLog(0) && (Log() << Verbose(0) << "Enter index of molecule: ");
    10251025          cin >> nr;
    10261026          mol = molecules->ReturnIndex(nr);
    10271027        } while (mol == NULL);
    1028         Log() << Verbose(0) << "Enter name: ";
     1028        DoLog(0) && (Log() << Verbose(0) << "Enter name: ");
    10291029        cin >> filename;
    10301030        strcpy(mol->name, filename);
     
    10361036        char filename[MAXSTRINGSIZE];
    10371037        do {
    1038           Log() << Verbose(0) << "Enter index of molecule: ";
     1038          DoLog(0) && (Log() << Verbose(0) << "Enter index of molecule: ");
    10391039          cin >> nr;
    10401040          mol = molecules->ReturnIndex(nr);
    10411041        } while (mol == NULL);
    1042         Log() << Verbose(0) << "Enter name: ";
     1042        DoLog(0) && (Log() << Verbose(0) << "Enter name: ");
    10431043        cin >> filename;
    10441044        mol->SetNameFromFilename(filename);
     
    10511051        mol = NULL;
    10521052        do {
    1053           Log() << Verbose(0) << "Enter index of molecule: ";
     1053          DoLog(0) && (Log() << Verbose(0) << "Enter index of molecule: ");
    10541054          cin >> nr;
    10551055          mol = molecules->ReturnIndex(nr);
    10561056        } while (mol == NULL);
    1057         Log() << Verbose(0) << "Format should be XYZ with: ShorthandOfElement\tX\tY\tZ" << endl;
     1057        DoLog(0) && (Log() << Verbose(0) << "Format should be XYZ with: ShorthandOfElement\tX\tY\tZ" << endl);
    10581058        do {
    1059           Log() << Verbose(0) << "Enter file name: ";
     1059          DoLog(0) && (Log() << Verbose(0) << "Enter file name: ");
    10601060          cin >> filename;
    10611061        } while (!mol->AddXYZFile(filename));
     
    10651065
    10661066    case 'r':
    1067       Log() << Verbose(0) << "Enter index of molecule: ";
     1067      DoLog(0) && (Log() << Verbose(0) << "Enter index of molecule: ");
    10681068      cin >> nr;
    10691069      count = 1;
     
    10881088  char choice;  // menu choice char
    10891089
    1090   Log() << Verbose(0) << "===========MERGE MOLECULES=====================" << endl;
    1091   Log() << Verbose(0) << "a - simple add of one molecule to another" << endl;
    1092   Log() << Verbose(0) << "b - count the number of bonds of two elements" << endl;
    1093   Log() << Verbose(0) << "B - count the number of bonds of three elements " << endl;
    1094   Log() << Verbose(0) << "e - embedding merge of two molecules" << endl;
    1095   Log() << Verbose(0) << "h - count the number of hydrogen bonds" << endl;
    1096   Log() << Verbose(0) << "b - count the number of hydrogen bonds" << endl;
    1097   Log() << Verbose(0) << "m - multi-merge of all molecules" << endl;
    1098   Log() << Verbose(0) << "s - scatter merge of two molecules" << endl;
    1099   Log() << Verbose(0) << "t - simple merge of two molecules" << endl;
    1100   Log() << Verbose(0) << "all else - go back" << endl;
    1101   Log() << Verbose(0) << "===============================================" << endl;
    1102   Log() << Verbose(0) << "INPUT: ";
     1090  DoLog(0) && (Log() << Verbose(0) << "===========MERGE MOLECULES=====================" << endl);
     1091  DoLog(0) && (Log() << Verbose(0) << "a - simple add of one molecule to another" << endl);
     1092  DoLog(0) && (Log() << Verbose(0) << "b - count the number of bonds of two elements" << endl);
     1093  DoLog(0) && (Log() << Verbose(0) << "B - count the number of bonds of three elements " << endl);
     1094  DoLog(0) && (Log() << Verbose(0) << "e - embedding merge of two molecules" << endl);
     1095  DoLog(0) && (Log() << Verbose(0) << "h - count the number of hydrogen bonds" << endl);
     1096  DoLog(0) && (Log() << Verbose(0) << "b - count the number of hydrogen bonds" << endl);
     1097  DoLog(0) && (Log() << Verbose(0) << "m - multi-merge of all molecules" << endl);
     1098  DoLog(0) && (Log() << Verbose(0) << "s - scatter merge of two molecules" << endl);
     1099  DoLog(0) && (Log() << Verbose(0) << "t - simple merge of two molecules" << endl);
     1100  DoLog(0) && (Log() << Verbose(0) << "all else - go back" << endl);
     1101  DoLog(0) && (Log() << Verbose(0) << "===============================================" << endl);
     1102  DoLog(0) && (Log() << Verbose(0) << "INPUT: ");
    11031103  cin >> choice;
    11041104
    11051105  switch (choice) {
    11061106    default:
    1107       Log() << Verbose(0) << "Not a valid choice." << endl;
     1107      DoLog(0) && (Log() << Verbose(0) << "Not a valid choice." << endl);
    11081108      break;
    11091109
     
    11141114        {
    11151115          do {
    1116             Log() << Verbose(0) << "Enter index of destination molecule: ";
     1116            DoLog(0) && (Log() << Verbose(0) << "Enter index of destination molecule: ");
    11171117            cin >> dest;
    11181118            destmol = molecules->ReturnIndex(dest);
    11191119          } while ((destmol == NULL) && (dest != -1));
    11201120          do {
    1121             Log() << Verbose(0) << "Enter index of source molecule to add from: ";
     1121            DoLog(0) && (Log() << Verbose(0) << "Enter index of source molecule to add from: ");
    11221122            cin >> src;
    11231123            srcmol = molecules->ReturnIndex(src);
     
    11861186        molecule *srcmol = NULL, *destmol = NULL;
    11871187        do {
    1188           Log() << Verbose(0) << "Enter index of matrix molecule (the variable one): ";
     1188          DoLog(0) && (Log() << Verbose(0) << "Enter index of matrix molecule (the variable one): ");
    11891189          cin >> src;
    11901190          srcmol = molecules->ReturnIndex(src);
    11911191        } while ((srcmol == NULL) && (src != -1));
    11921192        do {
    1193           Log() << Verbose(0) << "Enter index of molecule to merge into (the fixed one): ";
     1193          DoLog(0) && (Log() << Verbose(0) << "Enter index of molecule to merge into (the fixed one): ");
    11941194          cin >> dest;
    11951195          destmol = molecules->ReturnIndex(dest);
     
    12151215        molecule *mol = NULL;
    12161216        do {
    1217           Log() << Verbose(0) << "Enter index of molecule to merge into: ";
     1217          DoLog(0) && (Log() << Verbose(0) << "Enter index of molecule to merge into: ");
    12181218          cin >> nr;
    12191219          mol = molecules->ReturnIndex(nr);
     
    12321232
    12331233    case 's':
    1234       Log() << Verbose(0) << "Not implemented yet." << endl;
     1234      DoLog(0) && (Log() << Verbose(0) << "Not implemented yet." << endl);
    12351235      break;
    12361236
     
    12411241        {
    12421242          do {
    1243             Log() << Verbose(0) << "Enter index of destination molecule: ";
     1243            DoLog(0) && (Log() << Verbose(0) << "Enter index of destination molecule: ");
    12441244            cin >> dest;
    12451245            destmol = molecules->ReturnIndex(dest);
    12461246          } while ((destmol == NULL) && (dest != -1));
    12471247          do {
    1248             Log() << Verbose(0) << "Enter index of source molecule to merge into: ";
     1248            DoLog(0) && (Log() << Verbose(0) << "Enter index of source molecule to merge into: ");
    12491249            cin >> src;
    12501250            srcmol = molecules->ReturnIndex(src);
     
    12821282
    12831283  // generate some KeySets
    1284   Log() << Verbose(0) << "Generating KeySets." << endl;
     1284  DoLog(0) && (Log() << Verbose(0) << "Generating KeySets." << endl);
    12851285  KeySet TestSets[mol->AtomCount+1];
    12861286  i=1;
     
    12921292    i++;
    12931293  }
    1294   Log() << Verbose(0) << "Testing insertion of already present item in KeySets." << endl;
     1294  DoLog(0) && (Log() << Verbose(0) << "Testing insertion of already present item in KeySets." << endl);
    12951295  KeySetTestPair test;
    12961296  test = TestSets[mol->AtomCount-1].insert(Walker->nr);
    12971297  if (test.second) {
    1298     Log() << Verbose(1) << "Insertion worked?!" << endl;
     1298    DoLog(1) && (Log() << Verbose(1) << "Insertion worked?!" << endl);
    12991299  } else {
    1300     Log() << Verbose(1) << "Insertion rejected: Present object is " << (*test.first) << "." << endl;
     1300    DoLog(1) && (Log() << Verbose(1) << "Insertion rejected: Present object is " << (*test.first) << "." << endl);
    13011301  }
    13021302  TestSets[mol->AtomCount].insert(mol->end->previous->nr);
     
    13041304
    13051305  // constructing Graph structure
    1306   Log() << Verbose(0) << "Generating Subgraph class." << endl;
     1306  DoLog(0) && (Log() << Verbose(0) << "Generating Subgraph class." << endl);
    13071307  Graph Subgraphs;
    13081308
    13091309  // insert KeySets into Subgraphs
    1310   Log() << Verbose(0) << "Inserting KeySets into Subgraph class." << endl;
     1310  DoLog(0) && (Log() << Verbose(0) << "Inserting KeySets into Subgraph class." << endl);
    13111311  for (int j=0;j<mol->AtomCount;j++) {
    13121312    Subgraphs.insert(GraphPair (TestSets[j],pair<int, double>(counter++, 1.)));
    13131313  }
    1314   Log() << Verbose(0) << "Testing insertion of already present item in Subgraph." << endl;
     1314  DoLog(0) && (Log() << Verbose(0) << "Testing insertion of already present item in Subgraph." << endl);
    13151315  GraphTestPair test2;
    13161316  test2 = Subgraphs.insert(GraphPair (TestSets[mol->AtomCount],pair<int, double>(counter++, 1.)));
    13171317  if (test2.second) {
    1318     Log() << Verbose(1) << "Insertion worked?!" << endl;
     1318    DoLog(1) && (Log() << Verbose(1) << "Insertion worked?!" << endl);
    13191319  } else {
    1320     Log() << Verbose(1) << "Insertion rejected: Present object is " << (*(test2.first)).second.first << "." << endl;
     1320    DoLog(1) && (Log() << Verbose(1) << "Insertion rejected: Present object is " << (*(test2.first)).second.first << "." << endl);
    13211321  }
    13221322
    13231323  // show graphs
    1324   Log() << Verbose(0) << "Showing Subgraph's contents, checking that it's sorted." << endl;
     1324  DoLog(0) && (Log() << Verbose(0) << "Showing Subgraph's contents, checking that it's sorted." << endl);
    13251325  Graph::iterator A = Subgraphs.begin();
    13261326  while (A !=  Subgraphs.end()) {
    1327     Log() << Verbose(0) << (*A).second.first << ": ";
     1327    DoLog(0) && (Log() << Verbose(0) << (*A).second.first << ": ");
    13281328    KeySet::iterator key = (*A).first.begin();
    13291329    comp = -1;
    13301330    while (key != (*A).first.end()) {
    13311331      if ((*key) > comp)
    1332         Log() << Verbose(0) << (*key) << " ";
     1332        DoLog(0) && (Log() << Verbose(0) << (*key) << " ");
    13331333      else
    1334         Log() << Verbose(0) << (*key) << "! ";
     1334        DoLog(0) && (Log() << Verbose(0) << (*key) << "! ");
    13351335      comp = (*key);
    13361336      key++;
    13371337    }
    1338     Log() << Verbose(0) << endl;
     1338    DoLog(0) && (Log() << Verbose(0) << endl);
    13391339    A++;
    13401340  }
     
    13651365  if (output == NULL)
    13661366    strcpy(filename,"main_pcp_linux");
    1367   Log() << Verbose(0) << "Saving as pdb input ";
     1367  DoLog(0) && (Log() << Verbose(0) << "Saving as pdb input ");
    13681368  if (configuration->SavePDB(filename, molecules))
    1369     Log() << Verbose(0) << "done." << endl;
     1369    DoLog(0) && (Log() << Verbose(0) << "done." << endl);
    13701370  else
    1371     Log() << Verbose(0) << "failed." << endl;
     1371    DoLog(0) && (Log() << Verbose(0) << "failed." << endl);
    13721372
    13731373  // then save as tremolo data file
     
    13761376  if (output == NULL)
    13771377    strcpy(filename,"main_pcp_linux");
    1378   Log() << Verbose(0) << "Saving as tremolo data input ";
     1378  DoLog(0) && (Log() << Verbose(0) << "Saving as tremolo data input ");
    13791379  if (configuration->SaveTREMOLO(filename, molecules))
    1380     Log() << Verbose(0) << "done." << endl;
     1380    DoLog(0) && (Log() << Verbose(0) << "done." << endl);
    13811381  else
    1382     Log() << Verbose(0) << "failed." << endl;
     1382    DoLog(0) && (Log() << Verbose(0) << "failed." << endl);
    13831383
    13841384  // translate each to its center and merge all molecules in MoleculeListClass into this molecule
     
    14001400  }
    14011401
    1402   Log() << Verbose(0) << "Storing configuration ... " << endl;
     1402  DoLog(0) && (Log() << Verbose(0) << "Storing configuration ... " << endl);
    14031403  // get correct valence orbitals
    14041404  mol->CalculateOrbitals(*configuration);
     
    14161416  output.close();
    14171417  output.clear();
    1418   Log() << Verbose(0) << "Saving of config file ";
     1418  DoLog(0) && (Log() << Verbose(0) << "Saving of config file ");
    14191419  if (configuration->Save(filename, periode, mol))
    1420     Log() << Verbose(0) << "successful." << endl;
     1420    DoLog(0) && (Log() << Verbose(0) << "successful." << endl);
    14211421  else
    1422     Log() << Verbose(0) << "failed." << endl;
     1422    DoLog(0) && (Log() << Verbose(0) << "failed." << endl);
    14231423
    14241424  // and save to xyz file
     
    14331433    output.open(filename, ios::trunc);
    14341434  }
    1435   Log() << Verbose(0) << "Saving of XYZ file ";
     1435  DoLog(0) && (Log() << Verbose(0) << "Saving of XYZ file ");
    14361436  if (mol->MDSteps <= 1) {
    14371437    if (mol->OutputXYZ(&output))
    1438       Log() << Verbose(0) << "successful." << endl;
     1438      DoLog(0) && (Log() << Verbose(0) << "successful." << endl);
    14391439    else
    1440       Log() << Verbose(0) << "failed." << endl;
     1440      DoLog(0) && (Log() << Verbose(0) << "failed." << endl);
    14411441  } else {
    14421442    if (mol->OutputTrajectoriesXYZ(&output))
    1443       Log() << Verbose(0) << "successful." << endl;
     1443      DoLog(0) && (Log() << Verbose(0) << "successful." << endl);
    14441444    else
    1445       Log() << Verbose(0) << "failed." << endl;
     1445      DoLog(0) && (Log() << Verbose(0) << "failed." << endl);
    14461446  }
    14471447  output.close();
     
    14531453  if (output == NULL)
    14541454    strcpy(filename,"main_pcp_linux");
    1455   Log() << Verbose(0) << "Saving as mpqc input ";
     1455  DoLog(0) && (Log() << Verbose(0) << "Saving as mpqc input ");
    14561456  if (configuration->SaveMPQC(filename, mol))
    1457     Log() << Verbose(0) << "done." << endl;
     1457    DoLog(0) && (Log() << Verbose(0) << "done." << endl);
    14581458  else
    1459     Log() << Verbose(0) << "failed." << endl;
     1459    DoLog(0) && (Log() << Verbose(0) << "failed." << endl);
    14601460
    14611461  if (!strcmp(configuration->configpath, configuration->GetDefaultPath())) {
     
    15021502    do {
    15031503      if (argv[argptr][0] == '-') {
    1504         Log() << Verbose(0) << "Recognized command line argument: " << argv[argptr][1] << ".\n";
     1504        DoLog(0) && (Log() << Verbose(0) << "Recognized command line argument: " << argv[argptr][1] << ".\n");
    15051505        argptr++;
    15061506        switch(argv[argptr-1][1]) {
     
    15081508          case 'H':
    15091509          case '?':
    1510             Log() << Verbose(0) << "MoleCuilder suite" << endl << "==================" << endl << endl;
    1511             Log() << Verbose(0) << "Usage: " << argv[0] << "[config file] [-{acefpsthH?vfrp}] [further arguments]" << endl;
    1512             Log() << Verbose(0) << "or simply " << argv[0] << " without arguments for interactive session." << endl;
    1513             Log() << Verbose(0) << "\t-a Z x1 x2 x3\tAdd new atom of element Z at coordinates (x1,x2,x3)." << endl;
    1514             Log() << Verbose(0) << "\t-A <source>\tCreate adjacency list from bonds parsed from 'dbond'-style file." <<endl;
    1515             Log() << Verbose(0) << "\t-b xx xy xz yy yz zz\tCenter atoms in domain with given symmetric matrix of (xx,xy,xz,yy,yz,zz)." << endl;
    1516             Log() << Verbose(0) << "\t-B xx xy xz yy yz zz\tBound atoms by domain with given symmetric matrix of (xx,xy,xz,yy,yz,zz)." << endl;
    1517             Log() << Verbose(0) << "\t-c x1 x2 x3\tCenter atoms in domain with a minimum distance to boundary of (x1,x2,x3)." << endl;
    1518             Log() << Verbose(0) << "\t-C <type> [params] <output> <bin output> <BinWidth> <BinStart> <BinEnd>\tPair Correlation analysis." << endl;
    1519             Log() << Verbose(0) << "\t-d x1 x2 x3\tDuplicate cell along each axis by given factor." << endl;
    1520             Log() << Verbose(0) << "\t-D <bond distance>\tDepth-First-Search Analysis of the molecule, giving cycles and tree/back edges." << endl;
    1521             Log() << Verbose(0) << "\t-e <file>\tSets the databases path to be parsed (default: ./)." << endl;
    1522             Log() << Verbose(0) << "\t-E <id> <Z>\tChange atom <id>'s element to <Z>, <id> begins at 0." << endl;
    1523             Log() << Verbose(0) << "\t-f <dist> <order>\tFragments the molecule in BOSSANOVA manner (with/out rings compressed) and stores config files in same dir as config (return code 0 - fragmented, 2 - no fragmentation necessary)." << endl;
    1524             Log() << Verbose(0) << "\t-F <xyz of filler> <dist_x> <dist_y> <dist_z> <epsilon> <randatom> <randmol> <DoRotate>\tFilling Box with water molecules." << endl;
    1525             Log() << Verbose(0) << "\t-FF <MaxDistance> <xyz of filler> <dist_x> <dist_y> <dist_z> <epsilon> <randatom> <randmol> <DoRotate>\tFilling Box with water molecules." << endl;
    1526             Log() << Verbose(0) << "\t-g <file>\tParses a bond length table from the given file." << endl;
    1527             Log() << Verbose(0) << "\t-h/-H/-?\tGive this help screen." << endl;
    1528             Log() << Verbose(0) << "\t-I\t Dissect current system of molecules into a set of disconnected (subgraphs of) molecules." << endl;
    1529             Log() << Verbose(0) << "\t-j\t<path> Store all bonds to file." << endl;
    1530             Log() << Verbose(0) << "\t-J\t<path> Store adjacency per atom to file." << endl;
    1531             Log() << Verbose(0) << "\t-L <step0> <step1> <prefix>\tStore a linear interpolation between two configurations <step0> and <step1> into single config files with prefix <prefix> and as Trajectories into the current config file." << endl;
    1532             Log() << Verbose(0) << "\t-m <0/1>\tCalculate (0)/ Align in(1) PAS with greatest EV along z axis." << endl;
    1533             Log() << Verbose(0) << "\t-M <basis>\tSetting basis to store to MPQC config files." << endl;
    1534             Log() << Verbose(0) << "\t-n\tFast parsing (i.e. no trajectories are looked for)." << endl;
    1535             Log() << Verbose(0) << "\t-N <radius> <file>\tGet non-convex-envelope." << endl;
    1536             Log() << Verbose(0) << "\t-o <out>\tGet volume of the convex envelope (and store to tecplot file)." << endl;
    1537             Log() << Verbose(0) << "\t-O\tCenter atoms in origin." << endl;
    1538             Log() << Verbose(0) << "\t-p <file>\tParse given xyz file and create raw config file from it." << endl;
    1539             Log() << Verbose(0) << "\t-P <file>\tParse given forces file and append as an MD step to config file via Verlet." << endl;
    1540             Log() << Verbose(0) << "\t-r <id>\t\tRemove an atom with given id." << endl;
    1541             Log() << Verbose(0) << "\t-R <id> <radius>\t\tRemove all atoms out of sphere around a given one." << endl;
    1542             Log() << Verbose(0) << "\t-s x1 x2 x3\tScale all atom coordinates by this vector (x1,x2,x3)." << endl;
    1543             Log() << Verbose(0) << "\t-S <file> Store temperatures from the config file in <file>." << endl;
    1544             Log() << Verbose(0) << "\t-t x1 x2 x3\tTranslate all atoms by this vector (x1,x2,x3)." << endl;
    1545             Log() << Verbose(0) << "\t-T x1 x2 x3\tTranslate periodically all atoms by this vector (x1,x2,x3)." << endl;
    1546             Log() << Verbose(0) << "\t-u rho\tsuspend in water solution and output necessary cell lengths, average density rho and repetition." << endl;
    1547             Log() << Verbose(0) << "\t-v\t\tsets verbosity (more is more)." << endl;
    1548             Log() << Verbose(0) << "\t-V\t\tGives version information." << endl;
    1549             Log() << Verbose(0) << "\t-X\t\tset default name of a molecule." << endl;
    1550             Log() << Verbose(0) << "Note: config files must not begin with '-' !" << endl;
     1510            DoLog(0) && (Log() << Verbose(0) << "MoleCuilder suite" << endl << "==================" << endl << endl);
     1511            DoLog(0) && (Log() << Verbose(0) << "Usage: " << argv[0] << "[config file] [-{acefpsthH?vfrp}] [further arguments]" << endl);
     1512            DoLog(0) && (Log() << Verbose(0) << "or simply " << argv[0] << " without arguments for interactive session." << endl);
     1513            DoLog(0) && (Log() << Verbose(0) << "\t-a Z x1 x2 x3\tAdd new atom of element Z at coordinates (x1,x2,x3)." << endl);
     1514            DoLog(0) && (Log() << Verbose(0) << "\t-A <source>\tCreate adjacency list from bonds parsed from 'dbond'-style file." <<endl);
     1515            DoLog(0) && (Log() << Verbose(0) << "\t-b xx xy xz yy yz zz\tCenter atoms in domain with given symmetric matrix of (xx,xy,xz,yy,yz,zz)." << endl);
     1516            DoLog(0) && (Log() << Verbose(0) << "\t-B xx xy xz yy yz zz\tBound atoms by domain with given symmetric matrix of (xx,xy,xz,yy,yz,zz)." << endl);
     1517            DoLog(0) && (Log() << Verbose(0) << "\t-c x1 x2 x3\tCenter atoms in domain with a minimum distance to boundary of (x1,x2,x3)." << endl);
     1518            DoLog(0) && (Log() << Verbose(0) << "\t-C <type> [params] <output> <bin output> <BinWidth> <BinStart> <BinEnd>\tPair Correlation analysis." << endl);
     1519            DoLog(0) && (Log() << Verbose(0) << "\t-d x1 x2 x3\tDuplicate cell along each axis by given factor." << endl);
     1520            DoLog(0) && (Log() << Verbose(0) << "\t-D <bond distance>\tDepth-First-Search Analysis of the molecule, giving cycles and tree/back edges." << endl);
     1521            DoLog(0) && (Log() << Verbose(0) << "\t-e <file>\tSets the databases path to be parsed (default: ./)." << endl);
     1522            DoLog(0) && (Log() << Verbose(0) << "\t-E <id> <Z>\tChange atom <id>'s element to <Z>, <id> begins at 0." << endl);
     1523            DoLog(0) && (Log() << Verbose(0) << "\t-f <dist> <order>\tFragments the molecule in BOSSANOVA manner (with/out rings compressed) and stores config files in same dir as config (return code 0 - fragmented, 2 - no fragmentation necessary)." << endl);
     1524            DoLog(0) && (Log() << Verbose(0) << "\t-F <xyz of filler> <dist_x> <dist_y> <dist_z> <epsilon> <randatom> <randmol> <DoRotate>\tFilling Box with water molecules." << endl);
     1525            DoLog(0) && (Log() << Verbose(0) << "\t-FF <MaxDistance> <xyz of filler> <dist_x> <dist_y> <dist_z> <epsilon> <randatom> <randmol> <DoRotate>\tFilling Box with water molecules." << endl);
     1526            DoLog(0) && (Log() << Verbose(0) << "\t-g <file>\tParses a bond length table from the given file." << endl);
     1527            DoLog(0) && (Log() << Verbose(0) << "\t-h/-H/-?\tGive this help screen." << endl);
     1528            DoLog(0) && (Log() << Verbose(0) << "\t-I\t Dissect current system of molecules into a set of disconnected (subgraphs of) molecules." << endl);
     1529            DoLog(0) && (Log() << Verbose(0) << "\t-j\t<path> Store all bonds to file." << endl);
     1530            DoLog(0) && (Log() << Verbose(0) << "\t-J\t<path> Store adjacency per atom to file." << endl);
     1531            DoLog(0) && (Log() << Verbose(0) << "\t-L <step0> <step1> <prefix>\tStore a linear interpolation between two configurations <step0> and <step1> into single config files with prefix <prefix> and as Trajectories into the current config file." << endl);
     1532            DoLog(0) && (Log() << Verbose(0) << "\t-m <0/1>\tCalculate (0)/ Align in(1) PAS with greatest EV along z axis." << endl);
     1533            DoLog(0) && (Log() << Verbose(0) << "\t-M <basis>\tSetting basis to store to MPQC config files." << endl);
     1534            DoLog(0) && (Log() << Verbose(0) << "\t-n\tFast parsing (i.e. no trajectories are looked for)." << endl);
     1535            DoLog(0) && (Log() << Verbose(0) << "\t-N <radius> <file>\tGet non-convex-envelope." << endl);
     1536            DoLog(0) && (Log() << Verbose(0) << "\t-o <out>\tGet volume of the convex envelope (and store to tecplot file)." << endl);
     1537            DoLog(0) && (Log() << Verbose(0) << "\t-O\tCenter atoms in origin." << endl);
     1538            DoLog(0) && (Log() << Verbose(0) << "\t-p <file>\tParse given xyz file and create raw config file from it." << endl);
     1539            DoLog(0) && (Log() << Verbose(0) << "\t-P <file>\tParse given forces file and append as an MD step to config file via Verlet." << endl);
     1540            DoLog(0) && (Log() << Verbose(0) << "\t-r <id>\t\tRemove an atom with given id." << endl);
     1541            DoLog(0) && (Log() << Verbose(0) << "\t-R <id> <radius>\t\tRemove all atoms out of sphere around a given one." << endl);
     1542            DoLog(0) && (Log() << Verbose(0) << "\t-s x1 x2 x3\tScale all atom coordinates by this vector (x1,x2,x3)." << endl);
     1543            DoLog(0) && (Log() << Verbose(0) << "\t-S <file> Store temperatures from the config file in <file>." << endl);
     1544            DoLog(0) && (Log() << Verbose(0) << "\t-t x1 x2 x3\tTranslate all atoms by this vector (x1,x2,x3)." << endl);
     1545            DoLog(0) && (Log() << Verbose(0) << "\t-T x1 x2 x3\tTranslate periodically all atoms by this vector (x1,x2,x3)." << endl);
     1546            DoLog(0) && (Log() << Verbose(0) << "\t-u rho\tsuspend in water solution and output necessary cell lengths, average density rho and repetition." << endl);
     1547            DoLog(0) && (Log() << Verbose(0) << "\t-v\t\tsets verbosity (more is more)." << endl);
     1548            DoLog(0) && (Log() << Verbose(0) << "\t-V\t\tGives version information." << endl);
     1549            DoLog(0) && (Log() << Verbose(0) << "\t-X\t\tset default name of a molecule." << endl);
     1550            DoLog(0) && (Log() << Verbose(0) << "Note: config files must not begin with '-' !" << endl);
    15511551            return (1);
    15521552            break;
     
    15561556            }
    15571557            setVerbosity(verbosity);
    1558             Log() << Verbose(0) << "Setting verbosity to " << verbosity << "." << endl;
     1558            DoLog(0) && (Log() << Verbose(0) << "Setting verbosity to " << verbosity << "." << endl);
    15591559            break;
    15601560          case 'V':
    1561             Log() << Verbose(0) << argv[0] << " " << VERSIONSTRING << endl;
    1562             Log() << Verbose(0) << "Build your own molecule position set." << endl;
     1561            DoLog(0) && (Log() << Verbose(0) << argv[0] << " " << VERSIONSTRING << endl);
     1562            DoLog(0) && (Log() << Verbose(0) << "Build your own molecule position set." << endl);
    15631563            return (1);
    15641564            break;
     
    15721572              SaveFlag = true;
    15731573              j = -1;
    1574               Log() << Verbose(1) << "Centering atoms in config file within given simulation box." << endl;
     1574              DoLog(1) && (Log() << Verbose(1) << "Centering atoms in config file within given simulation box." << endl);
    15751575              double * const cell_size = World::get()->cell_size;
    15761576              for (int i=0;i<6;i++) {
     
    15851585              performCriticalExit();
    15861586            } else {
    1587               Log() << Verbose(0) << "Using " << argv[argptr] << " as elements database." << endl;
     1587              DoLog(0) && (Log() << Verbose(0) << "Using " << argv[argptr] << " as elements database." << endl);
    15881588              strncpy (configuration.databasepath, argv[argptr], MAXSTRINGSIZE-1);
    15891589              argptr+=1;
     
    15961596            } else {
    15971597              BondGraphFileName = argv[argptr];
    1598               Log() << Verbose(0) << "Using " << BondGraphFileName << " as bond length table." << endl;
     1598              DoLog(0) && (Log() << Verbose(0) << "Using " << BondGraphFileName << " as bond length table." << endl);
    15991599              argptr+=1;
    16001600            }
    16011601            break;
    16021602          case 'n':
    1603             Log() << Verbose(0) << "I won't parse trajectories." << endl;
     1603            DoLog(0) && (Log() << Verbose(0) << "I won't parse trajectories." << endl);
    16041604            configuration.FastParsing = true;
    16051605            break;
     
    16111611              *name = new char[length+2];
    16121612              strncpy(*name, argv[argptr], length);
    1613               Log() << Verbose(0) << "Default name of new molecules set to " << *name << "." << endl;
     1613              DoLog(0) && (Log() << Verbose(0) << "Default name of new molecules set to " << *name << "." << endl);
    16141614            }
    16151615            break;
     
    16241624    // 3a. Parse the element database
    16251625    if (periode->LoadPeriodentafel(configuration.databasepath)) {
    1626       Log() << Verbose(0) << "Element list loaded successfully." << endl;
     1626      DoLog(0) && (Log() << Verbose(0) << "Element list loaded successfully." << endl);
    16271627      //periode->Output();
    16281628    } else {
    1629       Log() << Verbose(0) << "Element list loading failed." << endl;
     1629      DoLog(0) && (Log() << Verbose(0) << "Element list loading failed." << endl);
    16301630      return 1;
    16311631    }
     
    16331633    if (argv[1][0] != '-') {
    16341634      // simply create a new molecule, wherein the config file is loaded and the manipulation takes place
    1635       Log() << Verbose(0) << "Config file given." << endl;
     1635      DoLog(0) && (Log() << Verbose(0) << "Config file given." << endl);
    16361636      test.open(argv[1], ios::in);
    16371637      if (test == NULL) {
     
    16391639        output.open(argv[1], ios::out);
    16401640        if (output == NULL) {
    1641           Log() << Verbose(1) << "Specified config file " << argv[1] << " not found." << endl;
     1641          DoLog(1) && (Log() << Verbose(1) << "Specified config file " << argv[1] << " not found." << endl);
    16421642          configPresent = absent;
    16431643        } else {
    1644           Log() << Verbose(0) << "Empty configuration file." << endl;
     1644          DoLog(0) && (Log() << Verbose(0) << "Empty configuration file." << endl);
    16451645          ConfigFileName = argv[1];
    16461646          configPresent = empty;
     
    16501650        test.close();
    16511651        ConfigFileName = argv[1];
    1652         Log() << Verbose(1) << "Specified config file found, parsing ... ";
     1652        DoLog(1) && (Log() << Verbose(1) << "Specified config file found, parsing ... ");
    16531653        switch (configuration.TestSyntax(ConfigFileName, periode)) {
    16541654          case 1:
    1655             Log() << Verbose(0) << "new syntax." << endl;
     1655            DoLog(0) && (Log() << Verbose(0) << "new syntax." << endl);
    16561656            configuration.Load(ConfigFileName, BondGraphFileName, periode, molecules);
    16571657            configPresent = present;
    16581658            break;
    16591659          case 0:
    1660             Log() << Verbose(0) << "old syntax." << endl;
     1660            DoLog(0) && (Log() << Verbose(0) << "old syntax." << endl);
    16611661            configuration.LoadOld(ConfigFileName, BondGraphFileName, periode, molecules);
    16621662            configPresent = present;
    16631663            break;
    16641664          default:
    1665             Log() << Verbose(0) << "Unknown syntax or empty, yet present file." << endl;
     1665            DoLog(0) && (Log() << Verbose(0) << "Unknown syntax or empty, yet present file." << endl);
    16661666            configPresent = empty;
    16671667       }
     
    16871687       configuration.BG = new BondGraph(configuration.GetIsAngstroem());
    16881688       if ((!BondGraphFileName.empty()) && (configuration.BG->LoadBondLengthTable(BondGraphFileName))) {
    1689          Log() << Verbose(0) << "Bond length table loaded successfully." << endl;
     1689         DoLog(0) && (Log() << Verbose(0) << "Bond length table loaded successfully." << endl);
    16901690       } else {
    16911691         DoeLog(1) && (eLog()<< Verbose(1) << "Bond length table loading failed." << endl);
     
    16961696    argptr = 1;
    16971697    do {
    1698       Log() << Verbose(0) << "Current Command line argument: " << argv[argptr] << "." << endl;
     1698      DoLog(0) && (Log() << Verbose(0) << "Current Command line argument: " << argv[argptr] << "." << endl);
    16991699      if (argv[argptr][0] == '-') {
    17001700        argptr++;
     
    17091709              } else {
    17101710                SaveFlag = true;
    1711                 Log() << Verbose(1) << "Parsing xyz file for new atoms." << endl;
     1711                DoLog(1) && (Log() << Verbose(1) << "Parsing xyz file for new atoms." << endl);
    17121712                if (!mol->AddXYZFile(argv[argptr]))
    1713                   Log() << Verbose(2) << "File not found." << endl;
     1713                  DoLog(2) && (Log() << Verbose(2) << "File not found." << endl);
    17141714                else {
    1715                   Log() << Verbose(2) << "File found and parsed." << endl;
     1715                  DoLog(2) && (Log() << Verbose(2) << "File found and parsed." << endl);
    17161716                  configPresent = present;
    17171717                }
     
    17261726              } else {
    17271727                SaveFlag = true;
    1728                 Log() << Verbose(1) << "Adding new atom with element " << argv[argptr] << " at (" << argv[argptr+1] << "," << argv[argptr+2] << "," << argv[argptr+3] << "), ";
     1728                DoLog(1) && (Log() << Verbose(1) << "Adding new atom with element " << argv[argptr] << " at (" << argv[argptr+1] << "," << argv[argptr+2] << "," << argv[argptr+3] << "), ");
    17291729                first = new atom;
    17301730                first->type = periode->FindElement(atoi(argv[argptr]));
    17311731                if (first->type != NULL)
    1732                   Log() << Verbose(2) << "found element " << first->type->name << endl;
     1732                  DoLog(2) && (Log() << Verbose(2) << "found element " << first->type->name << endl);
    17331733                for (int i=NDIM;i--;)
    17341734                  first->x.x[i] = atof(argv[argptr+1+i]);
     
    17551755              } else {
    17561756                configuration.basis = argv[argptr];
    1757                 Log() << Verbose(1) << "Setting MPQC basis to " << configuration.basis << "." << endl;
     1757                DoLog(1) && (Log() << Verbose(1) << "Setting MPQC basis to " << configuration.basis << "." << endl);
    17581758                argptr+=1;
    17591759              }
     
    17621762              if (ExitFlag == 0) ExitFlag = 1;
    17631763              {
    1764                 Log() << Verbose(1) << "Depth-First-Search Analysis." << endl;
     1764                DoLog(1) && (Log() << Verbose(1) << "Depth-First-Search Analysis." << endl);
    17651765                MoleculeLeafClass *Subgraphs = NULL;      // list of subgraphs from DFS analysis
    17661766                int *MinimumRingSize = new int[mol->AtomCount];
     
    17931793              break;
    17941794            case 'I':
    1795               Log() << Verbose(1) << "Dissecting molecular system into a set of disconnected subgraphs ... " << endl;
     1795              DoLog(1) && (Log() << Verbose(1) << "Dissecting molecular system into a set of disconnected subgraphs ... " << endl);
    17961796              // @TODO rather do the dissection afterwards
    17971797              molecules->DissectMoleculeIntoConnectedSubgraphs(periode, &configuration);
     
    19721972              } else {
    19731973                SaveFlag = true;
    1974                 Log() << Verbose(1) << "Changing atom " << argv[argptr] << " to element " << argv[argptr+1] << "." << endl;
     1974                DoLog(1) && (Log() << Verbose(1) << "Changing atom " << argv[argptr] << " to element " << argv[argptr+1] << "." << endl);
    19751975                first = mol->FindAtom(atoi(argv[argptr]));
    19761976                first->type = periode->FindElement(atoi(argv[argptr+1]));
     
    19841984                // fetch first argument as max distance to surface
    19851985                MaxDistance = atof(argv[argptr++]);
    1986                 Log() << Verbose(0) << "Filling with maximum layer distance of " << MaxDistance << "." << endl;
     1986                DoLog(0) && (Log() << Verbose(0) << "Filling with maximum layer distance of " << MaxDistance << "." << endl);
    19871987              }
    19881988              if ((argptr+7 >=argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) || (!IsValidNumber(argv[argptr+3])) || (!IsValidNumber(argv[argptr+4])) || (!IsValidNumber(argv[argptr+5])) || (!IsValidNumber(argv[argptr+6])) || (!IsValidNumber(argv[argptr+7]))) {
     
    19921992              } else {
    19931993                SaveFlag = true;
    1994                 Log() << Verbose(1) << "Filling Box with water molecules." << endl;
     1994                DoLog(1) && (Log() << Verbose(1) << "Filling Box with water molecules." << endl);
    19951995                // construct water molecule
    19961996                molecule *filler = new molecule(periode);
     
    20212021                performCriticalExit();
    20222022              } else {
    2023                 Log() << Verbose(0) << "Parsing bonds from " << argv[argptr] << "." << endl;
     2023                DoLog(0) && (Log() << Verbose(0) << "Parsing bonds from " << argv[argptr] << "." << endl);
    20242024                ifstream *input = new ifstream(argv[argptr]);
    20252025                mol->CreateAdjacencyListFromDbondFile(input);
     
    20362036                performCriticalExit();
    20372037              } else {
    2038                 Log() << Verbose(0) << "Storing adjacency to path " << argv[argptr] << "." << endl;
     2038                DoLog(0) && (Log() << Verbose(0) << "Storing adjacency to path " << argv[argptr] << "." << endl);
    20392039                configuration.BG->ConstructBondGraph(mol);
    20402040                mol->StoreAdjacencyToFile(NULL, argv[argptr]);
     
    20502050                performCriticalExit();
    20512051              } else {
    2052                 Log() << Verbose(0) << "Storing bonds to path " << argv[argptr] << "." << endl;
     2052                DoLog(0) && (Log() << Verbose(0) << "Storing bonds to path " << argv[argptr] << "." << endl);
    20532053                configuration.BG->ConstructBondGraph(mol);
    20542054                mol->StoreBondsToFile(NULL, argv[argptr]);
     
    20692069                //string filename(argv[argptr+1]);
    20702070                //filename.append(".csv");
    2071                 Log() << Verbose(0) << "Evaluating non-convex envelope of biggest molecule.";
    2072                 Log() << Verbose(1) << "Using rolling ball of radius " << atof(argv[argptr]) << " and storing tecplot data in " << argv[argptr+1] << "." << endl;
     2071                DoLog(0) && (Log() << Verbose(0) << "Evaluating non-convex envelope of biggest molecule.");
     2072                DoLog(1) && (Log() << Verbose(1) << "Using rolling ball of radius " << atof(argv[argptr]) << " and storing tecplot data in " << argv[argptr+1] << "." << endl);
    20732073                // find biggest molecule
    20742074                int counter  = 0;
     
    20802080                  counter++;
    20812081                }
    2082                 Log() << Verbose(1) << "Biggest molecule has " << Boundary->AtomCount << " atoms." << endl;
     2082                DoLog(1) && (Log() << Verbose(1) << "Biggest molecule has " << Boundary->AtomCount << " atoms." << endl);
    20832083                start = clock();
    20842084                LCList = new LinkedCell(Boundary, atof(argv[argptr])*2.);
     
    20872087                //FindDistributionOfEllipsoids(T, &LCList, N, number, filename.c_str());
    20882088                end = clock();
    2089                 Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl;
     2089                DoLog(0) && (Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl);
    20902090                delete(LCList);
    20912091                delete(T);
     
    21002100                performCriticalExit();
    21012101              } else {
    2102                 Log() << Verbose(1) << "Storing temperatures in " << argv[argptr] << "." << endl;
     2102                DoLog(1) && (Log() << Verbose(1) << "Storing temperatures in " << argv[argptr] << "." << endl);
    21032103                ofstream *output = new ofstream(argv[argptr], ios::trunc);
    21042104                if (!mol->OutputTemperatureFromTrajectories(output, 0, mol->MDSteps))
    2105                   Log() << Verbose(2) << "File could not be written." << endl;
     2105                  DoLog(2) && (Log() << Verbose(2) << "File could not be written." << endl);
    21062106                else
    2107                   Log() << Verbose(2) << "File stored." << endl;
     2107                  DoLog(2) && (Log() << Verbose(2) << "File stored." << endl);
    21082108                output->close();
    21092109                delete(output);
     
    21192119              } else {
    21202120                SaveFlag = true;
    2121                 Log() << Verbose(1) << "Linear interpolation between configuration " << argv[argptr] << " and " << argv[argptr+1] << "." << endl;
     2121                DoLog(1) && (Log() << Verbose(1) << "Linear interpolation between configuration " << argv[argptr] << " and " << argv[argptr+1] << "." << endl);
    21222122                if (atoi(argv[argptr+3]) == 1)
    2123                   Log() << Verbose(1) << "Using Identity for the permutation map." << endl;
     2123                  DoLog(1) && (Log() << Verbose(1) << "Using Identity for the permutation map." << endl);
    21242124                if (!mol->LinearInterpolationBetweenConfiguration(atoi(argv[argptr]), atoi(argv[argptr+1]), argv[argptr+2], configuration, atoi(argv[argptr+3])) == 1 ? true : false)
    2125                   Log() << Verbose(2) << "Could not store " << argv[argptr+2] << " files." << endl;
     2125                  DoLog(2) && (Log() << Verbose(2) << "Could not store " << argv[argptr+2] << " files." << endl);
    21262126                else
    2127                   Log() << Verbose(2) << "Steps created and " << argv[argptr+2] << " files stored." << endl;
     2127                  DoLog(2) && (Log() << Verbose(2) << "Steps created and " << argv[argptr+2] << " files stored." << endl);
    21282128                argptr+=4;
    21292129              }
     
    21372137              } else {
    21382138                SaveFlag = true;
    2139                 Log() << Verbose(1) << "Parsing forces file and Verlet integrating." << endl;
     2139                DoLog(1) && (Log() << Verbose(1) << "Parsing forces file and Verlet integrating." << endl);
    21402140                if (!mol->VerletForceIntegration(argv[argptr], configuration))
    2141                   Log() << Verbose(2) << "File not found." << endl;
     2141                  DoLog(2) && (Log() << Verbose(2) << "File not found." << endl);
    21422142                else
    2143                   Log() << Verbose(2) << "File found and parsed." << endl;
     2143                  DoLog(2) && (Log() << Verbose(2) << "File found and parsed." << endl);
    21442144                argptr+=1;
    21452145              }
     
    21532153              } else {
    21542154                SaveFlag = true;
    2155                 Log() << Verbose(1) << "Removing atoms around " << argv[argptr] << " with radius " << argv[argptr+1] << "." << endl;
     2155                DoLog(1) && (Log() << Verbose(1) << "Removing atoms around " << argv[argptr] << " with radius " << argv[argptr+1] << "." << endl);
    21562156                double tmp1 = atof(argv[argptr+1]);
    21572157                atom *third = mol->FindAtom(atoi(argv[argptr]));
     
    21802180                if (ExitFlag == 0) ExitFlag = 1;
    21812181                SaveFlag = true;
    2182                 Log() << Verbose(1) << "Translating all ions by given vector." << endl;
     2182                DoLog(1) && (Log() << Verbose(1) << "Translating all ions by given vector." << endl);
    21832183                for (int i=NDIM;i--;)
    21842184                  x.x[i] = atof(argv[argptr+i]);
     
    21962196                if (ExitFlag == 0) ExitFlag = 1;
    21972197                SaveFlag = true;
    2198                 Log() << Verbose(1) << "Translating all ions periodically by given vector." << endl;
     2198                DoLog(1) && (Log() << Verbose(1) << "Translating all ions periodically by given vector." << endl);
    21992199                for (int i=NDIM;i--;)
    22002200                  x.x[i] = atof(argv[argptr+i]);
     
    22122212                SaveFlag = true;
    22132213                j = -1;
    2214                 Log() << Verbose(1) << "Scaling all ion positions by factor." << endl;
     2214                DoLog(1) && (Log() << Verbose(1) << "Scaling all ion positions by factor." << endl);
    22152215                factor = new double[NDIM];
    22162216                factor[0] = atof(argv[argptr]);
     
    22372237                SaveFlag = true;
    22382238                j = -1;
    2239                 Log() << Verbose(1) << "Centering atoms in config file within given simulation box." << endl;
     2239                DoLog(1) && (Log() << Verbose(1) << "Centering atoms in config file within given simulation box." << endl);
    22402240                double * const cell_size = World::get()->cell_size;
    22412241                for (int i=0;i<6;i++) {
     
    22562256                SaveFlag = true;
    22572257                j = -1;
    2258                 Log() << Verbose(1) << "Centering atoms in config file within given simulation box." << endl;
     2258                DoLog(1) && (Log() << Verbose(1) << "Centering atoms in config file within given simulation box." << endl);
    22592259                double * const cell_size = World::get()->cell_size;
    22602260                for (int i=0;i<6;i++) {
     
    22752275                SaveFlag = true;
    22762276                j = -1;
    2277                 Log() << Verbose(1) << "Centering atoms in config file within given additional boundary." << endl;
     2277                DoLog(1) && (Log() << Verbose(1) << "Centering atoms in config file within given additional boundary." << endl);
    22782278                // make every coordinate positive
    22792279                mol->CenterEdge(&x);
     
    22952295              if (ExitFlag == 0) ExitFlag = 1;
    22962296              SaveFlag = true;
    2297               Log() << Verbose(1) << "Centering atoms on edge and setting box dimensions." << endl;
     2297              DoLog(1) && (Log() << Verbose(1) << "Centering atoms on edge and setting box dimensions." << endl);
    22982298              x.Zero();
    22992299              mol->CenterEdge(&x);
     
    23092309              } else {
    23102310                SaveFlag = true;
    2311                 Log() << Verbose(1) << "Removing atom " << argv[argptr] << "." << endl;
     2311                DoLog(1) && (Log() << Verbose(1) << "Removing atom " << argv[argptr] << "." << endl);
    23122312                atom *first = mol->FindAtom(atoi(argv[argptr]));
    23132313                mol->RemoveAtom(first);
     
    23222322                performCriticalExit();
    23232323              } else {
    2324                 Log() << Verbose(0) << "Fragmenting molecule with bond distance " << argv[argptr] << " angstroem, order of " << argv[argptr+1] << "." << endl;
    2325                 Log() << Verbose(0) << "Creating connection matrix..." << endl;
     2324                DoLog(0) && (Log() << Verbose(0) << "Fragmenting molecule with bond distance " << argv[argptr] << " angstroem, order of " << argv[argptr+1] << "." << endl);
     2325                DoLog(0) && (Log() << Verbose(0) << "Creating connection matrix..." << endl);
    23262326                start = clock();
    23272327                mol->CreateAdjacencyList(atof(argv[argptr++]), configuration.GetIsAngstroem(), &BondGraph::CovalentMinMaxDistance, NULL);
    2328                 Log() << Verbose(0) << "Fragmenting molecule with current connection matrix ..." << endl;
     2328                DoLog(0) && (Log() << Verbose(0) << "Fragmenting molecule with current connection matrix ..." << endl);
    23292329                if (mol->first->next != mol->last) {
    23302330                  ExitFlag = mol->FragmentMolecule(atoi(argv[argptr]), &configuration);
    23312331                }
    23322332                end = clock();
    2333                 Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl;
     2333                DoLog(0) && (Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl);
    23342334                argptr+=2;
    23352335              }
     
    23442344              if (j) {
    23452345                SaveFlag = true;
    2346                 Log() << Verbose(0) << "Converting to prinicipal axis system." << endl;
     2346                DoLog(0) && (Log() << Verbose(0) << "Converting to prinicipal axis system." << endl);
    23472347              } else
    2348                 Log() << Verbose(0) << "Evaluating prinicipal axis." << endl;
     2348                DoLog(0) && (Log() << Verbose(0) << "Evaluating prinicipal axis." << endl);
    23492349              mol->PrincipalAxisSystem((bool)j);
    23502350              break;
     
    23582358                class Tesselation *TesselStruct = NULL;
    23592359                const LinkedCell *LCList = NULL;
    2360                 Log() << Verbose(0) << "Evaluating volume of the convex envelope.";
    2361                 Log() << Verbose(1) << "Storing tecplot convex data in " << argv[argptr] << "." << endl;
    2362                 Log() << Verbose(1) << "Storing tecplot non-convex data in " << argv[argptr+1] << "." << endl;
     2360                DoLog(0) && (Log() << Verbose(0) << "Evaluating volume of the convex envelope.");
     2361                DoLog(1) && (Log() << Verbose(1) << "Storing tecplot convex data in " << argv[argptr] << "." << endl);
     2362                DoLog(1) && (Log() << Verbose(1) << "Storing tecplot non-convex data in " << argv[argptr+1] << "." << endl);
    23632363                LCList = new LinkedCell(mol, 10.);
    23642364                //FindConvexBorder(mol, LCList, argv[argptr]);
     
    23672367                double volumedifference = ConvexizeNonconvexEnvelope(TesselStruct, mol, argv[argptr]);
    23682368                double clustervolume = VolumeOfConvexEnvelope(TesselStruct, &configuration);
    2369                 Log() << Verbose(0) << "The tesselated volume area is " << clustervolume << " " << (configuration.GetIsAngstroem() ? "angstrom" : "atomiclength") << "^3." << endl;
    2370                 Log() << Verbose(0) << "The non-convex tesselated volume area is " << clustervolume-volumedifference << " " << (configuration.GetIsAngstroem() ? "angstrom" : "atomiclength") << "^3." << endl;
     2369                DoLog(0) && (Log() << Verbose(0) << "The tesselated volume area is " << clustervolume << " " << (configuration.GetIsAngstroem() ? "angstrom" : "atomiclength") << "^3." << endl);
     2370                DoLog(0) && (Log() << Verbose(0) << "The non-convex tesselated volume area is " << clustervolume-volumedifference << " " << (configuration.GetIsAngstroem() ? "angstrom" : "atomiclength") << "^3." << endl);
    23712371                delete(TesselStruct);
    23722372                delete(LCList);
     
    23822382              } else {
    23832383                volume = atof(argv[argptr++]);
    2384                 Log() << Verbose(0) << "Using " << volume << " angstrom^3 as the volume instead of convex envelope one's." << endl;
     2384                DoLog(0) && (Log() << Verbose(0) << "Using " << volume << " angstrom^3 as the volume instead of convex envelope one's." << endl);
    23852385              }
    23862386            case 'u':
     
    23942394                double density;
    23952395                SaveFlag = true;
    2396                 Log() << Verbose(0) << "Evaluating necessary cell volume for a cluster suspended in water.";
     2396                DoLog(0) && (Log() << Verbose(0) << "Evaluating necessary cell volume for a cluster suspended in water.");
    23972397                density = atof(argv[argptr++]);
    23982398                if (density < 1.0) {
     
    24822482  } else {  // no arguments, hence scan the elements db
    24832483    if (periode->LoadPeriodentafel(configuration.databasepath))
    2484       Log() << Verbose(0) << "Element list loaded successfully." << endl;
     2484      DoLog(0) && (Log() << Verbose(0) << "Element list loaded successfully." << endl);
    24852485    else
    2486       Log() << Verbose(0) << "Element list loading failed." << endl;
     2486      DoLog(0) && (Log() << Verbose(0) << "Element list loading failed." << endl);
    24872487    configuration.RetrieveConfigPathAndName("main_pcp_linux");
    24882488  }
     
    25082508  cout << ESPACKVersion << endl;
    25092509
    2510   Log() << Verbose(1) << "test" << endl;
     2510  DoLog(1) && (Log() << Verbose(1) << "test" << endl);
    25112511  DoLog(3) && (Log() << Verbose(1) << "test");
    25122512
     
    25392539    double * const cell_size = World::get()->cell_size;
    25402540    if (cell_size[0] == 0.) {
    2541       Log() << Verbose(0) << "enter lower tridiagonal form of basis matrix" << endl << endl;
     2541      DoLog(0) && (Log() << Verbose(0) << "enter lower tridiagonal form of basis matrix" << endl << endl);
    25422542      for (int i=0;i<6;i++) {
    2543         Log() << Verbose(1) << "Cell size" << i << ": ";
     2543        DoLog(1) && (Log() << Verbose(1) << "Cell size" << i << ": ");
    25442544        cin >> cell_size[i];
    25452545      }
     
    25522552
    25532553  // now the main construction loop
    2554   Log() << Verbose(0) << endl << "Now comes the real construction..." << endl;
     2554  DoLog(0) && (Log() << Verbose(0) << endl << "Now comes the real construction..." << endl);
    25552555  do {
    2556     Log() << Verbose(0) << endl << endl;
    2557     Log() << Verbose(0) << "============Molecule list=======================" << endl;
     2556    DoLog(0) && (Log() << Verbose(0) << endl << endl);
     2557    DoLog(0) && (Log() << Verbose(0) << "============Molecule list=======================" << endl);
    25582558    molecules->Enumerate((ofstream *)&cout);
    2559     Log() << Verbose(0) << "============Menu===============================" << endl;
    2560     Log() << Verbose(0) << "a - set molecule (in)active" << endl;
    2561     Log() << Verbose(0) << "e - edit molecules (load, parse, save)" << endl;
    2562     Log() << Verbose(0) << "g - globally manipulate atoms in molecule" << endl;
    2563     Log() << Verbose(0) << "M - Merge molecules" << endl;
    2564     Log() << Verbose(0) << "m - manipulate atoms" << endl;
    2565     Log() << Verbose(0) << "-----------------------------------------------" << endl;
    2566     Log() << Verbose(0) << "c - edit the current configuration" << endl;
    2567     Log() << Verbose(0) << "-----------------------------------------------" << endl;
    2568     Log() << Verbose(0) << "s - save current setup to config file" << endl;
    2569     Log() << Verbose(0) << "T - call the current test routine" << endl;
    2570     Log() << Verbose(0) << "q - quit" << endl;
    2571     Log() << Verbose(0) << "===============================================" << endl;
    2572     Log() << Verbose(0) << "Input: ";
     2559    DoLog(0) && (Log() << Verbose(0) << "============Menu===============================" << endl);
     2560    DoLog(0) && (Log() << Verbose(0) << "a - set molecule (in)active" << endl);
     2561    DoLog(0) && (Log() << Verbose(0) << "e - edit molecules (load, parse, save)" << endl);
     2562    DoLog(0) && (Log() << Verbose(0) << "g - globally manipulate atoms in molecule" << endl);
     2563    DoLog(0) && (Log() << Verbose(0) << "M - Merge molecules" << endl);
     2564    DoLog(0) && (Log() << Verbose(0) << "m - manipulate atoms" << endl);
     2565    DoLog(0) && (Log() << Verbose(0) << "-----------------------------------------------" << endl);
     2566    DoLog(0) && (Log() << Verbose(0) << "c - edit the current configuration" << endl);
     2567    DoLog(0) && (Log() << Verbose(0) << "-----------------------------------------------" << endl);
     2568    DoLog(0) && (Log() << Verbose(0) << "s - save current setup to config file" << endl);
     2569    DoLog(0) && (Log() << Verbose(0) << "T - call the current test routine" << endl);
     2570    DoLog(0) && (Log() << Verbose(0) << "q - quit" << endl);
     2571    DoLog(0) && (Log() << Verbose(0) << "===============================================" << endl);
     2572    DoLog(0) && (Log() << Verbose(0) << "Input: ");
    25732573    cin >> choice;
    25742574
     
    25762576      case 'a':  // (in)activate molecule
    25772577        {
    2578           Log() << Verbose(0) << "Enter index of molecule: ";
     2578          DoLog(0) && (Log() << Verbose(0) << "Enter index of molecule: ");
    25792579          cin >> j;
    25802580          for(MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++)
     
    26222622  // save element data base
    26232623  if (periode->StorePeriodentafel(configuration->databasepath)) //ElementsFileName
    2624     Log() << Verbose(0) << "Saving of elements.db successful." << endl;
     2624    DoLog(0) && (Log() << Verbose(0) << "Saving of elements.db successful." << endl);
    26252625  else
    2626     Log() << Verbose(0) << "Saving of elements.db failed." << endl;
     2626    DoLog(0) && (Log() << Verbose(0) << "Saving of elements.db failed." << endl);
    26272627
    26282628  delete(molecules); // also free's all molecules contained
  • src/config.cpp

    r6613ec ra67d19  
    8585  file->clear();
    8686  file->seekg(file_position, ios::beg);
    87   Log() << Verbose(1) << NoLines-1 << " lines were recognized." << endl;
     87  DoLog(1) && (Log() << Verbose(1) << NoLines-1 << " lines were recognized." << endl);
    8888
    8989  // allocate buffer's 1st dimension
     
    105105    lines++;
    106106  } while((!file->eof()) && (lines < NoLines));
    107   Log() << Verbose(1) << lines-1 << " lines were read into the buffer." << endl;
     107  DoLog(1) && (Log() << Verbose(1) << lines-1 << " lines were read into the buffer." << endl);
    108108
    109109  // close and exit
     
    250250        Thermostat = None;
    251251      } else {
    252         Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl;
     252        DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl);
    253253        Thermostat = None;
    254254      }
     
    258258        ParseForParameter(verbose,fb,"Thermostat", 0, 2, 1, int_type, &ScaleTempStep, 1, critical); // read scaling frequency
    259259      } else {
    260         Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl;
     260        DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl);
    261261        Thermostat = None;
    262262      }
     
    266266        ParseForParameter(verbose,fb,"Thermostat", 0, 2, 1, int_type, &ScaleTempStep, 1, critical); // read collision rate
    267267      } else {
    268         Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl;
     268        DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl);
    269269        Thermostat = None;
    270270      }
     
    274274        ParseForParameter(verbose,fb,"Thermostat", 0, 2, 1, double_type, &TempFrequency, 1, critical); // read gamma
    275275        if (ParseForParameter(verbose,fb,"Thermostat", 0, 3, 1, double_type, &alpha, 1, optional)) {
    276           Log() << Verbose(2) << "Extended Stochastic Thermostat detected with interpolation coefficient " << alpha << "." << endl;
     276          DoLog(2) && (Log() << Verbose(2) << "Extended Stochastic Thermostat detected with interpolation coefficient " << alpha << "." << endl);
    277277        } else {
    278278          alpha = 1.;
    279279        }
    280280      } else {
    281         Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl;
     281        DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl);
    282282        Thermostat = None;
    283283      }
     
    287287        ParseForParameter(verbose,fb,"Thermostat", 0, 2, 1, double_type, &TempFrequency, 1, critical); // read \tau_T
    288288      } else {
    289         Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl;
     289        DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl);
    290290        Thermostat = None;
    291291      }
     
    296296        alpha = 0.;
    297297      } else {
    298         Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl;
     298        DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl);
    299299        Thermostat = None;
    300300      }
    301301    } else {
    302       Log() << Verbose(1) << " Warning: thermostat name was not understood!" << endl;
     302      DoLog(1) && (Log() << Verbose(1) << " Warning: thermostat name was not understood!" << endl);
    303303      Thermostat = None;
    304304    }
    305305  } else {
    306306    if ((MaxOuterStep > 0) && (TargetTemp != 0))
    307       Log() << Verbose(2) <<  "No thermostat chosen despite finite temperature MD, falling back to None." << endl;
     307      DoLog(2) && (Log() << Verbose(2) <<  "No thermostat chosen despite finite temperature MD, falling back to None." << endl);
    308308    Thermostat = None;
    309309  }
     
    321321
    322322  do {
    323     Log() << Verbose(0) << "===========EDIT CONFIGURATION============================" << endl;
    324     Log() << Verbose(0) << " A - mainname (prefix for all runtime files)" << endl;
    325     Log() << Verbose(0) << " B - Default path (for runtime files)" << endl;
    326     Log() << Verbose(0) << " C - Path of pseudopotential files" << endl;
    327     Log() << Verbose(0) << " D - Number of coefficient sharing processes" << endl;
    328     Log() << Verbose(0) << " E - Number of wave function sharing processes" << endl;
    329     Log() << Verbose(0) << " F - 0: Don't output density for OpenDX, 1: do" << endl;
    330     Log() << Verbose(0) << " G - 0: Don't output physical data, 1: do" << endl;
    331     Log() << Verbose(0) << " H - 0: Don't output densities of each unperturbed orbital for OpenDX, 1: do" << endl;
    332     Log() << Verbose(0) << " I - 0: Don't output current density for OpenDX, 1: do" << endl;
    333     Log() << Verbose(0) << " J - 0: Don't do the full current calculation, 1: do" << endl;
    334     Log() << Verbose(0) << " K - 0: Don't do perturbation calculation to obtain susceptibility and shielding, 1: do" << endl;
    335     Log() << Verbose(0) << " L - 0: Wannier centres as calculated, 1: common centre for all, 2: unite centres according to spread, 3: cell centre, 4: shifted to nearest grid point" << endl;
    336     Log() << Verbose(0) << " M - Absolute begin of unphysical sawtooth transfer for position operator within cell" << endl;
    337     Log() << Verbose(0) << " N - (0,1,2) x,y,z-plane to do two-dimensional current vector cut" << endl;
    338     Log() << Verbose(0) << " O - Absolute position along vector cut axis for cut plane" << endl;
    339     Log() << Verbose(0) << " P - Additional Gram-Schmidt-Orthonormalization to stabilize numerics" << endl;
    340     Log() << Verbose(0) << " Q - Initial integer value of random number generator" << endl;
    341     Log() << Verbose(0) << " R - for perturbation 0, for structure optimization defines upper limit of iterations" << endl;
    342     Log() << Verbose(0) << " T - Output visual after ...th step" << endl;
    343     Log() << Verbose(0) << " U - Output source densities of wave functions after ...th step" << endl;
    344     Log() << Verbose(0) << " X - minimization iterations per wave function, if unsure leave at default value 0" << endl;
    345     Log() << Verbose(0) << " Y - tolerance value for total spread in iterative Jacobi diagonalization" << endl;
    346     Log() << Verbose(0) << " Z - Maximum number of minimization iterations" << endl;
    347     Log() << Verbose(0) << " a - Relative change in total energy to stop min. iteration" << endl;
    348     Log() << Verbose(0) << " b - Relative change in kinetic energy to stop min. iteration" << endl;
    349     Log() << Verbose(0) << " c - Check stop conditions every ..th step during min. iteration" << endl;
    350     Log() << Verbose(0) << " e - Maximum number of minimization iterations during initial level" << endl;
    351     Log() << Verbose(0) << " f - Relative change in total energy to stop min. iteration during initial level" << endl;
    352     Log() << Verbose(0) << " g - Relative change in kinetic energy to stop min. iteration during initial level" << endl;
    353     Log() << Verbose(0) << " h - Check stop conditions every ..th step during min. iteration during initial level" << endl;
     323    DoLog(0) && (Log() << Verbose(0) << "===========EDIT CONFIGURATION============================" << endl);
     324    DoLog(0) && (Log() << Verbose(0) << " A - mainname (prefix for all runtime files)" << endl);
     325    DoLog(0) && (Log() << Verbose(0) << " B - Default path (for runtime files)" << endl);
     326    DoLog(0) && (Log() << Verbose(0) << " C - Path of pseudopotential files" << endl);
     327    DoLog(0) && (Log() << Verbose(0) << " D - Number of coefficient sharing processes" << endl);
     328    DoLog(0) && (Log() << Verbose(0) << " E - Number of wave function sharing processes" << endl);
     329    DoLog(0) && (Log() << Verbose(0) << " F - 0: Don't output density for OpenDX, 1: do" << endl);
     330    DoLog(0) && (Log() << Verbose(0) << " G - 0: Don't output physical data, 1: do" << endl);
     331    DoLog(0) && (Log() << Verbose(0) << " H - 0: Don't output densities of each unperturbed orbital for OpenDX, 1: do" << endl);
     332    DoLog(0) && (Log() << Verbose(0) << " I - 0: Don't output current density for OpenDX, 1: do" << endl);
     333    DoLog(0) && (Log() << Verbose(0) << " J - 0: Don't do the full current calculation, 1: do" << endl);
     334    DoLog(0) && (Log() << Verbose(0) << " K - 0: Don't do perturbation calculation to obtain susceptibility and shielding, 1: do" << endl);
     335    DoLog(0) && (Log() << Verbose(0) << " L - 0: Wannier centres as calculated, 1: common centre for all, 2: unite centres according to spread, 3: cell centre, 4: shifted to nearest grid point" << endl);
     336    DoLog(0) && (Log() << Verbose(0) << " M - Absolute begin of unphysical sawtooth transfer for position operator within cell" << endl);
     337    DoLog(0) && (Log() << Verbose(0) << " N - (0,1,2) x,y,z-plane to do two-dimensional current vector cut" << endl);
     338    DoLog(0) && (Log() << Verbose(0) << " O - Absolute position along vector cut axis for cut plane" << endl);
     339    DoLog(0) && (Log() << Verbose(0) << " P - Additional Gram-Schmidt-Orthonormalization to stabilize numerics" << endl);
     340    DoLog(0) && (Log() << Verbose(0) << " Q - Initial integer value of random number generator" << endl);
     341    DoLog(0) && (Log() << Verbose(0) << " R - for perturbation 0, for structure optimization defines upper limit of iterations" << endl);
     342    DoLog(0) && (Log() << Verbose(0) << " T - Output visual after ...th step" << endl);
     343    DoLog(0) && (Log() << Verbose(0) << " U - Output source densities of wave functions after ...th step" << endl);
     344    DoLog(0) && (Log() << Verbose(0) << " X - minimization iterations per wave function, if unsure leave at default value 0" << endl);
     345    DoLog(0) && (Log() << Verbose(0) << " Y - tolerance value for total spread in iterative Jacobi diagonalization" << endl);
     346    DoLog(0) && (Log() << Verbose(0) << " Z - Maximum number of minimization iterations" << endl);
     347    DoLog(0) && (Log() << Verbose(0) << " a - Relative change in total energy to stop min. iteration" << endl);
     348    DoLog(0) && (Log() << Verbose(0) << " b - Relative change in kinetic energy to stop min. iteration" << endl);
     349    DoLog(0) && (Log() << Verbose(0) << " c - Check stop conditions every ..th step during min. iteration" << endl);
     350    DoLog(0) && (Log() << Verbose(0) << " e - Maximum number of minimization iterations during initial level" << endl);
     351    DoLog(0) && (Log() << Verbose(0) << " f - Relative change in total energy to stop min. iteration during initial level" << endl);
     352    DoLog(0) && (Log() << Verbose(0) << " g - Relative change in kinetic energy to stop min. iteration during initial level" << endl);
     353    DoLog(0) && (Log() << Verbose(0) << " h - Check stop conditions every ..th step during min. iteration during initial level" << endl);
    354354//    Log() << Verbose(0) << " j - six lower diagonal entries of matrix, defining the unit cell" << endl;
    355     Log() << Verbose(0) << " k - Energy cutoff of plane wave basis in Hartree" << endl;
    356     Log() << Verbose(0) << " l - Maximum number of levels in multi-level-ansatz" << endl;
    357     Log() << Verbose(0) << " m - Factor by which grid nodes increase between standard and upper level" << endl;
    358     Log() << Verbose(0) << " n - 0: Don't use RiemannTensor, 1: Do" << endl;
    359     Log() << Verbose(0) << " o - Factor by which grid nodes increase between Riemann and standard(?) level" << endl;
    360     Log() << Verbose(0) << " p - Number of Riemann levels" << endl;
    361     Log() << Verbose(0) << " r - 0: Don't Use RiemannTensor, 1: Do" << endl;
    362     Log() << Verbose(0) << " s - 0: Doubly occupied orbitals, 1: Up-/Down-Orbitals" << endl;
    363     Log() << Verbose(0) << " t - Number of orbitals (depends pn SpinType)" << endl;
    364     Log() << Verbose(0) << " u - Number of SpinUp orbitals (depends on SpinType)" << endl;
    365     Log() << Verbose(0) << " v - Number of SpinDown orbitals (depends on SpinType)" << endl;
    366     Log() << Verbose(0) << " w - Number of additional, unoccupied orbitals" << endl;
    367     Log() << Verbose(0) << " x - radial cutoff for ewald summation in Bohrradii" << endl;
    368     Log() << Verbose(0) << " y - 0: Don't do structure optimization beforehand, 1: Do" << endl;
    369     Log() << Verbose(0) << " z - 0: Units are in Bohr radii, 1: units are in Aengstrom" << endl;
    370     Log() << Verbose(0) << " i - 0: Coordinates given in file are absolute, 1: ... are relative to unit cell" << endl;
    371     Log() << Verbose(0) << "=========================================================" << endl;
    372     Log() << Verbose(0) << "INPUT: ";
     355    DoLog(0) && (Log() << Verbose(0) << " k - Energy cutoff of plane wave basis in Hartree" << endl);
     356    DoLog(0) && (Log() << Verbose(0) << " l - Maximum number of levels in multi-level-ansatz" << endl);
     357    DoLog(0) && (Log() << Verbose(0) << " m - Factor by which grid nodes increase between standard and upper level" << endl);
     358    DoLog(0) && (Log() << Verbose(0) << " n - 0: Don't use RiemannTensor, 1: Do" << endl);
     359    DoLog(0) && (Log() << Verbose(0) << " o - Factor by which grid nodes increase between Riemann and standard(?) level" << endl);
     360    DoLog(0) && (Log() << Verbose(0) << " p - Number of Riemann levels" << endl);
     361    DoLog(0) && (Log() << Verbose(0) << " r - 0: Don't Use RiemannTensor, 1: Do" << endl);
     362    DoLog(0) && (Log() << Verbose(0) << " s - 0: Doubly occupied orbitals, 1: Up-/Down-Orbitals" << endl);
     363    DoLog(0) && (Log() << Verbose(0) << " t - Number of orbitals (depends pn SpinType)" << endl);
     364    DoLog(0) && (Log() << Verbose(0) << " u - Number of SpinUp orbitals (depends on SpinType)" << endl);
     365    DoLog(0) && (Log() << Verbose(0) << " v - Number of SpinDown orbitals (depends on SpinType)" << endl);
     366    DoLog(0) && (Log() << Verbose(0) << " w - Number of additional, unoccupied orbitals" << endl);
     367    DoLog(0) && (Log() << Verbose(0) << " x - radial cutoff for ewald summation in Bohrradii" << endl);
     368    DoLog(0) && (Log() << Verbose(0) << " y - 0: Don't do structure optimization beforehand, 1: Do" << endl);
     369    DoLog(0) && (Log() << Verbose(0) << " z - 0: Units are in Bohr radii, 1: units are in Aengstrom" << endl);
     370    DoLog(0) && (Log() << Verbose(0) << " i - 0: Coordinates given in file are absolute, 1: ... are relative to unit cell" << endl);
     371    DoLog(0) && (Log() << Verbose(0) << "=========================================================" << endl);
     372    DoLog(0) && (Log() << Verbose(0) << "INPUT: ");
    373373    cin >> choice;
    374374
    375375    switch (choice) {
    376376        case 'A': // mainname
    377           Log() << Verbose(0) << "Old: " << config::mainname << "\t new: ";
     377          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::mainname << "\t new: ");
    378378          cin >> config::mainname;
    379379          break;
    380380        case 'B': // defaultpath
    381           Log() << Verbose(0) << "Old: " << config::defaultpath << "\t new: ";
     381          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::defaultpath << "\t new: ");
    382382          cin >> config::defaultpath;
    383383          break;
    384384        case 'C': // pseudopotpath
    385           Log() << Verbose(0) << "Old: " << config::pseudopotpath << "\t new: ";
     385          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::pseudopotpath << "\t new: ");
    386386          cin >> config::pseudopotpath;
    387387          break;
    388388
    389389        case 'D': // ProcPEGamma
    390           Log() << Verbose(0) << "Old: " << config::ProcPEGamma << "\t new: ";
     390          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::ProcPEGamma << "\t new: ");
    391391          cin >> config::ProcPEGamma;
    392392          break;
    393393        case 'E': // ProcPEPsi
    394           Log() << Verbose(0) << "Old: " << config::ProcPEPsi << "\t new: ";
     394          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::ProcPEPsi << "\t new: ");
    395395          cin >> config::ProcPEPsi;
    396396          break;
    397397        case 'F': // DoOutVis
    398           Log() << Verbose(0) << "Old: " << config::DoOutVis << "\t new: ";
     398          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::DoOutVis << "\t new: ");
    399399          cin >> config::DoOutVis;
    400400          break;
    401401        case 'G': // DoOutMes
    402           Log() << Verbose(0) << "Old: " << config::DoOutMes << "\t new: ";
     402          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::DoOutMes << "\t new: ");
    403403          cin >> config::DoOutMes;
    404404          break;
    405405        case 'H': // DoOutOrbitals
    406           Log() << Verbose(0) << "Old: " << config::DoOutOrbitals << "\t new: ";
     406          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::DoOutOrbitals << "\t new: ");
    407407          cin >> config::DoOutOrbitals;
    408408          break;
    409409        case 'I': // DoOutCurrent
    410           Log() << Verbose(0) << "Old: " << config::DoOutCurrent << "\t new: ";
     410          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::DoOutCurrent << "\t new: ");
    411411          cin >> config::DoOutCurrent;
    412412          break;
    413413        case 'J': // DoFullCurrent
    414           Log() << Verbose(0) << "Old: " << config::DoFullCurrent << "\t new: ";
     414          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::DoFullCurrent << "\t new: ");
    415415          cin >> config::DoFullCurrent;
    416416          break;
    417417        case 'K': // DoPerturbation
    418           Log() << Verbose(0) << "Old: " << config::DoPerturbation << "\t new: ";
     418          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::DoPerturbation << "\t new: ");
    419419          cin >> config::DoPerturbation;
    420420          break;
    421421        case 'L': // CommonWannier
    422           Log() << Verbose(0) << "Old: " << config::CommonWannier << "\t new: ";
     422          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::CommonWannier << "\t new: ");
    423423          cin >> config::CommonWannier;
    424424          break;
    425425        case 'M': // SawtoothStart
    426           Log() << Verbose(0) << "Old: " << config::SawtoothStart << "\t new: ";
     426          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::SawtoothStart << "\t new: ");
    427427          cin >> config::SawtoothStart;
    428428          break;
    429429        case 'N': // VectorPlane
    430           Log() << Verbose(0) << "Old: " << config::VectorPlane << "\t new: ";
     430          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::VectorPlane << "\t new: ");
    431431          cin >> config::VectorPlane;
    432432          break;
    433433        case 'O': // VectorCut
    434           Log() << Verbose(0) << "Old: " << config::VectorCut << "\t new: ";
     434          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::VectorCut << "\t new: ");
    435435          cin >> config::VectorCut;
    436436          break;
    437437        case 'P': // UseAddGramSch
    438           Log() << Verbose(0) << "Old: " << config::UseAddGramSch << "\t new: ";
     438          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::UseAddGramSch << "\t new: ");
    439439          cin >> config::UseAddGramSch;
    440440          break;
    441441        case 'Q': // Seed
    442           Log() << Verbose(0) << "Old: " << config::Seed << "\t new: ";
     442          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::Seed << "\t new: ");
    443443          cin >> config::Seed;
    444444          break;
    445445
    446446        case 'R': // MaxOuterStep
    447           Log() << Verbose(0) << "Old: " << config::MaxOuterStep << "\t new: ";
     447          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::MaxOuterStep << "\t new: ");
    448448          cin >> config::MaxOuterStep;
    449449          break;
    450450        case 'T': // OutVisStep
    451           Log() << Verbose(0) << "Old: " << config::OutVisStep << "\t new: ";
     451          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::OutVisStep << "\t new: ");
    452452          cin >> config::OutVisStep;
    453453          break;
    454454        case 'U': // OutSrcStep
    455           Log() << Verbose(0) << "Old: " << config::OutSrcStep << "\t new: ";
     455          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::OutSrcStep << "\t new: ");
    456456          cin >> config::OutSrcStep;
    457457          break;
    458458        case 'X': // MaxPsiStep
    459           Log() << Verbose(0) << "Old: " << config::MaxPsiStep << "\t new: ";
     459          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::MaxPsiStep << "\t new: ");
    460460          cin >> config::MaxPsiStep;
    461461          break;
    462462        case 'Y': // EpsWannier
    463           Log() << Verbose(0) << "Old: " << config::EpsWannier << "\t new: ";
     463          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::EpsWannier << "\t new: ");
    464464          cin >> config::EpsWannier;
    465465          break;
    466466
    467467        case 'Z': // MaxMinStep
    468           Log() << Verbose(0) << "Old: " << config::MaxMinStep << "\t new: ";
     468          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::MaxMinStep << "\t new: ");
    469469          cin >> config::MaxMinStep;
    470470          break;
    471471        case 'a': // RelEpsTotalEnergy
    472           Log() << Verbose(0) << "Old: " << config::RelEpsTotalEnergy << "\t new: ";
     472          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::RelEpsTotalEnergy << "\t new: ");
    473473          cin >> config::RelEpsTotalEnergy;
    474474          break;
    475475        case 'b': // RelEpsKineticEnergy
    476           Log() << Verbose(0) << "Old: " << config::RelEpsKineticEnergy << "\t new: ";
     476          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::RelEpsKineticEnergy << "\t new: ");
    477477          cin >> config::RelEpsKineticEnergy;
    478478          break;
    479479        case 'c': // MaxMinStopStep
    480           Log() << Verbose(0) << "Old: " << config::MaxMinStopStep << "\t new: ";
     480          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::MaxMinStopStep << "\t new: ");
    481481          cin >> config::MaxMinStopStep;
    482482          break;
    483483        case 'e': // MaxInitMinStep
    484           Log() << Verbose(0) << "Old: " << config::MaxInitMinStep << "\t new: ";
     484          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::MaxInitMinStep << "\t new: ");
    485485          cin >> config::MaxInitMinStep;
    486486          break;
    487487        case 'f': // InitRelEpsTotalEnergy
    488           Log() << Verbose(0) << "Old: " << config::InitRelEpsTotalEnergy << "\t new: ";
     488          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::InitRelEpsTotalEnergy << "\t new: ");
    489489          cin >> config::InitRelEpsTotalEnergy;
    490490          break;
    491491        case 'g': // InitRelEpsKineticEnergy
    492           Log() << Verbose(0) << "Old: " << config::InitRelEpsKineticEnergy << "\t new: ";
     492          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::InitRelEpsKineticEnergy << "\t new: ");
    493493          cin >> config::InitRelEpsKineticEnergy;
    494494          break;
    495495        case 'h': // InitMaxMinStopStep
    496           Log() << Verbose(0) << "Old: " << config::InitMaxMinStopStep << "\t new: ";
     496          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::InitMaxMinStopStep << "\t new: ");
    497497          cin >> config::InitMaxMinStopStep;
    498498          break;
     
    508508
    509509        case 'k': // ECut
    510           Log() << Verbose(0) << "Old: " << config::ECut << "\t new: ";
     510          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::ECut << "\t new: ");
    511511          cin >> config::ECut;
    512512          break;
    513513        case 'l': // MaxLevel
    514           Log() << Verbose(0) << "Old: " << config::MaxLevel << "\t new: ";
     514          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::MaxLevel << "\t new: ");
    515515          cin >> config::MaxLevel;
    516516          break;
    517517        case 'm': // RiemannTensor
    518           Log() << Verbose(0) << "Old: " << config::RiemannTensor << "\t new: ";
     518          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::RiemannTensor << "\t new: ");
    519519          cin >> config::RiemannTensor;
    520520          break;
    521521        case 'n': // LevRFactor
    522           Log() << Verbose(0) << "Old: " << config::LevRFactor << "\t new: ";
     522          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::LevRFactor << "\t new: ");
    523523          cin >> config::LevRFactor;
    524524          break;
    525525        case 'o': // RiemannLevel
    526           Log() << Verbose(0) << "Old: " << config::RiemannLevel << "\t new: ";
     526          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::RiemannLevel << "\t new: ");
    527527          cin >> config::RiemannLevel;
    528528          break;
    529529        case 'p': // Lev0Factor
    530           Log() << Verbose(0) << "Old: " << config::Lev0Factor << "\t new: ";
     530          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::Lev0Factor << "\t new: ");
    531531          cin >> config::Lev0Factor;
    532532          break;
    533533        case 'r': // RTActualUse
    534           Log() << Verbose(0) << "Old: " << config::RTActualUse << "\t new: ";
     534          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::RTActualUse << "\t new: ");
    535535          cin >> config::RTActualUse;
    536536          break;
    537537        case 's': // PsiType
    538           Log() << Verbose(0) << "Old: " << config::PsiType << "\t new: ";
     538          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::PsiType << "\t new: ");
    539539          cin >> config::PsiType;
    540540          break;
    541541        case 't': // MaxPsiDouble
    542           Log() << Verbose(0) << "Old: " << config::MaxPsiDouble << "\t new: ";
     542          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::MaxPsiDouble << "\t new: ");
    543543          cin >> config::MaxPsiDouble;
    544544          break;
    545545        case 'u': // PsiMaxNoUp
    546           Log() << Verbose(0) << "Old: " << config::PsiMaxNoUp << "\t new: ";
     546          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::PsiMaxNoUp << "\t new: ");
    547547          cin >> config::PsiMaxNoUp;
    548548          break;
    549549        case 'v': // PsiMaxNoDown
    550           Log() << Verbose(0) << "Old: " << config::PsiMaxNoDown << "\t new: ";
     550          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::PsiMaxNoDown << "\t new: ");
    551551          cin >> config::PsiMaxNoDown;
    552552          break;
    553553        case 'w': // AddPsis
    554           Log() << Verbose(0) << "Old: " << config::AddPsis << "\t new: ";
     554          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::AddPsis << "\t new: ");
    555555          cin >> config::AddPsis;
    556556          break;
    557557
    558558        case 'x': // RCut
    559           Log() << Verbose(0) << "Old: " << config::RCut << "\t new: ";
     559          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::RCut << "\t new: ");
    560560          cin >> config::RCut;
    561561          break;
    562562        case 'y': // StructOpt
    563           Log() << Verbose(0) << "Old: " << config::StructOpt << "\t new: ";
     563          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::StructOpt << "\t new: ");
    564564          cin >> config::StructOpt;
    565565          break;
    566566        case 'z': // IsAngstroem
    567           Log() << Verbose(0) << "Old: " << config::IsAngstroem << "\t new: ";
     567          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::IsAngstroem << "\t new: ");
    568568          cin >> config::IsAngstroem;
    569569          break;
    570570        case 'i': // RelativeCoord
    571           Log() << Verbose(0) << "Old: " << config::RelativeCoord << "\t new: ";
     571          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::RelativeCoord << "\t new: ");
    572572          cin >> config::RelativeCoord;
    573573          break;
     
    648648  }
    649649  strcpy(configname, ptr);
    650   Log() << Verbose(0) << "Found configpath: " << configpath << ", dir slash was found at " << last << ", config name is " << configname << "." << endl;
     650  DoLog(0) && (Log() << Verbose(0) << "Found configpath: " << configpath << ", dir slash was found at " << last << ", config name is " << configname << "." << endl);
    651651  delete[](buffer);
    652652};
     
    695695  } else {
    696696    // prescan number of ions per type
    697     Log() << Verbose(0) << "Prescanning ions per type: " << endl;
     697    DoLog(0) && (Log() << Verbose(0) << "Prescanning ions per type: " << endl);
    698698    int NoAtoms = 0;
    699699    for (int i=0; i < MaxTypes; i++) {
     
    702702      ParseForParameter(verbose,FileBuffer, name, 0, 2, 1, int_type, &Z, 1, critical);
    703703      elementhash[i] = periode->FindElement(Z);
    704       Log() << Verbose(1) << i << ". Z = " << elementhash[i]->Z << " with " << No[i] << " ions." << endl;
     704      DoLog(1) && (Log() << Verbose(1) << i << ". Z = " << elementhash[i]->Z << " with " << No[i] << " ions." << endl);
    705705      NoAtoms += No[i];
    706706    }
     
    728728      bool status = true;
    729729      while (status) {
    730         Log() << Verbose(0) << "Currently parsing MD step " << repetition << "." << endl;
     730        DoLog(0) && (Log() << Verbose(0) << "Currently parsing MD step " << repetition << "." << endl);
    731731        for (int i=0; i < MaxTypes; i++) {
    732732          sprintf(name,"Ion_Type%i",i+1);
     
    794794      }
    795795      repetition--;
    796       Log() << Verbose(0) << "Found " << repetition << " trajectory steps." << endl;
     796      DoLog(0) && (Log() << Verbose(0) << "Found " << repetition << " trajectory steps." << endl);
    797797      if (repetition <= 1)  // if onyl one step, desactivate use of trajectories
    798798        mol->MDSteps = 0;
     
    806806              ParseForParameter(verbose,FileBuffer, "Ion_Type1_1", 0, 3, 1, double_type, &value[2], repetition, (repetition == 0) ? critical : optional))
    807807        repetition++;
    808       Log() << Verbose(0) << "I found " << repetition << " times the keyword Ion_Type1_1." << endl;
     808      DoLog(0) && (Log() << Verbose(0) << "I found " << repetition << " times the keyword Ion_Type1_1." << endl);
    809809      // parse in molecule coordinates
    810810      for (int i=0; i < MaxTypes; i++) {
     
    10631063    BG = new BondGraph(IsAngstroem);
    10641064    if (BG->LoadBondLengthTable(BondGraphFileName)) {
    1065       Log() << Verbose(0) << "Bond length table loaded successfully." << endl;
     1065      DoLog(0) && (Log() << Verbose(0) << "Bond length table loaded successfully." << endl);
    10661066    } else {
    10671067      DoeLog(1) && (eLog()<< Verbose(1) << "Bond length table loading failed." << endl);
     
    12541254  BG = new BondGraph(IsAngstroem);
    12551255  if (BG->LoadBondLengthTable(BondGraphFileName)) {
    1256     Log() << Verbose(0) << "Bond length table loaded successfully." << endl;
     1256    DoLog(0) && (Log() << Verbose(0) << "Bond length table loaded successfully." << endl);
    12571257  } else {
    1258     Log() << Verbose(0) << "Bond length table loading failed." << endl;
     1258    DoLog(0) && (Log() << Verbose(0) << "Bond length table loading failed." << endl);
    12591259  }
    12601260
     
    12631263  for (i=MAX_ELEMENTS;i--;)
    12641264    elementhash[i] = NULL;
    1265   Log() << Verbose(0) << "Parsing Ions ..." << endl;
     1265  DoLog(0) && (Log() << Verbose(0) << "Parsing Ions ..." << endl);
    12661266  No=0;
    12671267  found = 0;
    12681268  while (getline(*file,zeile,'\n')) {
    12691269    if (zeile.find("Ions_Data") == 0) {
    1270       Log() << Verbose(1) << "found Ions_Data...begin parsing" << endl;
     1270      DoLog(1) && (Log() << Verbose(1) << "found Ions_Data...begin parsing" << endl);
    12711271      found ++;
    12721272    }
     
    12821282      input >> b;     // element mass
    12831283      elementhash[No] = periode->FindElement(Z);
    1284       Log() << Verbose(1) << "AtomNo: " << AtomNo << "\tZ: " << Z << "\ta:" << a << "\tl:"  << l << "\b:" << b << "\tElement:" << elementhash[No] << "\t:" << endl;
     1284      DoLog(1) && (Log() << Verbose(1) << "AtomNo: " << AtomNo << "\tZ: " << Z << "\ta:" << a << "\tl:"  << l << "\b:" << b << "\tElement:" << elementhash[No] << "\t:" << endl);
    12851285      for(i=0;i<AtomNo;i++) {
    12861286        if (!getline(*file,zeile,'\n')) {// parse on and on
    1287           Log() << Verbose(2) << "Error: Too few items in ionic list of element" << elementhash[No] << "." << endl << "Exiting." << endl;
     1287          DoLog(2) && (Log() << Verbose(2) << "Error: Too few items in ionic list of element" << elementhash[No] << "." << endl << "Exiting." << endl);
    12881288          // return 1;
    12891289        } else {
  • src/datacreator.cpp

    r6613ec ra67d19  
    2525  output.open(name.str().c_str(), ios::out);
    2626  if (output == NULL) {
    27     Log() << Verbose(0) << "Unable to open " << name.str() << " for writing, is directory correct?" << endl;
     27    DoLog(0) && (Log() << Verbose(0) << "Unable to open " << name.str() << " for writing, is directory correct?" << endl);
    2828    return false;
    2929  }
     
    4343  output.open(name.str().c_str(), ios::app);
    4444  if (output == NULL) {
    45     Log() << Verbose(0) << "Unable to open " << name.str() << " for writing, is directory correct?" << endl;
     45    DoLog(0) && (Log() << Verbose(0) << "Unable to open " << name.str() << " for writing, is directory correct?" << endl);
    4646    return false;
    4747  }
     
    6363  filename << prefix << ".dat";
    6464  if (!OpenOutputFile(output, dir, filename.str().c_str())) return false;
    65   Log() << Verbose(0) << msg << endl;
     65  DoLog(0) && (Log() << Verbose(0) << msg << endl);
    6666  output << "# " << msg << ", created on " << datum;
    6767  output << "#Order\tFrag.No.\t" << Fragments.Header[Fragments.MatrixCounter] << endl;
     
    9696  filename << prefix << ".dat";
    9797  if (!OpenOutputFile(output, dir, filename.str().c_str())) return false;
    98   Log() << Verbose(0) << msg << endl;
     98  DoLog(0) && (Log() << Verbose(0) << msg << endl);
    9999  output << "# " << msg << ", created on " << datum;
    100100  output << "#Order\tFrag.No.\t" << Fragments.Header[Fragments.MatrixCounter] << endl;
     
    133133  filename << prefix << ".dat";
    134134  if (!OpenOutputFile(output, dir, filename.str().c_str())) return false;
    135   Log() << Verbose(0) << msg << endl;
     135  DoLog(0) && (Log() << Verbose(0) << msg << endl);
    136136  output << "# " << msg << ", created on " << datum;
    137137  output << "# Order\tFrag.No.\t" << Fragments.Header[Fragments.MatrixCounter] << endl;
     
    165165  filename << prefix << ".dat";
    166166  if (!OpenOutputFile(output, dir, filename.str().c_str())) return false;
    167   Log() << Verbose(0) << msg << endl;
     167  DoLog(0) && (Log() << Verbose(0) << msg << endl);
    168168  output << "# " << msg << ", created on " << datum;
    169169  output << "# Order\tFrag.No.\t" << Fragments.Header[Fragments.MatrixCounter] << endl;
     
    198198  filename << prefix << ".dat";
    199199  if (!OpenOutputFile(output, dir, filename.str().c_str())) return false;
    200   Log() << Verbose(0) << msg << endl;
     200  DoLog(0) && (Log() << Verbose(0) << msg << endl);
    201201  output << "# " << msg << ", created on " << datum;
    202202  output << "# AtomNo\t" << Fragments.Header[Fragments.MatrixCounter] << endl;
     
    244244  filename << prefix << ".dat";
    245245  if (!OpenOutputFile(output, dir, filename.str().c_str())) return false;
    246   Log() << Verbose(0) << msg << endl;
     246  DoLog(0) && (Log() << Verbose(0) << msg << endl);
    247247  output << "# " << msg << ", created on " << datum;
    248248  output << "# AtomNo\t" << Fragments.Header[Fragments.MatrixCounter] << endl;
     
    281281  filename << prefix << ".dat";
    282282  if (!OpenOutputFile(output, dir, filename.str().c_str())) return false;
    283   Log() << Verbose(0) << msg << endl;
     283  DoLog(0) && (Log() << Verbose(0) << msg << endl);
    284284  output << "# " << msg << ", created on " << datum;
    285285  output << "# AtomNo\t" << Fragments.Header[Fragments.MatrixCounter] << endl;
     
    321321  filename << prefix << ".dat";
    322322  if (!OpenOutputFile(output, dir, filename.str().c_str())) return false;
    323   Log() << Verbose(0) << msg << endl;
     323  DoLog(0) && (Log() << Verbose(0) << msg << endl);
    324324  output << "# " << msg << ", created on " << datum;
    325325  output << "# AtomNo\t";
     
    363363  filename << prefix << ".dat";
    364364  if (!OpenOutputFile(output, dir, filename.str().c_str())) return false;
    365   Log() << Verbose(0) << msg << endl;
     365  DoLog(0) && (Log() << Verbose(0) << msg << endl);
    366366  output << "# " << msg << ", created on " << datum;
    367367  output << "# AtomNo\t" << Fragments.Header[ Fragments.MatrixCounter ] << endl;
     
    393393  filename << prefix << ".dat";
    394394  if (!OpenOutputFile(output, dir, filename.str().c_str())) return false;
    395   Log() << Verbose(0) << msg << endl;
     395  DoLog(0) && (Log() << Verbose(0) << msg << endl);
    396396  output << "# " << msg << ", created on " << datum << endl;
    397397  output << "#Order\tFrag.No.\t" << Fragment.Header[ Fragment.MatrixCounter ] << endl;
     
    458458  filename << prefix << ".dat";
    459459  if (!OpenOutputFile(output, dir, filename.str().c_str())) return false;
    460   Log() << Verbose(0) << msg << endl;
     460  DoLog(0) && (Log() << Verbose(0) << msg << endl);
    461461  output << "# " << msg << ", created on " << datum;
    462462  output << "#Order\tFrag.No.\t" << Fragment.Header[ Fragment.MatrixCounter ] << endl;
  • src/ellipsoid.cpp

    r6613ec ra67d19  
    146146{
    147147  int status = GSL_SUCCESS;
    148   Log() << Verbose(2) << "Begin of FitPointSetToEllipsoid " << endl;
     148  DoLog(2) && (Log() << Verbose(2) << "Begin of FitPointSetToEllipsoid " << endl);
    149149  if (N >= 3) { // check that enough points are given (9 d.o.f.)
    150150    struct EllipsoidMinimisation par;
     
    199199          EllipsoidAngle[i] = gsl_vector_get (s->x, i+6);
    200200        }
    201         Log() << Verbose(4) << setprecision(3) << "Converged fit at: " << *EllipsoidCenter << ", lengths " << EllipsoidLength[0] << ", " << EllipsoidLength[1] << ", " << EllipsoidLength[2] << ", angles " << EllipsoidAngle[0] << ", " << EllipsoidAngle[1] << ", " << EllipsoidAngle[2] << " with summed distance " << s->fval << "." << endl;
     201        DoLog(4) && (Log() << Verbose(4) << setprecision(3) << "Converged fit at: " << *EllipsoidCenter << ", lengths " << EllipsoidLength[0] << ", " << EllipsoidLength[1] << ", " << EllipsoidLength[2] << ", angles " << EllipsoidAngle[0] << ", " << EllipsoidAngle[1] << ", " << EllipsoidAngle[2] << " with summed distance " << s->fval << "." << endl);
    202202      }
    203203
     
    209209
    210210  } else {
    211     Log() << Verbose(3) << "Not enough points provided for fit to ellipsoid." << endl;
     211    DoLog(3) && (Log() << Verbose(3) << "Not enough points provided for fit to ellipsoid." << endl);
    212212    return false;
    213213  }
    214   Log() << Verbose(2) << "End of FitPointSetToEllipsoid" << endl;
     214  DoLog(2) && (Log() << Verbose(2) << "End of FitPointSetToEllipsoid" << endl);
    215215  if (status == GSL_SUCCESS)
    216216    return true;
     
    235235  int index;
    236236  TesselPoint *Candidate = NULL;
    237   Log() << Verbose(2) << "Begin of PickRandomPointSet" << endl;
     237  DoLog(2) && (Log() << Verbose(2) << "Begin of PickRandomPointSet" << endl);
    238238
    239239  // allocate array
     
    247247    for(int i=0;i<NDIM;i++) // pick three random indices
    248248      LC->n[i] = (rand() % LC->N[i]);
    249     Log() << Verbose(2) << "INFO: Center cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " ... ";
     249    DoLog(2) && (Log() << Verbose(2) << "INFO: Center cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " ... ");
    250250    // get random cell
    251251    const LinkedCell::LinkedNodes *List = LC->GetCurrentCell();
     
    253253      continue;
    254254    }
    255     Log() << Verbose(2) << "with No. " << LC->index << "." << endl;
    256 
    257     Log() << Verbose(2) << "LC Intervals:";
     255    DoLog(2) && (Log() << Verbose(2) << "with No. " << LC->index << "." << endl);
     256
     257    DoLog(2) && (Log() << Verbose(2) << "LC Intervals:");
    258258    for (int i=0;i<NDIM;i++) {
    259259      Nlower[i] = ((LC->n[i]-1) >= 0) ? LC->n[i]-1 : 0;
    260260      Nupper[i] = ((LC->n[i]+1) < LC->N[i]) ? LC->n[i]+1 : LC->N[i]-1;
    261       Log() << Verbose(0) << " [" << Nlower[i] << "," << Nupper[i] << "] ";
    262     }
    263     Log() << Verbose(0) << endl;
     261      DoLog(0) && (Log() << Verbose(0) << " [" << Nlower[i] << "," << Nupper[i] << "] ");
     262    }
     263    DoLog(0) && (Log() << Verbose(0) << endl);
    264264
    265265    // count whether there are sufficient atoms in this cell+neighbors
     
    271271          PointsLeft += List->size();
    272272        }
    273     Log() << Verbose(2) << "There are " << PointsLeft << " atoms in this neighbourhood." << endl;
     273    DoLog(2) && (Log() << Verbose(2) << "There are " << PointsLeft << " atoms in this neighbourhood." << endl);
    274274    if (PointsLeft < PointsToPick) {  // ensure that we can pick enough points in its neighbourhood at all.
    275275      continue;
     
    303303              if ((current != PickedAtomNrs.end()) && (*current == index)) {
    304304                Candidate = (*Runner);
    305                 Log() << Verbose(2) << "Current picked node is " << **Runner << " with index " << index << "." << endl;
     305                DoLog(2) && (Log() << Verbose(2) << "Current picked node is " << **Runner << " with index " << index << "." << endl);
    306306                x[PointsPicked++].CopyVector(Candidate->node);    // we have one more atom picked
    307307                current++;    // next pre-picked atom
     
    313313          }
    314314        }
    315     Log() << Verbose(2) << "The following points were picked: " << endl;
     315    DoLog(2) && (Log() << Verbose(2) << "The following points were picked: " << endl);
    316316    for (size_t i=0;i<PointsPicked;i++)
    317       Log() << Verbose(2) << x[i] << endl;
     317      DoLog(2) && (Log() << Verbose(2) << x[i] << endl);
    318318    if (PointsPicked == PointsToPick)  // break out of loop if we have all
    319319      break;
    320320  } while(1);
    321321
    322   Log() << Verbose(2) << "End of PickRandomPointSet" << endl;
     322  DoLog(2) && (Log() << Verbose(2) << "End of PickRandomPointSet" << endl);
    323323};
    324324
     
    335335  double value, threshold;
    336336  PointMap *List = &T->PointsOnBoundary;
    337   Log() << Verbose(2) << "Begin of PickRandomPointSet" << endl;
     337  DoLog(2) && (Log() << Verbose(2) << "Begin of PickRandomPointSet" << endl);
    338338
    339339  // allocate array
     
    358358      PointsLeft--;
    359359    }
    360   Log() << Verbose(2) << "The following points were picked: " << endl;
     360  DoLog(2) && (Log() << Verbose(2) << "The following points were picked: " << endl);
    361361  for (size_t i=0;i<PointsPicked;i++)
    362     Log() << Verbose(3) << x[i] << endl;
    363 
    364   Log() << Verbose(2) << "End of PickRandomPointSet" << endl;
     362    DoLog(3) && (Log() << Verbose(3) << x[i] << endl);
     363
     364  DoLog(2) && (Log() << Verbose(2) << "End of PickRandomPointSet" << endl);
    365365};
    366366
     
    382382  double EllipsoidAngle[3];
    383383  double distance, MaxDistance, MinDistance;
    384   Log() << Verbose(0) << "Begin of FindDistributionOfEllipsoids" << endl;
     384  DoLog(0) && (Log() << Verbose(0) << "Begin of FindDistributionOfEllipsoids" << endl);
    385385
    386386  // construct center of gravity of boundary point set for initial ellipsoid center
     
    389389    Center.AddVector(Runner->second->node->node);
    390390  Center.Scale(1./T->PointsOnBoundaryCount);
    391   Log() << Verbose(1) << "Center is at " << Center << "." << endl;
     391  DoLog(1) && (Log() << Verbose(1) << "Center is at " << Center << "." << endl);
    392392
    393393  // Output header
     
    397397  // loop over desired number of parameter sets
    398398  for (;number >0;number--) {
    399     Log() << Verbose(1) << "Determining data set " << number << " ... " << endl;
     399    DoLog(1) && (Log() << Verbose(1) << "Determining data set " << number << " ... " << endl);
    400400    // pick the point set
    401401    x = NULL;
     
    423423    // fit the parameters
    424424    if (FitPointSetToEllipsoid(x, N, &EllipsoidCenter, &EllipsoidLength[0], &EllipsoidAngle[0])) {
    425       Log() << Verbose(1) << "Picking succeeded!" << endl;
     425      DoLog(1) && (Log() << Verbose(1) << "Picking succeeded!" << endl);
    426426      // output obtained parameter set
    427427      output << number << "\t";
     
    434434      output << endl;
    435435    } else { // increase N to pick one more
    436       Log() << Verbose(1) << "Picking failed!" << endl;
     436      DoLog(1) && (Log() << Verbose(1) << "Picking failed!" << endl);
    437437      number++;
    438438    }
     
    442442  output.close();
    443443
    444   Log() << Verbose(0) << "End of FindDistributionOfEllipsoids" << endl;
    445 };
     444  DoLog(0) && (Log() << Verbose(0) << "End of FindDistributionOfEllipsoids" << endl);
     445};
  • src/graph.cpp

    r6613ec ra67d19  
    8585  testGraphInsert = Fragment->Leaflet->insert(GraphPair (*Fragment->FragmentSet,pair<int,double>(Fragment->FragmentCounter,Fragment->TEFactor)));  // store fragment number and current factor
    8686  if (testGraphInsert.second) {
    87     Log() << Verbose(2) << "KeySet " << Fragment->FragmentCounter << " successfully inserted." << endl;
     87    DoLog(2) && (Log() << Verbose(2) << "KeySet " << Fragment->FragmentCounter << " successfully inserted." << endl);
    8888    Fragment->FragmentCounter++;
    8989  } else {
    90     Log() << Verbose(2) << "KeySet " << Fragment->FragmentCounter << " failed to insert, present fragment is " << ((*(testGraphInsert.first)).second).first << endl;
     90    DoLog(2) && (Log() << Verbose(2) << "KeySet " << Fragment->FragmentCounter << " failed to insert, present fragment is " << ((*(testGraphInsert.first)).second).first << endl);
    9191    ((*(testGraphInsert.first)).second).second += Fragment->TEFactor;  // increase the "created" counter
    92     Log() << Verbose(2) << "New factor is " << ((*(testGraphInsert.first)).second).second << "." << endl;
     92    DoLog(2) && (Log() << Verbose(2) << "New factor is " << ((*(testGraphInsert.first)).second).second << "." << endl);
    9393  }
    9494};
     
    115115    testGraphInsert = graph1.insert(GraphPair ((*runner).first,pair<int,double>((*counter)++,((*runner).second).second)));  // store fragment number and current factor
    116116    if (testGraphInsert.second) {
    117       Log() << Verbose(2) << "KeySet " << (*counter)-1 << " successfully inserted." << endl;
     117      DoLog(2) && (Log() << Verbose(2) << "KeySet " << (*counter)-1 << " successfully inserted." << endl);
    118118    } else {
    119       Log() << Verbose(2) << "KeySet " << (*counter)-1 << " failed to insert, present fragment is " << ((*(testGraphInsert.first)).second).first << endl;
     119      DoLog(2) && (Log() << Verbose(2) << "KeySet " << (*counter)-1 << " failed to insert, present fragment is " << ((*(testGraphInsert.first)).second).first << endl);
    120120      ((*(testGraphInsert.first)).second).second += (*runner).second.second;
    121       Log() << Verbose(2) << "New factor is " << (*(testGraphInsert.first)).second.second << "." << endl;
     121      DoLog(2) && (Log() << Verbose(2) << "New factor is " << (*(testGraphInsert.first)).second.second << "." << endl);
    122122    }
    123123  }
  • src/helpers.cpp

    r6613ec ra67d19  
    1919  double test = 0.1439851348959832147598734598273456723948652983045928346598365;
    2020  do {
    21     Log() << Verbose(0) << text;
     21    DoLog(0) && (Log() << Verbose(0) << text);
    2222    cin >> test;
    2323  } while (test == 0.1439851348959832147598734598273456723948652983045928346598365);
  • src/helpers.hpp

    r6613ec ra67d19  
    114114
    115115  if (LookupTable != NULL) {
    116     Log() << Verbose(0) << "Pointer for Lookup table is not NULL! Aborting ..." <<endl;
     116    DoLog(0) && (Log() << Verbose(0) << "Pointer for Lookup table is not NULL! Aborting ..." <<endl);
    117117    return false;
    118118  }
     
    127127  }
    128128  if (count <= 0) {
    129     Log() << Verbose(0) << "Count of lookup list is 0 or less." << endl;
     129    DoLog(0) && (Log() << Verbose(0) << "Count of lookup list is 0 or less." << endl);
    130130    return false;
    131131  }
     
    146146        LookupTable[AtomNo] = Walker;
    147147      } else {
    148         Log() << Verbose(0) << "Walker " << *Walker << " exceeded range of nuclear ids [0, " << count << ")." << endl;
     148        DoLog(0) && (Log() << Verbose(0) << "Walker " << *Walker << " exceeded range of nuclear ids [0, " << count << ")." << endl);
    149149        status = false;
    150150        break;
  • src/info.cpp

    r6613ec ra67d19  
    2121  verbosity++;
    2222  FunctionName = msg;
    23   Log() << Verbose(0) << "Begin of " << FunctionName << endl;
     23  DoLog(0) && (Log() << Verbose(0) << "Begin of " << FunctionName << endl);
    2424};
    2525
     
    2828 */
    2929Info::~Info() {
    30   Log() << Verbose(0) << "End of " << FunctionName << endl;
     30  DoLog(0) && (Log() << Verbose(0) << "End of " << FunctionName << endl);
    3131  verbosity--;
    3232}
  • src/joiner.cpp

    r6613ec ra67d19  
    4747  bool NoHessian = false;
    4848
    49   Log() << Verbose(0) << "Joiner" << endl;
    50   Log() << Verbose(0) << "======" << endl;
     49  DoLog(0) && (Log() << Verbose(0) << "Joiner" << endl);
     50  DoLog(0) && (Log() << Verbose(0) << "======" << endl);
    5151
    5252  // Get the command line options
    5353  if (argc < 3) {
    54     Log() << Verbose(0) << "Usage: " << argv[0] << " <inputdir> <prefix> [elementsdb]" << endl;
    55     Log() << Verbose(0) << "<inputdir>\ttherein the output of a molecuilder fragmentation is expected, each fragment with a subdir containing an energy.all and a forces.all file." << endl;
    56     Log() << Verbose(0) << "<prefix>\tprefix of energy and forces file." << endl;
    57     Log() << Verbose(0) << "[elementsdb]\tpath to elements database, needed for shieldings." << endl;
     54    DoLog(0) && (Log() << Verbose(0) << "Usage: " << argv[0] << " <inputdir> <prefix> [elementsdb]" << endl);
     55    DoLog(0) && (Log() << Verbose(0) << "<inputdir>\ttherein the output of a molecuilder fragmentation is expected, each fragment with a subdir containing an energy.all and a forces.all file." << endl);
     56    DoLog(0) && (Log() << Verbose(0) << "<prefix>\tprefix of energy and forces file." << endl);
     57    DoLog(0) && (Log() << Verbose(0) << "[elementsdb]\tpath to elements database, needed for shieldings." << endl);
    5858    return 1;
    5959  } else {
     
    7777  if (!Hcorrection.ParseFragmentMatrix(argv[1], "", HCORRECTIONSUFFIX, 0,0)) {
    7878    NoHCorrection = true;
    79     Log() << Verbose(0) << "No HCorrection matrices found, skipping these." << endl;
     79    DoLog(0) && (Log() << Verbose(0) << "No HCorrection matrices found, skipping these." << endl);
    8080  }
    8181  if (!Force.ParseFragmentMatrix(argv[1], dir, ForcesSuffix, 0,0)) return 1;
    8282  if (!Hessian.ParseFragmentMatrix(argv[1], dir, HessianSuffix, 0,0)) {
    8383    NoHessian = true;
    84     Log() << Verbose(0) << "No hessian matrices found, skipping these." << endl;
     84    DoLog(0) && (Log() << Verbose(0) << "No hessian matrices found, skipping these." << endl);
    8585  }
    8686  if (periode != NULL) { // also look for PAS values
     
    146146  for (int BondOrder=0;BondOrder<KeySet.Order;BondOrder++) {
    147147    // --------- sum up energy --------------------
    148     Log() << Verbose(0) << "Summing energy of order " << BondOrder+1 << " ..." << endl;
     148    DoLog(0) && (Log() << Verbose(0) << "Summing energy of order " << BondOrder+1 << " ..." << endl);
    149149    if (!EnergyFragments.SumSubManyBodyTerms(Energy, KeySet, BondOrder)) return 1;
    150150    if (!NoHCorrection) {
     
    155155      if (!Energy.SumSubEnergy(EnergyFragments, NULL, KeySet, BondOrder, 1.)) return 1;
    156156    // --------- sum up Forces --------------------
    157     Log() << Verbose(0) << "Summing forces of order " << BondOrder+1 << " ..." << endl;
     157    DoLog(0) && (Log() << Verbose(0) << "Summing forces of order " << BondOrder+1 << " ..." << endl);
    158158    if (!ForceFragments.SumSubManyBodyTerms(Force, KeySet, BondOrder)) return 1;
    159159    if (!Force.SumSubForces(ForceFragments, KeySet, BondOrder, 1.)) return 1;
    160160    // --------- sum up Hessian --------------------
    161161    if (!NoHessian) {
    162       Log() << Verbose(0) << "Summing Hessian of order " << BondOrder+1 << " ..." << endl;
     162      DoLog(0) && (Log() << Verbose(0) << "Summing Hessian of order " << BondOrder+1 << " ..." << endl);
    163163      if (!HessianFragments.SumSubManyBodyTerms(Hessian, KeySet, BondOrder)) return 1;
    164164      if (!Hessian.SumSubHessians(HessianFragments, KeySet, BondOrder, 1.)) return 1;
    165165    }
    166166    if (periode != NULL) { // also look for PAS values
    167       Log() << Verbose(0) << "Summing shieldings and susceptibilities of order " << BondOrder+1 << " ..." << endl;
     167      DoLog(0) && (Log() << Verbose(0) << "Summing shieldings and susceptibilities of order " << BondOrder+1 << " ..." << endl);
    168168      if (!ShieldingFragments.SumSubManyBodyTerms(Shielding, KeySet, BondOrder)) return 1;
    169169      if (!Shielding.SumSubForces(ShieldingFragments, KeySet, BondOrder, 1.)) return 1;
     
    179179    prefix.str(" ");
    180180    prefix << dir << OrderSuffix << (BondOrder+1);
    181     Log() << Verbose(0) << "Writing files " << argv[1] << prefix.str() << ". ..." << endl;
     181    DoLog(0) && (Log() << Verbose(0) << "Writing files " << argv[1] << prefix.str() << ". ..." << endl);
    182182    // energy
    183183    if (!Energy.WriteLastMatrix(argv[1], (prefix.str()).c_str(), EnergySuffix)) return 1;
     
    244244  delete(periode);
    245245  Free(&dir);
    246   Log() << Verbose(0) << "done." << endl;
     246  DoLog(0) && (Log() << Verbose(0) << "done." << endl);
    247247  return 0;
    248248};
  • src/linkedcell.cpp

    r6613ec ra67d19  
    4545  max.Zero();
    4646  min.Zero();
    47   Log() << Verbose(1) << "Begin of LinkedCell" << endl;
     47  DoLog(1) && (Log() << Verbose(1) << "Begin of LinkedCell" << endl);
    4848  if ((set == NULL) || (set->IsEmpty())) {
    4949    DoeLog(1) && (eLog()<< Verbose(1) << "set is NULL or contains no linked cell nodes!" << endl);
     
    6868    set->GoToNext();
    6969  }
    70   Log() << Verbose(2) << "Bounding box is " << min << " and " << max << "." << endl;
     70  DoLog(2) && (Log() << Verbose(2) << "Bounding box is " << min << " and " << max << "." << endl);
    7171
    7272  // 2. find then number of cells per axis
     
    7474    N[i] = (int)floor((max.x[i] - min.x[i])/RADIUS)+1;
    7575  }
    76   Log() << Verbose(2) << "Number of cells per axis are " << N[0] << ", " << N[1] << " and " << N[2] << "." << endl;
     76  DoLog(2) && (Log() << Verbose(2) << "Number of cells per axis are " << N[0] << ", " << N[1] << " and " << N[2] << "." << endl);
    7777
    7878  // 3. allocate the lists
    79   Log() << Verbose(2) << "Allocating cells ... ";
     79  DoLog(2) && (Log() << Verbose(2) << "Allocating cells ... ");
    8080  if (LC != NULL) {
    8181    DoeLog(1) && (eLog()<< Verbose(1) << "Linked Cell list is already allocated, I do nothing." << endl);
     
    8686    LC [index].clear();
    8787  }
    88   Log() << Verbose(0) << "done."  << endl;
     88  DoLog(0) && (Log() << Verbose(0) << "done."  << endl);
    8989
    9090  // 4. put each atom into its respective cell
    91   Log() << Verbose(2) << "Filling cells ... ";
     91  DoLog(2) && (Log() << Verbose(2) << "Filling cells ... ");
    9292  set->GoToFirst();
    9393  while (!set->IsEnd()) {
     
    101101    set->GoToNext();
    102102  }
    103   Log() << Verbose(0) << "done."  << endl;
    104   Log() << Verbose(1) << "End of LinkedCell" << endl;
     103  DoLog(0) && (Log() << Verbose(0) << "done."  << endl);
     104  DoLog(1) && (Log() << Verbose(1) << "End of LinkedCell" << endl);
    105105};
    106106
     
    120120  max.Zero();
    121121  min.Zero();
    122   Log() << Verbose(1) << "Begin of LinkedCell" << endl;
     122  DoLog(1) && (Log() << Verbose(1) << "Begin of LinkedCell" << endl);
    123123  if (set->empty()) {
    124124    DoeLog(1) && (eLog()<< Verbose(1) << "set contains no linked cell nodes!" << endl);
     
    140140    }
    141141  }
    142   Log() << Verbose(2) << "Bounding box is " << min << " and " << max << "." << endl;
     142  DoLog(2) && (Log() << Verbose(2) << "Bounding box is " << min << " and " << max << "." << endl);
    143143
    144144  // 2. find then number of cells per axis
     
    146146    N[i] = (int)floor((max.x[i] - min.x[i])/RADIUS)+1;
    147147  }
    148   Log() << Verbose(2) << "Number of cells per axis are " << N[0] << ", " << N[1] << " and " << N[2] << "." << endl;
     148  DoLog(2) && (Log() << Verbose(2) << "Number of cells per axis are " << N[0] << ", " << N[1] << " and " << N[2] << "." << endl);
    149149
    150150  // 3. allocate the lists
    151   Log() << Verbose(2) << "Allocating cells ... ";
     151  DoLog(2) && (Log() << Verbose(2) << "Allocating cells ... ");
    152152  if (LC != NULL) {
    153153    DoeLog(1) && (eLog()<< Verbose(1) << "Linked Cell list is already allocated, I do nothing." << endl);
     
    158158    LC [index].clear();
    159159  }
    160   Log() << Verbose(0) << "done."  << endl;
     160  DoLog(0) && (Log() << Verbose(0) << "done."  << endl);
    161161
    162162  // 4. put each atom into its respective cell
    163   Log() << Verbose(2) << "Filling cells ... ";
     163  DoLog(2) && (Log() << Verbose(2) << "Filling cells ... ");
    164164  for (LinkedNodes::iterator Runner = set->begin(); Runner != set->end(); Runner++) {
    165165    Walker = *Runner;
     
    171171    //Log() << Verbose(2) << *Walker << " goes into cell " << n[0] << ", " << n[1] << ", " << n[2] << " with No. " << index << "." << endl;
    172172  }
    173   Log() << Verbose(0) << "done."  << endl;
    174   Log() << Verbose(1) << "End of LinkedCell" << endl;
     173  DoLog(0) && (Log() << Verbose(0) << "done."  << endl);
     174  DoLog(1) && (Log() << Verbose(1) << "End of LinkedCell" << endl);
    175175};
    176176
     
    399399    return TesselList;
    400400  } else
    401     Log() << Verbose(1) << "Distance of closest cell to center of sphere with radius " << radius << " is " << dist << "." << endl;
     401    DoLog(1) && (Log() << Verbose(1) << "Distance of closest cell to center of sphere with radius " << radius << " is " << dist << "." << endl);
    402402
    403403  // gather all neighbours first, then look who fulfills distance criteria
  • src/memoryusageobserver.cpp

    r6613ec ra67d19  
    9393      << pointer << " is not registered by MemoryUsageObserver: ";
    9494    if (msg != NULL)
    95       Log() << Verbose(0) << *msg;
    96     Log() << Verbose(0) << endl;
     95      DoLog(0) && (Log() << Verbose(0) << *msg);
     96    DoLog(0) && (Log() << Verbose(0) << endl);
    9797    return;
    9898  }
  • src/molecule.cpp

    r6613ec ra67d19  
    429429  input = new istringstream(line);
    430430  *input >> NumberOfAtoms;
    431   Log() << Verbose(0) << "Parsing " << NumberOfAtoms << " atoms in file." << endl;
     431  DoLog(0) && (Log() << Verbose(0) << "Parsing " << NumberOfAtoms << " atoms in file." << endl);
    432432  getline(xyzfile,line,'\n'); // Read comment
    433   Log() << Verbose(1) << "Comment: " << line << endl;
     433  DoLog(1) && (Log() << Verbose(1) << "Comment: " << line << endl);
    434434
    435435  if (MDSteps == 0) // no atoms yet present
     
    665665    return walker;
    666666  } else {
    667     Log() << Verbose(0) << "Atom not found in list." << endl;
     667    DoLog(0) && (Log() << Verbose(0) << "Atom not found in list." << endl);
    668668    return NULL;
    669669  }
     
    681681    //mol->Output((ofstream *)&cout);
    682682    //Log() << Verbose(0) << "===============================================" << endl;
    683     Log() << Verbose(0) << text;
     683    DoLog(0) && (Log() << Verbose(0) << text);
    684684    cin >> No;
    685685    ion = this->FindAtom(No);
     
    770770void molecule::OutputListOfBonds() const
    771771{
    772   Log() << Verbose(2) << endl << "From Contents of ListOfBonds, all non-hydrogen atoms:" << endl;
     772  DoLog(2) && (Log() << Verbose(2) << endl << "From Contents of ListOfBonds, all non-hydrogen atoms:" << endl);
    773773  ActOnAllAtoms (&atom::OutputBondOfAtom );
    774   Log() << Verbose(0) << endl;
     774  DoLog(0) && (Log() << Verbose(0) << endl);
    775775};
    776776
     
    829829  }
    830830  if ((AtomCount == 0) || (i != AtomCount)) {
    831     Log() << Verbose(3) << "Mismatch in AtomCount " << AtomCount << " and recounted number " << i << ", renaming all." << endl;
     831    DoLog(3) && (Log() << Verbose(3) << "Mismatch in AtomCount " << AtomCount << " and recounted number " << i << ", renaming all." << endl);
    832832    AtomCount = i;
    833833
     
    845845        Walker->Name = Malloc<char>(6, "molecule::CountAtoms: *walker->Name");
    846846        sprintf(Walker->Name, "%2s%02d", Walker->type->symbol, Walker->nr+1);
    847         Log() << Verbose(3) << "Naming atom nr. " << Walker->nr << " " << Walker->Name << "." << endl;
     847        DoLog(3) && (Log() << Verbose(3) << "Naming atom nr. " << Walker->nr << " " << Walker->Name << "." << endl);
    848848        i++;
    849849      }
    850850    } else
    851       Log() << Verbose(3) << "AtomCount is still " << AtomCount << ", thus counting nothing." << endl;
     851      DoLog(3) && (Log() << Verbose(3) << "AtomCount is still " << AtomCount << ", thus counting nothing." << endl);
    852852  }
    853853};
     
    909909  bool result = true; // status of comparison
    910910
    911   Log() << Verbose(3) << "Begin of IsEqualToWithinThreshold." << endl;
     911  DoLog(3) && (Log() << Verbose(3) << "Begin of IsEqualToWithinThreshold." << endl);
    912912  /// first count both their atoms and elements and update lists thereby ...
    913913  //Log() << Verbose(0) << "Counting atoms, updating list" << endl;
     
    921921  if (result) {
    922922    if (AtomCount != OtherMolecule->AtomCount) {
    923       Log() << Verbose(4) << "AtomCounts don't match: " << AtomCount << " == " << OtherMolecule->AtomCount << endl;
     923      DoLog(4) && (Log() << Verbose(4) << "AtomCounts don't match: " << AtomCount << " == " << OtherMolecule->AtomCount << endl);
    924924      result = false;
    925925    } else Log() << Verbose(4) << "AtomCounts match: " << AtomCount << " == " << OtherMolecule->AtomCount << endl;
     
    928928  if (result) {
    929929    if (ElementCount != OtherMolecule->ElementCount) {
    930       Log() << Verbose(4) << "ElementCount don't match: " << ElementCount << " == " << OtherMolecule->ElementCount << endl;
     930      DoLog(4) && (Log() << Verbose(4) << "ElementCount don't match: " << ElementCount << " == " << OtherMolecule->ElementCount << endl);
    931931      result = false;
    932932    } else Log() << Verbose(4) << "ElementCount match: " << ElementCount << " == " << OtherMolecule->ElementCount << endl;
     
    940940    }
    941941    if (flag < MAX_ELEMENTS) {
    942       Log() << Verbose(4) << "ElementsInMolecule don't match." << endl;
     942      DoLog(4) && (Log() << Verbose(4) << "ElementsInMolecule don't match." << endl);
    943943      result = false;
    944944    } else Log() << Verbose(4) << "ElementsInMolecule match." << endl;
     
    946946  /// then determine and compare center of gravity for each molecule ...
    947947  if (result) {
    948     Log() << Verbose(5) << "Calculating Centers of Gravity" << endl;
     948    DoLog(5) && (Log() << Verbose(5) << "Calculating Centers of Gravity" << endl);
    949949    DeterminePeriodicCenter(CenterOfGravity);
    950950    OtherMolecule->DeterminePeriodicCenter(OtherCenterOfGravity);
    951     Log() << Verbose(5) << "Center of Gravity: ";
     951    DoLog(5) && (Log() << Verbose(5) << "Center of Gravity: ");
    952952    CenterOfGravity.Output();
    953     Log() << Verbose(0) << endl << Verbose(5) << "Other Center of Gravity: ";
     953    DoLog(0) && (Log() << Verbose(0) << endl << Verbose(5) << "Other Center of Gravity: ");
    954954    OtherCenterOfGravity.Output();
    955     Log() << Verbose(0) << endl;
     955    DoLog(0) && (Log() << Verbose(0) << endl);
    956956    if (CenterOfGravity.DistanceSquared(&OtherCenterOfGravity) > threshold*threshold) {
    957       Log() << Verbose(4) << "Centers of gravity don't match." << endl;
     957      DoLog(4) && (Log() << Verbose(4) << "Centers of gravity don't match." << endl);
    958958      result = false;
    959959    }
     
    962962  /// ... then make a list with the euclidian distance to this center for each atom of both molecules
    963963  if (result) {
    964     Log() << Verbose(5) << "Calculating distances" << endl;
     964    DoLog(5) && (Log() << Verbose(5) << "Calculating distances" << endl);
    965965    Distances = Calloc<double>(AtomCount, "molecule::IsEqualToWithinThreshold: Distances");
    966966    OtherDistances = Calloc<double>(AtomCount, "molecule::IsEqualToWithinThreshold: OtherDistances");
     
    969969
    970970    /// ... sort each list (using heapsort (o(N log N)) from GSL)
    971     Log() << Verbose(5) << "Sorting distances" << endl;
     971    DoLog(5) && (Log() << Verbose(5) << "Sorting distances" << endl);
    972972    PermMap = Calloc<size_t>(AtomCount, "molecule::IsEqualToWithinThreshold: *PermMap");
    973973    OtherPermMap = Calloc<size_t>(AtomCount, "molecule::IsEqualToWithinThreshold: *OtherPermMap");
     
    975975    gsl_heapsort_index (OtherPermMap, OtherDistances, AtomCount, sizeof(double), CompareDoubles);
    976976    PermutationMap = Calloc<int>(AtomCount, "molecule::IsEqualToWithinThreshold: *PermutationMap");
    977     Log() << Verbose(5) << "Combining Permutation Maps" << endl;
     977    DoLog(5) && (Log() << Verbose(5) << "Combining Permutation Maps" << endl);
    978978    for(int i=AtomCount;i--;)
    979979      PermutationMap[PermMap[i]] = (int) OtherPermMap[i];
    980980
    981981    /// ... and compare them step by step, whether the difference is individually(!) below \a threshold for all
    982     Log() << Verbose(4) << "Comparing distances" << endl;
     982    DoLog(4) && (Log() << Verbose(4) << "Comparing distances" << endl);
    983983    flag = 0;
    984984    for (int i=0;i<AtomCount;i++) {
    985       Log() << Verbose(5) << "Distances squared: |" << Distances[PermMap[i]] << " - " << OtherDistances[OtherPermMap[i]] << "| = " << fabs(Distances[PermMap[i]] - OtherDistances[OtherPermMap[i]]) << " ?<? " <<  threshold << endl;
     985      DoLog(5) && (Log() << Verbose(5) << "Distances squared: |" << Distances[PermMap[i]] << " - " << OtherDistances[OtherPermMap[i]] << "| = " << fabs(Distances[PermMap[i]] - OtherDistances[OtherPermMap[i]]) << " ?<? " <<  threshold << endl);
    986986      if (fabs(Distances[PermMap[i]] - OtherDistances[OtherPermMap[i]]) > threshold*threshold)
    987987        flag = 1;
     
    999999  }
    10001000  /// return pointer to map if all distances were below \a threshold
    1001   Log() << Verbose(3) << "End of IsEqualToWithinThreshold." << endl;
     1001  DoLog(3) && (Log() << Verbose(3) << "End of IsEqualToWithinThreshold." << endl);
    10021002  if (result) {
    1003     Log() << Verbose(3) << "Result: Equal." << endl;
     1003    DoLog(3) && (Log() << Verbose(3) << "Result: Equal." << endl);
    10041004    return PermutationMap;
    10051005  } else {
    1006     Log() << Verbose(3) << "Result: Not equal." << endl;
     1006    DoLog(3) && (Log() << Verbose(3) << "Result: Not equal." << endl);
    10071007    return NULL;
    10081008  }
     
    10191019{
    10201020  atom *Walker = NULL, *OtherWalker = NULL;
    1021   Log() << Verbose(3) << "Begin of GetFatherAtomicMap." << endl;
     1021  DoLog(3) && (Log() << Verbose(3) << "Begin of GetFatherAtomicMap." << endl);
    10221022  int *AtomicMap = Malloc<int>(AtomCount, "molecule::GetAtomicMap: *AtomicMap");
    10231023  for (int i=AtomCount;i--;)
     
    10261026    for (int i=AtomCount;i--;) // no need as -1 means already that there is trivial correspondence
    10271027      AtomicMap[i] = i;
    1028     Log() << Verbose(4) << "Map is trivial." << endl;
     1028    DoLog(4) && (Log() << Verbose(4) << "Map is trivial." << endl);
    10291029  } else {
    1030     Log() << Verbose(4) << "Map is ";
     1030    DoLog(4) && (Log() << Verbose(4) << "Map is ");
    10311031    Walker = start;
    10321032    while (Walker->next != end) {
     
    10451045        }
    10461046      }
    1047       Log() << Verbose(0) << AtomicMap[Walker->nr] << "\t";
    1048     }
    1049     Log() << Verbose(0) << endl;
    1050   }
    1051   Log() << Verbose(3) << "End of GetFatherAtomicMap." << endl;
     1047      DoLog(0) && (Log() << Verbose(0) << AtomicMap[Walker->nr] << "\t");
     1048    }
     1049    DoLog(0) && (Log() << Verbose(0) << endl);
     1050  }
     1051  DoLog(3) && (Log() << Verbose(3) << "End of GetFatherAtomicMap." << endl);
    10521052  return AtomicMap;
    10531053};
  • src/molecule_dynamics.cpp

    r6613ec ra67d19  
    207207    doubles++;
    208208  if (doubles >0)
    209     Log() << Verbose(2) << "Found " << doubles << " Doubles." << endl;
     209    DoLog(2) && (Log() << Verbose(2) << "Found " << doubles << " Doubles." << endl);
    210210  Free(&DoubleList);
    211211//  Log() << Verbose(2) << zeile1.str() << endl << zeile2.str() << endl;
     
    249249    Params.DoubleList[Params.DistanceList[Walker->nr]->begin()->second->nr]++;            // increase this target's source count (>1? not injective)
    250250    Params.DistanceIterators[Walker->nr] = Params.DistanceList[Walker->nr]->begin();    // and remember which one we picked
    251     Log() << Verbose(2) << *Walker << " starts with distance " << Params.DistanceList[Walker->nr]->begin()->first << "." << endl;
     251    DoLog(2) && (Log() << Verbose(2) << *Walker << " starts with distance " << Params.DistanceList[Walker->nr]->begin()->first << "." << endl);
    252252  }
    253253};
     
    277277      Params.DistanceIterators[Walker->nr] = NewBase;
    278278      OldPotential = Potential;
    279       Log() << Verbose(3) << "Found a new permutation, new potential is " << OldPotential << "." << endl;
     279      DoLog(3) && (Log() << Verbose(3) << "Found a new permutation, new potential is " << OldPotential << "." << endl);
    280280    }
    281281  }
     
    309309      performCriticalExit();
    310310    }
    311   Log() << Verbose(1) << "done." << endl;
     311  DoLog(1) && (Log() << Verbose(1) << "done." << endl);
    312312};
    313313
     
    358358  Params.PenaltyConstants[2] = 1e+7;    // just a huge penalty
    359359  // generate the distance list
    360   Log() << Verbose(1) << "Allocating, initializting and filling the distance list ... " << endl;
     360  DoLog(1) && (Log() << Verbose(1) << "Allocating, initializting and filling the distance list ... " << endl);
    361361  FillDistanceList(this, Params);
    362362
     
    365365
    366366  // make the PermutationMap injective by checking whether we have a non-zero constants[2] term in it
    367   Log() << Verbose(1) << "Making the PermutationMap injective ... " << endl;
     367  DoLog(1) && (Log() << Verbose(1) << "Making the PermutationMap injective ... " << endl);
    368368  MakeInjectivePermutation(this, Params);
    369369  Free(&Params.DoubleList);
    370370
    371371  // argument minimise the constrained potential in this injective PermutationMap
    372   Log() << Verbose(1) << "Argument minimising the PermutationMap." << endl;
     372  DoLog(1) && (Log() << Verbose(1) << "Argument minimising the PermutationMap." << endl);
    373373  OldPotential = 1e+10;
    374374  round = 0;
    375375  do {
    376     Log() << Verbose(2) << "Starting round " << ++round << ", at current potential " << OldPotential << " ... " << endl;
     376    DoLog(2) && (Log() << Verbose(2) << "Starting round " << ++round << ", at current potential " << OldPotential << " ... " << endl);
    377377    OlderPotential = OldPotential;
    378378    do {
     
    424424            } else {
    425425              Params.DistanceIterators[Runner->nr] = Rider;  // if successful also move the pointer in the iterator list
    426               Log() << Verbose(3) << "Found a better permutation, new potential is " << Potential << " vs." << OldPotential << "." << endl;
     426              DoLog(3) && (Log() << Verbose(3) << "Found a better permutation, new potential is " << Potential << " vs." << OldPotential << "." << endl);
    427427              OldPotential = Potential;
    428428            }
     
    443443    } while (Walker->next != end);
    444444  } while ((OlderPotential - OldPotential) > 1e-3);
    445   Log() << Verbose(1) << "done." << endl;
     445  DoLog(1) && (Log() << Verbose(1) << "done." << endl);
    446446
    447447
     
    466466{
    467467  /// evaluate forces (only the distance to target dependent part) with the final PermutationMap
    468   Log() << Verbose(1) << "Calculating forces and adding onto ForceMatrix ... " << endl;
     468  DoLog(1) && (Log() << Verbose(1) << "Calculating forces and adding onto ForceMatrix ... " << endl);
    469469  ActOnAllAtoms( &atom::EvaluateConstrainedForce, startstep, endstep, PermutationMap, Force );
    470   Log() << Verbose(1) << "done." << endl;
     470  DoLog(1) && (Log() << Verbose(1) << "done." << endl);
    471471};
    472472
     
    503503
    504504  // go through all steps and add the molecular configuration to the list and to the Trajectories of \a this molecule
    505   Log() << Verbose(1) << "Filling intermediate " << MaxSteps << " steps with MDSteps of " << MDSteps << "." << endl;
     505  DoLog(1) && (Log() << Verbose(1) << "Filling intermediate " << MaxSteps << " steps with MDSteps of " << MDSteps << "." << endl);
    506506  for (int step = 0; step <= MaxSteps; step++) {
    507507    mol = new molecule(elemente);
     
    652652  switch(Thermostat) {
    653653     case None:
    654       Log() << Verbose(2) <<  "Applying no thermostat..." << endl;
     654      DoLog(2) && (Log() << Verbose(2) <<  "Applying no thermostat..." << endl);
    655655      break;
    656656     case Woodcock:
    657657      if ((configuration.ScaleTempStep > 0) && ((MDSteps-1) % configuration.ScaleTempStep == 0)) {
    658         Log() << Verbose(2) <<  "Applying Woodcock thermostat..." << endl;
     658        DoLog(2) && (Log() << Verbose(2) <<  "Applying Woodcock thermostat..." << endl);
    659659        ActOnAllAtoms( &atom::Thermostat_Woodcock, sqrt(ScaleTempFactor), MDSteps, &ekin );
    660660      }
    661661      break;
    662662     case Gaussian:
    663       Log() << Verbose(2) <<  "Applying Gaussian thermostat..." << endl;
     663      DoLog(2) && (Log() << Verbose(2) <<  "Applying Gaussian thermostat..." << endl);
    664664      ActOnAllAtoms( &atom::Thermostat_Gaussian_init, MDSteps, &G, &E );
    665665
    666       Log() << Verbose(1) << "Gaussian Least Constraint constant is " << G/E << "." << endl;
     666      DoLog(1) && (Log() << Verbose(1) << "Gaussian Least Constraint constant is " << G/E << "." << endl);
    667667      ActOnAllAtoms( &atom::Thermostat_Gaussian_least_constraint, MDSteps, G/E, &ekin, &configuration);
    668668
    669669      break;
    670670     case Langevin:
    671       Log() << Verbose(2) <<  "Applying Langevin thermostat..." << endl;
     671      DoLog(2) && (Log() << Verbose(2) <<  "Applying Langevin thermostat..." << endl);
    672672      // init random number generator
    673673      gsl_rng_env_setup();
     
    679679
    680680     case Berendsen:
    681       Log() << Verbose(2) <<  "Applying Berendsen-VanGunsteren thermostat..." << endl;
     681      DoLog(2) && (Log() << Verbose(2) <<  "Applying Berendsen-VanGunsteren thermostat..." << endl);
    682682      ActOnAllAtoms( &atom::Thermostat_Berendsen, MDSteps, ScaleTempFactor, &ekin, &configuration );
    683683      break;
    684684
    685685     case NoseHoover:
    686       Log() << Verbose(2) <<  "Applying Nose-Hoover thermostat..." << endl;
     686      DoLog(2) && (Log() << Verbose(2) <<  "Applying Nose-Hoover thermostat..." << endl);
    687687      // dynamically evolve alpha (the additional degree of freedom)
    688688      delta_alpha = 0.;
     
    690690      delta_alpha = (delta_alpha - (3.*AtomCount+1.) * configuration.TargetTemp)/(configuration.HooverMass*Units2Electronmass);
    691691      configuration.alpha += delta_alpha*configuration.Deltat;
    692       Log() << Verbose(3) << "alpha = " << delta_alpha << " * " << configuration.Deltat << " = " << configuration.alpha << "." << endl;
     692      DoLog(3) && (Log() << Verbose(3) << "alpha = " << delta_alpha << " * " << configuration.Deltat << " = " << configuration.alpha << "." << endl);
    693693      // apply updated alpha as additional force
    694694      ActOnAllAtoms( &atom::Thermostat_NoseHoover_scale, MDSteps, &ekin, &configuration );
    695695      break;
    696696  }
    697   Log() << Verbose(1) << "Kinetic energy is " << ekin << "." << endl;
    698 };
     697  DoLog(1) && (Log() << Verbose(1) << "Kinetic energy is " << ekin << "." << endl);
     698};
  • src/molecule_fragmentation.cpp

    r6613ec ra67d19  
    4444  }
    4545  FragmentCount = NoNonHydrogen*(1 << (c*order));
    46   Log() << Verbose(1) << "Upper limit for this subgraph is " << FragmentCount << " for " << NoNonHydrogen << " non-H atoms with maximum bond degree of " << c << "." << endl;
     46  DoLog(1) && (Log() << Verbose(1) << "Upper limit for this subgraph is " << FragmentCount << " for " << NoNonHydrogen << " non-H atoms with maximum bond degree of " << c << "." << endl);
    4747  return FragmentCount;
    4848};
     
    6868    } // else it's "-1" or else and thus must not be added
    6969  }
    70   Log() << Verbose(1) << "The scanned KeySet is ";
     70  DoLog(1) && (Log() << Verbose(1) << "The scanned KeySet is ");
    7171  for(KeySet::iterator runner = CurrentSet.begin(); runner != CurrentSet.end(); runner++) {
    72     Log() << Verbose(0) << (*runner) << "\t";
    73   }
    74   Log() << Verbose(0) << endl;
     72    DoLog(0) && (Log() << Verbose(0) << (*runner) << "\t");
     73  }
     74  DoLog(0) && (Log() << Verbose(0) << endl);
    7575  return (status != 0);
    7676};
     
    100100
    101101  // 1st pass: open file and read
    102   Log() << Verbose(1) << "Parsing the KeySet file ... " << endl;
     102  DoLog(1) && (Log() << Verbose(1) << "Parsing the KeySet file ... " << endl);
    103103  sprintf(filename, "%s/%s%s", path, FRAGMENTPREFIX, KEYSETFILE);
    104104  InputFile.open(filename);
     
    122122    InputFile.clear();
    123123    Free(&buffer);
    124     Log() << Verbose(1) << "done." << endl;
     124    DoLog(1) && (Log() << Verbose(1) << "done." << endl);
    125125  } else {
    126     Log() << Verbose(1) << "File " << filename << " not found." << endl;
     126    DoLog(1) && (Log() << Verbose(1) << "File " << filename << " not found." << endl);
    127127    status = false;
    128128  }
     
    154154
    155155  // 2nd pass: open TEFactors file and read
    156   Log() << Verbose(1) << "Parsing the TEFactors file ... " << endl;
     156  DoLog(1) && (Log() << Verbose(1) << "Parsing the TEFactors file ... " << endl);
    157157  sprintf(filename, "%s/%s%s", path, FRAGMENTPREFIX, TEFACTORSFILE);
    158158  InputFile.open(filename);
     
    164164        InputFile >> TEFactor;
    165165        (*runner).second.second = TEFactor;
    166         Log() << Verbose(2) << "Setting " << ++NumberOfFragments << " fragment's TEFactor to " << (*runner).second.second << "." << endl;
     166        DoLog(2) && (Log() << Verbose(2) << "Setting " << ++NumberOfFragments << " fragment's TEFactor to " << (*runner).second.second << "." << endl);
    167167      } else {
    168168        status = false;
     
    172172    // 4. Free and done
    173173    InputFile.close();
    174     Log() << Verbose(1) << "done." << endl;
     174    DoLog(1) && (Log() << Verbose(1) << "done." << endl);
    175175  } else {
    176     Log() << Verbose(1) << "File " << filename << " not found." << endl;
     176    DoLog(1) && (Log() << Verbose(1) << "File " << filename << " not found." << endl);
    177177    status = false;
    178178  }
     
    202202  line += KEYSETFILE;
    203203  output.open(line.c_str(), ios::out);
    204   Log() << Verbose(1) << "Saving key sets of the total graph ... ";
     204  DoLog(1) && (Log() << Verbose(1) << "Saving key sets of the total graph ... ");
    205205  if(output != NULL) {
    206206    for(Graph::iterator runner = KeySetList.begin(); runner != KeySetList.end(); runner++) {
     
    212212      output << endl;
    213213    }
    214     Log() << Verbose(0) << "done." << endl;
     214    DoLog(0) && (Log() << Verbose(0) << "done." << endl);
    215215  } else {
    216216    DoeLog(0) && (eLog()<< Verbose(0) << "Unable to open " << line << " for writing keysets!" << endl);
     
    243243  line += TEFACTORSFILE;
    244244  output.open(line.c_str(), ios::out);
    245   Log() << Verbose(1) << "Saving TEFactors of the total graph ... ";
     245  DoLog(1) && (Log() << Verbose(1) << "Saving TEFactors of the total graph ... ");
    246246  if(output != NULL) {
    247247    for(Graph::iterator runner = KeySetList.begin(); runner != KeySetList.end(); runner++)
    248248      output << (*runner).second.second << endl;
    249     Log() << Verbose(1) << "done." << endl;
     249    DoLog(1) && (Log() << Verbose(1) << "done." << endl);
    250250  } else {
    251     Log() << Verbose(1) << "failed to open " << line << "." << endl;
     251    DoLog(1) && (Log() << Verbose(1) << "failed to open " << line << "." << endl);
    252252    status = false;
    253253  }
     
    293293        (*PresentItem).second.first = fabs(Value);
    294294        (*PresentItem).second.second = FragOrder;
    295         Log() << Verbose(2) << "Updated element (" <<  (*PresentItem).first << ",[" << (*PresentItem).second.first << "," << (*PresentItem).second.second << "])." << endl;
     295        DoLog(2) && (Log() << Verbose(2) << "Updated element (" <<  (*PresentItem).first << ",[" << (*PresentItem).second.first << "," << (*PresentItem).second.second << "])." << endl);
    296296      } else {
    297         Log() << Verbose(2) << "Did not update element " <<  (*PresentItem).first << " as " << FragOrder << " is less than or equal to " << (*PresentItem).second.second << "." << endl;
     297        DoLog(2) && (Log() << Verbose(2) << "Did not update element " <<  (*PresentItem).first << " as " << FragOrder << " is less than or equal to " << (*PresentItem).second.second << "." << endl);
    298298      }
    299299    } else {
    300       Log() << Verbose(2) << "Inserted element (" <<  (*PresentItem).first << ",[" << (*PresentItem).second.first << "," << (*PresentItem).second.second << "])." << endl;
     300      DoLog(2) && (Log() << Verbose(2) << "Inserted element (" <<  (*PresentItem).first << ",[" << (*PresentItem).second.first << "," << (*PresentItem).second.second << "])." << endl);
    301301    }
    302302  } else {
    303     Log() << Verbose(1) << "No Fragment under No. " << No << "found." << endl;
     303    DoLog(1) && (Log() << Verbose(1) << "No Fragment under No. " << No << "found." << endl);
    304304  }
    305305};
     
    360360  atom *Walker = mol->start;
    361361  map<double, pair<int,int> > *FinalRootCandidates = new map<double, pair<int,int> > ;
    362   Log() << Verbose(1) << "Root candidate list is: " << endl;
     362  DoLog(1) && (Log() << Verbose(1) << "Root candidate list is: " << endl);
    363363  for(map<int, pair<double,int> >::iterator runner = AdaptiveCriteriaList->begin(); runner != AdaptiveCriteriaList->end(); runner++) {
    364364    Walker = mol->FindAtom((*runner).first);
     
    366366      //if ((*runner).second.second >= Walker->AdaptiveOrder) { // only insert if this is an "active" root site for the current order
    367367      if (!Walker->MaxOrder) {
    368         Log() << Verbose(2) << "(" << (*runner).first << ",[" << (*runner).second.first << "," << (*runner).second.second << "])" << endl;
     368        DoLog(2) && (Log() << Verbose(2) << "(" << (*runner).first << ",[" << (*runner).second.first << "," << (*runner).second.second << "])" << endl);
    369369        FinalRootCandidates->insert( make_pair( (*runner).second.first, pair<int,int>((*runner).first, (*runner).second.second) ) );
    370370      } else {
    371         Log() << Verbose(2) << "Excluding (" << *Walker << ", " << (*runner).first << ",[" << (*runner).second.first << "," << (*runner).second.second << "]), as it has reached its maximum order." << endl;
     371        DoLog(2) && (Log() << Verbose(2) << "Excluding (" << *Walker << ", " << (*runner).first << ",[" << (*runner).second.first << "," << (*runner).second.second << "]), as it has reached its maximum order." << endl);
    372372      }
    373373    } else {
     
    397397    Walker = mol->FindAtom(No);
    398398    //if (Walker->AdaptiveOrder < MinimumRingSize[Walker->nr]) {
    399       Log() << Verbose(2) << "Root " << No << " is still above threshold (10^{" << Order <<"}: " << runner->first << ", setting entry " << No << " of Atom mask to true." << endl;
     399      DoLog(2) && (Log() << Verbose(2) << "Root " << No << " is still above threshold (10^{" << Order <<"}: " << runner->first << ", setting entry " << No << " of Atom mask to true." << endl);
    400400      AtomMask[No] = true;
    401401      status = true;
     
    413413void PrintAtomMask(bool *AtomMask, int AtomCount)
    414414{
    415   Log() << Verbose(2) << "              ";
     415  DoLog(2) && (Log() << Verbose(2) << "              ");
    416416  for(int i=0;i<AtomCount;i++)
    417     Log() << Verbose(0) << (i % 10);
    418   Log() << Verbose(0) << endl;
    419   Log() << Verbose(2) << "Atom mask is: ";
     417    DoLog(0) && (Log() << Verbose(0) << (i % 10));
     418  DoLog(0) && (Log() << Verbose(0) << endl);
     419  DoLog(2) && (Log() << Verbose(2) << "Atom mask is: ");
    420420  for(int i=0;i<AtomCount;i++)
    421     Log() << Verbose(0) << (AtomMask[i] ? "t" : "f");
    422   Log() << Verbose(0) << endl;
     421    DoLog(0) && (Log() << Verbose(0) << (AtomMask[i] ? "t" : "f"));
     422  DoLog(0) && (Log() << Verbose(0) << endl);
    423423};
    424424
     
    493493    if (!status) {
    494494      if (Order == 0)
    495         Log() << Verbose(1) << "Single stepping done." << endl;
     495        DoLog(1) && (Log() << Verbose(1) << "Single stepping done." << endl);
    496496      else
    497         Log() << Verbose(1) << "Order at every site is already equal or above desired order " << Order << "." << endl;
     497        DoLog(1) && (Log() << Verbose(1) << "Order at every site is already equal or above desired order " << Order << "." << endl);
    498498    }
    499499  }
     
    512512{
    513513  if (SortIndex != NULL) {
    514     Log() << Verbose(1) << "SortIndex is " << SortIndex << " and not NULL as expected." << endl;
     514    DoLog(1) && (Log() << Verbose(1) << "SortIndex is " << SortIndex << " and not NULL as expected." << endl);
    515515    return false;
    516516  }
     
    563563  bool *AtomMask = NULL;
    564564
    565   Log() << Verbose(0) << endl;
     565  DoLog(0) && (Log() << Verbose(0) << endl);
    566566#ifdef ADDHYDROGEN
    567   Log() << Verbose(0) << "I will treat hydrogen special and saturate dangling bonds with it." << endl;
     567  DoLog(0) && (Log() << Verbose(0) << "I will treat hydrogen special and saturate dangling bonds with it." << endl);
    568568#else
    569   Log() << Verbose(0) << "Hydrogen is treated just like the rest of the lot." << endl;
     569  DoLog(0) && (Log() << Verbose(0) << "Hydrogen is treated just like the rest of the lot." << endl);
    570570#endif
    571571
     
    593593    // fill the bond structure of the individually stored subgraphs
    594594  MolecularWalker->FillBondStructureFromReference(this, FragmentCounter, ListOfLocalAtoms, false);  // we want to keep the created ListOfLocalAtoms
    595     Log() << Verbose(0) << "Analysing the cycles of subgraph " << MolecularWalker->Leaf << " with nr. " << FragmentCounter << "." << endl;
     595    DoLog(0) && (Log() << Verbose(0) << "Analysing the cycles of subgraph " << MolecularWalker->Leaf << " with nr. " << FragmentCounter << "." << endl);
    596596    LocalBackEdgeStack = new StackClass<bond *> (MolecularWalker->Leaf->BondCount);
    597597//    // check the list of local atoms for debugging
     
    602602//      else
    603603//        Log() << Verbose(0) << "\t" << ListOfLocalAtoms[FragmentCounter][i]->Name;
    604     Log() << Verbose(0) << "Gathering local back edges for subgraph " << MolecularWalker->Leaf << " with nr. " << FragmentCounter << "." << endl;
     604    DoLog(0) && (Log() << Verbose(0) << "Gathering local back edges for subgraph " << MolecularWalker->Leaf << " with nr. " << FragmentCounter << "." << endl);
    605605    MolecularWalker->Leaf->PickLocalBackEdges(ListOfLocalAtoms[FragmentCounter++], BackEdgeStack, LocalBackEdgeStack);
    606     Log() << Verbose(0) << "Analysing the cycles of subgraph " << MolecularWalker->Leaf << " with nr. " << FragmentCounter << "." << endl;
     606    DoLog(0) && (Log() << Verbose(0) << "Analysing the cycles of subgraph " << MolecularWalker->Leaf << " with nr. " << FragmentCounter << "." << endl);
    607607    MolecularWalker->Leaf->CyclicStructureAnalysis(LocalBackEdgeStack, MinimumRingSize);
    608     Log() << Verbose(0) << "Done with Analysing the cycles of subgraph " << MolecularWalker->Leaf << " with nr. " << FragmentCounter << "." << endl;
     608    DoLog(0) && (Log() << Verbose(0) << "Done with Analysing the cycles of subgraph " << MolecularWalker->Leaf << " with nr. " << FragmentCounter << "." << endl);
    609609    delete(LocalBackEdgeStack);
    610610  }
     
    637637    while (MolecularWalker->next != NULL) {
    638638      MolecularWalker = MolecularWalker->next;
    639       Log() << Verbose(1) << "Fragmenting subgraph " << MolecularWalker << "." << endl;
     639      DoLog(1) && (Log() << Verbose(1) << "Fragmenting subgraph " << MolecularWalker << "." << endl);
    640640      //MolecularWalker->Leaf->OutputListOfBonds(out);  // output atom::ListOfBonds for debugging
    641641      if (MolecularWalker->Leaf->first->next != MolecularWalker->Leaf->last) {
    642642        // call BOSSANOVA method
    643         Log() << Verbose(0) << endl << " ========== BOND ENERGY of subgraph " << FragmentCounter << " ========================= " << endl;
     643        DoLog(0) && (Log() << Verbose(0) << endl << " ========== BOND ENERGY of subgraph " << FragmentCounter << " ========================= " << endl);
    644644        MolecularWalker->Leaf->FragmentBOSSANOVA(FragmentList[FragmentCounter], RootStack[FragmentCounter], MinimumRingSize);
    645645      } else {
     
    649649    }
    650650  }
    651   Log() << Verbose(2) << "CheckOrder is " << CheckOrder << "." << endl;
     651  DoLog(2) && (Log() << Verbose(2) << "CheckOrder is " << CheckOrder << "." << endl);
    652652  delete[](RootStack);
    653653  delete[](AtomMask);
     
    680680  for(Graph::iterator runner = TotalGraph.begin(); runner != TotalGraph.end(); runner++) {
    681681    KeySet test = (*runner).first;
    682     Log() << Verbose(0) << "Fragment No." << (*runner).second.first << " with TEFactor " << (*runner).second.second << "." << endl;
     682    DoLog(0) && (Log() << Verbose(0) << "Fragment No." << (*runner).second.first << " with TEFactor " << (*runner).second.second << "." << endl);
    683683    BondFragments->insert(StoreFragmentFromKeySet(test, configuration));
    684684    k++;
    685685  }
    686   Log() << Verbose(0) << k << "/" << BondFragments->ListOfMolecules.size() << " fragments generated from the keysets." << endl;
     686  DoLog(0) && (Log() << Verbose(0) << k << "/" << BondFragments->ListOfMolecules.size() << " fragments generated from the keysets." << endl);
    687687
    688688  // ===== 9. Save fragments' configuration and keyset files et al to disk ===
     
    691691    CreateMappingLabelsToConfigSequence(SortIndex);
    692692
    693     Log() << Verbose(1) << "Writing " << BondFragments->ListOfMolecules.size() << " possible bond fragmentation configs" << endl;
     693    DoLog(1) && (Log() << Verbose(1) << "Writing " << BondFragments->ListOfMolecules.size() << " possible bond fragmentation configs" << endl);
    694694    if (BondFragments->OutputConfigForListOfFragments(configuration, SortIndex))
    695       Log() << Verbose(1) << "All configs written." << endl;
     695      DoLog(1) && (Log() << Verbose(1) << "All configs written." << endl);
    696696    else
    697       Log() << Verbose(1) << "Some config writing failed." << endl;
     697      DoLog(1) && (Log() << Verbose(1) << "Some config writing failed." << endl);
    698698
    699699    // store force index reference file
     
    720720
    721721    // free memory for bond part
    722     Log() << Verbose(1) << "Freeing bond memory" << endl;
     722    DoLog(1) && (Log() << Verbose(1) << "Freeing bond memory" << endl);
    723723    delete(FragmentList); // remove bond molecule from memory
    724724    Free(&SortIndex);
    725725  } else {
    726     Log() << Verbose(1) << "FragmentList is zero on return, splitting failed." << endl;
     726    DoLog(1) && (Log() << Verbose(1) << "FragmentList is zero on return, splitting failed." << endl);
    727727  }
    728728  delete(BondFragments);
    729   Log() << Verbose(0) << "End of bond fragmentation." << endl;
     729  DoLog(0) && (Log() << Verbose(0) << "End of bond fragmentation." << endl);
    730730
    731731  return ((int)(!FragmentationToDo)+1);    // 1 - continue, 2 - stop (no fragmentation occured)
     
    746746  line << path << "/" << FRAGMENTPREFIX << ORDERATSITEFILE;
    747747  file.open(line.str().c_str());
    748   Log() << Verbose(1) << "Writing OrderAtSite " << ORDERATSITEFILE << " ... " << endl;
     748  DoLog(1) && (Log() << Verbose(1) << "Writing OrderAtSite " << ORDERATSITEFILE << " ... " << endl);
    749749  if (file != NULL) {
    750750    ActOnAllAtoms( &atom::OutputOrder, &file );
    751751    file.close();
    752     Log() << Verbose(1) << "done." << endl;
     752    DoLog(1) && (Log() << Verbose(1) << "done." << endl);
    753753    return true;
    754754  } else {
    755     Log() << Verbose(1) << "failed to open file " << line.str() << "." << endl;
     755    DoLog(1) && (Log() << Verbose(1) << "failed to open file " << line.str() << "." << endl);
    756756    return false;
    757757  }
     
    774774  ifstream file;
    775775
    776   Log() << Verbose(1) << "Begin of ParseOrderAtSiteFromFile" << endl;
     776  DoLog(1) && (Log() << Verbose(1) << "Begin of ParseOrderAtSiteFromFile" << endl);
    777777  line << path << "/" << FRAGMENTPREFIX << ORDERATSITEFILE;
    778778  file.open(line.str().c_str());
     
    795795    SetAtomValueToIndexedArray( MaxArray, &atom::nr, &atom::MaxOrder );
    796796
    797     Log() << Verbose(1) << "done." << endl;
     797    DoLog(1) && (Log() << Verbose(1) << "done." << endl);
    798798    status = true;
    799799  } else {
    800     Log() << Verbose(1) << "failed to open file " << line.str() << "." << endl;
     800    DoLog(1) && (Log() << Verbose(1) << "failed to open file " << line.str() << "." << endl);
    801801    status = false;
    802802  }
     
    804804  Free(&MaxArray);
    805805
    806   Log() << Verbose(1) << "End of ParseOrderAtSiteFromFile" << endl;
     806  DoLog(1) && (Log() << Verbose(1) << "End of ParseOrderAtSiteFromFile" << endl);
    807807  return status;
    808808};
     
    821821  int SP, Removal;
    822822
    823   Log() << Verbose(2) << "Looking for removal candidate." << endl;
     823  DoLog(2) && (Log() << Verbose(2) << "Looking for removal candidate." << endl);
    824824  SP = -1; //0;  // not -1, so that Root is never removed
    825825  Removal = -1;
     
    909909    }
    910910    if ((LonelyFlag) && (Leaf->AtomCount > 1)) {
    911       Log() << Verbose(0) << *Runner << "has got bonds only to hydrogens!" << endl;
     911      DoLog(0) && (Log() << Verbose(0) << *Runner << "has got bonds only to hydrogens!" << endl);
    912912    }
    913913#ifdef ADDHYDROGEN
     
    10561056    TouchedList[j] = -1;
    10571057  }
    1058   Log() << Verbose(2) << "Remaining local nr.s on snake stack are: ";
     1058  DoLog(2) && (Log() << Verbose(2) << "Remaining local nr.s on snake stack are: ");
    10591059  for(KeySet::iterator runner = FragmentSet->begin(); runner != FragmentSet->end(); runner++)
    1060     Log() << Verbose(0) << (*runner) << " ";
    1061   Log() << Verbose(0) << endl;
     1060    DoLog(0) && (Log() << Verbose(0) << (*runner) << " ");
     1061  DoLog(0) && (Log() << Verbose(0) << endl);
    10621062  TouchedIndex = 0; // set Index to 0 for list of atoms added on this level
    10631063};
     
    11361136        Log() << Verbose(1+verbosity) << "Enough items on stack for a fragment!" << endl;
    11371137        // store fragment as a KeySet
    1138         Log() << Verbose(2) << "Found a new fragment[" << FragmentSearch->FragmentCounter << "], local nr.s are: ";
     1138        DoLog(2) && (Log() << Verbose(2) << "Found a new fragment[" << FragmentSearch->FragmentCounter << "], local nr.s are: ");
    11391139        for(KeySet::iterator runner = FragmentSearch->FragmentSet->begin(); runner != FragmentSearch->FragmentSet->end(); runner++)
    1140           Log() << Verbose(0) << (*runner) << " ";
    1141         Log() << Verbose(0) << endl;
     1140          DoLog(0) && (Log() << Verbose(0) << (*runner) << " ");
     1141        DoLog(0) && (Log() << Verbose(0) << endl);
    11421142        //if (!CheckForConnectedSubgraph(FragmentSearch->FragmentSet))
    11431143          //DoeLog(1) && (eLog()<< Verbose(1) << "The found fragment is not a connected subgraph!" << endl);
     
    12211221{
    12221222  bond *Binder = NULL;
    1223   Log() << Verbose(0) << "Free'ing all found lists. and resetting index lists" << endl;
     1223  DoLog(0) && (Log() << Verbose(0) << "Free'ing all found lists. and resetting index lists" << endl);
    12241224  for(int i=Order;i--;) {
    1225     Log() << Verbose(1) << "Current SP level is " << i << ": ";
     1225    DoLog(1) && (Log() << Verbose(1) << "Current SP level is " << i << ": ");
    12261226    Binder = FragmentSearch.BondsPerSPList[2*i];
    12271227    while (Binder->next != FragmentSearch.BondsPerSPList[2*i+1]) {
     
    12341234    cleanup(FragmentSearch.BondsPerSPList[2*i], FragmentSearch.BondsPerSPList[2*i+1]);
    12351235    // also start and end node
    1236     Log() << Verbose(0) << "cleaned." << endl;
     1236    DoLog(0) && (Log() << Verbose(0) << "cleaned." << endl);
    12371237  }
    12381238};
     
    12641264  int SP = -1;
    12651265
    1266   Log() << Verbose(0) << "Starting BFS analysis ..." << endl;
     1266  DoLog(0) && (Log() << Verbose(0) << "Starting BFS analysis ..." << endl);
    12671267  for (SP = 0; SP < (Order-1); SP++) {
    1268     Log() << Verbose(1) << "New SP level reached: " << SP << ", creating new SP list with " << FragmentSearch.BondsPerSPCount[SP] << " item(s)";
     1268    DoLog(1) && (Log() << Verbose(1) << "New SP level reached: " << SP << ", creating new SP list with " << FragmentSearch.BondsPerSPCount[SP] << " item(s)");
    12691269    if (SP > 0) {
    1270       Log() << Verbose(0) << ", old level closed with " << FragmentSearch.BondsPerSPCount[SP-1] << " item(s)." << endl;
     1270      DoLog(0) && (Log() << Verbose(0) << ", old level closed with " << FragmentSearch.BondsPerSPCount[SP-1] << " item(s)." << endl);
    12711271      FragmentSearch.BondsPerSPCount[SP] = 0;
    12721272    } else
    1273       Log() << Verbose(0) << "." << endl;
     1273      DoLog(0) && (Log() << Verbose(0) << "." << endl);
    12741274
    12751275    RemainingWalkers = FragmentSearch.BondsPerSPCount[SP];
     
    12811281      Predecessor = CurrentEdge->leftatom;    // ... and leftatom is predecessor
    12821282      AtomKeyNr = Walker->nr;
    1283       Log() << Verbose(0) << "Current Walker is: " << *Walker << " with nr " << Walker->nr << " and SP of " << SP << ", with " << RemainingWalkers << " remaining walkers on this level." << endl;
     1283      DoLog(0) && (Log() << Verbose(0) << "Current Walker is: " << *Walker << " with nr " << Walker->nr << " and SP of " << SP << ", with " << RemainingWalkers << " remaining walkers on this level." << endl);
    12841284      // check for new sp level
    12851285      // go through all its bonds
    1286       Log() << Verbose(1) << "Going through all bonds of Walker." << endl;
     1286      DoLog(1) && (Log() << Verbose(1) << "Going through all bonds of Walker." << endl);
    12871287      for (BondList::const_iterator Runner = Walker->ListOfBonds.begin(); Runner != Walker->ListOfBonds.end(); (++Runner)) {
    12881288        OtherWalker = (*Runner)->GetOtherAtom(Walker);
     
    12921292  #endif
    12931293                                                              ) {  // skip hydrogens and restrict to fragment
    1294           Log() << Verbose(2) << "Current partner is " << *OtherWalker << " with nr " << OtherWalker->nr << " in bond " << *(*Runner) << "." << endl;
     1294          DoLog(2) && (Log() << Verbose(2) << "Current partner is " << *OtherWalker << " with nr " << OtherWalker->nr << " in bond " << *(*Runner) << "." << endl);
    12951295          // set the label if not set (and push on root stack as well)
    12961296          if ((OtherWalker != Predecessor) && (OtherWalker->GetTrueFather()->nr > RootKeyNr)) { // only pass through those with label bigger than Root's
    12971297            FragmentSearch.ShortestPathList[OtherWalker->nr] = SP+1;
    1298             Log() << Verbose(3) << "Set Shortest Path to " << FragmentSearch.ShortestPathList[OtherWalker->nr] << "." << endl;
     1298            DoLog(3) && (Log() << Verbose(3) << "Set Shortest Path to " << FragmentSearch.ShortestPathList[OtherWalker->nr] << "." << endl);
    12991299            // add the bond in between to the SP list
    13001300            Binder = new bond(Walker, OtherWalker); // create a new bond in such a manner, that bond::rightatom is always the one more distant
    13011301            add(Binder, FragmentSearch.BondsPerSPList[2*(SP+1)+1]);
    13021302            FragmentSearch.BondsPerSPCount[SP+1]++;
    1303             Log() << Verbose(3) << "Added its bond to SP list, having now " << FragmentSearch.BondsPerSPCount[SP+1] << " item(s)." << endl;
     1303            DoLog(3) && (Log() << Verbose(3) << "Added its bond to SP list, having now " << FragmentSearch.BondsPerSPCount[SP+1] << " item(s)." << endl);
    13041304          } else {
    13051305            if (OtherWalker != Predecessor)
    1306               Log() << Verbose(3) << "Not passing on, as index of " << *OtherWalker << " " << OtherWalker->GetTrueFather()->nr << " is smaller than that of Root " << RootKeyNr << "." << endl;
     1306              DoLog(3) && (Log() << Verbose(3) << "Not passing on, as index of " << *OtherWalker << " " << OtherWalker->GetTrueFather()->nr << " is smaller than that of Root " << RootKeyNr << "." << endl);
    13071307            else
    1308               Log() << Verbose(3) << "This is my predecessor " << *Predecessor << "." << endl;
     1308              DoLog(3) && (Log() << Verbose(3) << "This is my predecessor " << *Predecessor << "." << endl);
    13091309          }
    13101310        } else Log() << Verbose(2) << "Is not in the restricted keyset or skipping hydrogen " << *OtherWalker << "." << endl;
     
    13221322{
    13231323  bond *Binder = NULL;
    1324   Log() << Verbose(0) << "Printing all found lists." << endl;
     1324  DoLog(0) && (Log() << Verbose(0) << "Printing all found lists." << endl);
    13251325  for(int i=1;i<Order;i++) {    // skip the root edge in the printing
    13261326    Binder = FragmentSearch.BondsPerSPList[2*i];
    1327     Log() << Verbose(1) << "Current SP level is " << i << "." << endl;
     1327    DoLog(1) && (Log() << Verbose(1) << "Current SP level is " << i << "." << endl);
    13281328    while (Binder->next != FragmentSearch.BondsPerSPList[2*i+1]) {
    13291329      Binder = Binder->next;
    1330       Log() << Verbose(2) << *Binder << endl;
     1330      DoLog(2) && (Log() << Verbose(2) << *Binder << endl);
    13311331    }
    13321332  }
     
    13721372  int Counter = FragmentSearch.FragmentCounter; // mark current value of counter
    13731373
    1374   Log() << Verbose(0) << endl;
    1375   Log() << Verbose(0) << "Begin of PowerSetGenerator with order " << Order << " at Root " << *FragmentSearch.Root << "." << endl;
     1374  DoLog(0) && (Log() << Verbose(0) << endl);
     1375  DoLog(0) && (Log() << Verbose(0) << "Begin of PowerSetGenerator with order " << Order << " at Root " << *FragmentSearch.Root << "." << endl);
    13761376
    13771377  SetSPList(Order, FragmentSearch);
     
    13851385  // creating fragments with the found edge sets  (may be done in reverse order, faster)
    13861386  int SP = CountNumbersInBondsList(Order, FragmentSearch);
    1387   Log() << Verbose(0) << "Total number of edges is " << SP << "." << endl;
     1387  DoLog(0) && (Log() << Verbose(0) << "Total number of edges is " << SP << "." << endl);
    13881388  if (SP >= (Order-1)) {
    13891389    // start with root (push on fragment stack)
    1390     Log() << Verbose(0) << "Starting fragment generation with " << *FragmentSearch.Root << ", local nr is " << FragmentSearch.Root->nr << "." << endl;
     1390    DoLog(0) && (Log() << Verbose(0) << "Starting fragment generation with " << *FragmentSearch.Root << ", local nr is " << FragmentSearch.Root->nr << "." << endl);
    13911391    FragmentSearch.FragmentSet->clear();
    1392     Log() << Verbose(0) << "Preparing subset for this root and calling generator." << endl;
     1392    DoLog(0) && (Log() << Verbose(0) << "Preparing subset for this root and calling generator." << endl);
    13931393
    13941394    // prepare the subset and call the generator
     
    14001400    Free(&BondsList);
    14011401  } else {
    1402     Log() << Verbose(0) << "Not enough total number of edges to build " << Order << "-body fragments." << endl;
     1402    DoLog(0) && (Log() << Verbose(0) << "Not enough total number of edges to build " << Order << "-body fragments." << endl);
    14031403  }
    14041404
    14051405  // as FragmentSearch structure is used only once, we don't have to clean it anymore
    14061406  // remove root from stack
    1407   Log() << Verbose(0) << "Removing root again from stack." << endl;
     1407  DoLog(0) && (Log() << Verbose(0) << "Removing root again from stack." << endl);
    14081408  FragmentSearch.FragmentSet->erase(FragmentSearch.Root->nr);
    14091409
     
    14121412
    14131413  // return list
    1414   Log() << Verbose(0) << "End of PowerSetGenerator." << endl;
     1414  DoLog(0) && (Log() << Verbose(0) << "End of PowerSetGenerator." << endl);
    14151415  return (FragmentSearch.FragmentCounter - Counter);
    14161416};
     
    14581458  atom *Walker = NULL;
    14591459
    1460   Log() << Verbose(0) << "Combining the lists of all orders per order and finally into a single one." << endl;
     1460  DoLog(0) && (Log() << Verbose(0) << "Combining the lists of all orders per order and finally into a single one." << endl);
    14611461  if (FragmentList == NULL) {
    14621462    FragmentList = new Graph;
     
    14911491void FreeAllOrdersList(Graph ***FragmentLowerOrdersList, KeyStack &RootStack, molecule *mol)
    14921492{
    1493   Log() << Verbose(1) << "Free'ing the lists of all orders per order." << endl;
     1493  DoLog(1) && (Log() << Verbose(1) << "Free'ing the lists of all orders per order." << endl);
    14941494  int RootNr = 0;
    14951495  int RootKeyNr = 0;
     
    15441544  struct UniqueFragments FragmentSearch;
    15451545
    1546   Log() << Verbose(0) << "Begin of FragmentBOSSANOVA." << endl;
     1546  DoLog(0) && (Log() << Verbose(0) << "Begin of FragmentBOSSANOVA." << endl);
    15471547
    15481548  // FragmentLowerOrdersList is a 2D-array of pointer to MoleculeListClass objects, one dimension represents the ANOVA expansion of a single order (i.e. 5)
     
    15941594
    15951595      // create top order where nothing is reduced
    1596       Log() << Verbose(0) << "==============================================================================================================" << endl;
    1597       Log() << Verbose(0) << "Creating KeySets of Bond Order " << Order << " for " << *Walker << ", " << (RootStack.size()-RootNr) << " Roots remaining." << endl; // , NumLevels is " << NumLevels << "
     1596      DoLog(0) && (Log() << Verbose(0) << "==============================================================================================================" << endl);
     1597      DoLog(0) && (Log() << Verbose(0) << "Creating KeySets of Bond Order " << Order << " for " << *Walker << ", " << (RootStack.size()-RootNr) << " Roots remaining." << endl); // , NumLevels is " << NumLevels << "
    15981598
    15991599      // Create list of Graphs of current Bond Order (i.e. F_{ij})
     
    16051605
    16061606      // output resulting number
    1607       Log() << Verbose(1) << "Number of resulting KeySets is: " << NumMoleculesOfOrder[RootNr] << "." << endl;
     1607      DoLog(1) && (Log() << Verbose(1) << "Number of resulting KeySets is: " << NumMoleculesOfOrder[RootNr] << "." << endl);
    16081608      if (NumMoleculesOfOrder[RootNr] != 0) {
    16091609        NumMolecules = 0;
     
    16221622    }
    16231623  }
    1624   Log() << Verbose(0) << "==============================================================================================================" << endl;
    1625   Log() << Verbose(1) << "Total number of resulting molecules is: " << TotalNumMolecules << "." << endl;
    1626   Log() << Verbose(0) << "==============================================================================================================" << endl;
     1624  DoLog(0) && (Log() << Verbose(0) << "==============================================================================================================" << endl);
     1625  DoLog(1) && (Log() << Verbose(1) << "Total number of resulting molecules is: " << TotalNumMolecules << "." << endl);
     1626  DoLog(0) && (Log() << Verbose(0) << "==============================================================================================================" << endl);
    16271627
    16281628  // cleanup FragmentSearch structure
     
    16421642  Free(&NumMoleculesOfOrder);
    16431643
    1644   Log() << Verbose(0) << "End of FragmentBOSSANOVA." << endl;
     1644  DoLog(0) && (Log() << Verbose(0) << "End of FragmentBOSSANOVA." << endl);
    16451645};
    16461646
     
    16661666  bool flag = true;
    16671667
    1668   Log() << Verbose(2) << "Begin of ScanForPeriodicCorrection." << endl;
     1668  DoLog(2) && (Log() << Verbose(2) << "Begin of ScanForPeriodicCorrection." << endl);
    16691669
    16701670  ColorList = Calloc<enum Shading>(AtomCount, "molecule::ScanForPeriodicCorrection: *ColorList");
     
    16841684          OtherBinder = Binder->next; // note down binding partner for later re-insertion
    16851685          unlink(Binder);   // unlink bond
    1686           Log() << Verbose(2) << "Correcting at bond " << *Binder << "." << endl;
     1686          DoLog(2) && (Log() << Verbose(2) << "Correcting at bond " << *Binder << "." << endl);
    16871687          flag = true;
    16881688          break;
     
    17001700      //Log() << Verbose(3) << "Translation vector is ";
    17011701      Translationvector.Output();
    1702       Log() << Verbose(0) << endl;
     1702      DoLog(0) && (Log() << Verbose(0) << endl);
    17031703      // apply to all atoms of first component via BFS
    17041704      for (int i=AtomCount;i--;)
     
    17221722      link(Binder, OtherBinder);
    17231723    } else {
    1724       Log() << Verbose(3) << "No corrections for this fragment." << endl;
     1724      DoLog(3) && (Log() << Verbose(3) << "No corrections for this fragment." << endl);
    17251725    }
    17261726    //delete(CompStack);
     
    17311731  Free(&ColorList);
    17321732  Free(&matrix);
    1733   Log() << Verbose(2) << "End of ScanForPeriodicCorrection." << endl;
    1734 };
     1733  DoLog(2) && (Log() << Verbose(2) << "End of ScanForPeriodicCorrection." << endl);
     1734};
  • src/molecule_geometry.cpp

    r6613ec ra67d19  
    280280              if ((fabs(tmp)) > BondDistance) {
    281281                flag = false;
    282                 Log() << Verbose(0) << "Hit: atom " << Walker->Name << " in bond " << *(*Runner) << " has to be shifted due to " << tmp << "." << endl;
     282                DoLog(0) && (Log() << Verbose(0) << "Hit: atom " << Walker->Name << " in bond " << *(*Runner) << " has to be shifted due to " << tmp << "." << endl);
    283283                if (tmp > 0)
    284284                  Translationvector.x[j] -= 1.;
     
    291291        Testvector.MatrixMultiplication(matrix);
    292292        Center.AddVector(&Testvector);
    293         Log() << Verbose(1) << "vector is: ";
     293        DoLog(1) && (Log() << Verbose(1) << "vector is: ");
    294294        Testvector.Output();
    295         Log() << Verbose(0) << endl;
     295        DoLog(0) && (Log() << Verbose(0) << endl);
    296296#ifdef ADDHYDROGEN
    297297        // now also change all hydrogens
     
    303303            Testvector.MatrixMultiplication(matrix);
    304304            Center.AddVector(&Testvector);
    305             Log() << Verbose(1) << "Hydrogen vector is: ";
     305            DoLog(1) && (Log() << Verbose(1) << "Hydrogen vector is: ");
    306306            Testvector.Output();
    307             Log() << Verbose(0) << endl;
     307            DoLog(0) && (Log() << Verbose(0) << endl);
    308308          }
    309309        }
     
    352352  }
    353353  // print InertiaTensor for debugging
    354   Log() << Verbose(0) << "The inertia tensor is:" << endl;
     354  DoLog(0) && (Log() << Verbose(0) << "The inertia tensor is:" << endl);
    355355  for(int i=0;i<NDIM;i++) {
    356356    for(int j=0;j<NDIM;j++)
    357       Log() << Verbose(0) << InertiaTensor[i*NDIM+j] << " ";
    358     Log() << Verbose(0) << endl;
    359   }
    360   Log() << Verbose(0) << endl;
     357      DoLog(0) && (Log() << Verbose(0) << InertiaTensor[i*NDIM+j] << " ");
     358    DoLog(0) && (Log() << Verbose(0) << endl);
     359  }
     360  DoLog(0) && (Log() << Verbose(0) << endl);
    361361
    362362  // diagonalize to determine principal axis system
     
    370370
    371371  for(int i=0;i<NDIM;i++) {
    372     Log() << Verbose(1) << "eigenvalue = " << gsl_vector_get(eval, i);
    373     Log() << Verbose(0) << ", eigenvector = (" << evec->data[i * evec->tda + 0] << "," << evec->data[i * evec->tda + 1] << "," << evec->data[i * evec->tda + 2] << ")" << endl;
     372    DoLog(1) && (Log() << Verbose(1) << "eigenvalue = " << gsl_vector_get(eval, i));
     373    DoLog(0) && (Log() << Verbose(0) << ", eigenvector = (" << evec->data[i * evec->tda + 0] << "," << evec->data[i * evec->tda + 1] << "," << evec->data[i * evec->tda + 2] << ")" << endl);
    374374  }
    375375
    376376  // check whether we rotate or not
    377377  if (DoRotate) {
    378     Log() << Verbose(1) << "Transforming molecule into PAS ... ";
     378    DoLog(1) && (Log() << Verbose(1) << "Transforming molecule into PAS ... ");
    379379    // the eigenvectors specify the transformation matrix
    380380    ActOnAllVectors( &Vector::MatrixMultiplication, (const double *) evec->data );
    381     Log() << Verbose(0) << "done." << endl;
     381    DoLog(0) && (Log() << Verbose(0) << "done." << endl);
    382382
    383383    // summing anew for debugging (resulting matrix has to be diagonal!)
     
    404404    }
    405405    // print InertiaTensor for debugging
    406     Log() << Verbose(0) << "The inertia tensor is:" << endl;
     406    DoLog(0) && (Log() << Verbose(0) << "The inertia tensor is:" << endl);
    407407    for(int i=0;i<NDIM;i++) {
    408408      for(int j=0;j<NDIM;j++)
    409         Log() << Verbose(0) << InertiaTensor[i*NDIM+j] << " ";
    410       Log() << Verbose(0) << endl;
    411     }
    412     Log() << Verbose(0) << endl;
     409        DoLog(0) && (Log() << Verbose(0) << InertiaTensor[i*NDIM+j] << " ");
     410      DoLog(0) && (Log() << Verbose(0) << endl);
     411    }
     412    DoLog(0) && (Log() << Verbose(0) << endl);
    413413  }
    414414
     
    433433
    434434  // rotate on z-x plane
    435   Log() << Verbose(0) << "Begin of Aligning all atoms." << endl;
     435  DoLog(0) && (Log() << Verbose(0) << "Begin of Aligning all atoms." << endl);
    436436  alpha = atan(-n->x[0]/n->x[2]);
    437   Log() << Verbose(1) << "Z-X-angle: " << alpha << " ... ";
     437  DoLog(1) && (Log() << Verbose(1) << "Z-X-angle: " << alpha << " ... ");
    438438  while (ptr->next != end) {
    439439    ptr = ptr->next;
     
    451451  n->x[0] =  cos(alpha) * tmp +  sin(alpha) * n->x[2];
    452452  n->x[2] = -sin(alpha) * tmp +  cos(alpha) * n->x[2];
    453   Log() << Verbose(1) << "alignment vector after first rotation: ";
     453  DoLog(1) && (Log() << Verbose(1) << "alignment vector after first rotation: ");
    454454  n->Output();
    455   Log() << Verbose(0) << endl;
     455  DoLog(0) && (Log() << Verbose(0) << endl);
    456456
    457457  // rotate on z-y plane
    458458  ptr = start;
    459459  alpha = atan(-n->x[1]/n->x[2]);
    460   Log() << Verbose(1) << "Z-Y-angle: " << alpha << " ... ";
     460  DoLog(1) && (Log() << Verbose(1) << "Z-Y-angle: " << alpha << " ... ");
    461461  while (ptr->next != end) {
    462462    ptr = ptr->next;
     
    475475  n->x[2] = -sin(alpha) * tmp +  cos(alpha) * n->x[2];
    476476
    477   Log() << Verbose(1) << "alignment vector after second rotation: ";
     477  DoLog(1) && (Log() << Verbose(1) << "alignment vector after second rotation: ");
    478478  n->Output();
    479   Log() << Verbose(1) << endl;
    480   Log() << Verbose(0) << "End of Aligning all atoms." << endl;
     479  DoLog(1) && (Log() << Verbose(1) << endl);
     480  DoLog(0) && (Log() << Verbose(0) << "End of Aligning all atoms." << endl);
    481481};
    482482
  • src/molecule_graph.cpp

    r6613ec ra67d19  
    5959
    6060  if (!input) {
    61     Log() << Verbose(1) << "Opening silica failed \n";
     61    DoLog(1) && (Log() << Verbose(1) << "Opening silica failed \n");
    6262  };
    6363
    6464  *input >> ws >> atom1;
    6565  *input >> ws >> atom2;
    66   Log() << Verbose(1) << "Scanning file\n";
     66  DoLog(1) && (Log() << Verbose(1) << "Scanning file\n");
    6767  while (!input->eof()) // Check whether we read everything already
    6868  {
     
    115115
    116116  BondDistance = bonddistance; // * ((IsAngstroem) ? 1. : 1./AtomicLengthToAngstroem);
    117   Log() << Verbose(0) << "Begin of CreateAdjacencyList." << endl;
     117  DoLog(0) && (Log() << Verbose(0) << "Begin of CreateAdjacencyList." << endl);
    118118  // remove every bond from the list
    119119  bond *Binder = NULL;
     
    128128  // count atoms in molecule = dimension of matrix (also give each unique name and continuous numbering)
    129129  CountAtoms();
    130   Log() << Verbose(1) << "AtomCount " << AtomCount << " and bonddistance is " << bonddistance << "." << endl;
     130  DoLog(1) && (Log() << Verbose(1) << "AtomCount " << AtomCount << " and bonddistance is " << bonddistance << "." << endl);
    131131
    132132  if ((AtomCount > 1) && (bonddistance > 1.)) {
    133     Log() << Verbose(2) << "Creating Linked Cell structure ... " << endl;
     133    DoLog(2) && (Log() << Verbose(2) << "Creating Linked Cell structure ... " << endl);
    134134    LC = new LinkedCell(this, bonddistance);
    135135
    136136    // create a list to map Tesselpoint::nr to atom *
    137     Log() << Verbose(2) << "Creating TesselPoint to atom map ... " << endl;
     137    DoLog(2) && (Log() << Verbose(2) << "Creating TesselPoint to atom map ... " << endl);
    138138    AtomMap = Calloc<atom *> (AtomCount, "molecule::CreateAdjacencyList - **AtomCount");
    139139    Walker = start;
     
    144144
    145145    // 3a. go through every cell
    146     Log() << Verbose(2) << "Celling ... " << endl;
     146    DoLog(2) && (Log() << Verbose(2) << "Celling ... " << endl);
    147147    for (LC->n[0] = 0; LC->n[0] < LC->N[0]; LC->n[0]++)
    148148      for (LC->n[1] = 0; LC->n[1] < LC->N[1]; LC->n[1]++)
     
    183183    Free(&AtomMap);
    184184    delete (LC);
    185     Log() << Verbose(1) << "I detected " << BondCount << " bonds in the molecule with distance " << BondDistance << "." << endl;
     185    DoLog(1) && (Log() << Verbose(1) << "I detected " << BondCount << " bonds in the molecule with distance " << BondDistance << "." << endl);
    186186
    187187    // correct bond degree by comparing valence and bond degree
    188     Log() << Verbose(2) << "Correcting bond degree ... " << endl;
     188    DoLog(2) && (Log() << Verbose(2) << "Correcting bond degree ... " << endl);
    189189    CorrectBondDegree();
    190190
     
    192192    ActOnAllAtoms( &atom::OutputBondOfAtom );
    193193  } else
    194     Log() << Verbose(1) << "AtomCount is " << AtomCount << ", thus no bonds, no connections!." << endl;
    195   Log() << Verbose(0) << "End of CreateAdjacencyList." << endl;
     194    DoLog(1) && (Log() << Verbose(1) << "AtomCount is " << AtomCount << ", thus no bonds, no connections!." << endl);
     195  DoLog(0) && (Log() << Verbose(0) << "End of CreateAdjacencyList." << endl);
    196196  if (free_BG)
    197197    delete(BG);
     
    204204void molecule::OutputBondsList() const
    205205{
    206   Log() << Verbose(1) << endl << "From contents of bond chain list:";
     206  DoLog(1) && (Log() << Verbose(1) << endl << "From contents of bond chain list:");
    207207  bond *Binder = first;
    208208  while (Binder->next != last) {
    209209    Binder = Binder->next;
    210     Log() << Verbose(0) << *Binder << "\t" << endl;
    211   }
    212   Log() << Verbose(0) << endl;
     210    DoLog(0) && (Log() << Verbose(0) << *Binder << "\t" << endl);
     211  }
     212  DoLog(0) && (Log() << Verbose(0) << endl);
    213213}
    214214;
     
    227227
    228228  if (BondCount != 0) {
    229     Log() << Verbose(1) << "Correcting Bond degree of each bond ... " << endl;
     229    DoLog(1) && (Log() << Verbose(1) << "Correcting Bond degree of each bond ... " << endl);
    230230    do {
    231231      OldNo = No;
    232232      No = SumPerAtom( &atom::CorrectBondDegree );
    233233    } while (OldNo != No);
    234     Log() << Verbose(0) << " done." << endl;
     234    DoLog(0) && (Log() << Verbose(0) << " done." << endl);
    235235  } else {
    236     Log() << Verbose(1) << "BondCount is " << BondCount << ", no bonds between any of the " << AtomCount << " atoms." << endl;
    237   }
    238   Log() << Verbose(0) << No << " bonds could not be corrected." << endl;
     236    DoLog(1) && (Log() << Verbose(1) << "BondCount is " << BondCount << ", no bonds between any of the " << AtomCount << " atoms." << endl);
     237  }
     238  DoLog(0) && (Log() << Verbose(0) << No << " bonds could not be corrected." << endl);
    239239
    240240  return (No);
     
    255255  bond *Binder = first;
    256256  if ((Binder->next != last) && (Binder->next->Type == Undetermined)) {
    257     Log() << Verbose(0) << "No Depth-First-Search analysis performed so far, calling ..." << endl;
     257    DoLog(0) && (Log() << Verbose(0) << "No Depth-First-Search analysis performed so far, calling ..." << endl);
    258258    Subgraphs = DepthFirstSearchAnalysis(BackEdgeStack);
    259259    while (Subgraphs->next != NULL) {
     
    310310    Walker->GraphNr = DFS.CurrentGraphNr;
    311311    Walker->LowpointNr = DFS.CurrentGraphNr;
    312     Log() << Verbose(1) << "Setting Walker[" << Walker->Name << "]'s number to " << Walker->GraphNr << " with Lowpoint " << Walker->LowpointNr << "." << endl;
     312    DoLog(1) && (Log() << Verbose(1) << "Setting Walker[" << Walker->Name << "]'s number to " << Walker->GraphNr << " with Lowpoint " << Walker->LowpointNr << "." << endl);
    313313    DFS.AtomStack->Push(Walker);
    314314    DFS.CurrentGraphNr++;
     
    337337    if (Binder == NULL)
    338338      break;
    339     Log() << Verbose(2) << "Current Unused Bond is " << *Binder << "." << endl;
     339    DoLog(2) && (Log() << Verbose(2) << "Current Unused Bond is " << *Binder << "." << endl);
    340340    // (4) Mark Binder used, ...
    341341    Binder->MarkUsed(black);
    342342    OtherAtom = Binder->GetOtherAtom(Walker);
    343     Log() << Verbose(2) << "(4) OtherAtom is " << OtherAtom->Name << "." << endl;
     343    DoLog(2) && (Log() << Verbose(2) << "(4) OtherAtom is " << OtherAtom->Name << "." << endl);
    344344    if (OtherAtom->GraphNr != -1) {
    345345      // (4a) ... if "other" atom has been visited (GraphNr != 0), set lowpoint to minimum of both, go to (3)
     
    347347      DFS.BackEdgeStack->Push(Binder);
    348348      Walker->LowpointNr = (Walker->LowpointNr < OtherAtom->GraphNr) ? Walker->LowpointNr : OtherAtom->GraphNr;
    349       Log() << Verbose(3) << "(4a) Visited: Setting Lowpoint of Walker[" << Walker->Name << "] to " << Walker->LowpointNr << "." << endl;
     349      DoLog(3) && (Log() << Verbose(3) << "(4a) Visited: Setting Lowpoint of Walker[" << Walker->Name << "] to " << Walker->LowpointNr << "." << endl);
    350350    } else {
    351351      // (4b) ... otherwise set OtherAtom as Ancestor of Walker and Walker as OtherAtom, go to (2)
     
    353353      OtherAtom->Ancestor = Walker;
    354354      Walker = OtherAtom;
    355       Log() << Verbose(3) << "(4b) Not Visited: OtherAtom[" << OtherAtom->Name << "]'s Ancestor is now " << OtherAtom->Ancestor->Name << ", Walker is OtherAtom " << OtherAtom->Name << "." << endl;
     355      DoLog(3) && (Log() << Verbose(3) << "(4b) Not Visited: OtherAtom[" << OtherAtom->Name << "]'s Ancestor is now " << OtherAtom->Ancestor->Name << ", Walker is OtherAtom " << OtherAtom->Name << "." << endl);
    356356      break;
    357357    }
     
    375375
    376376  // (5) if Ancestor of Walker is ...
    377   Log() << Verbose(1) << "(5) Number of Walker[" << Walker->Name << "]'s Ancestor[" << Walker->Ancestor->Name << "] is " << Walker->Ancestor->GraphNr << "." << endl;
     377  DoLog(1) && (Log() << Verbose(1) << "(5) Number of Walker[" << Walker->Name << "]'s Ancestor[" << Walker->Ancestor->Name << "] is " << Walker->Ancestor->GraphNr << "." << endl);
    378378
    379379  if (Walker->Ancestor->GraphNr != DFS.Root->GraphNr) {
     
    382382      // (6a) set Ancestor's Lowpoint number to minimum of of its Ancestor and itself, go to Step(8)
    383383      Walker->Ancestor->LowpointNr = (Walker->Ancestor->LowpointNr < Walker->LowpointNr) ? Walker->Ancestor->LowpointNr : Walker->LowpointNr;
    384       Log() << Verbose(2) << "(6) Setting Walker[" << Walker->Name << "]'s Ancestor[" << Walker->Ancestor->Name << "]'s Lowpoint to " << Walker->Ancestor->LowpointNr << "." << endl;
     384      DoLog(2) && (Log() << Verbose(2) << "(6) Setting Walker[" << Walker->Name << "]'s Ancestor[" << Walker->Ancestor->Name << "]'s Lowpoint to " << Walker->Ancestor->LowpointNr << "." << endl);
    385385    } else {
    386386      // (7) (Ancestor of Walker is a separating vertex, remove all from stack till Walker (including), these and Ancestor form a component
    387387      Walker->Ancestor->SeparationVertex = true;
    388       Log() << Verbose(2) << "(7) Walker[" << Walker->Name << "]'s Ancestor[" << Walker->Ancestor->Name << "]'s is a separating vertex, creating component." << endl;
     388      DoLog(2) && (Log() << Verbose(2) << "(7) Walker[" << Walker->Name << "]'s Ancestor[" << Walker->Ancestor->Name << "]'s is a separating vertex, creating component." << endl);
    389389      mol->SetNextComponentNumber(Walker->Ancestor, DFS.ComponentNumber);
    390       Log() << Verbose(3) << "(7) Walker[" << Walker->Name << "]'s Ancestor's Compont is " << DFS.ComponentNumber << "." << endl;
     390      DoLog(3) && (Log() << Verbose(3) << "(7) Walker[" << Walker->Name << "]'s Ancestor's Compont is " << DFS.ComponentNumber << "." << endl);
    391391      mol->SetNextComponentNumber(Walker, DFS.ComponentNumber);
    392       Log() << Verbose(3) << "(7) Walker[" << Walker->Name << "]'s Compont is " << DFS.ComponentNumber << "." << endl;
     392      DoLog(3) && (Log() << Verbose(3) << "(7) Walker[" << Walker->Name << "]'s Compont is " << DFS.ComponentNumber << "." << endl);
    393393      do {
    394394        OtherAtom = DFS.AtomStack->PopLast();
    395395        LeafWalker->Leaf->AddCopyAtom(OtherAtom);
    396396        mol->SetNextComponentNumber(OtherAtom, DFS.ComponentNumber);
    397         Log() << Verbose(3) << "(7) Other[" << OtherAtom->Name << "]'s Compont is " << DFS.ComponentNumber << "." << endl;
     397        DoLog(3) && (Log() << Verbose(3) << "(7) Other[" << OtherAtom->Name << "]'s Compont is " << DFS.ComponentNumber << "." << endl);
    398398      } while (OtherAtom != Walker);
    399399      DFS.ComponentNumber++;
    400400    }
    401401    // (8) Walker becomes its Ancestor, go to (3)
    402     Log() << Verbose(2) << "(8) Walker[" << Walker->Name << "] is now its Ancestor " << Walker->Ancestor->Name << ", backstepping. " << endl;
     402    DoLog(2) && (Log() << Verbose(2) << "(8) Walker[" << Walker->Name << "] is now its Ancestor " << Walker->Ancestor->Name << ", backstepping. " << endl);
    403403    Walker = Walker->Ancestor;
    404404    DFS.BackStepping = true;
     
    424424    //DFS.AtomStack->Output(out);
    425425    mol->SetNextComponentNumber(DFS.Root, DFS.ComponentNumber);
    426     Log() << Verbose(3) << "(9) Root[" << DFS.Root->Name << "]'s Component is " << DFS.ComponentNumber << "." << endl;
     426    DoLog(3) && (Log() << Verbose(3) << "(9) Root[" << DFS.Root->Name << "]'s Component is " << DFS.ComponentNumber << "." << endl);
    427427    mol->SetNextComponentNumber(Walker, DFS.ComponentNumber);
    428     Log() << Verbose(3) << "(9) Walker[" << Walker->Name << "]'s Component is " << DFS.ComponentNumber << "." << endl;
     428    DoLog(3) && (Log() << Verbose(3) << "(9) Walker[" << Walker->Name << "]'s Component is " << DFS.ComponentNumber << "." << endl);
    429429    do {
    430430      OtherAtom = DFS.AtomStack->PopLast();
    431431      LeafWalker->Leaf->AddCopyAtom(OtherAtom);
    432432      mol->SetNextComponentNumber(OtherAtom, DFS.ComponentNumber);
    433       Log() << Verbose(3) << "(7) Other[" << OtherAtom->Name << "]'s Compont is " << DFS.ComponentNumber << "." << endl;
     433      DoLog(3) && (Log() << Verbose(3) << "(7) Other[" << OtherAtom->Name << "]'s Compont is " << DFS.ComponentNumber << "." << endl);
    434434    } while (OtherAtom != Walker);
    435435    DFS.ComponentNumber++;
     
    438438    Walker = DFS.Root;
    439439    Binder = mol->FindNextUnused(Walker);
    440     Log() << Verbose(1) << "(10) Walker is Root[" << DFS.Root->Name << "], next Unused Bond is " << Binder << "." << endl;
     440    DoLog(1) && (Log() << Verbose(1) << "(10) Walker is Root[" << DFS.Root->Name << "], next Unused Bond is " << Binder << "." << endl);
    441441    if (Binder != NULL) { // Root is separation vertex
    442       Log() << Verbose(1) << "(11) Root is a separation vertex." << endl;
     442      DoLog(1) && (Log() << Verbose(1) << "(11) Root is a separation vertex." << endl);
    443443      Walker->SeparationVertex = true;
    444444    }
     
    497497  if (AtomCount == 0)
    498498    return SubGraphs;
    499   Log() << Verbose(0) << "Begin of DepthFirstSearchAnalysis" << endl;
     499  DoLog(0) && (Log() << Verbose(0) << "Begin of DepthFirstSearchAnalysis" << endl);
    500500  DepthFirstSearchAnalysis_Init(DFS, this);
    501501
     
    519519
    520520        if (Binder == NULL) {
    521           Log() << Verbose(2) << "No more Unused Bonds." << endl;
     521          DoLog(2) && (Log() << Verbose(2) << "No more Unused Bonds." << endl);
    522522          break;
    523523        } else
     
    536536
    537537    // From OldGraphNr to CurrentGraphNr ranges an disconnected subgraph
    538     Log() << Verbose(0) << "Disconnected subgraph ranges from " << OldGraphNr << " to " << DFS.CurrentGraphNr << "." << endl;
     538    DoLog(0) && (Log() << Verbose(0) << "Disconnected subgraph ranges from " << OldGraphNr << " to " << DFS.CurrentGraphNr << "." << endl);
    539539    LeafWalker->Leaf->Output((ofstream *)&cout);
    540     Log() << Verbose(0) << endl;
     540    DoLog(0) && (Log() << Verbose(0) << endl);
    541541
    542542    // step on to next root
     
    556556  // free all and exit
    557557  DepthFirstSearchAnalysis_Finalize(DFS);
    558   Log() << Verbose(0) << "End of DepthFirstSearchAnalysis" << endl;
     558  DoLog(0) && (Log() << Verbose(0) << "End of DepthFirstSearchAnalysis" << endl);
    559559  return SubGraphs;
    560560}
     
    582582void molecule::OutputGraphInfoPerAtom() const
    583583{
    584   Log() << Verbose(1) << "Final graph info for each atom is:" << endl;
     584  DoLog(1) && (Log() << Verbose(1) << "Final graph info for each atom is:" << endl);
    585585  ActOnAllAtoms( &atom::OutputGraphInfo );
    586586}
     
    592592void molecule::OutputGraphInfoPerBond() const
    593593{
    594   Log() << Verbose(1) << "Final graph info for each bond is:" << endl;
     594  DoLog(1) && (Log() << Verbose(1) << "Final graph info for each bond is:" << endl);
    595595  bond *Binder = first;
    596596  while (Binder->next != last) {
    597597    Binder = Binder->next;
    598     Log() << Verbose(2) << ((Binder->Type == TreeEdge) ? "TreeEdge " : "BackEdge ") << *Binder << ": <";
    599     Log() << Verbose(0) << ((Binder->leftatom->SeparationVertex) ? "SP," : "") << "L" << Binder->leftatom->LowpointNr << " G" << Binder->leftatom->GraphNr << " Comp.";
     598    DoLog(2) && (Log() << Verbose(2) << ((Binder->Type == TreeEdge) ? "TreeEdge " : "BackEdge ") << *Binder << ": <");
     599    DoLog(0) && (Log() << Verbose(0) << ((Binder->leftatom->SeparationVertex) ? "SP," : "") << "L" << Binder->leftatom->LowpointNr << " G" << Binder->leftatom->GraphNr << " Comp.");
    600600    Binder->leftatom->OutputComponentNumber();
    601     Log() << Verbose(0) << " ===  ";
    602     Log() << Verbose(0) << ((Binder->rightatom->SeparationVertex) ? "SP," : "") << "L" << Binder->rightatom->LowpointNr << " G" << Binder->rightatom->GraphNr << " Comp.";
     601    DoLog(0) && (Log() << Verbose(0) << " ===  ");
     602    DoLog(0) && (Log() << Verbose(0) << ((Binder->rightatom->SeparationVertex) ? "SP," : "") << "L" << Binder->rightatom->LowpointNr << " G" << Binder->rightatom->GraphNr << " Comp.");
    603603    Binder->rightatom->OutputComponentNumber();
    604     Log() << Verbose(0) << ">." << endl;
     604    DoLog(0) && (Log() << Verbose(0) << ">." << endl);
    605605    if (Binder->Cyclic) // cyclic ??
    606       Log() << Verbose(3) << "Lowpoint at each side are equal: CYCLIC!" << endl;
     606      DoLog(3) && (Log() << Verbose(3) << "Lowpoint at each side are equal: CYCLIC!" << endl);
    607607  }
    608608}
     
    678678  do { // look for Root
    679679    Walker = BFS.BFSStack->PopFirst();
    680     Log() << Verbose(2) << "Current Walker is " << *Walker << ", we look for SP to Root " << *BFS.Root << "." << endl;
     680    DoLog(2) && (Log() << Verbose(2) << "Current Walker is " << *Walker << ", we look for SP to Root " << *BFS.Root << "." << endl);
    681681    for (BondList::const_iterator Runner = Walker->ListOfBonds.begin(); Runner != Walker->ListOfBonds.end(); (++Runner)) {
    682682      if ((*Runner) != BackEdge) { // only walk along DFS spanning tree (otherwise we always find SP of one being backedge Binder)
     
    685685        if (OtherAtom->type->Z != 1) {
    686686#endif
    687         Log() << Verbose(2) << "Current OtherAtom is: " << OtherAtom->Name << " for bond " << *(*Runner) << "." << endl;
     687        DoLog(2) && (Log() << Verbose(2) << "Current OtherAtom is: " << OtherAtom->Name << " for bond " << *(*Runner) << "." << endl);
    688688        if (BFS.ColorList[OtherAtom->nr] == white) {
    689689          BFS.TouchedStack->Push(OtherAtom);
     
    691691          BFS.PredecessorList[OtherAtom->nr] = Walker; // Walker is the predecessor
    692692          BFS.ShortestPathList[OtherAtom->nr] = BFS.ShortestPathList[Walker->nr] + 1;
    693           Log() << Verbose(2) << "Coloring OtherAtom " << OtherAtom->Name << " lightgray, its predecessor is " << Walker->Name << " and its Shortest Path is " << BFS.ShortestPathList[OtherAtom->nr] << " egde(s) long." << endl;
     693          DoLog(2) && (Log() << Verbose(2) << "Coloring OtherAtom " << OtherAtom->Name << " lightgray, its predecessor is " << Walker->Name << " and its Shortest Path is " << BFS.ShortestPathList[OtherAtom->nr] << " egde(s) long." << endl);
    694694          //if (BFS.ShortestPathList[OtherAtom->nr] < MinimumRingSize[Walker->GetTrueFather()->nr]) { // Check for maximum distance
    695           Log() << Verbose(3) << "Putting OtherAtom into queue." << endl;
     695          DoLog(3) && (Log() << Verbose(3) << "Putting OtherAtom into queue." << endl);
    696696          BFS.BFSStack->Push(OtherAtom);
    697697          //}
    698698        } else {
    699           Log() << Verbose(3) << "Not Adding, has already been visited." << endl;
     699          DoLog(3) && (Log() << Verbose(3) << "Not Adding, has already been visited." << endl);
    700700        }
    701701        if (OtherAtom == BFS.Root)
     
    703703#ifdef ADDHYDROGEN
    704704      } else {
    705         Log() << Verbose(2) << "Skipping hydrogen atom " << *OtherAtom << "." << endl;
     705        DoLog(2) && (Log() << Verbose(2) << "Skipping hydrogen atom " << *OtherAtom << "." << endl);
    706706        BFS.ColorList[OtherAtom->nr] = black;
    707707      }
    708708#endif
    709709      } else {
    710         Log() << Verbose(2) << "Bond " << *(*Runner) << " not Visiting, is the back edge." << endl;
     710        DoLog(2) && (Log() << Verbose(2) << "Bond " << *(*Runner) << " not Visiting, is the back edge." << endl);
    711711      }
    712712    }
    713713    BFS.ColorList[Walker->nr] = black;
    714     Log() << Verbose(1) << "Coloring Walker " << Walker->Name << " black." << endl;
     714    DoLog(1) && (Log() << Verbose(1) << "Coloring Walker " << Walker->Name << " black." << endl);
    715715    if (OtherAtom == BFS.Root) { // if we have found the root, check whether this cycle wasn't already found beforehand
    716716      // step through predecessor list
     
    722722      }
    723723      if (OtherAtom == BackEdge->rightatom) { // if each atom in found cycle is cyclic, loop's been found before already
    724         Log() << Verbose(3) << "This cycle was already found before, skipping and removing seeker from search." << endl;
     724        DoLog(3) && (Log() << Verbose(3) << "This cycle was already found before, skipping and removing seeker from search." << endl);
    725725        do {
    726726          OtherAtom = BFS.TouchedStack->PopLast();
    727727          if (BFS.PredecessorList[OtherAtom->nr] == Walker) {
    728             Log() << Verbose(4) << "Removing " << *OtherAtom << " from lists and stacks." << endl;
     728            DoLog(4) && (Log() << Verbose(4) << "Removing " << *OtherAtom << " from lists and stacks." << endl);
    729729            BFS.PredecessorList[OtherAtom->nr] = NULL;
    730730            BFS.ShortestPathList[OtherAtom->nr] = -1;
     
    760760    RingSize = 1;
    761761    BFS.Root->GetTrueFather()->IsCyclic = true;
    762     Log() << Verbose(1) << "Found ring contains: ";
     762    DoLog(1) && (Log() << Verbose(1) << "Found ring contains: ");
    763763    Walker = BFS.Root;
    764764    while (Walker != BackEdge->rightatom) {
    765       Log() << Verbose(0) << Walker->Name << " <-> ";
     765      DoLog(0) && (Log() << Verbose(0) << Walker->Name << " <-> ");
    766766      Walker = BFS.PredecessorList[Walker->nr];
    767767      Walker->GetTrueFather()->IsCyclic = true;
    768768      RingSize++;
    769769    }
    770     Log() << Verbose(0) << Walker->Name << "  with a length of " << RingSize << "." << endl << endl;
     770    DoLog(0) && (Log() << Verbose(0) << Walker->Name << "  with a length of " << RingSize << "." << endl << endl);
    771771    // walk through all and set MinimumRingSize
    772772    Walker = BFS.Root;
     
    780780      MinRingSize = RingSize;
    781781  } else {
    782     Log() << Verbose(1) << "No ring containing " << *BFS.Root << " with length equal to or smaller than " << MinimumRingSize[Walker->GetTrueFather()->nr] << " found." << endl;
     782    DoLog(1) && (Log() << Verbose(1) << "No ring containing " << *BFS.Root << " with length equal to or smaller than " << MinimumRingSize[Walker->GetTrueFather()->nr] << " found." << endl);
    783783  }
    784784};
     
    858858
    859859      }
    860       Log() << Verbose(1) << "Minimum ring size of " << *Root << " is " << MinimumRingSize[Root->GetTrueFather()->nr] << "." << endl;
    861     }
    862     Log() << Verbose(1) << "Minimum ring size is " << MinRingSize << ", over " << NumCycles << " cycles total." << endl;
     860      DoLog(1) && (Log() << Verbose(1) << "Minimum ring size of " << *Root << " is " << MinimumRingSize[Root->GetTrueFather()->nr] << "." << endl);
     861    }
     862    DoLog(1) && (Log() << Verbose(1) << "Minimum ring size is " << MinRingSize << ", over " << NumCycles << " cycles total." << endl);
    863863  } else
    864     Log() << Verbose(1) << "No rings were detected in the molecular structure." << endl;
     864    DoLog(1) && (Log() << Verbose(1) << "No rings were detected in the molecular structure." << endl);
    865865}
    866866;
     
    890890  //BackEdgeStack->Output(out);
    891891
    892   Log() << Verbose(1) << "Analysing cycles ... " << endl;
     892  DoLog(1) && (Log() << Verbose(1) << "Analysing cycles ... " << endl);
    893893  NumCycles = 0;
    894894  while (!BackEdgeStack->IsEmpty()) {
     
    901901    ResetBFSAccounting(Walker, BFS);
    902902
    903     Log() << Verbose(1) << "---------------------------------------------------------------------------------------------------------" << endl;
     903    DoLog(1) && (Log() << Verbose(1) << "---------------------------------------------------------------------------------------------------------" << endl);
    904904    OtherAtom = NULL;
    905905    CyclicStructureAnalysis_CyclicBFSFromRootToRoot(BackEdge, BFS);
     
    973973void OutputAlreadyVisited(int *list)
    974974{
    975   Log() << Verbose(4) << "Already Visited Bonds:\t";
     975  DoLog(4) && (Log() << Verbose(4) << "Already Visited Bonds:\t");
    976976  for (int i = 1; i <= list[0]; i++)
    977     Log() << Verbose(0) << list[i] << "  ";
    978   Log() << Verbose(0) << endl;
     977    DoLog(0) && (Log() << Verbose(0) << list[i] << "  ");
     978  DoLog(0) && (Log() << Verbose(0) << endl);
    979979}
    980980;
     
    997997    line << filename;
    998998  AdjacencyFile.open(line.str().c_str(), ios::out);
    999   Log() << Verbose(1) << "Saving adjacency list ... ";
     999  DoLog(1) && (Log() << Verbose(1) << "Saving adjacency list ... ");
    10001000  if (AdjacencyFile != NULL) {
    10011001    AdjacencyFile << "m\tn" << endl;
    10021002    ActOnAllAtoms(&atom::OutputAdjacency, &AdjacencyFile);
    10031003    AdjacencyFile.close();
    1004     Log() << Verbose(1) << "done." << endl;
     1004    DoLog(1) && (Log() << Verbose(1) << "done." << endl);
    10051005  } else {
    1006     Log() << Verbose(1) << "failed to open file " << line.str() << "." << endl;
     1006    DoLog(1) && (Log() << Verbose(1) << "failed to open file " << line.str() << "." << endl);
    10071007    status = false;
    10081008  }
     
    10291029    line << filename;
    10301030  BondFile.open(line.str().c_str(), ios::out);
    1031   Log() << Verbose(1) << "Saving adjacency list ... ";
     1031  DoLog(1) && (Log() << Verbose(1) << "Saving adjacency list ... ");
    10321032  if (BondFile != NULL) {
    10331033    BondFile << "m\tn" << endl;
    10341034    ActOnAllAtoms(&atom::OutputBonds, &BondFile);
    10351035    BondFile.close();
    1036     Log() << Verbose(1) << "done." << endl;
     1036    DoLog(1) && (Log() << Verbose(1) << "done." << endl);
    10371037  } else {
    1038     Log() << Verbose(1) << "failed to open file " << line.str() << "." << endl;
     1038    DoLog(1) && (Log() << Verbose(1) << "failed to open file " << line.str() << "." << endl);
    10391039    status = false;
    10401040  }
     
    10491049  filename << path << "/" << FRAGMENTPREFIX << ADJACENCYFILE;
    10501050  File.open(filename.str().c_str(), ios::out);
    1051   Log() << Verbose(1) << "Looking at bond structure stored in adjacency file and comparing to present one ... ";
     1051  DoLog(1) && (Log() << Verbose(1) << "Looking at bond structure stored in adjacency file and comparing to present one ... ");
    10521052  if (File == NULL)
    10531053    return false;
     
    10901090    //Log() << Verbose(0) << endl;
    10911091  } else {
    1092     Log() << Verbose(0) << "Number of bonds for Atom " << *Walker << " does not match, parsed " << CurrentBondsOfAtom << " against " << Walker->ListOfBonds.size() << "." << endl;
     1092    DoLog(0) && (Log() << Verbose(0) << "Number of bonds for Atom " << *Walker << " does not match, parsed " << CurrentBondsOfAtom << " against " << Walker->ListOfBonds.size() << "." << endl);
    10931093    status = false;
    10941094  }
     
    11131113
    11141114  if (!CheckAdjacencyFileAgainstMolecule_Init(path, File, CurrentBonds)) {
    1115     Log() << Verbose(1) << "Adjacency file not found." << endl;
     1115    DoLog(1) && (Log() << Verbose(1) << "Adjacency file not found." << endl);
    11161116    return true;
    11171117  }
     
    11391139
    11401140  if (status) { // if equal we parse the KeySetFile
    1141     Log() << Verbose(1) << "done: Equal." << endl;
     1141    DoLog(1) && (Log() << Verbose(1) << "done: Equal." << endl);
    11421142  } else
    1143     Log() << Verbose(1) << "done: Not equal by " << NonMatchNumber << " atoms." << endl;
     1143    DoLog(1) && (Log() << Verbose(1) << "done: Not equal by " << NonMatchNumber << " atoms." << endl);
    11441144  return status;
    11451145}
     
    11571157  bool status = true;
    11581158  if (ReferenceStack->IsEmpty()) {
    1159     Log() << Verbose(1) << "ReferenceStack is empty!" << endl;
     1159    DoLog(1) && (Log() << Verbose(1) << "ReferenceStack is empty!" << endl);
    11601160    return false;
    11611161  }
     
    11721172        if (OtherAtom == ListOfLocalAtoms[(*Runner)->rightatom->nr]) { // found the bond
    11731173          LocalStack->Push((*Runner));
    1174           Log() << Verbose(3) << "Found local edge " << *(*Runner) << "." << endl;
     1174          DoLog(3) && (Log() << Verbose(3) << "Found local edge " << *(*Runner) << "." << endl);
    11751175          break;
    11761176        }
    11771177      }
    11781178    Binder = ReferenceStack->PopFirst(); // loop the stack for next item
    1179     Log() << Verbose(3) << "Current candidate edge " << Binder << "." << endl;
     1179    DoLog(3) && (Log() << Verbose(3) << "Current candidate edge " << Binder << "." << endl);
    11801180    ReferenceStack->Push(Binder);
    11811181  } while (FirstBond != Binder);
     
    12261226  BFS.PredecessorList[OtherAtom->nr] = Walker; // Walker is the predecessor
    12271227  BFS.ShortestPathList[OtherAtom->nr] = BFS.ShortestPathList[Walker->nr] + 1;
    1228   Log() << Verbose(2) << "Coloring OtherAtom " << OtherAtom->Name << " " << ((BFS.ColorList[OtherAtom->nr] == white) ? "white" : "lightgray") << ", its predecessor is " << Walker->Name << " and its Shortest Path is " << BFS.ShortestPathList[OtherAtom->nr] << " egde(s) long." << endl;
     1228  DoLog(2) && (Log() << Verbose(2) << "Coloring OtherAtom " << OtherAtom->Name << " " << ((BFS.ColorList[OtherAtom->nr] == white) ? "white" : "lightgray") << ", its predecessor is " << Walker->Name << " and its Shortest Path is " << BFS.ShortestPathList[OtherAtom->nr] << " egde(s) long." << endl);
    12291229  if ((((BFS.ShortestPathList[OtherAtom->nr] < BFS.BondOrder) && (Binder != Bond)))) { // Check for maximum distance
    1230     Log() << Verbose(3);
     1230    DoLog(3) && (Log() << Verbose(3));
    12311231    if (AddedAtomList[OtherAtom->nr] == NULL) { // add if it's not been so far
    12321232      AddedAtomList[OtherAtom->nr] = Mol->AddCopyAtom(OtherAtom);
    1233       Log() << Verbose(0) << "Added OtherAtom " << OtherAtom->Name;
     1233      DoLog(0) && (Log() << Verbose(0) << "Added OtherAtom " << OtherAtom->Name);
    12341234      AddedBondList[Binder->nr] = Mol->CopyBond(AddedAtomList[Walker->nr], AddedAtomList[OtherAtom->nr], Binder);
    1235       Log() << Verbose(0) << " and bond " << *(AddedBondList[Binder->nr]) << ", ";
     1235      DoLog(0) && (Log() << Verbose(0) << " and bond " << *(AddedBondList[Binder->nr]) << ", ");
    12361236    } else { // this code should actually never come into play (all white atoms are not yet present in BondMolecule, that's why they are white in the first place)
    1237       Log() << Verbose(0) << "Not adding OtherAtom " << OtherAtom->Name;
     1237      DoLog(0) && (Log() << Verbose(0) << "Not adding OtherAtom " << OtherAtom->Name);
    12381238      if (AddedBondList[Binder->nr] == NULL) {
    12391239        AddedBondList[Binder->nr] = Mol->CopyBond(AddedAtomList[Walker->nr], AddedAtomList[OtherAtom->nr], Binder);
    1240         Log() << Verbose(0) << ", added Bond " << *(AddedBondList[Binder->nr]);
     1240        DoLog(0) && (Log() << Verbose(0) << ", added Bond " << *(AddedBondList[Binder->nr]));
    12411241      } else
    1242         Log() << Verbose(0) << ", not added Bond ";
    1243     }
    1244     Log() << Verbose(0) << ", putting OtherAtom into queue." << endl;
     1242        DoLog(0) && (Log() << Verbose(0) << ", not added Bond ");
     1243    }
     1244    DoLog(0) && (Log() << Verbose(0) << ", putting OtherAtom into queue." << endl);
    12451245    BFS.BFSStack->Push(OtherAtom);
    12461246  } else { // out of bond order, then replace
     
    12481248      BFS.ColorList[OtherAtom->nr] = white; // unmark if it has not been queued/added, to make it available via its other bonds (cyclic)
    12491249    if (Binder == Bond)
    1250       Log() << Verbose(3) << "Not Queueing, is the Root bond";
     1250      DoLog(3) && (Log() << Verbose(3) << "Not Queueing, is the Root bond");
    12511251    else if (BFS.ShortestPathList[OtherAtom->nr] >= BFS.BondOrder)
    1252       Log() << Verbose(3) << "Not Queueing, is out of Bond Count of " << BFS.BondOrder;
     1252      DoLog(3) && (Log() << Verbose(3) << "Not Queueing, is out of Bond Count of " << BFS.BondOrder);
    12531253    if (!Binder->Cyclic)
    1254       Log() << Verbose(0) << ", is not part of a cyclic bond, saturating bond with Hydrogen." << endl;
     1254      DoLog(0) && (Log() << Verbose(0) << ", is not part of a cyclic bond, saturating bond with Hydrogen." << endl);
    12551255    if (AddedBondList[Binder->nr] == NULL) {
    12561256      if ((AddedAtomList[OtherAtom->nr] != NULL)) { // .. whether we add or saturate
     
    12691269void BreadthFirstSearchAdd_VisitedNode(molecule *Mol, struct BFSAccounting &BFS, atom *&Walker, atom *&OtherAtom, bond *&Binder, bond *&Bond, atom **&AddedAtomList, bond **&AddedBondList, bool IsAngstroem)
    12701270{
    1271   Log() << Verbose(3) << "Not Adding, has already been visited." << endl;
     1271  DoLog(3) && (Log() << Verbose(3) << "Not Adding, has already been visited." << endl);
    12721272  // This has to be a cyclic bond, check whether it's present ...
    12731273  if (AddedBondList[Binder->nr] == NULL) {
     
    13151315    // followed by n+1 till top of stack.
    13161316    Walker = BFS.BFSStack->PopFirst(); // pop oldest added
    1317     Log() << Verbose(1) << "Current Walker is: " << Walker->Name << ", and has " << Walker->ListOfBonds.size() << " bonds." << endl;
     1317    DoLog(1) && (Log() << Verbose(1) << "Current Walker is: " << Walker->Name << ", and has " << Walker->ListOfBonds.size() << " bonds." << endl);
    13181318    for (BondList::const_iterator Runner = Walker->ListOfBonds.begin(); Runner != Walker->ListOfBonds.end(); (++Runner)) {
    13191319      if ((*Runner) != NULL) { // don't look at bond equal NULL
    13201320        Binder = (*Runner);
    13211321        OtherAtom = (*Runner)->GetOtherAtom(Walker);
    1322         Log() << Verbose(2) << "Current OtherAtom is: " << OtherAtom->Name << " for bond " << *(*Runner) << "." << endl;
     1322        DoLog(2) && (Log() << Verbose(2) << "Current OtherAtom is: " << OtherAtom->Name << " for bond " << *(*Runner) << "." << endl);
    13231323        if (BFS.ColorList[OtherAtom->nr] == white) {
    13241324          BreadthFirstSearchAdd_UnvisitedNode(Mol, BFS, Walker, OtherAtom, Binder, Bond, AddedAtomList, AddedBondList, IsAngstroem);
     
    13291329    }
    13301330    BFS.ColorList[Walker->nr] = black;
    1331     Log() << Verbose(1) << "Coloring Walker " << Walker->Name << " black." << endl;
     1331    DoLog(1) && (Log() << Verbose(1) << "Coloring Walker " << Walker->Name << " black." << endl);
    13321332  }
    13331333  BreadthFirstSearchAdd_Free(BFS);
     
    13541354  // reset parent list
    13551355  ParentList = Calloc<atom*> (AtomCount, "molecule::BuildInducedSubgraph_Init: **ParentList");
    1356   Log() << Verbose(3) << "Resetting ParentList." << endl;
     1356  DoLog(3) && (Log() << Verbose(3) << "Resetting ParentList." << endl);
    13571357}
    13581358;
     
    13611361{
    13621362  // fill parent list with sons
    1363   Log() << Verbose(3) << "Filling Parent List." << endl;
     1363  DoLog(3) && (Log() << Verbose(3) << "Filling Parent List." << endl);
    13641364  atom *Walker = mol->start;
    13651365  while (Walker->next != mol->end) {
     
    13671367    ParentList[Walker->father->nr] = Walker;
    13681368    // Outputting List for debugging
    1369     Log() << Verbose(4) << "Son[" << Walker->father->nr << "] of " << Walker->father << " is " << ParentList[Walker->father->nr] << "." << endl;
     1369    DoLog(4) && (Log() << Verbose(4) << "Son[" << Walker->father->nr << "] of " << Walker->father << " is " << ParentList[Walker->father->nr] << "." << endl);
    13701370  }
    13711371
     
    13851385  atom *OtherAtom = NULL;
    13861386  // check each entry of parent list and if ok (one-to-and-onto matching) create bonds
    1387   Log() << Verbose(3) << "Creating bonds." << endl;
     1387  DoLog(3) && (Log() << Verbose(3) << "Creating bonds." << endl);
    13881388  Walker = Father->start;
    13891389  while (Walker->next != Father->end) {
     
    13961396          OtherAtom = (*Runner)->GetOtherAtom(Walker);
    13971397          if (ParentList[OtherAtom->nr] != NULL) { // if otheratom is also a father of an atom on this molecule, create the bond
    1398             Log() << Verbose(4) << "Endpoints of Bond " << (*Runner) << " are both present: " << ParentList[Walker->nr]->Name << " and " << ParentList[OtherAtom->nr]->Name << "." << endl;
     1398            DoLog(4) && (Log() << Verbose(4) << "Endpoints of Bond " << (*Runner) << " are both present: " << ParentList[Walker->nr]->Name << " and " << ParentList[OtherAtom->nr]->Name << "." << endl);
    13991399            mol->AddBond(ParentList[Walker->nr], ParentList[OtherAtom->nr], (*Runner)->BondDegree);
    14001400          }
     
    14211421  atom **ParentList = NULL;
    14221422
    1423   Log() << Verbose(2) << "Begin of BuildInducedSubgraph." << endl;
     1423  DoLog(2) && (Log() << Verbose(2) << "Begin of BuildInducedSubgraph." << endl);
    14241424  BuildInducedSubgraph_Init(ParentList, Father->AtomCount);
    14251425  BuildInducedSubgraph_FillParentList(this, Father, ParentList);
    14261426  status = BuildInducedSubgraph_CreateBondsFromParent(this, Father, ParentList);
    14271427  BuildInducedSubgraph_Finalize(ParentList);
    1428   Log() << Verbose(2) << "End of BuildInducedSubgraph." << endl;
     1428  DoLog(2) && (Log() << Verbose(2) << "End of BuildInducedSubgraph." << endl);
    14291429  return status;
    14301430}
     
    14431443  int size;
    14441444
    1445   Log() << Verbose(1) << "Begin of CheckForConnectedSubgraph" << endl;
    1446   Log() << Verbose(2) << "Disconnected atom: ";
     1445  DoLog(1) && (Log() << Verbose(1) << "Begin of CheckForConnectedSubgraph" << endl);
     1446  DoLog(2) && (Log() << Verbose(2) << "Disconnected atom: ");
    14471447
    14481448  // count number of atoms in graph
     
    14661466      }
    14671467      if (!BondStatus) {
    1468         Log() << Verbose(0) << (*Walker) << endl;
     1468        DoLog(0) && (Log() << Verbose(0) << (*Walker) << endl);
    14691469        return false;
    14701470      }
    14711471    }
    14721472  else {
    1473     Log() << Verbose(0) << "none." << endl;
     1473    DoLog(0) && (Log() << Verbose(0) << "none." << endl);
    14741474    return true;
    14751475  }
    1476   Log() << Verbose(0) << "none." << endl;
    1477 
    1478   Log() << Verbose(1) << "End of CheckForConnectedSubgraph" << endl;
     1476  DoLog(0) && (Log() << Verbose(0) << "none." << endl);
     1477
     1478  DoLog(1) && (Log() << Verbose(1) << "End of CheckForConnectedSubgraph" << endl);
    14791479
    14801480  return true;
  • src/moleculelist.cpp

    r6613ec ra67d19  
    3636MoleculeListClass::~MoleculeListClass()
    3737{
    38   Log() << Verbose(3) << this << ": Freeing ListOfMolcules." << endl;
     38  DoLog(3) && (Log() << Verbose(3) << this << ": Freeing ListOfMolcules." << endl);
    3939  for (MoleculeList::iterator ListRunner = ListOfMolecules.begin(); ListRunner != ListOfMolecules.end(); ListRunner++) {
    40     Log() << Verbose(4) << "ListOfMolecules: Freeing " << *ListRunner << "." << endl;
     40    DoLog(4) && (Log() << Verbose(4) << "ListOfMolecules: Freeing " << *ListRunner << "." << endl);
    4141    delete (*ListRunner);
    4242  }
    43   Log() << Verbose(4) << "Freeing ListOfMolecules." << endl;
     43  DoLog(4) && (Log() << Verbose(4) << "Freeing ListOfMolecules." << endl);
    4444  ListOfMolecules.clear(); // empty list
    4545};
     
    145145
    146146  // header
    147   Log() << Verbose(0) << "Index\tName\t\tAtoms\tFormula\tCenter\tSize" << endl;
    148   Log() << Verbose(0) << "-----------------------------------------------" << endl;
     147  DoLog(0) && (Log() << Verbose(0) << "Index\tName\t\tAtoms\tFormula\tCenter\tSize" << endl);
     148  DoLog(0) && (Log() << Verbose(0) << "-----------------------------------------------" << endl);
    149149  if (ListOfMolecules.size() == 0)
    150     Log() << Verbose(0) << "\tNone" << endl;
     150    DoLog(0) && (Log() << Verbose(0) << "\tNone" << endl);
    151151  else {
    152152    Origin.Zero();
     
    165165      }
    166166      // output Index, Name, number of atoms, chemical formula
    167       Log() << Verbose(0) << ((*ListRunner)->ActiveFlag ? "*" : " ") << (*ListRunner)->IndexNr << "\t" << (*ListRunner)->name << "\t\t" << (*ListRunner)->AtomCount << "\t";
     167      DoLog(0) && (Log() << Verbose(0) << ((*ListRunner)->ActiveFlag ? "*" : " ") << (*ListRunner)->IndexNr << "\t" << (*ListRunner)->name << "\t\t" << (*ListRunner)->AtomCount << "\t");
    168168      Elemental = (*ListRunner)->elemente->end;
    169169      while(Elemental->previous != (*ListRunner)->elemente->start) {
    170170        Elemental = Elemental->previous;
    171171        if (Counts[Elemental->Z] != 0)
    172           Log() << Verbose(0) << Elemental->symbol << Counts[Elemental->Z];
     172          DoLog(0) && (Log() << Verbose(0) << Elemental->symbol << Counts[Elemental->Z]);
    173173      }
    174174      // Center and size
    175       Log() << Verbose(0) << "\t" << (*ListRunner)->Center << "\t" << sqrt(size) << endl;
     175      DoLog(0) && (Log() << Verbose(0) << "\t" << (*ListRunner)->Center << "\t" << sqrt(size) << endl);
    176176    }
    177177  }
     
    339339  while (Walker->next != srcmol->end) {
    340340    Walker = Walker->next;
    341     Log() << Verbose(2) << "INFO: Current Walker is " << *Walker << "." << endl;
     341    DoLog(2) && (Log() << Verbose(2) << "INFO: Current Walker is " << *Walker << "." << endl);
    342342    if (!TesselStruct->IsInnerPoint(Walker->x, LCList)) {
    343343      CopyAtoms[Walker->nr] = new atom(Walker);
     
    348348    }
    349349  }
    350   Log() << Verbose(1) << nr << " of " << srcmol->AtomCount << " atoms have been merged.";
     350  DoLog(1) && (Log() << Verbose(1) << nr << " of " << srcmol->AtomCount << " atoms have been merged.");
    351351
    352352  // go through all bonds and add as well
     
    354354  while(Binder->next != srcmol->last) {
    355355    Binder = Binder->next;
    356     Log() << Verbose(3) << "Adding Bond between " << *CopyAtoms[Binder->leftatom->nr] << " and " << *CopyAtoms[Binder->rightatom->nr]<< "." << endl;
     356    DoLog(3) && (Log() << Verbose(3) << "Adding Bond between " << *CopyAtoms[Binder->leftatom->nr] << " and " << *CopyAtoms[Binder->rightatom->nr]<< "." << endl);
    357357    mol->AddBond(CopyAtoms[Binder->leftatom->nr], CopyAtoms[Binder->rightatom->nr], Binder->BondDegree);
    358358  }
     
    366366void MoleculeListClass::Output(ofstream *out)
    367367{
    368   Log() << Verbose(1) << "MoleculeList: ";
     368  DoLog(1) && (Log() << Verbose(1) << "MoleculeList: ");
    369369  for (MoleculeList::iterator ListRunner = ListOfMolecules.begin(); ListRunner != ListOfMolecules.end(); ListRunner++)
    370     Log() << Verbose(0) << *ListRunner << "\t";
    371   Log() << Verbose(0) << endl;
     370    DoLog(0) && (Log() << Verbose(0) << *ListRunner << "\t");
     371  DoLog(0) && (Log() << Verbose(0) << endl);
    372372};
    373373
     
    395395  char *FragmentNumber = NULL;
    396396
    397   Log() << Verbose(1) << "Saving hydrogen saturation correction ... ";
     397  DoLog(1) && (Log() << Verbose(1) << "Saving hydrogen saturation correction ... ");
    398398  // 0. parse in fit constant files that should have the same dimension as the final energy files
    399399  // 0a. find dimension of matrices with constants
     
    405405  input.open(line.c_str());
    406406  if (input == NULL) {
    407     Log() << Verbose(1) << endl << "Unable to open " << line << ", is the directory correct?" << endl;
     407    DoLog(1) && (Log() << Verbose(1) << endl << "Unable to open " << line << ", is the directory correct?" << endl);
    408408    return false;
    409409  }
     
    422422    b++;
    423423  }
    424   Log() << Verbose(0) << "I recognized " << a << " columns and " << b << " rows, ";
     424  DoLog(0) && (Log() << Verbose(0) << "I recognized " << a << " columns and " << b << " rows, ");
    425425  input.close();
    426426
     
    465465  }
    466466  for (int k = 0; k < 3; k++) {
    467     Log() << Verbose(0) << "Constants " << k << ":" << endl;
     467    DoLog(0) && (Log() << Verbose(0) << "Constants " << k << ":" << endl);
    468468    for (int j = 0; j < b; j++) {
    469469      for (int i = 0; i < a; i++) {
    470         Log() << Verbose(0) << FitConstant[k][i][j] << "\t";
     470        DoLog(0) && (Log() << Verbose(0) << FitConstant[k][i][j] << "\t");
    471471      }
    472       Log() << Verbose(0) << endl;
    473     }
    474     Log() << Verbose(0) << endl;
     472      DoLog(0) && (Log() << Verbose(0) << endl);
     473    }
     474    DoLog(0) && (Log() << Verbose(0) << endl);
    475475  }
    476476
     
    560560  }
    561561  Free(&FitConstant);
    562   Log() << Verbose(0) << "done." << endl;
     562  DoLog(0) && (Log() << Verbose(0) << "done." << endl);
    563563  return true;
    564564};
     
    580580
    581581  // open file for the force factors
    582   Log() << Verbose(1) << "Saving  force factors ... ";
     582  DoLog(1) && (Log() << Verbose(1) << "Saving  force factors ... ");
    583583  line << path << "/" << FRAGMENTPREFIX << FORCESFILE;
    584584  ForcesFile.open(line.str().c_str(), ios::out);
     
    608608    }
    609609    ForcesFile.close();
    610     Log() << Verbose(1) << "done." << endl;
     610    DoLog(1) && (Log() << Verbose(1) << "done." << endl);
    611611  } else {
    612612    status = false;
    613     Log() << Verbose(1) << "failed to open file " << line.str() << "." << endl;
     613    DoLog(1) && (Log() << Verbose(1) << "failed to open file " << line.str() << "." << endl);
    614614  }
    615615  ForcesFile.close();
     
    663663    sprintf(FragmentName, "%s/%s%s.conf.xyz", configuration->configpath, FRAGMENTPREFIX, FragmentNumber);
    664664    outputFragment.open(FragmentName, ios::out);
    665     Log() << Verbose(2) << "Saving bond fragment No. " << FragmentNumber << "/" << FragmentCounter - 1 << " as XYZ ...";
     665    DoLog(2) && (Log() << Verbose(2) << "Saving bond fragment No. " << FragmentNumber << "/" << FragmentCounter - 1 << " as XYZ ...");
    666666    if ((intermediateResult = (*ListRunner)->OutputXYZ(&outputFragment)))
    667       Log() << Verbose(0) << " done." << endl;
     667      DoLog(0) && (Log() << Verbose(0) << " done." << endl);
    668668    else
    669       Log() << Verbose(0) << " failed." << endl;
     669      DoLog(0) && (Log() << Verbose(0) << " failed." << endl);
    670670    result = result && intermediateResult;
    671671    outputFragment.close();
     
    673673
    674674    // list atoms in fragment for debugging
    675     Log() << Verbose(2) << "Contained atoms: ";
     675    DoLog(2) && (Log() << Verbose(2) << "Contained atoms: ");
    676676    Walker = (*ListRunner)->start;
    677677    while (Walker->next != (*ListRunner)->end) {
    678678      Walker = Walker->next;
    679       Log() << Verbose(0) << Walker->Name << " ";
    680     }
    681     Log() << Verbose(0) << endl;
     679      DoLog(0) && (Log() << Verbose(0) << Walker->Name << " ");
     680    }
     681    DoLog(0) && (Log() << Verbose(0) << endl);
    682682
    683683    // center on edge
     
    703703    // and save as config
    704704    sprintf(FragmentName, "%s/%s%s.conf", configuration->configpath, FRAGMENTPREFIX, FragmentNumber);
    705     Log() << Verbose(2) << "Saving bond fragment No. " << FragmentNumber << "/" << FragmentCounter - 1 << " as config ...";
     705    DoLog(2) && (Log() << Verbose(2) << "Saving bond fragment No. " << FragmentNumber << "/" << FragmentCounter - 1 << " as config ...");
    706706    if ((intermediateResult = configuration->Save(FragmentName, (*ListRunner)->elemente, (*ListRunner))))
    707       Log() << Verbose(0) << " done." << endl;
     707      DoLog(0) && (Log() << Verbose(0) << " done." << endl);
    708708    else
    709       Log() << Verbose(0) << " failed." << endl;
     709      DoLog(0) && (Log() << Verbose(0) << " failed." << endl);
    710710    result = result && intermediateResult;
    711711
     
    715715    // and save as mpqc input file
    716716    sprintf(FragmentName, "%s/%s%s.conf", configuration->configpath, FRAGMENTPREFIX, FragmentNumber);
    717     Log() << Verbose(2) << "Saving bond fragment No. " << FragmentNumber << "/" << FragmentCounter - 1 << " as mpqc input ...";
     717    DoLog(2) && (Log() << Verbose(2) << "Saving bond fragment No. " << FragmentNumber << "/" << FragmentCounter - 1 << " as mpqc input ...");
    718718    if ((intermediateResult = configuration->SaveMPQC(FragmentName, (*ListRunner))))
    719       Log() << Verbose(2) << " done." << endl;
     719      DoLog(2) && (Log() << Verbose(2) << " done." << endl);
    720720    else
    721       Log() << Verbose(0) << " failed." << endl;
     721      DoLog(0) && (Log() << Verbose(0) << " failed." << endl);
    722722
    723723    result = result && intermediateResult;
     
    726726    Free(&FragmentNumber);
    727727  }
    728   Log() << Verbose(0) << " done." << endl;
     728  DoLog(0) && (Log() << Verbose(0) << " done." << endl);
    729729
    730730  // printing final number
    731   Log() << Verbose(2) << "Final number of fragments: " << FragmentCounter << "." << endl;
     731  DoLog(2) && (Log() << Verbose(2) << "Final number of fragments: " << FragmentCounter << "." << endl);
    732732
    733733  // restore cell_size
     
    768768      Walker = Advancer;
    769769      Advancer = Advancer->next;
    770       Log() << Verbose(3) << "Re-linking " << *Walker << "..." << endl;
     770      DoLog(3) && (Log() << Verbose(3) << "Re-linking " << *Walker << "..." << endl);
    771771      unlink(Walker);
    772772      Walker->father = Walker;
     
    819819      strncat(molecules[i]->name, number, MAXSTRINGSIZE - strlen(mol->name) - 1);
    820820    }
    821     Log() << Verbose(1) << "MolName is " << molecules[i]->name << endl;
     821    DoLog(1) && (Log() << Verbose(1) << "MolName is " << molecules[i]->name << endl);
    822822    insert(molecules[i]);
    823823  }
     
    848848    FragmentCounter = MolMap[Walker->nr];
    849849    if (FragmentCounter != 0) {
    850       Log() << Verbose(3) << "Re-linking " << *Walker << "..." << endl;
     850      DoLog(3) && (Log() << Verbose(3) << "Re-linking " << *Walker << "..." << endl);
    851851      unlink(Walker);
    852852      molecules[FragmentCounter-1]->AddAtom(Walker);    // counting starts at 1
     
    873873  Free(&MolMap);
    874874  Free(&molecules);
    875   Log() << Verbose(1) << "I scanned " << FragmentCounter << " molecules." << endl;
     875  DoLog(1) && (Log() << Verbose(1) << "I scanned " << FragmentCounter << " molecules." << endl);
    876876};
    877877
     
    982982  int AtomNo;
    983983
    984   Log() << Verbose(1) << "Begin of FillBondStructureFromReference." << endl;
     984  DoLog(1) && (Log() << Verbose(1) << "Begin of FillBondStructureFromReference." << endl);
    985985  // fill ListOfLocalAtoms if NULL was given
    986986  if (!FillListOfLocalAtoms(ListOfLocalAtoms, FragmentCounter, reference->AtomCount, FreeList)) {
    987     Log() << Verbose(1) << "Filling of ListOfLocalAtoms failed." << endl;
     987    DoLog(1) && (Log() << Verbose(1) << "Filling of ListOfLocalAtoms failed." << endl);
    988988    return false;
    989989  }
    990990
    991991  if (status) {
    992     Log() << Verbose(1) << "Creating adjacency list for subgraph " << Leaf << "." << endl;
     992    DoLog(1) && (Log() << Verbose(1) << "Creating adjacency list for subgraph " << Leaf << "." << endl);
    993993    // remove every bond from the list
    994994    bond *Binder = NULL;
     
    10111011            Leaf->AddBond(Walker, OtherWalker, (*Runner)->BondDegree);
    10121012        } else {
    1013           Log() << Verbose(1) << "OtherWalker = ListOfLocalAtoms[" << FragmentCounter << "][" << (*Runner)->GetOtherAtom(Walker->GetTrueFather())->nr << "] is NULL!" << endl;
     1013          DoLog(1) && (Log() << Verbose(1) << "OtherWalker = ListOfLocalAtoms[" << FragmentCounter << "][" << (*Runner)->GetOtherAtom(Walker->GetTrueFather())->nr << "] is NULL!" << endl);
    10141014          status = false;
    10151015        }
     
    10241024      Free(&ListOfLocalAtoms);
    10251025  }
    1026   Log() << Verbose(1) << "End of FillBondStructureFromReference." << endl;
     1026  DoLog(1) && (Log() << Verbose(1) << "End of FillBondStructureFromReference." << endl);
    10271027  return status;
    10281028};
     
    10571057        next->FillRootStackForSubgraphs(RootStack, AtomMask, ++FragmentCounter);
    10581058    } else {
    1059       Log() << Verbose(1) << "Rootstack[" << FragmentCounter << "] is NULL." << endl;
     1059      DoLog(1) && (Log() << Verbose(1) << "Rootstack[" << FragmentCounter << "] is NULL." << endl);
    10601060      return false;
    10611061    }
     
    10631063    return true;
    10641064  } else {
    1065     Log() << Verbose(1) << "Rootstack is NULL." << endl;
     1065    DoLog(1) && (Log() << Verbose(1) << "Rootstack is NULL." << endl);
    10661066    return false;
    10671067  }
     
    11131113  int KeySetCounter = 0;
    11141114
    1115   Log() << Verbose(1) << "Begin of AssignKeySetsToFragment." << endl;
     1115  DoLog(1) && (Log() << Verbose(1) << "Begin of AssignKeySetsToFragment." << endl);
    11161116  // fill ListOfLocalAtoms if NULL was given
    11171117  if (!FillListOfLocalAtoms(ListOfLocalAtoms, FragmentCounter, reference->AtomCount, FreeList)) {
    1118     Log() << Verbose(1) << "Filling of ListOfLocalAtoms failed." << endl;
     1118    DoLog(1) && (Log() << Verbose(1) << "Filling of ListOfLocalAtoms failed." << endl);
    11191119    return false;
    11201120  }
     
    11441144    delete (TempSet);
    11451145    if (KeySetCounter == 0) {// if there are no keysets, delete the list
    1146       Log() << Verbose(1) << "KeySetCounter is zero, deleting FragmentList." << endl;
     1146      DoLog(1) && (Log() << Verbose(1) << "KeySetCounter is zero, deleting FragmentList." << endl);
    11471147      delete (FragmentList[FragmentCounter]);
    11481148    } else
    1149       Log() << Verbose(1) << KeySetCounter << " keysets were assigned to subgraph " << FragmentCounter << "." << endl;
     1149      DoLog(1) && (Log() << Verbose(1) << KeySetCounter << " keysets were assigned to subgraph " << FragmentCounter << "." << endl);
    11501150    FragmentCounter++;
    11511151    if (next != NULL)
     
    11531153    FragmentCounter--;
    11541154  } else
    1155     Log() << Verbose(1) << "KeySetList is NULL or empty." << endl;
     1155    DoLog(1) && (Log() << Verbose(1) << "KeySetList is NULL or empty." << endl);
    11561156
    11571157  if ((FreeList) && (ListOfLocalAtoms != NULL)) {
     
    11611161      Free(&ListOfLocalAtoms);
    11621162  }
    1163   Log() << Verbose(1) << "End of AssignKeySetsToFragment." << endl;
     1163  DoLog(1) && (Log() << Verbose(1) << "End of AssignKeySetsToFragment." << endl);
    11641164  return status;
    11651165};
     
    11741174void MoleculeLeafClass::TranslateIndicesToGlobalIDs(Graph **FragmentList, int &FragmentCounter, int &TotalNumberOfKeySets, Graph &TotalGraph)
    11751175{
    1176   Log() << Verbose(1) << "Begin of TranslateIndicesToGlobalIDs." << endl;
     1176  DoLog(1) && (Log() << Verbose(1) << "Begin of TranslateIndicesToGlobalIDs." << endl);
    11771177  KeySet *TempSet = new KeySet;
    11781178  if (FragmentList[FragmentCounter] != NULL) {
     
    11851185    delete (TempSet);
    11861186  } else {
    1187     Log() << Verbose(1) << "FragmentList is NULL." << endl;
     1187    DoLog(1) && (Log() << Verbose(1) << "FragmentList is NULL." << endl);
    11881188  }
    11891189  if (next != NULL)
    11901190    next->TranslateIndicesToGlobalIDs(FragmentList, ++FragmentCounter, TotalNumberOfKeySets, TotalGraph);
    11911191  FragmentCounter--;
    1192   Log() << Verbose(1) << "End of TranslateIndicesToGlobalIDs." << endl;
     1192  DoLog(1) && (Log() << Verbose(1) << "End of TranslateIndicesToGlobalIDs." << endl);
    11931193};
    11941194
  • src/parser.cpp

    r6613ec ra67d19  
    3232  if (input == NULL) {
    3333    if (!test)
    34       Log() << Verbose(0) << endl << "Unable to open " << filename << ", is the directory correct?" << endl;
     34      DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << filename << ", is the directory correct?" << endl);
    3535    return false;
    3636  }
     
    109109bool MatrixContainer::InitialiseIndices(class MatrixContainer *Matrix)
    110110{
    111   Log() << Verbose(0) << "Initialising indices";
     111  DoLog(0) && (Log() << Verbose(0) << "Initialising indices");
    112112  if (Matrix == NULL) {
    113     Log() << Verbose(0) << " with trivial mapping." << endl;
     113    DoLog(0) && (Log() << Verbose(0) << " with trivial mapping." << endl);
    114114    Indices = Malloc<int*>(MatrixCounter + 1, "MatrixContainer::InitialiseIndices: **Indices");
    115115    for(int i=MatrixCounter+1;i--;) {
     
    119119    }
    120120  } else {
    121     Log() << Verbose(0) << " from other MatrixContainer." << endl;
     121    DoLog(0) && (Log() << Verbose(0) << " from other MatrixContainer." << endl);
    122122    if (MatrixCounter != Matrix->MatrixCounter)
    123123      return false;
     
    269269  input.open(file.str().c_str(), ios::in);
    270270  if (input == NULL) {
    271     Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl;
     271    DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl);
    272272    return false;
    273273  }
     
    278278  }
    279279  input.close();
    280   Log() << Verbose(0) << "Determined " << MatrixCounter << " fragments." << endl;
    281 
    282   Log() << Verbose(0) << "Parsing through each fragment and retrieving " << prefix << suffix << "." << endl;
     280  DoLog(0) && (Log() << Verbose(0) << "Determined " << MatrixCounter << " fragments." << endl);
     281
     282  DoLog(0) && (Log() << Verbose(0) << "Parsing through each fragment and retrieving " << prefix << suffix << "." << endl);
    283283  Header = ReAlloc<char*>(Header, MatrixCounter + 1, "MatrixContainer::ParseFragmentMatrix: **Header"); // one more each for the total molecule
    284284  Matrix = ReAlloc<double**>(Matrix, MatrixCounter + 1, "MatrixContainer::ParseFragmentMatrix: ***Matrix"); // one more each for the total molecule
     
    469469  char *FragmentNumber = NULL;
    470470
    471   Log() << Verbose(0) << "Writing fragment files." << endl;
     471  DoLog(0) && (Log() << Verbose(0) << "Writing fragment files." << endl);
    472472  for(int i=0;i<MatrixCounter;i++) {
    473473    stringstream line;
     
    503503  stringstream line;
    504504
    505   Log() << Verbose(0) << "Writing matrix values of " << suffix << "." << endl;
     505  DoLog(0) && (Log() << Verbose(0) << "Writing matrix values of " << suffix << "." << endl);
    506506  line << name << prefix << suffix;
    507507  output.open(line.str().c_str(), ios::out);
     
    529529bool EnergyMatrix::ParseIndices()
    530530{
    531   Log() << Verbose(0) << "Parsing energy indices." << endl;
     531  DoLog(0) && (Log() << Verbose(0) << "Parsing energy indices." << endl);
    532532  Indices = Malloc<int*>(MatrixCounter + 1, "EnergyMatrix::ParseIndices: **Indices");
    533533  for(int i=MatrixCounter+1;i--;) {
     
    588588    }
    589589    // allocate last plus one matrix
    590     Log() << Verbose(0) << "Allocating last plus one matrix with " << (RowCounter[MatrixCounter]+1) << " rows and " << ColumnCounter[MatrixCounter] << " columns." << endl;
     590    DoLog(0) && (Log() << Verbose(0) << "Allocating last plus one matrix with " << (RowCounter[MatrixCounter]+1) << " rows and " << ColumnCounter[MatrixCounter] << " columns." << endl);
    591591    Matrix[MatrixCounter] = Malloc<double*>(RowCounter[MatrixCounter] + 1, "MatrixContainer::ParseFragmentMatrix: **Matrix[]");
    592592    for(int j=0;j<=RowCounter[MatrixCounter];j++)
     
    615615  stringstream line;
    616616
    617   Log() << Verbose(0) << "Parsing force indices for " << MatrixCounter << " matrices." << endl;
     617  DoLog(0) && (Log() << Verbose(0) << "Parsing force indices for " << MatrixCounter << " matrices." << endl);
    618618  Indices = Malloc<int*>(MatrixCounter + 1, "ForceMatrix::ParseIndices: **Indices");
    619619  line << name << FRAGMENTPREFIX << FORCESFILE;
     
    621621  //Log() << Verbose(0) << "Opening " << line.str() << " ... "  << input << endl;
    622622  if (input == NULL) {
    623     Log() << Verbose(0) << endl << "Unable to open " << line.str() << ", is the directory correct?" << endl;
     623    DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << line.str() << ", is the directory correct?" << endl);
    624624    return false;
    625625  }
     
    700700    input.open(file.str().c_str(), ios::in);
    701701    if (input == NULL) {
    702       Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl;
     702      DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl);
    703703      return false;
    704704    }
     
    724724 
    725725    // allocate last plus one matrix
    726     Log() << Verbose(0) << "Allocating last plus one matrix with " << (RowCounter[MatrixCounter]+1) << " rows and " << ColumnCounter[MatrixCounter] << " columns." << endl;
     726    DoLog(0) && (Log() << Verbose(0) << "Allocating last plus one matrix with " << (RowCounter[MatrixCounter]+1) << " rows and " << ColumnCounter[MatrixCounter] << " columns." << endl);
    727727    Matrix[MatrixCounter] = Malloc<double*>(RowCounter[MatrixCounter] + 1, "MatrixContainer::ParseFragmentMatrix: **Matrix[]");
    728728    for(int j=0;j<=RowCounter[MatrixCounter];j++)
     
    753753  stringstream line;
    754754 
    755   Log() << Verbose(0) << "Parsing hessian indices for " << MatrixCounter << " matrices." << endl;
     755  DoLog(0) && (Log() << Verbose(0) << "Parsing hessian indices for " << MatrixCounter << " matrices." << endl);
    756756  Indices = Malloc<int*>(MatrixCounter + 1, "HessianMatrix::ParseIndices: **Indices");
    757757  line << name << FRAGMENTPREFIX << FORCESFILE;
     
    759759  //Log() << Verbose(0) << "Opening " << line.str() << " ... "  << input << endl;
    760760  if (input == NULL) {
    761     Log() << Verbose(0) << endl << "Unable to open " << line.str() << ", is the directory correct?" << endl;
     761    DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << line.str() << ", is the directory correct?" << endl);
    762762    return false;
    763763  }
     
    930930    input.open(file.str().c_str(), ios::in);
    931931    if (input == NULL) {
    932       Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl;
     932      DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl);
    933933      return false;
    934934    }
     
    952952 
    953953    // allocate last plus one matrix
    954     Log() << Verbose(0) << "Allocating last plus one matrix with " << (RowCounter[MatrixCounter]+1) << " rows and " << ColumnCounter[MatrixCounter] << " columns." << endl;
     954    DoLog(0) && (Log() << Verbose(0) << "Allocating last plus one matrix with " << (RowCounter[MatrixCounter]+1) << " rows and " << ColumnCounter[MatrixCounter] << " columns." << endl);
    955955    Matrix[MatrixCounter] = Malloc<double*>(RowCounter[MatrixCounter] + 1, "MatrixContainer::ParseFragmentMatrix: **Matrix[]");
    956956    for(int j=0;j<=RowCounter[MatrixCounter];j++)
     
    10071007
    10081008  FragmentCounter = FCounter;
    1009   Log() << Verbose(0) << "Parsing key sets." << endl;
     1009  DoLog(0) && (Log() << Verbose(0) << "Parsing key sets." << endl);
    10101010  KeySets = Malloc<int*>(FragmentCounter, "KeySetsContainer::ParseKeySets: **KeySets");
    10111011  for(int i=FragmentCounter;i--;)
     
    10141014  input.open(file.str().c_str(), ios::in);
    10151015  if (input == NULL) {
    1016     Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl;
     1016    DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl);
    10171017    return false;
    10181018  }
     
    10481048  int Counter;
    10491049
    1050   Log() << Verbose(0) << "Creating Fragment terms." << endl;
     1050  DoLog(0) && (Log() << Verbose(0) << "Creating Fragment terms." << endl);
    10511051  // scan through all to determine maximum order
    10521052  Order=0;
     
    10591059      Order = Counter;
    10601060  }
    1061   Log() << Verbose(0) << "Found Order is " << Order << "." << endl;
     1061  DoLog(0) && (Log() << Verbose(0) << "Found Order is " << Order << "." << endl);
    10621062
    10631063  // scan through all to determine fragments per order
     
    10731073  }
    10741074  for(int i=0;i<Order;i++)
    1075     Log() << Verbose(0) << "Found No. of Fragments of Order " << i+1 << " is " << FragmentsPerOrder[i] << "." << endl;
     1075    DoLog(0) && (Log() << Verbose(0) << "Found No. of Fragments of Order " << i+1 << " is " << FragmentsPerOrder[i] << "." << endl);
    10761076
    10771077  // scan through all to gather indices to each order set
     
    10891089    FragmentsPerOrder[Counter-1]++;
    10901090  }
    1091   Log() << Verbose(0) << "Printing OrderSet." << endl;
     1091  DoLog(0) && (Log() << Verbose(0) << "Printing OrderSet." << endl);
    10921092  for(int i=0;i<Order;i++) {
    10931093    for (int j=0;j<FragmentsPerOrder[i];j++) {
    1094       Log() << Verbose(0) << " " << OrderSet[i][j];
    1095     }
    1096     Log() << Verbose(0) << endl;
    1097   }
    1098   Log() << Verbose(0) << endl;
     1094      DoLog(0) && (Log() << Verbose(0) << " " << OrderSet[i][j]);
     1095    }
     1096    DoLog(0) && (Log() << Verbose(0) << endl);
     1097  }
     1098  DoLog(0) && (Log() << Verbose(0) << endl);
    10991099
    11001100
  • src/periodentafel.cpp

    r6613ec ra67d19  
    4949  pointer->sort = &pointer->Z;
    5050  if (pointer->Z < 1 && pointer->Z >= MAX_ELEMENTS)
    51     Log() << Verbose(0) << "Invalid Z number!\n";
     51    DoLog(0) && (Log() << Verbose(0) << "Invalid Z number!\n");
    5252  return add(pointer, end);
    5353};
     
    104104  int Z;
    105105  do {
    106     Log() << Verbose(0) << "Atomic number Z: ";
     106    DoLog(0) && (Log() << Verbose(0) << "Atomic number Z: ");
    107107    cin >> Z;
    108108    walker = this->FindElement(Z);  // give type
     
    118118  element *walker = NULL;
    119119  int Z = -1;
    120   Log() << Verbose(0) << "Atomic number: " << Z << endl;
     120  DoLog(0) && (Log() << Verbose(0) << "Atomic number: " << Z << endl);
    121121  cin >> Z;
    122122  walker = FindElement(Z);
    123123  if (walker == NULL) {
    124     Log() << Verbose(0) << "Element not found in database, please enter." << endl;
     124    DoLog(0) && (Log() << Verbose(0) << "Element not found in database, please enter." << endl);
    125125    walker = new element;
    126126    walker->Z = Z;
    127     Log() << Verbose(0) << "Mass: " << endl;
     127    DoLog(0) && (Log() << Verbose(0) << "Mass: " << endl);
    128128    cin >> walker->mass;
    129     Log() << Verbose(0) << "Name [max 64 chars]: " << endl;
     129    DoLog(0) && (Log() << Verbose(0) << "Name [max 64 chars]: " << endl);
    130130    cin >> walker->name;
    131     Log() << Verbose(0) << "Short form [max 3 chars]: " << endl;
     131    DoLog(0) && (Log() << Verbose(0) << "Short form [max 3 chars]: " << endl);
    132132    cin >> walker->symbol;
    133133    periodentafel::AddElement(walker);
     
    198198    infile.getline(header1, MAXSTRINGSIZE);
    199199    infile.getline(header2, MAXSTRINGSIZE); // skip first two header lines
    200     Log() << Verbose(0) <<  "Parsed elements:";
     200    DoLog(0) && (Log() << Verbose(0) <<  "Parsed elements:");
    201201    while (!infile.eof()) {
    202202      element *neues = new element;
     
    220220      //infile >> ws;
    221221      infile >> ws;
    222       Log() << Verbose(0) << " " << neues->symbol;
     222      DoLog(0) && (Log() << Verbose(0) << " " << neues->symbol);
    223223      //neues->Output((ofstream *)&cout);
    224224      if ((neues->Z > 0) && (neues->Z < MAX_ELEMENTS))
    225225        periodentafel::AddElement(neues);
    226226      else {
    227         Log() << Verbose(0) << "Could not parse element: ";
     227        DoLog(0) && (Log() << Verbose(0) << "Could not parse element: ");
    228228        neues->Output((ofstream *)&cout);
    229229        delete(neues);
    230230      }
    231231    }
    232     Log() << Verbose(0) << endl;
     232    DoLog(0) && (Log() << Verbose(0) << endl);
    233233    infile.close();
    234234    infile.clear();
  • src/stackclass.hpp

    r6613ec ra67d19  
    130130{
    131131  bool found = false;
    132   Log() << Verbose(5) << "First " << CurrentFirstEntry<< "\tLast " << CurrentLastEntry<< "\tNext " << NextFreeField<< "\tCount " << EntryCount<< "." << endl;
     132  DoLog(5) && (Log() << Verbose(5) << "First " << CurrentFirstEntry<< "\tLast " << CurrentLastEntry<< "\tNext " << NextFreeField<< "\tCount " << EntryCount<< "." << endl);
    133133  int i=CurrentFirstEntry;
    134134  if (!IsEmpty())
    135135    do {
    136136      if (StackList[i] == ptr) {  // if item found, remove
    137         Log() << Verbose(5) << "Item " << *ptr << " was number " << i << " on stack, removing it." << endl;
     137        DoLog(5) && (Log() << Verbose(5) << "Item " << *ptr << " was number " << i << " on stack, removing it." << endl);
    138138        found = true;
    139139        StackList[i] = NULL;
     
    141141      if ((found) && (StackList[i] != NULL)) {  // means we have to shift (and not the removed item)
    142142        if (i == 0) { // we are down to first item in stack, have to put onto last item
    143           Log() << Verbose(5) << "Shifting item 0 to place " << EntryCount-1 << "." << endl;
     143          DoLog(5) && (Log() << Verbose(5) << "Shifting item 0 to place " << EntryCount-1 << "." << endl);
    144144          StackList[EntryCount-1] = StackList[0];
    145145        } else {
    146           Log() << Verbose(5) << "Shifting item " << i << " to place " << i-1 << "." << endl;
     146          DoLog(5) && (Log() << Verbose(5) << "Shifting item " << i << " to place " << i-1 << "." << endl);
    147147          StackList[i-1] = StackList[i];
    148148        }
  • src/tesselation.cpp

    r6613ec ra67d19  
    2828{
    2929  Info FunctionInfo(__func__);
    30   Log() << Verbose(1) << "Adding noname." << endl;
     30  DoLog(1) && (Log() << Verbose(1) << "Adding noname." << endl);
    3131}
    3232;
     
    3939{
    4040  Info FunctionInfo(__func__);
    41   Log() << Verbose(1) << "Adding Node " << *Walker << endl;
     41  DoLog(1) && (Log() << Verbose(1) << "Adding Node " << *Walker << endl);
    4242}
    4343;
     
    6363{
    6464  Info FunctionInfo(__func__);
    65   Log() << Verbose(1) << "Adding " << *this << " to line " << *line << "." << endl;
     65  DoLog(1) && (Log() << Verbose(1) << "Adding " << *this << " to line " << *line << "." << endl);
    6666  if (line->endpoints[0] == this) {
    6767    lines.insert(LinePair(line->endpoints[1]->Nr, line));
     
    115115  skipped = false;
    116116  // clear triangles list
    117   Log() << Verbose(0) << "New Line with endpoints " << *this << "." << endl;
     117  DoLog(0) && (Log() << Verbose(0) << "New Line with endpoints " << *this << "." << endl);
    118118}
    119119;
     
    138138  skipped = false;
    139139  // clear triangles list
    140   Log() << Verbose(0) << "New Line with endpoints " << *this << "." << endl;
     140  DoLog(0) && (Log() << Verbose(0) << "New Line with endpoints " << *this << "." << endl);
    141141}
    142142;
     
    196196{
    197197  Info FunctionInfo(__func__);
    198   Log() << Verbose(0) << "Add " << triangle->Nr << " to line " << *this << "." << endl;
     198  DoLog(0) && (Log() << Verbose(0) << "Add " << triangle->Nr << " to line " << *this << "." << endl);
    199199  triangles.insert(TrianglePair(triangle->Nr, triangle));
    200200}
     
    270270  //Log() << Verbose(0) << "INFO: BaselineNormal is " << BaseLineNormal << "." << endl;
    271271  if (NormalCheck.NormSquared() < MYEPSILON) {
    272     Log() << Verbose(0) << "ACCEPT: Normalvectors of both triangles are the same: convex." << endl;
     272    DoLog(0) && (Log() << Verbose(0) << "ACCEPT: Normalvectors of both triangles are the same: convex." << endl);
    273273    return true;
    274274  }
     
    276276  double angle = GetAngle(helper[0], helper[1], BaseLineNormal);
    277277  if ((angle - M_PI) > -MYEPSILON) {
    278     Log() << Verbose(0) << "ACCEPT: Angle is greater than pi: convex." << endl;
     278    DoLog(0) && (Log() << Verbose(0) << "ACCEPT: Angle is greater than pi: convex." << endl);
    279279    return true;
    280280  } else {
    281     Log() << Verbose(0) << "REJECT: Angle is less than pi: concave." << endl;
     281    DoLog(0) && (Log() << Verbose(0) << "REJECT: Angle is less than pi: concave." << endl);
    282282    return false;
    283283  }
     
    364364  // set endpoints
    365365  int Counter = 0;
    366   Log() << Verbose(0) << "New triangle " << Nr << " with end points: " << endl;
     366  DoLog(0) && (Log() << Verbose(0) << "New triangle " << Nr << " with end points: " << endl);
    367367  for (PointMap::iterator runner = OrderMap.begin(); runner != OrderMap.end(); runner++) {
    368368    endpoints[Counter] = runner->second;
    369     Log() << Verbose(0) << " " << *endpoints[Counter] << endl;
     369    DoLog(0) && (Log() << Verbose(0) << " " << *endpoints[Counter] << endl);
    370370    Counter++;
    371371  }
     
    413413  if (NormalVector.ScalarProduct(&OtherVector) > 0.)
    414414    NormalVector.Scale(-1.);
    415   Log() << Verbose(1) << "Normal Vector is " << NormalVector << "." << endl;
     415  DoLog(1) && (Log() << Verbose(1) << "Normal Vector is " << NormalVector << "." << endl);
    416416}
    417417;
     
    440440  }
    441441
    442   Log() << Verbose(1) << "INFO: Triangle is " << *this << "." << endl;
    443   Log() << Verbose(1) << "INFO: Line is from " << *MolCenter << " to " << *x << "." << endl;
    444   Log() << Verbose(1) << "INFO: Intersection is " << *Intersection << "." << endl;
     442  DoLog(1) && (Log() << Verbose(1) << "INFO: Triangle is " << *this << "." << endl);
     443  DoLog(1) && (Log() << Verbose(1) << "INFO: Line is from " << *MolCenter << " to " << *x << "." << endl);
     444  DoLog(1) && (Log() << Verbose(1) << "INFO: Intersection is " << *Intersection << "." << endl);
    445445
    446446  if (Intersection->DistanceSquared(endpoints[0]->node->node) < MYEPSILON) {
    447     Log() << Verbose(1) << "Intersection coindices with first endpoint." << endl;
     447    DoLog(1) && (Log() << Verbose(1) << "Intersection coindices with first endpoint." << endl);
    448448    return true;
    449449  } else if (Intersection->DistanceSquared(endpoints[1]->node->node) < MYEPSILON) {
    450     Log() << Verbose(1) << "Intersection coindices with second endpoint." << endl;
     450    DoLog(1) && (Log() << Verbose(1) << "Intersection coindices with second endpoint." << endl);
    451451    return true;
    452452  } else if (Intersection->DistanceSquared(endpoints[2]->node->node) < MYEPSILON) {
    453     Log() << Verbose(1) << "Intersection coindices with third endpoint." << endl;
     453    DoLog(1) && (Log() << Verbose(1) << "Intersection coindices with third endpoint." << endl);
    454454    return true;
    455455  }
     
    462462      CrossPoint.SubtractVector(endpoints[i % 3]->node->node); // cross point was returned as absolute vector
    463463      const double s = CrossPoint.ScalarProduct(&helper) / helper.NormSquared();
    464       Log() << Verbose(1) << "INFO: Factor s is " << s << "." << endl;
     464      DoLog(1) && (Log() << Verbose(1) << "INFO: Factor s is " << s << "." << endl);
    465465      if ((s < -MYEPSILON) || ((s - 1.) > MYEPSILON)) {
    466         Log() << Verbose(1) << "INFO: Crosspoint " << CrossPoint << "outside of triangle." << endl;
     466        DoLog(1) && (Log() << Verbose(1) << "INFO: Crosspoint " << CrossPoint << "outside of triangle." << endl);
    467467        i = 4;
    468468        break;
     
    473473  } while (i < 3);
    474474  if (i == 3) {
    475     Log() << Verbose(1) << "INFO: Crosspoint " << CrossPoint << " inside of triangle." << endl;
     475    DoLog(1) && (Log() << Verbose(1) << "INFO: Crosspoint " << CrossPoint << " inside of triangle." << endl);
    476476    return true;
    477477  } else {
    478     Log() << Verbose(1) << "INFO: Crosspoint " << CrossPoint << " outside of triangle." << endl;
     478    DoLog(1) && (Log() << Verbose(1) << "INFO: Crosspoint " << CrossPoint << " outside of triangle." << endl);
    479479    return false;
    480480  }
     
    500500
    501501  // 1. get intersection with plane
    502   Log() << Verbose(1) << "INFO: Looking for closest point of triangle " << *this << " to " << *x << "." << endl;
     502  DoLog(1) && (Log() << Verbose(1) << "INFO: Looking for closest point of triangle " << *this << " to " << *x << "." << endl);
    503503  GetCenter(&Direction);
    504504  if (!ClosestPoint->GetIntersectionWithPlane(&NormalVector, endpoints[0]->node->node, x, &Direction)) {
     
    513513  InPlane.AddVector(ClosestPoint);
    514514
    515   Log() << Verbose(2) << "INFO: Triangle is " << *this << "." << endl;
    516   Log() << Verbose(2) << "INFO: Line is from " << Direction << " to " << *x << "." << endl;
    517   Log() << Verbose(2) << "INFO: In-plane part is " << InPlane << "." << endl;
     515  DoLog(2) && (Log() << Verbose(2) << "INFO: Triangle is " << *this << "." << endl);
     516  DoLog(2) && (Log() << Verbose(2) << "INFO: Line is from " << Direction << " to " << *x << "." << endl);
     517  DoLog(2) && (Log() << Verbose(2) << "INFO: In-plane part is " << InPlane << "." << endl);
    518518
    519519  // Calculate cross point between one baseline and the desired point such that distance is shortest
     
    533533    CrossPoint[i].SubtractVector(endpoints[i % 3]->node->node); // cross point was returned as absolute vector
    534534    const double s = CrossPoint[i].ScalarProduct(&Direction) / Direction.NormSquared();
    535     Log() << Verbose(2) << "INFO: Factor s is " << s << "." << endl;
     535    DoLog(2) && (Log() << Verbose(2) << "INFO: Factor s is " << s << "." << endl);
    536536    if ((s >= -MYEPSILON) && ((s - 1.) <= MYEPSILON)) {
    537537      CrossPoint[i].AddVector(endpoints[i % 3]->node->node); // make cross point absolute again
    538       Log() << Verbose(2) << "INFO: Crosspoint is " << CrossPoint[i] << ", intersecting BoundaryLine between " << *endpoints[i % 3]->node->node << " and " << *endpoints[(i + 1) % 3]->node->node << "." << endl;
     538      DoLog(2) && (Log() << Verbose(2) << "INFO: Crosspoint is " << CrossPoint[i] << ", intersecting BoundaryLine between " << *endpoints[i % 3]->node->node << " and " << *endpoints[(i + 1) % 3]->node->node << "." << endl);
    539539      const double distance = CrossPoint[i].DistanceSquared(x);
    540540      if ((ShortestDistance < 0.) || (ShortestDistance > distance)) {
     
    565565    }
    566566  }
    567   Log() << Verbose(1) << "INFO: Closest Point is " << *ClosestPoint << " with shortest squared distance is " << ShortestDistance << "." << endl;
     567  DoLog(1) && (Log() << Verbose(1) << "INFO: Closest Point is " << *ClosestPoint << " with shortest squared distance is " << ShortestDistance << "." << endl);
    568568  return ShortestDistance;
    569569}
     
    619619{
    620620  Info FunctionInfo(__func__);
    621   Log() << Verbose(1) << "INFO: Checking " << Points[0] << "," << Points[1] << "," << Points[2] << " against " << endpoints[0] << "," << endpoints[1] << "," << endpoints[2] << "." << endl;
     621  DoLog(1) && (Log() << Verbose(1) << "INFO: Checking " << Points[0] << "," << Points[1] << "," << Points[2] << " against " << endpoints[0] << "," << endpoints[1] << "," << endpoints[2] << "." << endl);
    622622  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])
    623623
     
    668668    center->AddVector(endpoints[i]->node->node);
    669669  center->Scale(1. / 3.);
    670   Log() << Verbose(1) << "INFO: Center is at " << *center << "." << endl;
     670  DoLog(1) && (Log() << Verbose(1) << "INFO: Center is at " << *center << "." << endl);
    671671}
    672672
     
    703703  Info FunctionInfo(__func__);
    704704  endpoints.clear();
    705   Log() << Verbose(1) << "Erasing polygon Nr." << Nr << " itself." << endl;
     705  DoLog(1) && (Log() << Verbose(1) << "Erasing polygon Nr." << Nr << " itself." << endl);
    706706}
    707707;
     
    742742  if (TotalNormal->ScalarProduct(&OtherVector) > 0.)
    743743    TotalNormal->Scale(-1.);
    744   Log() << Verbose(1) << "Normal Vector is " << *TotalNormal << "." << endl;
     744  DoLog(1) && (Log() << Verbose(1) << "Normal Vector is " << *TotalNormal << "." << endl);
    745745
    746746  return TotalNormal;
     
    762762  }
    763763  center->Scale(1. / (double) counter);
    764   Log() << Verbose(1) << "Center is at " << *center << "." << endl;
     764  DoLog(1) && (Log() << Verbose(1) << "Center is at " << *center << "." << endl);
    765765}
    766766
     
    795795  Info FunctionInfo(__func__);
    796796  for (PointSet::const_iterator Runner = endpoints.begin(); Runner != endpoints.end(); Runner++) {
    797     Log() << Verbose(0) << "Checking against " << **Runner << endl;
     797    DoLog(0) && (Log() << Verbose(0) << "Checking against " << **Runner << endl);
    798798    if (point == (*Runner)) {
    799       Log() << Verbose(0) << " Contained." << endl;
     799      DoLog(0) && (Log() << Verbose(0) << " Contained." << endl);
    800800      return true;
    801801    }
    802802  }
    803   Log() << Verbose(0) << " Not contained." << endl;
     803  DoLog(0) && (Log() << Verbose(0) << " Not contained." << endl);
    804804  return false;
    805805}
     
    815815  for (PointSet::const_iterator Runner = endpoints.begin(); Runner != endpoints.end(); Runner++)
    816816    if (point == (*Runner)->node) {
    817       Log() << Verbose(0) << " Contained." << endl;
     817      DoLog(0) && (Log() << Verbose(0) << " Contained." << endl);
    818818      return true;
    819819    }
    820   Log() << Verbose(0) << " Not contained." << endl;
     820  DoLog(0) && (Log() << Verbose(0) << " Not contained." << endl);
    821821  return false;
    822822}
     
    832832  Info FunctionInfo(__func__);
    833833  int counter = 0;
    834   Log() << Verbose(1) << "Polygon is " << *this << endl;
     834  DoLog(1) && (Log() << Verbose(1) << "Polygon is " << *this << endl);
    835835  for (int i = 0; i < dim; i++) {
    836     Log() << Verbose(1) << " Testing endpoint " << *Points[i] << endl;
     836    DoLog(1) && (Log() << Verbose(1) << " Testing endpoint " << *Points[i] << endl);
    837837    if (ContainsBoundaryPoint(Points[i])) {
    838838      counter++;
     
    855855  Info FunctionInfo(__func__);
    856856  size_t counter = 0;
    857   Log() << Verbose(1) << "Polygon is " << *this << endl;
     857  DoLog(1) && (Log() << Verbose(1) << "Polygon is " << *this << endl);
    858858  for (PointSet::const_iterator Runner = endpoints.begin(); Runner != endpoints.end(); Runner++) {
    859     Log() << Verbose(1) << " Testing endpoint " << **Runner << endl;
     859    DoLog(1) && (Log() << Verbose(1) << " Testing endpoint " << **Runner << endl);
    860860    if (ContainsBoundaryPoint(*Runner))
    861861      counter++;
     
    895895          Tester = triangles->insert(Sprinter->second);
    896896          if (Tester.second)
    897             Log() << Verbose(0) << "Adding triangle " << *(Sprinter->second) << endl;
     897            DoLog(0) && (Log() << Verbose(0) << "Adding triangle " << *(Sprinter->second) << endl);
    898898        }
    899899      }
    900900
    901   Log() << Verbose(1) << "The Polygon of " << endpoints.size() << " endpoints has " << triangles->size() << " unique triangles in total." << endl;
     901  DoLog(1) && (Log() << Verbose(1) << "The Polygon of " << endpoints.size() << " endpoints has " << triangles->size() << " unique triangles in total." << endl);
    902902  return triangles;
    903903}
     
    914914  if (line == NULL)
    915915    return false;
    916   Log() << Verbose(1) << "Filling polygon from line " << *line << endl;
     916  DoLog(1) && (Log() << Verbose(1) << "Filling polygon from line " << *line << endl);
    917917  for (TriangleMap::const_iterator Runner = line->triangles.begin(); Runner != line->triangles.end(); Runner++) {
    918918    for (int i = 0; i < 3; i++) {
    919919      Tester = endpoints.insert((Runner->second)->endpoints[i]);
    920920      if (Tester.second)
    921         Log() << Verbose(1) << "  Inserting endpoint " << *((Runner->second)->endpoints[i]) << endl;
     921        DoLog(1) && (Log() << Verbose(1) << "  Inserting endpoint " << *((Runner->second)->endpoints[i]) << endl);
    922922    }
    923923  }
     
    10711071        return false;
    10721072      } else {
    1073         Log() << Verbose(1) << "Candidate " << *Walker << " is inside by " << distance << "." << endl;
     1073        DoLog(1) && (Log() << Verbose(1) << "Candidate " << *Walker << " is inside by " << distance << "." << endl);
    10741074      }
    10751075    }
     
    10821082    TesselPointList *ListofPoints = LC->GetPointsInsideSphere(RADIUS, (*VRunner));
    10831083
    1084     Log() << Verbose(1) << "The following atoms are inside sphere at " << OtherOptCenter << ":" << endl;
     1084    DoLog(1) && (Log() << Verbose(1) << "The following atoms are inside sphere at " << OtherOptCenter << ":" << endl);
    10851085    for (TesselPointList::const_iterator Runner = ListofPoints->begin(); Runner != ListofPoints->end(); ++Runner)
    1086       Log() << Verbose(1) << "  " << *(*Runner) << " with distance " << (*Runner)->node->Distance(&OtherOptCenter) << "." << endl;
     1086      DoLog(1) && (Log() << Verbose(1) << "  " << *(*Runner) << " with distance " << (*Runner)->node->Distance(&OtherOptCenter) << "." << endl);
    10871087
    10881088    // remove baseline's endpoints and candidates
    10891089    for (int i = 0; i < 2; i++) {
    1090       Log() << Verbose(1) << "INFO: removing baseline tesselpoint " << *BaseLine->endpoints[i]->node << "." << endl;
     1090      DoLog(1) && (Log() << Verbose(1) << "INFO: removing baseline tesselpoint " << *BaseLine->endpoints[i]->node << "." << endl);
    10911091      ListofPoints->remove(BaseLine->endpoints[i]->node);
    10921092    }
    10931093    for (TesselPointList::const_iterator Runner = pointlist.begin(); Runner != pointlist.end(); ++Runner) {
    1094       Log() << Verbose(1) << "INFO: removing candidate tesselpoint " << *(*Runner) << "." << endl;
     1094      DoLog(1) && (Log() << Verbose(1) << "INFO: removing candidate tesselpoint " << *(*Runner) << "." << endl);
    10951095      ListofPoints->remove(*Runner);
    10961096    }
     
    11061106    // check with animate_sphere.tcl VMD script
    11071107    if (ThirdPoint != NULL) {
    1108       Log() << Verbose(1) << "Check by: animate_sphere 0 " << BaseLine->endpoints[0]->Nr + 1 << " " << BaseLine->endpoints[1]->Nr + 1 << " " << ThirdPoint->Nr + 1 << " " << RADIUS << " " << OldCenter.x[0] << " " << OldCenter.x[1] << " " << OldCenter.x[2] << " " << (*VRunner)->x[0] << " " << (*VRunner)->x[1] << " " << (*VRunner)->x[2] << endl;
     1108      DoLog(1) && (Log() << Verbose(1) << "Check by: animate_sphere 0 " << BaseLine->endpoints[0]->Nr + 1 << " " << BaseLine->endpoints[1]->Nr + 1 << " " << ThirdPoint->Nr + 1 << " " << RADIUS << " " << OldCenter.x[0] << " " << OldCenter.x[1] << " " << OldCenter.x[2] << " " << (*VRunner)->x[0] << " " << (*VRunner)->x[1] << " " << (*VRunner)->x[2] << endl);
    11091109    } else {
    1110       Log() << Verbose(1) << "Check by: ... missing third point ..." << endl;
    1111       Log() << Verbose(1) << "Check by: animate_sphere 0 " << BaseLine->endpoints[0]->Nr + 1 << " " << BaseLine->endpoints[1]->Nr + 1 << " ??? " << RADIUS << " " << OldCenter.x[0] << " " << OldCenter.x[1] << " " << OldCenter.x[2] << " " << (*VRunner)->x[0] << " " << (*VRunner)->x[1] << " " << (*VRunner)->x[2] << endl;
     1110      DoLog(1) && (Log() << Verbose(1) << "Check by: ... missing third point ..." << endl);
     1111      DoLog(1) && (Log() << Verbose(1) << "Check by: animate_sphere 0 " << BaseLine->endpoints[0]->Nr + 1 << " " << BaseLine->endpoints[1]->Nr + 1 << " ??? " << RADIUS << " " << OldCenter.x[0] << " " << OldCenter.x[1] << " " << OldCenter.x[2] << " " << (*VRunner)->x[0] << " " << (*VRunner)->x[1] << " " << (*VRunner)->x[2] << endl);
    11121112    }
    11131113  }
     
    11571157{
    11581158  Info FunctionInfo(__func__);
    1159   Log() << Verbose(0) << "Free'ing TesselStruct ... " << endl;
     1159  DoLog(0) && (Log() << Verbose(0) << "Free'ing TesselStruct ... " << endl);
    11601160  for (TriangleMap::iterator runner = TrianglesOnBoundary.begin(); runner != TrianglesOnBoundary.end(); runner++) {
    11611161    if (runner->second != NULL) {
     
    11651165      DoeLog(1) && (eLog() << Verbose(1) << "The triangle " << runner->first << " has already been free'd." << endl);
    11661166  }
    1167   Log() << Verbose(0) << "This envelope was written to file " << TriangleFilesWritten << " times(s)." << endl;
     1167  DoLog(0) && (Log() << Verbose(0) << "This envelope was written to file " << TriangleFilesWritten << " times(s)." << endl);
    11681168}
    11691169;
     
    13191319    // 3. construct plane vector
    13201320    PlaneVector.MakeNormalVector(A->second->node->node, baseline->second.first->second->node->node, baseline->second.second->second->node->node);
    1321     Log() << Verbose(2) << "Plane vector of candidate triangle is " << PlaneVector << endl;
     1321    DoLog(2) && (Log() << Verbose(2) << "Plane vector of candidate triangle is " << PlaneVector << endl);
    13221322    // 4. loop over all points
    13231323    double sign = 0.;
     
    13331333      if (fabs(distance) < 1e-4) // we need to have a small epsilon around 0 which is still ok
    13341334        continue;
    1335       Log() << Verbose(2) << "Projection of " << checker->second->node->Name << " yields distance of " << distance << "." << endl;
     1335      DoLog(2) && (Log() << Verbose(2) << "Projection of " << checker->second->node->Name << " yields distance of " << distance << "." << endl);
    13361336      tmp = distance / fabs(distance);
    13371337      // 4b. Any have different sign to than before? (i.e. would lie outside convex hull with this starting triangle)
    13381338      if ((sign != 0) && (tmp != sign)) {
    13391339        // 4c. If so, break 4. loop and continue with next candidate in 1. loop
    1340         Log() << Verbose(2) << "Current candidates: " << A->second->node->Name << "," << baseline->second.first->second->node->Name << "," << baseline->second.second->second->node->Name << " leaves " << checker->second->node->Name << " outside the convex hull." << endl;
     1340        DoLog(2) && (Log() << Verbose(2) << "Current candidates: " << A->second->node->Name << "," << baseline->second.first->second->node->Name << "," << baseline->second.second->second->node->Name << " leaves " << checker->second->node->Name << " outside the convex hull." << endl);
    13411341        break;
    13421342      } else { // note the sign for later
    1343         Log() << Verbose(2) << "Current candidates: " << A->second->node->Name << "," << baseline->second.first->second->node->Name << "," << baseline->second.second->second->node->Name << " leave " << checker->second->node->Name << " inside the convex hull." << endl;
     1343        DoLog(2) && (Log() << Verbose(2) << "Current candidates: " << A->second->node->Name << "," << baseline->second.first->second->node->Name << "," << baseline->second.second->second->node->Name << " leave " << checker->second->node->Name << " inside the convex hull." << endl);
    13441344        sign = tmp;
    13451345      }
     
    13611361    // 5. come this far, all on same side? Then break 1. loop and construct triangle
    13621362    if (checker == PointsOnBoundary.end()) {
    1363       Log() << Verbose(2) << "Looks like we have a candidate!" << endl;
     1363      DoLog(2) && (Log() << Verbose(2) << "Looks like we have a candidate!" << endl);
    13641364      break;
    13651365    }
     
    13851385    }
    13861386
    1387     Log() << Verbose(1) << "Starting triangle is " << *BTS << "." << endl;
     1387    DoLog(1) && (Log() << Verbose(1) << "Starting triangle is " << *BTS << "." << endl);
    13881388  } else {
    13891389    DoeLog(0) && (eLog() << Verbose(0) << "No starting triangle found." << endl);
     
    14261426        // get peak point with respect to this base line's only triangle
    14271427        BTS = baseline->second->triangles.begin()->second; // there is only one triangle so far
    1428         Log() << Verbose(0) << "Current baseline is between " << *(baseline->second) << "." << endl;
     1428        DoLog(0) && (Log() << Verbose(0) << "Current baseline is between " << *(baseline->second) << "." << endl);
    14291429        for (int i = 0; i < 3; i++)
    14301430          if ((BTS->endpoints[i] != baseline->second->endpoints[0]) && (BTS->endpoints[i] != baseline->second->endpoints[1]))
    14311431            peak = BTS->endpoints[i];
    1432         Log() << Verbose(1) << " and has peak " << *peak << "." << endl;
     1432        DoLog(1) && (Log() << Verbose(1) << " and has peak " << *peak << "." << endl);
    14331433
    14341434        // prepare some auxiliary vectors
     
    14451445          CenterVector.AddVector(BTS->endpoints[i]->node->node);
    14461446        CenterVector.Scale(1. / 3.);
    1447         Log() << Verbose(2) << "CenterVector of base triangle is " << CenterVector << endl;
     1447        DoLog(2) && (Log() << Verbose(2) << "CenterVector of base triangle is " << CenterVector << endl);
    14481448
    14491449        // normal vector of triangle
     
    14521452        BTS->GetNormalVector(NormalVector);
    14531453        NormalVector.CopyVector(&BTS->NormalVector);
    1454         Log() << Verbose(2) << "NormalVector of base triangle is " << NormalVector << endl;
     1454        DoLog(2) && (Log() << Verbose(2) << "NormalVector of base triangle is " << NormalVector << endl);
    14551455
    14561456        // vector in propagation direction (out of triangle)
     
    14621462        if (PropagationVector.ScalarProduct(&TempVector) > 0) // make sure normal propagation vector points outward from baseline
    14631463          PropagationVector.Scale(-1.);
    1464         Log() << Verbose(2) << "PropagationVector of base triangle is " << PropagationVector << endl;
     1464        DoLog(2) && (Log() << Verbose(2) << "PropagationVector of base triangle is " << PropagationVector << endl);
    14651465        winner = PointsOnBoundary.end();
    14661466
     
    14681468        for (PointMap::iterator target = PointsOnBoundary.begin(); target != PointsOnBoundary.end(); target++) {
    14691469          if ((target->second != baseline->second->endpoints[0]) && (target->second != baseline->second->endpoints[1])) { // don't take the same endpoints
    1470             Log() << Verbose(1) << "Target point is " << *(target->second) << ":" << endl;
     1470            DoLog(1) && (Log() << Verbose(1) << "Target point is " << *(target->second) << ":" << endl);
    14711471
    14721472            // first check direction, so that triangles don't intersect
     
    14751475            VirtualNormalVector.ProjectOntoPlane(&NormalVector);
    14761476            TempAngle = VirtualNormalVector.Angle(&PropagationVector);
    1477             Log() << Verbose(2) << "VirtualNormalVector is " << VirtualNormalVector << " and PropagationVector is " << PropagationVector << "." << endl;
     1477            DoLog(2) && (Log() << Verbose(2) << "VirtualNormalVector is " << VirtualNormalVector << " and PropagationVector is " << PropagationVector << "." << endl);
    14781478            if (TempAngle > (M_PI / 2.)) { // no bends bigger than Pi/2 (90 degrees)
    1479               Log() << Verbose(2) << "Angle on triangle plane between propagation direction and base line to " << *(target->second) << " is " << TempAngle << ", bad direction!" << endl;
     1479              DoLog(2) && (Log() << Verbose(2) << "Angle on triangle plane between propagation direction and base line to " << *(target->second) << " is " << TempAngle << ", bad direction!" << endl);
    14801480              continue;
    14811481            } else
    1482               Log() << Verbose(2) << "Angle on triangle plane between propagation direction and base line to " << *(target->second) << " is " << TempAngle << ", good direction!" << endl;
     1482              DoLog(2) && (Log() << Verbose(2) << "Angle on triangle plane between propagation direction and base line to " << *(target->second) << " is " << TempAngle << ", good direction!" << endl);
    14831483
    14841484            // check first and second endpoint (if any connecting line goes to target has at least not more than 1 triangle)
     
    14861486            LineChecker[1] = baseline->second->endpoints[1]->lines.find(target->first);
    14871487            if (((LineChecker[0] != baseline->second->endpoints[0]->lines.end()) && (LineChecker[0]->second->triangles.size() == 2))) {
    1488               Log() << Verbose(2) << *(baseline->second->endpoints[0]) << " has line " << *(LineChecker[0]->second) << " to " << *(target->second) << " as endpoint with " << LineChecker[0]->second->triangles.size() << " triangles." << endl;
     1488              DoLog(2) && (Log() << Verbose(2) << *(baseline->second->endpoints[0]) << " has line " << *(LineChecker[0]->second) << " to " << *(target->second) << " as endpoint with " << LineChecker[0]->second->triangles.size() << " triangles." << endl);
    14891489              continue;
    14901490            }
    14911491            if (((LineChecker[1] != baseline->second->endpoints[1]->lines.end()) && (LineChecker[1]->second->triangles.size() == 2))) {
    1492               Log() << Verbose(2) << *(baseline->second->endpoints[1]) << " has line " << *(LineChecker[1]->second) << " to " << *(target->second) << " as endpoint with " << LineChecker[1]->second->triangles.size() << " triangles." << endl;
     1492              DoLog(2) && (Log() << Verbose(2) << *(baseline->second->endpoints[1]) << " has line " << *(LineChecker[1]->second) << " to " << *(target->second) << " as endpoint with " << LineChecker[1]->second->triangles.size() << " triangles." << endl);
    14931493              continue;
    14941494            }
     
    14961496            // check whether the envisaged triangle does not already exist (if both lines exist and have same endpoint)
    14971497            if ((((LineChecker[0] != baseline->second->endpoints[0]->lines.end()) && (LineChecker[1] != baseline->second->endpoints[1]->lines.end()) && (GetCommonEndpoint(LineChecker[0]->second, LineChecker[1]->second) == peak)))) {
    1498               Log() << Verbose(4) << "Current target is peak!" << endl;
     1498              DoLog(4) && (Log() << Verbose(4) << "Current target is peak!" << endl);
    14991499              continue;
    15001500            }
     
    15071507            helper.ProjectOntoPlane(&TempVector);
    15081508            if (fabs(helper.NormSquared()) < MYEPSILON) {
    1509               Log() << Verbose(2) << "Chosen set of vectors is linear dependent." << endl;
     1509              DoLog(2) && (Log() << Verbose(2) << "Chosen set of vectors is linear dependent." << endl);
    15101510              continue;
    15111511            }
     
    15241524            // calculate angle
    15251525            TempAngle = NormalVector.Angle(&VirtualNormalVector);
    1526             Log() << Verbose(2) << "NormalVector is " << VirtualNormalVector << " and the angle is " << TempAngle << "." << endl;
     1526            DoLog(2) && (Log() << Verbose(2) << "NormalVector is " << VirtualNormalVector << " and the angle is " << TempAngle << "." << endl);
    15271527            if ((SmallestAngle - TempAngle) > MYEPSILON) { // set to new possible winner
    15281528              SmallestAngle = TempAngle;
    15291529              winner = target;
    1530               Log() << Verbose(2) << "New winner " << *winner->second->node << " due to smaller angle between normal vectors." << endl;
     1530              DoLog(2) && (Log() << Verbose(2) << "New winner " << *winner->second->node << " due to smaller angle between normal vectors." << endl);
    15311531            } else if (fabs(SmallestAngle - TempAngle) < MYEPSILON) { // check the angle to propagation, both possible targets are in one plane! (their normals have same angle)
    15321532              // hence, check the angles to some normal direction from our base line but in this common plane of both targets...
     
    15461546                SmallestAngle = TempAngle;
    15471547                winner = target;
    1548                 Log() << Verbose(2) << "New winner " << *winner->second->node << " due to smaller angle " << TempAngle << " to propagation direction." << endl;
     1548                DoLog(2) && (Log() << Verbose(2) << "New winner " << *winner->second->node << " due to smaller angle " << TempAngle << " to propagation direction." << endl);
    15491549              } else
    1550                 Log() << Verbose(2) << "Keeping old winner " << *winner->second->node << " due to smaller angle to propagation direction." << endl;
     1550                DoLog(2) && (Log() << Verbose(2) << "Keeping old winner " << *winner->second->node << " due to smaller angle to propagation direction." << endl);
    15511551            } else
    1552               Log() << Verbose(2) << "Keeping old winner " << *winner->second->node << " due to smaller angle between normal vectors." << endl;
     1552              DoLog(2) && (Log() << Verbose(2) << "Keeping old winner " << *winner->second->node << " due to smaller angle between normal vectors." << endl);
    15531553          }
    15541554        } // end of loop over all boundary points
     
    15561556        // 5b. The point of the above whose triangle has the greatest angle with the triangle the current line belongs to (it only belongs to one, remember!): New triangle
    15571557        if (winner != PointsOnBoundary.end()) {
    1558           Log() << Verbose(0) << "Winning target point is " << *(winner->second) << " with angle " << SmallestAngle << "." << endl;
     1558          DoLog(0) && (Log() << Verbose(0) << "Winning target point is " << *(winner->second) << " with angle " << SmallestAngle << "." << endl);
    15591559          // create the lins of not yet present
    15601560          BLS[0] = baseline->second;
     
    15911591        // 5d. If the set of lines is not yet empty, go to 5. and continue
    15921592      } else
    1593         Log() << Verbose(0) << "Baseline candidate " << *(baseline->second) << " has a triangle count of " << baseline->second->triangles.size() << "." << endl;
     1593        DoLog(0) && (Log() << Verbose(0) << "Baseline candidate " << *(baseline->second) << " has a triangle count of " << baseline->second->triangles.size() << "." << endl);
    15941594  } while (flag);
    15951595
     
    16241624    }
    16251625    Walker = cloud->GetPoint();
    1626     Log() << Verbose(0) << "Current point is " << *Walker << "." << endl;
     1626    DoLog(0) && (Log() << Verbose(0) << "Current point is " << *Walker << "." << endl);
    16271627    // get the next triangle
    16281628    triangles = FindClosestTrianglesToVector(Walker->node, BoundaryPoints);
    16291629    BTS = triangles->front();
    16301630    if ((triangles == NULL) || (BTS->ContainsBoundaryPoint(Walker))) {
    1631       Log() << Verbose(0) << "No triangles found, probably a tesselation point itself." << endl;
     1631      DoLog(0) && (Log() << Verbose(0) << "No triangles found, probably a tesselation point itself." << endl);
    16321632      cloud->GoToNext();
    16331633      continue;
    16341634    } else {
    16351635    }
    1636     Log() << Verbose(0) << "Closest triangle is " << *BTS << "." << endl;
     1636    DoLog(0) && (Log() << Verbose(0) << "Closest triangle is " << *BTS << "." << endl);
    16371637    // get the intersection point
    16381638    if (BTS->GetIntersectionInsideTriangle(Center, Walker->node, &Intersection)) {
    1639       Log() << Verbose(0) << "We have an intersection at " << Intersection << "." << endl;
     1639      DoLog(0) && (Log() << Verbose(0) << "We have an intersection at " << Intersection << "." << endl);
    16401640      // we have the intersection, check whether in- or outside of boundary
    16411641      if ((Center->DistanceSquared(Walker->node) - Center->DistanceSquared(&Intersection)) < -MYEPSILON) {
    16421642        // inside, next!
    1643         Log() << Verbose(0) << *Walker << " is inside wrt triangle " << *BTS << "." << endl;
     1643        DoLog(0) && (Log() << Verbose(0) << *Walker << " is inside wrt triangle " << *BTS << "." << endl);
    16441644      } else {
    16451645        // outside!
    1646         Log() << Verbose(0) << *Walker << " is outside wrt triangle " << *BTS << "." << endl;
     1646        DoLog(0) && (Log() << Verbose(0) << *Walker << " is outside wrt triangle " << *BTS << "." << endl);
    16471647        class BoundaryLineSet *OldLines[3], *NewLines[3];
    16481648        class BoundaryPointSet *OldPoints[3], *NewPoint;
     
    16541654        Normal.CopyVector(&BTS->NormalVector);
    16551655        // add Walker to boundary points
    1656         Log() << Verbose(0) << "Adding " << *Walker << " to BoundaryPoints." << endl;
     1656        DoLog(0) && (Log() << Verbose(0) << "Adding " << *Walker << " to BoundaryPoints." << endl);
    16571657        AddFlag = true;
    16581658        if (AddBoundaryPoint(Walker, 0))
     
    16611661          continue;
    16621662        // remove triangle
    1663         Log() << Verbose(0) << "Erasing triangle " << *BTS << "." << endl;
     1663        DoLog(0) && (Log() << Verbose(0) << "Erasing triangle " << *BTS << "." << endl);
    16641664        TrianglesOnBoundary.erase(BTS->Nr);
    16651665        delete (BTS);
     
    16691669          BPS[1] = OldPoints[i];
    16701670          NewLines[i] = new class BoundaryLineSet(BPS, LinesOnBoundaryCount);
    1671           Log() << Verbose(1) << "Creating new line " << *NewLines[i] << "." << endl;
     1671          DoLog(1) && (Log() << Verbose(1) << "Creating new line " << *NewLines[i] << "." << endl);
    16721672          LinesOnBoundary.insert(LinePair(LinesOnBoundaryCount, NewLines[i])); // no need for check for unique insertion as BPS[0] is definitely a new one
    16731673          LinesOnBoundaryCount++;
     
    16911691          BTS->GetNormalVector(Normal);
    16921692          Normal.Scale(-1.);
    1693           Log() << Verbose(0) << "Created new triangle " << *BTS << "." << endl;
     1693          DoLog(0) && (Log() << Verbose(0) << "Created new triangle " << *BTS << "." << endl);
    16941694          TrianglesOnBoundary.insert(TrianglePair(TrianglesOnBoundaryCount, BTS));
    16951695          TrianglesOnBoundaryCount++;
     
    17461746  } else {
    17471747    delete TPS[n];
    1748     Log() << Verbose(0) << "Node " << *((InsertUnique.first)->second->node) << " is already present in PointsOnBoundary." << endl;
     1748    DoLog(0) && (Log() << Verbose(0) << "Node " << *((InsertUnique.first)->second->node) << " is already present in PointsOnBoundary." << endl);
    17491749    TPS[n] = (InsertUnique.first)->second;
    17501750  }
     
    17831783  BoundaryLineSet *WinningLine = NULL;
    17841784  if (FindLine != a->lines.end()) {
    1785     Log() << Verbose(1) << "INFO: There is at least one line between " << *a << " and " << *b << ": " << *(FindLine->second) << "." << endl;
     1785    DoLog(1) && (Log() << Verbose(1) << "INFO: There is at least one line between " << *a << " and " << *b << ": " << *(FindLine->second) << "." << endl);
    17861786
    17871787    pair<LineMap::iterator, LineMap::iterator> FindPair;
     
    17891789
    17901790    for (FindLine = FindPair.first; (FindLine != FindPair.second) && (insertNewLine); FindLine++) {
    1791       Log() << Verbose(1) << "INFO: Checking line " << *(FindLine->second) << " ..." << endl;
     1791      DoLog(1) && (Log() << Verbose(1) << "INFO: Checking line " << *(FindLine->second) << " ..." << endl);
    17921792      // If there is a line with less than two attached triangles, we don't need a new line.
    17931793      if (FindLine->second->triangles.size() == 1) {
    17941794        CandidateMap::iterator Finder = OpenLines.find(FindLine->second);
    17951795        if (!Finder->second->pointlist.empty())
    1796           Log() << Verbose(1) << "INFO: line " << *(FindLine->second) << " is open with candidate " << **(Finder->second->pointlist.begin()) << "." << endl;
     1796          DoLog(1) && (Log() << Verbose(1) << "INFO: line " << *(FindLine->second) << " is open with candidate " << **(Finder->second->pointlist.begin()) << "." << endl);
    17971797        else
    1798           Log() << Verbose(1) << "INFO: line " << *(FindLine->second) << " is open with no candidate." << endl;
     1798          DoLog(1) && (Log() << Verbose(1) << "INFO: line " << *(FindLine->second) << " is open with no candidate." << endl);
    17991799        // get open line
    18001800        for (TesselPointList::const_iterator CandidateChecker = Finder->second->pointlist.begin(); CandidateChecker != Finder->second->pointlist.end(); ++CandidateChecker) {
     
    18281828{
    18291829  Info FunctionInfo(__func__);
    1830   Log() << Verbose(0) << "Adding open line [" << LinesOnBoundaryCount << "|" << *(a->node) << " and " << *(b->node) << "." << endl;
     1830  DoLog(0) && (Log() << Verbose(0) << "Adding open line [" << LinesOnBoundaryCount << "|" << *(a->node) << " and " << *(b->node) << "." << endl);
    18311831  BPS[0] = a;
    18321832  BPS[1] = b;
     
    18501850{
    18511851  Info FunctionInfo(__func__);
    1852   Log() << Verbose(0) << "Using existing line " << *Line << endl;
     1852  DoLog(0) && (Log() << Verbose(0) << "Using existing line " << *Line << endl);
    18531853
    18541854  // set endpoints and line
     
    18591859  CandidateMap::iterator CandidateLine = OpenLines.find(BLS[n]);
    18601860  if (CandidateLine != OpenLines.end()) {
    1861     Log() << Verbose(1) << " Removing line from OpenLines." << endl;
     1861    DoLog(1) && (Log() << Verbose(1) << " Removing line from OpenLines." << endl);
    18621862    delete (CandidateLine->second);
    18631863    OpenLines.erase(CandidateLine);
     
    18741874{
    18751875  Info FunctionInfo(__func__);
    1876   Log() << Verbose(1) << "Adding triangle to global TrianglesOnBoundary map." << endl;
     1876  DoLog(1) && (Log() << Verbose(1) << "Adding triangle to global TrianglesOnBoundary map." << endl);
    18771877
    18781878  // add triangle to global map
     
    18941894{
    18951895  Info FunctionInfo(__func__);
    1896   Log() << Verbose(0) << "Adding triangle to global TrianglesOnBoundary map." << endl;
     1896  DoLog(0) && (Log() << Verbose(0) << "Adding triangle to global TrianglesOnBoundary map." << endl);
    18971897
    18981898  // add triangle to global map
     
    19181918  for (int i = 0; i < 3; i++) {
    19191919    if (triangle->lines[i] != NULL) {
    1920       Log() << Verbose(0) << "Removing triangle Nr." << triangle->Nr << " in line " << *triangle->lines[i] << "." << endl;
     1920      DoLog(0) && (Log() << Verbose(0) << "Removing triangle Nr." << triangle->Nr << " in line " << *triangle->lines[i] << "." << endl);
    19211921      triangle->lines[i]->triangles.erase(triangle->Nr);
    19221922      if (triangle->lines[i]->triangles.empty()) {
    1923         Log() << Verbose(0) << *triangle->lines[i] << " is no more attached to any triangle, erasing." << endl;
     1923        DoLog(0) && (Log() << Verbose(0) << *triangle->lines[i] << " is no more attached to any triangle, erasing." << endl);
    19241924        RemoveTesselationLine(triangle->lines[i]);
    19251925      } else {
    1926         Log() << Verbose(0) << *triangle->lines[i] << " is still attached to another triangle: ";
     1926        DoLog(0) && (Log() << Verbose(0) << *triangle->lines[i] << " is still attached to another triangle: ");
    19271927        OpenLines.insert(pair<BoundaryLineSet *, CandidateForTesselation *> (triangle->lines[i], NULL));
    19281928        for (TriangleMap::iterator TriangleRunner = triangle->lines[i]->triangles.begin(); TriangleRunner != triangle->lines[i]->triangles.end(); TriangleRunner++)
    1929           Log() << Verbose(0) << "[" << (TriangleRunner->second)->Nr << "|" << *((TriangleRunner->second)->endpoints[0]) << ", " << *((TriangleRunner->second)->endpoints[1]) << ", " << *((TriangleRunner->second)->endpoints[2]) << "] \t";
    1930         Log() << Verbose(0) << endl;
     1929          DoLog(0) && (Log() << Verbose(0) << "[" << (TriangleRunner->second)->Nr << "|" << *((TriangleRunner->second)->endpoints[0]) << ", " << *((TriangleRunner->second)->endpoints[1]) << ", " << *((TriangleRunner->second)->endpoints[2]) << "] \t");
     1930        DoLog(0) && (Log() << Verbose(0) << endl);
    19311931        //        for (int j=0;j<2;j++) {
    19321932        //          Log() << Verbose(0) << "Lines of endpoint " << *(triangle->lines[i]->endpoints[j]) << ": ";
     
    19421942
    19431943  if (TrianglesOnBoundary.erase(triangle->Nr))
    1944     Log() << Verbose(0) << "Removing triangle Nr. " << triangle->Nr << "." << endl;
     1944    DoLog(0) && (Log() << Verbose(0) << "Removing triangle Nr. " << triangle->Nr << "." << endl);
    19451945  delete (triangle);
    19461946}
     
    19741974        for (LineMap::iterator Runner = erasor.first; Runner != erasor.second; Runner++)
    19751975          if ((*Runner).second == line) {
    1976             Log() << Verbose(0) << "Removing Line Nr. " << line->Nr << " in boundary point " << *line->endpoints[i] << "." << endl;
     1976            DoLog(0) && (Log() << Verbose(0) << "Removing Line Nr. " << line->Nr << " in boundary point " << *line->endpoints[i] << "." << endl);
    19771977            line->endpoints[i]->lines.erase(Runner);
    19781978            break;
     
    19801980      } else { // there's just a single line left
    19811981        if (line->endpoints[i]->lines.erase(line->Nr))
    1982           Log() << Verbose(0) << "Removing Line Nr. " << line->Nr << " in boundary point " << *line->endpoints[i] << "." << endl;
     1982          DoLog(0) && (Log() << Verbose(0) << "Removing Line Nr. " << line->Nr << " in boundary point " << *line->endpoints[i] << "." << endl);
    19831983      }
    19841984      if (line->endpoints[i]->lines.empty()) {
    1985         Log() << Verbose(0) << *line->endpoints[i] << " has no more lines it's attached to, erasing." << endl;
     1985        DoLog(0) && (Log() << Verbose(0) << *line->endpoints[i] << " has no more lines it's attached to, erasing." << endl);
    19861986        RemoveTesselationPoint(line->endpoints[i]);
    19871987      } else {
    1988         Log() << Verbose(0) << *line->endpoints[i] << " has still lines it's attached to: ";
     1988        DoLog(0) && (Log() << Verbose(0) << *line->endpoints[i] << " has still lines it's attached to: ");
    19891989        for (LineMap::iterator LineRunner = line->endpoints[i]->lines.begin(); LineRunner != line->endpoints[i]->lines.end(); LineRunner++)
    1990           Log() << Verbose(0) << "[" << *(LineRunner->second) << "] \t";
    1991         Log() << Verbose(0) << endl;
     1990          DoLog(0) && (Log() << Verbose(0) << "[" << *(LineRunner->second) << "] \t");
     1991        DoLog(0) && (Log() << Verbose(0) << endl);
    19921992      }
    19931993      line->endpoints[i] = NULL; // free'd or not: disconnect
     
    19991999
    20002000  if (LinesOnBoundary.erase(line->Nr))
    2001     Log() << Verbose(0) << "Removing line Nr. " << line->Nr << "." << endl;
     2001    DoLog(0) && (Log() << Verbose(0) << "Removing line Nr. " << line->Nr << "." << endl);
    20022002  delete (line);
    20032003}
     
    20152015    return;
    20162016  if (PointsOnBoundary.erase(point->Nr))
    2017     Log() << Verbose(0) << "Removing point Nr. " << point->Nr << "." << endl;
     2017    DoLog(0) && (Log() << Verbose(0) << "Removing point Nr. " << point->Nr << "." << endl);
    20182018  delete (point);
    20192019}
     
    20352035  bool flag = true;
    20362036
    2037   Log() << Verbose(1) << "Check by: draw sphere {" << CandidateLine.OtherOptCenter.x[0] << " " << CandidateLine.OtherOptCenter.x[1] << " " << CandidateLine.OtherOptCenter.x[2] << "} radius " << RADIUS << " resolution 30" << endl;
     2037  DoLog(1) && (Log() << Verbose(1) << "Check by: draw sphere {" << CandidateLine.OtherOptCenter.x[0] << " " << CandidateLine.OtherOptCenter.x[1] << " " << CandidateLine.OtherOptCenter.x[2] << "} radius " << RADIUS << " resolution 30" << endl);
    20382038  // get all points inside the sphere
    20392039  TesselPointList *ListofPoints = LC->GetPointsInsideSphere(RADIUS, &CandidateLine.OtherOptCenter);
    20402040
    2041   Log() << Verbose(1) << "The following atoms are inside sphere at " << CandidateLine.OtherOptCenter << ":" << endl;
     2041  DoLog(1) && (Log() << Verbose(1) << "The following atoms are inside sphere at " << CandidateLine.OtherOptCenter << ":" << endl);
    20422042  for (TesselPointList::const_iterator Runner = ListofPoints->begin(); Runner != ListofPoints->end(); ++Runner)
    2043     Log() << Verbose(1) << "  " << *(*Runner) << " with distance " << (*Runner)->node->Distance(&CandidateLine.OtherOptCenter) << "." << endl;
     2043    DoLog(1) && (Log() << Verbose(1) << "  " << *(*Runner) << " with distance " << (*Runner)->node->Distance(&CandidateLine.OtherOptCenter) << "." << endl);
    20442044
    20452045  // remove triangles's endpoints
     
    20532053  // check for other points
    20542054  if (!ListofPoints->empty()) {
    2055     Log() << Verbose(1) << "CheckDegeneracy: There are still " << ListofPoints->size() << " points inside the sphere." << endl;
     2055    DoLog(1) && (Log() << Verbose(1) << "CheckDegeneracy: There are still " << ListofPoints->size() << " points inside the sphere." << endl);
    20562056    flag = false;
    2057     Log() << Verbose(1) << "External atoms inside of sphere at " << CandidateLine.OtherOptCenter << ":" << endl;
     2057    DoLog(1) && (Log() << Verbose(1) << "External atoms inside of sphere at " << CandidateLine.OtherOptCenter << ":" << endl);
    20582058    for (TesselPointList::const_iterator Runner = ListofPoints->begin(); Runner != ListofPoints->end(); ++Runner)
    2059       Log() << Verbose(1) << "  " << *(*Runner) << " with distance " << (*Runner)->node->Distance(&CandidateLine.OtherOptCenter) << "." << endl;
     2059      DoLog(1) && (Log() << Verbose(1) << "  " << *(*Runner) << " with distance " << (*Runner)->node->Distance(&CandidateLine.OtherOptCenter) << "." << endl);
    20602060  }
    20612061  delete (ListofPoints);
     
    20982098          for (; (FindLine != Points[i]->lines.end()) && (FindLine->first == Points[j]->node->nr); FindLine++) {
    20992099            TriangleMap *triangles = &FindLine->second->triangles;
    2100             Log() << Verbose(1) << "Current line is " << FindLine->first << ": " << *(FindLine->second) << " with triangles " << triangles << "." << endl;
     2100            DoLog(1) && (Log() << Verbose(1) << "Current line is " << FindLine->first << ": " << *(FindLine->second) << " with triangles " << triangles << "." << endl);
    21012101            for (TriangleMap::const_iterator FindTriangle = triangles->begin(); FindTriangle != triangles->end(); FindTriangle++) {
    21022102              if (FindTriangle->second->IsPresentTupel(Points)) {
     
    21042104              }
    21052105            }
    2106             Log() << Verbose(1) << "end." << endl;
     2106            DoLog(1) && (Log() << Verbose(1) << "end." << endl);
    21072107          }
    21082108          // Only one of the triangle lines must be considered for the triangle count.
     
    21142114  }
    21152115
    2116   Log() << Verbose(0) << "Found " << adjacentTriangleCount << " adjacent triangles for the point set." << endl;
     2116  DoLog(0) && (Log() << Verbose(0) << "Found " << adjacentTriangleCount << " adjacent triangles for the point set." << endl);
    21172117  return adjacentTriangleCount;
    21182118}
     
    22112211          for (LinkedCell::LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
    22122212            if ((*Runner)->node->x[i] > maxCoordinate[i]) {
    2213               Log() << Verbose(1) << "New maximal for axis " << i << " node is " << *(*Runner) << " at " << *(*Runner)->node << "." << endl;
     2213              DoLog(1) && (Log() << Verbose(1) << "New maximal for axis " << i << " node is " << *(*Runner) << " at " << *(*Runner)->node << "." << endl);
    22142214              maxCoordinate[i] = (*Runner)->node->x[i];
    22152215              MaxPoint[i] = (*Runner);
     
    22222222  }
    22232223
    2224   Log() << Verbose(1) << "Found maximum coordinates: ";
     2224  DoLog(1) && (Log() << Verbose(1) << "Found maximum coordinates: ");
    22252225  for (int i = 0; i < NDIM; i++)
    2226     Log() << Verbose(0) << i << ": " << *MaxPoint[i] << "\t";
    2227   Log() << Verbose(0) << endl;
     2226    DoLog(0) && (Log() << Verbose(0) << i << ": " << *MaxPoint[i] << "\t");
     2227  DoLog(0) && (Log() << Verbose(0) << endl);
    22282228
    22292229  BTS = NULL;
     
    22332233    BaseLine = new BoundaryLineSet();
    22342234    BaseLine->endpoints[0] = new BoundaryPointSet(MaxPoint[k]);
    2235     Log() << Verbose(0) << "Coordinates of start node at " << *BaseLine->endpoints[0]->node << "." << endl;
     2235    DoLog(0) && (Log() << Verbose(0) << "Coordinates of start node at " << *BaseLine->endpoints[0]->node << "." << endl);
    22362236
    22372237    double ShortestAngle;
     
    22712271
    22722272    // adding point 1 and point 2 and add the line between them
    2273     Log() << Verbose(0) << "Coordinates of start node at " << *BaseLine->endpoints[0]->node << "." << endl;
    2274     Log() << Verbose(0) << "Found second point is at " << *BaseLine->endpoints[1]->node << ".\n";
     2273    DoLog(0) && (Log() << Verbose(0) << "Coordinates of start node at " << *BaseLine->endpoints[0]->node << "." << endl);
     2274    DoLog(0) && (Log() << Verbose(0) << "Found second point is at " << *BaseLine->endpoints[1]->node << ".\n");
    22752275
    22762276    //Log() << Verbose(1) << "INFO: OldSphereCenter is at " << helper << ".\n";
    22772277    CandidateForTesselation OptCandidates(BaseLine);
    22782278    FindThirdPointForTesselation(NormalVector, SearchDirection, SphereCenter, OptCandidates, NULL, RADIUS, LC);
    2279     Log() << Verbose(0) << "List of third Points is:" << endl;
     2279    DoLog(0) && (Log() << Verbose(0) << "List of third Points is:" << endl);
    22802280    for (TesselPointList::iterator it = OptCandidates.pointlist.begin(); it != OptCandidates.pointlist.end(); it++) {
    2281       Log() << Verbose(0) << " " << *(*it) << endl;
     2281      DoLog(0) && (Log() << Verbose(0) << " " << *(*it) << endl);
    22822282    }
    22832283    if (!OptCandidates.pointlist.empty()) {
     
    24652465      break;
    24662466    }
    2467   Log() << Verbose(0) << "Current baseline is " << *CandidateLine.BaseLine << " with ThirdPoint " << *ThirdPoint << " of triangle " << T << "." << endl;
     2467  DoLog(0) && (Log() << Verbose(0) << "Current baseline is " << *CandidateLine.BaseLine << " with ThirdPoint " << *ThirdPoint << " of triangle " << T << "." << endl);
    24682468
    24692469  CandidateLine.T = &T;
     
    24872487    CircleRadius = RADIUS * RADIUS - radius / 4.;
    24882488    CirclePlaneNormal.Normalize();
    2489     Log() << Verbose(1) << "INFO: CircleCenter is at " << CircleCenter << ", CirclePlaneNormal is " << CirclePlaneNormal << " with circle radius " << sqrt(CircleRadius) << "." << endl;
    2490 
    2491     Log() << Verbose(1) << "INFO: OldSphereCenter is at " << T.SphereCenter << "." << endl;
     2489    DoLog(1) && (Log() << Verbose(1) << "INFO: CircleCenter is at " << CircleCenter << ", CirclePlaneNormal is " << CirclePlaneNormal << " with circle radius " << sqrt(CircleRadius) << "." << endl);
     2490
     2491    DoLog(1) && (Log() << Verbose(1) << "INFO: OldSphereCenter is at " << T.SphereCenter << "." << endl);
    24922492
    24932493    // construct SearchDirection and an "outward pointer"
     
    24972497    if (helper.ScalarProduct(&SearchDirection) < -HULLEPSILON)// ohoh, SearchDirection points inwards!
    24982498      SearchDirection.Scale(-1.);
    2499     Log() << Verbose(1) << "INFO: SearchDirection is " << SearchDirection << "." << endl;
     2499    DoLog(1) && (Log() << Verbose(1) << "INFO: SearchDirection is " << SearchDirection << "." << endl);
    25002500    if (fabs(RelativeSphereCenter.ScalarProduct(&SearchDirection)) > HULLEPSILON) {
    25012501      // rotated the wrong way!
     
    25072507
    25082508  } else {
    2509     Log() << Verbose(0) << "Circumcircle for base line " << *CandidateLine.BaseLine << " and base triangle " << T << " is too big!" << endl;
     2509    DoLog(0) && (Log() << Verbose(0) << "Circumcircle for base line " << *CandidateLine.BaseLine << " and base triangle " << T << " is too big!" << endl);
    25102510  }
    25112511
     
    25142514    return false;
    25152515  }
    2516   Log() << Verbose(0) << "Third Points are: " << endl;
     2516  DoLog(0) && (Log() << Verbose(0) << "Third Points are: " << endl);
    25172517  for (TesselPointList::iterator it = CandidateLine.pointlist.begin(); it != CandidateLine.pointlist.end(); ++it) {
    2518     Log() << Verbose(0) << " " << *(*it) << endl;
     2518    DoLog(0) && (Log() << Verbose(0) << " " << *(*it) << endl);
    25192519  }
    25202520
     
    25392539    if (baseline->pointlist.empty()) {
    25402540      T = (((baseline->BaseLine->triangles.begin()))->second);
    2541       Log() << Verbose(1) << "Finding best candidate for open line " << *baseline->BaseLine << " of triangle " << *T << endl;
     2541      DoLog(1) && (Log() << Verbose(1) << "Finding best candidate for open line " << *baseline->BaseLine << " of triangle " << *T << endl);
    25422542      TesselationFailFlag = TesselationFailFlag && FindNextSuitableTriangle(*baseline, *T, RADIUS, LCList); //the line is there, so there is a triangle, but only one.
    25432543    }
     
    25692569  TesselPointList *connectedClosestPoints = GetCircleOfSetOfPoints(&SetOfNeighbours, TurningPoint, CandidateLine.BaseLine->endpoints[1]->node->node);
    25702570
    2571   Log() << Verbose(0) << "List of Candidates for Turning Point " << *TurningPoint << ":" << endl;
     2571  DoLog(0) && (Log() << Verbose(0) << "List of Candidates for Turning Point " << *TurningPoint << ":" << endl);
    25722572  for (TesselPointList::iterator TesselRunner = connectedClosestPoints->begin(); TesselRunner != connectedClosestPoints->end(); ++TesselRunner)
    2573     Log() << Verbose(0) << " " << **TesselRunner << endl;
     2573    DoLog(0) && (Log() << Verbose(0) << " " << **TesselRunner << endl);
    25742574
    25752575  // go through all angle-sorted candidates (in degenerate n-nodes case we may have to add multiple triangles)
     
    25782578  Sprinter++;
    25792579  while (Sprinter != connectedClosestPoints->end()) {
    2580     Log() << Verbose(0) << "Current Runner is " << *(*Runner) << " and sprinter is " << *(*Sprinter) << "." << endl;
     2580    DoLog(0) && (Log() << Verbose(0) << "Current Runner is " << *(*Runner) << " and sprinter is " << *(*Sprinter) << "." << endl);
    25812581
    25822582    AddTesselationPoint(TurningPoint, 0);
     
    25912591      // fill the internal open lines with its respective candidate (otherwise lines in degenerate case are not picked)
    25922592      FindDegeneratedCandidatesforOpenLines(*Sprinter, &CandidateLine.OptCenter);
    2593       Log() << Verbose(0) << " There are still more triangles to add." << endl;
     2593      DoLog(0) && (Log() << Verbose(0) << " There are still more triangles to add." << endl);
    25942594    }
    25952595    // pick candidates for other open lines as well
     
    25992599    if (CheckDegeneracy(CandidateLine, RADIUS, LC)) {
    26002600      // add normal and degenerate triangles
    2601       Log() << Verbose(1) << "Triangle of endpoints " << *TPS[0] << "," << *TPS[1] << " and " << *TPS[2] << " is degenerated, adding both sides." << endl;
     2601      DoLog(1) && (Log() << Verbose(1) << "Triangle of endpoints " << *TPS[0] << "," << *TPS[1] << " and " << *TPS[2] << " is degenerated, adding both sides." << endl);
    26022602      AddCandidateTriangle(CandidateLine, OtherOpt);
    26032603
     
    26232623  pair<LineMap::iterator, LineMap::iterator> FindPair = TPS[0]->lines.equal_range(TPS[2]->node->nr);
    26242624  for (LineMap::const_iterator FindLine = FindPair.first; FindLine != FindPair.second; FindLine++) {
    2625     Log() << Verbose(1) << "INFO: Checking line " << *(FindLine->second) << " ..." << endl;
     2625    DoLog(1) && (Log() << Verbose(1) << "INFO: Checking line " << *(FindLine->second) << " ..." << endl);
    26262626    // If there is a line with less than two attached triangles, we don't need a new line.
    26272627    if (FindLine->second->triangles.size() == 1) {
    26282628      CandidateMap::iterator Finder = OpenLines.find(FindLine->second);
    26292629      if (!Finder->second->pointlist.empty())
    2630         Log() << Verbose(1) << "INFO: line " << *(FindLine->second) << " is open with candidate " << **(Finder->second->pointlist.begin()) << "." << endl;
     2630        DoLog(1) && (Log() << Verbose(1) << "INFO: line " << *(FindLine->second) << " is open with candidate " << **(Finder->second->pointlist.begin()) << "." << endl);
    26312631      else {
    2632         Log() << Verbose(1) << "INFO: line " << *(FindLine->second) << " is open with no candidate, setting to next Sprinter" << (*Sprinter) << endl;
     2632        DoLog(1) && (Log() << Verbose(1) << "INFO: line " << *(FindLine->second) << " is open with no candidate, setting to next Sprinter" << (*Sprinter) << endl);
    26332633        Finder->second->pointlist.push_back(Sprinter);
    26342634        Finder->second->ShortestAngle = 0.;
     
    26542654
    26552655  /// 1. Create or pick the lines for the first triangle
    2656   Log() << Verbose(0) << "INFO: Creating/Picking lines for first triangle ..." << endl;
     2656  DoLog(0) && (Log() << Verbose(0) << "INFO: Creating/Picking lines for first triangle ..." << endl);
    26572657  for (int i = 0; i < 3; i++) {
    26582658    BLS[i] = NULL;
    2659     Log() << Verbose(0) << "Current line is between " << *TPS[(i + 0) % 3] << " and " << *TPS[(i + 1) % 3] << ":" << endl;
     2659    DoLog(0) && (Log() << Verbose(0) << "Current line is between " << *TPS[(i + 0) % 3] << " and " << *TPS[(i + 1) % 3] << ":" << endl);
    26602660    AddTesselationLine(&CandidateLine.OptCenter, TPS[(i + 2) % 3], TPS[(i + 0) % 3], TPS[(i + 1) % 3], i);
    26612661  }
    26622662
    26632663  /// 2. create the first triangle and NormalVector and so on
    2664   Log() << Verbose(0) << "INFO: Adding first triangle with center at " << CandidateLine.OptCenter << " ..." << endl;
     2664  DoLog(0) && (Log() << Verbose(0) << "INFO: Adding first triangle with center at " << CandidateLine.OptCenter << " ..." << endl);
    26652665  BTS = new class BoundaryTriangleSet(BLS, TrianglesOnBoundaryCount);
    26662666  AddTesselationTriangle();
     
    26732673  // give some verbose output about the whole procedure
    26742674  if (CandidateLine.T != NULL)
    2675     Log() << Verbose(0) << "--> New triangle with " << *BTS << " and normal vector " << BTS->NormalVector << ", from " << *CandidateLine.T << " and angle " << CandidateLine.ShortestAngle << "." << endl;
     2675    DoLog(0) && (Log() << Verbose(0) << "--> New triangle with " << *BTS << " and normal vector " << BTS->NormalVector << ", from " << *CandidateLine.T << " and angle " << CandidateLine.ShortestAngle << "." << endl);
    26762676  else
    2677     Log() << Verbose(0) << "--> New starting triangle with " << *BTS << " and normal vector " << BTS->NormalVector << " and no top triangle." << endl;
     2677    DoLog(0) && (Log() << Verbose(0) << "--> New starting triangle with " << *BTS << " and normal vector " << BTS->NormalVector << " and no top triangle." << endl);
    26782678  triangle = BTS;
    26792679
    26802680  /// 3. Gather candidates for each new line
    2681   Log() << Verbose(0) << "INFO: Adding candidates to new lines ..." << endl;
     2681  DoLog(0) && (Log() << Verbose(0) << "INFO: Adding candidates to new lines ..." << endl);
    26822682  for (int i = 0; i < 3; i++) {
    2683     Log() << Verbose(0) << "Current line is between " << *TPS[(i + 0) % 3] << " and " << *TPS[(i + 1) % 3] << ":" << endl;
     2683    DoLog(0) && (Log() << Verbose(0) << "Current line is between " << *TPS[(i + 0) % 3] << " and " << *TPS[(i + 1) % 3] << ":" << endl);
    26842684    CandidateCheck = OpenLines.find(BLS[i]);
    26852685    if ((CandidateCheck != OpenLines.end()) && (CandidateCheck->second->pointlist.empty())) {
     
    26912691
    26922692  /// 4. Create or pick the lines for the second triangle
    2693   Log() << Verbose(0) << "INFO: Creating/Picking lines for second triangle ..." << endl;
     2693  DoLog(0) && (Log() << Verbose(0) << "INFO: Creating/Picking lines for second triangle ..." << endl);
    26942694  for (int i = 0; i < 3; i++) {
    2695     Log() << Verbose(0) << "Current line is between " << *TPS[(i + 0) % 3] << " and " << *TPS[(i + 1) % 3] << ":" << endl;
     2695    DoLog(0) && (Log() << Verbose(0) << "Current line is between " << *TPS[(i + 0) % 3] << " and " << *TPS[(i + 1) % 3] << ":" << endl);
    26962696    AddTesselationLine(&CandidateLine.OtherOptCenter, TPS[(i + 2) % 3], TPS[(i + 0) % 3], TPS[(i + 1) % 3], i);
    26972697  }
    26982698
    26992699  /// 5. create the second triangle and NormalVector and so on
    2700   Log() << Verbose(0) << "INFO: Adding second triangle with center at " << CandidateLine.OtherOptCenter << " ..." << endl;
     2700  DoLog(0) && (Log() << Verbose(0) << "INFO: Adding second triangle with center at " << CandidateLine.OtherOptCenter << " ..." << endl);
    27012701  BTS = new class BoundaryTriangleSet(BLS, TrianglesOnBoundaryCount);
    27022702  AddTesselationTriangle();
     
    27082708  // give some verbose output about the whole procedure
    27092709  if (CandidateLine.T != NULL)
    2710     Log() << Verbose(0) << "--> New degenerate triangle with " << *BTS << " and normal vector " << BTS->NormalVector << ", from " << *CandidateLine.T << " and angle " << CandidateLine.ShortestAngle << "." << endl;
     2710    DoLog(0) && (Log() << Verbose(0) << "--> New degenerate triangle with " << *BTS << " and normal vector " << BTS->NormalVector << ", from " << *CandidateLine.T << " and angle " << CandidateLine.ShortestAngle << "." << endl);
    27112711  else
    2712     Log() << Verbose(0) << "--> New degenerate starting triangle with " << *BTS << " and normal vector " << BTS->NormalVector << " and no top triangle." << endl;
     2712    DoLog(0) && (Log() << Verbose(0) << "--> New degenerate starting triangle with " << *BTS << " and normal vector " << BTS->NormalVector << " and no top triangle." << endl);
    27132713
    27142714  /// 6. Adding triangle to new lines
    2715   Log() << Verbose(0) << "INFO: Adding second triangles to new lines ..." << endl;
     2715  DoLog(0) && (Log() << Verbose(0) << "INFO: Adding second triangles to new lines ..." << endl);
    27162716  for (int i = 0; i < 3; i++) {
    2717     Log() << Verbose(0) << "Current line is between " << *TPS[(i + 0) % 3] << " and " << *TPS[(i + 1) % 3] << ":" << endl;
     2717    DoLog(0) && (Log() << Verbose(0) << "Current line is between " << *TPS[(i + 0) % 3] << " and " << *TPS[(i + 1) % 3] << ":" << endl);
    27182718    CandidateCheck = OpenLines.find(BLS[i]);
    27192719    if ((CandidateCheck != OpenLines.end()) && (CandidateCheck->second->pointlist.empty())) {
     
    27532753  // give some verbose output about the whole procedure
    27542754  if (CandidateLine.T != NULL)
    2755     Log() << Verbose(0) << "--> New" << ((type == OtherOpt) ? " degenerate " : " ") << "triangle with " << *BTS << " and normal vector " << BTS->NormalVector << ", from " << *CandidateLine.T << " and angle " << CandidateLine.ShortestAngle << "." << endl;
     2755    DoLog(0) && (Log() << Verbose(0) << "--> New" << ((type == OtherOpt) ? " degenerate " : " ") << "triangle with " << *BTS << " and normal vector " << BTS->NormalVector << ", from " << *CandidateLine.T << " and angle " << CandidateLine.ShortestAngle << "." << endl);
    27562756  else
    2757     Log() << Verbose(0) << "--> New" << ((type == OtherOpt) ? " degenerate " : " ") << "starting triangle with " << *BTS << " and normal vector " << BTS->NormalVector << " and no top triangle." << endl;
     2757    DoLog(0) && (Log() << Verbose(0) << "--> New" << ((type == OtherOpt) ? " degenerate " : " ") << "starting triangle with " << *BTS << " and normal vector " << BTS->NormalVector << " and no top triangle." << endl);
    27582758}
    27592759;
     
    27802780  OtherBase = new class BoundaryLineSet(BPS, -1);
    27812781
    2782   Log() << Verbose(1) << "INFO: Current base line is " << *Base << "." << endl;
    2783   Log() << Verbose(1) << "INFO: Other base line is " << *OtherBase << "." << endl;
     2782  DoLog(1) && (Log() << Verbose(1) << "INFO: Current base line is " << *Base << "." << endl);
     2783  DoLog(1) && (Log() << Verbose(1) << "INFO: Other base line is " << *OtherBase << "." << endl);
    27842784
    27852785  // get the closest point on each line to the other line
     
    28012801  delete (ClosestPoint);
    28022802  if ((distance[0] * distance[1]) > 0) { // have same sign?
    2803     Log() << Verbose(1) << "REJECT: Both SKPs have same sign: " << distance[0] << " and " << distance[1] << ". " << *Base << "' rectangle is concave." << endl;
     2803    DoLog(1) && (Log() << Verbose(1) << "REJECT: Both SKPs have same sign: " << distance[0] << " and " << distance[1] << ". " << *Base << "' rectangle is concave." << endl);
    28042804    if (distance[0] < distance[1]) {
    28052805      Spot = Base->endpoints[0];
     
    28092809    return Spot;
    28102810  } else { // different sign, i.e. we are in between
    2811     Log() << Verbose(0) << "ACCEPT: Rectangle of triangles of base line " << *Base << " is convex." << endl;
     2811    DoLog(0) && (Log() << Verbose(0) << "ACCEPT: Rectangle of triangles of base line " << *Base << " is convex." << endl);
    28122812    return NULL;
    28132813  }
     
    28202820  Info FunctionInfo(__func__);
    28212821  // print all lines
    2822   Log() << Verbose(0) << "Printing all boundary points for debugging:" << endl;
     2822  DoLog(0) && (Log() << Verbose(0) << "Printing all boundary points for debugging:" << endl);
    28232823  for (PointMap::const_iterator PointRunner = PointsOnBoundary.begin(); PointRunner != PointsOnBoundary.end(); PointRunner++)
    2824     Log() << Verbose(0) << *(PointRunner->second) << endl;
     2824    DoLog(0) && (Log() << Verbose(0) << *(PointRunner->second) << endl);
    28252825}
    28262826;
     
    28302830  Info FunctionInfo(__func__);
    28312831  // print all lines
    2832   Log() << Verbose(0) << "Printing all boundary lines for debugging:" << endl;
     2832  DoLog(0) && (Log() << Verbose(0) << "Printing all boundary lines for debugging:" << endl);
    28332833  for (LineMap::const_iterator LineRunner = LinesOnBoundary.begin(); LineRunner != LinesOnBoundary.end(); LineRunner++)
    2834     Log() << Verbose(0) << *(LineRunner->second) << endl;
     2834    DoLog(0) && (Log() << Verbose(0) << *(LineRunner->second) << endl);
    28352835}
    28362836;
     
    28402840  Info FunctionInfo(__func__);
    28412841  // print all triangles
    2842   Log() << Verbose(0) << "Printing all boundary triangles for debugging:" << endl;
     2842  DoLog(0) && (Log() << Verbose(0) << "Printing all boundary triangles for debugging:" << endl);
    28432843  for (TriangleMap::const_iterator TriangleRunner = TrianglesOnBoundary.begin(); TriangleRunner != TrianglesOnBoundary.end(); TriangleRunner++)
    2844     Log() << Verbose(0) << *(TriangleRunner->second) << endl;
     2844    DoLog(0) && (Log() << Verbose(0) << *(TriangleRunner->second) << endl);
    28452845}
    28462846;
     
    28652865  OtherBase = new class BoundaryLineSet(BPS, -1);
    28662866
    2867   Log() << Verbose(0) << "INFO: Current base line is " << *Base << "." << endl;
    2868   Log() << Verbose(0) << "INFO: Other base line is " << *OtherBase << "." << endl;
     2867  DoLog(0) && (Log() << Verbose(0) << "INFO: Current base line is " << *Base << "." << endl);
     2868  DoLog(0) && (Log() << Verbose(0) << "INFO: Other base line is " << *OtherBase << "." << endl);
    28692869
    28702870  // get the closest point on each line to the other line
     
    28862886
    28872887  if (Distance.NormSquared() < MYEPSILON) { // check for intersection
    2888     Log() << Verbose(0) << "REJECT: Both lines have an intersection: Nothing to do." << endl;
     2888    DoLog(0) && (Log() << Verbose(0) << "REJECT: Both lines have an intersection: Nothing to do." << endl);
    28892889    return false;
    28902890  } else { // check for sign against BaseLineNormal
     
    28962896    }
    28972897    for (TriangleMap::iterator runner = Base->triangles.begin(); runner != Base->triangles.end(); runner++) {
    2898       Log() << Verbose(1) << "INFO: Adding NormalVector " << runner->second->NormalVector << " of triangle " << *(runner->second) << "." << endl;
     2898      DoLog(1) && (Log() << Verbose(1) << "INFO: Adding NormalVector " << runner->second->NormalVector << " of triangle " << *(runner->second) << "." << endl);
    28992899      BaseLineNormal.AddVector(&(runner->second->NormalVector));
    29002900    }
     
    29022902
    29032903    if (Distance.ScalarProduct(&BaseLineNormal) > MYEPSILON) { // Distance points outwards, hence OtherBase higher than Base -> flip
    2904       Log() << Verbose(0) << "ACCEPT: Other base line would be higher: Flipping baseline." << endl;
     2904      DoLog(0) && (Log() << Verbose(0) << "ACCEPT: Other base line would be higher: Flipping baseline." << endl);
    29052905      // calculate volume summand as a general tetraeder
    29062906      return volume;
    29072907    } else { // Base higher than OtherBase -> do nothing
    2908       Log() << Verbose(0) << "REJECT: Base line is higher: Nothing to do." << endl;
     2908      DoLog(0) && (Log() << Verbose(0) << "REJECT: Base line is higher: Nothing to do." << endl);
    29092909      return 0.;
    29102910    }
     
    29362936  }
    29372937  for (TriangleMap::iterator runner = Base->triangles.begin(); runner != Base->triangles.end(); runner++) {
    2938     Log() << Verbose(1) << "INFO: Adding NormalVector " << runner->second->NormalVector << " of triangle " << *(runner->second) << "." << endl;
     2938    DoLog(1) && (Log() << Verbose(1) << "INFO: Adding NormalVector " << runner->second->NormalVector << " of triangle " << *(runner->second) << "." << endl);
    29392939    BaseLineNormal.AddVector(&(runner->second->NormalVector));
    29402940  }
     
    29492949  i = 0;
    29502950  m = 0;
    2951   Log() << Verbose(0) << "The four old lines are: ";
     2951  DoLog(0) && (Log() << Verbose(0) << "The four old lines are: ");
    29522952  for (TriangleMap::iterator runner = Base->triangles.begin(); runner != Base->triangles.end(); runner++)
    29532953    for (int j = 0; j < 3; j++) // all of their endpoints and baselines
    29542954      if (runner->second->lines[j] != Base) { // pick not the central baseline
    29552955        OldLines[i++] = runner->second->lines[j];
    2956         Log() << Verbose(0) << *runner->second->lines[j] << "\t";
     2956        DoLog(0) && (Log() << Verbose(0) << *runner->second->lines[j] << "\t");
    29572957      }
    2958   Log() << Verbose(0) << endl;
    2959   Log() << Verbose(0) << "The two old points are: ";
     2958  DoLog(0) && (Log() << Verbose(0) << endl);
     2959  DoLog(0) && (Log() << Verbose(0) << "The two old points are: ");
    29602960  for (TriangleMap::iterator runner = Base->triangles.begin(); runner != Base->triangles.end(); runner++)
    29612961    for (int j = 0; j < 3; j++) // all of their endpoints and baselines
    29622962      if (!Base->ContainsBoundaryPoint(runner->second->endpoints[j])) { // and neither of its endpoints
    29632963        OldPoints[m++] = runner->second->endpoints[j];
    2964         Log() << Verbose(0) << *runner->second->endpoints[j] << "\t";
     2964        DoLog(0) && (Log() << Verbose(0) << *runner->second->endpoints[j] << "\t");
    29652965      }
    2966   Log() << Verbose(0) << endl;
     2966  DoLog(0) && (Log() << Verbose(0) << endl);
    29672967
    29682968  // check whether everything is in place to create new lines and triangles
     
    29832983
    29842984  // remove triangles and baseline removes itself
    2985   Log() << Verbose(0) << "INFO: Deleting baseline " << *Base << " from global list." << endl;
     2985  DoLog(0) && (Log() << Verbose(0) << "INFO: Deleting baseline " << *Base << " from global list." << endl);
    29862986  OldBaseLineNr = Base->Nr;
    29872987  m = 0;
    29882988  for (TriangleMap::iterator runner = Base->triangles.begin(); runner != Base->triangles.end(); runner++) {
    2989     Log() << Verbose(0) << "INFO: Deleting triangle " << *(runner->second) << "." << endl;
     2989    DoLog(0) && (Log() << Verbose(0) << "INFO: Deleting triangle " << *(runner->second) << "." << endl);
    29902990    OldTriangleNrs[m++] = runner->second->Nr;
    29912991    RemoveTesselationTriangle(runner->second);
     
    29972997  NewLine = new class BoundaryLineSet(BPS, OldBaseLineNr);
    29982998  LinesOnBoundary.insert(LinePair(OldBaseLineNr, NewLine)); // no need for check for unique insertion as NewLine is definitely a new one
    2999   Log() << Verbose(0) << "INFO: Created new baseline " << *NewLine << "." << endl;
     2999  DoLog(0) && (Log() << Verbose(0) << "INFO: Created new baseline " << *NewLine << "." << endl);
    30003000
    30013001  // construct new triangles with flipped baseline
     
    30123012    BTS->GetNormalVector(BaseLineNormal);
    30133013    AddTesselationTriangle(OldTriangleNrs[0]);
    3014     Log() << Verbose(0) << "INFO: Created new triangle " << *BTS << "." << endl;
     3014    DoLog(0) && (Log() << Verbose(0) << "INFO: Created new triangle " << *BTS << "." << endl);
    30153015
    30163016    BLS[0] = (i == 2 ? OldLines[3] : OldLines[2]);
     
    30203020    BTS->GetNormalVector(BaseLineNormal);
    30213021    AddTesselationTriangle(OldTriangleNrs[1]);
    3022     Log() << Verbose(0) << "INFO: Created new triangle " << *BTS << "." << endl;
     3022    DoLog(0) && (Log() << Verbose(0) << "INFO: Created new triangle " << *BTS << "." << endl);
    30233023  } else {
    30243024    DoeLog(0) && (eLog() << Verbose(0) << "The four old lines do not connect, something's utterly wrong here!" << endl);
     
    30613061    Nupper[i] = ((N[i] + 1) < LC->N[i]) ? N[i] + 1 : LC->N[i] - 1;
    30623062  }
    3063   Log() << Verbose(0) << "LC Intervals from [" << N[0] << "<->" << LC->N[0] << ", " << N[1] << "<->" << LC->N[1] << ", " << N[2] << "<->" << LC->N[2] << "] :" << " [" << Nlower[0] << "," << Nupper[0] << "], " << " [" << Nlower[1] << "," << Nupper[1] << "], " << " [" << Nlower[2] << "," << Nupper[2] << "], " << endl;
     3063  DoLog(0) && (Log() << Verbose(0) << "LC Intervals from [" << N[0] << "<->" << LC->N[0] << ", " << N[1] << "<->" << LC->N[1] << ", " << N[2] << "<->" << LC->N[2] << "] :" << " [" << Nlower[0] << "," << Nupper[0] << "], " << " [" << Nlower[1] << "," << Nupper[1] << "], " << " [" << Nlower[2] << "," << Nupper[2] << "], " << endl);
    30643064
    30653065  for (LC->n[0] = Nlower[0]; LC->n[0] <= Nupper[0]; LC->n[0]++)
     
    30993099                if (angle < Storage[0]) {
    31003100                  //Log() << Verbose(1) << "Old values of Storage: %lf %lf \n", Storage[0], Storage[1]);
    3101                   Log() << Verbose(1) << "Current candidate is " << *Candidate << ": Is a better candidate with distance " << norm << " and angle " << angle << " to oben " << Oben << ".\n";
     3101                  DoLog(1) && (Log() << Verbose(1) << "Current candidate is " << *Candidate << ": Is a better candidate with distance " << norm << " and angle " << angle << " to oben " << Oben << ".\n");
    31023102                  OptCandidate = Candidate;
    31033103                  Storage[0] = angle;
     
    31143114          }
    31153115        } else {
    3116           Log() << Verbose(0) << "Linked cell list is empty." << endl;
     3116          DoLog(0) && (Log() << Verbose(0) << "Linked cell list is empty." << endl);
    31173117        }
    31183118      }
     
    31693169  TesselPoint *Candidate = NULL;
    31703170
    3171   Log() << Verbose(1) << "INFO: NormalVector of BaseTriangle is " << NormalVector << "." << endl;
     3171  DoLog(1) && (Log() << Verbose(1) << "INFO: NormalVector of BaseTriangle is " << NormalVector << "." << endl);
    31723172
    31733173  // copy old center
     
    31933193    CircleRadius = RADIUS * RADIUS - radius;
    31943194    CirclePlaneNormal.Normalize();
    3195     Log() << Verbose(1) << "INFO: CircleCenter is at " << CircleCenter << ", CirclePlaneNormal is " << CirclePlaneNormal << " with circle radius " << sqrt(CircleRadius) << "." << endl;
     3195    DoLog(1) && (Log() << Verbose(1) << "INFO: CircleCenter is at " << CircleCenter << ", CirclePlaneNormal is " << CirclePlaneNormal << " with circle radius " << sqrt(CircleRadius) << "." << endl);
    31963196
    31973197    // test whether old center is on the band's plane
     
    32023202    radius = RelativeOldSphereCenter.NormSquared();
    32033203    if (fabs(radius - CircleRadius) < HULLEPSILON) {
    3204       Log() << Verbose(1) << "INFO: RelativeOldSphereCenter is at " << RelativeOldSphereCenter << "." << endl;
     3204      DoLog(1) && (Log() << Verbose(1) << "INFO: RelativeOldSphereCenter is at " << RelativeOldSphereCenter << "." << endl);
    32053205
    32063206      // check SearchDirection
    3207       Log() << Verbose(1) << "INFO: SearchDirection is " << SearchDirection << "." << endl;
     3207      DoLog(1) && (Log() << Verbose(1) << "INFO: SearchDirection is " << SearchDirection << "." << endl);
    32083208      if (fabs(RelativeOldSphereCenter.ScalarProduct(&SearchDirection)) > HULLEPSILON) { // rotated the wrong way!
    32093209        DoeLog(1) && (eLog() << Verbose(1) << "SearchDirection and RelativeOldSphereCenter are not orthogonal!" << endl);
     
    32373237
    32383238                // check for three unique points
    3239                 Log() << Verbose(2) << "INFO: Current Candidate is " << *Candidate << " for BaseLine " << *CandidateLine.BaseLine << " with OldSphereCenter " << OldSphereCenter << "." << endl;
     3239                DoLog(2) && (Log() << Verbose(2) << "INFO: Current Candidate is " << *Candidate << " for BaseLine " << *CandidateLine.BaseLine << " with OldSphereCenter " << OldSphereCenter << "." << endl);
    32403240                if ((Candidate != CandidateLine.BaseLine->endpoints[0]->node) && (Candidate != CandidateLine.BaseLine->endpoints[1]->node)) {
    32413241
    32423242                  // find center on the plane
    32433243                  GetCenterofCircumcircle(&NewPlaneCenter, *CandidateLine.BaseLine->endpoints[0]->node->node, *CandidateLine.BaseLine->endpoints[1]->node->node, *Candidate->node);
    3244                   Log() << Verbose(1) << "INFO: NewPlaneCenter is " << NewPlaneCenter << "." << endl;
     3244                  DoLog(1) && (Log() << Verbose(1) << "INFO: NewPlaneCenter is " << NewPlaneCenter << "." << endl);
    32453245
    32463246                  if (NewNormalVector.MakeNormalVector(CandidateLine.BaseLine->endpoints[0]->node->node, CandidateLine.BaseLine->endpoints[1]->node->node, Candidate->node) && (fabs(NewNormalVector.NormSquared()) > HULLEPSILON)) {
    3247                     Log() << Verbose(1) << "INFO: NewNormalVector is " << NewNormalVector << "." << endl;
     3247                    DoLog(1) && (Log() << Verbose(1) << "INFO: NewNormalVector is " << NewNormalVector << "." << endl);
    32483248                    radius = CandidateLine.BaseLine->endpoints[0]->node->node->DistanceSquared(&NewPlaneCenter);
    3249                     Log() << Verbose(1) << "INFO: CircleCenter is at " << CircleCenter << ", CirclePlaneNormal is " << CirclePlaneNormal << " with circle radius " << sqrt(CircleRadius) << "." << endl;
    3250                     Log() << Verbose(1) << "INFO: SearchDirection is " << SearchDirection << "." << endl;
    3251                     Log() << Verbose(1) << "INFO: Radius of CircumCenterCircle is " << radius << "." << endl;
     3249                    DoLog(1) && (Log() << Verbose(1) << "INFO: CircleCenter is at " << CircleCenter << ", CirclePlaneNormal is " << CirclePlaneNormal << " with circle radius " << sqrt(CircleRadius) << "." << endl);
     3250                    DoLog(1) && (Log() << Verbose(1) << "INFO: SearchDirection is " << SearchDirection << "." << endl);
     3251                    DoLog(1) && (Log() << Verbose(1) << "INFO: Radius of CircumCenterCircle is " << radius << "." << endl);
    32523252                    if (radius < RADIUS * RADIUS) {
    32533253                      otherradius = CandidateLine.BaseLine->endpoints[1]->node->node->DistanceSquared(&NewPlaneCenter);
     
    32603260                      helper.CopyVector(&NewNormalVector);
    32613261                      helper.Scale(sqrt(RADIUS * RADIUS - radius));
    3262                       Log() << Verbose(2) << "INFO: Distance of NewPlaneCenter " << NewPlaneCenter << " to either NewSphereCenter is " << helper.Norm() << " of vector " << helper << " with sphere radius " << RADIUS << "." << endl;
     3262                      DoLog(2) && (Log() << Verbose(2) << "INFO: Distance of NewPlaneCenter " << NewPlaneCenter << " to either NewSphereCenter is " << helper.Norm() << " of vector " << helper << " with sphere radius " << RADIUS << "." << endl);
    32633263                      NewSphereCenter.AddVector(&helper);
    3264                       Log() << Verbose(2) << "INFO: NewSphereCenter is at " << NewSphereCenter << "." << endl;
     3264                      DoLog(2) && (Log() << Verbose(2) << "INFO: NewSphereCenter is at " << NewSphereCenter << "." << endl);
    32653265                      // OtherNewSphereCenter is created by the same vector just in the other direction
    32663266                      helper.Scale(-1.);
    32673267                      OtherNewSphereCenter.AddVector(&helper);
    3268                       Log() << Verbose(2) << "INFO: OtherNewSphereCenter is at " << OtherNewSphereCenter << "." << endl;
     3268                      DoLog(2) && (Log() << Verbose(2) << "INFO: OtherNewSphereCenter is at " << OtherNewSphereCenter << "." << endl);
    32693269
    32703270                      alpha = GetPathLengthonCircumCircle(CircleCenter, CirclePlaneNormal, CircleRadius, NewSphereCenter, OldSphereCenter, NormalVector, SearchDirection);
     
    32853285                        if ((CandidateLine.ShortestAngle - HULLEPSILON) < alpha) {
    32863286                          CandidateLine.pointlist.push_back(Candidate);
    3287                           Log() << Verbose(0) << "ACCEPT: We have found an equally good candidate: " << *(Candidate) << " with " << alpha << " and circumsphere's center at " << CandidateLine.OptCenter << "." << endl;
     3287                          DoLog(0) && (Log() << Verbose(0) << "ACCEPT: We have found an equally good candidate: " << *(Candidate) << " with " << alpha << " and circumsphere's center at " << CandidateLine.OptCenter << "." << endl);
    32883288                        } else {
    32893289                          // remove all candidates from the list and then the list itself
    32903290                          CandidateLine.pointlist.clear();
    32913291                          CandidateLine.pointlist.push_back(Candidate);
    3292                           Log() << Verbose(0) << "ACCEPT: We have found a better candidate: " << *(Candidate) << " with " << alpha << " and circumsphere's center at " << CandidateLine.OptCenter << "." << endl;
     3292                          DoLog(0) && (Log() << Verbose(0) << "ACCEPT: We have found a better candidate: " << *(Candidate) << " with " << alpha << " and circumsphere's center at " << CandidateLine.OptCenter << "." << endl);
    32933293                        }
    32943294                        CandidateLine.ShortestAngle = alpha;
    3295                         Log() << Verbose(0) << "INFO: There are " << CandidateLine.pointlist.size() << " candidates in the list now." << endl;
     3295                        DoLog(0) && (Log() << Verbose(0) << "INFO: There are " << CandidateLine.pointlist.size() << " candidates in the list now." << endl);
    32963296                      } else {
    32973297                        if ((Candidate != NULL) && (CandidateLine.pointlist.begin() != CandidateLine.pointlist.end())) {
    3298                           Log() << Verbose(1) << "REJECT: Old candidate " << *(*CandidateLine.pointlist.begin()) << " with " << CandidateLine.ShortestAngle << " is better than new one " << *Candidate << " with " << alpha << " ." << endl;
     3298                          DoLog(1) && (Log() << Verbose(1) << "REJECT: Old candidate " << *(*CandidateLine.pointlist.begin()) << " with " << CandidateLine.ShortestAngle << " is better than new one " << *Candidate << " with " << alpha << " ." << endl);
    32993299                        } else {
    3300                           Log() << Verbose(1) << "REJECT: Candidate " << *Candidate << " with " << alpha << " was rejected." << endl;
     3300                          DoLog(1) && (Log() << Verbose(1) << "REJECT: Candidate " << *Candidate << " with " << alpha << " was rejected." << endl);
    33013301                        }
    33023302                      }
    33033303                    } else {
    3304                       Log() << Verbose(1) << "REJECT: NewSphereCenter " << NewSphereCenter << " for " << *Candidate << " is too far away: " << radius << "." << endl;
     3304                      DoLog(1) && (Log() << Verbose(1) << "REJECT: NewSphereCenter " << NewSphereCenter << " for " << *Candidate << " is too far away: " << radius << "." << endl);
    33053305                    }
    33063306                  } else {
    3307                     Log() << Verbose(1) << "REJECT: Three points from " << *CandidateLine.BaseLine << " and Candidate " << *Candidate << " are linear-dependent." << endl;
     3307                    DoLog(1) && (Log() << Verbose(1) << "REJECT: Three points from " << *CandidateLine.BaseLine << " and Candidate " << *Candidate << " are linear-dependent." << endl);
    33083308                  }
    33093309                } else {
    33103310                  if (ThirdPoint != NULL) {
    3311                     Log() << Verbose(1) << "REJECT: Base triangle " << *CandidateLine.BaseLine << " and " << *ThirdPoint << " contains Candidate " << *Candidate << "." << endl;
     3311                    DoLog(1) && (Log() << Verbose(1) << "REJECT: Base triangle " << *CandidateLine.BaseLine << " and " << *ThirdPoint << " contains Candidate " << *Candidate << "." << endl);
    33123312                  } else {
    3313                     Log() << Verbose(1) << "REJECT: Base triangle " << *CandidateLine.BaseLine << " contains Candidate " << *Candidate << "." << endl;
     3313                    DoLog(1) && (Log() << Verbose(1) << "REJECT: Base triangle " << *CandidateLine.BaseLine << " contains Candidate " << *Candidate << "." << endl);
    33143314                  }
    33153315                }
     
    33223322  } else {
    33233323    if (ThirdPoint != NULL)
    3324       Log() << Verbose(1) << "Circumcircle for base line " << *CandidateLine.BaseLine << " and third node " << *ThirdPoint << " is too big!" << endl;
     3324      DoLog(1) && (Log() << Verbose(1) << "Circumcircle for base line " << *CandidateLine.BaseLine << " and third node " << *ThirdPoint << " is too big!" << endl);
    33253325    else
    3326       Log() << Verbose(1) << "Circumcircle for base line " << *CandidateLine.BaseLine << " is too big!" << endl;
     3326      DoLog(1) && (Log() << Verbose(1) << "Circumcircle for base line " << *CandidateLine.BaseLine << " is too big!" << endl);
    33273327  }
    33283328
     
    33583358      if (!OrderTest.second) { // if insertion fails, we have common endpoint
    33593359        node = OrderTest.first->second;
    3360         Log() << Verbose(1) << "Common endpoint of lines " << *line1 << " and " << *line2 << " is: " << *node << "." << endl;
     3360        DoLog(1) && (Log() << Verbose(1) << "Common endpoint of lines " << *line1 << " and " << *line2 << " is: " << *node << "." << endl);
    33613361        j = 2;
    33623362        i = 2;
     
    33883388  for (int i = 0; i < NDIM; i++) // store indices of this cell
    33893389    N[i] = LC->n[i];
    3390   Log() << Verbose(1) << "INFO: Center cell is " << N[0] << ", " << N[1] << ", " << N[2] << " with No. " << LC->index << "." << endl;
     3390  DoLog(1) && (Log() << Verbose(1) << "INFO: Center cell is " << N[0] << ", " << N[1] << ", " << N[2] << " with No. " << LC->index << "." << endl);
    33913391  DistanceToPointMap * points = new DistanceToPointMap;
    33923392  LC->GetNeighbourBounds(Nlower, Nupper);
     
    34023402            if (FindPoint != PointsOnBoundary.end()) {
    34033403              points->insert(DistanceToPointPair(FindPoint->second->node->node->DistanceSquared(x), FindPoint->second));
    3404               Log() << Verbose(1) << "INFO: Putting " << *FindPoint->second << " into the list." << endl;
     3404              DoLog(1) && (Log() << Verbose(1) << "INFO: Putting " << *FindPoint->second << " into the list." << endl);
    34053405            }
    34063406          }
     
    34363436
    34373437  // for each point, check its lines, remember closest
    3438   Log() << Verbose(1) << "Finding closest BoundaryLine to " << *x << " ... " << endl;
     3438  DoLog(1) && (Log() << Verbose(1) << "Finding closest BoundaryLine to " << *x << " ... " << endl);
    34393439  BoundaryLineSet *ClosestLine = NULL;
    34403440  double MinDistance = -1.;
     
    34673467          ClosestLine = LineRunner->second;
    34683468          MinDistance = distance;
    3469           Log() << Verbose(1) << "ACCEPT: New closest line is " << *ClosestLine << " with projected distance " << MinDistance << "." << endl;
     3469          DoLog(1) && (Log() << Verbose(1) << "ACCEPT: New closest line is " << *ClosestLine << " with projected distance " << MinDistance << "." << endl);
    34703470        } else {
    3471           Log() << Verbose(1) << "REJECT: Intersection is outside of the line section: " << lengthA << " and " << lengthB << "." << endl;
     3471          DoLog(1) && (Log() << Verbose(1) << "REJECT: Intersection is outside of the line section: " << lengthA << " and " << lengthB << "." << endl);
    34723472        }
    34733473      } else {
    3474         Log() << Verbose(1) << "REJECT: Point is too further away than present line: " << distance << " >> " << MinDistance << "." << endl;
     3474        DoLog(1) && (Log() << Verbose(1) << "REJECT: Point is too further away than present line: " << distance << " >> " << MinDistance << "." << endl);
    34753475      }
    34763476    }
     
    34793479  // check whether closest line is "too close" :), then it's inside
    34803480  if (ClosestLine == NULL) {
    3481     Log() << Verbose(0) << "Is the only point, no one else is closeby." << endl;
     3481    DoLog(0) && (Log() << Verbose(0) << "Is the only point, no one else is closeby." << endl);
    34823482    return NULL;
    34833483  }
     
    35023502
    35033503  // for each point, check its lines, remember closest
    3504   Log() << Verbose(1) << "Finding closest BoundaryTriangle to " << *x << " ... " << endl;
     3504  DoLog(1) && (Log() << Verbose(1) << "Finding closest BoundaryTriangle to " << *x << " ... " << endl);
    35053505  LineSet ClosestLines;
    35063506  double MinDistance = 1e+16;
     
    35303530          ClosestLines.insert(LineRunner->second);
    35313531          MinDistance = lengthEnd;
    3532           Log() << Verbose(1) << "ACCEPT: Line " << *LineRunner->second << " to endpoint " << *LineRunner->second->endpoints[0]->node << " is closer with " << lengthEnd << "." << endl;
     3532          DoLog(1) && (Log() << Verbose(1) << "ACCEPT: Line " << *LineRunner->second << " to endpoint " << *LineRunner->second->endpoints[0]->node << " is closer with " << lengthEnd << "." << endl);
    35333533        } else if (fabs(lengthEnd - MinDistance) < MYEPSILON) { // additional best candidate
    35343534          ClosestLines.insert(LineRunner->second);
    3535           Log() << Verbose(1) << "ACCEPT: Line " << *LineRunner->second << " to endpoint " << *LineRunner->second->endpoints[1]->node << " is equally good with " << lengthEnd << "." << endl;
     3535          DoLog(1) && (Log() << Verbose(1) << "ACCEPT: Line " << *LineRunner->second << " to endpoint " << *LineRunner->second->endpoints[1]->node << " is equally good with " << lengthEnd << "." << endl);
    35363536        } else { // line is worse
    3537           Log() << Verbose(1) << "REJECT: Line " << *LineRunner->second << " to either endpoints is further away than present closest line candidate: " << lengthEndA << ", " << lengthEndB << ", and distance is longer than baseline:" << lengthBase << "." << endl;
     3537          DoLog(1) && (Log() << Verbose(1) << "REJECT: Line " << *LineRunner->second << " to either endpoints is further away than present closest line candidate: " << lengthEndA << ", " << lengthEndB << ", and distance is longer than baseline:" << lengthBase << "." << endl);
    35383538        }
    35393539      } else { // intersection is closer, calculate
     
    35513551          ClosestLines.insert(LineRunner->second);
    35523552          MinDistance = distance;
    3553           Log() << Verbose(1) << "ACCEPT: Intersection in between endpoints, new closest line " << *LineRunner->second << " is " << *ClosestLines.begin() << " with projected distance " << MinDistance << "." << endl;
     3553          DoLog(1) && (Log() << Verbose(1) << "ACCEPT: Intersection in between endpoints, new closest line " << *LineRunner->second << " is " << *ClosestLines.begin() << " with projected distance " << MinDistance << "." << endl);
    35543554        } else {
    3555           Log() << Verbose(2) << "REJECT: Point is further away from line " << *LineRunner->second << " than present closest line: " << distance << " >> " << MinDistance << "." << endl;
     3555          DoLog(2) && (Log() << Verbose(2) << "REJECT: Point is further away from line " << *LineRunner->second << " than present closest line: " << distance << " >> " << MinDistance << "." << endl);
    35563556        }
    35573557      }
     
    35623562  // check whether closest line is "too close" :), then it's inside
    35633563  if (ClosestLines.empty()) {
    3564     Log() << Verbose(0) << "Is the only point, no one else is closeby." << endl;
     3564    DoLog(0) && (Log() << Verbose(0) << "Is the only point, no one else is closeby." << endl);
    35653565    return NULL;
    35663566  }
     
    36033603      result = *Runner;
    36043604      MinAlignment = Alignment;
    3605       Log() << Verbose(1) << "ACCEPT: Triangle " << *result << " is better aligned with " << MinAlignment << "." << endl;
     3605      DoLog(1) && (Log() << Verbose(1) << "ACCEPT: Triangle " << *result << " is better aligned with " << MinAlignment << "." << endl);
    36063606    } else {
    3607       Log() << Verbose(1) << "REJECT: Triangle " << *result << " is worse aligned with " << MinAlignment << "." << endl;
     3607      DoLog(1) && (Log() << Verbose(1) << "REJECT: Triangle " << *result << " is worse aligned with " << MinAlignment << "." << endl);
    36083608    }
    36093609  }
     
    36583658
    36593659  if (triangle == NULL) {// is boundary point or only point in point cloud?
    3660     Log() << Verbose(1) << "No triangle given!" << endl;
     3660    DoLog(1) && (Log() << Verbose(1) << "No triangle given!" << endl);
    36613661    return -1.;
    36623662  } else {
    3663     Log() << Verbose(1) << "INFO: Closest triangle found is " << *triangle << " with normal vector " << triangle->NormalVector << "." << endl;
     3663    DoLog(1) && (Log() << Verbose(1) << "INFO: Closest triangle found is " << *triangle << " with normal vector " << triangle->NormalVector << "." << endl);
    36643664  }
    36653665
    36663666  triangle->GetCenter(&Center);
    3667   Log() << Verbose(2) << "INFO: Central point of the triangle is " << Center << "." << endl;
     3667  DoLog(2) && (Log() << Verbose(2) << "INFO: Central point of the triangle is " << Center << "." << endl);
    36683668  DistanceToCenter.CopyVector(&Center);
    36693669  DistanceToCenter.SubtractVector(&Point);
    3670   Log() << Verbose(2) << "INFO: Vector from point to test to center is " << DistanceToCenter << "." << endl;
     3670  DoLog(2) && (Log() << Verbose(2) << "INFO: Vector from point to test to center is " << DistanceToCenter << "." << endl);
    36713671
    36723672  // check whether we are on boundary
     
    36773677    Center.SubtractVector(&triangle->NormalVector); // points towards MolCenter
    36783678    DistanceToCenter.AddVector(&triangle->NormalVector); // points outside
    3679     Log() << Verbose(1) << "INFO: Calling Intersection with " << Center << " and " << DistanceToCenter << "." << endl;
     3679    DoLog(1) && (Log() << Verbose(1) << "INFO: Calling Intersection with " << Center << " and " << DistanceToCenter << "." << endl);
    36803680    if (triangle->GetIntersectionInsideTriangle(&Center, &DistanceToCenter, &Intersection)) {
    3681       Log() << Verbose(1) << Point << " is inner point: sufficiently close to boundary, " << Intersection << "." << endl;
     3681      DoLog(1) && (Log() << Verbose(1) << Point << " is inner point: sufficiently close to boundary, " << Intersection << "." << endl);
    36823682      return 0.;
    36833683    } else {
    3684       Log() << Verbose(1) << Point << " is NOT an inner point: on triangle plane but outside of triangle bounds." << endl;
     3684      DoLog(1) && (Log() << Verbose(1) << Point << " is NOT an inner point: on triangle plane but outside of triangle bounds." << endl);
    36853685      return false;
    36863686    }
     
    36883688    // calculate smallest distance
    36893689    distance = triangle->GetClosestPointInsideTriangle(&Point, &Intersection);
    3690     Log() << Verbose(1) << "Closest point on triangle is " << Intersection << "." << endl;
     3690    DoLog(1) && (Log() << Verbose(1) << "Closest point on triangle is " << Intersection << "." << endl);
    36913691
    36923692    // then check direction to boundary
    36933693    if (DistanceToCenter.ScalarProduct(&triangle->NormalVector) > MYEPSILON) {
    3694       Log() << Verbose(1) << Point << " is an inner point, " << distance << " below surface." << endl;
     3694      DoLog(1) && (Log() << Verbose(1) << Point << " is an inner point, " << distance << " below surface." << endl);
    36953695      return -distance;
    36963696    } else {
    3697       Log() << Verbose(1) << Point << " is NOT an inner point, " << distance << " above surface." << endl;
     3697      DoLog(1) && (Log() << Verbose(1) << Point << " is NOT an inner point, " << distance << " above surface." << endl);
    36983698      return +distance;
    36993699    }
     
    37753775
    37763776    if (takePoint) {
    3777       Log() << Verbose(1) << "INFO: Endpoint " << *current << " of line " << *(findLines->second) << " is enlisted." << endl;
     3777      DoLog(1) && (Log() << Verbose(1) << "INFO: Endpoint " << *current << " of line " << *(findLines->second) << " is enlisted." << endl);
    37783778      connectedPoints->insert(current);
    37793779    }
     
    38313831  }
    38323832  PlaneNormal.Scale(1.0 / triangles->size());
    3833   Log() << Verbose(1) << "INFO: Calculated PlaneNormal of all circle points is " << PlaneNormal << "." << endl;
     3833  DoLog(1) && (Log() << Verbose(1) << "INFO: Calculated PlaneNormal of all circle points is " << PlaneNormal << "." << endl);
    38343834  PlaneNormal.Normalize();
    38353835
     
    38413841  }
    38423842  if ((Reference == NULL) || (AngleZero.NormSquared() < MYEPSILON)) {
    3843     Log() << Verbose(1) << "Using alternatively " << *(*SetOfNeighbours->begin())->node << " as angle 0 referencer." << endl;
     3843    DoLog(1) && (Log() << Verbose(1) << "Using alternatively " << *(*SetOfNeighbours->begin())->node << " as angle 0 referencer." << endl);
    38443844    AngleZero.CopyVector((*SetOfNeighbours->begin())->node);
    38453845    AngleZero.SubtractVector(Point->node);
     
    38503850    }
    38513851  }
    3852   Log() << Verbose(1) << "INFO: Reference vector on this plane representing angle 0 is " << AngleZero << "." << endl;
     3852  DoLog(1) && (Log() << Verbose(1) << "INFO: Reference vector on this plane representing angle 0 is " << AngleZero << "." << endl);
    38533853  if (AngleZero.NormSquared() > MYEPSILON)
    38543854    OrthogonalVector.MakeNormalVector(&PlaneNormal, &AngleZero);
    38553855  else
    38563856    OrthogonalVector.MakeNormalVector(&PlaneNormal);
    3857   Log() << Verbose(1) << "INFO: OrthogonalVector on plane is " << OrthogonalVector << "." << endl;
     3857  DoLog(1) && (Log() << Verbose(1) << "INFO: OrthogonalVector on plane is " << OrthogonalVector << "." << endl);
    38583858
    38593859  // go through all connected points and calculate angle
     
    38633863    helper.ProjectOntoPlane(&PlaneNormal);
    38643864    double angle = GetAngle(helper, AngleZero, OrthogonalVector);
    3865     Log() << Verbose(0) << "INFO: Calculated angle is " << angle << " for point " << **listRunner << "." << endl;
     3865    DoLog(0) && (Log() << Verbose(0) << "INFO: Calculated angle is " << angle << " for point " << **listRunner << "." << endl);
    38663866    anglesOfPoints.insert(pair<double, TesselPoint*> (angle, (*listRunner)));
    38673867  }
     
    39093909  }
    39103910
    3911   Log() << Verbose(1) << "INFO: Point is " << *Point << " and Reference is " << *Reference << "." << endl;
     3911  DoLog(1) && (Log() << Verbose(1) << "INFO: Point is " << *Point << " and Reference is " << *Reference << "." << endl);
    39123912  // calculate central point
    39133913  TesselPointSet::const_iterator TesselA = SetOfNeighbours->begin();
     
    39203920  while (TesselC != SetOfNeighbours->end()) {
    39213921    helper.MakeNormalVector((*TesselA)->node, (*TesselB)->node, (*TesselC)->node);
    3922     Log() << Verbose(0) << "Making normal vector out of " << *(*TesselA) << ", " << *(*TesselB) << " and " << *(*TesselC) << ":" << helper << endl;
     3922    DoLog(0) && (Log() << Verbose(0) << "Making normal vector out of " << *(*TesselA) << ", " << *(*TesselB) << " and " << *(*TesselC) << ":" << helper << endl);
    39233923    counter++;
    39243924    TesselA++;
     
    39363936  //  PlaneNormal.SubtractVector(&center);
    39373937  //  PlaneNormal.Normalize();
    3938   Log() << Verbose(1) << "INFO: Calculated plane normal of circle is " << PlaneNormal << "." << endl;
     3938  DoLog(1) && (Log() << Verbose(1) << "INFO: Calculated plane normal of circle is " << PlaneNormal << "." << endl);
    39393939
    39403940  // construct one orthogonal vector
     
    39453945  }
    39463946  if ((Reference == NULL) || (AngleZero.NormSquared() < MYEPSILON)) {
    3947     Log() << Verbose(1) << "Using alternatively " << *(*SetOfNeighbours->begin())->node << " as angle 0 referencer." << endl;
     3947    DoLog(1) && (Log() << Verbose(1) << "Using alternatively " << *(*SetOfNeighbours->begin())->node << " as angle 0 referencer." << endl);
    39483948    AngleZero.CopyVector((*SetOfNeighbours->begin())->node);
    39493949    AngleZero.SubtractVector(Point->node);
     
    39543954    }
    39553955  }
    3956   Log() << Verbose(1) << "INFO: Reference vector on this plane representing angle 0 is " << AngleZero << "." << endl;
     3956  DoLog(1) && (Log() << Verbose(1) << "INFO: Reference vector on this plane representing angle 0 is " << AngleZero << "." << endl);
    39573957  if (AngleZero.NormSquared() > MYEPSILON)
    39583958    OrthogonalVector.MakeNormalVector(&PlaneNormal, &AngleZero);
    39593959  else
    39603960    OrthogonalVector.MakeNormalVector(&PlaneNormal);
    3961   Log() << Verbose(1) << "INFO: OrthogonalVector on plane is " << OrthogonalVector << "." << endl;
     3961  DoLog(1) && (Log() << Verbose(1) << "INFO: OrthogonalVector on plane is " << OrthogonalVector << "." << endl);
    39623962
    39633963  // go through all connected points and calculate angle
     
    39703970    if (angle > M_PI) // the correction is of no use here (and not desired)
    39713971      angle = 2. * M_PI - angle;
    3972     Log() << Verbose(0) << "INFO: Calculated angle between " << helper << " and " << AngleZero << " is " << angle << " for point " << **listRunner << "." << endl;
     3972    DoLog(0) && (Log() << Verbose(0) << "INFO: Calculated angle between " << helper << " and " << AngleZero << " is " << angle << " for point " << **listRunner << "." << endl);
    39733973    InserterTest = anglesOfPoints.insert(pair<double, TesselPoint*> (angle, (*listRunner)));
    39743974    if (!InserterTest.second) {
     
    40374037        StartLine = CurrentLine;
    40384038        CurrentPoint = CurrentLine->GetOtherEndpoint(ReferencePoint);
    4039         Log() << Verbose(1) << "INFO: Beginning path retrieval at " << *CurrentPoint << " of line " << *CurrentLine << "." << endl;
     4039        DoLog(1) && (Log() << Verbose(1) << "INFO: Beginning path retrieval at " << *CurrentPoint << " of line " << *CurrentLine << "." << endl);
    40404040        do {
    40414041          // push current one
    4042           Log() << Verbose(1) << "INFO: Putting " << *CurrentPoint << " at end of path." << endl;
     4042          DoLog(1) && (Log() << Verbose(1) << "INFO: Putting " << *CurrentPoint << " at end of path." << endl);
    40434043          connectedPath->push_back(CurrentPoint->node);
    40444044
    40454045          // find next triangle
    40464046          for (TriangleMap::iterator Runner = CurrentLine->triangles.begin(); Runner != CurrentLine->triangles.end(); Runner++) {
    4047             Log() << Verbose(1) << "INFO: Inspecting triangle " << *Runner->second << "." << endl;
     4047            DoLog(1) && (Log() << Verbose(1) << "INFO: Inspecting triangle " << *Runner->second << "." << endl);
    40484048            if ((Runner->second != triangle)) { // look for first triangle not equal to old one
    40494049              triangle = Runner->second;
     
    40524052                if (!TriangleRunner->second) {
    40534053                  TriangleRunner->second = true;
    4054                   Log() << Verbose(1) << "INFO: Connecting triangle is " << *triangle << "." << endl;
     4054                  DoLog(1) && (Log() << Verbose(1) << "INFO: Connecting triangle is " << *triangle << "." << endl);
    40554055                  break;
    40564056                } else {
    4057                   Log() << Verbose(1) << "INFO: Skipping " << *triangle << ", as we have already visited it." << endl;
     4057                  DoLog(1) && (Log() << Verbose(1) << "INFO: Skipping " << *triangle << ", as we have already visited it." << endl);
    40584058                  triangle = NULL;
    40594059                }
     
    40704070            if ((triangle->lines[i] != CurrentLine) && (triangle->lines[i]->ContainsBoundaryPoint(ReferencePoint))) { // not the current line and still containing Point
    40714071              CurrentLine = triangle->lines[i];
    4072               Log() << Verbose(1) << "INFO: Connecting line is " << *CurrentLine << "." << endl;
     4072              DoLog(1) && (Log() << Verbose(1) << "INFO: Connecting line is " << *CurrentLine << "." << endl);
    40734073              break;
    40744074            }
     
    40844084        } while (CurrentLine != StartLine);
    40854085        // last point is missing, as it's on start line
    4086         Log() << Verbose(1) << "INFO: Putting " << *CurrentPoint << " at end of path." << endl;
     4086        DoLog(1) && (Log() << Verbose(1) << "INFO: Putting " << *CurrentPoint << " at end of path." << endl);
    40874087        if (StartLine->GetOtherEndpoint(ReferencePoint)->node != connectedPath->back())
    40884088          connectedPath->push_back(StartLine->GetOtherEndpoint(ReferencePoint)->node);
     
    40904090        ListOfPaths->push_back(connectedPath);
    40914091      } else {
    4092         Log() << Verbose(1) << "INFO: Skipping " << *runner->second << ", as we have already visited it." << endl;
     4092        DoLog(1) && (Log() << Verbose(1) << "INFO: Skipping " << *runner->second << ", as we have already visited it." << endl);
    40934093      }
    40944094    }
     
    41204120    connectedPath = *ListRunner;
    41214121
    4122     Log() << Verbose(1) << "INFO: Current path is " << connectedPath << "." << endl;
     4122    DoLog(1) && (Log() << Verbose(1) << "INFO: Current path is " << connectedPath << "." << endl);
    41234123
    41244124    // go through list, look for reappearance of starting Point and count
     
    41294129      if ((*CircleRunner == *CircleStart) && (CircleRunner != CircleStart)) { // is not the very first point
    41304130        // we have a closed circle from Marker to new Marker
    4131         Log() << Verbose(1) << count + 1 << ". closed path consists of: ";
     4131        DoLog(1) && (Log() << Verbose(1) << count + 1 << ". closed path consists of: ");
    41324132        newPath = new TesselPointList;
    41334133        TesselPointList::iterator CircleSprinter = Marker;
    41344134        for (; CircleSprinter != CircleRunner; CircleSprinter++) {
    41354135          newPath->push_back(*CircleSprinter);
    4136           Log() << Verbose(0) << (**CircleSprinter) << " <-> ";
     4136          DoLog(0) && (Log() << Verbose(0) << (**CircleSprinter) << " <-> ");
    41374137        }
    4138         Log() << Verbose(0) << ".." << endl;
     4138        DoLog(0) && (Log() << Verbose(0) << ".." << endl);
    41394139        count++;
    41404140        Marker = CircleRunner;
     
    41454145    }
    41464146  }
    4147   Log() << Verbose(1) << "INFO: " << count << " closed additional path(s) have been created." << endl;
     4147  DoLog(1) && (Log() << Verbose(1) << "INFO: " << count << " closed additional path(s) have been created." << endl);
    41484148
    41494149  // delete list of paths
     
    42074207    return 0.;
    42084208  } else
    4209     Log() << Verbose(0) << "Removing point " << *point << " from tesselated boundary ..." << endl;
     4209    DoLog(0) && (Log() << Verbose(0) << "Removing point " << *point << " from tesselated boundary ..." << endl);
    42104210
    42114211  // copy old location for the volume
     
    42374237  NormalVector.Zero();
    42384238  for (TriangleMap::iterator Runner = Candidates.begin(); Runner != Candidates.end(); Runner++) {
    4239     Log() << Verbose(1) << "INFO: Removing triangle " << *(Runner->second) << "." << endl;
     4239    DoLog(1) && (Log() << Verbose(1) << "INFO: Removing triangle " << *(Runner->second) << "." << endl);
    42404240    NormalVector.SubtractVector(&Runner->second->NormalVector); // has to point inward
    42414241    RemoveTesselationTriangle(Runner->second);
    42424242    count++;
    42434243  }
    4244   Log() << Verbose(1) << count << " triangles were removed." << endl;
     4244  DoLog(1) && (Log() << Verbose(1) << count << " triangles were removed." << endl);
    42454245
    42464246  list<TesselPointList *>::iterator ListAdvance = ListOfClosedPaths->begin();
     
    42664266        smallestangle = 0.;
    42674267        for (MiddleNode = connectedPath->begin(); MiddleNode != connectedPath->end(); MiddleNode++) {
    4268           Log() << Verbose(1) << "INFO: MiddleNode is " << **MiddleNode << "." << endl;
     4268          DoLog(1) && (Log() << Verbose(1) << "INFO: MiddleNode is " << **MiddleNode << "." << endl);
    42694269          // construct vectors to next and previous neighbour
    42704270          StartNode = MiddleNode;
     
    43044304        if (EndNode == connectedPath->end())
    43054305          EndNode = connectedPath->begin();
    4306         Log() << Verbose(2) << "INFO: StartNode is " << **StartNode << "." << endl;
    4307         Log() << Verbose(2) << "INFO: MiddleNode is " << **MiddleNode << "." << endl;
    4308         Log() << Verbose(2) << "INFO: EndNode is " << **EndNode << "." << endl;
    4309         Log() << Verbose(1) << "INFO: Attempting to create triangle " << (*StartNode)->Name << ", " << (*MiddleNode)->Name << " and " << (*EndNode)->Name << "." << endl;
     4306        DoLog(2) && (Log() << Verbose(2) << "INFO: StartNode is " << **StartNode << "." << endl);
     4307        DoLog(2) && (Log() << Verbose(2) << "INFO: MiddleNode is " << **MiddleNode << "." << endl);
     4308        DoLog(2) && (Log() << Verbose(2) << "INFO: EndNode is " << **EndNode << "." << endl);
     4309        DoLog(1) && (Log() << Verbose(1) << "INFO: Attempting to create triangle " << (*StartNode)->Name << ", " << (*MiddleNode)->Name << " and " << (*EndNode)->Name << "." << endl);
    43104310        TriangleCandidates[0] = *StartNode;
    43114311        TriangleCandidates[1] = *MiddleNode;
     
    43254325          continue;
    43264326        }
    4327         Log() << Verbose(3) << "Adding new triangle points." << endl;
     4327        DoLog(3) && (Log() << Verbose(3) << "Adding new triangle points." << endl);
    43284328        AddTesselationPoint(*StartNode, 0);
    43294329        AddTesselationPoint(*MiddleNode, 1);
    43304330        AddTesselationPoint(*EndNode, 2);
    4331         Log() << Verbose(3) << "Adding new triangle lines." << endl;
     4331        DoLog(3) && (Log() << Verbose(3) << "Adding new triangle lines." << endl);
    43324332        AddTesselationLine(NULL, NULL, TPS[0], TPS[1], 0);
    43334333        AddTesselationLine(NULL, NULL, TPS[0], TPS[2], 1);
     
    43444344        // prepare nodes for next triangle
    43454345        StartNode = EndNode;
    4346         Log() << Verbose(2) << "Removing " << **MiddleNode << " from closed path, remaining points: " << connectedPath->size() << "." << endl;
     4346        DoLog(2) && (Log() << Verbose(2) << "Removing " << **MiddleNode << " from closed path, remaining points: " << connectedPath->size() << "." << endl);
    43474347        connectedPath->remove(*MiddleNode); // remove the middle node (it is surrounded by triangles)
    43484348        if (connectedPath->size() == 2) { // we are done
     
    43804380          if (maxgain != 0) {
    43814381            volume += maxgain;
    4382             Log() << Verbose(1) << "Flipping baseline with highest volume" << **Candidate << "." << endl;
     4382            DoLog(1) && (Log() << Verbose(1) << "Flipping baseline with highest volume" << **Candidate << "." << endl);
    43834383            OtherBase = FlipBaseline(*Candidate);
    43844384            NewLines.erase(Candidate);
     
    43914391      delete (connectedPath);
    43924392    }
    4393     Log() << Verbose(0) << count << " triangles were created." << endl;
     4393    DoLog(0) && (Log() << Verbose(0) << count << " triangles were created." << endl);
    43944394  } else {
    43954395    while (!ListOfClosedPaths->empty()) {
     
    43994399      delete (connectedPath);
    44004400    }
    4401     Log() << Verbose(0) << "No need to create any triangles." << endl;
     4401    DoLog(0) && (Log() << Verbose(0) << "No need to create any triangles." << endl);
    44024402  }
    44034403  delete (ListOfClosedPaths);
    44044404
    4405   Log() << Verbose(0) << "Removed volume is " << volume << "." << endl;
     4405  DoLog(0) && (Log() << Verbose(0) << "Removed volume is " << volume << "." << endl);
    44064406
    44074407  return volume;
     
    45684568  AllLines.clear();
    45694569
    4570   Log() << Verbose(0) << "FindAllDegeneratedLines() found " << DegeneratedLines->size() << " lines." << endl;
     4570  DoLog(0) && (Log() << Verbose(0) << "FindAllDegeneratedLines() found " << DegeneratedLines->size() << " lines." << endl);
    45714571  IndexToIndex::iterator it;
    45724572  for (it = DegeneratedLines->begin(); it != DegeneratedLines->end(); it++) {
     
    45744574    const LineMap::const_iterator Line2 = LinesOnBoundary.find((*it).second);
    45754575    if (Line1 != LinesOnBoundary.end() && Line2 != LinesOnBoundary.end())
    4576       Log() << Verbose(0) << *Line1->second << " => " << *Line2->second << endl;
     4576      DoLog(0) && (Log() << Verbose(0) << *Line1->second << " => " << *Line2->second << endl);
    45774577    else
    45784578      DoeLog(1) && (eLog() << Verbose(1) << "Either " << (*it).first << " or " << (*it).second << " are not in LinesOnBoundary!" << endl);
     
    46164616  delete (DegeneratedLines);
    46174617
    4618   Log() << Verbose(0) << "FindAllDegeneratedTriangles() found " << DegeneratedTriangles->size() << " triangles:" << endl;
     4618  DoLog(0) && (Log() << Verbose(0) << "FindAllDegeneratedTriangles() found " << DegeneratedTriangles->size() << " triangles:" << endl);
    46194619  IndexToIndex::iterator it;
    46204620  for (it = DegeneratedTriangles->begin(); it != DegeneratedTriangles->end(); it++)
    4621     Log() << Verbose(0) << (*it).first << " => " << (*it).second << endl;
     4621    DoLog(0) && (Log() << Verbose(0) << (*it).first << " => " << (*it).second << endl);
    46224622
    46234623  return DegeneratedTriangles;
     
    46874687      // erase the pair
    46884688      count += (int) DegeneratedTriangles->erase(triangle->Nr);
    4689       Log() << Verbose(0) << "RemoveDegeneratedTriangles() removes triangle " << *triangle << "." << endl;
     4689      DoLog(0) && (Log() << Verbose(0) << "RemoveDegeneratedTriangles() removes triangle " << *triangle << "." << endl);
    46904690      RemoveTesselationTriangle(triangle);
    46914691      count += (int) DegeneratedTriangles->erase(partnerTriangle->Nr);
    4692       Log() << Verbose(0) << "RemoveDegeneratedTriangles() removes triangle " << *partnerTriangle << "." << endl;
     4692      DoLog(0) && (Log() << Verbose(0) << "RemoveDegeneratedTriangles() removes triangle " << *partnerTriangle << "." << endl);
    46934693      RemoveTesselationTriangle(partnerTriangle);
    46944694    } else {
    4695       Log() << Verbose(0) << "RemoveDegeneratedTriangles() does not remove triangle " << *triangle << " and its partner " << *partnerTriangle << " because it is essential for at" << " least one of the endpoints to be kept in the tesselation structure." << endl;
     4695      DoLog(0) && (Log() << Verbose(0) << "RemoveDegeneratedTriangles() does not remove triangle " << *triangle << " and its partner " << *partnerTriangle << " because it is essential for at" << " least one of the endpoints to be kept in the tesselation structure." << endl);
    46964696    }
    46974697  }
     
    47004700    LastTriangle = NULL;
    47014701
    4702   Log() << Verbose(0) << "RemoveDegeneratedTriangles() removed " << count << " triangles:" << endl;
     4702  DoLog(0) && (Log() << Verbose(0) << "RemoveDegeneratedTriangles() removed " << count << " triangles:" << endl);
    47034703}
    47044704
     
    47294729    return;
    47304730  }
    4731   Log() << Verbose(0) << "Nearest point on boundary is " << NearestPoint->Name << "." << endl;
     4731  DoLog(0) && (Log() << Verbose(0) << "Nearest point on boundary is " << NearestPoint->Name << "." << endl);
    47324732
    47334733  // go through its lines and find the best one to split
     
    47624762
    47634763  // create new triangle to connect point (connects automatically with the missing spot of the chosen line)
    4764   Log() << Verbose(2) << "Adding new triangle points." << endl;
     4764  DoLog(2) && (Log() << Verbose(2) << "Adding new triangle points." << endl);
    47654765  AddTesselationPoint((BestLine->endpoints[0]->node), 0);
    47664766  AddTesselationPoint((BestLine->endpoints[1]->node), 1);
    47674767  AddTesselationPoint(point, 2);
    4768   Log() << Verbose(2) << "Adding new triangle lines." << endl;
     4768  DoLog(2) && (Log() << Verbose(2) << "Adding new triangle lines." << endl);
    47694769  AddTesselationLine(NULL, NULL, TPS[0], TPS[1], 0);
    47704770  AddTesselationLine(NULL, NULL, TPS[0], TPS[2], 1);
     
    47734773  BTS->GetNormalVector(TempTriangle->NormalVector);
    47744774  BTS->NormalVector.Scale(-1.);
    4775   Log() << Verbose(1) << "INFO: NormalVector of new triangle is " << BTS->NormalVector << "." << endl;
     4775  DoLog(1) && (Log() << Verbose(1) << "INFO: NormalVector of new triangle is " << BTS->NormalVector << "." << endl);
    47764776  AddTesselationTriangle();
    47774777
    47784778  // create other side of this triangle and close both new sides of the first created triangle
    4779   Log() << Verbose(2) << "Adding new triangle points." << endl;
     4779  DoLog(2) && (Log() << Verbose(2) << "Adding new triangle points." << endl);
    47804780  AddTesselationPoint((BestLine->endpoints[0]->node), 0);
    47814781  AddTesselationPoint((BestLine->endpoints[1]->node), 1);
    47824782  AddTesselationPoint(point, 2);
    4783   Log() << Verbose(2) << "Adding new triangle lines." << endl;
     4783  DoLog(2) && (Log() << Verbose(2) << "Adding new triangle lines." << endl);
    47844784  AddTesselationLine(NULL, NULL, TPS[0], TPS[1], 0);
    47854785  AddTesselationLine(NULL, NULL, TPS[0], TPS[2], 1);
     
    47874787  BTS = new class BoundaryTriangleSet(BLS, TrianglesOnBoundaryCount);
    47884788  BTS->GetNormalVector(TempTriangle->NormalVector);
    4789   Log() << Verbose(1) << "INFO: NormalVector of other new triangle is " << BTS->NormalVector << "." << endl;
     4789  DoLog(1) && (Log() << Verbose(1) << "INFO: NormalVector of other new triangle is " << BTS->NormalVector << "." << endl);
    47904790  AddTesselationTriangle();
    47914791
     
    48254825        NameofTempFile.erase(npos, 1);
    48264826      NameofTempFile.append(TecplotSuffix);
    4827       Log() << Verbose(0) << "Writing temporary non convex hull to file " << NameofTempFile << ".\n";
     4827      DoLog(0) && (Log() << Verbose(0) << "Writing temporary non convex hull to file " << NameofTempFile << ".\n");
    48284828      tempstream = new ofstream(NameofTempFile.c_str(), ios::trunc);
    48294829      WriteTecplotFile(tempstream, this, cloud, TriangleFilesWritten);
     
    48394839        NameofTempFile.erase(npos, 1);
    48404840      NameofTempFile.append(Raster3DSuffix);
    4841       Log() << Verbose(0) << "Writing temporary non convex hull to file " << NameofTempFile << ".\n";
     4841      DoLog(0) && (Log() << Verbose(0) << "Writing temporary non convex hull to file " << NameofTempFile << ".\n");
    48424842      tempstream = new ofstream(NameofTempFile.c_str(), ios::trunc);
    48434843      WriteRaster3dFile(tempstream, this, cloud);
     
    48914891  pair<map<int, Vector *>::iterator, bool> TriangleInsertionTester;
    48924892  for (PointMap::const_iterator Runner = PointsOnBoundary.begin(); Runner != PointsOnBoundary.end(); Runner++) {
    4893     Log() << Verbose(0) << "Current point is " << *Runner->second << "." << endl;
     4893    DoLog(0) && (Log() << Verbose(0) << "Current point is " << *Runner->second << "." << endl);
    48944894    map<int, Vector *> TriangleVectors;
    48954895    // gather all NormalVectors
    4896     Log() << Verbose(1) << "Gathering triangles ..." << endl;
     4896    DoLog(1) && (Log() << Verbose(1) << "Gathering triangles ..." << endl);
    48974897    for (LineMap::const_iterator LineRunner = (Runner->second)->lines.begin(); LineRunner != (Runner->second)->lines.end(); LineRunner++)
    48984898      for (TriangleMap::const_iterator TriangleRunner = (LineRunner->second)->triangles.begin(); TriangleRunner != (LineRunner->second)->triangles.end(); TriangleRunner++) {
     
    49004900          TriangleInsertionTester = TriangleVectors.insert(pair<int, Vector *> ((TriangleRunner->second)->Nr, &((TriangleRunner->second)->NormalVector)));
    49014901          if (TriangleInsertionTester.second)
    4902             Log() << Verbose(1) << " Adding triangle " << *(TriangleRunner->second) << " to triangles to check-list." << endl;
     4902            DoLog(1) && (Log() << Verbose(1) << " Adding triangle " << *(TriangleRunner->second) << " to triangles to check-list." << endl);
    49034903        } else {
    4904           Log() << Verbose(1) << " NOT adding triangle " << *(TriangleRunner->second) << " as it's a simply degenerated one." << endl;
     4904          DoLog(1) && (Log() << Verbose(1) << " NOT adding triangle " << *(TriangleRunner->second) << " as it's a simply degenerated one." << endl);
    49054905        }
    49064906      }
    49074907    // check whether there are two that are parallel
    4908     Log() << Verbose(1) << "Finding two parallel triangles ..." << endl;
     4908    DoLog(1) && (Log() << Verbose(1) << "Finding two parallel triangles ..." << endl);
    49094909    for (map<int, Vector *>::iterator VectorWalker = TriangleVectors.begin(); VectorWalker != TriangleVectors.end(); VectorWalker++)
    49104910      for (map<int, Vector *>::iterator VectorRunner = VectorWalker; VectorRunner != TriangleVectors.end(); VectorRunner++)
    49114911        if (VectorWalker != VectorRunner) { // skip equals
    49124912          const double SCP = VectorWalker->second->ScalarProduct(VectorRunner->second); // ScalarProduct should result in -1. for degenerated triangles
    4913           Log() << Verbose(1) << "Checking " << *VectorWalker->second << " against " << *VectorRunner->second << ": " << SCP << endl;
     4913          DoLog(1) && (Log() << Verbose(1) << "Checking " << *VectorWalker->second << " against " << *VectorRunner->second << ": " << SCP << endl);
    49144914          if (fabs(SCP + 1.) < ParallelEpsilon) {
    49154915            InsertionTester = EndpointCandidateList.insert((Runner->second));
    49164916            if (InsertionTester.second)
    4917               Log() << Verbose(0) << " Adding " << *Runner->second << " to endpoint candidate list." << endl;
     4917              DoLog(0) && (Log() << Verbose(0) << " Adding " << *Runner->second << " to endpoint candidate list." << endl);
    49184918            // and break out of both loops
    49194919            VectorWalker = TriangleVectors.end();
     
    49334933    Walker = *(EndpointCandidateList.begin());
    49344934    if (Current == NULL) { // create a new polygon with current candidate
    4935       Log() << Verbose(0) << "Starting new polygon set at point " << *Walker << endl;
     4935      DoLog(0) && (Log() << Verbose(0) << "Starting new polygon set at point " << *Walker << endl);
    49364936      Current = new BoundaryPolygonSet;
    49374937      Current->endpoints.insert(Walker);
     
    49464946      for (LineMap::const_iterator LineWalker = Walker->lines.begin(); LineWalker != Walker->lines.end(); LineWalker++) {
    49474947        OtherWalker = (LineWalker->second)->GetOtherEndpoint(Walker);
    4948         Log() << Verbose(1) << "Checking " << *OtherWalker << endl;
     4948        DoLog(1) && (Log() << Verbose(1) << "Checking " << *OtherWalker << endl);
    49494949        set<BoundaryPointSet *>::iterator Finder = EndpointCandidateList.find(OtherWalker);
    49504950        if (Finder != EndpointCandidateList.end()) { // found a connected partner
    4951           Log() << Verbose(1) << " Adding to polygon." << endl;
     4951          DoLog(1) && (Log() << Verbose(1) << " Adding to polygon." << endl);
    49524952          Current->endpoints.insert(OtherWalker);
    49534953          EndpointCandidateList.erase(Finder); // remove from candidates
    49544954          ToCheckConnecteds.push(OtherWalker); // but check its partners too
    49554955        } else {
    4956           Log() << Verbose(1) << " is not connected to " << *Walker << endl;
     4956          DoLog(1) && (Log() << Verbose(1) << " is not connected to " << *Walker << endl);
    49574957        }
    49584958      }
    49594959    }
    49604960
    4961     Log() << Verbose(0) << "Final polygon is " << *Current << endl;
     4961    DoLog(0) && (Log() << Verbose(0) << "Final polygon is " << *Current << endl);
    49624962    ListofDegeneratedPolygons.insert(Current);
    49634963    Current = NULL;
     
    49664966  const int counter = ListofDegeneratedPolygons.size();
    49674967
    4968   Log() << Verbose(0) << "The following " << counter << " degenerated polygons have been found: " << endl;
     4968  DoLog(0) && (Log() << Verbose(0) << "The following " << counter << " degenerated polygons have been found: " << endl);
    49694969  for (UniquePolygonSet::iterator PolygonRunner = ListofDegeneratedPolygons.begin(); PolygonRunner != ListofDegeneratedPolygons.end(); PolygonRunner++)
    4970     Log() << Verbose(0) << " " << **PolygonRunner << endl;
     4970    DoLog(0) && (Log() << Verbose(0) << " " << **PolygonRunner << endl);
    49714971
    49724972  /// 4. Go through all these degenerated polygons
     
    49794979    // check whether number is bigger than 2, otherwise it's just a simply degenerated one and nothing to do.
    49804980    if (T->size() == 2) {
    4981       Log() << Verbose(1) << " Skipping degenerated polygon, is just a (already simply degenerated) triangle." << endl;
     4981      DoLog(1) && (Log() << Verbose(1) << " Skipping degenerated polygon, is just a (already simply degenerated) triangle." << endl);
    49824982      delete (T);
    49834983      continue;
     
    49954995    /// 4a. Get NormalVector for one side (this is "front")
    49964996    NormalVector.CopyVector(&(*TriangleWalker)->NormalVector);
    4997     Log() << Verbose(1) << "\"front\" defining triangle is " << **TriangleWalker << " and Normal vector of \"front\" side is " << NormalVector << endl;
     4997    DoLog(1) && (Log() << Verbose(1) << "\"front\" defining triangle is " << **TriangleWalker << " and Normal vector of \"front\" side is " << NormalVector << endl);
    49984998    TriangleWalker++;
    49994999    TriangleSet::iterator TriangleSprinter = TriangleWalker; // is the inner advanced iterator
     
    50045004      triangle = *TriangleWalker;
    50055005      TriangleSprinter++;
    5006       Log() << Verbose(1) << "Current triangle to test for removal: " << *triangle << endl;
     5006      DoLog(1) && (Log() << Verbose(1) << "Current triangle to test for removal: " << *triangle << endl);
    50075007      if (triangle->NormalVector.ScalarProduct(&NormalVector) < 0) { // if from other side, then delete and remove from list
    5008         Log() << Verbose(1) << " Removing ... " << endl;
     5008        DoLog(1) && (Log() << Verbose(1) << " Removing ... " << endl);
    50095009        TriangleNrs.push(triangle->Nr);
    50105010        T->erase(TriangleWalker);
    50115011        RemoveTesselationTriangle(triangle);
    50125012      } else
    5013         Log() << Verbose(1) << " Keeping ... " << endl;
     5013        DoLog(1) && (Log() << Verbose(1) << " Keeping ... " << endl);
    50145014    }
    50155015    /// 4c. Copy all "front" triangles but with inverse NormalVector
    50165016    TriangleWalker = T->begin();
    50175017    while (TriangleWalker != T->end()) { // go through all front triangles
    5018       Log() << Verbose(1) << " Re-creating triangle " << **TriangleWalker << " with NormalVector " << (*TriangleWalker)->NormalVector << endl;
     5018      DoLog(1) && (Log() << Verbose(1) << " Re-creating triangle " << **TriangleWalker << " with NormalVector " << (*TriangleWalker)->NormalVector << endl);
    50195019      for (int i = 0; i < 3; i++)
    50205020        AddTesselationPoint((*TriangleWalker)->endpoints[i]->node, i);
     
    50375037  }
    50385038  IndexToIndex * SimplyDegeneratedTriangles = FindAllDegeneratedTriangles();
    5039   Log() << Verbose(0) << "Final list of simply degenerated triangles found, containing " << SimplyDegeneratedTriangles->size() << " triangles:" << endl;
     5039  DoLog(0) && (Log() << Verbose(0) << "Final list of simply degenerated triangles found, containing " << SimplyDegeneratedTriangles->size() << " triangles:" << endl);
    50405040  IndexToIndex::iterator it;
    50415041  for (it = SimplyDegeneratedTriangles->begin(); it != SimplyDegeneratedTriangles->end(); it++)
    5042     Log() << Verbose(0) << (*it).first << " => " << (*it).second << endl;
     5042    DoLog(0) && (Log() << Verbose(0) << (*it).first << " => " << (*it).second << endl);
    50435043  delete (SimplyDegeneratedTriangles);
    50445044  /// 5. exit
  • src/tesselationhelpers.cpp

    r6613ec ra67d19  
    132132  Center->Scale(1./(sin(2.*alpha) + sin(2.*beta) + sin(2.*gamma)));
    133133  NewUmkreismittelpunkt->CopyVector(Center);
    134   Log() << Verbose(1) << "Center of new circumference is " << *NewUmkreismittelpunkt << ".\n";
     134  DoLog(1) && (Log() << Verbose(1) << "Center of new circumference is " << *NewUmkreismittelpunkt << ".\n");
    135135  // Here we calculated center of circumscribing circle, using barycentric coordinates
    136   Log() << Verbose(1) << "Center of circumference is " << *Center << " in direction " << *Direction << ".\n";
     136  DoLog(1) && (Log() << Verbose(1) << "Center of circumference is " << *Center << " in direction " << *Direction << ".\n");
    137137
    138138  TempNormal.CopyVector(&a);
     
    158158  TempNormal.Normalize();
    159159  Restradius = sqrt(RADIUS*RADIUS - Umkreisradius*Umkreisradius);
    160   Log() << Verbose(1) << "Height of center of circumference to center of sphere is " << Restradius << ".\n";
     160  DoLog(1) && (Log() << Verbose(1) << "Height of center of circumference to center of sphere is " << Restradius << ".\n");
    161161  TempNormal.Scale(Restradius);
    162   Log() << Verbose(1) << "Shift vector to sphere of circumference is " << TempNormal << ".\n";
     162  DoLog(1) && (Log() << Verbose(1) << "Shift vector to sphere of circumference is " << TempNormal << ".\n");
    163163
    164164  Center->AddVector(&TempNormal);
    165   Log() << Verbose(1) << "Center of sphere of circumference is " << *Center << ".\n";
     165  DoLog(1) && (Log() << Verbose(1) << "Center of sphere of circumference is " << *Center << ".\n");
    166166  GetSphere(&OtherCenter, a, b, c, RADIUS);
    167   Log() << Verbose(1) << "OtherCenter of sphere of circumference is " << OtherCenter << ".\n";
     167  DoLog(1) && (Log() << Verbose(1) << "OtherCenter of sphere of circumference is " << OtherCenter << ".\n");
    168168};
    169169
     
    247247  if (helper.ScalarProduct(&SearchDirection) < -HULLEPSILON)  // acos is not unique on [0, 2.*M_PI), hence extra check to decide between two half intervals
    248248    alpha = 2.*M_PI - alpha;
    249   Log() << Verbose(1) << "INFO: RelativeNewSphereCenter is " << helper << ", RelativeOldSphereCenter is " << RelativeOldSphereCenter << " and resulting angle is " << alpha << "." << endl;
     249  DoLog(1) && (Log() << Verbose(1) << "INFO: RelativeNewSphereCenter is " << helper << ", RelativeOldSphereCenter is " << RelativeOldSphereCenter << " and resulting angle is " << alpha << "." << endl);
    250250  radius = helper.Distance(&RelativeOldSphereCenter);
    251251  helper.ProjectOntoPlane(&NormalVector);
    252252  // check whether new center is somewhat away or at least right over the current baseline to prevent intersecting triangles
    253253  if ((radius > HULLEPSILON) || (helper.Norm() < HULLEPSILON)) {
    254     Log() << Verbose(1) << "INFO: Distance between old and new center is " << radius << " and between new center and baseline center is " << helper.Norm() << "." << endl;
     254    DoLog(1) && (Log() << Verbose(1) << "INFO: Distance between old and new center is " << radius << " and between new center and baseline center is " << helper.Norm() << "." << endl);
    255255    return alpha;
    256256  } else {
    257     Log() << Verbose(1) << "INFO: NewSphereCenter " << RelativeNewSphereCenter << " is too close to RelativeOldSphereCenter" << RelativeOldSphereCenter << "." << endl;
     257    DoLog(1) && (Log() << Verbose(1) << "INFO: NewSphereCenter " << RelativeNewSphereCenter << " is too close to RelativeOldSphereCenter" << RelativeOldSphereCenter << "." << endl);
    258258    return 2.*M_PI;
    259259  }
     
    364364
    365365        if (status == GSL_SUCCESS) {
    366           Log() << Verbose(1) << "converged to minimum" <<  endl;
     366          DoLog(1) && (Log() << Verbose(1) << "converged to minimum" <<  endl);
    367367        }
    368368    } while (status == GSL_CONTINUE && iter < 100);
     
    394394
    395395  if (((t1 >= 0) && (t1 <= 1)) && ((t2 >= 0) && (t2 <= 1))) {
    396     Log() << Verbose(1) << "true intersection." << endl;
     396    DoLog(1) && (Log() << Verbose(1) << "true intersection." << endl);
    397397    result = true;
    398398  } else {
    399     Log() << Verbose(1) << "intersection out of region of interest." << endl;
     399    DoLog(1) && (Log() << Verbose(1) << "intersection out of region of interest." << endl);
    400400    result = false;
    401401  }
     
    432432  }
    433433
    434   Log() << Verbose(1) << "INFO: " << point << " has angle " << phi << " with respect to reference " << reference << "." << endl;
     434  DoLog(1) && (Log() << Verbose(1) << "INFO: " << point << " has angle " << phi << " with respect to reference " << reference << "." << endl);
    435435
    436436  return phi;
     
    479479    for (int j=i+1; j<3; j++) {
    480480      if (nodes[i] == NULL) {
    481         Log() << Verbose(1) << "Node nr. " << i << " is not yet present." << endl;
     481        DoLog(1) && (Log() << Verbose(1) << "Node nr. " << i << " is not yet present." << endl);
    482482        result = true;
    483483      } else if (nodes[i]->lines.find(nodes[j]->node->nr) != nodes[i]->lines.end()) {  // there already is a line
     
    493493        }
    494494      } else { // no line
    495         Log() << Verbose(1) << "The line between " << *nodes[i] << " and " << *nodes[j] << " is not yet present, hence no need for a degenerate triangle." << endl;
     495        DoLog(1) && (Log() << Verbose(1) << "The line between " << *nodes[i] << " and " << *nodes[j] << " is not yet present, hence no need for a degenerate triangle." << endl);
    496496        result = true;
    497497      }
    498498    }
    499499  if ((!result) && (counter > 1)) {
    500     Log() << Verbose(1) << "INFO: Degenerate triangle is ok, at least two, here " << counter << ", existing lines are used." << endl;
     500    DoLog(1) && (Log() << Verbose(1) << "INFO: Degenerate triangle is ok, at least two, here " << counter << ", existing lines are used." << endl);
    501501    result = true;
    502502  }
     
    571571  for(int i=0;i<NDIM;i++) // store indices of this cell
    572572    N[i] = LC->n[i];
    573   Log() << Verbose(1) << "INFO: Center cell is " << N[0] << ", " << N[1] << ", " << N[2] << " with No. " << LC->index << "." << endl;
     573  DoLog(1) && (Log() << Verbose(1) << "INFO: Center cell is " << N[0] << ", " << N[1] << ", " << N[2] << " with No. " << LC->index << "." << endl);
    574574
    575575  LC->GetNeighbourBounds(Nlower, Nupper);
     
    626626  for(int i=0;i<NDIM;i++) // store indices of this cell
    627627    N[i] = LC->n[i];
    628   Log() << Verbose(1) << "INFO: Center cell is " << N[0] << ", " << N[1] << ", " << N[2] << " with No. " << LC->index << "." << endl;
     628  DoLog(1) && (Log() << Verbose(1) << "INFO: Center cell is " << N[0] << ", " << N[1] << ", " << N[2] << " with No. " << LC->index << "." << endl);
    629629
    630630  LC->GetNeighbourBounds(Nlower, Nupper);
     
    659659  // output
    660660  if (closestPoint != NULL) {
    661     Log() << Verbose(1) << "Closest point is " << *closestPoint;
     661    DoLog(1) && (Log() << Verbose(1) << "Closest point is " << *closestPoint);
    662662    if (SecondPoint != NULL)
    663       Log() << Verbose(0) << " and second closest is " << *SecondPoint;
    664     Log() << Verbose(0) << "." << endl;
     663      DoLog(0) && (Log() << Verbose(0) << " and second closest is " << *SecondPoint);
     664    DoLog(0) && (Log() << Verbose(0) << "." << endl);
    665665  }
    666666  return closestPoint;
     
    686686  Normal.VectorProduct(&OtherBaseline);
    687687  Normal.Normalize();
    688   Log() << Verbose(1) << "First direction is " << Baseline << ", second direction is " << OtherBaseline << ", normal of intersection plane is " << Normal << "." << endl;
     688  DoLog(1) && (Log() << Verbose(1) << "First direction is " << Baseline << ", second direction is " << OtherBaseline << ", normal of intersection plane is " << Normal << "." << endl);
    689689
    690690  // project one offset point of OtherBase onto this plane (and add plane offset vector)
     
    703703  Normal.CopyVector(Intersection);
    704704  Normal.SubtractVector(Base->endpoints[0]->node->node);
    705   Log() << Verbose(1) << "Found closest point on " << *Base << " at " << *Intersection << ", factor in line is " << fabs(Normal.ScalarProduct(&Baseline)/Baseline.NormSquared()) << "." << endl;
     705  DoLog(1) && (Log() << Verbose(1) << "Found closest point on " << *Base << " at " << *Intersection << ", factor in line is " << fabs(Normal.ScalarProduct(&Baseline)/Baseline.NormSquared()) << "." << endl);
    706706
    707707  return Intersection;
     
    885885    *tecplot << endl;
    886886    // print connectivity
    887     Log() << Verbose(1) << "The following triangles were created:" << endl;
     887    DoLog(1) && (Log() << Verbose(1) << "The following triangles were created:" << endl);
    888888    for (TriangleMap::const_iterator runner = TesselStruct->TrianglesOnBoundary.begin(); runner != TesselStruct->TrianglesOnBoundary.end(); runner++) {
    889       Log() << Verbose(1) << " " << runner->second->endpoints[0]->node->Name << "<->" << runner->second->endpoints[1]->node->Name << "<->" << runner->second->endpoints[2]->node->Name << endl;
     889      DoLog(1) && (Log() << Verbose(1) << " " << runner->second->endpoints[0]->node->Name << "<->" << runner->second->endpoints[1]->node->Name << "<->" << runner->second->endpoints[2]->node->Name << endl);
    890890      *tecplot << LookupList[runner->second->endpoints[0]->node->nr] << " " << LookupList[runner->second->endpoints[1]->node->nr] << " " << LookupList[runner->second->endpoints[2]->node->nr] << endl;
    891891    }
     
    908908  for (PointMap::const_iterator PointRunner = TesselStruct->PointsOnBoundary.begin(); PointRunner != TesselStruct->PointsOnBoundary.end(); PointRunner++) {
    909909    point = PointRunner->second;
    910     Log() << Verbose(1) << "INFO: Current point is " << *point << "." << endl;
     910    DoLog(1) && (Log() << Verbose(1) << "INFO: Current point is " << *point << "." << endl);
    911911    point->value = 0;
    912912    for (LineMap::iterator LineRunner = point->lines.begin(); LineRunner != point->lines.end(); LineRunner++) {
     
    932932  int counter = 0;
    933933
    934   Log() << Verbose(1) << "Check: List of Baselines with not two connected triangles:" << endl;
     934  DoLog(1) && (Log() << Verbose(1) << "Check: List of Baselines with not two connected triangles:" << endl);
    935935  for (testline = TesselStruct->LinesOnBoundary.begin(); testline != TesselStruct->LinesOnBoundary.end(); testline++) {
    936936    if (testline->second->triangles.size() != 2) {
    937       Log() << Verbose(2) << *testline->second << "\t" << testline->second->triangles.size() << endl;
     937      DoLog(2) && (Log() << Verbose(2) << *testline->second << "\t" << testline->second->triangles.size() << endl);
    938938      counter++;
    939939    }
    940940  }
    941941  if (counter == 0) {
    942     Log() << Verbose(1) << "None." << endl;
     942    DoLog(1) && (Log() << Verbose(1) << "None." << endl);
    943943    result = true;
    944944  }
     
    965965  }
    966966
    967   Log() << Verbose(0) << "Polygon is " << *P << endl;
     967  DoLog(0) && (Log() << Verbose(0) << "Polygon is " << *P << endl);
    968968  // create each pair, get the endpoints and check whether *P is contained.
    969969  int counter = 0;
     
    981981        const int size = PairTrianglenodes.endpoints.size();
    982982        if (size == 4) {
    983           Log() << Verbose(0) << " Current pair of triangles: " << **Walker << "," << **PairWalker << " with " << size << " distinct endpoints:" << PairTrianglenodes << endl;
     983          DoLog(0) && (Log() << Verbose(0) << " Current pair of triangles: " << **Walker << "," << **PairWalker << " with " << size << " distinct endpoints:" << PairTrianglenodes << endl);
    984984          // now check
    985985          if (PairTrianglenodes.ContainsPresentTupel(P)) {
    986986            counter++;
    987             Log() << Verbose(0) << "  ACCEPT: Matches with " << *P << endl;
     987            DoLog(0) && (Log() << Verbose(0) << "  ACCEPT: Matches with " << *P << endl);
    988988          } else {
    989             Log() << Verbose(0) << "  REJECT: No match with " << *P << endl;
     989            DoLog(0) && (Log() << Verbose(0) << "  REJECT: No match with " << *P << endl);
    990990          }
    991991        } else {
    992           Log() << Verbose(0) << "  REJECT: Less than four endpoints." << endl;
     992          DoLog(0) && (Log() << Verbose(0) << "  REJECT: Less than four endpoints." << endl);
    993993        }
    994994      }
     
    10111011    if (P2->ContainsBoundaryPoint((*Runner))) {
    10121012      counter++;
    1013       Log() << Verbose(1) << *(*Runner) << " of second polygon is found in the first one." << endl;
     1013      DoLog(1) && (Log() << Verbose(1) << *(*Runner) << " of second polygon is found in the first one." << endl);
    10141014      return true;
    10151015    }
     
    10291029    Tester = P1->endpoints.insert((*Runner));
    10301030    if (Tester.second)
    1031       Log() << Verbose(0) << "Inserting endpoint " << *(*Runner) << " into first polygon." << endl;
     1031      DoLog(0) && (Log() << Verbose(0) << "Inserting endpoint " << *(*Runner) << " into first polygon." << endl);
    10321032  }
    10331033  P2->endpoints.clear();
  • src/unittests/logunittest.cpp

    r6613ec ra67d19  
    3535{
    3636  logger::getInstance()->setVerbosity(2);
    37   Log() << Verbose(0) << "Verbosity level is set to 2." << endl;
    38   Log() << Verbose(0) << "Test level 0" << endl;
    39   Log() << Verbose(1) << "Test level 1" << endl;
    40   Log() << Verbose(2) << "Test level 2" << endl;
    41   Log() << Verbose(3) << "Test level 3" << endl;
    42   Log() << Verbose(4) << "Test level 4" << endl;
     37  DoLog(0) && (Log() << Verbose(0) << "Verbosity level is set to 2." << endl);
     38  DoLog(0) && (Log() << Verbose(0) << "Test level 0" << endl);
     39  DoLog(1) && (Log() << Verbose(1) << "Test level 1" << endl);
     40  DoLog(2) && (Log() << Verbose(2) << "Test level 2" << endl);
     41  DoLog(3) && (Log() << Verbose(3) << "Test level 3" << endl);
     42  DoLog(4) && (Log() << Verbose(4) << "Test level 4" << endl);
    4343
    44   Log() << Verbose(0) << "Output a log message." << endl;
     44  DoLog(0) && (Log() << Verbose(0) << "Output a log message." << endl);
    4545  DoeLog(0) && (eLog()<< Verbose(0) << "Output an error message." << endl);
    4646  setVerbosity(3);
    47   Log() << Verbose(4) << "This should not be printed." << endl;
     47  DoLog(4) && (Log() << Verbose(4) << "This should not be printed." << endl);
    4848  DoeLog(4) && (eLog()<< Verbose(4) << "This should not be printed." << endl);
    4949};
  • src/unittests/memoryallocatorunittest.cpp

    r6613ec ra67d19  
    4646  char* buffer3 = NULL;
    4747  buffer3 = Malloc<char>(4, "");
    48   Log() << Verbose(0) << buffer3 << endl;
     48  DoLog(0) && (Log() << Verbose(0) << buffer3 << endl);
    4949  Free(&buffer3);
    5050
  • src/unittests/tesselation_insideoutsideunittest.cpp

    r6613ec ra67d19  
    9494  while ((!TesselStruct->OpenLines.empty()) && (OneLoopWithoutSuccessFlag)) {
    9595    // 2a. fill all new OpenLines
    96     Log() << Verbose(1) << "There are " << TesselStruct->OpenLines.size() << " open lines to scan for candidates:" << endl;
     96    DoLog(1) && (Log() << Verbose(1) << "There are " << TesselStruct->OpenLines.size() << " open lines to scan for candidates:" << endl);
    9797    for (CandidateMap::iterator Runner = TesselStruct->OpenLines.begin(); Runner != TesselStruct->OpenLines.end(); Runner++)
    98       Log() << Verbose(2) << *(Runner->second) << endl;
     98      DoLog(2) && (Log() << Verbose(2) << *(Runner->second) << endl);
    9999
    100100    for (CandidateMap::iterator Runner = TesselStruct->OpenLines.begin(); Runner != TesselStruct->OpenLines.end(); Runner++) {
     
    102102      if (baseline->pointlist.empty()) {
    103103        T = (((baseline->BaseLine->triangles.begin()))->second);
    104         Log() << Verbose(1) << "Finding best candidate for open line " << *baseline->BaseLine << " of triangle " << *T << endl;
     104        DoLog(1) && (Log() << Verbose(1) << "Finding best candidate for open line " << *baseline->BaseLine << " of triangle " << *T << endl);
    105105        TesselationFailFlag = TesselStruct->FindNextSuitableTriangle(*baseline, *T, SPHERERADIUS, LinkedList); //the line is there, so there is a triangle, but only one.
    106106      }
     
    109109    // 2b. search for smallest ShortestAngle among all candidates
    110110    double ShortestAngle = 4.*M_PI;
    111     Log() << Verbose(1) << "There are " << TesselStruct->OpenLines.size() << " open lines to scan for the best candidates:" << endl;
     111    DoLog(1) && (Log() << Verbose(1) << "There are " << TesselStruct->OpenLines.size() << " open lines to scan for the best candidates:" << endl);
    112112    for (CandidateMap::iterator Runner = TesselStruct->OpenLines.begin(); Runner != TesselStruct->OpenLines.end(); Runner++)
    113       Log() << Verbose(2) << *(Runner->second) << endl;
     113      DoLog(2) && (Log() << Verbose(2) << *(Runner->second) << endl);
    114114
    115115    for (CandidateMap::iterator Runner = TesselStruct->OpenLines.begin(); Runner != TesselStruct->OpenLines.end(); Runner++) {
  • src/vector.cpp

    r6613ec ra67d19  
    253253  Direction.SubtractVector(Origin);
    254254  Direction.Normalize();
    255   Log() << Verbose(1) << "INFO: Direction is " << Direction << "." << endl;
     255  DoLog(1) && (Log() << Verbose(1) << "INFO: Direction is " << Direction << "." << endl);
    256256  //Log() << Verbose(1) << "INFO: PlaneNormal is " << *PlaneNormal << " and PlaneOffset is " << *PlaneOffset << "." << endl;
    257257  factor = Direction.ScalarProduct(PlaneNormal);
    258258  if (fabs(factor) < MYEPSILON) { // Uniqueness: line parallel to plane?
    259     Log() << Verbose(1) << "BAD: Line is parallel to plane, no intersection." << endl;
     259    DoLog(1) && (Log() << Verbose(1) << "BAD: Line is parallel to plane, no intersection." << endl);
    260260    return false;
    261261  }
     
    264264  factor = helper.ScalarProduct(PlaneNormal)/factor;
    265265  if (fabs(factor) < MYEPSILON) { // Origin is in-plane
    266     Log() << Verbose(1) << "GOOD: Origin of line is in-plane." << endl;
     266    DoLog(1) && (Log() << Verbose(1) << "GOOD: Origin of line is in-plane." << endl);
    267267    CopyVector(Origin);
    268268    return true;
     
    271271  Direction.Scale(factor);
    272272  CopyVector(Origin);
    273   Log() << Verbose(1) << "INFO: Scaled direction is " << Direction << "." << endl;
     273  DoLog(1) && (Log() << Verbose(1) << "INFO: Scaled direction is " << Direction << "." << endl);
    274274  AddVector(&Direction);
    275275
     
    278278  helper.SubtractVector(PlaneOffset);
    279279  if (helper.ScalarProduct(PlaneNormal) < MYEPSILON) {
    280     Log() << Verbose(1) << "GOOD: Intersection is " << *this << "." << endl;
     280    DoLog(1) && (Log() << Verbose(1) << "GOOD: Intersection is " << *this << "." << endl);
    281281    return true;
    282282  } else {
     
    359359  //}
    360360  if (fabs(M->Determinant()) > MYEPSILON) {
    361     Log() << Verbose(1) << "Determinant of coefficient matrix is NOT zero." << endl;
     361    DoLog(1) && (Log() << Verbose(1) << "Determinant of coefficient matrix is NOT zero." << endl);
    362362    return false;
    363363  }
    364   Log() << Verbose(1) << "INFO: Line1a = " << *Line1a << ", Line1b = " << *Line1b << ", Line2a = " << *Line2a << ", Line2b = " << *Line2b << "." << endl;
     364  DoLog(1) && (Log() << Verbose(1) << "INFO: Line1a = " << *Line1a << ", Line1b = " << *Line1b << ", Line2a = " << *Line2a << ", Line2b = " << *Line2b << "." << endl);
    365365
    366366
     
    378378  d.CopyVector(Line2b);
    379379  d.SubtractVector(Line1b);
    380   Log() << Verbose(1) << "INFO: a = " << a << ", b = " << b << ", c = " << c << "." << endl;
     380  DoLog(1) && (Log() << Verbose(1) << "INFO: a = " << a << ", b = " << b << ", c = " << c << "." << endl);
    381381  if ((a.NormSquared() < MYEPSILON) || (b.NormSquared() < MYEPSILON)) {
    382382   Zero();
    383    Log() << Verbose(1) << "At least one of the lines is ill-defined, i.e. offset equals second vector." << endl;
     383   DoLog(1) && (Log() << Verbose(1) << "At least one of the lines is ill-defined, i.e. offset equals second vector." << endl);
    384384   return false;
    385385  }
     
    394394    if ((factor >= -MYEPSILON) && (factor - 1. < MYEPSILON)) {
    395395      CopyVector(Line2a);
    396       Log() << Verbose(1) << "Lines conincide." << endl;
     396      DoLog(1) && (Log() << Verbose(1) << "Lines conincide." << endl);
    397397      return true;
    398398    } else {
     
    402402      if ((factor >= -MYEPSILON) && (factor - 1. < MYEPSILON)) {
    403403        CopyVector(Line2b);
    404         Log() << Verbose(1) << "Lines conincide." << endl;
     404        DoLog(1) && (Log() << Verbose(1) << "Lines conincide." << endl);
    405405        return true;
    406406      }
    407407    }
    408     Log() << Verbose(1) << "Lines are parallel." << endl;
     408    DoLog(1) && (Log() << Verbose(1) << "Lines are parallel." << endl);
    409409    Zero();
    410410    return false;
     
    418418  temp2.CopyVector(&a);
    419419  temp2.VectorProduct(&b);
    420   Log() << Verbose(1) << "INFO: temp1 = " << temp1 << ", temp2 = " << temp2 << "." << endl;
     420  DoLog(1) && (Log() << Verbose(1) << "INFO: temp1 = " << temp1 << ", temp2 = " << temp2 << "." << endl);
    421421  if (fabs(temp2.NormSquared()) > MYEPSILON)
    422422    s = temp1.ScalarProduct(&temp2)/temp2.NormSquared();
    423423  else
    424424    s = 0.;
    425   Log() << Verbose(1) << "Factor s is " << temp1.ScalarProduct(&temp2) << "/" << temp2.NormSquared() << " = " << s << "." << endl;
     425  DoLog(1) && (Log() << Verbose(1) << "Factor s is " << temp1.ScalarProduct(&temp2) << "/" << temp2.NormSquared() << " = " << s << "." << endl);
    426426
    427427  // construct intersection
     
    429429  Scale(s);
    430430  AddVector(Line1a);
    431   Log() << Verbose(1) << "Intersection is at " << *this << "." << endl;
     431  DoLog(1) && (Log() << Verbose(1) << "Intersection is at " << *this << "." << endl);
    432432
    433433  return true;
     
    702702void Vector::Output() const
    703703{
    704   Log() << Verbose(0) << "(";
     704  DoLog(0) && (Log() << Verbose(0) << "(");
    705705  for (int i=0;i<NDIM;i++) {
    706     Log() << Verbose(0) << x[i];
     706    DoLog(0) && (Log() << Verbose(0) << x[i]);
    707707    if (i != 2)
    708       Log() << Verbose(0) << ",";
    709   }
    710   Log() << Verbose(0) << ")";
     708      DoLog(0) && (Log() << Verbose(0) << ",");
     709  }
     710  DoLog(0) && (Log() << Verbose(0) << ")");
    711711};
    712712
     
    843843  projection = ScalarProduct(n)/n->ScalarProduct(n);    // remove constancy from n (keep as logical one)
    844844  // withdraw projected vector twice from original one
    845   Log() << Verbose(1) << "Vector: ";
     845  DoLog(1) && (Log() << Verbose(1) << "Vector: ");
    846846  Output();
    847   Log() << Verbose(0) << "\t";
     847  DoLog(0) && (Log() << Verbose(0) << "\t");
    848848  for (int i=NDIM;i--;)
    849849    x[i] -= 2.*projection*n->x[i];
    850   Log() << Verbose(0) << "Projected vector: ";
     850  DoLog(0) && (Log() << Verbose(0) << "Projected vector: ");
    851851  Output();
    852   Log() << Verbose(0) << endl;
     852  DoLog(0) && (Log() << Verbose(0) << endl);
    853853};
    854854
     
    954954  double norm;
    955955
    956   Log() << Verbose(4);
     956  DoLog(4) && (Log() << Verbose(4));
    957957  GivenVector->Output();
    958   Log() << Verbose(0) << endl;
     958  DoLog(0) && (Log() << Verbose(0) << endl);
    959959  for (j=NDIM;j--;)
    960960    Components[j] = -1;
     
    963963    if (fabs(GivenVector->x[j]) > MYEPSILON)
    964964      Components[Last++] = j;
    965   Log() << Verbose(4) << Last << " Components != 0: (" << Components[0] << "," << Components[1] << "," << Components[2] << ")" << endl;
     965  DoLog(4) && (Log() << Verbose(4) << Last << " Components != 0: (" << Components[0] << "," << Components[1] << "," << Components[2] << ")" << endl);
    966966
    967967  switch(Last) {
     
    10131013
    10141014  for (j=0;j<num;j++) {
    1015     Log() << Verbose(1) << j << "th atom's vector: ";
     1015    DoLog(1) && (Log() << Verbose(1) << j << "th atom's vector: ");
    10161016    (vectors[j])->Output();
    1017     Log() << Verbose(0) << endl;
     1017    DoLog(0) && (Log() << Verbose(0) << endl);
    10181018  }
    10191019
     
    11351135    j += i+1;
    11361136    do {
    1137       Log() << Verbose(0) << coords[i] << "[0.." << cell_size[j] << "]: ";
     1137      DoLog(0) && (Log() << Verbose(0) << coords[i] << "[0.." << cell_size[j] << "]: ");
    11381138      cin >> x[i];
    11391139    } while (((x[i] < 0) || (x[i] >= cell_size[j])) && (check));
     
    11661166  B2 = cos(beta) * x2->Norm() * c;
    11671167  C = c * c;
    1168   Log() << Verbose(2) << "A " << A << "\tB " << B1 << "\tC " << C << endl;
     1168  DoLog(2) && (Log() << Verbose(2) << "A " << A << "\tB " << B1 << "\tC " << C << endl);
    11691169  int flag = 0;
    11701170  if (fabs(x1->x[0]) < MYEPSILON) { // check for zero components for the later flipping and back-flipping
     
    12051205  D2 = -y->x[0]/x1->x[0]*x1->x[2]+y->x[2];
    12061206  D3 = y->x[0]/x1->x[0]*A-B1;
    1207   Log() << Verbose(2) << "D1 " << D1 << "\tD2 " << D2 << "\tD3 " << D3 << "\n";
     1207  DoLog(2) && (Log() << Verbose(2) << "D1 " << D1 << "\tD2 " << D2 << "\tD3 " << D3 << "\n");
    12081208  if (fabs(D1) < MYEPSILON) {
    1209     Log() << Verbose(2) << "D1 == 0!\n";
     1209    DoLog(2) && (Log() << Verbose(2) << "D1 == 0!\n");
    12101210    if (fabs(D2) > MYEPSILON) {
    1211       Log() << Verbose(3) << "D2 != 0!\n";
     1211      DoLog(3) && (Log() << Verbose(3) << "D2 != 0!\n");
    12121212      x[2] = -D3/D2;
    12131213      E1 = A/x1->x[0] + x1->x[2]/x1->x[0]*D3/D2;
    12141214      E2 = -x1->x[1]/x1->x[0];
    1215       Log() << Verbose(3) << "E1 " << E1 << "\tE2 " << E2 << "\n";
     1215      DoLog(3) && (Log() << Verbose(3) << "E1 " << E1 << "\tE2 " << E2 << "\n");
    12161216      F1 = E1*E1 + 1.;
    12171217      F2 = -E1*E2;
    12181218      F3 = E1*E1 + D3*D3/(D2*D2) - C;
    1219       Log() << Verbose(3) << "F1 " << F1 << "\tF2 " << F2 << "\tF3 " << F3 << "\n";
     1219      DoLog(3) && (Log() << Verbose(3) << "F1 " << F1 << "\tF2 " << F2 << "\tF3 " << F3 << "\n");
    12201220      if (fabs(F1) < MYEPSILON) {
    1221         Log() << Verbose(4) << "F1 == 0!\n";
    1222         Log() << Verbose(4) << "Gleichungssystem linear\n";
     1221        DoLog(4) && (Log() << Verbose(4) << "F1 == 0!\n");
     1222        DoLog(4) && (Log() << Verbose(4) << "Gleichungssystem linear\n");
    12231223        x[1] = F3/(2.*F2);
    12241224      } else {
    12251225        p = F2/F1;
    12261226        q = p*p - F3/F1;
    1227         Log() << Verbose(4) << "p " << p << "\tq " << q << endl;
     1227        DoLog(4) && (Log() << Verbose(4) << "p " << p << "\tq " << q << endl);
    12281228        if (q < 0) {
    1229           Log() << Verbose(4) << "q < 0" << endl;
     1229          DoLog(4) && (Log() << Verbose(4) << "q < 0" << endl);
    12301230          return false;
    12311231        }
     
    12341234      x[0] =  A/x1->x[0] - x1->x[1]/x1->x[0]*x[1] + x1->x[2]/x1->x[0]*x[2];
    12351235    } else {
    1236       Log() << Verbose(2) << "Gleichungssystem unterbestimmt\n";
     1236      DoLog(2) && (Log() << Verbose(2) << "Gleichungssystem unterbestimmt\n");
    12371237      return false;
    12381238    }
     
    12401240    E1 = A/x1->x[0]+x1->x[1]/x1->x[0]*D3/D1;
    12411241    E2 = x1->x[1]/x1->x[0]*D2/D1 - x1->x[2];
    1242     Log() << Verbose(2) << "E1 " << E1 << "\tE2 " << E2 << "\n";
     1242    DoLog(2) && (Log() << Verbose(2) << "E1 " << E1 << "\tE2 " << E2 << "\n");
    12431243    F1 = E2*E2 + D2*D2/(D1*D1) + 1.;
    12441244    F2 = -(E1*E2 + D2*D3/(D1*D1));
    12451245    F3 = E1*E1 + D3*D3/(D1*D1) - C;
    1246     Log() << Verbose(2) << "F1 " << F1 << "\tF2 " << F2 << "\tF3 " << F3 << "\n";
     1246    DoLog(2) && (Log() << Verbose(2) << "F1 " << F1 << "\tF2 " << F2 << "\tF3 " << F3 << "\n");
    12471247    if (fabs(F1) < MYEPSILON) {
    1248       Log() << Verbose(3) << "F1 == 0!\n";
    1249       Log() << Verbose(3) << "Gleichungssystem linear\n";
     1248      DoLog(3) && (Log() << Verbose(3) << "F1 == 0!\n");
     1249      DoLog(3) && (Log() << Verbose(3) << "Gleichungssystem linear\n");
    12501250      x[2] = F3/(2.*F2);
    12511251    } else {
    12521252      p = F2/F1;
    12531253      q = p*p - F3/F1;
    1254       Log() << Verbose(3) << "p " << p << "\tq " << q << endl;
     1254      DoLog(3) && (Log() << Verbose(3) << "p " << p << "\tq " << q << endl);
    12551255      if (q < 0) {
    1256         Log() << Verbose(3) << "q < 0" << endl;
     1256        DoLog(3) && (Log() << Verbose(3) << "q < 0" << endl);
    12571257        return false;
    12581258      }
     
    12921292    for (j=2;j>=0;j--) {
    12931293      k = (i & pot(2,j)) << j;
    1294       Log() << Verbose(2) << "k " << k << "\tpot(2,j) " << pot(2,j) << endl;
     1294      DoLog(2) && (Log() << Verbose(2) << "k " << k << "\tpot(2,j) " << pot(2,j) << endl);
    12951295      sign[j] = (k == 0) ? 1. : -1.;
    12961296    }
    1297     Log() << Verbose(2) << i << ": sign matrix is " << sign[0] << "\t" << sign[1] << "\t" << sign[2] << "\n";
     1297    DoLog(2) && (Log() << Verbose(2) << i << ": sign matrix is " << sign[0] << "\t" << sign[1] << "\t" << sign[2] << "\n");
    12981298    // apply sign matrix
    12991299    for (j=NDIM;j--;)
     
    13011301    // calculate angle and check
    13021302    ang = x2->Angle (this);
    1303     Log() << Verbose(1) << i << "th angle " << ang << "\tbeta " << cos(beta) << " :\t";
     1303    DoLog(1) && (Log() << Verbose(1) << i << "th angle " << ang << "\tbeta " << cos(beta) << " :\t");
    13041304    if (fabs(ang - cos(beta)) < MYEPSILON) {
    13051305      break;
Note: See TracChangeset for help on using the changeset viewer.