Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/builder.cpp

    rb34306 ra67d19  
    5252#include <cstring>
    5353
     54#include "analysis_bonds.hpp"
    5455#include "analysis_correlation.hpp"
    5556#include "atom.hpp"
     
    8586  bool valid;
    8687
    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: ";
     88  cout << Verbose(0) << "===========ADD ATOM============================" << endl;
     89  cout << Verbose(0) << " a - state absolute coordinates of atom" << endl;
     90  cout << Verbose(0) << " b - state relative coordinates of atom wrt to reference point" << endl;
     91  cout << Verbose(0) << " c - state relative coordinates of atom wrt to already placed atom" << endl;
     92  cout << Verbose(0) << " d - state two atoms, two angles and a distance" << endl;
     93  cout << Verbose(0) << " e - least square distance position to a set of atoms" << endl;
     94  cout << Verbose(0) << "all else - go back" << endl;
     95  cout << Verbose(0) << "===============================================" << endl;
     96  cout << Verbose(0) << "Note: Specifiy angles in degrees not multiples of Pi!" << endl;
     97  cout << Verbose(0) << "INPUT: ";
    9798  cin >> choice;
    9899
    99100  switch (choice) {
    100101    default:
    101       eLog() << Verbose(2) << "Not a valid choice." << endl;
     102      DoeLog(2) && (eLog()<< Verbose(2) << "Not a valid choice." << endl);
    102103      break;
    103104      case 'a': // absolute coordinates of atom
    104         Log() << Verbose(0) << "Enter absolute coordinates." << endl;
     105        cout << Verbose(0) << "Enter absolute coordinates." << endl;
    105106        first = new atom;
    106107        first->x.AskPosition(World::get()->cell_size, false);
     
    113114        valid = true;
    114115        do {
    115           if (!valid) eLog() << Verbose(2) << "Resulting position out of cell." << endl;
    116           Log() << Verbose(0) << "Enter reference coordinates." << endl;
     116          if (!valid) DoeLog(2) && (eLog()<< Verbose(2) << "Resulting position out of cell." << endl);
     117          cout << Verbose(0) << "Enter reference coordinates." << endl;
    117118          x.AskPosition(World::get()->cell_size, true);
    118           Log() << Verbose(0) << "Enter relative coordinates." << endl;
     119          cout << Verbose(0) << "Enter relative coordinates." << endl;
    119120          first->x.AskPosition(World::get()->cell_size, false);
    120121          first->x.AddVector((const Vector *)&x);
    121           Log() << Verbose(0) << "\n";
     122          cout << Verbose(0) << "\n";
    122123        } while (!(valid = mol->CheckBounds((const Vector *)&first->x)));
    123124        first->type = periode->AskElement();  // give type
     
    129130        valid = true;
    130131        do {
    131           if (!valid) eLog() << Verbose(2) << "Resulting position out of cell." << endl;
     132          if (!valid) DoeLog(2) && (eLog()<< Verbose(2) << "Resulting position out of cell." << endl);
    132133          second = mol->AskAtom("Enter atom number: ");
    133           Log() << Verbose(0) << "Enter relative coordinates." << endl;
     134          DoLog(0) && (Log() << Verbose(0) << "Enter relative coordinates." << endl);
    134135          first->x.AskPosition(World::get()->cell_size, false);
    135136          for (int i=NDIM;i--;) {
     
    146147        do {
    147148          if (!valid) {
    148             eLog() << Verbose(2) << "Resulting coordinates out of cell - " << first->x << endl;
     149            DoeLog(2) && (eLog()<< Verbose(2) << "Resulting coordinates out of cell - " << first->x << endl);
    149150          }
    150           Log() << Verbose(0) << "First, we need two atoms, the first atom is the central, while the second is the outer one." << endl;
     151          cout << Verbose(0) << "First, we need two atoms, the first atom is the central, while the second is the outer one." << endl;
    151152          second = mol->AskAtom("Enter central atom: ");
    152153          third = mol->AskAtom("Enter second atom (specifying the axis for first angle): ");
     
    159160          c *= M_PI/180.;
    160161          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;
     162          cout << Verbose(0) << "radius: " << a << "\t phi: " << b*180./M_PI << "\t theta: " << c*180./M_PI << endl;
    162163/*
    163164          second->Output(1,1,(ofstream *)&cout);
     
    171172
    172173          if (!z.SolveSystem(&x,&y,&n, b, c, a)) {
    173             Log() << Verbose(0) << "Failure solving self-dependent linear system!" << endl;
     174         coutg() << Verbose(0) << "Failure solving self-dependent linear system!" << endl;
    174175            continue;
    175176          }
    176           Log() << Verbose(0) << "resulting relative coordinates: ";
     177          DoLog(0) && (Log() << Verbose(0) << "resulting relative coordinates: ");
    177178          z.Output();
    178           Log() << Verbose(0) << endl;
     179          DoLog(0) && (Log() << Verbose(0) << endl);
    179180          */
    180181          // calc axis vector
     
    184185          Log() << Verbose(0) << "x: ",
    185186          x.Output();
    186           Log() << Verbose(0) << endl;
     187          DoLog(0) && (Log() << Verbose(0) << endl);
    187188          z.MakeNormalVector(&second->x,&third->x,&fourth->x);
    188189          Log() << Verbose(0) << "z: ",
    189190          z.Output();
    190           Log() << Verbose(0) << endl;
     191          DoLog(0) && (Log() << Verbose(0) << endl);
    191192          y.MakeNormalVector(&x,&z);
    192193          Log() << Verbose(0) << "y: ",
    193194          y.Output();
    194           Log() << Verbose(0) << endl;
     195          DoLog(0) && (Log() << Verbose(0) << endl);
    195196
    196197          // rotate vector around first angle
     
    199200          Log() << Verbose(0) << "Rotated vector: ",
    200201          first->x.Output();
    201           Log() << Verbose(0) << endl;
     202          DoLog(0) && (Log() << Verbose(0) << endl);
    202203          // remove the projection onto the rotation plane of the second angle
    203204          n.CopyVector(&y);
     
    205206          Log() << Verbose(0) << "N1: ",
    206207          n.Output();
    207           Log() << Verbose(0) << endl;
     208          DoLog(0) && (Log() << Verbose(0) << endl);
    208209          first->x.SubtractVector(&n);
    209210          Log() << Verbose(0) << "Subtracted vector: ",
    210211          first->x.Output();
    211           Log() << Verbose(0) << endl;
     212          DoLog(0) && (Log() << Verbose(0) << endl);
    212213          n.CopyVector(&z);
    213214          n.Scale(first->x.ScalarProduct(&z));
    214215          Log() << Verbose(0) << "N2: ",
    215216          n.Output();
    216           Log() << Verbose(0) << endl;
     217          DoLog(0) && (Log() << Verbose(0) << endl);
    217218          first->x.SubtractVector(&n);
    218219          Log() << Verbose(0) << "2nd subtracted vector: ",
    219220          first->x.Output();
    220           Log() << Verbose(0) << endl;
     221          DoLog(0) && (Log() << Verbose(0) << endl);
    221222
    222223          // rotate another vector around second angle
     
    225226          Log() << Verbose(0) << "2nd Rotated vector: ",
    226227          n.Output();
    227           Log() << Verbose(0) << endl;
     228          DoLog(0) && (Log() << Verbose(0) << endl);
    228229
    229230          // add the two linear independent vectors
     
    233234          first->x.AddVector(&second->x);
    234235
    235           Log() << Verbose(0) << "resulting coordinates: ";
     236          DoLog(0) && (Log() << Verbose(0) << "resulting coordinates: ");
    236237          first->x.Output();
    237           Log() << Verbose(0) << endl;
     238          DoLog(0) && (Log() << Verbose(0) << endl);
    238239        } while (!(valid = mol->CheckBounds((const Vector *)&first->x)));
    239240        first->type = periode->AskElement();  // give type
     
    248249          atoms[i] = NULL;
    249250        int i=0, j=0;
    250         Log() << Verbose(0) << "Now we need at least three molecules.\n";
     251        cout << Verbose(0) << "Now we need at least three molecules.\n";
    251252        do {
    252           Log() << Verbose(0) << "Enter " << i+1 << "th atom: ";
     253          cout << Verbose(0) << "Enter " << i+1 << "th atom: ";
    253254          cin >> j;
    254255          if (j != -1) {
     
    265266        } else {
    266267          delete first;
    267           Log() << Verbose(0) << "Please enter at least two vectors!\n";
     268          cout << Verbose(0) << "Please enter at least two vectors!\n";
    268269        }
    269270        break;
     
    279280  char choice;  // menu choice char
    280281
    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: ";
     282  cout << Verbose(0) << "===========CENTER ATOMS=========================" << endl;
     283  cout << Verbose(0) << " a - on origin" << endl;
     284  cout << Verbose(0) << " b - on center of gravity" << endl;
     285  cout << Verbose(0) << " c - within box with additional boundary" << endl;
     286  cout << Verbose(0) << " d - within given simulation box" << endl;
     287  cout << Verbose(0) << "all else - go back" << endl;
     288  cout << Verbose(0) << "===============================================" << endl;
     289  cout << Verbose(0) << "INPUT: ";
    289290  cin >> choice;
    290291
    291292  switch (choice) {
    292293    default:
    293       Log() << Verbose(0) << "Not a valid choice." << endl;
     294      cout << Verbose(0) << "Not a valid choice." << endl;
    294295      break;
    295296    case 'a':
    296       Log() << Verbose(0) << "Centering atoms in config file on origin." << endl;
     297      cout << Verbose(0) << "Centering atoms in config file on origin." << endl;
    297298      mol->CenterOrigin();
    298299      break;
    299300    case 'b':
    300       Log() << Verbose(0) << "Centering atoms in config file on center of gravity." << endl;
     301      cout << Verbose(0) << "Centering atoms in config file on center of gravity." << endl;
    301302      mol->CenterPeriodic();
    302303      break;
    303304    case 'c':
    304       Log() << Verbose(0) << "Centering atoms in config file within given additional boundary." << endl;
     305      cout << Verbose(0) << "Centering atoms in config file within given additional boundary." << endl;
    305306      for (int i=0;i<NDIM;i++) {
    306         Log() << Verbose(0) << "Enter axis " << i << " boundary: ";
     307        cout << Verbose(0) << "Enter axis " << i << " boundary: ";
    307308        cin >> y.x[i];
    308309      }
     
    315316      break;
    316317    case 'd':
    317       Log() << Verbose(1) << "Centering atoms in config file within given simulation box." << endl;
     318      cout << Verbose(1) << "Centering atoms in config file within given simulation box." << endl;
    318319      for (int i=0;i<NDIM;i++) {
    319         Log() << Verbose(0) << "Enter axis " << i << " boundary: ";
     320        cout << Verbose(0) << "Enter axis " << i << " boundary: ";
    320321        cin >> x.x[i];
    321322      }
     
    338339  char choice;  // menu choice char
    339340
    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: ";
     341  cout << Verbose(0) << "===========ALIGN ATOMS=========================" << endl;
     342  cout << Verbose(0) << " a - state three atoms defining align plane" << endl;
     343  cout << Verbose(0) << " b - state alignment vector" << endl;
     344  cout << Verbose(0) << " c - state two atoms in alignment direction" << endl;
     345  cout << Verbose(0) << " d - align automatically by least square fit" << endl;
     346  cout << Verbose(0) << "all else - go back" << endl;
     347  cout << Verbose(0) << "===============================================" << endl;
     348  cout << Verbose(0) << "INPUT: ";
    348349  cin >> choice;
    349350
     
    358359      break;
    359360    case 'b': // normal vector of mirror plane
    360       Log() << Verbose(0) << "Enter normal vector of mirror plane." << endl;
     361      cout << Verbose(0) << "Enter normal vector of mirror plane." << endl;
    361362      n.AskPosition(World::get()->cell_size,0);
    362363      n.Normalize();
     
    378379        fscanf(stdin, "%3s", shorthand);
    379380      } while ((param.type = periode->FindElement(shorthand)) == NULL);
    380       Log() << Verbose(0) << "Element is " << param.type->name << endl;
     381      cout << Verbose(0) << "Element is " << param.type->name << endl;
    381382      mol->GetAlignvector(&param);
    382383      for (int i=NDIM;i--;) {
     
    385386      }
    386387      gsl_vector_free(param.x);
    387       Log() << Verbose(0) << "Offset vector: ";
     388      cout << Verbose(0) << "Offset vector: ";
    388389      x.Output();
    389       Log() << Verbose(0) << endl;
     390      DoLog(0) && (Log() << Verbose(0) << endl);
    390391      n.Normalize();
    391392      break;
    392393  };
    393   Log() << Verbose(0) << "Alignment vector: ";
     394  DoLog(0) && (Log() << Verbose(0) << "Alignment vector: ");
    394395  n.Output();
    395   Log() << Verbose(0) << endl;
     396  DoLog(0) && (Log() << Verbose(0) << endl);
    396397  mol->Align(&n);
    397398};
     
    406407  char choice;  // menu choice char
    407408
    408   Log() << Verbose(0) << "===========MIRROR ATOMS=========================" << endl;
    409   Log() << Verbose(0) << " a - state three atoms defining mirror plane" << endl;
    410   Log() << Verbose(0) << " b - state normal vector of mirror plane" << endl;
    411   Log() << Verbose(0) << " c - state two atoms in normal direction" << endl;
    412   Log() << Verbose(0) << "all else - go back" << endl;
    413   Log() << Verbose(0) << "===============================================" << endl;
    414   Log() << Verbose(0) << "INPUT: ";
     409  DoLog(0) && (Log() << Verbose(0) << "===========MIRROR ATOMS=========================" << endl);
     410  DoLog(0) && (Log() << Verbose(0) << " a - state three atoms defining mirror plane" << endl);
     411  DoLog(0) && (Log() << Verbose(0) << " b - state normal vector of mirror plane" << endl);
     412  DoLog(0) && (Log() << Verbose(0) << " c - state two atoms in normal direction" << endl);
     413  DoLog(0) && (Log() << Verbose(0) << "all else - go back" << endl);
     414  DoLog(0) && (Log() << Verbose(0) << "===============================================" << endl);
     415  DoLog(0) && (Log() << Verbose(0) << "INPUT: ");
    415416  cin >> choice;
    416417
     
    425426      break;
    426427    case 'b': // normal vector of mirror plane
    427       Log() << Verbose(0) << "Enter normal vector of mirror plane." << endl;
     428      DoLog(0) && (Log() << Verbose(0) << "Enter normal vector of mirror plane." << endl);
    428429      n.AskPosition(World::get()->cell_size,0);
    429430      n.Normalize();
     
    438439      break;
    439440  };
    440   Log() << Verbose(0) << "Normal vector: ";
     441  DoLog(0) && (Log() << Verbose(0) << "Normal vector: ");
    441442  n.Output();
    442   Log() << Verbose(0) << endl;
     443  DoLog(0) && (Log() << Verbose(0) << endl);
    443444  mol->Mirror((const Vector *)&n);
    444445};
     
    454455  char choice;  // menu choice char
    455456
    456   Log() << Verbose(0) << "===========REMOVE ATOMS=========================" << endl;
    457   Log() << Verbose(0) << " a - state atom for removal by number" << endl;
    458   Log() << Verbose(0) << " b - keep only in radius around atom" << endl;
    459   Log() << Verbose(0) << " c - remove this with one axis greater value" << endl;
    460   Log() << Verbose(0) << "all else - go back" << endl;
    461   Log() << Verbose(0) << "===============================================" << endl;
    462   Log() << Verbose(0) << "INPUT: ";
     457  DoLog(0) && (Log() << Verbose(0) << "===========REMOVE ATOMS=========================" << endl);
     458  DoLog(0) && (Log() << Verbose(0) << " a - state atom for removal by number" << endl);
     459  DoLog(0) && (Log() << Verbose(0) << " b - keep only in radius around atom" << endl);
     460  DoLog(0) && (Log() << Verbose(0) << " c - remove this with one axis greater value" << endl);
     461  DoLog(0) && (Log() << Verbose(0) << "all else - go back" << endl);
     462  DoLog(0) && (Log() << Verbose(0) << "===============================================" << endl);
     463  DoLog(0) && (Log() << Verbose(0) << "INPUT: ");
    463464  cin >> choice;
    464465
     
    467468    case 'a':
    468469      if (mol->RemoveAtom(mol->AskAtom("Enter number of atom within molecule: ")))
    469         Log() << Verbose(1) << "Atom removed." << endl;
     470        DoLog(1) && (Log() << Verbose(1) << "Atom removed." << endl);
    470471      else
    471         Log() << Verbose(1) << "Atom not found." << endl;
     472        DoLog(1) && (Log() << Verbose(1) << "Atom not found." << endl);
    472473      break;
    473474    case 'b':
    474475      second = mol->AskAtom("Enter number of atom as reference point: ");
    475       Log() << Verbose(0) << "Enter radius: ";
     476      DoLog(0) && (Log() << Verbose(0) << "Enter radius: ");
    476477      cin >> tmp1;
    477478      first = mol->start;
     
    485486      break;
    486487    case 'c':
    487       Log() << Verbose(0) << "Which axis is it: ";
     488      DoLog(0) && (Log() << Verbose(0) << "Which axis is it: ");
    488489      cin >> axis;
    489       Log() << Verbose(0) << "Lower boundary: ";
     490      DoLog(0) && (Log() << Verbose(0) << "Lower boundary: ");
    490491      cin >> tmp1;
    491       Log() << Verbose(0) << "Upper boundary: ";
     492      DoLog(0) && (Log() << Verbose(0) << "Upper boundary: ");
    492493      cin >> tmp2;
    493494      first = mol->start;
     
    519520  char choice;  // menu choice char
    520521
    521   Log() << Verbose(0) << "===========MEASURE ATOMS=========================" << endl;
    522   Log() << Verbose(0) << " a - calculate bond length between one atom and all others" << endl;
    523   Log() << Verbose(0) << " b - calculate bond length between two atoms" << endl;
    524   Log() << Verbose(0) << " c - calculate bond angle" << endl;
    525   Log() << Verbose(0) << " d - calculate principal axis of the system" << endl;
    526   Log() << Verbose(0) << " e - calculate volume of the convex envelope" << endl;
    527   Log() << Verbose(0) << " f - calculate temperature from current velocity" << endl;
    528   Log() << Verbose(0) << " g - output all temperatures per step from velocities" << endl;
    529   Log() << Verbose(0) << "all else - go back" << endl;
    530   Log() << Verbose(0) << "===============================================" << endl;
    531   Log() << Verbose(0) << "INPUT: ";
     522  DoLog(0) && (Log() << Verbose(0) << "===========MEASURE ATOMS=========================" << endl);
     523  DoLog(0) && (Log() << Verbose(0) << " a - calculate bond length between one atom and all others" << endl);
     524  DoLog(0) && (Log() << Verbose(0) << " b - calculate bond length between two atoms" << endl);
     525  DoLog(0) && (Log() << Verbose(0) << " c - calculate bond angle" << endl);
     526  DoLog(0) && (Log() << Verbose(0) << " d - calculate principal axis of the system" << endl);
     527  DoLog(0) && (Log() << Verbose(0) << " e - calculate volume of the convex envelope" << endl);
     528  DoLog(0) && (Log() << Verbose(0) << " f - calculate temperature from current velocity" << endl);
     529  DoLog(0) && (Log() << Verbose(0) << " g - output all temperatures per step from velocities" << endl);
     530  DoLog(0) && (Log() << Verbose(0) << "all else - go back" << endl);
     531  DoLog(0) && (Log() << Verbose(0) << "===============================================" << endl);
     532  DoLog(0) && (Log() << Verbose(0) << "INPUT: ");
    532533  cin >> choice;
    533534
    534535  switch(choice) {
    535536    default:
    536       Log() << Verbose(1) << "Not a valid choice." << endl;
     537      DoLog(1) && (Log() << Verbose(1) << "Not a valid choice." << endl);
    537538      break;
    538539    case 'a':
     
    566567      x.SubtractVector((const Vector *)&second->x);
    567568      tmp1 = x.Norm();
    568       Log() << Verbose(1) << "Distance vector is ";
     569      DoLog(1) && (Log() << Verbose(1) << "Distance vector is ");
    569570      x.Output();
    570       Log() << Verbose(0) << "." << endl << "Norm of distance is " << tmp1 << "." << endl;
     571      DoLog(0) && (Log() << Verbose(0) << "." << endl << "Norm of distance is " << tmp1 << "." << endl);
    571572      break;
    572573
    573574    case 'c':
    574       Log() << Verbose(0) << "Evaluating bond angle between three - first, central, last - atoms." << endl;
     575      DoLog(0) && (Log() << Verbose(0) << "Evaluating bond angle between three - first, central, last - atoms." << endl);
    575576      first = mol->AskAtom("Enter first atom: ");
    576577      second = mol->AskAtom("Enter central atom: ");
     
    581582      y.CopyVector((const Vector *)&third->x);
    582583      y.SubtractVector((const Vector *)&second->x);
    583       Log() << Verbose(0) << "Bond angle between first atom Nr." << first->nr << ", central atom Nr." << second->nr << " and last atom Nr." << third->nr << ": ";
    584       Log() << Verbose(0) << (acos(x.ScalarProduct((const Vector *)&y)/(y.Norm()*x.Norm()))/M_PI*180.) << " degrees" << endl;
     584      DoLog(0) && (Log() << Verbose(0) << "Bond angle between first atom Nr." << first->nr << ", central atom Nr." << second->nr << " and last atom Nr." << third->nr << ": ");
     585      DoLog(0) && (Log() << Verbose(0) << (acos(x.ScalarProduct((const Vector *)&y)/(y.Norm()*x.Norm()))/M_PI*180.) << " degrees" << endl);
    585586      break;
    586587    case 'd':
    587       Log() << Verbose(0) << "Evaluating prinicipal axis." << endl;
    588       Log() << Verbose(0) << "Shall we rotate? [0/1]: ";
     588      DoLog(0) && (Log() << Verbose(0) << "Evaluating prinicipal axis." << endl);
     589      DoLog(0) && (Log() << Verbose(0) << "Shall we rotate? [0/1]: ");
    589590      cin >> Z;
    590591      if ((Z >=0) && (Z <=1))
     
    595596    case 'e':
    596597      {
    597         Log() << Verbose(0) << "Evaluating volume of the convex envelope.";
     598        DoLog(0) && (Log() << Verbose(0) << "Evaluating volume of the convex envelope.");
    598599        class Tesselation *TesselStruct = NULL;
    599600        const LinkedCell *LCList = NULL;
     
    601602        FindConvexBorder(mol, TesselStruct, LCList, NULL);
    602603        double clustervolume = VolumeOfConvexEnvelope(TesselStruct, configuration);
    603         Log() << Verbose(0) << "The tesselated surface area is " << clustervolume << "." << endl;\
     604        DoLog(0) && (Log() << Verbose(0) << "The tesselated surface area is " << clustervolume << "." << endl);\
    604605        delete(LCList);
    605606        delete(TesselStruct);
     
    612613      {
    613614        char filename[255];
    614         Log() << Verbose(0) << "Please enter filename: " << endl;
     615        DoLog(0) && (Log() << Verbose(0) << "Please enter filename: " << endl);
    615616        cin >> filename;
    616         Log() << Verbose(1) << "Storing temperatures in " << filename << "." << endl;
     617        DoLog(1) && (Log() << Verbose(1) << "Storing temperatures in " << filename << "." << endl);
    617618        ofstream *output = new ofstream(filename, ios::trunc);
    618619        if (!mol->OutputTemperatureFromTrajectories(output, 0, mol->MDSteps))
    619           Log() << Verbose(2) << "File could not be written." << endl;
     620          DoLog(2) && (Log() << Verbose(2) << "File could not be written." << endl);
    620621        else
    621           Log() << Verbose(2) << "File stored." << endl;
     622          DoLog(2) && (Log() << Verbose(2) << "File stored." << endl);
    622623        output->close();
    623624        delete(output);
     
    636637  clock_t start, end;
    637638
    638   Log() << Verbose(0) << "Fragmenting molecule with current connection matrix ..." << endl;
    639   Log() << Verbose(0) << "What's the desired bond order: ";
     639  DoLog(0) && (Log() << Verbose(0) << "Fragmenting molecule with current connection matrix ..." << endl);
     640  DoLog(0) && (Log() << Verbose(0) << "What's the desired bond order: ");
    640641  cin >> Order1;
    641642  if (mol->first->next != mol->last) {  // there are bonds
     
    643644    mol->FragmentMolecule(Order1, configuration);
    644645    end = clock();
    645     Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl;
     646    DoLog(0) && (Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl);
    646647  } else
    647     Log() << Verbose(0) << "Connection matrix has not yet been generated!" << endl;
     648    DoLog(0) && (Log() << Verbose(0) << "Connection matrix has not yet been generated!" << endl);
    648649};
    649650
     
    664665  bool valid;
    665666
    666   Log() << Verbose(0) << "=========MANIPULATE ATOMS======================" << endl;
    667   Log() << Verbose(0) << "a - add an atom" << endl;
    668   Log() << Verbose(0) << "r - remove an atom" << endl;
    669   Log() << Verbose(0) << "b - scale a bond between atoms" << endl;
    670   Log() << Verbose(0) << "t - turn an atom round another bond" << endl;
    671   Log() << Verbose(0) << "u - change an atoms element" << endl;
    672   Log() << Verbose(0) << "l - measure lengths, angles, ... for an atom" << endl;
    673   Log() << Verbose(0) << "all else - go back" << endl;
    674   Log() << Verbose(0) << "===============================================" << endl;
     667  DoLog(0) && (Log() << Verbose(0) << "=========MANIPULATE ATOMS======================" << endl);
     668  DoLog(0) && (Log() << Verbose(0) << "a - add an atom" << endl);
     669  DoLog(0) && (Log() << Verbose(0) << "r - remove an atom" << endl);
     670  DoLog(0) && (Log() << Verbose(0) << "b - scale a bond between atoms" << endl);
     671  DoLog(0) && (Log() << Verbose(0) << "t - turn an atom round another bond" << endl);
     672  DoLog(0) && (Log() << Verbose(0) << "u - change an atoms element" << endl);
     673  DoLog(0) && (Log() << Verbose(0) << "l - measure lengths, angles, ... for an atom" << endl);
     674  DoLog(0) && (Log() << Verbose(0) << "all else - go back" << endl);
     675  DoLog(0) && (Log() << Verbose(0) << "===============================================" << endl);
    675676  if (molecules->NumberOfActiveMolecules() > 1)
    676     eLog() << Verbose(2) << "There is more than one molecule active! Atoms will be added to each." << endl;
    677   Log() << Verbose(0) << "INPUT: ";
     677    DoeLog(2) && (eLog()<< Verbose(2) << "There is more than one molecule active! Atoms will be added to each." << endl);
     678  DoLog(0) && (Log() << Verbose(0) << "INPUT: ");
    678679  cin >> choice;
    679680
    680681  switch (choice) {
    681682    default:
    682       Log() << Verbose(0) << "Not a valid choice." << endl;
     683      DoLog(0) && (Log() << Verbose(0) << "Not a valid choice." << endl);
    683684      break;
    684685
     
    687688        if ((*ListRunner)->ActiveFlag) {
    688689        mol = *ListRunner;
    689         Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;
     690        DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl);
    690691        AddAtoms(periode, mol);
    691692      }
     
    696697        if ((*ListRunner)->ActiveFlag) {
    697698        mol = *ListRunner;
    698         Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;
    699         Log() << Verbose(0) << "Scaling bond length between two atoms." << endl;
     699        DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl);
     700        DoLog(0) && (Log() << Verbose(0) << "Scaling bond length between two atoms." << endl);
    700701        first = mol->AskAtom("Enter first (fixed) atom: ");
    701702        second = mol->AskAtom("Enter second (shifting) atom: ");
     
    704705          minBond += (first->x.x[i]-second->x.x[i])*(first->x.x[i] - second->x.x[i]);
    705706        minBond = sqrt(minBond);
    706         Log() << Verbose(0) << "Current Bond length between " << first->type->name << " Atom " << first->nr << " and " << second->type->name << " Atom " << second->nr << ": " << minBond << " a.u." << endl;
    707         Log() << Verbose(0) << "Enter new bond length [a.u.]: ";
     707        DoLog(0) && (Log() << Verbose(0) << "Current Bond length between " << first->type->name << " Atom " << first->nr << " and " << second->type->name << " Atom " << second->nr << ": " << minBond << " a.u." << endl);
     708        DoLog(0) && (Log() << Verbose(0) << "Enter new bond length [a.u.]: ");
    708709        cin >> bond;
    709710        for (int i=NDIM;i--;) {
     
    719720        if ((*ListRunner)->ActiveFlag) {
    720721        mol = *ListRunner;
    721         Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;
    722        Log() << Verbose(0) << "Angstroem -> Bohrradius: 1.8897261\t\tBohrradius -> Angstroem: 0.52917721" << endl;
    723        Log() << Verbose(0) << "Enter three factors: ";
     722        DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl);
     723       DoLog(0) && (Log() << Verbose(0) << "Angstroem -> Bohrradius: 1.8897261\t\tBohrradius -> Angstroem: 0.52917721" << endl);
     724       DoLog(0) && (Log() << Verbose(0) << "Enter three factors: ");
    724725       factor = new double[NDIM];
    725726       cin >> factor[0];
     
    736737        if ((*ListRunner)->ActiveFlag) {
    737738        mol = *ListRunner;
    738         Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;
     739        DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl);
    739740        MeasureAtoms(periode, mol, configuration);
    740741      }
     
    745746        if ((*ListRunner)->ActiveFlag) {
    746747        mol = *ListRunner;
    747         Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;
     748        DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl);
    748749        RemoveAtoms(mol);
    749750      }
     
    754755        if ((*ListRunner)->ActiveFlag) {
    755756          mol = *ListRunner;
    756           Log() << Verbose(0) << "Turning atom around another bond - first is atom to turn, second (central) and third specify bond" << endl;
     757          DoLog(0) && (Log() << Verbose(0) << "Turning atom around another bond - first is atom to turn, second (central) and third specify bond" << endl);
    757758          first = mol->AskAtom("Enter turning atom: ");
    758759          second = mol->AskAtom("Enter central atom: ");
     
    788789        int Z;
    789790        mol = *ListRunner;
    790         Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;
     791        DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl);
    791792        first = NULL;
    792793        do {
    793           Log() << Verbose(0) << "Change the element of which atom: ";
     794          DoLog(0) && (Log() << Verbose(0) << "Change the element of which atom: ");
    794795          cin >> Z;
    795796        } while ((first = mol->FindAtom(Z)) == NULL);
    796         Log() << Verbose(0) << "New element by atomic number Z: ";
     797        DoLog(0) && (Log() << Verbose(0) << "New element by atomic number Z: ");
    797798        cin >> Z;
    798799        first->type = periode->FindElement(Z);
    799         Log() << Verbose(0) << "Atom " << first->nr << "'s element is " << first->type->name << "." << endl;
     800        DoLog(0) && (Log() << Verbose(0) << "Atom " << first->nr << "'s element is " << first->type->name << "." << endl);
    800801      }
    801802      break;
     
    818819  MoleculeLeafClass *Subgraphs = NULL;
    819820
    820   Log() << Verbose(0) << "=========MANIPULATE GLOBALLY===================" << endl;
    821   Log() << Verbose(0) << "c - scale by unit transformation" << endl;
    822   Log() << Verbose(0) << "d - duplicate molecule/periodic cell" << endl;
    823   Log() << Verbose(0) << "f - fragment molecule many-body bond order style" << endl;
    824   Log() << Verbose(0) << "g - center atoms in box" << endl;
    825   Log() << Verbose(0) << "i - realign molecule" << endl;
    826   Log() << Verbose(0) << "m - mirror all molecules" << endl;
    827   Log() << Verbose(0) << "o - create connection matrix" << endl;
    828   Log() << Verbose(0) << "t - translate molecule by vector" << endl;
    829   Log() << Verbose(0) << "all else - go back" << endl;
    830   Log() << Verbose(0) << "===============================================" << endl;
     821  DoLog(0) && (Log() << Verbose(0) << "=========MANIPULATE GLOBALLY===================" << endl);
     822  DoLog(0) && (Log() << Verbose(0) << "c - scale by unit transformation" << endl);
     823  DoLog(0) && (Log() << Verbose(0) << "d - duplicate molecule/periodic cell" << endl);
     824  DoLog(0) && (Log() << Verbose(0) << "f - fragment molecule many-body bond order style" << endl);
     825  DoLog(0) && (Log() << Verbose(0) << "g - center atoms in box" << endl);
     826  DoLog(0) && (Log() << Verbose(0) << "i - realign molecule" << endl);
     827  DoLog(0) && (Log() << Verbose(0) << "m - mirror all molecules" << endl);
     828  DoLog(0) && (Log() << Verbose(0) << "o - create connection matrix" << endl);
     829  DoLog(0) && (Log() << Verbose(0) << "t - translate molecule by vector" << endl);
     830  DoLog(0) && (Log() << Verbose(0) << "all else - go back" << endl);
     831  DoLog(0) && (Log() << Verbose(0) << "===============================================" << endl);
    831832  if (molecules->NumberOfActiveMolecules() > 1)
    832     eLog() << Verbose(2) << "There is more than one molecule active! Atoms will be added to each." << endl;
    833   Log() << Verbose(0) << "INPUT: ";
     833    DoeLog(2) && (eLog()<< Verbose(2) << "There is more than one molecule active! Atoms will be added to each." << endl);
     834  DoLog(0) && (Log() << Verbose(0) << "INPUT: ");
    834835  cin >> choice;
    835836
    836837  switch (choice) {
    837838    default:
    838       Log() << Verbose(0) << "Not a valid choice." << endl;
     839      DoLog(0) && (Log() << Verbose(0) << "Not a valid choice." << endl);
    839840      break;
    840841
     
    843844        if ((*ListRunner)->ActiveFlag) {
    844845        mol = *ListRunner;
    845         Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;
    846         Log() << Verbose(0) << "State the axis [(+-)123]: ";
     846        DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl);
     847        DoLog(0) && (Log() << Verbose(0) << "State the axis [(+-)123]: ");
    847848        cin >> axis;
    848         Log() << Verbose(0) << "State the factor: ";
     849        DoLog(0) && (Log() << Verbose(0) << "State the factor: ");
    849850        cin >> faktor;
    850851
     
    863864          }
    864865          if (count != j)
    865             eLog() << Verbose(1) << "AtomCount " << count << " is not equal to number of atoms in molecule " << j << "!" << endl;
     866            DoeLog(1) && (eLog()<< Verbose(1) << "AtomCount " << count << " is not equal to number of atoms in molecule " << j << "!" << endl);
    866867          x.Zero();
    867868          y.Zero();
     
    902903        if ((*ListRunner)->ActiveFlag) {
    903904        mol = *ListRunner;
    904         Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;
     905        DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl);
    905906        CenterAtoms(mol);
    906907      }
     
    911912        if ((*ListRunner)->ActiveFlag) {
    912913        mol = *ListRunner;
    913         Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;
     914        DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl);
    914915        AlignAtoms(periode, mol);
    915916      }
     
    920921        if ((*ListRunner)->ActiveFlag) {
    921922        mol = *ListRunner;
    922         Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;
     923        DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl);
    923924        MirrorAtoms(mol);
    924925      }
     
    931932          double bonddistance;
    932933          clock_t start,end;
    933           Log() << Verbose(0) << "What's the maximum bond distance: ";
     934          DoLog(0) && (Log() << Verbose(0) << "What's the maximum bond distance: ");
    934935          cin >> bonddistance;
    935936          start = clock();
    936937          mol->CreateAdjacencyList(bonddistance, configuration->GetIsAngstroem(), &BondGraph::CovalentMinMaxDistance, NULL);
    937938          end = clock();
    938           Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl;
     939          DoLog(0) && (Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl);
    939940        }
    940941      break;
     
    944945        if ((*ListRunner)->ActiveFlag) {
    945946        mol = *ListRunner;
    946         Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;
    947         Log() << Verbose(0) << "Enter translation vector." << endl;
     947        DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl);
     948        DoLog(0) && (Log() << Verbose(0) << "Enter translation vector." << endl);
    948949        x.AskPosition(World::get()->cell_size,0);
    949950        mol->Center.AddVector((const Vector *)&x);
     
    973974  molecule *mol = NULL;
    974975
    975   Log() << Verbose(0) << "==========EDIT MOLECULES=====================" << endl;
    976   Log() << Verbose(0) << "c - create new molecule" << endl;
    977   Log() << Verbose(0) << "l - load molecule from xyz file" << endl;
    978   Log() << Verbose(0) << "n - change molecule's name" << endl;
    979   Log() << Verbose(0) << "N - give molecules filename" << endl;
    980   Log() << Verbose(0) << "p - parse atoms in xyz file into molecule" << endl;
    981   Log() << Verbose(0) << "r - remove a molecule" << endl;
    982   Log() << Verbose(0) << "all else - go back" << endl;
    983   Log() << Verbose(0) << "===============================================" << endl;
    984   Log() << Verbose(0) << "INPUT: ";
     976  DoLog(0) && (Log() << Verbose(0) << "==========EDIT MOLECULES=====================" << endl);
     977  DoLog(0) && (Log() << Verbose(0) << "c - create new molecule" << endl);
     978  DoLog(0) && (Log() << Verbose(0) << "l - load molecule from xyz file" << endl);
     979  DoLog(0) && (Log() << Verbose(0) << "n - change molecule's name" << endl);
     980  DoLog(0) && (Log() << Verbose(0) << "N - give molecules filename" << endl);
     981  DoLog(0) && (Log() << Verbose(0) << "p - parse atoms in xyz file into molecule" << endl);
     982  DoLog(0) && (Log() << Verbose(0) << "r - remove a molecule" << endl);
     983  DoLog(0) && (Log() << Verbose(0) << "all else - go back" << endl);
     984  DoLog(0) && (Log() << Verbose(0) << "===============================================" << endl);
     985  DoLog(0) && (Log() << Verbose(0) << "INPUT: ");
    985986  cin >> choice;
    986987
    987988  switch (choice) {
    988989    default:
    989       Log() << Verbose(0) << "Not a valid choice." << endl;
     990      DoLog(0) && (Log() << Verbose(0) << "Not a valid choice." << endl);
    990991      break;
    991992    case 'c':
     
    997998      {
    998999        char filename[MAXSTRINGSIZE];
    999         Log() << Verbose(0) << "Format should be XYZ with: ShorthandOfElement\tX\tY\tZ" << endl;
     1000        DoLog(0) && (Log() << Verbose(0) << "Format should be XYZ with: ShorthandOfElement\tX\tY\tZ" << endl);
    10001001        mol = new molecule(periode);
    10011002        do {
    1002           Log() << Verbose(0) << "Enter file name: ";
     1003          DoLog(0) && (Log() << Verbose(0) << "Enter file name: ");
    10031004          cin >> filename;
    10041005        } while (!mol->AddXYZFile(filename));
     
    10211022        char filename[MAXSTRINGSIZE];
    10221023        do {
    1023           Log() << Verbose(0) << "Enter index of molecule: ";
     1024          DoLog(0) && (Log() << Verbose(0) << "Enter index of molecule: ");
    10241025          cin >> nr;
    10251026          mol = molecules->ReturnIndex(nr);
    10261027        } while (mol == NULL);
    1027         Log() << Verbose(0) << "Enter name: ";
     1028        DoLog(0) && (Log() << Verbose(0) << "Enter name: ");
    10281029        cin >> filename;
    10291030        strcpy(mol->name, filename);
     
    10351036        char filename[MAXSTRINGSIZE];
    10361037        do {
    1037           Log() << Verbose(0) << "Enter index of molecule: ";
     1038          DoLog(0) && (Log() << Verbose(0) << "Enter index of molecule: ");
    10381039          cin >> nr;
    10391040          mol = molecules->ReturnIndex(nr);
    10401041        } while (mol == NULL);
    1041         Log() << Verbose(0) << "Enter name: ";
     1042        DoLog(0) && (Log() << Verbose(0) << "Enter name: ");
    10421043        cin >> filename;
    10431044        mol->SetNameFromFilename(filename);
     
    10501051        mol = NULL;
    10511052        do {
    1052           Log() << Verbose(0) << "Enter index of molecule: ";
     1053          DoLog(0) && (Log() << Verbose(0) << "Enter index of molecule: ");
    10531054          cin >> nr;
    10541055          mol = molecules->ReturnIndex(nr);
    10551056        } while (mol == NULL);
    1056         Log() << Verbose(0) << "Format should be XYZ with: ShorthandOfElement\tX\tY\tZ" << endl;
     1057        DoLog(0) && (Log() << Verbose(0) << "Format should be XYZ with: ShorthandOfElement\tX\tY\tZ" << endl);
    10571058        do {
    1058           Log() << Verbose(0) << "Enter file name: ";
     1059          DoLog(0) && (Log() << Verbose(0) << "Enter file name: ");
    10591060          cin >> filename;
    10601061        } while (!mol->AddXYZFile(filename));
     
    10641065
    10651066    case 'r':
    1066       Log() << Verbose(0) << "Enter index of molecule: ";
     1067      DoLog(0) && (Log() << Verbose(0) << "Enter index of molecule: ");
    10671068      cin >> nr;
    10681069      count = 1;
     
    10871088  char choice;  // menu choice char
    10881089
    1089   Log() << Verbose(0) << "===========MERGE MOLECULES=====================" << endl;
    1090   Log() << Verbose(0) << "a - simple add of one molecule to another" << endl;
    1091   Log() << Verbose(0) << "e - embedding merge of two molecules" << endl;
    1092   Log() << Verbose(0) << "m - multi-merge of all molecules" << endl;
    1093   Log() << Verbose(0) << "s - scatter merge of two molecules" << endl;
    1094   Log() << Verbose(0) << "t - simple merge of two molecules" << endl;
    1095   Log() << Verbose(0) << "all else - go back" << endl;
    1096   Log() << Verbose(0) << "===============================================" << endl;
    1097   Log() << Verbose(0) << "INPUT: ";
     1090  DoLog(0) && (Log() << Verbose(0) << "===========MERGE MOLECULES=====================" << endl);
     1091  DoLog(0) && (Log() << Verbose(0) << "a - simple add of one molecule to another" << endl);
     1092  DoLog(0) && (Log() << Verbose(0) << "b - count the number of bonds of two elements" << endl);
     1093  DoLog(0) && (Log() << Verbose(0) << "B - count the number of bonds of three elements " << endl);
     1094  DoLog(0) && (Log() << Verbose(0) << "e - embedding merge of two molecules" << endl);
     1095  DoLog(0) && (Log() << Verbose(0) << "h - count the number of hydrogen bonds" << endl);
     1096  DoLog(0) && (Log() << Verbose(0) << "b - count the number of hydrogen bonds" << endl);
     1097  DoLog(0) && (Log() << Verbose(0) << "m - multi-merge of all molecules" << endl);
     1098  DoLog(0) && (Log() << Verbose(0) << "s - scatter merge of two molecules" << endl);
     1099  DoLog(0) && (Log() << Verbose(0) << "t - simple merge of two molecules" << endl);
     1100  DoLog(0) && (Log() << Verbose(0) << "all else - go back" << endl);
     1101  DoLog(0) && (Log() << Verbose(0) << "===============================================" << endl);
     1102  DoLog(0) && (Log() << Verbose(0) << "INPUT: ");
    10981103  cin >> choice;
    10991104
    11001105  switch (choice) {
    11011106    default:
    1102       Log() << Verbose(0) << "Not a valid choice." << endl;
     1107      DoLog(0) && (Log() << Verbose(0) << "Not a valid choice." << endl);
    11031108      break;
    11041109
     
    11091114        {
    11101115          do {
    1111             Log() << Verbose(0) << "Enter index of destination molecule: ";
     1116            DoLog(0) && (Log() << Verbose(0) << "Enter index of destination molecule: ");
    11121117            cin >> dest;
    11131118            destmol = molecules->ReturnIndex(dest);
    11141119          } while ((destmol == NULL) && (dest != -1));
    11151120          do {
    1116             Log() << Verbose(0) << "Enter index of source molecule to add from: ";
     1121            DoLog(0) && (Log() << Verbose(0) << "Enter index of source molecule to add from: ");
    11171122            cin >> src;
    11181123            srcmol = molecules->ReturnIndex(src);
     
    11241129      break;
    11251130
     1131    case 'b':
     1132      {
     1133        const int nr = 2;
     1134        char *names[nr] = {"first", "second"};
     1135        int Z[nr];
     1136        element *elements[nr];
     1137        for (int i=0;i<nr;i++) {
     1138          Z[i] = 0;
     1139          do {
     1140            cout << "Enter " << names[i] << " element: ";
     1141            cin >> Z[i];
     1142          } while ((Z[i] <= 0) && (Z[i] > MAX_ELEMENTS));
     1143          elements[i] = periode->FindElement(Z[i]);
     1144        }
     1145        const int count = CountBondsOfTwo(molecules, elements[0], elements[1]);
     1146        cout << endl << "There are " << count << " ";
     1147        for (int i=0;i<nr;i++) {
     1148          if (i==0)
     1149            cout << elements[i]->symbol;
     1150          else
     1151            cout << "-" << elements[i]->symbol;
     1152        }
     1153        cout << " bonds." << endl;
     1154      }
     1155    break;
     1156
     1157    case 'B':
     1158      {
     1159        const int nr = 3;
     1160        char *names[nr] = {"first", "second", "third"};
     1161        int Z[nr];
     1162        element *elements[nr];
     1163        for (int i=0;i<nr;i++) {
     1164          Z[i] = 0;
     1165          do {
     1166            cout << "Enter " << names[i] << " element: ";
     1167            cin >> Z[i];
     1168          } while ((Z[i] <= 0) && (Z[i] > MAX_ELEMENTS));
     1169          elements[i] = periode->FindElement(Z[i]);
     1170        }
     1171        const int count = CountBondsOfThree(molecules, elements[0], elements[1], elements[2]);
     1172        cout << endl << "There are " << count << " ";
     1173        for (int i=0;i<nr;i++) {
     1174          if (i==0)
     1175            cout << elements[i]->symbol;
     1176          else
     1177            cout << "-" << elements[i]->symbol;
     1178        }
     1179        cout << " bonds." << endl;
     1180      }
     1181    break;
     1182
    11261183    case 'e':
    11271184      {
     
    11291186        molecule *srcmol = NULL, *destmol = NULL;
    11301187        do {
    1131           Log() << Verbose(0) << "Enter index of matrix molecule (the variable one): ";
     1188          DoLog(0) && (Log() << Verbose(0) << "Enter index of matrix molecule (the variable one): ");
    11321189          cin >> src;
    11331190          srcmol = molecules->ReturnIndex(src);
    11341191        } while ((srcmol == NULL) && (src != -1));
    11351192        do {
    1136           Log() << Verbose(0) << "Enter index of molecule to merge into (the fixed one): ";
     1193          DoLog(0) && (Log() << Verbose(0) << "Enter index of molecule to merge into (the fixed one): ");
    11371194          cin >> dest;
    11381195          destmol = molecules->ReturnIndex(dest);
     
    11431200      break;
    11441201
     1202    case 'h':
     1203      {
     1204        int Z;
     1205        cout << "Please enter interface element: ";
     1206        cin >> Z;
     1207        element * const InterfaceElement = periode->FindElement(Z);
     1208        cout << endl << "There are " << CountHydrogenBridgeBonds(molecules, InterfaceElement) << " hydrogen bridges with connections to " << (InterfaceElement != 0 ? InterfaceElement->name : "None") << "." << endl;
     1209      }
     1210      break;
     1211
    11451212    case 'm':
    11461213      {
     
    11481215        molecule *mol = NULL;
    11491216        do {
    1150           Log() << Verbose(0) << "Enter index of molecule to merge into: ";
     1217          DoLog(0) && (Log() << Verbose(0) << "Enter index of molecule to merge into: ");
    11511218          cin >> nr;
    11521219          mol = molecules->ReturnIndex(nr);
     
    11651232
    11661233    case 's':
    1167       Log() << Verbose(0) << "Not implemented yet." << endl;
     1234      DoLog(0) && (Log() << Verbose(0) << "Not implemented yet." << endl);
    11681235      break;
    11691236
     
    11741241        {
    11751242          do {
    1176             Log() << Verbose(0) << "Enter index of destination molecule: ";
     1243            DoLog(0) && (Log() << Verbose(0) << "Enter index of destination molecule: ");
    11771244            cin >> dest;
    11781245            destmol = molecules->ReturnIndex(dest);
    11791246          } while ((destmol == NULL) && (dest != -1));
    11801247          do {
    1181             Log() << Verbose(0) << "Enter index of source molecule to merge into: ";
     1248            DoLog(0) && (Log() << Verbose(0) << "Enter index of source molecule to merge into: ");
    11821249            cin >> src;
    11831250            srcmol = molecules->ReturnIndex(src);
     
    12081275    mol = (molecules->ListOfMolecules.front())->CopyMolecule();
    12091276  else {
    1210     eLog() << Verbose(0) << "I don't have anything to test on ... ";
     1277    DoeLog(0) && (eLog()<< Verbose(0) << "I don't have anything to test on ... ");
    12111278    performCriticalExit();
    12121279    return;
     
    12151282
    12161283  // generate some KeySets
    1217   Log() << Verbose(0) << "Generating KeySets." << endl;
     1284  DoLog(0) && (Log() << Verbose(0) << "Generating KeySets." << endl);
    12181285  KeySet TestSets[mol->AtomCount+1];
    12191286  i=1;
     
    12251292    i++;
    12261293  }
    1227   Log() << Verbose(0) << "Testing insertion of already present item in KeySets." << endl;
     1294  DoLog(0) && (Log() << Verbose(0) << "Testing insertion of already present item in KeySets." << endl);
    12281295  KeySetTestPair test;
    12291296  test = TestSets[mol->AtomCount-1].insert(Walker->nr);
    12301297  if (test.second) {
    1231     Log() << Verbose(1) << "Insertion worked?!" << endl;
     1298    DoLog(1) && (Log() << Verbose(1) << "Insertion worked?!" << endl);
    12321299  } else {
    1233     Log() << Verbose(1) << "Insertion rejected: Present object is " << (*test.first) << "." << endl;
     1300    DoLog(1) && (Log() << Verbose(1) << "Insertion rejected: Present object is " << (*test.first) << "." << endl);
    12341301  }
    12351302  TestSets[mol->AtomCount].insert(mol->end->previous->nr);
     
    12371304
    12381305  // constructing Graph structure
    1239   Log() << Verbose(0) << "Generating Subgraph class." << endl;
     1306  DoLog(0) && (Log() << Verbose(0) << "Generating Subgraph class." << endl);
    12401307  Graph Subgraphs;
    12411308
    12421309  // insert KeySets into Subgraphs
    1243   Log() << Verbose(0) << "Inserting KeySets into Subgraph class." << endl;
     1310  DoLog(0) && (Log() << Verbose(0) << "Inserting KeySets into Subgraph class." << endl);
    12441311  for (int j=0;j<mol->AtomCount;j++) {
    12451312    Subgraphs.insert(GraphPair (TestSets[j],pair<int, double>(counter++, 1.)));
    12461313  }
    1247   Log() << Verbose(0) << "Testing insertion of already present item in Subgraph." << endl;
     1314  DoLog(0) && (Log() << Verbose(0) << "Testing insertion of already present item in Subgraph." << endl);
    12481315  GraphTestPair test2;
    12491316  test2 = Subgraphs.insert(GraphPair (TestSets[mol->AtomCount],pair<int, double>(counter++, 1.)));
    12501317  if (test2.second) {
    1251     Log() << Verbose(1) << "Insertion worked?!" << endl;
     1318    DoLog(1) && (Log() << Verbose(1) << "Insertion worked?!" << endl);
    12521319  } else {
    1253     Log() << Verbose(1) << "Insertion rejected: Present object is " << (*(test2.first)).second.first << "." << endl;
     1320    DoLog(1) && (Log() << Verbose(1) << "Insertion rejected: Present object is " << (*(test2.first)).second.first << "." << endl);
    12541321  }
    12551322
    12561323  // show graphs
    1257   Log() << Verbose(0) << "Showing Subgraph's contents, checking that it's sorted." << endl;
     1324  DoLog(0) && (Log() << Verbose(0) << "Showing Subgraph's contents, checking that it's sorted." << endl);
    12581325  Graph::iterator A = Subgraphs.begin();
    12591326  while (A !=  Subgraphs.end()) {
    1260     Log() << Verbose(0) << (*A).second.first << ": ";
     1327    DoLog(0) && (Log() << Verbose(0) << (*A).second.first << ": ");
    12611328    KeySet::iterator key = (*A).first.begin();
    12621329    comp = -1;
    12631330    while (key != (*A).first.end()) {
    12641331      if ((*key) > comp)
    1265         Log() << Verbose(0) << (*key) << " ";
     1332        DoLog(0) && (Log() << Verbose(0) << (*key) << " ");
    12661333      else
    1267         Log() << Verbose(0) << (*key) << "! ";
     1334        DoLog(0) && (Log() << Verbose(0) << (*key) << "! ");
    12681335      comp = (*key);
    12691336      key++;
    12701337    }
    1271     Log() << Verbose(0) << endl;
     1338    DoLog(0) && (Log() << Verbose(0) << endl);
    12721339    A++;
    12731340  }
     
    12891356
    12901357  if (!strcmp(configuration->configpath, configuration->GetDefaultPath())) {
    1291     eLog() << Verbose(2) << "config is found under different path then stated in config file::defaultpath!" << endl;
     1358    DoeLog(2) && (eLog()<< Verbose(2) << "config is found under different path then stated in config file::defaultpath!" << endl);
    12921359  }
    12931360
     
    12981365  if (output == NULL)
    12991366    strcpy(filename,"main_pcp_linux");
    1300   Log() << Verbose(0) << "Saving as pdb input ";
     1367  DoLog(0) && (Log() << Verbose(0) << "Saving as pdb input ");
    13011368  if (configuration->SavePDB(filename, molecules))
    1302     Log() << Verbose(0) << "done." << endl;
     1369    DoLog(0) && (Log() << Verbose(0) << "done." << endl);
    13031370  else
    1304     Log() << Verbose(0) << "failed." << endl;
     1371    DoLog(0) && (Log() << Verbose(0) << "failed." << endl);
    13051372
    13061373  // then save as tremolo data file
     
    13091376  if (output == NULL)
    13101377    strcpy(filename,"main_pcp_linux");
    1311   Log() << Verbose(0) << "Saving as tremolo data input ";
     1378  DoLog(0) && (Log() << Verbose(0) << "Saving as tremolo data input ");
    13121379  if (configuration->SaveTREMOLO(filename, molecules))
    1313     Log() << Verbose(0) << "done." << endl;
     1380    DoLog(0) && (Log() << Verbose(0) << "done." << endl);
    13141381  else
    1315     Log() << Verbose(0) << "failed." << endl;
     1382    DoLog(0) && (Log() << Verbose(0) << "failed." << endl);
    13161383
    13171384  // translate each to its center and merge all molecules in MoleculeListClass into this molecule
     
    13331400  }
    13341401
    1335   Log() << Verbose(0) << "Storing configuration ... " << endl;
     1402  DoLog(0) && (Log() << Verbose(0) << "Storing configuration ... " << endl);
    13361403  // get correct valence orbitals
    13371404  mol->CalculateOrbitals(*configuration);
     
    13491416  output.close();
    13501417  output.clear();
    1351   Log() << Verbose(0) << "Saving of config file ";
     1418  DoLog(0) && (Log() << Verbose(0) << "Saving of config file ");
    13521419  if (configuration->Save(filename, periode, mol))
    1353     Log() << Verbose(0) << "successful." << endl;
     1420    DoLog(0) && (Log() << Verbose(0) << "successful." << endl);
    13541421  else
    1355     Log() << Verbose(0) << "failed." << endl;
     1422    DoLog(0) && (Log() << Verbose(0) << "failed." << endl);
    13561423
    13571424  // and save to xyz file
     
    13661433    output.open(filename, ios::trunc);
    13671434  }
    1368   Log() << Verbose(0) << "Saving of XYZ file ";
     1435  DoLog(0) && (Log() << Verbose(0) << "Saving of XYZ file ");
    13691436  if (mol->MDSteps <= 1) {
    13701437    if (mol->OutputXYZ(&output))
    1371       Log() << Verbose(0) << "successful." << endl;
     1438      DoLog(0) && (Log() << Verbose(0) << "successful." << endl);
    13721439    else
    1373       Log() << Verbose(0) << "failed." << endl;
     1440      DoLog(0) && (Log() << Verbose(0) << "failed." << endl);
    13741441  } else {
    13751442    if (mol->OutputTrajectoriesXYZ(&output))
    1376       Log() << Verbose(0) << "successful." << endl;
     1443      DoLog(0) && (Log() << Verbose(0) << "successful." << endl);
    13771444    else
    1378       Log() << Verbose(0) << "failed." << endl;
     1445      DoLog(0) && (Log() << Verbose(0) << "failed." << endl);
    13791446  }
    13801447  output.close();
     
    13861453  if (output == NULL)
    13871454    strcpy(filename,"main_pcp_linux");
    1388   Log() << Verbose(0) << "Saving as mpqc input ";
     1455  DoLog(0) && (Log() << Verbose(0) << "Saving as mpqc input ");
    13891456  if (configuration->SaveMPQC(filename, mol))
    1390     Log() << Verbose(0) << "done." << endl;
     1457    DoLog(0) && (Log() << Verbose(0) << "done." << endl);
    13911458  else
    1392     Log() << Verbose(0) << "failed." << endl;
     1459    DoLog(0) && (Log() << Verbose(0) << "failed." << endl);
    13931460
    13941461  if (!strcmp(configuration->configpath, configuration->GetDefaultPath())) {
    1395     eLog() << Verbose(2) << "config is found under different path then stated in config file::defaultpath!" << endl;
     1462    DoeLog(2) && (eLog()<< Verbose(2) << "config is found under different path then stated in config file::defaultpath!" << endl);
    13961463  }
    13971464
     
    14351502    do {
    14361503      if (argv[argptr][0] == '-') {
    1437         Log() << Verbose(0) << "Recognized command line argument: " << argv[argptr][1] << ".\n";
     1504        DoLog(0) && (Log() << Verbose(0) << "Recognized command line argument: " << argv[argptr][1] << ".\n");
    14381505        argptr++;
    14391506        switch(argv[argptr-1][1]) {
     
    14411508          case 'H':
    14421509          case '?':
    1443             Log() << Verbose(0) << "MoleCuilder suite" << endl << "==================" << endl << endl;
    1444             Log() << Verbose(0) << "Usage: " << argv[0] << "[config file] [-{acefpsthH?vfrp}] [further arguments]" << endl;
    1445             Log() << Verbose(0) << "or simply " << argv[0] << " without arguments for interactive session." << endl;
    1446             Log() << Verbose(0) << "\t-a Z x1 x2 x3\tAdd new atom of element Z at coordinates (x1,x2,x3)." << endl;
    1447             Log() << Verbose(0) << "\t-A <source>\tCreate adjacency list from bonds parsed from 'dbond'-style file." <<endl;
    1448             Log() << Verbose(0) << "\t-b xx xy xz yy yz zz\tCenter atoms in domain with given symmetric matrix of (xx,xy,xz,yy,yz,zz)." << endl;
    1449             Log() << Verbose(0) << "\t-B xx xy xz yy yz zz\tBound atoms by domain with given symmetric matrix of (xx,xy,xz,yy,yz,zz)." << endl;
    1450             Log() << Verbose(0) << "\t-c x1 x2 x3\tCenter atoms in domain with a minimum distance to boundary of (x1,x2,x3)." << endl;
    1451             Log() << Verbose(0) << "\t-C <type> [params] <output> <bin output> <BinWidth> <BinStart> <BinEnd>\tPair Correlation analysis." << endl;
    1452             Log() << Verbose(0) << "\t-d x1 x2 x3\tDuplicate cell along each axis by given factor." << endl;
    1453             Log() << Verbose(0) << "\t-D <bond distance>\tDepth-First-Search Analysis of the molecule, giving cycles and tree/back edges." << endl;
    1454             Log() << Verbose(0) << "\t-e <file>\tSets the databases path to be parsed (default: ./)." << endl;
    1455             Log() << Verbose(0) << "\t-E <id> <Z>\tChange atom <id>'s element to <Z>, <id> begins at 0." << endl;
    1456             Log() << Verbose(0) << "\t-f <dist> <order>\tFragments the molecule in BOSSANOVA manner (with/out rings compressed) and stores config files in same dir as config (return code 0 - fragmented, 2 - no fragmentation necessary)." << endl;
    1457             Log() << Verbose(0) << "\t-F <xyz of filler> <dist_x> <dist_y> <dist_z> <epsilon> <randatom> <randmol> <DoRotate>\tFilling Box with water molecules." << endl;
    1458             Log() << Verbose(0) << "\t-FF <MaxDistance> <xyz of filler> <dist_x> <dist_y> <dist_z> <epsilon> <randatom> <randmol> <DoRotate>\tFilling Box with water molecules." << endl;
    1459             Log() << Verbose(0) << "\t-g <file>\tParses a bond length table from the given file." << endl;
    1460             Log() << Verbose(0) << "\t-h/-H/-?\tGive this help screen." << endl;
    1461             Log() << Verbose(0) << "\t-I\t Dissect current system of molecules into a set of disconnected (subgraphs of) molecules." << endl;
    1462             Log() << Verbose(0) << "\t-j\t<path> Store all bonds to file." << endl;
    1463             Log() << Verbose(0) << "\t-J\t<path> Store adjacency per atom to file." << endl;
    1464             Log() << Verbose(0) << "\t-L <step0> <step1> <prefix>\tStore a linear interpolation between two configurations <step0> and <step1> into single config files with prefix <prefix> and as Trajectories into the current config file." << endl;
    1465             Log() << Verbose(0) << "\t-m <0/1>\tCalculate (0)/ Align in(1) PAS with greatest EV along z axis." << endl;
    1466             Log() << Verbose(0) << "\t-M <basis>\tSetting basis to store to MPQC config files." << endl;
    1467             Log() << Verbose(0) << "\t-n\tFast parsing (i.e. no trajectories are looked for)." << endl;
    1468             Log() << Verbose(0) << "\t-N <radius> <file>\tGet non-convex-envelope." << endl;
    1469             Log() << Verbose(0) << "\t-o <out>\tGet volume of the convex envelope (and store to tecplot file)." << endl;
    1470             Log() << Verbose(0) << "\t-O\tCenter atoms in origin." << endl;
    1471             Log() << Verbose(0) << "\t-p <file>\tParse given xyz file and create raw config file from it." << endl;
    1472             Log() << Verbose(0) << "\t-P <file>\tParse given forces file and append as an MD step to config file via Verlet." << endl;
    1473             Log() << Verbose(0) << "\t-r <id>\t\tRemove an atom with given id." << endl;
    1474             Log() << Verbose(0) << "\t-R <id> <radius>\t\tRemove all atoms out of sphere around a given one." << endl;
    1475             Log() << Verbose(0) << "\t-s x1 x2 x3\tScale all atom coordinates by this vector (x1,x2,x3)." << endl;
    1476             Log() << Verbose(0) << "\t-S <file> Store temperatures from the config file in <file>." << endl;
    1477             Log() << Verbose(0) << "\t-t x1 x2 x3\tTranslate all atoms by this vector (x1,x2,x3)." << endl;
    1478             Log() << Verbose(0) << "\t-T x1 x2 x3\tTranslate periodically all atoms by this vector (x1,x2,x3)." << endl;
    1479             Log() << Verbose(0) << "\t-u rho\tsuspend in water solution and output necessary cell lengths, average density rho and repetition." << endl;
    1480             Log() << Verbose(0) << "\t-v\t\tsets verbosity (more is more)." << endl;
    1481             Log() << Verbose(0) << "\t-V\t\tGives version information." << endl;
    1482             Log() << Verbose(0) << "Note: config files must not begin with '-' !" << endl;
     1510            DoLog(0) && (Log() << Verbose(0) << "MoleCuilder suite" << endl << "==================" << endl << endl);
     1511            DoLog(0) && (Log() << Verbose(0) << "Usage: " << argv[0] << "[config file] [-{acefpsthH?vfrp}] [further arguments]" << endl);
     1512            DoLog(0) && (Log() << Verbose(0) << "or simply " << argv[0] << " without arguments for interactive session." << endl);
     1513            DoLog(0) && (Log() << Verbose(0) << "\t-a Z x1 x2 x3\tAdd new atom of element Z at coordinates (x1,x2,x3)." << endl);
     1514            DoLog(0) && (Log() << Verbose(0) << "\t-A <source>\tCreate adjacency list from bonds parsed from 'dbond'-style file." <<endl);
     1515            DoLog(0) && (Log() << Verbose(0) << "\t-b xx xy xz yy yz zz\tCenter atoms in domain with given symmetric matrix of (xx,xy,xz,yy,yz,zz)." << endl);
     1516            DoLog(0) && (Log() << Verbose(0) << "\t-B xx xy xz yy yz zz\tBound atoms by domain with given symmetric matrix of (xx,xy,xz,yy,yz,zz)." << endl);
     1517            DoLog(0) && (Log() << Verbose(0) << "\t-c x1 x2 x3\tCenter atoms in domain with a minimum distance to boundary of (x1,x2,x3)." << endl);
     1518            DoLog(0) && (Log() << Verbose(0) << "\t-C <type> [params] <output> <bin output> <BinWidth> <BinStart> <BinEnd>\tPair Correlation analysis." << endl);
     1519            DoLog(0) && (Log() << Verbose(0) << "\t-d x1 x2 x3\tDuplicate cell along each axis by given factor." << endl);
     1520            DoLog(0) && (Log() << Verbose(0) << "\t-D <bond distance>\tDepth-First-Search Analysis of the molecule, giving cycles and tree/back edges." << endl);
     1521            DoLog(0) && (Log() << Verbose(0) << "\t-e <file>\tSets the databases path to be parsed (default: ./)." << endl);
     1522            DoLog(0) && (Log() << Verbose(0) << "\t-E <id> <Z>\tChange atom <id>'s element to <Z>, <id> begins at 0." << endl);
     1523            DoLog(0) && (Log() << Verbose(0) << "\t-f <dist> <order>\tFragments the molecule in BOSSANOVA manner (with/out rings compressed) and stores config files in same dir as config (return code 0 - fragmented, 2 - no fragmentation necessary)." << endl);
     1524            DoLog(0) && (Log() << Verbose(0) << "\t-F <xyz of filler> <dist_x> <dist_y> <dist_z> <epsilon> <randatom> <randmol> <DoRotate>\tFilling Box with water molecules." << endl);
     1525            DoLog(0) && (Log() << Verbose(0) << "\t-FF <MaxDistance> <xyz of filler> <dist_x> <dist_y> <dist_z> <epsilon> <randatom> <randmol> <DoRotate>\tFilling Box with water molecules." << endl);
     1526            DoLog(0) && (Log() << Verbose(0) << "\t-g <file>\tParses a bond length table from the given file." << endl);
     1527            DoLog(0) && (Log() << Verbose(0) << "\t-h/-H/-?\tGive this help screen." << endl);
     1528            DoLog(0) && (Log() << Verbose(0) << "\t-I\t Dissect current system of molecules into a set of disconnected (subgraphs of) molecules." << endl);
     1529            DoLog(0) && (Log() << Verbose(0) << "\t-j\t<path> Store all bonds to file." << endl);
     1530            DoLog(0) && (Log() << Verbose(0) << "\t-J\t<path> Store adjacency per atom to file." << endl);
     1531            DoLog(0) && (Log() << Verbose(0) << "\t-L <step0> <step1> <prefix>\tStore a linear interpolation between two configurations <step0> and <step1> into single config files with prefix <prefix> and as Trajectories into the current config file." << endl);
     1532            DoLog(0) && (Log() << Verbose(0) << "\t-m <0/1>\tCalculate (0)/ Align in(1) PAS with greatest EV along z axis." << endl);
     1533            DoLog(0) && (Log() << Verbose(0) << "\t-M <basis>\tSetting basis to store to MPQC config files." << endl);
     1534            DoLog(0) && (Log() << Verbose(0) << "\t-n\tFast parsing (i.e. no trajectories are looked for)." << endl);
     1535            DoLog(0) && (Log() << Verbose(0) << "\t-N <radius> <file>\tGet non-convex-envelope." << endl);
     1536            DoLog(0) && (Log() << Verbose(0) << "\t-o <out>\tGet volume of the convex envelope (and store to tecplot file)." << endl);
     1537            DoLog(0) && (Log() << Verbose(0) << "\t-O\tCenter atoms in origin." << endl);
     1538            DoLog(0) && (Log() << Verbose(0) << "\t-p <file>\tParse given xyz file and create raw config file from it." << endl);
     1539            DoLog(0) && (Log() << Verbose(0) << "\t-P <file>\tParse given forces file and append as an MD step to config file via Verlet." << endl);
     1540            DoLog(0) && (Log() << Verbose(0) << "\t-r <id>\t\tRemove an atom with given id." << endl);
     1541            DoLog(0) && (Log() << Verbose(0) << "\t-R <id> <radius>\t\tRemove all atoms out of sphere around a given one." << endl);
     1542            DoLog(0) && (Log() << Verbose(0) << "\t-s x1 x2 x3\tScale all atom coordinates by this vector (x1,x2,x3)." << endl);
     1543            DoLog(0) && (Log() << Verbose(0) << "\t-S <file> Store temperatures from the config file in <file>." << endl);
     1544            DoLog(0) && (Log() << Verbose(0) << "\t-t x1 x2 x3\tTranslate all atoms by this vector (x1,x2,x3)." << endl);
     1545            DoLog(0) && (Log() << Verbose(0) << "\t-T x1 x2 x3\tTranslate periodically all atoms by this vector (x1,x2,x3)." << endl);
     1546            DoLog(0) && (Log() << Verbose(0) << "\t-u rho\tsuspend in water solution and output necessary cell lengths, average density rho and repetition." << endl);
     1547            DoLog(0) && (Log() << Verbose(0) << "\t-v\t\tsets verbosity (more is more)." << endl);
     1548            DoLog(0) && (Log() << Verbose(0) << "\t-V\t\tGives version information." << endl);
     1549            DoLog(0) && (Log() << Verbose(0) << "\t-X\t\tset default name of a molecule." << endl);
     1550            DoLog(0) && (Log() << Verbose(0) << "Note: config files must not begin with '-' !" << endl);
    14831551            return (1);
    14841552            break;
     
    14881556            }
    14891557            setVerbosity(verbosity);
    1490             Log() << Verbose(0) << "Setting verbosity to " << verbosity << "." << endl;
     1558            DoLog(0) && (Log() << Verbose(0) << "Setting verbosity to " << verbosity << "." << endl);
    14911559            break;
    14921560          case 'V':
    1493             Log() << Verbose(0) << argv[0] << " " << VERSIONSTRING << endl;
    1494             Log() << Verbose(0) << "Build your own molecule position set." << endl;
     1561            DoLog(0) && (Log() << Verbose(0) << argv[0] << " " << VERSIONSTRING << endl);
     1562            DoLog(0) && (Log() << Verbose(0) << "Build your own molecule position set." << endl);
    14951563            return (1);
     1564            break;
     1565          case 'B':
     1566            if (ExitFlag == 0) ExitFlag = 1;
     1567            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])) ) {
     1568              ExitFlag = 255;
     1569              DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for bounding in box: -B <xx> <xy> <xz> <yy> <yz> <zz>" << endl);
     1570              performCriticalExit();
     1571            } else {
     1572              SaveFlag = true;
     1573              j = -1;
     1574              DoLog(1) && (Log() << Verbose(1) << "Centering atoms in config file within given simulation box." << endl);
     1575              double * const cell_size = World::get()->cell_size;
     1576              for (int i=0;i<6;i++) {
     1577                cell_size[i] = atof(argv[argptr+i]);
     1578              }
     1579              argptr+=6;
     1580            }
    14961581            break;
    14971582          case 'e':
    14981583            if ((argptr >= argc) || (argv[argptr][0] == '-')) {
    1499               eLog() << Verbose(0) << "Not enough or invalid arguments for specifying element db: -e <db file>" << endl;
     1584              DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments for specifying element db: -e <db file>" << endl);
    15001585              performCriticalExit();
    15011586            } else {
    1502               Log() << Verbose(0) << "Using " << argv[argptr] << " as elements database." << endl;
     1587              DoLog(0) && (Log() << Verbose(0) << "Using " << argv[argptr] << " as elements database." << endl);
    15031588              strncpy (configuration.databasepath, argv[argptr], MAXSTRINGSIZE-1);
    15041589              argptr+=1;
     
    15071592          case 'g':
    15081593            if ((argptr >= argc) || (argv[argptr][0] == '-')) {
    1509               eLog() << Verbose(0) << "Not enough or invalid arguments for specifying bond length table: -g <table file>" << endl;
     1594              DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments for specifying bond length table: -g <table file>" << endl);
    15101595              performCriticalExit();
    15111596            } else {
    15121597              BondGraphFileName = argv[argptr];
    1513               Log() << Verbose(0) << "Using " << BondGraphFileName << " as bond length table." << endl;
     1598              DoLog(0) && (Log() << Verbose(0) << "Using " << BondGraphFileName << " as bond length table." << endl);
    15141599              argptr+=1;
    15151600            }
    15161601            break;
    15171602          case 'n':
    1518             Log() << Verbose(0) << "I won't parse trajectories." << endl;
     1603            DoLog(0) && (Log() << Verbose(0) << "I won't parse trajectories." << endl);
    15191604            configuration.FastParsing = true;
     1605            break;
     1606          case 'X':
     1607            {
     1608              char **name = &(World::get()->DefaultName);
     1609              delete[](*name);
     1610              const int length = strlen(argv[argptr]);
     1611              *name = new char[length+2];
     1612              strncpy(*name, argv[argptr], length);
     1613              DoLog(0) && (Log() << Verbose(0) << "Default name of new molecules set to " << *name << "." << endl);
     1614            }
    15201615            break;
    15211616          default:   // no match? Step on
     
    15291624    // 3a. Parse the element database
    15301625    if (periode->LoadPeriodentafel(configuration.databasepath)) {
    1531       Log() << Verbose(0) << "Element list loaded successfully." << endl;
     1626      DoLog(0) && (Log() << Verbose(0) << "Element list loaded successfully." << endl);
    15321627      //periode->Output();
    15331628    } else {
    1534       Log() << Verbose(0) << "Element list loading failed." << endl;
     1629      DoLog(0) && (Log() << Verbose(0) << "Element list loading failed." << endl);
    15351630      return 1;
    15361631    }
     
    15381633    if (argv[1][0] != '-') {
    15391634      // simply create a new molecule, wherein the config file is loaded and the manipulation takes place
    1540       Log() << Verbose(0) << "Config file given." << endl;
     1635      DoLog(0) && (Log() << Verbose(0) << "Config file given." << endl);
    15411636      test.open(argv[1], ios::in);
    15421637      if (test == NULL) {
     
    15441639        output.open(argv[1], ios::out);
    15451640        if (output == NULL) {
    1546           Log() << Verbose(1) << "Specified config file " << argv[1] << " not found." << endl;
     1641          DoLog(1) && (Log() << Verbose(1) << "Specified config file " << argv[1] << " not found." << endl);
    15471642          configPresent = absent;
    15481643        } else {
    1549           Log() << Verbose(0) << "Empty configuration file." << endl;
     1644          DoLog(0) && (Log() << Verbose(0) << "Empty configuration file." << endl);
    15501645          ConfigFileName = argv[1];
    15511646          configPresent = empty;
     
    15551650        test.close();
    15561651        ConfigFileName = argv[1];
    1557         Log() << Verbose(1) << "Specified config file found, parsing ... ";
     1652        DoLog(1) && (Log() << Verbose(1) << "Specified config file found, parsing ... ");
    15581653        switch (configuration.TestSyntax(ConfigFileName, periode)) {
    15591654          case 1:
    1560             Log() << Verbose(0) << "new syntax." << endl;
     1655            DoLog(0) && (Log() << Verbose(0) << "new syntax." << endl);
    15611656            configuration.Load(ConfigFileName, BondGraphFileName, periode, molecules);
    15621657            configPresent = present;
    15631658            break;
    15641659          case 0:
    1565             Log() << Verbose(0) << "old syntax." << endl;
     1660            DoLog(0) && (Log() << Verbose(0) << "old syntax." << endl);
    15661661            configuration.LoadOld(ConfigFileName, BondGraphFileName, periode, molecules);
    15671662            configPresent = present;
    15681663            break;
    15691664          default:
    1570             Log() << Verbose(0) << "Unknown syntax or empty, yet present file." << endl;
     1665            DoLog(0) && (Log() << Verbose(0) << "Unknown syntax or empty, yet present file." << endl);
    15711666            configPresent = empty;
    15721667       }
     
    15921687       configuration.BG = new BondGraph(configuration.GetIsAngstroem());
    15931688       if ((!BondGraphFileName.empty()) && (configuration.BG->LoadBondLengthTable(BondGraphFileName))) {
    1594          Log() << Verbose(0) << "Bond length table loaded successfully." << endl;
     1689         DoLog(0) && (Log() << Verbose(0) << "Bond length table loaded successfully." << endl);
    15951690       } else {
    1596          eLog() << Verbose(1) << "Bond length table loading failed." << endl;
     1691         DoeLog(1) && (eLog()<< Verbose(1) << "Bond length table loading failed." << endl);
    15971692       }
    15981693     }
     
    16011696    argptr = 1;
    16021697    do {
    1603       Log() << Verbose(0) << "Current Command line argument: " << argv[argptr] << "." << endl;
     1698      DoLog(0) && (Log() << Verbose(0) << "Current Command line argument: " << argv[argptr] << "." << endl);
    16041699      if (argv[argptr][0] == '-') {
    16051700        argptr++;
     
    16101705              if ((argptr >= argc) || (argv[argptr][0] == '-')) {
    16111706                ExitFlag = 255;
    1612                 eLog() << Verbose(0) << "Not enough arguments for parsing: -p <xyz file>" << endl;
     1707                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough arguments for parsing: -p <xyz file>" << endl);
    16131708                performCriticalExit();
    16141709              } else {
    16151710                SaveFlag = true;
    1616                 Log() << Verbose(1) << "Parsing xyz file for new atoms." << endl;
     1711                DoLog(1) && (Log() << Verbose(1) << "Parsing xyz file for new atoms." << endl);
    16171712                if (!mol->AddXYZFile(argv[argptr]))
    1618                   Log() << Verbose(2) << "File not found." << endl;
     1713                  DoLog(2) && (Log() << Verbose(2) << "File not found." << endl);
    16191714                else {
    1620                   Log() << Verbose(2) << "File found and parsed." << endl;
     1715                  DoLog(2) && (Log() << Verbose(2) << "File found and parsed." << endl);
    16211716                  configPresent = present;
    16221717                }
     
    16271722              if ((argptr >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) || (!IsValidNumber(argv[argptr+3]))) {
    16281723                ExitFlag = 255;
    1629                 eLog() << Verbose(0) << "Not enough or invalid arguments for adding atom: -a <element> <x> <y> <z>" << endl;
     1724                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments for adding atom: -a <element> <x> <y> <z>" << endl);
    16301725                performCriticalExit();
    16311726              } else {
    16321727                SaveFlag = true;
    1633                 Log() << Verbose(1) << "Adding new atom with element " << argv[argptr] << " at (" << argv[argptr+1] << "," << argv[argptr+2] << "," << argv[argptr+3] << "), ";
     1728                DoLog(1) && (Log() << Verbose(1) << "Adding new atom with element " << argv[argptr] << " at (" << argv[argptr+1] << "," << argv[argptr+2] << "," << argv[argptr+3] << "), ");
    16341729                first = new atom;
    16351730                first->type = periode->FindElement(atoi(argv[argptr]));
    16361731                if (first->type != NULL)
    1637                   Log() << Verbose(2) << "found element " << first->type->name << endl;
     1732                  DoLog(2) && (Log() << Verbose(2) << "found element " << first->type->name << endl);
    16381733                for (int i=NDIM;i--;)
    16391734                  first->x.x[i] = atof(argv[argptr+1+i]);
     
    16431738                    configPresent = present;
    16441739                } else
    1645                   eLog() << Verbose(1) << "Could not find the specified element." << endl;
     1740                  DoeLog(1) && (eLog()<< Verbose(1) << "Could not find the specified element." << endl);
    16461741                argptr+=4;
    16471742              }
     
    16561751              if ((argptr >= argc) || (argv[argptr][0] == '-')) {
    16571752                ExitFlag = 255;
    1658                 eLog() << Verbose(0) << "Not enough or invalid arguments given for setting MPQC basis: -B <basis name>" << endl;
     1753                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for setting MPQC basis: -B <basis name>" << endl);
    16591754                performCriticalExit();
    16601755              } else {
    16611756                configuration.basis = argv[argptr];
    1662                 Log() << Verbose(1) << "Setting MPQC basis to " << configuration.basis << "." << endl;
     1757                DoLog(1) && (Log() << Verbose(1) << "Setting MPQC basis to " << configuration.basis << "." << endl);
    16631758                argptr+=1;
    16641759              }
     
    16671762              if (ExitFlag == 0) ExitFlag = 1;
    16681763              {
    1669                 Log() << Verbose(1) << "Depth-First-Search Analysis." << endl;
     1764                DoLog(1) && (Log() << Verbose(1) << "Depth-First-Search Analysis." << endl);
    16701765                MoleculeLeafClass *Subgraphs = NULL;      // list of subgraphs from DFS analysis
    16711766                int *MinimumRingSize = new int[mol->AtomCount];
     
    16981793              break;
    16991794            case 'I':
    1700               Log() << Verbose(1) << "Dissecting molecular system into a set of disconnected subgraphs ... " << endl;
     1795              DoLog(1) && (Log() << Verbose(1) << "Dissecting molecular system into a set of disconnected subgraphs ... " << endl);
    17011796              // @TODO rather do the dissection afterwards
    17021797              molecules->DissectMoleculeIntoConnectedSubgraphs(periode, &configuration);
     
    17091804                  }
    17101805              }
    1711               if (mol == NULL) {
     1806              if ((mol == NULL) && (!molecules->ListOfMolecules.empty())) {
    17121807                mol = *(molecules->ListOfMolecules.begin());
    1713                 mol->ActiveFlag = true;
     1808                if (mol != NULL)
     1809                  mol->ActiveFlag = true;
    17141810              }
    17151811              break;
    17161812            case 'C':
    1717               if (ExitFlag == 0) ExitFlag = 1;
    1718               if ((argptr >= argc)) {
    1719                 ExitFlag = 255;
    1720                 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;
    1721                 performCriticalExit();
    1722               } else {
    1723                 switch(argv[argptr][0]) {
    1724                   case 'E':
    1725                     {
    1726                       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] == '-')) {
    1727                         ExitFlag = 255;
    1728                         eLog() << Verbose(0) << "Not enough or invalid arguments given for pair correlation analysis: -C E <Z1> <Z2> <output> <bin output>" << endl;
    1729                         performCriticalExit();
    1730                       } else {
    1731                         ofstream output(argv[argptr+3]);
    1732                         ofstream binoutput(argv[argptr+4]);
    1733                         const double BinStart = atof(argv[argptr+5]);
    1734                         const double BinEnd = atof(argv[argptr+6]);
    1735 
    1736                         element *elemental = periode->FindElement((const int) atoi(argv[argptr+1]));
    1737                         element *elemental2 = periode->FindElement((const int) atoi(argv[argptr+2]));
    1738                         PairCorrelationMap *correlationmap = PairCorrelation(molecules, elemental, elemental2);
    1739                         //OutputCorrelationToSurface(&output, correlationmap);
    1740                         BinPairMap *binmap = BinData( correlationmap, 0.5, BinStart, BinEnd );
    1741                         OutputCorrelation ( &binoutput, binmap );
    1742                         output.close();
    1743                         binoutput.close();
    1744                         delete(binmap);
    1745                         delete(correlationmap);
    1746                         argptr+=7;
     1813              {
     1814                int ranges[3] = {1, 1, 1};
     1815                bool periodic = (argv[argptr-1][2] =='p');
     1816                if (ExitFlag == 0) ExitFlag = 1;
     1817                if ((argptr >= argc)) {
     1818                  ExitFlag = 255;
     1819                  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);
     1820                  performCriticalExit();
     1821                } else {
     1822                  switch(argv[argptr][0]) {
     1823                    case 'E':
     1824                      {
     1825                        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] == '-')) {
     1826                          ExitFlag = 255;
     1827                          DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for pair correlation analysis: -C E <Z1> <Z2> <output> <bin output>" << endl);
     1828                          performCriticalExit();
     1829                        } else {
     1830                          ofstream output(argv[argptr+3]);
     1831                          ofstream binoutput(argv[argptr+4]);
     1832                          const double BinStart = atof(argv[argptr+5]);
     1833                          const double BinEnd = atof(argv[argptr+6]);
     1834
     1835                          element *elemental = periode->FindElement((const int) atoi(argv[argptr+1]));
     1836                          element *elemental2 = periode->FindElement((const int) atoi(argv[argptr+2]));
     1837                          PairCorrelationMap *correlationmap = NULL;
     1838                          if (periodic)
     1839                            correlationmap = PeriodicPairCorrelation(molecules, elemental, elemental2, ranges);
     1840                          else
     1841                            correlationmap = PairCorrelation(molecules, elemental, elemental2);
     1842                          //OutputCorrelationToSurface(&output, correlationmap);
     1843                          BinPairMap *binmap = BinData( correlationmap, 0.5, BinStart, BinEnd );
     1844                          OutputCorrelation ( &binoutput, binmap );
     1845                          output.close();
     1846                          binoutput.close();
     1847                          delete(binmap);
     1848                          delete(correlationmap);
     1849                          argptr+=7;
     1850                        }
    17471851                      }
    1748                     }
    1749                     break;
    1750 
    1751                   case 'P':
    1752                     {
    1753                       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] == '-')) {
    1754                         ExitFlag = 255;
    1755                         eLog() << Verbose(0) << "Not enough or invalid arguments given for pair correlation analysis: -C P <Z1> <x> <y> <z> <output> <bin output>" << endl;
    1756                         performCriticalExit();
    1757                       } else {
    1758                         ofstream output(argv[argptr+5]);
    1759                         ofstream binoutput(argv[argptr+6]);
    1760                         const double BinStart = atof(argv[argptr+7]);
    1761                         const double BinEnd = atof(argv[argptr+8]);
    1762 
    1763                         element *elemental = periode->FindElement((const int) atoi(argv[argptr+1]));
    1764                         Vector *Point = new Vector((const double) atof(argv[argptr+1]),(const double) atof(argv[argptr+2]),(const double) atof(argv[argptr+3]));
    1765                         CorrelationToPointMap *correlationmap = CorrelationToPoint(molecules, elemental, Point);
    1766                         //OutputCorrelationToSurface(&output, correlationmap);
    1767                         BinPairMap *binmap = BinData( correlationmap, 0.5, BinStart, BinEnd );
    1768                         OutputCorrelation ( &binoutput, binmap );
    1769                         output.close();
    1770                         binoutput.close();
    1771                         delete(Point);
    1772                         delete(binmap);
    1773                         delete(correlationmap);
    1774                         argptr+=9;
     1852                      break;
     1853
     1854                    case 'P':
     1855                      {
     1856                        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] == '-')) {
     1857                          ExitFlag = 255;
     1858                          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);
     1859                          performCriticalExit();
     1860                        } else {
     1861                          ofstream output(argv[argptr+5]);
     1862                          ofstream binoutput(argv[argptr+6]);
     1863                          const double BinStart = atof(argv[argptr+7]);
     1864                          const double BinEnd = atof(argv[argptr+8]);
     1865
     1866                          element *elemental = periode->FindElement((const int) atoi(argv[argptr+1]));
     1867                          Vector *Point = new Vector((const double) atof(argv[argptr+1]),(const double) atof(argv[argptr+2]),(const double) atof(argv[argptr+3]));
     1868                          CorrelationToPointMap *correlationmap = NULL;
     1869                          if (periodic)
     1870                            correlationmap  = PeriodicCorrelationToPoint(molecules, elemental, Point, ranges);
     1871                          else
     1872                            correlationmap = CorrelationToPoint(molecules, elemental, Point);
     1873                          //OutputCorrelationToSurface(&output, correlationmap);
     1874                          BinPairMap *binmap = BinData( correlationmap, 0.5, BinStart, BinEnd );
     1875                          OutputCorrelation ( &binoutput, binmap );
     1876                          output.close();
     1877                          binoutput.close();
     1878                          delete(Point);
     1879                          delete(binmap);
     1880                          delete(correlationmap);
     1881                          argptr+=9;
     1882                        }
    17751883                      }
    1776                     }
    1777                     break;
    1778 
    1779                   case 'S':
    1780                     {
    1781                       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] == '-')) {
    1782                         ExitFlag = 255;
    1783                         eLog() << Verbose(0) << "Not enough or invalid arguments given for pair correlation analysis: -C S <Z> <output> <bin output> <BinWidth> <BinStart> <BinEnd>" << endl;
    1784                         performCriticalExit();
    1785                       } else {
    1786                         ofstream output(argv[argptr+2]);
    1787                         ofstream binoutput(argv[argptr+3]);
    1788                         const double radius = 4.;
    1789                         const double BinWidth = atof(argv[argptr+4]);
    1790                         const double BinStart = atof(argv[argptr+5]);
    1791                         const double BinEnd = atof(argv[argptr+6]);
    1792                         double LCWidth = 20.;
    1793                         if (BinEnd > 0) {
    1794                           if (BinEnd > 2.*radius)
    1795                               LCWidth = BinEnd;
     1884                      break;
     1885
     1886                    case 'S':
     1887                      {
     1888                        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] == '-')) {
     1889                          ExitFlag = 255;
     1890                          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);
     1891                          performCriticalExit();
     1892                        } else {
     1893                          ofstream output(argv[argptr+2]);
     1894                          ofstream binoutput(argv[argptr+3]);
     1895                          const double radius = 4.;
     1896                          const double BinWidth = atof(argv[argptr+4]);
     1897                          const double BinStart = atof(argv[argptr+5]);
     1898                          const double BinEnd = atof(argv[argptr+6]);
     1899                          double LCWidth = 20.;
     1900                          if (BinEnd > 0) {
     1901                            if (BinEnd > 2.*radius)
     1902                                LCWidth = BinEnd;
     1903                            else
     1904                              LCWidth = 2.*radius;
     1905                          }
     1906
     1907                          // get the boundary
     1908                          class molecule *Boundary = NULL;
     1909                          class Tesselation *TesselStruct = NULL;
     1910                          const LinkedCell *LCList = NULL;
     1911                          // find biggest molecule
     1912                          int counter  = 0;
     1913                          for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++) {
     1914                            if ((Boundary == NULL) || (Boundary->AtomCount < (*BigFinder)->AtomCount)) {
     1915                              Boundary = *BigFinder;
     1916                            }
     1917                            counter++;
     1918                          }
     1919                          bool *Actives = Malloc<bool>(counter, "ParseCommandLineOptions() - case C -- *Actives");
     1920                          counter = 0;
     1921                          for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++) {
     1922                            Actives[counter++] = (*BigFinder)->ActiveFlag;
     1923                            (*BigFinder)->ActiveFlag = (*BigFinder == Boundary) ? false : true;
     1924                          }
     1925                          LCList = new LinkedCell(Boundary, LCWidth);
     1926                          element *elemental = periode->FindElement((const int) atoi(argv[argptr+1]));
     1927                          FindNonConvexBorder(Boundary, TesselStruct, LCList, radius, NULL);
     1928                          CorrelationToSurfaceMap *surfacemap = NULL;
     1929                          if (periodic)
     1930                            surfacemap = PeriodicCorrelationToSurface( molecules, elemental, TesselStruct, LCList, ranges);
    17961931                          else
    1797                             LCWidth = 2.*radius;
     1932                            surfacemap = CorrelationToSurface( molecules, elemental, TesselStruct, LCList);
     1933                          OutputCorrelationToSurface(&output, surfacemap);
     1934                          // check whether radius was appropriate
     1935                          {
     1936                            double start; double end;
     1937                            GetMinMax( surfacemap, start, end);
     1938                            if (LCWidth < end)
     1939                              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);
     1940                          }
     1941                          BinPairMap *binmap = BinData( surfacemap, BinWidth, BinStart, BinEnd );
     1942                          OutputCorrelation ( &binoutput, binmap );
     1943                          output.close();
     1944                          binoutput.close();
     1945                          for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++)
     1946                            (*BigFinder)->ActiveFlag = Actives[counter++];
     1947                          Free(&Actives);
     1948                          delete(LCList);
     1949                          delete(TesselStruct);
     1950                          delete(binmap);
     1951                          delete(surfacemap);
     1952                          argptr+=7;
    17981953                        }
    1799 
    1800                         // get the boundary
    1801                         class molecule *Boundary = NULL;
    1802                         class Tesselation *TesselStruct = NULL;
    1803                         const LinkedCell *LCList = NULL;
    1804                         // find biggest molecule
    1805                         int counter  = 0;
    1806                         for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++) {
    1807                           if ((Boundary == NULL) || (Boundary->AtomCount < (*BigFinder)->AtomCount)) {
    1808                             Boundary = *BigFinder;
    1809                           }
    1810                           counter++;
    1811                         }
    1812                         bool *Actives = Malloc<bool>(counter, "ParseCommandLineOptions() - case C -- *Actives");
    1813                         counter = 0;
    1814                         for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++) {
    1815                           Actives[counter++] = (*BigFinder)->ActiveFlag;
    1816                           (*BigFinder)->ActiveFlag = (*BigFinder == Boundary) ? false : true;
    1817                         }
    1818                         LCList = new LinkedCell(Boundary, LCWidth);
    1819                         element *elemental = periode->FindElement((const int) atoi(argv[argptr+1]));
    1820                         FindNonConvexBorder(Boundary, TesselStruct, LCList, radius, NULL);
    1821                         //int ranges[NDIM] = {1,1,1};
    1822                         CorrelationToSurfaceMap *surfacemap = CorrelationToSurface( molecules, elemental, TesselStruct, LCList); // for Periodic..(): ..., ranges );
    1823                         OutputCorrelationToSurface(&output, surfacemap);
    1824                         // check whether radius was appropriate
    1825                         {
    1826                         double start; double end;
    1827                         GetMinMax( surfacemap, start, end);
    1828                         if (LCWidth < end)
    1829                           eLog() << Verbose(1) << "Linked Cell width is smaller than the found range of values! Bins can only be correct up to: " << radius << "." << endl;
    1830                         }
    1831                         BinPairMap *binmap = BinData( surfacemap, BinWidth, BinStart, BinEnd );
    1832                         OutputCorrelation ( &binoutput, binmap );
    1833                         output.close();
    1834                         binoutput.close();
    1835                         for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++)
    1836                           (*BigFinder)->ActiveFlag = Actives[counter++];
    1837                         Free(&Actives);
    1838                         delete(LCList);
    1839                         delete(TesselStruct);
    1840                         delete(binmap);
    1841                         delete(surfacemap);
    1842                         argptr+=7;
    18431954                      }
    1844                     }
    1845                     break;
    1846 
    1847                   default:
    1848                     ExitFlag = 255;
    1849                     eLog() << Verbose(0) << "Invalid type given for pair correlation analysis: -C <type: E/P/S> [more params] <output> <bin output>" << endl;
    1850                     performCriticalExit();
    1851                     break;
     1955                      break;
     1956
     1957                    default:
     1958                      ExitFlag = 255;
     1959                      DoeLog(0) && (eLog()<< Verbose(0) << "Invalid type given for pair correlation analysis: -C <type: E/P/S> [more params] <output> <bin output>" << endl);
     1960                      performCriticalExit();
     1961                      break;
     1962                  }
    18521963                }
    1853               }
    1854               break;
     1964                break;
     1965              }
    18551966            case 'E':
    18561967              if (ExitFlag == 0) ExitFlag = 1;
    18571968              if ((argptr+1 >= argc) || (!IsValidNumber(argv[argptr])) || (argv[argptr+1][0] == '-')) {
    18581969                ExitFlag = 255;
    1859                 eLog() << Verbose(0) << "Not enough or invalid arguments given for changing element: -E <atom nr.> <element>" << endl;
     1970                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for changing element: -E <atom nr.> <element>" << endl);
    18601971                performCriticalExit();
    18611972              } else {
    18621973                SaveFlag = true;
    1863                 Log() << Verbose(1) << "Changing atom " << argv[argptr] << " to element " << argv[argptr+1] << "." << endl;
     1974                DoLog(1) && (Log() << Verbose(1) << "Changing atom " << argv[argptr] << " to element " << argv[argptr+1] << "." << endl);
    18641975                first = mol->FindAtom(atoi(argv[argptr]));
    18651976                first->type = periode->FindElement(atoi(argv[argptr+1]));
     
    18701981              if (ExitFlag == 0) ExitFlag = 1;
    18711982              MaxDistance = -1;
    1872               if (argv[argptr-1][2] == 'F') {
     1983              if (argv[argptr-1][2] == 'F') { // option is -FF?
    18731984                // fetch first argument as max distance to surface
    18741985                MaxDistance = atof(argv[argptr++]);
    1875                 Log() << Verbose(0) << "Filling with maximum layer distance of " << MaxDistance << "." << endl;
     1986                DoLog(0) && (Log() << Verbose(0) << "Filling with maximum layer distance of " << MaxDistance << "." << endl);
    18761987              }
    18771988              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]))) {
    18781989                ExitFlag = 255;
    1879                 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;
     1990                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);
    18801991                performCriticalExit();
    18811992              } else {
    18821993                SaveFlag = true;
    1883                 Log() << Verbose(1) << "Filling Box with water molecules." << endl;
     1994                DoLog(1) && (Log() << Verbose(1) << "Filling Box with water molecules." << endl);
    18841995                // construct water molecule
    18851996                molecule *filler = new molecule(periode);
    18861997                if (!filler->AddXYZFile(argv[argptr])) {
    1887                   eLog() << Verbose(0) << "Could not parse filler molecule from " << argv[argptr] << "." << endl;
     1998                  DoeLog(0) && (eLog()<< Verbose(0) << "Could not parse filler molecule from " << argv[argptr] << "." << endl);
    18881999                }
    18892000                filler->SetNameFromFilename(argv[argptr]);
     
    19072018              if ((argptr >= argc) || (argv[argptr][0] == '-')) {
    19082019                ExitFlag =255;
    1909                 eLog() << Verbose(0) << "Missing source file for bonds in molecule: -A <bond sourcefile>" << endl;
     2020                DoeLog(0) && (eLog()<< Verbose(0) << "Missing source file for bonds in molecule: -A <bond sourcefile>" << endl);
    19102021                performCriticalExit();
    19112022              } else {
    1912                 Log() << Verbose(0) << "Parsing bonds from " << argv[argptr] << "." << endl;
     2023                DoLog(0) && (Log() << Verbose(0) << "Parsing bonds from " << argv[argptr] << "." << endl);
    19132024                ifstream *input = new ifstream(argv[argptr]);
    19142025                mol->CreateAdjacencyListFromDbondFile(input);
     
    19222033              if ((argptr >= argc) || (argv[argptr][0] == '-')) {
    19232034                ExitFlag =255;
    1924                 eLog() << Verbose(0) << "Missing path of adjacency file: -j <path>" << endl;
     2035                DoeLog(0) && (eLog()<< Verbose(0) << "Missing path of adjacency file: -j <path>" << endl);
    19252036                performCriticalExit();
    19262037              } else {
    1927                 Log() << Verbose(0) << "Storing adjacency to path " << argv[argptr] << "." << endl;
     2038                DoLog(0) && (Log() << Verbose(0) << "Storing adjacency to path " << argv[argptr] << "." << endl);
    19282039                configuration.BG->ConstructBondGraph(mol);
    1929                 mol->StoreAdjacencyToFile(argv[argptr]);
     2040                mol->StoreAdjacencyToFile(NULL, argv[argptr]);
    19302041                argptr+=1;
    19312042              }
     
    19362047              if ((argptr >= argc) || (argv[argptr][0] == '-')) {
    19372048                ExitFlag =255;
    1938                 eLog() << Verbose(0) << "Missing path of bonds file: -j <path>" << endl;
     2049                DoeLog(0) && (eLog()<< Verbose(0) << "Missing path of bonds file: -j <path>" << endl);
    19392050                performCriticalExit();
    19402051              } else {
    1941                 Log() << Verbose(0) << "Storing bonds to path " << argv[argptr] << "." << endl;
     2052                DoLog(0) && (Log() << Verbose(0) << "Storing bonds to path " << argv[argptr] << "." << endl);
    19422053                configuration.BG->ConstructBondGraph(mol);
    1943                 mol->StoreBondsToFile(argv[argptr]);
     2054                mol->StoreBondsToFile(NULL, argv[argptr]);
    19442055                argptr+=1;
    19452056              }
     
    19502061              if ((argptr+1 >= argc) || (argv[argptr+1][0] == '-')){
    19512062                ExitFlag = 255;
    1952                 eLog() << Verbose(0) << "Not enough or invalid arguments given for non-convex envelope: -o <radius> <tecplot output file>" << endl;
     2063                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for non-convex envelope: -o <radius> <tecplot output file>" << endl);
    19532064                performCriticalExit();
    19542065              } else {
     
    19582069                //string filename(argv[argptr+1]);
    19592070                //filename.append(".csv");
    1960                 Log() << Verbose(0) << "Evaluating non-convex envelope of biggest molecule.";
    1961                 Log() << Verbose(1) << "Using rolling ball of radius " << atof(argv[argptr]) << " and storing tecplot data in " << argv[argptr+1] << "." << endl;
     2071                DoLog(0) && (Log() << Verbose(0) << "Evaluating non-convex envelope of biggest molecule.");
     2072                DoLog(1) && (Log() << Verbose(1) << "Using rolling ball of radius " << atof(argv[argptr]) << " and storing tecplot data in " << argv[argptr+1] << "." << endl);
    19622073                // find biggest molecule
    19632074                int counter  = 0;
     
    19692080                  counter++;
    19702081                }
    1971                 Log() << Verbose(1) << "Biggest molecule has " << Boundary->AtomCount << " atoms." << endl;
     2082                DoLog(1) && (Log() << Verbose(1) << "Biggest molecule has " << Boundary->AtomCount << " atoms." << endl);
    19722083                start = clock();
    19732084                LCList = new LinkedCell(Boundary, atof(argv[argptr])*2.);
     
    19762087                //FindDistributionOfEllipsoids(T, &LCList, N, number, filename.c_str());
    19772088                end = clock();
    1978                 Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl;
     2089                DoLog(0) && (Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl);
    19792090                delete(LCList);
    19802091                delete(T);
     
    19862097              if ((argptr >= argc) || (argv[argptr][0] == '-')) {
    19872098                ExitFlag = 255;
    1988                 eLog() << Verbose(0) << "Not enough or invalid arguments given for storing tempature: -S <temperature file>" << endl;
     2099                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for storing tempature: -S <temperature file>" << endl);
    19892100                performCriticalExit();
    19902101              } else {
    1991                 Log() << Verbose(1) << "Storing temperatures in " << argv[argptr] << "." << endl;
     2102                DoLog(1) && (Log() << Verbose(1) << "Storing temperatures in " << argv[argptr] << "." << endl);
    19922103                ofstream *output = new ofstream(argv[argptr], ios::trunc);
    19932104                if (!mol->OutputTemperatureFromTrajectories(output, 0, mol->MDSteps))
    1994                   Log() << Verbose(2) << "File could not be written." << endl;
     2105                  DoLog(2) && (Log() << Verbose(2) << "File could not be written." << endl);
    19952106                else
    1996                   Log() << Verbose(2) << "File stored." << endl;
     2107                  DoLog(2) && (Log() << Verbose(2) << "File stored." << endl);
    19972108                output->close();
    19982109                delete(output);
     
    20042115              if ((argptr >= argc) || (argv[argptr][0] == '-')) {
    20052116                ExitFlag = 255;
    2006                 eLog() << Verbose(0) << "Not enough or invalid arguments given for storing tempature: -L <step0> <step1> <prefix> <identity mapping?>" << endl;
     2117                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for storing tempature: -L <step0> <step1> <prefix> <identity mapping?>" << endl);
    20072118                performCriticalExit();
    20082119              } else {
    20092120                SaveFlag = true;
    2010                 Log() << Verbose(1) << "Linear interpolation between configuration " << argv[argptr] << " and " << argv[argptr+1] << "." << endl;
     2121                DoLog(1) && (Log() << Verbose(1) << "Linear interpolation between configuration " << argv[argptr] << " and " << argv[argptr+1] << "." << endl);
    20112122                if (atoi(argv[argptr+3]) == 1)
    2012                   Log() << Verbose(1) << "Using Identity for the permutation map." << endl;
     2123                  DoLog(1) && (Log() << Verbose(1) << "Using Identity for the permutation map." << endl);
    20132124                if (!mol->LinearInterpolationBetweenConfiguration(atoi(argv[argptr]), atoi(argv[argptr+1]), argv[argptr+2], configuration, atoi(argv[argptr+3])) == 1 ? true : false)
    2014                   Log() << Verbose(2) << "Could not store " << argv[argptr+2] << " files." << endl;
     2125                  DoLog(2) && (Log() << Verbose(2) << "Could not store " << argv[argptr+2] << " files." << endl);
    20152126                else
    2016                   Log() << Verbose(2) << "Steps created and " << argv[argptr+2] << " files stored." << endl;
     2127                  DoLog(2) && (Log() << Verbose(2) << "Steps created and " << argv[argptr+2] << " files stored." << endl);
    20172128                argptr+=4;
    20182129              }
     
    20222133              if ((argptr >= argc) || (argv[argptr][0] == '-')) {
    20232134                ExitFlag = 255;
    2024                 eLog() << Verbose(0) << "Not enough or invalid arguments given for parsing and integrating forces: -P <forces file>" << endl;
     2135                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for parsing and integrating forces: -P <forces file>" << endl);
    20252136                performCriticalExit();
    20262137              } else {
    20272138                SaveFlag = true;
    2028                 Log() << Verbose(1) << "Parsing forces file and Verlet integrating." << endl;
     2139                DoLog(1) && (Log() << Verbose(1) << "Parsing forces file and Verlet integrating." << endl);
    20292140                if (!mol->VerletForceIntegration(argv[argptr], configuration))
    2030                   Log() << Verbose(2) << "File not found." << endl;
     2141                  DoLog(2) && (Log() << Verbose(2) << "File not found." << endl);
    20312142                else
    2032                   Log() << Verbose(2) << "File found and parsed." << endl;
     2143                  DoLog(2) && (Log() << Verbose(2) << "File found and parsed." << endl);
    20332144                argptr+=1;
    20342145              }
     
    20382149              if ((argptr+1 >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])))  {
    20392150                ExitFlag = 255;
    2040                 eLog() << Verbose(0) << "Not enough or invalid arguments given for removing atoms: -R <id> <distance>" << endl;
     2151                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for removing atoms: -R <id> <distance>" << endl);
    20412152                performCriticalExit();
    20422153              } else {
    20432154                SaveFlag = true;
    2044                 Log() << Verbose(1) << "Removing atoms around " << argv[argptr] << " with radius " << argv[argptr+1] << "." << endl;
     2155                DoLog(1) && (Log() << Verbose(1) << "Removing atoms around " << argv[argptr] << " with radius " << argv[argptr+1] << "." << endl);
    20452156                double tmp1 = atof(argv[argptr+1]);
    20462157                atom *third = mol->FindAtom(atoi(argv[argptr]));
     
    20552166                  }
    20562167                } else {
    2057                   eLog() << Verbose(1) << "Removal failed due to missing atoms on molecule or wrong id." << endl;
     2168                  DoeLog(1) && (eLog()<< Verbose(1) << "Removal failed due to missing atoms on molecule or wrong id." << endl);
    20582169                }
    20592170                argptr+=2;
     
    20642175              if ((argptr+2 >= argc) || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) {
    20652176                ExitFlag = 255;
    2066                 eLog() << Verbose(0) << "Not enough or invalid arguments given for translation: -t <x> <y> <z>" << endl;
     2177                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for translation: -t <x> <y> <z>" << endl);
    20672178                performCriticalExit();
    20682179              } else {
    20692180                if (ExitFlag == 0) ExitFlag = 1;
    20702181                SaveFlag = true;
    2071                 Log() << Verbose(1) << "Translating all ions by given vector." << endl;
     2182                DoLog(1) && (Log() << Verbose(1) << "Translating all ions by given vector." << endl);
    20722183                for (int i=NDIM;i--;)
    20732184                  x.x[i] = atof(argv[argptr+i]);
     
    20802191              if ((argptr+2 >= argc) || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) {
    20812192                ExitFlag = 255;
    2082                 eLog() << Verbose(0) << "Not enough or invalid arguments given for periodic translation: -T <x> <y> <z>" << endl;
     2193                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for periodic translation: -T <x> <y> <z>" << endl);
    20832194                performCriticalExit();
    20842195              } else {
    20852196                if (ExitFlag == 0) ExitFlag = 1;
    20862197                SaveFlag = true;
    2087                 Log() << Verbose(1) << "Translating all ions periodically by given vector." << endl;
     2198                DoLog(1) && (Log() << Verbose(1) << "Translating all ions periodically by given vector." << endl);
    20882199                for (int i=NDIM;i--;)
    20892200                  x.x[i] = atof(argv[argptr+i]);
     
    20962207              if ((argptr >= argc) || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) {
    20972208                ExitFlag = 255;
    2098                 eLog() << Verbose(0) << "Not enough or invalid arguments given for scaling: -s <factor_x> [factor_y] [factor_z]" << endl;
     2209                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for scaling: -s <factor_x> [factor_y] [factor_z]" << endl);
    20992210                performCriticalExit();
    21002211              } else {
    21012212                SaveFlag = true;
    21022213                j = -1;
    2103                 Log() << Verbose(1) << "Scaling all ion positions by factor." << endl;
     2214                DoLog(1) && (Log() << Verbose(1) << "Scaling all ion positions by factor." << endl);
    21042215                factor = new double[NDIM];
    21052216                factor[0] = atof(argv[argptr]);
     
    21212232              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])) ) {
    21222233                ExitFlag = 255;
    2123                 eLog() << Verbose(0) << "Not enough or invalid arguments given for centering in box: -b <xx> <xy> <xz> <yy> <yz> <zz>" << endl;
     2234                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for centering in box: -b <xx> <xy> <xz> <yy> <yz> <zz>" << endl);
    21242235                performCriticalExit();
    21252236              } else {
    21262237                SaveFlag = true;
    21272238                j = -1;
    2128                 Log() << Verbose(1) << "Centering atoms in config file within given simulation box." << endl;
     2239                DoLog(1) && (Log() << Verbose(1) << "Centering atoms in config file within given simulation box." << endl);
    21292240                double * const cell_size = World::get()->cell_size;
    21302241                for (int i=0;i<6;i++) {
     
    21402251              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])) ) {
    21412252                ExitFlag = 255;
    2142                 eLog() << Verbose(0) << "Not enough or invalid arguments given for bounding in box: -B <xx> <xy> <xz> <yy> <yz> <zz>" << endl;
     2253                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for bounding in box: -B <xx> <xy> <xz> <yy> <yz> <zz>" << endl);
    21432254                performCriticalExit();
    21442255              } else {
    21452256                SaveFlag = true;
    21462257                j = -1;
    2147                 Log() << Verbose(1) << "Centering atoms in config file within given simulation box." << endl;
     2258                DoLog(1) && (Log() << Verbose(1) << "Centering atoms in config file within given simulation box." << endl);
    21482259                double * const cell_size = World::get()->cell_size;
    21492260                for (int i=0;i<6;i++) {
     
    21592270              if ((argptr+2 >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) {
    21602271                ExitFlag = 255;
    2161                 eLog() << Verbose(0) << "Not enough or invalid arguments given for centering with boundary: -c <boundary_x> <boundary_y> <boundary_z>" << endl;
     2272                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for centering with boundary: -c <boundary_x> <boundary_y> <boundary_z>" << endl);
    21622273                performCriticalExit();
    21632274              } else {
    21642275                SaveFlag = true;
    21652276                j = -1;
    2166                 Log() << Verbose(1) << "Centering atoms in config file within given additional boundary." << endl;
     2277                DoLog(1) && (Log() << Verbose(1) << "Centering atoms in config file within given additional boundary." << endl);
    21672278                // make every coordinate positive
    21682279                mol->CenterEdge(&x);
     
    21842295              if (ExitFlag == 0) ExitFlag = 1;
    21852296              SaveFlag = true;
    2186               Log() << Verbose(1) << "Centering atoms on edge and setting box dimensions." << endl;
     2297              DoLog(1) && (Log() << Verbose(1) << "Centering atoms on edge and setting box dimensions." << endl);
    21872298              x.Zero();
    21882299              mol->CenterEdge(&x);
     
    21942305              if ((argptr >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])))  {
    21952306                ExitFlag = 255;
    2196                 eLog() << Verbose(0) << "Not enough or invalid arguments given for removing atoms: -r <id>" << endl;
     2307                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for removing atoms: -r <id>" << endl);
    21972308                performCriticalExit();
    21982309              } else {
    21992310                SaveFlag = true;
    2200                 Log() << Verbose(1) << "Removing atom " << argv[argptr] << "." << endl;
     2311                DoLog(1) && (Log() << Verbose(1) << "Removing atom " << argv[argptr] << "." << endl);
    22012312                atom *first = mol->FindAtom(atoi(argv[argptr]));
    22022313                mol->RemoveAtom(first);
     
    22082319              if ((argptr+1 >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1]))) {
    22092320                ExitFlag = 255;
    2210                 eLog() << Verbose(0) << "Not enough or invalid arguments for fragmentation: -f <max. bond distance> <bond order>" << endl;
     2321                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments for fragmentation: -f <max. bond distance> <bond order>" << endl);
    22112322                performCriticalExit();
    22122323              } else {
    2213                 Log() << Verbose(0) << "Fragmenting molecule with bond distance " << argv[argptr] << " angstroem, order of " << argv[argptr+1] << "." << endl;
    2214                 Log() << Verbose(0) << "Creating connection matrix..." << endl;
     2324                DoLog(0) && (Log() << Verbose(0) << "Fragmenting molecule with bond distance " << argv[argptr] << " angstroem, order of " << argv[argptr+1] << "." << endl);
     2325                DoLog(0) && (Log() << Verbose(0) << "Creating connection matrix..." << endl);
    22152326                start = clock();
    22162327                mol->CreateAdjacencyList(atof(argv[argptr++]), configuration.GetIsAngstroem(), &BondGraph::CovalentMinMaxDistance, NULL);
    2217                 Log() << Verbose(0) << "Fragmenting molecule with current connection matrix ..." << endl;
     2328                DoLog(0) && (Log() << Verbose(0) << "Fragmenting molecule with current connection matrix ..." << endl);
    22182329                if (mol->first->next != mol->last) {
    22192330                  ExitFlag = mol->FragmentMolecule(atoi(argv[argptr]), &configuration);
    22202331                }
    22212332                end = clock();
    2222                 Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl;
     2333                DoLog(0) && (Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl);
    22232334                argptr+=2;
    22242335              }
     
    22282339              j = atoi(argv[argptr++]);
    22292340              if ((j<0) || (j>1)) {
    2230                 eLog() << Verbose(1) << "Argument of '-m' should be either 0 for no-rotate or 1 for rotate." << endl;
     2341                DoeLog(1) && (eLog()<< Verbose(1) << "Argument of '-m' should be either 0 for no-rotate or 1 for rotate." << endl);
    22312342                j = 0;
    22322343              }
    22332344              if (j) {
    22342345                SaveFlag = true;
    2235                 Log() << Verbose(0) << "Converting to prinicipal axis system." << endl;
     2346                DoLog(0) && (Log() << Verbose(0) << "Converting to prinicipal axis system." << endl);
    22362347              } else
    2237                 Log() << Verbose(0) << "Evaluating prinicipal axis." << endl;
     2348                DoLog(0) && (Log() << Verbose(0) << "Evaluating prinicipal axis." << endl);
    22382349              mol->PrincipalAxisSystem((bool)j);
    22392350              break;
     
    22422353              if ((argptr+1 >= argc) || (argv[argptr][0] == '-')){
    22432354                ExitFlag = 255;
    2244                 eLog() << Verbose(0) << "Not enough or invalid arguments given for convex envelope: -o <convex output file> <non-convex output file>" << endl;
     2355                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for convex envelope: -o <convex output file> <non-convex output file>" << endl);
    22452356                performCriticalExit();
    22462357              } else {
    22472358                class Tesselation *TesselStruct = NULL;
    22482359                const LinkedCell *LCList = NULL;
    2249                 Log() << Verbose(0) << "Evaluating volume of the convex envelope.";
    2250                 Log() << Verbose(1) << "Storing tecplot convex data in " << argv[argptr] << "." << endl;
    2251                 Log() << Verbose(1) << "Storing tecplot non-convex data in " << argv[argptr+1] << "." << endl;
     2360                DoLog(0) && (Log() << Verbose(0) << "Evaluating volume of the convex envelope.");
     2361                DoLog(1) && (Log() << Verbose(1) << "Storing tecplot convex data in " << argv[argptr] << "." << endl);
     2362                DoLog(1) && (Log() << Verbose(1) << "Storing tecplot non-convex data in " << argv[argptr+1] << "." << endl);
    22522363                LCList = new LinkedCell(mol, 10.);
    22532364                //FindConvexBorder(mol, LCList, argv[argptr]);
     
    22562367                double volumedifference = ConvexizeNonconvexEnvelope(TesselStruct, mol, argv[argptr]);
    22572368                double clustervolume = VolumeOfConvexEnvelope(TesselStruct, &configuration);
    2258                 Log() << Verbose(0) << "The tesselated volume area is " << clustervolume << " " << (configuration.GetIsAngstroem() ? "angstrom" : "atomiclength") << "^3." << endl;
    2259                 Log() << Verbose(0) << "The non-convex tesselated volume area is " << clustervolume-volumedifference << " " << (configuration.GetIsAngstroem() ? "angstrom" : "atomiclength") << "^3." << endl;
     2369                DoLog(0) && (Log() << Verbose(0) << "The tesselated volume area is " << clustervolume << " " << (configuration.GetIsAngstroem() ? "angstrom" : "atomiclength") << "^3." << endl);
     2370                DoLog(0) && (Log() << Verbose(0) << "The non-convex tesselated volume area is " << clustervolume-volumedifference << " " << (configuration.GetIsAngstroem() ? "angstrom" : "atomiclength") << "^3." << endl);
    22602371                delete(TesselStruct);
    22612372                delete(LCList);
     
    22672378              if ((argptr+1 >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) ) {
    22682379                ExitFlag = 255;
    2269                 eLog() << Verbose(0) << "Not enough or invalid arguments given for suspension with specified volume: -U <volume> <density>" << endl;
     2380                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for suspension with specified volume: -U <volume> <density>" << endl);
    22702381                performCriticalExit();
    22712382              } else {
    22722383                volume = atof(argv[argptr++]);
    2273                 Log() << Verbose(0) << "Using " << volume << " angstrom^3 as the volume instead of convex envelope one's." << endl;
     2384                DoLog(0) && (Log() << Verbose(0) << "Using " << volume << " angstrom^3 as the volume instead of convex envelope one's." << endl);
    22742385              }
    22752386            case 'u':
     
    22782389                if (volume != -1)
    22792390                  ExitFlag = 255;
    2280                   eLog() << Verbose(0) << "Not enough or invalid arguments given for suspension: -u <density>" << endl;
     2391                  DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for suspension: -u <density>" << endl);
    22812392                  performCriticalExit();
    22822393              } else {
    22832394                double density;
    22842395                SaveFlag = true;
    2285                 Log() << Verbose(0) << "Evaluating necessary cell volume for a cluster suspended in water.";
     2396                DoLog(0) && (Log() << Verbose(0) << "Evaluating necessary cell volume for a cluster suspended in water.");
    22862397                density = atof(argv[argptr++]);
    22872398                if (density < 1.0) {
    2288                   eLog() << Verbose(1) << "Density must be greater than 1.0g/cm^3 !" << endl;
     2399                  DoeLog(1) && (eLog()<< Verbose(1) << "Density must be greater than 1.0g/cm^3 !" << endl);
    22892400                  density = 1.3;
    22902401                }
     
    22922403//                  repetition[i] = atoi(argv[argptr++]);
    22932404//                  if (repetition[i] < 1)
    2294 //                    eLog() << Verbose(1) << "repetition value must be greater 1!" << endl;
     2405//                    DoeLog(1) && (eLog()<< Verbose(1) << "repetition value must be greater 1!" << endl);
    22952406//                  repetition[i] = 1;
    22962407//                }
     
    23022413              if ((argptr+2 >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) {
    23032414                ExitFlag = 255;
    2304                 eLog() << Verbose(0) << "Not enough or invalid arguments given for repeating cells: -d <repeat_x> <repeat_y> <repeat_z>" << endl;
     2415                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for repeating cells: -d <repeat_x> <repeat_y> <repeat_z>" << endl);
    23052416                performCriticalExit();
    23062417              } else {
     
    23132424                  Vector ** vectors;
    23142425                  if (faktor < 1) {
    2315                     eLog() << Verbose(1) << "Repetition factor mus be greater than 1!" << endl;
     2426                    DoeLog(1) && (eLog()<< Verbose(1) << "Repetition factor mus be greater than 1!" << endl);
    23162427                    faktor = 1;
    23172428                  }
     
    23302441                    }
    23312442                    if (count != j)
    2332                       eLog() << Verbose(1) << "AtomCount " << count << " is not equal to number of atoms in molecule " << j << "!" << endl;
     2443                      DoeLog(1) && (eLog()<< Verbose(1) << "AtomCount " << count << " is not equal to number of atoms in molecule " << j << "!" << endl);
    23332444                    x.Zero();
    23342445                    y.Zero();
     
    23712482  } else {  // no arguments, hence scan the elements db
    23722483    if (periode->LoadPeriodentafel(configuration.databasepath))
    2373       Log() << Verbose(0) << "Element list loaded successfully." << endl;
     2484      DoLog(0) && (Log() << Verbose(0) << "Element list loaded successfully." << endl);
    23742485    else
    2375       Log() << Verbose(0) << "Element list loading failed." << endl;
     2486      DoLog(0) && (Log() << Verbose(0) << "Element list loading failed." << endl);
    23762487    configuration.RetrieveConfigPathAndName("main_pcp_linux");
    23772488  }
     
    23962507
    23972508  cout << ESPACKVersion << endl;
     2509
     2510  DoLog(1) && (Log() << Verbose(1) << "test" << endl);
     2511  DoLog(3) && (Log() << Verbose(1) << "test");
    23982512
    23992513  setVerbosity(0);
     
    24252539    double * const cell_size = World::get()->cell_size;
    24262540    if (cell_size[0] == 0.) {
    2427       Log() << Verbose(0) << "enter lower tridiagonal form of basis matrix" << endl << endl;
     2541      DoLog(0) && (Log() << Verbose(0) << "enter lower tridiagonal form of basis matrix" << endl << endl);
    24282542      for (int i=0;i<6;i++) {
    2429         Log() << Verbose(1) << "Cell size" << i << ": ";
     2543        DoLog(1) && (Log() << Verbose(1) << "Cell size" << i << ": ");
    24302544        cin >> cell_size[i];
    24312545      }
     
    24382552
    24392553  // now the main construction loop
    2440   Log() << Verbose(0) << endl << "Now comes the real construction..." << endl;
     2554  DoLog(0) && (Log() << Verbose(0) << endl << "Now comes the real construction..." << endl);
    24412555  do {
    2442     Log() << Verbose(0) << endl << endl;
    2443     Log() << Verbose(0) << "============Molecule list=======================" << endl;
     2556    DoLog(0) && (Log() << Verbose(0) << endl << endl);
     2557    DoLog(0) && (Log() << Verbose(0) << "============Molecule list=======================" << endl);
    24442558    molecules->Enumerate((ofstream *)&cout);
    2445     Log() << Verbose(0) << "============Menu===============================" << endl;
    2446     Log() << Verbose(0) << "a - set molecule (in)active" << endl;
    2447     Log() << Verbose(0) << "e - edit molecules (load, parse, save)" << endl;
    2448     Log() << Verbose(0) << "g - globally manipulate atoms in molecule" << endl;
    2449     Log() << Verbose(0) << "M - Merge molecules" << endl;
    2450     Log() << Verbose(0) << "m - manipulate atoms" << endl;
    2451     Log() << Verbose(0) << "-----------------------------------------------" << endl;
    2452     Log() << Verbose(0) << "c - edit the current configuration" << endl;
    2453     Log() << Verbose(0) << "-----------------------------------------------" << endl;
    2454     Log() << Verbose(0) << "s - save current setup to config file" << endl;
    2455     Log() << Verbose(0) << "T - call the current test routine" << endl;
    2456     Log() << Verbose(0) << "q - quit" << endl;
    2457     Log() << Verbose(0) << "===============================================" << endl;
    2458     Log() << Verbose(0) << "Input: ";
     2559    DoLog(0) && (Log() << Verbose(0) << "============Menu===============================" << endl);
     2560    DoLog(0) && (Log() << Verbose(0) << "a - set molecule (in)active" << endl);
     2561    DoLog(0) && (Log() << Verbose(0) << "e - edit molecules (load, parse, save)" << endl);
     2562    DoLog(0) && (Log() << Verbose(0) << "g - globally manipulate atoms in molecule" << endl);
     2563    DoLog(0) && (Log() << Verbose(0) << "M - Merge molecules" << endl);
     2564    DoLog(0) && (Log() << Verbose(0) << "m - manipulate atoms" << endl);
     2565    DoLog(0) && (Log() << Verbose(0) << "-----------------------------------------------" << endl);
     2566    DoLog(0) && (Log() << Verbose(0) << "c - edit the current configuration" << endl);
     2567    DoLog(0) && (Log() << Verbose(0) << "-----------------------------------------------" << endl);
     2568    DoLog(0) && (Log() << Verbose(0) << "s - save current setup to config file" << endl);
     2569    DoLog(0) && (Log() << Verbose(0) << "T - call the current test routine" << endl);
     2570    DoLog(0) && (Log() << Verbose(0) << "q - quit" << endl);
     2571    DoLog(0) && (Log() << Verbose(0) << "===============================================" << endl);
     2572    DoLog(0) && (Log() << Verbose(0) << "Input: ");
    24592573    cin >> choice;
    24602574
     
    24622576      case 'a':  // (in)activate molecule
    24632577        {
    2464           Log() << Verbose(0) << "Enter index of molecule: ";
     2578          DoLog(0) && (Log() << Verbose(0) << "Enter index of molecule: ");
    24652579          cin >> j;
    24662580          for(MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++)
     
    25082622  // save element data base
    25092623  if (periode->StorePeriodentafel(configuration->databasepath)) //ElementsFileName
    2510     Log() << Verbose(0) << "Saving of elements.db successful." << endl;
     2624    DoLog(0) && (Log() << Verbose(0) << "Saving of elements.db successful." << endl);
    25112625  else
    2512     Log() << Verbose(0) << "Saving of elements.db failed." << endl;
     2626    DoLog(0) && (Log() << Verbose(0) << "Saving of elements.db failed." << endl);
    25132627
    25142628  delete(molecules); // also free's all molecules contained
Note: See TracChangeset for help on using the changeset viewer.