Ignore:
Timestamp:
Apr 22, 2010, 2:00:03 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
423c7b
Parents:
c43766
Message:

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

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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/builder.cpp

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