Ignore:
Timestamp:
Apr 27, 2010, 2:25:42 PM (15 years ago)
Author:
Frederik Heber <heber@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
Children:
632bc3
Parents:
13d5a9 (diff), c695c9 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'Analysis_PairCorrelation' into StructureRefactoring

Conflicts:

molecuilder/src/Makefile.am
molecuilder/src/World.cpp
molecuilder/src/World.hpp
molecuilder/src/boundary.cpp
molecuilder/src/builder.cpp
molecuilder/src/log.cpp
molecuilder/src/moleculelist.cpp
molecuilder/src/periodentafel.cpp
molecuilder/src/tesselation.cpp
molecuilder/src/unittests/AnalysisCorrelationToSurfaceUnitTest.cpp
molecuilder/src/unittests/Makefile.am
molecuilder/src/unittests/bondgraphunittest.cpp
molecuilder/src/unittests/gslvectorunittest.cpp
molecuilder/src/unittests/logunittest.cpp
molecuilder/src/unittests/tesselation_boundarytriangleunittest.hpp
molecuilder/src/vector.cpp
molecuilder/tests/Tesselations/defs.in

Conflicts have been many and too numerous to listen here, just the few general cases

  • new molecule() replaced by World::getInstance().createMolecule()
  • new atom() replaced by World::getInstance().createAtom() where appropriate.
  • Some DoLog()s added interfered with changes to the message produced by Log() << Verbose(.) << ...
  • DoLog() has been erroneously added to TestRunner.cpp as well, there cout is appropriate
  • ...

Additionally, there was a bug in atom::clone(), sort was set to atom::nr of the atom to clone not of the clone itself. This caused a failure of the fragmentation.

This merge has been fully checked from a clean build directory with subsequent configure,make all install and make check.
It configures, compiles and runs all test cases and the test suite without errors.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/molecule_graph.cpp

    r13d5a9 r5f612ee  
    1717#include "memoryallocator.hpp"
    1818#include "molecule.hpp"
     19#include "World.hpp"
    1920
    2021struct BFSAccounting
     
    5859
    5960  if (!input) {
    60     Log() << Verbose(1) << "Opening silica failed \n";
     61    DoLog(1) && (Log() << Verbose(1) << "Opening silica failed \n");
    6162  };
    6263
    6364  *input >> ws >> atom1;
    6465  *input >> ws >> atom2;
    65   Log() << Verbose(1) << "Scanning file\n";
     66  DoLog(1) && (Log() << Verbose(1) << "Scanning file\n");
    6667  while (!input->eof()) // Check whether we read everything already
    6768  {
     
    106107  LinkedCell *LC = NULL;
    107108  bool free_BG = false;
     109  double * const cell_size = World::getInstance().getDomain();
    108110
    109111  if (BG == NULL) {
     
    113115
    114116  BondDistance = bonddistance; // * ((IsAngstroem) ? 1. : 1./AtomicLengthToAngstroem);
    115   Log() << Verbose(0) << "Begin of CreateAdjacencyList." << endl;
     117  DoLog(0) && (Log() << Verbose(0) << "Begin of CreateAdjacencyList." << endl);
    116118  // remove every bond from the list
    117119  bond *Binder = NULL;
     
    126128  // count atoms in molecule = dimension of matrix (also give each unique name and continuous numbering)
    127129  CountAtoms();
    128   Log() << Verbose(1) << "AtomCount " << AtomCount << " and bonddistance is " << bonddistance << "." << endl;
     130  DoLog(1) && (Log() << Verbose(1) << "AtomCount " << AtomCount << " and bonddistance is " << bonddistance << "." << endl);
    129131
    130132  if ((AtomCount > 1) && (bonddistance > 1.)) {
    131     Log() << Verbose(2) << "Creating Linked Cell structure ... " << endl;
     133    DoLog(2) && (Log() << Verbose(2) << "Creating Linked Cell structure ... " << endl);
    132134    LC = new LinkedCell(this, bonddistance);
    133135
    134136    // create a list to map Tesselpoint::nr to atom *
    135     Log() << Verbose(2) << "Creating TesselPoint to atom map ... " << endl;
     137    DoLog(2) && (Log() << Verbose(2) << "Creating TesselPoint to atom map ... " << endl);
    136138    AtomMap = Calloc<atom *> (AtomCount, "molecule::CreateAdjacencyList - **AtomCount");
    137139    Walker = start;
     
    142144
    143145    // 3a. go through every cell
    144     Log() << Verbose(2) << "Celling ... " << endl;
     146    DoLog(2) && (Log() << Verbose(2) << "Celling ... " << endl);
    145147    for (LC->n[0] = 0; LC->n[0] < LC->N[0]; LC->n[0]++)
    146148      for (LC->n[1] = 0; LC->n[1] < LC->N[1]; LC->n[1]++)
    147149        for (LC->n[2] = 0; LC->n[2] < LC->N[2]; LC->n[2]++) {
    148           const LinkedNodes *List = LC->GetCurrentCell();
    149           //Log() << Verbose(2) << "Current cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << " containing " << List->size() << " points." << endl;
     150          const LinkedCell::LinkedNodes *List = LC->GetCurrentCell();
     151//          Log() << Verbose(2) << "Current cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << " containing " << List->size() << " points." << endl;
    150152          if (List != NULL) {
    151             for (LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
     153            for (LinkedCell::LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
    152154              Walker = AtomMap[(*Runner)->nr];
    153               //Log() << Verbose(0) << "Current Atom is " << *Walker << "." << endl;
     155//              Log() << Verbose(0) << "Current Atom is " << *Walker << "." << endl;
    154156              // 3c. check for possible bond between each atom in this and every one in the 27 cells
    155157              for (n[0] = -1; n[0] <= 1; n[0]++)
    156158                for (n[1] = -1; n[1] <= 1; n[1]++)
    157159                  for (n[2] = -1; n[2] <= 1; n[2]++) {
    158                     const LinkedNodes *OtherList = LC->GetRelativeToCurrentCell(n);
    159                     //Log() << Verbose(2) << "Current relative cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << " containing " << List->size() << " points." << endl;
     160                    const LinkedCell::LinkedNodes *OtherList = LC->GetRelativeToCurrentCell(n);
     161//                    Log() << Verbose(2) << "Current relative cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << " containing " << List->size() << " points." << endl;
    160162                    if (OtherList != NULL) {
    161                       for (LinkedNodes::const_iterator OtherRunner = OtherList->begin(); OtherRunner != OtherList->end(); OtherRunner++) {
     163                      for (LinkedCell::LinkedNodes::const_iterator OtherRunner = OtherList->begin(); OtherRunner != OtherList->end(); OtherRunner++) {
    162164                        if ((*OtherRunner)->nr > Walker->nr) {
    163165                          OtherWalker = AtomMap[(*OtherRunner)->nr];
    164                           //Log() << Verbose(1) << "Checking distance " << OtherWalker->x.PeriodicDistanceSquared(&(Walker->x), cell_size) << " against typical bond length of " << bonddistance*bonddistance << "." << endl;
     166//                          Log() << Verbose(0) << "Current other Atom is " << *OtherWalker << "." << endl;
     167                          const double distance = OtherWalker->x.PeriodicDistanceSquared(&(Walker->x), cell_size);
     168//                          Log() << Verbose(1) << "Checking distance " << distance << " against typical bond length of " << bonddistance*bonddistance << "." << endl;
    165169                          (BG->*minmaxdistance)(Walker, OtherWalker, MinDistance, MaxDistance, IsAngstroem);
    166                           const double distance = OtherWalker->x.PeriodicDistanceSquared(&(Walker->x), cell_size);
    167170                          const bool status = (distance <= MaxDistance * MaxDistance) && (distance >= MinDistance * MinDistance);
    168                           if ((OtherWalker->father->nr > Walker->father->nr) && (status)) { // create bond if distance is smaller
    169                             //Log() << Verbose(1) << "Adding Bond between " << *Walker << " and " << *OtherWalker << " in distance " << sqrt(distance) << "." << endl;
    170                             AddBond(Walker->father, OtherWalker->father, 1); // also increases molecule::BondCount
     171//                          Log() << Verbose(1) << "MinDistance is " << MinDistance << " and MaxDistance is " << MaxDistance << "." << endl;
     172                          if (OtherWalker->father->nr > Walker->father->nr) {
     173                            if (status) { // create bond if distance is smaller
     174//                              Log() << Verbose(1) << "Adding Bond between " << *Walker << " and " << *OtherWalker << " in distance " << sqrt(distance) << "." << endl;
     175                              AddBond(Walker->father, OtherWalker->father, 1); // also increases molecule::BondCount
     176                            } else {
     177//                              Log() << Verbose(1) << "Not Adding: distance too great." << endl;
     178                            }
    171179                          } else {
    172                             //Log() << Verbose(1) << "Not Adding: Wrong label order or distance too great." << endl;
     180//                            Log() << Verbose(1) << "Not Adding: Wrong order of labels." << endl;
    173181                          }
    174182                        }
     
    181189    Free(&AtomMap);
    182190    delete (LC);
    183     Log() << Verbose(1) << "I detected " << BondCount << " bonds in the molecule with distance " << BondDistance << "." << endl;
     191    DoLog(1) && (Log() << Verbose(1) << "I detected " << BondCount << " bonds in the molecule with distance " << BondDistance << "." << endl);
    184192
    185193    // correct bond degree by comparing valence and bond degree
    186     Log() << Verbose(2) << "Correcting bond degree ... " << endl;
     194    DoLog(2) && (Log() << Verbose(2) << "Correcting bond degree ... " << endl);
    187195    CorrectBondDegree();
    188196
     
    190198    ActOnAllAtoms( &atom::OutputBondOfAtom );
    191199  } else
    192     Log() << Verbose(1) << "AtomCount is " << AtomCount << ", thus no bonds, no connections!." << endl;
    193   Log() << Verbose(0) << "End of CreateAdjacencyList." << endl;
     200    DoLog(1) && (Log() << Verbose(1) << "AtomCount is " << AtomCount << ", thus no bonds, no connections!." << endl);
     201  DoLog(0) && (Log() << Verbose(0) << "End of CreateAdjacencyList." << endl);
    194202  if (free_BG)
    195203    delete(BG);
     
    202210void molecule::OutputBondsList() const
    203211{
    204   Log() << Verbose(1) << endl << "From contents of bond chain list:";
     212  DoLog(1) && (Log() << Verbose(1) << endl << "From contents of bond chain list:");
    205213  bond *Binder = first;
    206214  while (Binder->next != last) {
    207215    Binder = Binder->next;
    208     Log() << Verbose(0) << *Binder << "\t" << endl;
    209   }
    210   Log() << Verbose(0) << endl;
     216    DoLog(0) && (Log() << Verbose(0) << *Binder << "\t" << endl);
     217  }
     218  DoLog(0) && (Log() << Verbose(0) << endl);
    211219}
    212220;
     
    225233
    226234  if (BondCount != 0) {
    227     Log() << Verbose(1) << "Correcting Bond degree of each bond ... " << endl;
     235    DoLog(1) && (Log() << Verbose(1) << "Correcting Bond degree of each bond ... " << endl);
    228236    do {
    229237      OldNo = No;
    230238      No = SumPerAtom( &atom::CorrectBondDegree );
    231239    } while (OldNo != No);
    232     Log() << Verbose(0) << " done." << endl;
     240    DoLog(0) && (Log() << Verbose(0) << " done." << endl);
    233241  } else {
    234     Log() << Verbose(1) << "BondCount is " << BondCount << ", no bonds between any of the " << AtomCount << " atoms." << endl;
    235   }
    236   Log() << Verbose(0) << No << " bonds could not be corrected." << endl;
     242    DoLog(1) && (Log() << Verbose(1) << "BondCount is " << BondCount << ", no bonds between any of the " << AtomCount << " atoms." << endl);
     243  }
     244  DoLog(0) && (Log() << Verbose(0) << No << " bonds could not be corrected." << endl);
    237245
    238246  return (No);
     
    253261  bond *Binder = first;
    254262  if ((Binder->next != last) && (Binder->next->Type == Undetermined)) {
    255     Log() << Verbose(0) << "No Depth-First-Search analysis performed so far, calling ..." << endl;
     263    DoLog(0) && (Log() << Verbose(0) << "No Depth-First-Search analysis performed so far, calling ..." << endl);
    256264    Subgraphs = DepthFirstSearchAnalysis(BackEdgeStack);
    257265    while (Subgraphs->next != NULL) {
     
    308316    Walker->GraphNr = DFS.CurrentGraphNr;
    309317    Walker->LowpointNr = DFS.CurrentGraphNr;
    310     Log() << Verbose(1) << "Setting Walker[" << Walker->Name << "]'s number to " << Walker->GraphNr << " with Lowpoint " << Walker->LowpointNr << "." << endl;
     318    DoLog(1) && (Log() << Verbose(1) << "Setting Walker[" << Walker->Name << "]'s number to " << Walker->GraphNr << " with Lowpoint " << Walker->LowpointNr << "." << endl);
    311319    DFS.AtomStack->Push(Walker);
    312320    DFS.CurrentGraphNr++;
     
    335343    if (Binder == NULL)
    336344      break;
    337     Log() << Verbose(2) << "Current Unused Bond is " << *Binder << "." << endl;
     345    DoLog(2) && (Log() << Verbose(2) << "Current Unused Bond is " << *Binder << "." << endl);
    338346    // (4) Mark Binder used, ...
    339347    Binder->MarkUsed(black);
    340348    OtherAtom = Binder->GetOtherAtom(Walker);
    341     Log() << Verbose(2) << "(4) OtherAtom is " << OtherAtom->Name << "." << endl;
     349    DoLog(2) && (Log() << Verbose(2) << "(4) OtherAtom is " << OtherAtom->Name << "." << endl);
    342350    if (OtherAtom->GraphNr != -1) {
    343351      // (4a) ... if "other" atom has been visited (GraphNr != 0), set lowpoint to minimum of both, go to (3)
     
    345353      DFS.BackEdgeStack->Push(Binder);
    346354      Walker->LowpointNr = (Walker->LowpointNr < OtherAtom->GraphNr) ? Walker->LowpointNr : OtherAtom->GraphNr;
    347       Log() << Verbose(3) << "(4a) Visited: Setting Lowpoint of Walker[" << Walker->Name << "] to " << Walker->LowpointNr << "." << endl;
     355      DoLog(3) && (Log() << Verbose(3) << "(4a) Visited: Setting Lowpoint of Walker[" << Walker->Name << "] to " << Walker->LowpointNr << "." << endl);
    348356    } else {
    349357      // (4b) ... otherwise set OtherAtom as Ancestor of Walker and Walker as OtherAtom, go to (2)
     
    351359      OtherAtom->Ancestor = Walker;
    352360      Walker = OtherAtom;
    353       Log() << Verbose(3) << "(4b) Not Visited: OtherAtom[" << OtherAtom->Name << "]'s Ancestor is now " << OtherAtom->Ancestor->Name << ", Walker is OtherAtom " << OtherAtom->Name << "." << endl;
     361      DoLog(3) && (Log() << Verbose(3) << "(4b) Not Visited: OtherAtom[" << OtherAtom->Name << "]'s Ancestor is now " << OtherAtom->Ancestor->Name << ", Walker is OtherAtom " << OtherAtom->Name << "." << endl);
    354362      break;
    355363    }
     
    373381
    374382  // (5) if Ancestor of Walker is ...
    375   Log() << Verbose(1) << "(5) Number of Walker[" << Walker->Name << "]'s Ancestor[" << Walker->Ancestor->Name << "] is " << Walker->Ancestor->GraphNr << "." << endl;
     383  DoLog(1) && (Log() << Verbose(1) << "(5) Number of Walker[" << Walker->Name << "]'s Ancestor[" << Walker->Ancestor->Name << "] is " << Walker->Ancestor->GraphNr << "." << endl);
    376384
    377385  if (Walker->Ancestor->GraphNr != DFS.Root->GraphNr) {
     
    380388      // (6a) set Ancestor's Lowpoint number to minimum of of its Ancestor and itself, go to Step(8)
    381389      Walker->Ancestor->LowpointNr = (Walker->Ancestor->LowpointNr < Walker->LowpointNr) ? Walker->Ancestor->LowpointNr : Walker->LowpointNr;
    382       Log() << Verbose(2) << "(6) Setting Walker[" << Walker->Name << "]'s Ancestor[" << Walker->Ancestor->Name << "]'s Lowpoint to " << Walker->Ancestor->LowpointNr << "." << endl;
     390      DoLog(2) && (Log() << Verbose(2) << "(6) Setting Walker[" << Walker->Name << "]'s Ancestor[" << Walker->Ancestor->Name << "]'s Lowpoint to " << Walker->Ancestor->LowpointNr << "." << endl);
    383391    } else {
    384392      // (7) (Ancestor of Walker is a separating vertex, remove all from stack till Walker (including), these and Ancestor form a component
    385393      Walker->Ancestor->SeparationVertex = true;
    386       Log() << Verbose(2) << "(7) Walker[" << Walker->Name << "]'s Ancestor[" << Walker->Ancestor->Name << "]'s is a separating vertex, creating component." << endl;
     394      DoLog(2) && (Log() << Verbose(2) << "(7) Walker[" << Walker->Name << "]'s Ancestor[" << Walker->Ancestor->Name << "]'s is a separating vertex, creating component." << endl);
    387395      mol->SetNextComponentNumber(Walker->Ancestor, DFS.ComponentNumber);
    388       Log() << Verbose(3) << "(7) Walker[" << Walker->Name << "]'s Ancestor's Compont is " << DFS.ComponentNumber << "." << endl;
     396      DoLog(3) && (Log() << Verbose(3) << "(7) Walker[" << Walker->Name << "]'s Ancestor's Compont is " << DFS.ComponentNumber << "." << endl);
    389397      mol->SetNextComponentNumber(Walker, DFS.ComponentNumber);
    390       Log() << Verbose(3) << "(7) Walker[" << Walker->Name << "]'s Compont is " << DFS.ComponentNumber << "." << endl;
     398      DoLog(3) && (Log() << Verbose(3) << "(7) Walker[" << Walker->Name << "]'s Compont is " << DFS.ComponentNumber << "." << endl);
    391399      do {
    392400        OtherAtom = DFS.AtomStack->PopLast();
    393401        LeafWalker->Leaf->AddCopyAtom(OtherAtom);
    394402        mol->SetNextComponentNumber(OtherAtom, DFS.ComponentNumber);
    395         Log() << Verbose(3) << "(7) Other[" << OtherAtom->Name << "]'s Compont is " << DFS.ComponentNumber << "." << endl;
     403        DoLog(3) && (Log() << Verbose(3) << "(7) Other[" << OtherAtom->Name << "]'s Compont is " << DFS.ComponentNumber << "." << endl);
    396404      } while (OtherAtom != Walker);
    397405      DFS.ComponentNumber++;
    398406    }
    399407    // (8) Walker becomes its Ancestor, go to (3)
    400     Log() << Verbose(2) << "(8) Walker[" << Walker->Name << "] is now its Ancestor " << Walker->Ancestor->Name << ", backstepping. " << endl;
     408    DoLog(2) && (Log() << Verbose(2) << "(8) Walker[" << Walker->Name << "] is now its Ancestor " << Walker->Ancestor->Name << ", backstepping. " << endl);
    401409    Walker = Walker->Ancestor;
    402410    DFS.BackStepping = true;
     
    422430    //DFS.AtomStack->Output(out);
    423431    mol->SetNextComponentNumber(DFS.Root, DFS.ComponentNumber);
    424     Log() << Verbose(3) << "(9) Root[" << DFS.Root->Name << "]'s Component is " << DFS.ComponentNumber << "." << endl;
     432    DoLog(3) && (Log() << Verbose(3) << "(9) Root[" << DFS.Root->Name << "]'s Component is " << DFS.ComponentNumber << "." << endl);
    425433    mol->SetNextComponentNumber(Walker, DFS.ComponentNumber);
    426     Log() << Verbose(3) << "(9) Walker[" << Walker->Name << "]'s Component is " << DFS.ComponentNumber << "." << endl;
     434    DoLog(3) && (Log() << Verbose(3) << "(9) Walker[" << Walker->Name << "]'s Component is " << DFS.ComponentNumber << "." << endl);
    427435    do {
    428436      OtherAtom = DFS.AtomStack->PopLast();
    429437      LeafWalker->Leaf->AddCopyAtom(OtherAtom);
    430438      mol->SetNextComponentNumber(OtherAtom, DFS.ComponentNumber);
    431       Log() << Verbose(3) << "(7) Other[" << OtherAtom->Name << "]'s Compont is " << DFS.ComponentNumber << "." << endl;
     439      DoLog(3) && (Log() << Verbose(3) << "(7) Other[" << OtherAtom->Name << "]'s Compont is " << DFS.ComponentNumber << "." << endl);
    432440    } while (OtherAtom != Walker);
    433441    DFS.ComponentNumber++;
     
    436444    Walker = DFS.Root;
    437445    Binder = mol->FindNextUnused(Walker);
    438     Log() << Verbose(1) << "(10) Walker is Root[" << DFS.Root->Name << "], next Unused Bond is " << Binder << "." << endl;
     446    DoLog(1) && (Log() << Verbose(1) << "(10) Walker is Root[" << DFS.Root->Name << "], next Unused Bond is " << Binder << "." << endl);
    439447    if (Binder != NULL) { // Root is separation vertex
    440       Log() << Verbose(1) << "(11) Root is a separation vertex." << endl;
     448      DoLog(1) && (Log() << Verbose(1) << "(11) Root is a separation vertex." << endl);
    441449      Walker->SeparationVertex = true;
    442450    }
     
    493501  bond *Binder = NULL;
    494502
    495   Log() << Verbose(0) << "Begin of DepthFirstSearchAnalysis" << endl;
     503  if (AtomCount == 0)
     504    return SubGraphs;
     505  DoLog(0) && (Log() << Verbose(0) << "Begin of DepthFirstSearchAnalysis" << endl);
    496506  DepthFirstSearchAnalysis_Init(DFS, this);
    497507
     
    503513    // put into new subgraph molecule and add this to list of subgraphs
    504514    LeafWalker = new MoleculeLeafClass(LeafWalker);
    505     LeafWalker->Leaf = new molecule(elemente);
     515    LeafWalker->Leaf = World::getInstance().createMolecule();
    506516    LeafWalker->Leaf->AddCopyAtom(DFS.Root);
    507517
     
    515525
    516526        if (Binder == NULL) {
    517           Log() << Verbose(2) << "No more Unused Bonds." << endl;
     527          DoLog(2) && (Log() << Verbose(2) << "No more Unused Bonds." << endl);
    518528          break;
    519529        } else
     
    532542
    533543    // From OldGraphNr to CurrentGraphNr ranges an disconnected subgraph
    534     Log() << Verbose(0) << "Disconnected subgraph ranges from " << OldGraphNr << " to " << DFS.CurrentGraphNr << "." << endl;
     544    DoLog(0) && (Log() << Verbose(0) << "Disconnected subgraph ranges from " << OldGraphNr << " to " << DFS.CurrentGraphNr << "." << endl);
    535545    LeafWalker->Leaf->Output((ofstream *)&cout);
    536     Log() << Verbose(0) << endl;
     546    DoLog(0) && (Log() << Verbose(0) << endl);
    537547
    538548    // step on to next root
     
    552562  // free all and exit
    553563  DepthFirstSearchAnalysis_Finalize(DFS);
    554   Log() << Verbose(0) << "End of DepthFirstSearchAnalysis" << endl;
     564  DoLog(0) && (Log() << Verbose(0) << "End of DepthFirstSearchAnalysis" << endl);
    555565  return SubGraphs;
    556566}
     
    578588void molecule::OutputGraphInfoPerAtom() const
    579589{
    580   Log() << Verbose(1) << "Final graph info for each atom is:" << endl;
     590  DoLog(1) && (Log() << Verbose(1) << "Final graph info for each atom is:" << endl);
    581591  ActOnAllAtoms( &atom::OutputGraphInfo );
    582592}
     
    588598void molecule::OutputGraphInfoPerBond() const
    589599{
    590   Log() << Verbose(1) << "Final graph info for each bond is:" << endl;
     600  DoLog(1) && (Log() << Verbose(1) << "Final graph info for each bond is:" << endl);
    591601  bond *Binder = first;
    592602  while (Binder->next != last) {
    593603    Binder = Binder->next;
    594     Log() << Verbose(2) << ((Binder->Type == TreeEdge) ? "TreeEdge " : "BackEdge ") << *Binder << ": <";
    595     Log() << Verbose(0) << ((Binder->leftatom->SeparationVertex) ? "SP," : "") << "L" << Binder->leftatom->LowpointNr << " G" << Binder->leftatom->GraphNr << " Comp.";
     604    DoLog(2) && (Log() << Verbose(2) << ((Binder->Type == TreeEdge) ? "TreeEdge " : "BackEdge ") << *Binder << ": <");
     605    DoLog(0) && (Log() << Verbose(0) << ((Binder->leftatom->SeparationVertex) ? "SP," : "") << "L" << Binder->leftatom->LowpointNr << " G" << Binder->leftatom->GraphNr << " Comp.");
    596606    Binder->leftatom->OutputComponentNumber();
    597     Log() << Verbose(0) << " ===  ";
    598     Log() << Verbose(0) << ((Binder->rightatom->SeparationVertex) ? "SP," : "") << "L" << Binder->rightatom->LowpointNr << " G" << Binder->rightatom->GraphNr << " Comp.";
     607    DoLog(0) && (Log() << Verbose(0) << " ===  ");
     608    DoLog(0) && (Log() << Verbose(0) << ((Binder->rightatom->SeparationVertex) ? "SP," : "") << "L" << Binder->rightatom->LowpointNr << " G" << Binder->rightatom->GraphNr << " Comp.");
    599609    Binder->rightatom->OutputComponentNumber();
    600     Log() << Verbose(0) << ">." << endl;
     610    DoLog(0) && (Log() << Verbose(0) << ">." << endl);
    601611    if (Binder->Cyclic) // cyclic ??
    602       Log() << Verbose(3) << "Lowpoint at each side are equal: CYCLIC!" << endl;
     612      DoLog(3) && (Log() << Verbose(3) << "Lowpoint at each side are equal: CYCLIC!" << endl);
    603613  }
    604614}
     
    674684  do { // look for Root
    675685    Walker = BFS.BFSStack->PopFirst();
    676     Log() << Verbose(2) << "Current Walker is " << *Walker << ", we look for SP to Root " << *BFS.Root << "." << endl;
     686    DoLog(2) && (Log() << Verbose(2) << "Current Walker is " << *Walker << ", we look for SP to Root " << *BFS.Root << "." << endl);
    677687    for (BondList::const_iterator Runner = Walker->ListOfBonds.begin(); Runner != Walker->ListOfBonds.end(); (++Runner)) {
    678688      if ((*Runner) != BackEdge) { // only walk along DFS spanning tree (otherwise we always find SP of one being backedge Binder)
     
    681691        if (OtherAtom->type->Z != 1) {
    682692#endif
    683         Log() << Verbose(2) << "Current OtherAtom is: " << OtherAtom->Name << " for bond " << *(*Runner) << "." << endl;
     693        DoLog(2) && (Log() << Verbose(2) << "Current OtherAtom is: " << OtherAtom->Name << " for bond " << *(*Runner) << "." << endl);
    684694        if (BFS.ColorList[OtherAtom->nr] == white) {
    685695          BFS.TouchedStack->Push(OtherAtom);
     
    687697          BFS.PredecessorList[OtherAtom->nr] = Walker; // Walker is the predecessor
    688698          BFS.ShortestPathList[OtherAtom->nr] = BFS.ShortestPathList[Walker->nr] + 1;
    689           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;
     699          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);
    690700          //if (BFS.ShortestPathList[OtherAtom->nr] < MinimumRingSize[Walker->GetTrueFather()->nr]) { // Check for maximum distance
    691           Log() << Verbose(3) << "Putting OtherAtom into queue." << endl;
     701          DoLog(3) && (Log() << Verbose(3) << "Putting OtherAtom into queue." << endl);
    692702          BFS.BFSStack->Push(OtherAtom);
    693703          //}
    694704        } else {
    695           Log() << Verbose(3) << "Not Adding, has already been visited." << endl;
     705          DoLog(3) && (Log() << Verbose(3) << "Not Adding, has already been visited." << endl);
    696706        }
    697707        if (OtherAtom == BFS.Root)
     
    699709#ifdef ADDHYDROGEN
    700710      } else {
    701         Log() << Verbose(2) << "Skipping hydrogen atom " << *OtherAtom << "." << endl;
     711        DoLog(2) && (Log() << Verbose(2) << "Skipping hydrogen atom " << *OtherAtom << "." << endl);
    702712        BFS.ColorList[OtherAtom->nr] = black;
    703713      }
    704714#endif
    705715      } else {
    706         Log() << Verbose(2) << "Bond " << *(*Runner) << " not Visiting, is the back edge." << endl;
     716        DoLog(2) && (Log() << Verbose(2) << "Bond " << *(*Runner) << " not Visiting, is the back edge." << endl);
    707717      }
    708718    }
    709719    BFS.ColorList[Walker->nr] = black;
    710     Log() << Verbose(1) << "Coloring Walker " << Walker->Name << " black." << endl;
     720    DoLog(1) && (Log() << Verbose(1) << "Coloring Walker " << Walker->Name << " black." << endl);
    711721    if (OtherAtom == BFS.Root) { // if we have found the root, check whether this cycle wasn't already found beforehand
    712722      // step through predecessor list
     
    718728      }
    719729      if (OtherAtom == BackEdge->rightatom) { // if each atom in found cycle is cyclic, loop's been found before already
    720         Log() << Verbose(3) << "This cycle was already found before, skipping and removing seeker from search." << endl;
     730        DoLog(3) && (Log() << Verbose(3) << "This cycle was already found before, skipping and removing seeker from search." << endl);
    721731        do {
    722732          OtherAtom = BFS.TouchedStack->PopLast();
    723733          if (BFS.PredecessorList[OtherAtom->nr] == Walker) {
    724             Log() << Verbose(4) << "Removing " << *OtherAtom << " from lists and stacks." << endl;
     734            DoLog(4) && (Log() << Verbose(4) << "Removing " << *OtherAtom << " from lists and stacks." << endl);
    725735            BFS.PredecessorList[OtherAtom->nr] = NULL;
    726736            BFS.ShortestPathList[OtherAtom->nr] = -1;
     
    756766    RingSize = 1;
    757767    BFS.Root->GetTrueFather()->IsCyclic = true;
    758     Log() << Verbose(1) << "Found ring contains: ";
     768    DoLog(1) && (Log() << Verbose(1) << "Found ring contains: ");
    759769    Walker = BFS.Root;
    760770    while (Walker != BackEdge->rightatom) {
    761       Log() << Verbose(0) << Walker->Name << " <-> ";
     771      DoLog(0) && (Log() << Verbose(0) << Walker->Name << " <-> ");
    762772      Walker = BFS.PredecessorList[Walker->nr];
    763773      Walker->GetTrueFather()->IsCyclic = true;
    764774      RingSize++;
    765775    }
    766     Log() << Verbose(0) << Walker->Name << "  with a length of " << RingSize << "." << endl << endl;
     776    DoLog(0) && (Log() << Verbose(0) << Walker->Name << "  with a length of " << RingSize << "." << endl << endl);
    767777    // walk through all and set MinimumRingSize
    768778    Walker = BFS.Root;
     
    776786      MinRingSize = RingSize;
    777787  } else {
    778     Log() << Verbose(1) << "No ring containing " << *BFS.Root << " with length equal to or smaller than " << MinimumRingSize[Walker->GetTrueFather()->nr] << " found." << endl;
     788    DoLog(1) && (Log() << Verbose(1) << "No ring containing " << *BFS.Root << " with length equal to or smaller than " << MinimumRingSize[Walker->GetTrueFather()->nr] << " found." << endl);
    779789  }
    780790};
     
    854864
    855865      }
    856       Log() << Verbose(1) << "Minimum ring size of " << *Root << " is " << MinimumRingSize[Root->GetTrueFather()->nr] << "." << endl;
    857     }
    858     Log() << Verbose(1) << "Minimum ring size is " << MinRingSize << ", over " << NumCycles << " cycles total." << endl;
     866      DoLog(1) && (Log() << Verbose(1) << "Minimum ring size of " << *Root << " is " << MinimumRingSize[Root->GetTrueFather()->nr] << "." << endl);
     867    }
     868    DoLog(1) && (Log() << Verbose(1) << "Minimum ring size is " << MinRingSize << ", over " << NumCycles << " cycles total." << endl);
    859869  } else
    860     Log() << Verbose(1) << "No rings were detected in the molecular structure." << endl;
     870    DoLog(1) && (Log() << Verbose(1) << "No rings were detected in the molecular structure." << endl);
    861871}
    862872;
     
    886896  //BackEdgeStack->Output(out);
    887897
    888   Log() << Verbose(1) << "Analysing cycles ... " << endl;
     898  DoLog(1) && (Log() << Verbose(1) << "Analysing cycles ... " << endl);
    889899  NumCycles = 0;
    890900  while (!BackEdgeStack->IsEmpty()) {
     
    897907    ResetBFSAccounting(Walker, BFS);
    898908
    899     Log() << Verbose(1) << "---------------------------------------------------------------------------------------------------------" << endl;
     909    DoLog(1) && (Log() << Verbose(1) << "---------------------------------------------------------------------------------------------------------" << endl);
    900910    OtherAtom = NULL;
    901911    CyclicStructureAnalysis_CyclicBFSFromRootToRoot(BackEdge, BFS);
     
    927937    }
    928938    if (i == vertex->ListOfBonds.size()) {
    929       eLog() << Verbose(0) << "Error: All Component entries are already occupied!" << endl;
     939      DoeLog(0) && (eLog()<< Verbose(0) << "Error: All Component entries are already occupied!" << endl);
    930940      performCriticalExit();
    931941    }
    932942  } else {
    933     eLog() << Verbose(0) << "Error: Given vertex is NULL!" << endl;
     943    DoeLog(0) && (eLog()<< Verbose(0) << "Error: Given vertex is NULL!" << endl);
    934944    performCriticalExit();
    935945  }
     
    969979void OutputAlreadyVisited(int *list)
    970980{
    971   Log() << Verbose(4) << "Already Visited Bonds:\t";
     981  DoLog(4) && (Log() << Verbose(4) << "Already Visited Bonds:\t");
    972982  for (int i = 1; i <= list[0]; i++)
    973     Log() << Verbose(0) << list[i] << "  ";
    974   Log() << Verbose(0) << endl;
     983    DoLog(0) && (Log() << Verbose(0) << list[i] << "  ");
     984  DoLog(0) && (Log() << Verbose(0) << endl);
    975985}
    976986;
     
    978988/** Storing the bond structure of a molecule to file.
    979989 * Simply stores Atom::nr and then the Atom::nr of all bond partners per line.
    980  * \param *out output stream for debugging
    981990 * \param *path path to file
     991 * \param *filename name of file
    982992 * \return true - file written successfully, false - writing failed
    983993 */
    984 bool molecule::StoreAdjacencyToFile(char *path)
     994bool molecule::StoreAdjacencyToFile(char *path, char *filename)
    985995{
    986996  ofstream AdjacencyFile;
     
    988998  bool status = true;
    989999
    990   line << path << "/" << FRAGMENTPREFIX << ADJACENCYFILE;
     1000  if (path != NULL)
     1001    line << path << "/" << filename;
     1002  else
     1003    line << filename;
    9911004  AdjacencyFile.open(line.str().c_str(), ios::out);
    992   Log() << Verbose(1) << "Saving adjacency list ... ";
     1005  DoLog(1) && (Log() << Verbose(1) << "Saving adjacency list ... ");
    9931006  if (AdjacencyFile != NULL) {
    9941007    AdjacencyFile << "m\tn" << endl;
    9951008    ActOnAllAtoms(&atom::OutputAdjacency, &AdjacencyFile);
    9961009    AdjacencyFile.close();
    997     Log() << Verbose(1) << "done." << endl;
     1010    DoLog(1) && (Log() << Verbose(1) << "done." << endl);
    9981011  } else {
    999     Log() << Verbose(1) << "failed to open file " << line.str() << "." << endl;
     1012    DoLog(1) && (Log() << Verbose(1) << "failed to open file " << line.str() << "." << endl);
    10001013    status = false;
    10011014  }
     
    10071020/** Storing the bond structure of a molecule to file.
    10081021 * Simply stores Atom::nr and then the Atom::nr of all bond partners, one per line.
    1009  * \param *out output stream for debugging
    10101022 * \param *path path to file
     1023 * \param *filename name of file
    10111024 * \return true - file written successfully, false - writing failed
    10121025 */
    1013 bool molecule::StoreBondsToFile(char *path)
     1026bool molecule::StoreBondsToFile(char *path, char *filename)
    10141027{
    10151028  ofstream BondFile;
     
    10171030  bool status = true;
    10181031
    1019   line << path << "/" << FRAGMENTPREFIX << ADJACENCYFILE;
     1032  if (path != NULL)
     1033    line << path << "/" << filename;
     1034  else
     1035    line << filename;
    10201036  BondFile.open(line.str().c_str(), ios::out);
    1021   Log() << Verbose(1) << "Saving adjacency list ... ";
     1037  DoLog(1) && (Log() << Verbose(1) << "Saving adjacency list ... ");
    10221038  if (BondFile != NULL) {
    10231039    BondFile << "m\tn" << endl;
    10241040    ActOnAllAtoms(&atom::OutputBonds, &BondFile);
    10251041    BondFile.close();
    1026     Log() << Verbose(1) << "done." << endl;
     1042    DoLog(1) && (Log() << Verbose(1) << "done." << endl);
    10271043  } else {
    1028     Log() << Verbose(1) << "failed to open file " << line.str() << "." << endl;
     1044    DoLog(1) && (Log() << Verbose(1) << "failed to open file " << line.str() << "." << endl);
    10291045    status = false;
    10301046  }
     
    10391055  filename << path << "/" << FRAGMENTPREFIX << ADJACENCYFILE;
    10401056  File.open(filename.str().c_str(), ios::out);
    1041   Log() << Verbose(1) << "Looking at bond structure stored in adjacency file and comparing to present one ... ";
     1057  DoLog(1) && (Log() << Verbose(1) << "Looking at bond structure stored in adjacency file and comparing to present one ... ");
    10421058  if (File == NULL)
    10431059    return false;
     
    10801096    //Log() << Verbose(0) << endl;
    10811097  } else {
    1082     Log() << Verbose(0) << "Number of bonds for Atom " << *Walker << " does not match, parsed " << CurrentBondsOfAtom << " against " << Walker->ListOfBonds.size() << "." << endl;
     1098    DoLog(0) && (Log() << Verbose(0) << "Number of bonds for Atom " << *Walker << " does not match, parsed " << CurrentBondsOfAtom << " against " << Walker->ListOfBonds.size() << "." << endl);
    10831099    status = false;
    10841100  }
     
    11031119
    11041120  if (!CheckAdjacencyFileAgainstMolecule_Init(path, File, CurrentBonds)) {
    1105     Log() << Verbose(1) << "Adjacency file not found." << endl;
     1121    DoLog(1) && (Log() << Verbose(1) << "Adjacency file not found." << endl);
    11061122    return true;
    11071123  }
     
    11291145
    11301146  if (status) { // if equal we parse the KeySetFile
    1131     Log() << Verbose(1) << "done: Equal." << endl;
     1147    DoLog(1) && (Log() << Verbose(1) << "done: Equal." << endl);
    11321148  } else
    1133     Log() << Verbose(1) << "done: Not equal by " << NonMatchNumber << " atoms." << endl;
     1149    DoLog(1) && (Log() << Verbose(1) << "done: Not equal by " << NonMatchNumber << " atoms." << endl);
    11341150  return status;
    11351151}
     
    11471163  bool status = true;
    11481164  if (ReferenceStack->IsEmpty()) {
    1149     Log() << Verbose(1) << "ReferenceStack is empty!" << endl;
     1165    DoLog(1) && (Log() << Verbose(1) << "ReferenceStack is empty!" << endl);
    11501166    return false;
    11511167  }
     
    11621178        if (OtherAtom == ListOfLocalAtoms[(*Runner)->rightatom->nr]) { // found the bond
    11631179          LocalStack->Push((*Runner));
    1164           Log() << Verbose(3) << "Found local edge " << *(*Runner) << "." << endl;
     1180          DoLog(3) && (Log() << Verbose(3) << "Found local edge " << *(*Runner) << "." << endl);
    11651181          break;
    11661182        }
    11671183      }
    11681184    Binder = ReferenceStack->PopFirst(); // loop the stack for next item
    1169     Log() << Verbose(3) << "Current candidate edge " << Binder << "." << endl;
     1185    DoLog(3) && (Log() << Verbose(3) << "Current candidate edge " << Binder << "." << endl);
    11701186    ReferenceStack->Push(Binder);
    11711187  } while (FirstBond != Binder);
     
    12161232  BFS.PredecessorList[OtherAtom->nr] = Walker; // Walker is the predecessor
    12171233  BFS.ShortestPathList[OtherAtom->nr] = BFS.ShortestPathList[Walker->nr] + 1;
    1218   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;
     1234  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);
    12191235  if ((((BFS.ShortestPathList[OtherAtom->nr] < BFS.BondOrder) && (Binder != Bond)))) { // Check for maximum distance
    1220     Log() << Verbose(3);
     1236    DoLog(3) && (Log() << Verbose(3));
    12211237    if (AddedAtomList[OtherAtom->nr] == NULL) { // add if it's not been so far
    12221238      AddedAtomList[OtherAtom->nr] = Mol->AddCopyAtom(OtherAtom);
    1223       Log() << Verbose(0) << "Added OtherAtom " << OtherAtom->Name;
     1239      DoLog(0) && (Log() << Verbose(0) << "Added OtherAtom " << OtherAtom->Name);
    12241240      AddedBondList[Binder->nr] = Mol->CopyBond(AddedAtomList[Walker->nr], AddedAtomList[OtherAtom->nr], Binder);
    1225       Log() << Verbose(0) << " and bond " << *(AddedBondList[Binder->nr]) << ", ";
     1241      DoLog(0) && (Log() << Verbose(0) << " and bond " << *(AddedBondList[Binder->nr]) << ", ");
    12261242    } 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)
    1227       Log() << Verbose(0) << "Not adding OtherAtom " << OtherAtom->Name;
     1243      DoLog(0) && (Log() << Verbose(0) << "Not adding OtherAtom " << OtherAtom->Name);
    12281244      if (AddedBondList[Binder->nr] == NULL) {
    12291245        AddedBondList[Binder->nr] = Mol->CopyBond(AddedAtomList[Walker->nr], AddedAtomList[OtherAtom->nr], Binder);
    1230         Log() << Verbose(0) << ", added Bond " << *(AddedBondList[Binder->nr]);
     1246        DoLog(0) && (Log() << Verbose(0) << ", added Bond " << *(AddedBondList[Binder->nr]));
    12311247      } else
    1232         Log() << Verbose(0) << ", not added Bond ";
    1233     }
    1234     Log() << Verbose(0) << ", putting OtherAtom into queue." << endl;
     1248        DoLog(0) && (Log() << Verbose(0) << ", not added Bond ");
     1249    }
     1250    DoLog(0) && (Log() << Verbose(0) << ", putting OtherAtom into queue." << endl);
    12351251    BFS.BFSStack->Push(OtherAtom);
    12361252  } else { // out of bond order, then replace
     
    12381254      BFS.ColorList[OtherAtom->nr] = white; // unmark if it has not been queued/added, to make it available via its other bonds (cyclic)
    12391255    if (Binder == Bond)
    1240       Log() << Verbose(3) << "Not Queueing, is the Root bond";
     1256      DoLog(3) && (Log() << Verbose(3) << "Not Queueing, is the Root bond");
    12411257    else if (BFS.ShortestPathList[OtherAtom->nr] >= BFS.BondOrder)
    1242       Log() << Verbose(3) << "Not Queueing, is out of Bond Count of " << BFS.BondOrder;
     1258      DoLog(3) && (Log() << Verbose(3) << "Not Queueing, is out of Bond Count of " << BFS.BondOrder);
    12431259    if (!Binder->Cyclic)
    1244       Log() << Verbose(0) << ", is not part of a cyclic bond, saturating bond with Hydrogen." << endl;
     1260      DoLog(0) && (Log() << Verbose(0) << ", is not part of a cyclic bond, saturating bond with Hydrogen." << endl);
    12451261    if (AddedBondList[Binder->nr] == NULL) {
    12461262      if ((AddedAtomList[OtherAtom->nr] != NULL)) { // .. whether we add or saturate
     
    12591275void BreadthFirstSearchAdd_VisitedNode(molecule *Mol, struct BFSAccounting &BFS, atom *&Walker, atom *&OtherAtom, bond *&Binder, bond *&Bond, atom **&AddedAtomList, bond **&AddedBondList, bool IsAngstroem)
    12601276{
    1261   Log() << Verbose(3) << "Not Adding, has already been visited." << endl;
     1277  DoLog(3) && (Log() << Verbose(3) << "Not Adding, has already been visited." << endl);
    12621278  // This has to be a cyclic bond, check whether it's present ...
    12631279  if (AddedBondList[Binder->nr] == NULL) {
     
    13051321    // followed by n+1 till top of stack.
    13061322    Walker = BFS.BFSStack->PopFirst(); // pop oldest added
    1307     Log() << Verbose(1) << "Current Walker is: " << Walker->Name << ", and has " << Walker->ListOfBonds.size() << " bonds." << endl;
     1323    DoLog(1) && (Log() << Verbose(1) << "Current Walker is: " << Walker->Name << ", and has " << Walker->ListOfBonds.size() << " bonds." << endl);
    13081324    for (BondList::const_iterator Runner = Walker->ListOfBonds.begin(); Runner != Walker->ListOfBonds.end(); (++Runner)) {
    13091325      if ((*Runner) != NULL) { // don't look at bond equal NULL
    13101326        Binder = (*Runner);
    13111327        OtherAtom = (*Runner)->GetOtherAtom(Walker);
    1312         Log() << Verbose(2) << "Current OtherAtom is: " << OtherAtom->Name << " for bond " << *(*Runner) << "." << endl;
     1328        DoLog(2) && (Log() << Verbose(2) << "Current OtherAtom is: " << OtherAtom->Name << " for bond " << *(*Runner) << "." << endl);
    13131329        if (BFS.ColorList[OtherAtom->nr] == white) {
    13141330          BreadthFirstSearchAdd_UnvisitedNode(Mol, BFS, Walker, OtherAtom, Binder, Bond, AddedAtomList, AddedBondList, IsAngstroem);
     
    13191335    }
    13201336    BFS.ColorList[Walker->nr] = black;
    1321     Log() << Verbose(1) << "Coloring Walker " << Walker->Name << " black." << endl;
     1337    DoLog(1) && (Log() << Verbose(1) << "Coloring Walker " << Walker->Name << " black." << endl);
    13221338  }
    13231339  BreadthFirstSearchAdd_Free(BFS);
     
    13441360  // reset parent list
    13451361  ParentList = Calloc<atom*> (AtomCount, "molecule::BuildInducedSubgraph_Init: **ParentList");
    1346   Log() << Verbose(3) << "Resetting ParentList." << endl;
     1362  DoLog(3) && (Log() << Verbose(3) << "Resetting ParentList." << endl);
    13471363}
    13481364;
     
    13511367{
    13521368  // fill parent list with sons
    1353   Log() << Verbose(3) << "Filling Parent List." << endl;
     1369  DoLog(3) && (Log() << Verbose(3) << "Filling Parent List." << endl);
    13541370  atom *Walker = mol->start;
    13551371  while (Walker->next != mol->end) {
     
    13571373    ParentList[Walker->father->nr] = Walker;
    13581374    // Outputting List for debugging
    1359     Log() << Verbose(4) << "Son[" << Walker->father->nr << "] of " << Walker->father << " is " << ParentList[Walker->father->nr] << "." << endl;
     1375    DoLog(4) && (Log() << Verbose(4) << "Son[" << Walker->father->nr << "] of " << Walker->father << " is " << ParentList[Walker->father->nr] << "." << endl);
    13601376  }
    13611377
     
    13751391  atom *OtherAtom = NULL;
    13761392  // check each entry of parent list and if ok (one-to-and-onto matching) create bonds
    1377   Log() << Verbose(3) << "Creating bonds." << endl;
     1393  DoLog(3) && (Log() << Verbose(3) << "Creating bonds." << endl);
    13781394  Walker = Father->start;
    13791395  while (Walker->next != Father->end) {
     
    13861402          OtherAtom = (*Runner)->GetOtherAtom(Walker);
    13871403          if (ParentList[OtherAtom->nr] != NULL) { // if otheratom is also a father of an atom on this molecule, create the bond
    1388             Log() << Verbose(4) << "Endpoints of Bond " << (*Runner) << " are both present: " << ParentList[Walker->nr]->Name << " and " << ParentList[OtherAtom->nr]->Name << "." << endl;
     1404            DoLog(4) && (Log() << Verbose(4) << "Endpoints of Bond " << (*Runner) << " are both present: " << ParentList[Walker->nr]->Name << " and " << ParentList[OtherAtom->nr]->Name << "." << endl);
    13891405            mol->AddBond(ParentList[Walker->nr], ParentList[OtherAtom->nr], (*Runner)->BondDegree);
    13901406          }
     
    14111427  atom **ParentList = NULL;
    14121428
    1413   Log() << Verbose(2) << "Begin of BuildInducedSubgraph." << endl;
     1429  DoLog(2) && (Log() << Verbose(2) << "Begin of BuildInducedSubgraph." << endl);
    14141430  BuildInducedSubgraph_Init(ParentList, Father->AtomCount);
    14151431  BuildInducedSubgraph_FillParentList(this, Father, ParentList);
    14161432  status = BuildInducedSubgraph_CreateBondsFromParent(this, Father, ParentList);
    14171433  BuildInducedSubgraph_Finalize(ParentList);
    1418   Log() << Verbose(2) << "End of BuildInducedSubgraph." << endl;
     1434  DoLog(2) && (Log() << Verbose(2) << "End of BuildInducedSubgraph." << endl);
    14191435  return status;
    14201436}
     
    14331449  int size;
    14341450
    1435   Log() << Verbose(1) << "Begin of CheckForConnectedSubgraph" << endl;
    1436   Log() << Verbose(2) << "Disconnected atom: ";
     1451  DoLog(1) && (Log() << Verbose(1) << "Begin of CheckForConnectedSubgraph" << endl);
     1452  DoLog(2) && (Log() << Verbose(2) << "Disconnected atom: ");
    14371453
    14381454  // count number of atoms in graph
     
    14561472      }
    14571473      if (!BondStatus) {
    1458         Log() << Verbose(0) << (*Walker) << endl;
     1474        DoLog(0) && (Log() << Verbose(0) << (*Walker) << endl);
    14591475        return false;
    14601476      }
    14611477    }
    14621478  else {
    1463     Log() << Verbose(0) << "none." << endl;
     1479    DoLog(0) && (Log() << Verbose(0) << "none." << endl);
    14641480    return true;
    14651481  }
    1466   Log() << Verbose(0) << "none." << endl;
    1467 
    1468   Log() << Verbose(1) << "End of CheckForConnectedSubgraph" << endl;
     1482  DoLog(0) && (Log() << Verbose(0) << "none." << endl);
     1483
     1484  DoLog(1) && (Log() << Verbose(1) << "End of CheckForConnectedSubgraph" << endl);
    14691485
    14701486  return true;
Note: See TracChangeset for help on using the changeset viewer.