Changeset 58ed4a


Ignore:
Timestamp:
Mar 18, 2010, 11:33:54 AM (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:
b48ba6
Parents:
7ee87f
git-author:
Frederik Heber <heber@…> (03/18/10 10:26:55)
git-committer:
Frederik Heber <heber@…> (03/18/10 11:33:54)
Message:

Log() and eLog() are prepended by a DoLog()/DoeLog() construct.

  • Most of the run time (95%) is spent on verbosity that it is discarded anyway due to a low verbosity setting. However, the operator << is evaluated from the right-hand side, hence the whole message is constructed and then thrown away.
  • DoLog() and DoeLog() are new functions that check the verbosity beforehand and are used as follows: DoLog(2) && (Log() << verbose(2) << "message" << endl);

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

Location:
src
Files:
28 edited

Legend:

Unmodified
Added
Removed
  • src/analysis_bonds.cpp

    r7ee87f r58ed4a  
    3737  }
    3838  if (((int)Mean % 2) != 0)
    39     eLog() << Verbose(1) << "Something is wrong with the bond structure, the number of bonds is not even!" << endl;
     39    DoeLog(1) && (eLog()<< Verbose(1) << "Something is wrong with the bond structure, the number of bonds is not even!" << endl);
    4040  Mean /= (double)AtomCount;
    4141};
  • src/analysis_correlation.cpp

    r7ee87f r58ed4a  
    3636
    3737  if (molecules->ListOfMolecules.empty()) {
    38     eLog() << Verbose(1) <<"No molecule given." << endl;
     38    DoeLog(1) && (eLog()<< Verbose(1) <<"No molecule given." << endl);
    3939    return outmap;
    4040  }
     
    4242  for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++)
    4343    if ((*MolWalker)->ActiveFlag) {
    44       eLog() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl;
     44      DoeLog(2) && (eLog()<< Verbose(2) << "Current molecule is " << *MolWalker << "." << endl);
    4545      atom *Walker = (*MolWalker)->start;
    4646      while (Walker->next != (*MolWalker)->end) {
     
    9292
    9393  if (molecules->ListOfMolecules.empty()) {
    94     eLog() << Verbose(1) <<"No molecule given." << endl;
     94    DoeLog(1) && (eLog()<< Verbose(1) <<"No molecule given." << endl);
    9595    return outmap;
    9696  }
     
    100100      double * FullMatrix = ReturnFullMatrixforSymmetric(World::get()->cell_size);
    101101      double * FullInverseMatrix = InverseMatrix(FullMatrix);
    102       eLog() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl;
     102      DoeLog(2) && (eLog()<< Verbose(2) << "Current molecule is " << *MolWalker << "." << endl);
    103103      atom *Walker = (*MolWalker)->start;
    104104      while (Walker->next != (*MolWalker)->end) {
     
    257257
    258258  if ((Surface == NULL) || (LC == NULL) || (molecules->ListOfMolecules.empty())) {
    259     eLog() << Verbose(1) <<"No Tesselation, no LinkedCell or no molecule given." << endl;
     259    DoeLog(1) && (eLog()<< Verbose(1) <<"No Tesselation, no LinkedCell or no molecule given." << endl);
    260260    return outmap;
    261261  }
     
    333333                checkX.AddVector(&periodicX);
    334334                checkX.MatrixMultiplication(FullMatrix);
    335                 triangle = Surface->FindClosestTriangleToVector(&checkX, LC);
    336                 distance = Surface->GetDistanceSquaredToTriangle(checkX, triangle);
     335                TriangleIntersectionList Intersections(&checkX,Surface,LC);
     336                distance = Intersections.GetSmallestDistance();
     337                triangle = Intersections.GetClosestTriangle();
    337338                if ((ShortestDistance == -1.) || (distance < ShortestDistance)) {
    338339                  ShortestDistance = distance;
     
    341342              }
    342343          // insert
    343           ShortestDistance = sqrt(ShortestDistance);
    344344          outmap->insert ( pair<double, pair<atom *, BoundaryTriangleSet*> >(ShortestDistance, pair<atom *, BoundaryTriangleSet*> (Walker, ShortestTriangle) ) );
    345345          //Log() << Verbose(1) << "INFO: Inserting " << Walker << " with distance " << ShortestDistance << " to " << *ShortestTriangle << "." << endl;
  • src/analysis_correlation.hpp

    r7ee87f r58ed4a  
    7171
    7272  if (map == NULL) {
    73     eLog() << Verbose(0) << "Nothing to min/max, map is NULL!" << endl;
     73    DoeLog(0) && (eLog()<< Verbose(0) << "Nothing to min/max, map is NULL!" << endl);
    7474    performCriticalExit();
    7575    return;
     
    109109
    110110  if (map == NULL) {
    111     eLog() << Verbose(0) << "Nothing to bin, is NULL!" << endl;
     111    DoeLog(0) && (eLog()<< Verbose(0) << "Nothing to bin, is NULL!" << endl);
    112112    performCriticalExit();
    113113    return outmap;
  • src/analyzer.cpp

    r7ee87f r58ed4a  
    9696  if (!Hcorrection.ParseFragmentMatrix(argv[1], "", HCORRECTIONSUFFIX,0,0)) {
    9797    NoHCorrection = true;
    98     eLog() << Verbose(2) << "No HCorrection file found, skipping these." << endl;
     98    DoeLog(2) && (eLog()<< Verbose(2) << "No HCorrection file found, skipping these." << endl);
    9999  }
    100100 
     
    102102  if (!Hessian.ParseFragmentMatrix(argv[1], dir, HessianSuffix,0,0)) {
    103103    NoHessian = true;
    104     eLog() << Verbose(2) << "No Hessian file found, skipping these." << endl;
     104    DoeLog(2) && (eLog()<< Verbose(2) << "No Hessian file found, skipping these." << endl);
    105105  }
    106106  if (!Time.ParseFragmentMatrix(argv[1], dir, TimeSuffix, 10,1)) {
    107107    NoTime = true;
    108     eLog() << Verbose(2) << "No speed file found, skipping these." << endl;
     108    DoeLog(2) && (eLog()<< Verbose(2) << "No speed file found, skipping these." << endl);
    109109  }
    110110  if (periode != NULL) { // also look for PAS values
  • src/atom_bondedparticle.cpp

    r7ee87f r58ed4a  
    8686      status = true;
    8787    } else {
    88       eLog() << Verbose(1) << *Binder << " does not contain " << *this << "." << endl;
     88      DoeLog(1) && (eLog()<< Verbose(1) << *Binder << " does not contain " << *this << "." << endl);
    8989    }
    9090  } else {
    91     eLog() << Verbose(1) << "Binder is " << Binder << "." << endl;
     91    DoeLog(1) && (eLog()<< Verbose(1) << "Binder is " << Binder << "." << endl);
    9292  }
    9393  return status;
     
    105105      status = true;
    106106    } else {
    107       eLog() << Verbose(1) << *Binder << " does not contain " << *this << "." << endl;
     107      DoeLog(1) && (eLog()<< Verbose(1) << *Binder << " does not contain " << *this << "." << endl);
    108108    }
    109109  } else {
    110     eLog() << Verbose(1) << "Binder is " << Binder << "." << endl;
     110    DoeLog(1) && (eLog()<< Verbose(1) << "Binder is " << Binder << "." << endl);
    111111  }
    112112  return status;
     
    150150      //Log() << Verbose(2) << "Increased bond degree for bond " << *CandidateBond << "." << endl;
    151151    } else {
    152       eLog() << Verbose(2) << "Could not find correct degree for atom " << *this << "." << endl;
     152      DoeLog(2) && (eLog()<< Verbose(2) << "Could not find correct degree for atom " << *this << "." << endl);
    153153      FalseBondDegree++;
    154154    }
  • src/bond.cpp

    r7ee87f r58ed4a  
    6363  if(rightatom == Atom)
    6464    return leftatom;
    65   eLog() << Verbose(1) << "Bond " << *this << " does not contain atom " << *Atom << "!" << endl;
     65  DoeLog(1) && (eLog()<< Verbose(1) << "Bond " << *this << " does not contain atom " << *Atom << "!" << endl);
    6666  return NULL;
    6767};
     
    9999bool bond::MarkUsed(const enum Shading color) {
    100100  if (Used == black) {
    101     eLog() << Verbose(1) << "Bond " << this << " was already marked black!." << endl;
     101    DoeLog(1) && (eLog()<< Verbose(1) << "Bond " << this << " was already marked black!." << endl);
    102102    return false;
    103103  } else {
  • src/bondgraph.cpp

    r7ee87f r58ed4a  
    5858    Log() << Verbose(1) << "Parsing bond length matrix successful." << endl;
    5959  } else {
    60     eLog() << Verbose(1) << "Parsing bond length matrix failed." << endl;
     60    DoeLog(1) && (eLog()<< Verbose(1) << "Parsing bond length matrix failed." << endl);
    6161  }
    6262
     
    159159{
    160160  if (BondLengthMatrix == NULL) {// safety measure if no matrix has been parsed yet
    161     eLog() << Verbose(2) << "BondLengthMatrixMinMaxDistance() called without having parsed the bond length matrix yet!" << endl;
     161    DoeLog(2) && (eLog()<< Verbose(2) << "BondLengthMatrixMinMaxDistance() called without having parsed the bond length matrix yet!" << endl);
    162162    CovalentMinMaxDistance(Walker, OtherWalker, MinDistance, MaxDistance, IsAngstroem);
    163163  } else {
  • src/boundary.cpp

    r7ee87f r58ed4a  
    342342    for (Boundaries::iterator runner = BoundaryPoints[axis].begin(); runner != BoundaryPoints[axis].end(); runner++)
    343343        if (!TesselStruct->AddBoundaryPoint(runner->second.second, 0))
    344           eLog() << Verbose(2) << "Point " << *(runner->second.second) << " is already present!" << endl;
     344          DoeLog(2) && (eLog()<< Verbose(2) << "Point " << *(runner->second.second) << " is already present!" << endl);
    345345
    346346  Log() << Verbose(0) << "I found " << TesselStruct->PointsOnBoundaryCount << " points on the convex boundary." << endl;
     
    362362  // 3c. check whether all atoms lay inside the boundary, if not, add to boundary points, segment triangle into three with the new point
    363363  if (!TesselStruct->InsertStraddlingPoints(mol, LCList))
    364     eLog() << Verbose(1) << "Insertion of straddling points failed!" << endl;
     364    DoeLog(1) && (eLog()<< Verbose(1) << "Insertion of straddling points failed!" << endl);
    365365
    366366  Log() << Verbose(0) << "I created " << TesselStruct->TrianglesOnBoundary.size() << " intermediate triangles with " << TesselStruct->LinesOnBoundary.size() << " lines and " << TesselStruct->PointsOnBoundary.size() << " points." << endl;
     
    401401        // flip the line
    402402        if (TesselStruct->PickFarthestofTwoBaselines(line) == 0.)
    403           eLog() << Verbose(1) << "Correction of concave baselines failed!" << endl;
     403          DoeLog(1) && (eLog()<< Verbose(1) << "Correction of concave baselines failed!" << endl);
    404404        else {
    405405          TesselStruct->FlipBaseline(line);
     
    456456
    457457  if ((TesselStruct == NULL) || (TesselStruct->PointsOnBoundary.empty())) {
    458     eLog() << Verbose(1) << "TesselStruct is empty." << endl;
     458    DoeLog(1) && (eLog()<< Verbose(1) << "TesselStruct is empty." << endl);
    459459    return false;
    460460  }
     
    521521  // check whether there is something to work on
    522522  if (TesselStruct == NULL) {
    523     eLog() << Verbose(1) << "TesselStruct is empty!" << endl;
     523    DoeLog(1) && (eLog()<< Verbose(1) << "TesselStruct is empty!" << endl);
    524524    return volume;
    525525  }
     
    748748  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) {
    750     eLog() << Verbose(1) << "the containing box already has a greater volume than the envisaged cell volume!" << endl;
     750    DoeLog(1) && (eLog()<< Verbose(1) << "the containing box already has a greater volume than the envisaged cell volume!" << endl);
    751751    Log() << Verbose(0) << "Setting Box dimensions to minimum possible, the greatest diameters." << endl;
    752752    for (int i = 0; i < NDIM; i++)
  • src/builder.cpp

    r7ee87f r58ed4a  
    8585  bool valid;
    8686
    87   Log() << Verbose(0) << "===========ADD ATOM============================" << endl;
    88   Log() << Verbose(0) << " a - state absolute coordinates of atom" << endl;
    89   Log() << Verbose(0) << " b - state relative coordinates of atom wrt to reference point" << endl;
    90   Log() << Verbose(0) << " c - state relative coordinates of atom wrt to already placed atom" << endl;
    91   Log() << Verbose(0) << " d - state two atoms, two angles and a distance" << endl;
    92   Log() << Verbose(0) << " e - least square distance position to a set of atoms" << endl;
    93   Log() << Verbose(0) << "all else - go back" << endl;
    94   Log() << Verbose(0) << "===============================================" << endl;
    95   Log() << Verbose(0) << "Note: Specifiy angles in degrees not multiples of Pi!" << endl;
    96   Log() << Verbose(0) << "INPUT: ";
     87  cout << Verbose(0) << "===========ADD ATOM============================" << endl;
     88  cout << Verbose(0) << " a - state absolute coordinates of atom" << endl;
     89  cout << Verbose(0) << " b - state relative coordinates of atom wrt to reference point" << endl;
     90  cout << Verbose(0) << " c - state relative coordinates of atom wrt to already placed atom" << endl;
     91  cout << Verbose(0) << " d - state two atoms, two angles and a distance" << endl;
     92  cout << Verbose(0) << " e - least square distance position to a set of atoms" << endl;
     93  cout << Verbose(0) << "all else - go back" << endl;
     94  cout << Verbose(0) << "===============================================" << endl;
     95  cout << Verbose(0) << "Note: Specifiy angles in degrees not multiples of Pi!" << endl;
     96  cout << Verbose(0) << "INPUT: ";
    9797  cin >> choice;
    9898
    9999  switch (choice) {
    100100    default:
    101       eLog() << Verbose(2) << "Not a valid choice." << endl;
     101      DoeLog(2) && (eLog()<< Verbose(2) << "Not a valid choice." << endl);
    102102      break;
    103103      case 'a': // absolute coordinates of atom
    104         Log() << Verbose(0) << "Enter absolute coordinates." << endl;
     104        cout << Verbose(0) << "Enter absolute coordinates." << endl;
    105105        first = new atom;
    106106        first->x.AskPosition(World::get()->cell_size, false);
     
    113113        valid = true;
    114114        do {
    115           if (!valid) eLog() << Verbose(2) << "Resulting position out of cell." << endl;
    116           Log() << Verbose(0) << "Enter reference coordinates." << endl;
     115          if (!valid) DoeLog(2) && (eLog()<< Verbose(2) << "Resulting position out of cell." << endl);
     116          cout << Verbose(0) << "Enter reference coordinates." << endl;
    117117          x.AskPosition(World::get()->cell_size, true);
    118           Log() << Verbose(0) << "Enter relative coordinates." << endl;
     118          cout << Verbose(0) << "Enter relative coordinates." << endl;
    119119          first->x.AskPosition(World::get()->cell_size, false);
    120120          first->x.AddVector((const Vector *)&x);
    121           Log() << Verbose(0) << "\n";
     121          cout << Verbose(0) << "\n";
    122122        } while (!(valid = mol->CheckBounds((const Vector *)&first->x)));
    123123        first->type = periode->AskElement();  // give type
     
    129129        valid = true;
    130130        do {
    131           if (!valid) eLog() << Verbose(2) << "Resulting position out of cell." << endl;
     131          if (!valid) DoeLog(2) && (eLog()<< Verbose(2) << "Resulting position out of cell." << endl);
    132132          second = mol->AskAtom("Enter atom number: ");
    133133          Log() << Verbose(0) << "Enter relative coordinates." << endl;
     
    146146        do {
    147147          if (!valid) {
    148             eLog() << Verbose(2) << "Resulting coordinates out of cell - " << first->x << endl;
     148            DoeLog(2) && (eLog()<< Verbose(2) << "Resulting coordinates out of cell - " << first->x << endl);
    149149          }
    150           Log() << Verbose(0) << "First, we need two atoms, the first atom is the central, while the second is the outer one." << endl;
     150          cout << Verbose(0) << "First, we need two atoms, the first atom is the central, while the second is the outer one." << endl;
    151151          second = mol->AskAtom("Enter central atom: ");
    152152          third = mol->AskAtom("Enter second atom (specifying the axis for first angle): ");
     
    159159          c *= M_PI/180.;
    160160          bound(&c, -M_PI, M_PI);
    161           Log() << Verbose(0) << "radius: " << a << "\t phi: " << b*180./M_PI << "\t theta: " << c*180./M_PI << endl;
     161          cout << Verbose(0) << "radius: " << a << "\t phi: " << b*180./M_PI << "\t theta: " << c*180./M_PI << endl;
    162162/*
    163163          second->Output(1,1,(ofstream *)&cout);
     
    171171
    172172          if (!z.SolveSystem(&x,&y,&n, b, c, a)) {
    173             Log() << Verbose(0) << "Failure solving self-dependent linear system!" << endl;
     173         coutg() << Verbose(0) << "Failure solving self-dependent linear system!" << endl;
    174174            continue;
    175175          }
     
    248248          atoms[i] = NULL;
    249249        int i=0, j=0;
    250         Log() << Verbose(0) << "Now we need at least three molecules.\n";
     250        cout << Verbose(0) << "Now we need at least three molecules.\n";
    251251        do {
    252           Log() << Verbose(0) << "Enter " << i+1 << "th atom: ";
     252          cout << Verbose(0) << "Enter " << i+1 << "th atom: ";
    253253          cin >> j;
    254254          if (j != -1) {
     
    265265        } else {
    266266          delete first;
    267           Log() << Verbose(0) << "Please enter at least two vectors!\n";
     267          cout << Verbose(0) << "Please enter at least two vectors!\n";
    268268        }
    269269        break;
     
    279279  char choice;  // menu choice char
    280280
    281   Log() << Verbose(0) << "===========CENTER ATOMS=========================" << endl;
    282   Log() << Verbose(0) << " a - on origin" << endl;
    283   Log() << Verbose(0) << " b - on center of gravity" << endl;
    284   Log() << Verbose(0) << " c - within box with additional boundary" << endl;
    285   Log() << Verbose(0) << " d - within given simulation box" << endl;
    286   Log() << Verbose(0) << "all else - go back" << endl;
    287   Log() << Verbose(0) << "===============================================" << endl;
    288   Log() << Verbose(0) << "INPUT: ";
     281  cout << Verbose(0) << "===========CENTER ATOMS=========================" << endl;
     282  cout << Verbose(0) << " a - on origin" << endl;
     283  cout << Verbose(0) << " b - on center of gravity" << endl;
     284  cout << Verbose(0) << " c - within box with additional boundary" << endl;
     285  cout << Verbose(0) << " d - within given simulation box" << endl;
     286  cout << Verbose(0) << "all else - go back" << endl;
     287  cout << Verbose(0) << "===============================================" << endl;
     288  cout << Verbose(0) << "INPUT: ";
    289289  cin >> choice;
    290290
    291291  switch (choice) {
    292292    default:
    293       Log() << Verbose(0) << "Not a valid choice." << endl;
     293      cout << Verbose(0) << "Not a valid choice." << endl;
    294294      break;
    295295    case 'a':
    296       Log() << Verbose(0) << "Centering atoms in config file on origin." << endl;
     296      cout << Verbose(0) << "Centering atoms in config file on origin." << endl;
    297297      mol->CenterOrigin();
    298298      break;
    299299    case 'b':
    300       Log() << Verbose(0) << "Centering atoms in config file on center of gravity." << endl;
     300      cout << Verbose(0) << "Centering atoms in config file on center of gravity." << endl;
    301301      mol->CenterPeriodic();
    302302      break;
    303303    case 'c':
    304       Log() << Verbose(0) << "Centering atoms in config file within given additional boundary." << endl;
     304      cout << Verbose(0) << "Centering atoms in config file within given additional boundary." << endl;
    305305      for (int i=0;i<NDIM;i++) {
    306         Log() << Verbose(0) << "Enter axis " << i << " boundary: ";
     306        cout << Verbose(0) << "Enter axis " << i << " boundary: ";
    307307        cin >> y.x[i];
    308308      }
     
    315315      break;
    316316    case 'd':
    317       Log() << Verbose(1) << "Centering atoms in config file within given simulation box." << endl;
     317      cout << Verbose(1) << "Centering atoms in config file within given simulation box." << endl;
    318318      for (int i=0;i<NDIM;i++) {
    319         Log() << Verbose(0) << "Enter axis " << i << " boundary: ";
     319        cout << Verbose(0) << "Enter axis " << i << " boundary: ";
    320320        cin >> x.x[i];
    321321      }
     
    338338  char choice;  // menu choice char
    339339
    340   Log() << Verbose(0) << "===========ALIGN ATOMS=========================" << endl;
    341   Log() << Verbose(0) << " a - state three atoms defining align plane" << endl;
    342   Log() << Verbose(0) << " b - state alignment vector" << endl;
    343   Log() << Verbose(0) << " c - state two atoms in alignment direction" << endl;
    344   Log() << Verbose(0) << " d - align automatically by least square fit" << endl;
    345   Log() << Verbose(0) << "all else - go back" << endl;
    346   Log() << Verbose(0) << "===============================================" << endl;
    347   Log() << Verbose(0) << "INPUT: ";
     340  cout << Verbose(0) << "===========ALIGN ATOMS=========================" << endl;
     341  cout << Verbose(0) << " a - state three atoms defining align plane" << endl;
     342  cout << Verbose(0) << " b - state alignment vector" << endl;
     343  cout << Verbose(0) << " c - state two atoms in alignment direction" << endl;
     344  cout << Verbose(0) << " d - align automatically by least square fit" << endl;
     345  cout << Verbose(0) << "all else - go back" << endl;
     346  cout << Verbose(0) << "===============================================" << endl;
     347  cout << Verbose(0) << "INPUT: ";
    348348  cin >> choice;
    349349
     
    358358      break;
    359359    case 'b': // normal vector of mirror plane
    360       Log() << Verbose(0) << "Enter normal vector of mirror plane." << endl;
     360      cout << Verbose(0) << "Enter normal vector of mirror plane." << endl;
    361361      n.AskPosition(World::get()->cell_size,0);
    362362      n.Normalize();
     
    378378        fscanf(stdin, "%3s", shorthand);
    379379      } while ((param.type = periode->FindElement(shorthand)) == NULL);
    380       Log() << Verbose(0) << "Element is " << param.type->name << endl;
     380      cout << Verbose(0) << "Element is " << param.type->name << endl;
    381381      mol->GetAlignvector(&param);
    382382      for (int i=NDIM;i--;) {
     
    385385      }
    386386      gsl_vector_free(param.x);
    387       Log() << Verbose(0) << "Offset vector: ";
     387      cout << Verbose(0) << "Offset vector: ";
    388388      x.Output();
    389389      Log() << Verbose(0) << endl;
     
    674674  Log() << Verbose(0) << "===============================================" << endl;
    675675  if (molecules->NumberOfActiveMolecules() > 1)
    676     eLog() << Verbose(2) << "There is more than one molecule active! Atoms will be added to each." << endl;
     676    DoeLog(2) && (eLog()<< Verbose(2) << "There is more than one molecule active! Atoms will be added to each." << endl);
    677677  Log() << Verbose(0) << "INPUT: ";
    678678  cin >> choice;
     
    830830  Log() << Verbose(0) << "===============================================" << endl;
    831831  if (molecules->NumberOfActiveMolecules() > 1)
    832     eLog() << Verbose(2) << "There is more than one molecule active! Atoms will be added to each." << endl;
     832    DoeLog(2) && (eLog()<< Verbose(2) << "There is more than one molecule active! Atoms will be added to each." << endl);
    833833  Log() << Verbose(0) << "INPUT: ";
    834834  cin >> choice;
     
    863863          }
    864864          if (count != j)
    865             eLog() << Verbose(1) << "AtomCount " << count << " is not equal to number of atoms in molecule " << j << "!" << endl;
     865            DoeLog(1) && (eLog()<< Verbose(1) << "AtomCount " << count << " is not equal to number of atoms in molecule " << j << "!" << endl);
    866866          x.Zero();
    867867          y.Zero();
     
    12081208    mol = (molecules->ListOfMolecules.front())->CopyMolecule();
    12091209  else {
    1210     eLog() << Verbose(0) << "I don't have anything to test on ... ";
     1210    DoeLog(0) && (eLog()<< Verbose(0) << "I don't have anything to test on ... ");
    12111211    performCriticalExit();
    12121212    return;
     
    12891289
    12901290  if (!strcmp(configuration->configpath, configuration->GetDefaultPath())) {
    1291     eLog() << Verbose(2) << "config is found under different path then stated in config file::defaultpath!" << endl;
     1291    DoeLog(2) && (eLog()<< Verbose(2) << "config is found under different path then stated in config file::defaultpath!" << endl);
    12921292  }
    12931293
     
    13931393
    13941394  if (!strcmp(configuration->configpath, configuration->GetDefaultPath())) {
    1395     eLog() << Verbose(2) << "config is found under different path then stated in config file::defaultpath!" << endl;
     1395    DoeLog(2) && (eLog()<< Verbose(2) << "config is found under different path then stated in config file::defaultpath!" << endl);
    13961396  }
    13971397
     
    14961496            return (1);
    14971497            break;
     1498          case 'B':
     1499            if (ExitFlag == 0) ExitFlag = 1;
     1500            if ((argptr+5 >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) || (!IsValidNumber(argv[argptr+3])) || (!IsValidNumber(argv[argptr+4])) || (!IsValidNumber(argv[argptr+5])) ) {
     1501              ExitFlag = 255;
     1502              DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for bounding in box: -B <xx> <xy> <xz> <yy> <yz> <zz>" << endl);
     1503              performCriticalExit();
     1504            } else {
     1505              SaveFlag = true;
     1506              j = -1;
     1507              Log() << Verbose(1) << "Centering atoms in config file within given simulation box." << endl;
     1508              double * const cell_size = World::get()->cell_size;
     1509              for (int i=0;i<6;i++) {
     1510                cell_size[i] = atof(argv[argptr+i]);
     1511              }
     1512              argptr+=6;
     1513            }
     1514            break;
    14981515          case 'e':
    14991516            if ((argptr >= argc) || (argv[argptr][0] == '-')) {
    1500               eLog() << Verbose(0) << "Not enough or invalid arguments for specifying element db: -e <db file>" << endl;
     1517              DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments for specifying element db: -e <db file>" << endl);
    15011518              performCriticalExit();
    15021519            } else {
     
    15081525          case 'g':
    15091526            if ((argptr >= argc) || (argv[argptr][0] == '-')) {
    1510               eLog() << Verbose(0) << "Not enough or invalid arguments for specifying bond length table: -g <table file>" << endl;
     1527              DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments for specifying bond length table: -g <table file>" << endl);
    15111528              performCriticalExit();
    15121529            } else {
     
    16051622         Log() << Verbose(0) << "Bond length table loaded successfully." << endl;
    16061623       } else {
    1607          eLog() << Verbose(1) << "Bond length table loading failed." << endl;
     1624         DoeLog(1) && (eLog()<< Verbose(1) << "Bond length table loading failed." << endl);
    16081625       }
    16091626     }
     
    16211638              if ((argptr >= argc) || (argv[argptr][0] == '-')) {
    16221639                ExitFlag = 255;
    1623                 eLog() << Verbose(0) << "Not enough arguments for parsing: -p <xyz file>" << endl;
     1640                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough arguments for parsing: -p <xyz file>" << endl);
    16241641                performCriticalExit();
    16251642              } else {
     
    16381655              if ((argptr >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) || (!IsValidNumber(argv[argptr+3]))) {
    16391656                ExitFlag = 255;
    1640                 eLog() << Verbose(0) << "Not enough or invalid arguments for adding atom: -a <element> <x> <y> <z>" << endl;
     1657                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments for adding atom: -a <element> <x> <y> <z>" << endl);
    16411658                performCriticalExit();
    16421659              } else {
     
    16541671                    configPresent = present;
    16551672                } else
    1656                   eLog() << Verbose(1) << "Could not find the specified element." << endl;
     1673                  DoeLog(1) && (eLog()<< Verbose(1) << "Could not find the specified element." << endl);
    16571674                argptr+=4;
    16581675              }
     
    16671684              if ((argptr >= argc) || (argv[argptr][0] == '-')) {
    16681685                ExitFlag = 255;
    1669                 eLog() << Verbose(0) << "Not enough or invalid arguments given for setting MPQC basis: -B <basis name>" << endl;
     1686                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for setting MPQC basis: -B <basis name>" << endl);
    16701687                performCriticalExit();
    16711688              } else {
     
    17271744              break;
    17281745            case 'C':
    1729               if (ExitFlag == 0) ExitFlag = 1;
    1730               if ((argptr >= argc)) {
    1731                 ExitFlag = 255;
    1732                 eLog() << Verbose(0) << "Not enough or invalid arguments given for pair correlation analysis: -C <type: E/P/S> [more params] <output> <bin output> <BinStart> <BinEnd>" << endl;
    1733                 performCriticalExit();
    1734               } else {
    1735                 switch(argv[argptr][0]) {
    1736                   case 'E':
    1737                     {
    1738                       if ((argptr+6 >= argc) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+5])) || (!IsValidNumber(argv[argptr+6])) || (!IsValidNumber(argv[argptr+2])) || (argv[argptr+1][0] == '-') || (argv[argptr+2][0] == '-') || (argv[argptr+3][0] == '-') || (argv[argptr+4][0] == '-')) {
    1739                         ExitFlag = 255;
    1740                         eLog() << Verbose(0) << "Not enough or invalid arguments given for pair correlation analysis: -C E <Z1> <Z2> <output> <bin output>" << endl;
    1741                         performCriticalExit();
    1742                       } else {
    1743                         ofstream output(argv[argptr+3]);
    1744                         ofstream binoutput(argv[argptr+4]);
    1745                         const double BinStart = atof(argv[argptr+5]);
    1746                         const double BinEnd = atof(argv[argptr+6]);
    1747 
    1748                         element *elemental = periode->FindElement((const int) atoi(argv[argptr+1]));
    1749                         element *elemental2 = periode->FindElement((const int) atoi(argv[argptr+2]));
    1750                         PairCorrelationMap *correlationmap = PairCorrelation(molecules, elemental, elemental2);
    1751                         //OutputCorrelationToSurface(&output, correlationmap);
    1752                         BinPairMap *binmap = BinData( correlationmap, 0.5, BinStart, BinEnd );
    1753                         OutputCorrelation ( &binoutput, binmap );
    1754                         output.close();
    1755                         binoutput.close();
    1756                         delete(binmap);
    1757                         delete(correlationmap);
    1758                         argptr+=7;
     1746              {
     1747                int ranges[3] = {1, 1, 1};
     1748                bool periodic = (argv[argptr-1][2] =='p');
     1749                if (ExitFlag == 0) ExitFlag = 1;
     1750                if ((argptr >= argc)) {
     1751                  ExitFlag = 255;
     1752                  DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for pair correlation analysis: -C[p] <type: E/P/S> [more params] <output> <bin output> <BinStart> <BinEnd>" << endl);
     1753                  performCriticalExit();
     1754                } else {
     1755                  switch(argv[argptr][0]) {
     1756                    case 'E':
     1757                      {
     1758                        if ((argptr+6 >= argc) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+5])) || (!IsValidNumber(argv[argptr+6])) || (!IsValidNumber(argv[argptr+2])) || (argv[argptr+1][0] == '-') || (argv[argptr+2][0] == '-') || (argv[argptr+3][0] == '-') || (argv[argptr+4][0] == '-')) {
     1759                          ExitFlag = 255;
     1760                          DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for pair correlation analysis: -C E <Z1> <Z2> <output> <bin output>" << endl);
     1761                          performCriticalExit();
     1762                        } else {
     1763                          ofstream output(argv[argptr+3]);
     1764                          ofstream binoutput(argv[argptr+4]);
     1765                          const double BinStart = atof(argv[argptr+5]);
     1766                          const double BinEnd = atof(argv[argptr+6]);
     1767
     1768                          element *elemental = periode->FindElement((const int) atoi(argv[argptr+1]));
     1769                          element *elemental2 = periode->FindElement((const int) atoi(argv[argptr+2]));
     1770                          PairCorrelationMap *correlationmap = NULL;
     1771                          if (periodic)
     1772                            correlationmap = PeriodicPairCorrelation(molecules, elemental, elemental2, ranges);
     1773                          else
     1774                            correlationmap = PairCorrelation(molecules, elemental, elemental2);
     1775                          //OutputCorrelationToSurface(&output, correlationmap);
     1776                          BinPairMap *binmap = BinData( correlationmap, 0.5, BinStart, BinEnd );
     1777                          OutputCorrelation ( &binoutput, binmap );
     1778                          output.close();
     1779                          binoutput.close();
     1780                          delete(binmap);
     1781                          delete(correlationmap);
     1782                          argptr+=7;
     1783                        }
    17591784                      }
    1760                     }
    1761                     break;
    1762 
    1763                   case 'P':
    1764                     {
    1765                       if ((argptr+8 >= argc) || (!IsValidNumber(argv[argptr+1])) ||  (!IsValidNumber(argv[argptr+2])) || (!IsValidNumber(argv[argptr+3])) || (!IsValidNumber(argv[argptr+4])) || (!IsValidNumber(argv[argptr+7])) || (!IsValidNumber(argv[argptr+8])) || (argv[argptr+1][0] == '-') || (argv[argptr+2][0] == '-') || (argv[argptr+3][0] == '-') || (argv[argptr+4][0] == '-') || (argv[argptr+5][0] == '-') || (argv[argptr+6][0] == '-')) {
    1766                         ExitFlag = 255;
    1767                         eLog() << Verbose(0) << "Not enough or invalid arguments given for pair correlation analysis: -C P <Z1> <x> <y> <z> <output> <bin output>" << endl;
    1768                         performCriticalExit();
    1769                       } else {
    1770                         ofstream output(argv[argptr+5]);
    1771                         ofstream binoutput(argv[argptr+6]);
    1772                         const double BinStart = atof(argv[argptr+7]);
    1773                         const double BinEnd = atof(argv[argptr+8]);
    1774 
    1775                         element *elemental = periode->FindElement((const int) atoi(argv[argptr+1]));
    1776                         Vector *Point = new Vector((const double) atof(argv[argptr+1]),(const double) atof(argv[argptr+2]),(const double) atof(argv[argptr+3]));
    1777                         CorrelationToPointMap *correlationmap = CorrelationToPoint(molecules, elemental, Point);
    1778                         //OutputCorrelationToSurface(&output, correlationmap);
    1779                         BinPairMap *binmap = BinData( correlationmap, 0.5, BinStart, BinEnd );
    1780                         OutputCorrelation ( &binoutput, binmap );
    1781                         output.close();
    1782                         binoutput.close();
    1783                         delete(Point);
    1784                         delete(binmap);
    1785                         delete(correlationmap);
    1786                         argptr+=9;
     1785                      break;
     1786
     1787                    case 'P':
     1788                      {
     1789                        if ((argptr+8 >= argc) || (!IsValidNumber(argv[argptr+1])) ||  (!IsValidNumber(argv[argptr+2])) || (!IsValidNumber(argv[argptr+3])) || (!IsValidNumber(argv[argptr+4])) || (!IsValidNumber(argv[argptr+7])) || (!IsValidNumber(argv[argptr+8])) || (argv[argptr+1][0] == '-') || (argv[argptr+2][0] == '-') || (argv[argptr+3][0] == '-') || (argv[argptr+4][0] == '-') || (argv[argptr+5][0] == '-') || (argv[argptr+6][0] == '-')) {
     1790                          ExitFlag = 255;
     1791                          DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for pair correlation analysis: -C P <Z1> <x> <y> <z> <output> <bin output>" << endl);
     1792                          performCriticalExit();
     1793                        } else {
     1794                          ofstream output(argv[argptr+5]);
     1795                          ofstream binoutput(argv[argptr+6]);
     1796                          const double BinStart = atof(argv[argptr+7]);
     1797                          const double BinEnd = atof(argv[argptr+8]);
     1798
     1799                          element *elemental = periode->FindElement((const int) atoi(argv[argptr+1]));
     1800                          Vector *Point = new Vector((const double) atof(argv[argptr+1]),(const double) atof(argv[argptr+2]),(const double) atof(argv[argptr+3]));
     1801                          CorrelationToPointMap *correlationmap = NULL;
     1802                          if (periodic)
     1803                            correlationmap  = PeriodicCorrelationToPoint(molecules, elemental, Point, ranges);
     1804                          else
     1805                            correlationmap = CorrelationToPoint(molecules, elemental, Point);
     1806                          //OutputCorrelationToSurface(&output, correlationmap);
     1807                          BinPairMap *binmap = BinData( correlationmap, 0.5, BinStart, BinEnd );
     1808                          OutputCorrelation ( &binoutput, binmap );
     1809                          output.close();
     1810                          binoutput.close();
     1811                          delete(Point);
     1812                          delete(binmap);
     1813                          delete(correlationmap);
     1814                          argptr+=9;
     1815                        }
    17871816                      }
    1788                     }
    1789                     break;
    1790 
    1791                   case 'S':
    1792                     {
    1793                       if ((argptr+6 >= argc) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+4])) || (!IsValidNumber(argv[argptr+5])) || (!IsValidNumber(argv[argptr+6])) || (argv[argptr+1][0] == '-') || (argv[argptr+2][0] == '-') || (argv[argptr+3][0] == '-')) {
    1794                         ExitFlag = 255;
    1795                         eLog() << Verbose(0) << "Not enough or invalid arguments given for pair correlation analysis: -C S <Z> <output> <bin output> <BinWidth> <BinStart> <BinEnd>" << endl;
    1796                         performCriticalExit();
    1797                       } else {
    1798                         ofstream output(argv[argptr+2]);
    1799                         ofstream binoutput(argv[argptr+3]);
    1800                         const double radius = 4.;
    1801                         const double BinWidth = atof(argv[argptr+4]);
    1802                         const double BinStart = atof(argv[argptr+5]);
    1803                         const double BinEnd = atof(argv[argptr+6]);
    1804                         double LCWidth = 20.;
    1805                         if (BinEnd > 0) {
    1806                           if (BinEnd > 2.*radius)
    1807                               LCWidth = BinEnd;
     1817                      break;
     1818
     1819                    case 'S':
     1820                      {
     1821                        if ((argptr+6 >= argc) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+4])) || (!IsValidNumber(argv[argptr+5])) || (!IsValidNumber(argv[argptr+6])) || (argv[argptr+1][0] == '-') || (argv[argptr+2][0] == '-') || (argv[argptr+3][0] == '-')) {
     1822                          ExitFlag = 255;
     1823                          DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for pair correlation analysis: -C S <Z> <output> <bin output> <BinWidth> <BinStart> <BinEnd>" << endl);
     1824                          performCriticalExit();
     1825                        } else {
     1826                          ofstream output(argv[argptr+2]);
     1827                          ofstream binoutput(argv[argptr+3]);
     1828                          const double radius = 4.;
     1829                          const double BinWidth = atof(argv[argptr+4]);
     1830                          const double BinStart = atof(argv[argptr+5]);
     1831                          const double BinEnd = atof(argv[argptr+6]);
     1832                          double LCWidth = 20.;
     1833                          if (BinEnd > 0) {
     1834                            if (BinEnd > 2.*radius)
     1835                                LCWidth = BinEnd;
     1836                            else
     1837                              LCWidth = 2.*radius;
     1838                          }
     1839
     1840                          // get the boundary
     1841                          class molecule *Boundary = NULL;
     1842                          class Tesselation *TesselStruct = NULL;
     1843                          const LinkedCell *LCList = NULL;
     1844                          // find biggest molecule
     1845                          int counter  = 0;
     1846                          for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++) {
     1847                            if ((Boundary == NULL) || (Boundary->AtomCount < (*BigFinder)->AtomCount)) {
     1848                              Boundary = *BigFinder;
     1849                            }
     1850                            counter++;
     1851                          }
     1852                          bool *Actives = Malloc<bool>(counter, "ParseCommandLineOptions() - case C -- *Actives");
     1853                          counter = 0;
     1854                          for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++) {
     1855                            Actives[counter++] = (*BigFinder)->ActiveFlag;
     1856                            (*BigFinder)->ActiveFlag = (*BigFinder == Boundary) ? false : true;
     1857                          }
     1858                          LCList = new LinkedCell(Boundary, LCWidth);
     1859                          element *elemental = periode->FindElement((const int) atoi(argv[argptr+1]));
     1860                          FindNonConvexBorder(Boundary, TesselStruct, LCList, radius, NULL);
     1861                          CorrelationToSurfaceMap *surfacemap = NULL;
     1862                          if (periodic)
     1863                            surfacemap = PeriodicCorrelationToSurface( molecules, elemental, TesselStruct, LCList, ranges);
    18081864                          else
    1809                             LCWidth = 2.*radius;
     1865                            surfacemap = CorrelationToSurface( molecules, elemental, TesselStruct, LCList);
     1866                          OutputCorrelationToSurface(&output, surfacemap);
     1867                          // check whether radius was appropriate
     1868                          {
     1869                            double start; double end;
     1870                            GetMinMax( surfacemap, start, end);
     1871                            if (LCWidth < end)
     1872                              DoeLog(1) && (eLog()<< Verbose(1) << "Linked Cell width is smaller than the found range of values! Bins can only be correct up to: " << radius << "." << endl);
     1873                          }
     1874                          BinPairMap *binmap = BinData( surfacemap, BinWidth, BinStart, BinEnd );
     1875                          OutputCorrelation ( &binoutput, binmap );
     1876                          output.close();
     1877                          binoutput.close();
     1878                          for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++)
     1879                            (*BigFinder)->ActiveFlag = Actives[counter++];
     1880                          Free(&Actives);
     1881                          delete(LCList);
     1882                          delete(TesselStruct);
     1883                          delete(binmap);
     1884                          delete(surfacemap);
     1885                          argptr+=7;
    18101886                        }
    1811 
    1812                         // get the boundary
    1813                         class molecule *Boundary = NULL;
    1814                         class Tesselation *TesselStruct = NULL;
    1815                         const LinkedCell *LCList = NULL;
    1816                         // find biggest molecule
    1817                         int counter  = 0;
    1818                         for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++) {
    1819                           if ((Boundary == NULL) || (Boundary->AtomCount < (*BigFinder)->AtomCount)) {
    1820                             Boundary = *BigFinder;
    1821                           }
    1822                           counter++;
    1823                         }
    1824                         bool *Actives = Malloc<bool>(counter, "ParseCommandLineOptions() - case C -- *Actives");
    1825                         counter = 0;
    1826                         for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++) {
    1827                           Actives[counter++] = (*BigFinder)->ActiveFlag;
    1828                           (*BigFinder)->ActiveFlag = (*BigFinder == Boundary) ? false : true;
    1829                         }
    1830                         LCList = new LinkedCell(Boundary, LCWidth);
    1831                         element *elemental = periode->FindElement((const int) atoi(argv[argptr+1]));
    1832                         FindNonConvexBorder(Boundary, TesselStruct, LCList, radius, NULL);
    1833                         //int ranges[NDIM] = {1,1,1};
    1834                         CorrelationToSurfaceMap *surfacemap = CorrelationToSurface( molecules, elemental, TesselStruct, LCList); // for Periodic..(): ..., ranges );
    1835                         OutputCorrelationToSurface(&output, surfacemap);
    1836                         // check whether radius was appropriate
    1837                         {
    1838                         double start; double end;
    1839                         GetMinMax( surfacemap, start, end);
    1840                         if (LCWidth < end)
    1841                           eLog() << Verbose(1) << "Linked Cell width is smaller than the found range of values! Bins can only be correct up to: " << radius << "." << endl;
    1842                         }
    1843                         BinPairMap *binmap = BinData( surfacemap, BinWidth, BinStart, BinEnd );
    1844                         OutputCorrelation ( &binoutput, binmap );
    1845                         output.close();
    1846                         binoutput.close();
    1847                         for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++)
    1848                           (*BigFinder)->ActiveFlag = Actives[counter++];
    1849                         Free(&Actives);
    1850                         delete(LCList);
    1851                         delete(TesselStruct);
    1852                         delete(binmap);
    1853                         delete(surfacemap);
    1854                         argptr+=7;
    18551887                      }
    1856                     }
    1857                     break;
    1858 
    1859                   default:
    1860                     ExitFlag = 255;
    1861                     eLog() << Verbose(0) << "Invalid type given for pair correlation analysis: -C <type: E/P/S> [more params] <output> <bin output>" << endl;
    1862                     performCriticalExit();
    1863                     break;
     1888                      break;
     1889
     1890                    default:
     1891                      ExitFlag = 255;
     1892                      DoeLog(0) && (eLog()<< Verbose(0) << "Invalid type given for pair correlation analysis: -C <type: E/P/S> [more params] <output> <bin output>" << endl);
     1893                      performCriticalExit();
     1894                      break;
     1895                  }
    18641896                }
    1865               }
    1866               break;
     1897                break;
     1898              }
    18671899            case 'E':
    18681900              if (ExitFlag == 0) ExitFlag = 1;
    18691901              if ((argptr+1 >= argc) || (!IsValidNumber(argv[argptr])) || (argv[argptr+1][0] == '-')) {
    18701902                ExitFlag = 255;
    1871                 eLog() << Verbose(0) << "Not enough or invalid arguments given for changing element: -E <atom nr.> <element>" << endl;
     1903                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for changing element: -E <atom nr.> <element>" << endl);
    18721904                performCriticalExit();
    18731905              } else {
     
    18821914              if (ExitFlag == 0) ExitFlag = 1;
    18831915              MaxDistance = -1;
    1884               if (argv[argptr-1][2] == 'F') {
     1916              if (argv[argptr-1][2] == 'F') { // option is -FF?
    18851917                // fetch first argument as max distance to surface
    18861918                MaxDistance = atof(argv[argptr++]);
     
    18891921              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]))) {
    18901922                ExitFlag = 255;
    1891                 eLog() << Verbose(0) << "Not enough or invalid arguments given for filling box with water: -F <xyz of filler> <dist_x> <dist_y> <dist_z> <boundary> <randatom> <randmol> <DoRotate>" << endl;
     1923                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for filling box with water: -F <xyz of filler> <dist_x> <dist_y> <dist_z> <boundary> <randatom> <randmol> <DoRotate>" << endl);
    18921924                performCriticalExit();
    18931925              } else {
     
    18971929                molecule *filler = new molecule(periode);
    18981930                if (!filler->AddXYZFile(argv[argptr])) {
    1899                   eLog() << Verbose(0) << "Could not parse filler molecule from " << argv[argptr] << "." << endl;
     1931                  DoeLog(0) && (eLog()<< Verbose(0) << "Could not parse filler molecule from " << argv[argptr] << "." << endl);
    19001932                }
    19011933                filler->SetNameFromFilename(argv[argptr]);
     
    19191951              if ((argptr >= argc) || (argv[argptr][0] == '-')) {
    19201952                ExitFlag =255;
    1921                 eLog() << Verbose(0) << "Missing source file for bonds in molecule: -A <bond sourcefile>" << endl;
     1953                DoeLog(0) && (eLog()<< Verbose(0) << "Missing source file for bonds in molecule: -A <bond sourcefile>" << endl);
    19221954                performCriticalExit();
    19231955              } else {
     
    19341966              if ((argptr >= argc) || (argv[argptr][0] == '-')) {
    19351967                ExitFlag =255;
    1936                 eLog() << Verbose(0) << "Missing path of adjacency file: -j <path>" << endl;
     1968                DoeLog(0) && (eLog()<< Verbose(0) << "Missing path of adjacency file: -j <path>" << endl);
    19371969                performCriticalExit();
    19381970              } else {
    19391971                Log() << Verbose(0) << "Storing adjacency to path " << argv[argptr] << "." << endl;
    19401972                configuration.BG->ConstructBondGraph(mol);
    1941                 mol->StoreAdjacencyToFile(argv[argptr]);
     1973                mol->StoreAdjacencyToFile(NULL, argv[argptr]);
    19421974                argptr+=1;
    19431975              }
     
    19481980              if ((argptr >= argc) || (argv[argptr][0] == '-')) {
    19491981                ExitFlag =255;
    1950                 eLog() << Verbose(0) << "Missing path of bonds file: -j <path>" << endl;
     1982                DoeLog(0) && (eLog()<< Verbose(0) << "Missing path of bonds file: -j <path>" << endl);
    19511983                performCriticalExit();
    19521984              } else {
    19531985                Log() << Verbose(0) << "Storing bonds to path " << argv[argptr] << "." << endl;
    19541986                configuration.BG->ConstructBondGraph(mol);
    1955                 mol->StoreBondsToFile(argv[argptr]);
     1987                mol->StoreBondsToFile(NULL, argv[argptr]);
    19561988                argptr+=1;
    19571989              }
     
    19621994              if ((argptr+1 >= argc) || (argv[argptr+1][0] == '-')){
    19631995                ExitFlag = 255;
    1964                 eLog() << Verbose(0) << "Not enough or invalid arguments given for non-convex envelope: -o <radius> <tecplot output file>" << endl;
     1996                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for non-convex envelope: -o <radius> <tecplot output file>" << endl);
    19651997                performCriticalExit();
    19661998              } else {
     
    19982030              if ((argptr >= argc) || (argv[argptr][0] == '-')) {
    19992031                ExitFlag = 255;
    2000                 eLog() << Verbose(0) << "Not enough or invalid arguments given for storing tempature: -S <temperature file>" << endl;
     2032                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for storing tempature: -S <temperature file>" << endl);
    20012033                performCriticalExit();
    20022034              } else {
     
    20162048              if ((argptr >= argc) || (argv[argptr][0] == '-')) {
    20172049                ExitFlag = 255;
    2018                 eLog() << Verbose(0) << "Not enough or invalid arguments given for storing tempature: -L <step0> <step1> <prefix> <identity mapping?>" << endl;
     2050                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for storing tempature: -L <step0> <step1> <prefix> <identity mapping?>" << endl);
    20192051                performCriticalExit();
    20202052              } else {
     
    20342066              if ((argptr >= argc) || (argv[argptr][0] == '-')) {
    20352067                ExitFlag = 255;
    2036                 eLog() << Verbose(0) << "Not enough or invalid arguments given for parsing and integrating forces: -P <forces file>" << endl;
     2068                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for parsing and integrating forces: -P <forces file>" << endl);
    20372069                performCriticalExit();
    20382070              } else {
     
    20502082              if ((argptr+1 >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])))  {
    20512083                ExitFlag = 255;
    2052                 eLog() << Verbose(0) << "Not enough or invalid arguments given for removing atoms: -R <id> <distance>" << endl;
     2084                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for removing atoms: -R <id> <distance>" << endl);
    20532085                performCriticalExit();
    20542086              } else {
     
    20672099                  }
    20682100                } else {
    2069                   eLog() << Verbose(1) << "Removal failed due to missing atoms on molecule or wrong id." << endl;
     2101                  DoeLog(1) && (eLog()<< Verbose(1) << "Removal failed due to missing atoms on molecule or wrong id." << endl);
    20702102                }
    20712103                argptr+=2;
     
    20762108              if ((argptr+2 >= argc) || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) {
    20772109                ExitFlag = 255;
    2078                 eLog() << Verbose(0) << "Not enough or invalid arguments given for translation: -t <x> <y> <z>" << endl;
     2110                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for translation: -t <x> <y> <z>" << endl);
    20792111                performCriticalExit();
    20802112              } else {
     
    20922124              if ((argptr+2 >= argc) || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) {
    20932125                ExitFlag = 255;
    2094                 eLog() << Verbose(0) << "Not enough or invalid arguments given for periodic translation: -T <x> <y> <z>" << endl;
     2126                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for periodic translation: -T <x> <y> <z>" << endl);
    20952127                performCriticalExit();
    20962128              } else {
     
    21082140              if ((argptr >= argc) || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) {
    21092141                ExitFlag = 255;
    2110                 eLog() << Verbose(0) << "Not enough or invalid arguments given for scaling: -s <factor_x> [factor_y] [factor_z]" << endl;
     2142                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for scaling: -s <factor_x> [factor_y] [factor_z]" << endl);
    21112143                performCriticalExit();
    21122144              } else {
     
    21332165              if ((argptr+5 >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) || (!IsValidNumber(argv[argptr+3])) || (!IsValidNumber(argv[argptr+4])) || (!IsValidNumber(argv[argptr+5])) ) {
    21342166                ExitFlag = 255;
    2135                 eLog() << Verbose(0) << "Not enough or invalid arguments given for centering in box: -b <xx> <xy> <xz> <yy> <yz> <zz>" << endl;
     2167                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for centering in box: -b <xx> <xy> <xz> <yy> <yz> <zz>" << endl);
    21362168                performCriticalExit();
    21372169              } else {
     
    21522184              if ((argptr+5 >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) || (!IsValidNumber(argv[argptr+3])) || (!IsValidNumber(argv[argptr+4])) || (!IsValidNumber(argv[argptr+5])) ) {
    21532185                ExitFlag = 255;
    2154                 eLog() << Verbose(0) << "Not enough or invalid arguments given for bounding in box: -B <xx> <xy> <xz> <yy> <yz> <zz>" << endl;
     2186                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for bounding in box: -B <xx> <xy> <xz> <yy> <yz> <zz>" << endl);
    21552187                performCriticalExit();
    21562188              } else {
     
    21712203              if ((argptr+2 >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) {
    21722204                ExitFlag = 255;
    2173                 eLog() << Verbose(0) << "Not enough or invalid arguments given for centering with boundary: -c <boundary_x> <boundary_y> <boundary_z>" << endl;
     2205                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for centering with boundary: -c <boundary_x> <boundary_y> <boundary_z>" << endl);
    21742206                performCriticalExit();
    21752207              } else {
     
    22062238              if ((argptr >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])))  {
    22072239                ExitFlag = 255;
    2208                 eLog() << Verbose(0) << "Not enough or invalid arguments given for removing atoms: -r <id>" << endl;
     2240                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for removing atoms: -r <id>" << endl);
    22092241                performCriticalExit();
    22102242              } else {
     
    22202252              if ((argptr+1 >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1]))) {
    22212253                ExitFlag = 255;
    2222                 eLog() << Verbose(0) << "Not enough or invalid arguments for fragmentation: -f <max. bond distance> <bond order>" << endl;
     2254                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments for fragmentation: -f <max. bond distance> <bond order>" << endl);
    22232255                performCriticalExit();
    22242256              } else {
     
    22402272              j = atoi(argv[argptr++]);
    22412273              if ((j<0) || (j>1)) {
    2242                 eLog() << Verbose(1) << "Argument of '-m' should be either 0 for no-rotate or 1 for rotate." << endl;
     2274                DoeLog(1) && (eLog()<< Verbose(1) << "Argument of '-m' should be either 0 for no-rotate or 1 for rotate." << endl);
    22432275                j = 0;
    22442276              }
     
    22542286              if ((argptr+1 >= argc) || (argv[argptr][0] == '-')){
    22552287                ExitFlag = 255;
    2256                 eLog() << Verbose(0) << "Not enough or invalid arguments given for convex envelope: -o <convex output file> <non-convex output file>" << endl;
     2288                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for convex envelope: -o <convex output file> <non-convex output file>" << endl);
    22572289                performCriticalExit();
    22582290              } else {
     
    22792311              if ((argptr+1 >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) ) {
    22802312                ExitFlag = 255;
    2281                 eLog() << Verbose(0) << "Not enough or invalid arguments given for suspension with specified volume: -U <volume> <density>" << endl;
     2313                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for suspension with specified volume: -U <volume> <density>" << endl);
    22822314                performCriticalExit();
    22832315              } else {
     
    22902322                if (volume != -1)
    22912323                  ExitFlag = 255;
    2292                   eLog() << Verbose(0) << "Not enough or invalid arguments given for suspension: -u <density>" << endl;
     2324                  DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for suspension: -u <density>" << endl);
    22932325                  performCriticalExit();
    22942326              } else {
     
    22982330                density = atof(argv[argptr++]);
    22992331                if (density < 1.0) {
    2300                   eLog() << Verbose(1) << "Density must be greater than 1.0g/cm^3 !" << endl;
     2332                  DoeLog(1) && (eLog()<< Verbose(1) << "Density must be greater than 1.0g/cm^3 !" << endl);
    23012333                  density = 1.3;
    23022334                }
     
    23042336//                  repetition[i] = atoi(argv[argptr++]);
    23052337//                  if (repetition[i] < 1)
    2306 //                    eLog() << Verbose(1) << "repetition value must be greater 1!" << endl;
     2338//                    DoeLog(1) && (eLog()<< Verbose(1) << "repetition value must be greater 1!" << endl);
    23072339//                  repetition[i] = 1;
    23082340//                }
     
    23142346              if ((argptr+2 >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) {
    23152347                ExitFlag = 255;
    2316                 eLog() << Verbose(0) << "Not enough or invalid arguments given for repeating cells: -d <repeat_x> <repeat_y> <repeat_z>" << endl;
     2348                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for repeating cells: -d <repeat_x> <repeat_y> <repeat_z>" << endl);
    23172349                performCriticalExit();
    23182350              } else {
     
    23252357                  Vector ** vectors;
    23262358                  if (faktor < 1) {
    2327                     eLog() << Verbose(1) << "Repetition factor mus be greater than 1!" << endl;
     2359                    DoeLog(1) && (eLog()<< Verbose(1) << "Repetition factor mus be greater than 1!" << endl);
    23282360                    faktor = 1;
    23292361                  }
     
    23422374                    }
    23432375                    if (count != j)
    2344                       eLog() << Verbose(1) << "AtomCount " << count << " is not equal to number of atoms in molecule " << j << "!" << endl;
     2376                      DoeLog(1) && (eLog()<< Verbose(1) << "AtomCount " << count << " is not equal to number of atoms in molecule " << j << "!" << endl);
    23452377                    x.Zero();
    23462378                    y.Zero();
     
    24092441  cout << ESPACKVersion << endl;
    24102442
     2443  Log() << Verbose(1) << "test" << endl;
     2444  DoLog(3) && (Log() << Verbose(1) << "test");
     2445
    24112446  setVerbosity(0);
    24122447
  • src/config.cpp

    r7ee87f r58ed4a  
    7474  file= new ifstream(filename);
    7575  if (file == NULL) {
    76     eLog() << Verbose(1) << "config file " << filename << " missing!" << endl;
     76    DoeLog(1) && (eLog()<< Verbose(1) << "config file " << filename << " missing!" << endl);
    7777    return;
    7878  }
     
    8989  // allocate buffer's 1st dimension
    9090  if (buffer != NULL) {
    91     eLog() << Verbose(1) << "FileBuffer->buffer is not NULL!" << endl;
     91    DoeLog(1) && (eLog()<< Verbose(1) << "FileBuffer->buffer is not NULL!" << endl);
    9292    return;
    9393  } else
     
    144144  map<const char *, int, IonTypeCompare> IonTypeLineMap;
    145145  if (LineMapping == NULL) {
    146     eLog() << Verbose(0) << "map pointer is NULL: " << LineMapping << endl;
     146    DoeLog(0) && (eLog()<< Verbose(0) << "map pointer is NULL: " << LineMapping << endl);
    147147    performCriticalExit();
    148148    return;
     
    160160      LineMapping[CurrentLine+(nr++)] = runner->second;
    161161    else {
    162       eLog() << Verbose(0) << "config::MapIonTypesInBuffer - NoAtoms is wrong: We are past the end of the file!" << endl;
     162      DoeLog(0) && (eLog()<< Verbose(0) << "config::MapIonTypesInBuffer - NoAtoms is wrong: We are past the end of the file!" << endl);
    163163      performCriticalExit();
    164164    }
     
    659659{
    660660  if (FileBuffer != NULL) {
    661     eLog() << Verbose(2) << "deleting present FileBuffer in PrepareFileBuffer()." << endl;
     661    DoeLog(2) && (eLog()<< Verbose(2) << "deleting present FileBuffer in PrepareFileBuffer()." << endl);
    662662    delete(FileBuffer);
    663663  }
     
    685685
    686686  if (mol == NULL) {
    687     eLog() << Verbose(0) << "Molecule is not allocated in LoadMolecule(), exit.";
     687    DoeLog(0) && (eLog()<< Verbose(0) << "Molecule is not allocated in LoadMolecule(), exit.");
    688688    performCriticalExit();
    689689  }
     
    691691  ParseForParameter(verbose,FileBuffer,"MaxTypes", 0, 1, 1, int_type, &(MaxTypes), 1, critical);
    692692  if (MaxTypes == 0) {
    693     eLog() << Verbose(1) << "There are no atoms according to MaxTypes in this config file." << endl;
     693    DoeLog(1) && (eLog()<< Verbose(1) << "There are no atoms according to MaxTypes in this config file." << endl);
    694694    //performCriticalExit();
    695695  } else {
     
    710710    sprintf(name,"Ion_Type%i",MaxTypes);
    711711    if (!ParseForParameter(verbose,FileBuffer, (const char*)name, 1, 1, 1, int_type, &value[0], 1, critical)) {
    712       eLog() << Verbose(0) << "There are no atoms in the config file!" << endl;
     712      DoeLog(0) && (eLog()<< Verbose(0) << "There are no atoms in the config file!" << endl);
    713713      performCriticalExit();
    714714      return;
     
    855855  ifstream *file = new ifstream(filename);
    856856  if (file == NULL) {
    857     eLog() << Verbose(1) << "config file " << filename << " missing!" << endl;
     857    DoeLog(1) && (eLog()<< Verbose(1) << "config file " << filename << " missing!" << endl);
    858858    return;
    859859  }
     
    10651065      Log() << Verbose(0) << "Bond length table loaded successfully." << endl;
    10661066    } else {
    1067       eLog() << Verbose(1) << "Bond length table loading failed." << endl;
     1067      DoeLog(1) && (eLog()<< Verbose(1) << "Bond length table loading failed." << endl);
    10681068    }
    10691069  }
     
    10941094  ifstream *file = new ifstream(filename);
    10951095  if (file == NULL) {
    1096     eLog() << Verbose(1) << "config file " << filename << " missing!" << endl;
     1096    DoeLog(1) && (eLog()<< Verbose(1) << "config file " << filename << " missing!" << endl);
    10971097    return;
    10981098  }
     
    14331433    return result;
    14341434  } else {
    1435     eLog() << Verbose(1) << "Cannot open output file:" << filename << endl;
     1435    DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open output file:" << filename << endl);
    14361436    return false;
    14371437  }
     
    14551455    output = new ofstream(fname->str().c_str(), ios::out);
    14561456    if (output == NULL) {
    1457       eLog() << Verbose(1) << "Cannot open mpqc output file:" << fname << endl;
     1457      DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open mpqc output file:" << fname << endl);
    14581458      delete(fname);
    14591459      return false;
     
    14981498    output = new ofstream(fname->str().c_str(), ios::out);
    14991499    if (output == NULL) {
    1500       eLog() << Verbose(1) << "Cannot open mpqc hessian output file:" << fname << endl;
     1500      DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open mpqc hessian output file:" << fname << endl);
    15011501      delete(fname);
    15021502      return false;
     
    15541554  f = fopen(name, "w" );
    15551555  if (f == NULL) {
    1556     eLog() << Verbose(1) << "Cannot open pdb output file:" << name << endl;
     1556    DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open pdb output file:" << name << endl);
    15571557    return false;
    15581558  }
     
    16091609  f = fopen(name, "w" );
    16101610  if (f == NULL) {
    1611     eLog() << Verbose(1) << "Cannot open pdb output file:" << name << endl;
     1611    DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open pdb output file:" << name << endl);
    16121612    Free(&elementNo);
    16131613    return false;
     
    16591659  output = new ofstream(fname->str().c_str(), ios::out);
    16601660  if (output == NULL) {
    1661     eLog() << Verbose(1) << "Cannot open tremolo output file:" << fname << endl;
     1661    DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open tremolo output file:" << fname << endl);
    16621662    delete(fname);
    16631663    return false;
     
    17141714  output = new ofstream(fname->str().c_str(), ios::out);
    17151715  if (output == NULL) {
    1716     eLog() << Verbose(1) << "Cannot open tremolo output file:" << fname << endl;
     1716    DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open tremolo output file:" << fname << endl);
    17171717    delete(fname);
    17181718    return false;
  • src/ellipsoid.cpp

    r7ee87f r58ed4a  
    241241    x = new Vector[PointsToPick];
    242242  } else {
    243     eLog() << Verbose(2) << "Given pointer to vector array seems already allocated." << endl;
     243    DoeLog(2) && (eLog()<< Verbose(2) << "Given pointer to vector array seems already allocated." << endl);
    244244  }
    245245
     
    341341    x = new Vector[PointsToPick];
    342342  } else {
    343     eLog() << Verbose(2) << "Given pointer to vector array seems already allocated." << endl;
     343    DoeLog(2) && (eLog()<< Verbose(2) << "Given pointer to vector array seems already allocated." << endl);
    344344  }
    345345
  • src/helpers.hpp

    r7ee87f r58ed4a  
    134134  LookupTable = Calloc<T*>(count, "CreateFatherLookupTable - **LookupTable");
    135135  if (LookupTable == NULL) {
    136     eLog() << Verbose(0) << "LookupTable memory allocation failed!" << endl;
     136    DoeLog(0) && (eLog()<< Verbose(0) << "LookupTable memory allocation failed!" << endl);
    137137    performCriticalExit();
    138138    status = false;
  • src/linkedcell.cpp

    r7ee87f r58ed4a  
    4747  Log() << Verbose(1) << "Begin of LinkedCell" << endl;
    4848  if ((set == NULL) || (set->IsEmpty())) {
    49     eLog() << Verbose(1) << "set is NULL or contains no linked cell nodes!" << endl;
     49    DoeLog(1) && (eLog()<< Verbose(1) << "set is NULL or contains no linked cell nodes!" << endl);
    5050    return;
    5151  }
     
    7979  Log() << Verbose(2) << "Allocating cells ... ";
    8080  if (LC != NULL) {
    81     eLog() << Verbose(1) << "Linked Cell list is already allocated, I do nothing." << endl;
     81    DoeLog(1) && (eLog()<< Verbose(1) << "Linked Cell list is already allocated, I do nothing." << endl);
    8282    return;
    8383  }
     
    122122  Log() << Verbose(1) << "Begin of LinkedCell" << endl;
    123123  if (set->empty()) {
    124     eLog() << Verbose(1) << "set contains no linked cell nodes!" << endl;
     124    DoeLog(1) && (eLog()<< Verbose(1) << "set contains no linked cell nodes!" << endl);
    125125    return;
    126126  }
     
    151151  Log() << Verbose(2) << "Allocating cells ... ";
    152152  if (LC != NULL) {
    153     eLog() << Verbose(1) << "Linked Cell list is already allocated, I do nothing." << endl;
     153    DoeLog(1) && (eLog()<< Verbose(1) << "Linked Cell list is already allocated, I do nothing." << endl);
    154154    return;
    155155  }
     
    199199    status = status && ((n[i] >=0) && (n[i] < N[i]));
    200200  if (!status)
    201   eLog() << Verbose(1) << "indices are out of bounds!" << endl;
     201  DoeLog(1) && (eLog()<< Verbose(1) << "indices are out of bounds!" << endl);
    202202  return status;
    203203};
     
    260260    return status;
    261261  } else {
    262     eLog() << Verbose(1) << "Node at " << *Walker << " is out of bounds." << endl;
     262    DoeLog(1) && (eLog()<< Verbose(1) << "Node at " << *Walker << " is out of bounds." << endl);
    263263    return false;
    264264  }
  • src/log.cpp

    r7ee87f r58ed4a  
    2828}
    2929
     30/** Checks verbosity for logger.
     31 * Is supposed to be used in construct as this:
     32 * DoLog(2) && (Log() << Verbose(2) << "message." << endl);
     33 * If DoLog does not return true, the right-hand side is not evaluated and we save some time.
     34 * \param verbose verbosity level of this message
     35 * \return true - print, false - don't
     36 */
     37bool DoLog(int verbose) {
     38  return verbose <= logger::getInstance()->verbosity;
     39}
     40
     41/** Checks verbosity for errorlogger.
     42 * Is supposed to be used in construct as this:
     43 * DoLog(2) && (Log() << Verbose(2) << "message." << endl);
     44 * If DoLog does not return true, the right-hand side is not evaluated and we save some time.
     45 * \param verbose verbosity level of this message
     46 * \return true - print, false - don't
     47 */
     48bool DoeLog(int verbose) {
     49  return verbose <= errorLogger::getInstance()->verbosity;
     50}
     51
    3052/**
    3153 * Prints an error log entry.
  • src/log.hpp

    r7ee87f r58ed4a  
    1515class errorLogger * eLog();
    1616void setVerbosity(int verbosityLevel);
     17bool DoLog(int verbose);
     18bool DoeLog(int verbose);
    1719
    1820#endif /* LOG_HPP_ */
  • src/molecule.cpp

    r7ee87f r58ed4a  
    194194  BondRescale = TopOrigin->type->HBondDistance[TopBond->BondDegree-1];
    195195  if (BondRescale == -1) {
    196     eLog() << Verbose(1) << "There is no typical hydrogen bond distance in replacing bond (" << TopOrigin->Name << "<->" << TopReplacement->Name << ") of degree " << TopBond->BondDegree << "!" << endl;
     196    DoeLog(1) && (eLog()<< Verbose(1) << "There is no typical hydrogen bond distance in replacing bond (" << TopOrigin->Name << "<->" << TopReplacement->Name << ") of degree " << TopBond->BondDegree << "!" << endl);
    197197    return false;
    198198    BondRescale = bondlength;
     
    237237            SecondOtherAtom = (*Runner)->GetOtherAtom(TopOrigin);
    238238          } else {
    239             eLog() << Verbose(2) << "Detected more than four bonds for atom " << TopOrigin->Name;
     239            DoeLog(2) && (eLog()<< Verbose(2) << "Detected more than four bonds for atom " << TopOrigin->Name);
    240240          }
    241241        }
     
    274274      bondangle = TopOrigin->type->HBondAngle[1];
    275275      if (bondangle == -1) {
    276         eLog() << Verbose(1) << "There is no typical hydrogen bond angle in replacing bond (" << TopOrigin->Name << "<->" << TopReplacement->Name << ") of degree " << TopBond->BondDegree << "!" << endl;
     276        DoeLog(1) && (eLog()<< Verbose(1) << "There is no typical hydrogen bond angle in replacing bond (" << TopOrigin->Name << "<->" << TopReplacement->Name << ") of degree " << TopBond->BondDegree << "!" << endl);
    277277        return false;
    278278        bondangle = 0;
     
    396396      break;
    397397    default:
    398       eLog() << Verbose(1) << "BondDegree does not state single, double or triple bond!" << endl;
     398      DoeLog(1) && (eLog()<< Verbose(1) << "BondDegree does not state single, double or triple bond!" << endl);
    399399      AllWentWell = false;
    400400      break;
     
    447447    Walker->type = elemente->FindElement(shorthand);
    448448    if (Walker->type == NULL) {
    449       eLog() << Verbose(1) << "Could not parse the element at line: '" << line << "', setting to H.";
     449      DoeLog(1) && (eLog()<< Verbose(1) << "Could not parse the element at line: '" << line << "', setting to H.");
    450450      Walker->type = elemente->FindElement(1);
    451451    }
     
    543543    add(Binder, last);
    544544  } else {
    545     eLog() << Verbose(1) << "Could not add bond between " << atom1->Name << " and " << atom2->Name << " as one or both are not present in the molecule." << endl;
     545    DoeLog(1) && (eLog()<< Verbose(1) << "Could not add bond between " << atom1->Name << " and " << atom2->Name << " as one or both are not present in the molecule." << endl);
    546546  }
    547547  return Binder;
     
    555555bool molecule::RemoveBond(bond *pointer)
    556556{
    557   //eLog() << Verbose(1) << "molecule::RemoveBond: Function not implemented yet." << endl;
     557  //DoeLog(1) && (eLog()<< Verbose(1) << "molecule::RemoveBond: Function not implemented yet." << endl);
    558558  pointer->leftatom->RegisterBond(pointer);
    559559  pointer->rightatom->RegisterBond(pointer);
     
    569569bool molecule::RemoveBonds(atom *BondPartner)
    570570{
    571   //eLog() << Verbose(1) << "molecule::RemoveBond: Function not implemented yet." << endl;
     571  //DoeLog(1) && (eLog()<< Verbose(1) << "molecule::RemoveBond: Function not implemented yet." << endl);
    572572  BondList::const_iterator ForeRunner;
    573573  while (!BondPartner->ListOfBonds.empty()) {
     
    622622    AtomCount--;
    623623  } else
    624     eLog() << Verbose(1) << "Atom " << pointer->Name << " is of element " << pointer->type->Z << " but the entry in the table of the molecule is 0!" << endl;
     624    DoeLog(1) && (eLog()<< Verbose(1) << "Atom " << pointer->Name << " is of element " << pointer->type->Z << " but the entry in the table of the molecule is 0!" << endl);
    625625  if (ElementsInMolecule[pointer->type->Z] == 0)  // was last atom of this element?
    626626    ElementCount--;
     
    640640    ElementsInMolecule[pointer->type->Z]--; // decrease number of atom of this element
    641641  else
    642     eLog() << Verbose(1) << "Atom " << pointer->Name << " is of element " << pointer->type->Z << " but the entry in the table of the molecule is 0!" << endl;
     642    DoeLog(1) && (eLog()<< Verbose(1) << "Atom " << pointer->Name << " is of element " << pointer->type->Z << " but the entry in the table of the molecule is 0!" << endl);
    643643  if (ElementsInMolecule[pointer->type->Z] == 0)  // was last atom of this element?
    644644    ElementCount--;
  • src/molecule_dynamics.cpp

    r7ee87f r58ed4a  
    306306  for (int i=mol->AtomCount; i--;) // now each single entry in the DoubleList should be <=1
    307307    if (Params.DoubleList[i] > 1) {
    308       eLog() << Verbose(0) << "Failed to create an injective PermutationMap!" << endl;
     308      DoeLog(0) && (eLog()<< Verbose(0) << "Failed to create an injective PermutationMap!" << endl);
    309309      performCriticalExit();
    310310    }
     
    428428            }
    429429            if (Potential > Params.PenaltyConstants[2]) {
    430               eLog() << Verbose(1) << "The two-step permutation procedure did not maintain injectivity!" << endl;
     430              DoeLog(1) && (eLog()<< Verbose(1) << "The two-step permutation procedure did not maintain injectivity!" << endl);
    431431              exit(255);
    432432            }
    433433            //Log() << Verbose(0) << endl;
    434434          } else {
    435             eLog() << Verbose(1) << *Runner << " was not the owner of " << *Sprinter << "!" << endl;
     435            DoeLog(1) && (eLog()<< Verbose(1) << *Runner << " was not the owner of " << *Sprinter << "!" << endl);
    436436            exit(255);
    437437          }
     
    568568    // parse file into ForceMatrix
    569569    if (!Force.ParseMatrix(file, 0,0,0)) {
    570       eLog() << Verbose(0) << "Could not parse Force Matrix file " << file << "." << endl;
     570      DoeLog(0) && (eLog()<< Verbose(0) << "Could not parse Force Matrix file " << file << "." << endl);
    571571      performCriticalExit();
    572572      return false;
    573573    }
    574574    if (Force.RowCounter[0] != AtomCount) {
    575       eLog() << Verbose(0) << "Mismatch between number of atoms in file " << Force.RowCounter[0] << " and in molecule " << AtomCount << "." << endl;
     575      DoeLog(0) && (eLog()<< Verbose(0) << "Mismatch between number of atoms in file " << Force.RowCounter[0] << " and in molecule " << AtomCount << "." << endl);
    576576      performCriticalExit();
    577577      return false;
  • src/molecule_fragmentation.cpp

    r7ee87f r58ed4a  
    113113        testGraphInsert = FragmentList->insert(GraphPair (CurrentSet,pair<int,double>(NumberOfFragments++,1)));  // store fragment number and current factor
    114114        if (!testGraphInsert.second) {
    115           eLog() << Verbose(0) << "KeySet file must be corrupt as there are two equal key sets therein!" << endl;
     115          DoeLog(0) && (eLog()<< Verbose(0) << "KeySet file must be corrupt as there are two equal key sets therein!" << endl);
    116116          performCriticalExit();
    117117        }
     
    214214    Log() << Verbose(0) << "done." << endl;
    215215  } else {
    216     eLog() << Verbose(0) << "Unable to open " << line << " for writing keysets!" << endl;
     216    DoeLog(0) && (eLog()<< Verbose(0) << "Unable to open " << line << " for writing keysets!" << endl);
    217217    performCriticalExit();
    218218    status = false;
     
    372372      }
    373373    } else {
    374       eLog() << Verbose(0) << "Atom No. " << (*runner).second.first << " was not found in this molecule." << endl;
     374      DoeLog(0) && (eLog()<< Verbose(0) << "Atom No. " << (*runner).second.first << " was not found in this molecule." << endl);
    375375      performCriticalExit();
    376376    }
     
    447447    // transmorph graph keyset list into indexed KeySetList
    448448    if (GlobalKeySetList == NULL) {
    449       eLog() << Verbose(1) << "Given global key set list (graph) is NULL!" << endl;
     449      DoeLog(1) && (eLog()<< Verbose(1) << "Given global key set list (graph) is NULL!" << endl);
    450450      return false;
    451451    }
     
    455455    map<int, pair<double,int> > *AdaptiveCriteriaList = ScanAdaptiveFileIntoMap(path, *IndexKeySetList); // (Root No., (Value, Order)) !
    456456    if (AdaptiveCriteriaList->empty()) {
    457       eLog() << Verbose(2) << "Unable to parse file, incrementing all." << endl;
     457      DoeLog(2) && (eLog()<< Verbose(2) << "Unable to parse file, incrementing all." << endl);
    458458      while (Walker->next != end) {
    459459        Walker = Walker->next;
     
    644644        MolecularWalker->Leaf->FragmentBOSSANOVA(FragmentList[FragmentCounter], RootStack[FragmentCounter], MinimumRingSize);
    645645      } else {
    646         eLog() << Verbose(1) << "Subgraph " << MolecularWalker << " has no atoms!" << endl;
     646        DoeLog(1) && (eLog()<< Verbose(1) << "Subgraph " << MolecularWalker << " has no atoms!" << endl);
    647647      }
    648648      FragmentCounter++;  // next fragment list
     
    902902      }
    903903    } else {
    904       eLog() << Verbose(1) << "Son " << Runner->Name << " has father " << FatherOfRunner->Name << " but its entry in SonList is " << SonList[FatherOfRunner->nr] << "!" << endl;
     904      DoeLog(1) && (eLog()<< Verbose(1) << "Son " << Runner->Name << " has father " << FatherOfRunner->Name << " but its entry in SonList is " << SonList[FatherOfRunner->nr] << "!" << endl);
    905905    }
    906906    if ((LonelyFlag) && (Leaf->AtomCount > 1)) {
     
    11371137        Log() << Verbose(0) << endl;
    11381138        //if (!CheckForConnectedSubgraph(FragmentSearch->FragmentSet))
    1139           //eLog() << Verbose(1) << "The found fragment is not a connected subgraph!" << endl;
     1139          //DoeLog(1) && (eLog()<< Verbose(1) << "The found fragment is not a connected subgraph!" << endl);
    11401140        InsertFragmentIntoGraph(FragmentSearch);
    11411141      }
  • src/molecule_graph.cpp

    r7ee87f r58ed4a  
    931931    }
    932932    if (i == vertex->ListOfBonds.size()) {
    933       eLog() << Verbose(0) << "Error: All Component entries are already occupied!" << endl;
     933      DoeLog(0) && (eLog()<< Verbose(0) << "Error: All Component entries are already occupied!" << endl);
    934934      performCriticalExit();
    935935    }
    936936  } else {
    937     eLog() << Verbose(0) << "Error: Given vertex is NULL!" << endl;
     937    DoeLog(0) && (eLog()<< Verbose(0) << "Error: Given vertex is NULL!" << endl);
    938938    performCriticalExit();
    939939  }
  • src/moleculelist.cpp

    r7ee87f r58ed4a  
    314314  Tesselation *TesselStruct = NULL;
    315315  if ((srcmol == NULL) || (mol == NULL)) {
    316     eLog() << Verbose(1) << "Either fixed or variable molecule is given as NULL." << endl;
     316    DoeLog(1) && (eLog()<< Verbose(1) << "Either fixed or variable molecule is given as NULL." << endl);
    317317    return false;
    318318  }
     
    322322  FindNonConvexBorder(mol, TesselStruct, (const LinkedCell *&)LCList, 4., NULL);
    323323  if (TesselStruct == NULL) {
    324     eLog() << Verbose(1) << "Could not tesselate the fixed molecule." << endl;
     324    DoeLog(1) && (eLog()<< Verbose(1) << "Could not tesselate the fixed molecule." << endl);
    325325    return false;
    326326  }
     
    443443    input.open(line.c_str());
    444444    if (input == NULL) {
    445       eLog() << Verbose(0) << endl << "Unable to open " << line << ", is the directory correct?" << endl;
     445      DoeLog(0) && (eLog()<< Verbose(0) << endl << "Unable to open " << line << ", is the directory correct?" << endl);
    446446      performCriticalExit();
    447447      return false;
     
    652652      strcpy(PathBackup, path);
    653653    else {
    654       eLog() << Verbose(0) << "OutputConfigForListOfFragments: NULL default path obtained from config!" << endl;
     654      DoeLog(0) && (eLog()<< Verbose(0) << "OutputConfigForListOfFragments: NULL default path obtained from config!" << endl);
    655655      performCriticalExit();
    656656    }
     
    788788  if (!configuration->BG->ConstructBondGraph(mol)) {
    789789    delete (mol);
    790     eLog() << Verbose(1) << "There are no bonds." << endl;
     790    DoeLog(1) && (eLog()<< Verbose(1) << "There are no bonds." << endl);
    791791    return;
    792792  }
     
    799799  if ((Subgraphs == NULL) || (Subgraphs->next == NULL)) {
    800800    delete (mol);
    801     eLog() << Verbose(1) << "There are no atoms." << endl;
     801    DoeLog(1) && (eLog()<< Verbose(1) << "There are no atoms." << endl);
    802802    return;
    803803  }
     
    843843    Walker = mol->start->next;
    844844    if ((Walker->nr <0) || (Walker->nr >= mol->AtomCount)) {
    845       eLog() << Verbose(0) << "Index of atom " << *Walker << " is invalid!" << endl;
     845      DoeLog(0) && (eLog()<< Verbose(0) << "Index of atom " << *Walker << " is invalid!" << endl);
    846846      performCriticalExit();
    847847    }
     
    852852      molecules[FragmentCounter-1]->AddAtom(Walker);    // counting starts at 1
    853853    } else {
    854       eLog() << Verbose(0) << "Atom " << *Walker << " not associated to molecule!" << endl;
     854      DoeLog(0) && (eLog()<< Verbose(0) << "Atom " << *Walker << " not associated to molecule!" << endl);
    855855      performCriticalExit();
    856856    }
  • src/parser.cpp

    r7ee87f r58ed4a  
    160160  //Log() << Verbose(1) << "Opening " << name << " ... "  << input << endl;
    161161  if (input == NULL) {
    162     eLog() << Verbose(1) << endl << "Unable to open " << name << ", is the directory correct?" << endl;
     162    DoeLog(1) && (eLog()<< Verbose(1) << endl << "Unable to open " << name << ", is the directory correct?" << endl);
    163163    //performCriticalExit();
    164164    return false;
     
    183183  //Log() << Verbose(1) << "ColumnCounter[" << MatrixNr << "]: " << ColumnCounter[MatrixNr] << "." << endl;
    184184  if (ColumnCounter[MatrixNr] == 0) {
    185     eLog() << Verbose(0) << "ColumnCounter[" << MatrixNr << "]: " << ColumnCounter[MatrixNr] << " from file " << name << ", this is probably an error!" << endl;
     185    DoeLog(0) && (eLog()<< Verbose(0) << "ColumnCounter[" << MatrixNr << "]: " << ColumnCounter[MatrixNr] << " from file " << name << ", this is probably an error!" << endl);
    186186    performCriticalExit();
    187187  }
     
    199199  //Log() << Verbose(1) << "RowCounter[" << MatrixNr << "]: " << RowCounter[MatrixNr] << " from file " << name << "." << endl;
    200200  if (RowCounter[MatrixNr] == 0) {
    201     eLog() << Verbose(0) << "RowCounter[" << MatrixNr << "]: " << RowCounter[MatrixNr] << " from file " << name << ", this is probably an error!" << endl;
     201    DoeLog(0) && (eLog()<< Verbose(0) << "RowCounter[" << MatrixNr << "]: " << RowCounter[MatrixNr] << " from file " << name << ", this is probably an error!" << endl);
    202202    performCriticalExit();
    203203  }
     
    232232    }
    233233  } else {
    234     eLog() << Verbose(1) << "Matrix nr. " << MatrixNr << " has column and row count of (" << ColumnCounter[MatrixNr] << "," << RowCounter[MatrixNr] << "), could not allocate nor parse!" << endl;
     234    DoeLog(1) && (eLog()<< Verbose(1) << "Matrix nr. " << MatrixNr << " has column and row count of (" << ColumnCounter[MatrixNr] << "," << RowCounter[MatrixNr] << "), could not allocate nor parse!" << endl);
    235235  }
    236236  input.close();
     
    433433              //Log() << Verbose(0) << "Corresponding index in CurrentFragment is " << m << "." << endl;
    434434              if (m > RowCounter[ KeySets.OrderSet[Order][CurrentFragment] ]) {
    435                 eLog() << Verbose(0) << "In fragment No. " << KeySets.OrderSet[Order][CurrentFragment]   << " current force index " << m << " is greater than " << RowCounter[ KeySets.OrderSet[Order][CurrentFragment] ] << "!" << endl;
     435                DoeLog(0) && (eLog()<< Verbose(0) << "In fragment No. " << KeySets.OrderSet[Order][CurrentFragment]   << " current force index " << m << " is greater than " << RowCounter[ KeySets.OrderSet[Order][CurrentFragment] ] << "!" << endl);
    436436                performCriticalExit();
    437437                return false;
     
    477477    output.open(line.str().c_str(), ios::out);
    478478    if (output == NULL) {
    479       eLog() << Verbose(0) << "Unable to open output energy file " << line.str() << "!" << endl;
     479      DoeLog(0) && (eLog()<< Verbose(0) << "Unable to open output energy file " << line.str() << "!" << endl);
    480480      performCriticalExit();
    481481      return false;
     
    507507  output.open(line.str().c_str(), ios::out);
    508508  if (output == NULL) {
    509     eLog() << Verbose(0) << "Unable to open output matrix file " << line.str() << "!" << endl;
     509    DoeLog(0) && (eLog()<< Verbose(0) << "Unable to open output matrix file " << line.str() << "!" << endl);
    510510    performCriticalExit();
    511511    return false;
     
    664664      int j = Indices[ FragmentNr ][l];
    665665      if (j > RowCounter[MatrixCounter]) {
    666         eLog() << Verbose(0) << "Current force index " << j << " is greater than " << RowCounter[MatrixCounter] << "!" << endl;
     666        DoeLog(0) && (eLog()<< Verbose(0) << "Current force index " << j << " is greater than " << RowCounter[MatrixCounter] << "!" << endl);
    667667        performCriticalExit();
    668668        return false;
     
    802802      int j = Indices[ FragmentNr ][l];
    803803      if (j > RowCounter[MatrixCounter]) {
    804         eLog() << Verbose(0) << "Current hessian index " << j << " is greater than " << RowCounter[MatrixCounter] << ", where i=" << i << ", Order=" << Order << ", l=" << l << " and FragmentNr=" << FragmentNr << "!" << endl;
     804        DoeLog(0) && (eLog()<< Verbose(0) << "Current hessian index " << j << " is greater than " << RowCounter[MatrixCounter] << ", where i=" << i << ", Order=" << Order << ", l=" << l << " and FragmentNr=" << FragmentNr << "!" << endl);
    805805        performCriticalExit();
    806806        return false;
     
    810810          int k = Indices[ FragmentNr ][m];
    811811          if (k > ColumnCounter[MatrixCounter]) {
    812             eLog() << Verbose(0) << "Current hessian index " << k << " is greater than " << ColumnCounter[MatrixCounter] << ", where m=" << m << ", j=" << j << ", i=" << i << ", Order=" << Order << ", l=" << l << " and FragmentNr=" << FragmentNr << "!" << endl;
     812            DoeLog(0) && (eLog()<< Verbose(0) << "Current hessian index " << k << " is greater than " << ColumnCounter[MatrixCounter] << ", where m=" << m << ", j=" << j << ", i=" << i << ", Order=" << Order << ", l=" << l << " and FragmentNr=" << FragmentNr << "!" << endl);
    813813            performCriticalExit();
    814814            return false;
     
    863863              //Log() << Verbose(0) << "Corresponding row index for " << k << " in CurrentFragment is " << m << "." << endl;
    864864              if (m > RowCounter[ KeySets.OrderSet[Order][CurrentFragment] ]) {
    865                 eLog() << Verbose(0) << "In fragment No. " << KeySets.OrderSet[Order][CurrentFragment]   << " current row index " << m << " is greater than " << RowCounter[ KeySets.OrderSet[Order][CurrentFragment] ] << "!" << endl;
     865                DoeLog(0) && (eLog()<< Verbose(0) << "In fragment No. " << KeySets.OrderSet[Order][CurrentFragment]   << " current row index " << m << " is greater than " << RowCounter[ KeySets.OrderSet[Order][CurrentFragment] ] << "!" << endl);
    866866                performCriticalExit();
    867867                return false;
     
    881881                  //Log() << Verbose(0) << "Corresponding column index for " << l << " in CurrentFragment is " << n << "." << endl;
    882882                  if (n > ColumnCounter[ KeySets.OrderSet[Order][CurrentFragment] ]) {
    883                     eLog() << Verbose(0) << "In fragment No. " << KeySets.OrderSet[Order][CurrentFragment]   << " current column index " << n << " is greater than " << ColumnCounter[ KeySets.OrderSet[Order][CurrentFragment] ] << "!" << endl;
     883                    DoeLog(0) && (eLog()<< Verbose(0) << "In fragment No. " << KeySets.OrderSet[Order][CurrentFragment]   << " current column index " << n << " is greater than " << ColumnCounter[ KeySets.OrderSet[Order][CurrentFragment] ] << "!" << endl);
    884884                    performCriticalExit();
    885885                    return false;
  • src/periodentafel.cpp

    r7ee87f r58ed4a  
    314314
    315315  if (!otherstatus)
    316     eLog() << Verbose(2) << "Something went wrong while parsing the other databases!" << endl;
     316    DoeLog(2) && (eLog()<< Verbose(2) << "Something went wrong while parsing the other databases!" << endl);
    317317
    318318  return status;
  • src/stackclass.hpp

    r7ee87f r58ed4a  
    7272    return true;
    7373  } else {
    74     eLog() << Verbose(1) << "Stack is full, " << "Stack: CurrentLastEntry " << CurrentLastEntry<< "\tCurrentFirstEntry " << CurrentFirstEntry << "\tNextFreeField " << NextFreeField << "\tEntryCount " << EntryCount << "!" << endl;
     74    DoeLog(1) && (eLog()<< Verbose(1) << "Stack is full, " << "Stack: CurrentLastEntry " << CurrentLastEntry<< "\tCurrentFirstEntry " << CurrentFirstEntry << "\tNextFreeField " << NextFreeField << "\tEntryCount " << EntryCount << "!" << endl);
    7575    return false;
    7676  }
     
    8787    Walker = StackList[CurrentFirstEntry];
    8888    if (Walker == NULL)
    89       eLog() << Verbose(1) << "Stack's field is empty!" << endl;
     89      DoeLog(1) && (eLog()<< Verbose(1) << "Stack's field is empty!" << endl);
    9090    StackList[CurrentFirstEntry] = NULL;
    9191    if (CurrentFirstEntry != CurrentLastEntry) { // hasn't last item been popped as well?
     
    9696    }
    9797  } else
    98     eLog() << Verbose(1) << "Stack is empty!" << endl;
     98    DoeLog(1) && (eLog()<< Verbose(1) << "Stack is empty!" << endl);
    9999  return Walker;
    100100};
     
    111111    StackList[CurrentLastEntry] = NULL;
    112112    if (Walker == NULL)
    113       eLog() << Verbose(1) << "Stack's field is empty!" << endl;
     113      DoeLog(1) && (eLog()<< Verbose(1) << "Stack's field is empty!" << endl);
    114114    NextFreeField = CurrentLastEntry;
    115115    if (CurrentLastEntry != CurrentFirstEntry)  // has there been more than one item on stack
    116116      CurrentLastEntry = (CurrentLastEntry + (EntryCount-1)) % EntryCount; // step back from current free field to last (modulo does not work in -1, thus go EntryCount-1 instead)
    117117  } else {
    118     eLog() << Verbose(1) << "Stack is empty!" << endl;
     118    DoeLog(1) && (eLog()<< Verbose(1) << "Stack is empty!" << endl);
    119119  }
    120120  return Walker;
     
    151151    } while (i!=NextFreeField);
    152152  else
    153     eLog() << Verbose(1) << "Stack is already empty!" << endl;
     153    DoeLog(1) && (eLog()<< Verbose(1) << "Stack is already empty!" << endl);
    154154  if (found) {
    155155    NextFreeField = CurrentLastEntry;
  • src/tesselation.cpp

    r7ee87f r58ed4a  
    5555  //Log() << Verbose(0) << "Erasing point nr. " << Nr << "." << endl;
    5656  if (!lines.empty())
    57     eLog() << Verbose(2) << "Memory Leak! I " << *this << " am still connected to some lines." << endl;
     57    DoeLog(2) && (eLog()<< Verbose(2) << "Memory Leak! I " << *this << " am still connected to some lines." << endl);
    5858  node = NULL;
    5959};
     
    188188  }
    189189  if (!triangles.empty())
    190     eLog() << Verbose(2) << "Memory Leak! I " << *this << " am still connected to some triangles." << endl;
     190    DoeLog(2) && (eLog()<< Verbose(2) << "Memory Leak! I " << *this << " am still connected to some triangles." << endl);
    191191};
    192192
     
    226226  // get the two triangles
    227227  if (triangles.size() != 2) {
    228     eLog() << Verbose(0) << "Baseline " << *this << " is connected to less than two triangles, Tesselation incomplete!" << endl;
     228    DoeLog(0) && (eLog()<< Verbose(0) << "Baseline " << *this << " is connected to less than two triangles, Tesselation incomplete!" << endl);
    229229    return true;
    230230  }
     
    252252      BaseLineNormal.CopyVector(&runner->second->NormalVector);   // yes, copy second on top of first
    253253    else {
    254       eLog() << Verbose(0) << "Triangle " << *runner->second << " has zero normal vector!" << endl;
     254      DoeLog(0) && (eLog()<< Verbose(0) << "Triangle " << *runner->second << " has zero normal vector!" << endl);
    255255    }
    256256    node = runner->second->GetThirdEndpoint(this);
     
    263263      i++;
    264264    } else {
    265       eLog() << Verbose(1) << "I cannot find third node in triangle, something's wrong." << endl;
     265      DoeLog(1) && (eLog()<< Verbose(1) << "I cannot find third node in triangle, something's wrong." << endl);
    266266      return true;
    267267    }
     
    368368  }
    369369  if (Counter < 3) {
    370     eLog() << Verbose(0) << "We have a triangle with only two distinct endpoints!" << endl;
     370    DoeLog(0) && (eLog()<< Verbose(0) << "We have a triangle with only two distinct endpoints!" << endl);
    371371    performCriticalExit();
    372372  }
     
    430430
    431431  if (!Intersection->GetIntersectionWithPlane(&NormalVector, endpoints[0]->node->node, MolCenter, x)) {
    432     eLog() << Verbose(1) << "Alas! Intersection with plane failed - at least numerically - the intersection is not on the plane!" << endl;
     432    DoeLog(1) && (eLog()<< Verbose(1) << "Alas! Intersection with plane failed - at least numerically - the intersection is not on the plane!" << endl);
    433433    return false;
    434434  }
     
    726726      Runner[i]++;
    727727      if (Runner[i] == endpoints.end()) {
    728         eLog() << Verbose(0) << "There are less than three endpoints in the polygon!" << endl;
     728        DoeLog(0) && (eLog()<< Verbose(0) << "There are less than three endpoints in the polygon!" << endl);
    729729        performCriticalExit();
    730730      }
     
    10721072      runner->second = NULL;
    10731073    } else
    1074       eLog() << Verbose(1) << "The triangle " << runner->first << " has already been free'd." << endl;
     1074      DoeLog(1) && (eLog()<< Verbose(1) << "The triangle " << runner->first << " has already been free'd." << endl);
    10751075  }
    10761076  Log() << Verbose(0) << "This envelope was written to file " << TriangleFilesWritten << " times(s)." << endl;
     
    13251325  else
    13261326    {
    1327       eLog() << Verbose(0) << "No starting triangle found." << endl;
     1327      DoeLog(0) && (eLog()<< Verbose(0) << "No starting triangle found." << endl);
    13281328    }
    13291329}
     
    15241524          TrianglesOnBoundaryCount++;
    15251525        } else {
    1526           eLog() << Verbose(2) << "I could not determine a winner for this baseline " << *(baseline->second) << "." << endl;
     1526          DoeLog(2) && (eLog()<< Verbose(2) << "I could not determine a winner for this baseline " << *(baseline->second) << "." << endl);
    15271527        }
    15281528
     
    16171617            if (NewLines[j]->IsConnectedTo(BLS[0])) {
    16181618              if (n>2) {
    1619                 eLog() << Verbose(2) << BLS[0] << " connects to all of the new lines?!" << endl;
     1619                DoeLog(2) && (eLog()<< Verbose(2) << BLS[0] << " connects to all of the new lines?!" << endl);
    16201620                return false;
    16211621              } else
     
    16341634      }
    16351635    } else { // something is wrong with FindClosestTriangleToPoint!
    1636       eLog() << Verbose(1) << "The closest triangle did not produce an intersection!" << endl;
     1636      DoeLog(1) && (eLog()<< Verbose(1) << "The closest triangle did not produce an intersection!" << endl);
    16371637      return false;
    16381638    }
     
    17371737          OpenLines.erase(CandidateLine);
    17381738        } else {
    1739           eLog() << Verbose(1) << "Line exists and is attached to less than two triangles, but not in OpenLines!" << endl;
     1739          DoeLog(1) && (eLog()<< Verbose(1) << "Line exists and is attached to less than two triangles, but not in OpenLines!" << endl);
    17401740        }
    17411741
     
    18431843      triangle->lines[i] = NULL;  // free'd or not: disconnect
    18441844    } else
    1845       eLog() << Verbose(1) << "This line " << i << " has already been free'd." << endl;
     1845      DoeLog(1) && (eLog()<< Verbose(1) << "This line " << i << " has already been free'd." << endl);
    18461846  }
    18471847
     
    18971897      line->endpoints[i] = NULL;  // free'd or not: disconnect
    18981898    } else
    1899       eLog() << Verbose(1) << "Endpoint " << i << " has already been free'd." << endl;
     1899      DoeLog(1) && (eLog()<< Verbose(1) << "Endpoint " << i << " has already been free'd." << endl);
    19001900  }
    19011901  if (!line->triangles.empty())
    1902     eLog() << Verbose(2) << "Memory Leak! I " << *line << " am still connected to some triangles." << endl;
     1902    DoeLog(2) && (eLog()<< Verbose(2) << "Memory Leak! I " << *line << " am still connected to some triangles." << endl);
    19031903
    19041904  if (LinesOnBoundary.erase(line->Nr))
     
    20732073          }
    20742074        } else {
    2075           eLog() << Verbose(1) << "The current cell " << LC->n[0] << "," << LC->n[1] << "," << LC->n[2] << " is invalid!" << endl;
     2075          DoeLog(1) && (eLog()<< Verbose(1) << "The current cell " << LC->n[0] << "," << LC->n[1] << "," << LC->n[2] << " is invalid!" << endl);
    20762076        }
    20772077      }
     
    22172217//            if (fabs(OldSphereCenter.ScalarProduct(&SearchDirection)) > HULLEPSILON) {
    22182218//              // rotated the wrong way!
    2219 //              eLog() << Verbose(1) << "SearchDirection and RelativeOldSphereCenter are still not orthogonal!" << endl;
     2219//              DoeLog(1) && (eLog()<< Verbose(1) << "SearchDirection and RelativeOldSphereCenter are still not orthogonal!" << endl);
    22202220//            }
    22212221//
     
    22742274//          }
    22752275//        } else {
    2276 //          eLog() << Verbose(2) << "Baseline is connected to two triangles already?" << endl;
     2276//          DoeLog(2) && (eLog()<< Verbose(2) << "Baseline is connected to two triangles already?" << endl);
    22772277//        }
    22782278//      } else {
     
    22812281//    }
    22822282//  } else {
    2283 //    eLog() << Verbose(1) << "Could not find the TesselPoint " << *ThirdNode << "." << endl;
     2283//    DoeLog(1) && (eLog()<< Verbose(1) << "Could not find the TesselPoint " << *ThirdNode << "." << endl);
    22842284//  }
    22852285//
     
    23472347    if (fabs(RelativeSphereCenter.ScalarProduct(&SearchDirection)) > HULLEPSILON) {
    23482348      // rotated the wrong way!
    2349       eLog() << Verbose(1) << "SearchDirection and RelativeOldSphereCenter are still not orthogonal!" << endl;
     2349      DoeLog(1) && (eLog()<< Verbose(1) << "SearchDirection and RelativeOldSphereCenter are still not orthogonal!" << endl);
    23502350    }
    23512351
     
    23582358
    23592359  if (CandidateLine.pointlist.empty()) {
    2360     eLog() << Verbose(2) << "Could not find a suitable candidate." << endl;
     2360    DoeLog(2) && (eLog()<< Verbose(2) << "Could not find a suitable candidate." << endl);
    23612361    return false;
    23622362  }
     
    24002400//          CandidateLine.ShortestAngle = ShortestAngle;
    24012401//        } else {
    2402 ////          eLog() << Verbose(1) << "This triangle consisting of ";
     2402////          DoeLog(1) && (eLog()<< Verbose(1) << "This triangle consisting of ");
    24032403////          Log() << Verbose(0) << *(*it)->point << ", ";
    24042404////          Log() << Verbose(0) << *BaseRay->endpoints[0]->node << " and ";
     
    24212421//
    24222422//          } else {
    2423 ////            eLog() << Verbose(1) << "This triangle consisting of " << *(*it)->point << ", " << *BaseRay->endpoints[0]->node << " and " << *BaseRay->endpoints[1]->node << " " << "exists and is not added, as it does not seem helpful!" << endl;
     2423////            DoeLog(1) && (eLog()<< Verbose(1) << "This triangle consisting of " << *(*it)->point << ", " << *BaseRay->endpoints[0]->node << " and " << *BaseRay->endpoints[1]->node << " " << "exists and is not added, as it does not seem helpful!" << endl);
    24242424//            result = false;
    24252425//          }
     
    24372437//    BaseRay = BLS[0];
    24382438//    if ((BTS != NULL) && (BTS->NormalVector.NormSquared() < MYEPSILON)) {
    2439 //      eLog() << Verbose(1) << "Triangle " << *BTS << " has zero normal vector!" << endl;
     2439//      DoeLog(1) && (eLog()<< Verbose(1) << "Triangle " << *BTS << " has zero normal vector!" << endl);
    24402440//      exit(255);
    24412441//    }
     
    26352635    BaseLineNormal.Zero();
    26362636    if (Base->triangles.size() < 2) {
    2637       eLog() << Verbose(1) << "Less than two triangles are attached to this baseline!" << endl;
     2637      DoeLog(1) && (eLog()<< Verbose(1) << "Less than two triangles are attached to this baseline!" << endl);
    26382638      return 0.;
    26392639    }
     
    26742674  BaseLineNormal.Zero();
    26752675  if (Base->triangles.size() < 2) {
    2676     eLog() << Verbose(1) << "Less than two triangles are attached to this baseline!" << endl;
     2676    DoeLog(1) && (eLog()<< Verbose(1) << "Less than two triangles are attached to this baseline!" << endl);
    26772677    return NULL;
    26782678  }
     
    27102710  // check whether everything is in place to create new lines and triangles
    27112711  if (i<4) {
    2712     eLog() << Verbose(1) << "We have not gathered enough baselines!" << endl;
     2712    DoeLog(1) && (eLog()<< Verbose(1) << "We have not gathered enough baselines!" << endl);
    27132713    return NULL;
    27142714  }
    27152715  for (int j=0;j<4;j++)
    27162716    if (OldLines[j] == NULL) {
    2717       eLog() << Verbose(1) << "We have not gathered enough baselines!" << endl;
     2717      DoeLog(1) && (eLog()<< Verbose(1) << "We have not gathered enough baselines!" << endl);
    27182718      return NULL;
    27192719    }
    27202720  for (int j=0;j<2;j++)
    27212721    if (OldPoints[j] == NULL) {
    2722       eLog() << Verbose(1) << "We have not gathered enough endpoints!" << endl;
     2722      DoeLog(1) && (eLog()<< Verbose(1) << "We have not gathered enough endpoints!" << endl);
    27232723      return NULL;
    27242724    }
     
    27642764    Log() << Verbose(0) << "INFO: Created new triangle " << *BTS << "." << endl;
    27652765  } else {
    2766     eLog() << Verbose(0) << "The four old lines do not connect, something's utterly wrong here!" << endl;
     2766    DoeLog(0) && (eLog()<< Verbose(0) << "The four old lines do not connect, something's utterly wrong here!" << endl);
    27672767    return NULL;
    27682768  }
     
    27952795      N[i] = LC->n[i];
    27962796  } else {
    2797     eLog() << Verbose(1) << "Point " << *a << " is not found in cell " << LC->index << "." << endl;
     2797    DoeLog(1) && (eLog()<< Verbose(1) << "Point " << *a << " is not found in cell " << LC->index << "." << endl);
    27982798    return;
    27992799  }
     
    29352935    // test whether old center is on the band's plane
    29362936    if (fabs(RelativeOldSphereCenter.ScalarProduct(&CirclePlaneNormal)) > HULLEPSILON) {
    2937       eLog() << Verbose(1) << "Something's very wrong here: RelativeOldSphereCenter is not on the band's plane as desired by " << fabs(RelativeOldSphereCenter.ScalarProduct(&CirclePlaneNormal)) << "!" << endl;
     2937      DoeLog(1) && (eLog()<< Verbose(1) << "Something's very wrong here: RelativeOldSphereCenter is not on the band's plane as desired by " << fabs(RelativeOldSphereCenter.ScalarProduct(&CirclePlaneNormal)) << "!" << endl);
    29382938      RelativeOldSphereCenter.ProjectOntoPlane(&CirclePlaneNormal);
    29392939    }
     
    29452945      Log() << Verbose(1) << "INFO: SearchDirection is " << SearchDirection << "." << endl;
    29462946      if (fabs(RelativeOldSphereCenter.ScalarProduct(&SearchDirection)) > HULLEPSILON) {  // rotated the wrong way!
    2947         eLog() << Verbose(1) << "SearchDirection and RelativeOldSphereCenter are not orthogonal!" << endl;
     2947        DoeLog(1) && (eLog()<< Verbose(1) << "SearchDirection and RelativeOldSphereCenter are not orthogonal!" << endl);
    29482948      }
    29492949
     
    29542954        //Log() << Verbose(1) << "INFO: Center cell is " << N[0] << ", " << N[1] << ", " << N[2] << " with No. " << LC->index << "." << endl;
    29552955      } else {
    2956         eLog() << Verbose(1) << "Vector " << CircleCenter << " is outside of LinkedCell's bounding box." << endl;
     2956        DoeLog(1) && (eLog()<< Verbose(1) << "Vector " << CircleCenter << " is outside of LinkedCell's bounding box." << endl);
    29572957        return;
    29582958      }
     
    29932993                      otherradius = CandidateLine.BaseLine->endpoints[1]->node->node->DistanceSquared(&NewPlaneCenter);
    29942994                      if (fabs(radius - otherradius) > HULLEPSILON) {
    2995                         eLog() << Verbose(1) << "Distance to center of circumcircle is not the same from each corner of the triangle: " << fabs(radius-otherradius) << endl;
     2995                        DoeLog(1) && (eLog()<< Verbose(1) << "Distance to center of circumcircle is not the same from each corner of the triangle: " << fabs(radius-otherradius) << endl);
    29962996                      }
    29972997                      // construct both new centers
     
    30603060          }
    30613061    } else {
    3062       eLog() << Verbose(1) << "The projected center of the old sphere has radius " << radius << " instead of " << CircleRadius << "." << endl;
     3062      DoeLog(1) && (eLog()<< Verbose(1) << "The projected center of the old sphere has radius " << radius << " instead of " << CircleRadius << "." << endl);
    30633063    }
    30643064  } else {
     
    31193119
    31203120  if (LinesOnBoundary.empty()) {
    3121     eLog() << Verbose(1) << "There is no tesselation structure to compare the point with, please create one first." << endl;
     3121    DoeLog(1) && (eLog()<< Verbose(1) << "There is no tesselation structure to compare the point with, please create one first." << endl);
    31223122    return NULL;
    31233123  }
     
    31463146          }
    31473147        } else {
    3148           eLog() << Verbose(1) << "The current cell " << LC->n[0] << "," << LC->n[1] << "," << LC->n[2] << " is invalid!" << endl;
     3148          DoeLog(1) && (eLog()<< Verbose(1) << "The current cell " << LC->n[0] << "," << LC->n[1] << "," << LC->n[2] << " is invalid!" << endl);
    31493149        }
    31503150      }
     
    31523152  // check whether we found some points
    31533153  if (points->empty()) {
    3154     eLog() << Verbose(1) << "There is no nearest point: too far away from the surface." << endl;
     3154    DoeLog(1) && (eLog()<< Verbose(1) << "There is no nearest point: too far away from the surface." << endl);
    31553155    delete(points);
    31563156    return NULL;
     
    31713171  DistanceToPointMap * points = FindClosestBoundaryPointsToVector(x,LC);
    31723172  if (points == NULL) {
    3173     eLog() << Verbose(1) << "There is no nearest point: too far away from the surface." << endl;
     3173    DoeLog(1) && (eLog()<< Verbose(1) << "There is no nearest point: too far away from the surface." << endl);
    31743174    return NULL;
    31753175  }
     
    32373237        DistanceToPointMap * points = FindClosestBoundaryPointsToVector(x,LC);
    32383238  if (points == NULL) {
    3239     eLog() << Verbose(1) << "There is no nearest point: too far away from the surface." << endl;
     3239    DoeLog(1) && (eLog()<< Verbose(1) << "There is no nearest point: too far away from the surface." << endl);
    32403240    return NULL;
    32413241  }
     
    32863286        const double distance = BaseLineIntersection.NormSquared();
    32873287        if (Center.NormSquared() > BaseLine.NormSquared()) {
    3288           eLog() << Verbose(0) << "Algorithmic error: In second case we have intersection outside of baseline!" << endl;
     3288          DoeLog(0) && (eLog()<< Verbose(0) << "Algorithmic error: In second case we have intersection outside of baseline!" << endl);
    32893289        }
    32903290        if ((ClosestLines.empty()) || (distance < MinDistance)) {
     
    34853485    ReferencePoint = PointRunner->second;
    34863486  } else {
    3487     eLog() << Verbose(2) << "GetAllConnectedPoints() could not find the BoundaryPoint belonging to " << *Point << "." << endl;
     3487    DoeLog(2) && (eLog()<< Verbose(2) << "GetAllConnectedPoints() could not find the BoundaryPoint belonging to " << *Point << "." << endl);
    34883488    ReferencePoint = NULL;
    34893489  }
     
    35173517
    35183518  if (connectedPoints->empty()) { // if have not found any points
    3519     eLog() << Verbose(1) << "We have not found any connected points to " << *Point<< "." << endl;
     3519    DoeLog(1) && (eLog()<< Verbose(1) << "We have not found any connected points to " << *Point<< "." << endl);
    35203520    return NULL;
    35213521  }
     
    35503550
    35513551  if (SetOfNeighbours == NULL) {
    3552     eLog() << Verbose(2) << "Could not find any connected points!" << endl;
     3552    DoeLog(2) && (eLog()<< Verbose(2) << "Could not find any connected points!" << endl);
    35533553    delete(connectedCircle);
    35543554    return NULL;
     
    35613561      PlaneNormal.AddVector(&(*Runner)->NormalVector);
    35623562  } else {
    3563     eLog() << Verbose(0) << "Could not find any triangles for point " << *Point << "." << endl;
     3563    DoeLog(0) && (eLog()<< Verbose(0) << "Could not find any triangles for point " << *Point << "." << endl);
    35643564    performCriticalExit();
    35653565  }
     
    35803580    AngleZero.ProjectOntoPlane(&PlaneNormal);
    35813581    if (AngleZero.NormSquared() < MYEPSILON) {
    3582       eLog() << Verbose(0) << "CRITIAL: AngleZero is 0 even with alternative reference. The algorithm has to be changed here!" << endl;
     3582      DoeLog(0) && (eLog()<< Verbose(0) << "CRITIAL: AngleZero is 0 even with alternative reference. The algorithm has to be changed here!" << endl);
    35833583      performCriticalExit();
    35843584    }
     
    36313631
    36323632  if (SetOfNeighbours == NULL) {
    3633     eLog() << Verbose(2) << "Could not find any connected points!" << endl;
     3633    DoeLog(2) && (eLog()<< Verbose(2) << "Could not find any connected points!" << endl);
    36343634    delete(connectedCircle);
    36353635    return NULL;
     
    36853685    AngleZero.ProjectOntoPlane(&PlaneNormal);
    36863686    if (AngleZero.NormSquared() < MYEPSILON) {
    3687       eLog() << Verbose(0) << "CRITIAL: AngleZero is 0 even with alternative reference. The algorithm has to be changed here!" << endl;
     3687      DoeLog(0) && (eLog()<< Verbose(0) << "CRITIAL: AngleZero is 0 even with alternative reference. The algorithm has to be changed here!" << endl);
    36883688      performCriticalExit();
    36893689    }
     
    37083708    InserterTest = anglesOfPoints.insert(pair<double, TesselPoint*>(angle, (*listRunner)));
    37093709    if (!InserterTest.second) {
    3710       eLog() << Verbose(0) << "GetCircleOfSetOfPoints() got two atoms with same angle: " << *((InserterTest.first)->second) << " and " << (*listRunner) << endl;
     3710      DoeLog(0) && (eLog()<< Verbose(0) << "GetCircleOfSetOfPoints() got two atoms with same angle: " << *((InserterTest.first)->second) << " and " << (*listRunner) << endl);
    37113711      performCriticalExit();
    37123712    }
     
    37483748    ReferencePoint = PointRunner->second;
    37493749  } else {
    3750     eLog() << Verbose(1) << "GetPathOfConnectedPoints() could not find the BoundaryPoint belonging to " << *Point << "." << endl;
     3750    DoeLog(1) && (eLog()<< Verbose(1) << "GetPathOfConnectedPoints() could not find the BoundaryPoint belonging to " << *Point << "." << endl);
    37513751    return NULL;
    37523752  }
     
    37653765      LineRunner = TouchedLine.find(runner->second);
    37663766      if (LineRunner == TouchedLine.end()) {
    3767         eLog() << Verbose(1) << "I could not find " << *runner->second << " in the touched list." << endl;
     3767        DoeLog(1) && (eLog()<< Verbose(1) << "I could not find " << *runner->second << " in the touched list." << endl);
    37683768      } else if (!LineRunner->second) {
    37693769        LineRunner->second = true;
     
    37953795                }
    37963796              } else {
    3797                 eLog() << Verbose(1) << "I could not find " << *triangle << " in the touched list." << endl;
     3797                DoeLog(1) && (eLog()<< Verbose(1) << "I could not find " << *triangle << " in the touched list." << endl);
    37983798                triangle = NULL;
    37993799              }
     
    38123812          LineRunner = TouchedLine.find(CurrentLine);
    38133813          if (LineRunner == TouchedLine.end())
    3814             eLog() << Verbose(1) << "I could not find " << *CurrentLine << " in the touched list." << endl;
     3814            DoeLog(1) && (eLog()<< Verbose(1) << "I could not find " << *CurrentLine << " in the touched list." << endl);
    38153815          else
    38163816            LineRunner->second = true;
     
    38303830    }
    38313831  } else {
    3832     eLog() << Verbose(1) << "There are no lines attached to " << *ReferencePoint << "." << endl;
     3832    DoeLog(1) && (eLog()<< Verbose(1) << "There are no lines attached to " << *ReferencePoint << "." << endl);
    38333833  }
    38343834
     
    39103910
    39113911  if (Point == NULL) {
    3912     eLog() << Verbose(1) << "Point given is NULL." << endl;
     3912    DoeLog(1) && (eLog()<< Verbose(1) << "Point given is NULL." << endl);
    39133913  } else {
    39143914    // go through its lines and insert all triangles
     
    39423942
    39433943  if (point == NULL) {
    3944     eLog() << Verbose(1) << "Cannot remove the point " << point << ", it's NULL!" << endl;
     3944    DoeLog(1) && (eLog()<< Verbose(1) << "Cannot remove the point " << point << ", it's NULL!" << endl);
    39453945    return 0.;
    39463946  } else
     
    39523952  // get list of connected points
    39533953  if (point->lines.empty()) {
    3954     eLog() << Verbose(1) << "Cannot remove the point " << *point << ", it's connected to no lines!" << endl;
     3954    DoeLog(1) && (eLog()<< Verbose(1) << "Cannot remove the point " << *point << ", it's connected to no lines!" << endl);
    39553955    return 0.;
    39563956  }
     
    40334033        MiddleNode = EndNode;
    40344034        if (MiddleNode == connectedPath->end()) {
    4035           eLog() << Verbose(0) << "CRITICAL: Could not find a smallest angle!" << endl;
     4035          DoeLog(0) && (eLog()<< Verbose(0) << "CRITICAL: Could not find a smallest angle!" << endl);
    40364036          performCriticalExit();
    40374037        }
     
    40524052        triangle = GetPresentTriangle(TriangleCandidates);
    40534053        if (triangle != NULL) {
    4054           eLog() << Verbose(0) << "New triangle already present, skipping!" << endl;
     4054          DoeLog(0) && (eLog()<< Verbose(0) << "New triangle already present, skipping!" << endl);
    40554055          StartNode++;
    40564056          MiddleNode++;
     
    40904090          break;
    40914091        } else if (connectedPath->size() < 2) { // something's gone wrong!
    4092           eLog() << Verbose(0) << "CRITICAL: There are only two endpoints left!" << endl;
     4092          DoeLog(0) && (eLog()<< Verbose(0) << "CRITICAL: There are only two endpoints left!" << endl);
    40934093          performCriticalExit();
    40944094        } else {
     
    42434243    }
    42444244    default:
    4245       eLog() << Verbose(0) << "Number of wildcards is greater than 3, cannot happen!" << endl;
     4245      DoeLog(0) && (eLog()<< Verbose(0) << "Number of wildcards is greater than 3, cannot happen!" << endl);
    42464246      performCriticalExit();
    42474247      break;
     
    42964296  // sanity check
    42974297  if (LinesOnBoundary.empty()) {
    4298     eLog() << Verbose(2) << "FindAllDegeneratedTriangles() was called without any tesselation structure.";
     4298    DoeLog(2) && (eLog()<< Verbose(2) << "FindAllDegeneratedTriangles() was called without any tesselation structure.");
    42994299    return DegeneratedLines;
    43004300  }
     
    43204320      Log() << Verbose(0) << *Line1->second << " => " << *Line2->second << endl;
    43214321    else
    4322       eLog() << Verbose(1) << "Either " << (*it).first << " or " << (*it).second << " are not in LinesOnBoundary!" << endl;
     4322      DoeLog(1) && (eLog()<< Verbose(1) << "Either " << (*it).first << " or " << (*it).second << " are not in LinesOnBoundary!" << endl);
    43234323  }
    43244324
     
    44804480    NearestBoundaryPoint = PointRunner->second;
    44814481  } else {
    4482     eLog() << Verbose(1) << "I cannot find the boundary point." << endl;
     4482    DoeLog(1) && (eLog()<< Verbose(1) << "I cannot find the boundary point." << endl);
    44834483    return;
    44844484  }
     
    45484548    if ((BTS->lines[i]->ContainsBoundaryPoint(BestLine->endpoints[0])) && (BTS->lines[i]->ContainsBoundaryPoint(BestLine->endpoints[1]))) {
    45494549      if (BestLine == BTS->lines[i]){
    4550         eLog() << Verbose(0) << "BestLine is same as found line, something's wrong here!" << endl;
     4550        DoeLog(0) && (eLog()<< Verbose(0) << "BestLine is same as found line, something's wrong here!" << endl);
    45514551        performCriticalExit();
    45524552      }
     
    47404740    // connections to either polygon ...
    47414741    if (T->size() % 2 != 0) {
    4742       eLog() << Verbose(0) << " degenerated polygon contains an odd number of triangles, probably contains bridging non-degenerated ones, too!" << endl;
     4742      DoeLog(0) && (eLog()<< Verbose(0) << " degenerated polygon contains an odd number of triangles, probably contains bridging non-degenerated ones, too!" << endl);
    47434743      performCriticalExit();
    47444744    }
     
    47754775      AddTesselationLine(TPS[1], TPS[2], 2);
    47764776      if (TriangleNrs.empty())
    4777         eLog() << Verbose(0) << "No more free triangle numbers!" << endl;
     4777        DoeLog(0) && (eLog()<< Verbose(0) << "No more free triangle numbers!" << endl);
    47784778      BTS = new BoundaryTriangleSet(BLS, TriangleNrs.top()); // copy triangle ...
    47794779      AddTesselationTriangle(); // ... and add
     
    47844784    }
    47854785    if (!TriangleNrs.empty()) {
    4786       eLog() << Verbose(0) << "There have been less triangles created than removed!" << endl;
     4786      DoeLog(0) && (eLog()<< Verbose(0) << "There have been less triangles created than removed!" << endl);
    47874787    }
    47884788    delete(T);  // remove the triangleset
  • src/tesselationhelpers.cpp

    r7ee87f r58ed4a  
    8181
    8282  if (fabs(m11) < MYEPSILON)
    83     eLog() << Verbose(1) << "three points are colinear." << endl;
     83    DoeLog(1) && (eLog()<< Verbose(1) << "three points are colinear." << endl);
    8484
    8585  center->x[0] =  0.5 * m12/ m11;
     
    8888
    8989  if (fabs(a.Distance(center) - RADIUS) > MYEPSILON)
    90     eLog() << Verbose(1) << "The given center is further way by " << fabs(a.Distance(center) - RADIUS) << " from a than RADIUS." << endl;
     90    DoeLog(1) && (eLog()<< Verbose(1) << "The given center is further way by " << fabs(a.Distance(center) - RADIUS) << " from a than RADIUS." << endl);
    9191
    9292  gsl_matrix_free(A);
     
    192192  //Log() << Verbose(1) << "INFO: alpha = " << alpha/M_PI*180. << ", beta = " << beta/M_PI*180. << ", gamma = " << gamma/M_PI*180. << "." << endl;
    193193  if (fabs(M_PI - alpha - beta - gamma) > HULLEPSILON) {
    194     eLog() << Verbose(1) << "GetCenterofCircumcircle: Sum of angles " << (alpha+beta+gamma)/M_PI*180. << " > 180 degrees by " << fabs(M_PI - alpha - beta - gamma)/M_PI*180. << "!" << endl;
     194    DoeLog(1) && (eLog()<< Verbose(1) << "GetCenterofCircumcircle: Sum of angles " << (alpha+beta+gamma)/M_PI*180. << " > 180 degrees by " << fabs(M_PI - alpha - beta - gamma)/M_PI*180. << "!" << endl);
    195195  }
    196196
     
    236236  // test whether new center is on the parameter circle's plane
    237237  if (fabs(helper.ScalarProduct(&CirclePlaneNormal)) > HULLEPSILON) {
    238     eLog() << Verbose(1) << "Something's very wrong here: NewSphereCenter is not on the band's plane as desired by " <<fabs(helper.ScalarProduct(&CirclePlaneNormal))  << "!" << endl;
     238    DoeLog(1) && (eLog()<< Verbose(1) << "Something's very wrong here: NewSphereCenter is not on the band's plane as desired by " <<fabs(helper.ScalarProduct(&CirclePlaneNormal))  << "!" << endl);
    239239    helper.ProjectOntoPlane(&CirclePlaneNormal);
    240240  }
     
    242242  // test whether the new center vector has length of CircleRadius
    243243  if (fabs(radius - CircleRadius) > HULLEPSILON)
    244     eLog() << Verbose(1) << "The projected center of the new sphere has radius " << radius << " instead of " << CircleRadius << "." << endl;
     244    DoeLog(1) && (eLog()<< Verbose(1) << "The projected center of the new sphere has radius " << radius << " instead of " << CircleRadius << "." << endl);
    245245  alpha = helper.Angle(&RelativeOldSphereCenter);
    246246  // make the angle unique by checking the halfplanes/search direction
     
    512512//  Vector BaseLineVector, OrthogonalVector, helper;
    513513//  if (candidate1->BaseLine != candidate2->BaseLine) {  // sanity check
    514 //    eLog() << Verbose(1) << "sortCandidates was called for two different baselines: " << candidate1->BaseLine << " and " << candidate2->BaseLine << "." << endl;
     514//    DoeLog(1) && (eLog()<< Verbose(1) << "sortCandidates was called for two different baselines: " << candidate1->BaseLine << " and " << candidate2->BaseLine << "." << endl);
    515515//    //return false;
    516516//    exit(1);
     
    764764    }
    765765  } else {
    766     eLog() << Verbose(1) << "Given vrmlfile is " << vrmlfile << "." << endl;
     766    DoeLog(1) && (eLog()<< Verbose(1) << "Given vrmlfile is " << vrmlfile << "." << endl);
    767767  }
    768768  delete(center);
     
    839839    *rasterfile << "9\n#  terminating special property\n";
    840840  } else {
    841     eLog() << Verbose(1) << "Given rasterfile is " << rasterfile << "." << endl;
     841    DoeLog(1) && (eLog()<< Verbose(1) << "Given rasterfile is " << rasterfile << "." << endl);
    842842  }
    843843  IncludeSphereinRaster3D(rasterfile, Tess, cloud);
     
    951951  // check number of endpoints in *P
    952952  if (P->endpoints.size() != 4) {
    953     eLog() << Verbose(1) << "CountTrianglePairContainingPolygon works only on polygons with 4 nodes!" << endl;
     953    DoeLog(1) && (eLog()<< Verbose(1) << "CountTrianglePairContainingPolygon works only on polygons with 4 nodes!" << endl);
    954954    return 0;
    955955  }
     
    957957  // check number of triangles in *T
    958958  if (T->size() < 2) {
    959     eLog() << Verbose(1) << "Not enough triangles to have pairs!" << endl;
     959    DoeLog(1) && (eLog()<< Verbose(1) << "Not enough triangles to have pairs!" << endl);
    960960    return 0;
    961961  }
  • src/triangleintersectionlist.cpp

    r7ee87f r58ed4a  
    119119  DistanceToPointMap * points = Tess->FindClosestBoundaryPointsToVector(Point,Vicinity);
    120120  if (points == NULL) {
    121     eLog() << Verbose(1) << "There is no nearest point: too far away from the surface." << endl;
     121    DoeLog(1) && (eLog()<< Verbose(1) << "There is no nearest point: too far away from the surface." << endl);
    122122    return;
    123123  }
  • src/unittests/logunittest.cpp

    r7ee87f r58ed4a  
    4343
    4444  Log() << Verbose(0) << "Output a log message." << endl;
    45   eLog() << Verbose(0) << "Output an error message." << endl;
     45  DoeLog(0) && (eLog()<< Verbose(0) << "Output an error message." << endl);
    4646  setVerbosity(3);
    4747  Log() << Verbose(4) << "This should not be printed." << endl;
    48   eLog() << Verbose(4) << "This should not be printed." << endl;
     48  DoeLog(4) && (eLog()<< Verbose(4) << "This should not be printed." << endl);
    4949};
    5050
  • src/vector.cpp

    r7ee87f r58ed4a  
    281281    return true;
    282282  } else {
    283     eLog() << Verbose(2) << "Intersection point " << *this << " is not on plane." << endl;
     283    DoeLog(2) && (eLog()<< Verbose(2) << "Intersection point " << *this << " is not on plane." << endl);
    284284    return false;
    285285  }
     
    816816      x[i] = C.x[i];
    817817  } else {
    818     eLog() << Verbose(1) << "inverse of matrix does not exists: det A = " << detA << "." << endl;
     818    DoeLog(1) && (eLog()<< Verbose(1) << "inverse of matrix does not exists: det A = " << detA << "." << endl);
    819819  }
    820820};
     
    868868  x2.SubtractVector(y2);
    869869  if ((fabs(x1.Norm()) < MYEPSILON) || (fabs(x2.Norm()) < MYEPSILON) || (fabs(x1.Angle(&x2)) < MYEPSILON)) {
    870     eLog() << Verbose(2) << "Given vectors are linear dependent." << endl;
     870    DoeLog(2) && (eLog()<< Verbose(2) << "Given vectors are linear dependent." << endl);
    871871    return false;
    872872  }
     
    902902  Zero();
    903903  if ((fabs(x1.Norm()) < MYEPSILON) || (fabs(x2.Norm()) < MYEPSILON) || (fabs(x1.Angle(&x2)) < MYEPSILON)) {
    904     eLog() << Verbose(2) << "Given vectors are linear dependent." << endl;
     904    DoeLog(2) && (eLog()<< Verbose(2) << "Given vectors are linear dependent." << endl);
    905905    return false;
    906906  }
Note: See TracChangeset for help on using the changeset viewer.