Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/config.cpp

    r49e1ae ra67d19  
    1919#include "molecule.hpp"
    2020#include "periodentafel.hpp"
     21#include "World.hpp"
    2122
    2223/******************************** Functions for class ConfigFileBuffer **********************/
     
    7374  file= new ifstream(filename);
    7475  if (file == NULL) {
    75     eLog() << Verbose(1) << "config file " << filename << " missing!" << endl;
     76    DoeLog(1) && (eLog()<< Verbose(1) << "config file " << filename << " missing!" << endl);
    7677    return;
    7778  }
     
    8485  file->clear();
    8586  file->seekg(file_position, ios::beg);
    86   Log() << Verbose(1) << NoLines-1 << " lines were recognized." << endl;
     87  DoLog(1) && (Log() << Verbose(1) << NoLines-1 << " lines were recognized." << endl);
    8788
    8889  // allocate buffer's 1st dimension
    8990  if (buffer != NULL) {
    90     eLog() << Verbose(1) << "FileBuffer->buffer is not NULL!" << endl;
     91    DoeLog(1) && (eLog()<< Verbose(1) << "FileBuffer->buffer is not NULL!" << endl);
    9192    return;
    9293  } else
     
    104105    lines++;
    105106  } while((!file->eof()) && (lines < NoLines));
    106   Log() << Verbose(1) << lines-1 << " lines were read into the buffer." << endl;
     107  DoLog(1) && (Log() << Verbose(1) << lines-1 << " lines were read into the buffer." << endl);
    107108
    108109  // close and exit
     
    143144  map<const char *, int, IonTypeCompare> IonTypeLineMap;
    144145  if (LineMapping == NULL) {
    145     eLog() << Verbose(0) << "map pointer is NULL: " << LineMapping << endl;
     146    DoeLog(0) && (eLog()<< Verbose(0) << "map pointer is NULL: " << LineMapping << endl);
    146147    performCriticalExit();
    147148    return;
     
    159160      LineMapping[CurrentLine+(nr++)] = runner->second;
    160161    else {
    161       eLog() << Verbose(0) << "config::MapIonTypesInBuffer - NoAtoms is wrong: We are past the end of the file!" << endl;
     162      DoeLog(0) && (eLog()<< Verbose(0) << "config::MapIonTypesInBuffer - NoAtoms is wrong: We are past the end of the file!" << endl);
    162163      performCriticalExit();
    163164    }
     
    249250        Thermostat = None;
    250251      } else {
    251         Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl;
     252        DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl);
    252253        Thermostat = None;
    253254      }
     
    257258        ParseForParameter(verbose,fb,"Thermostat", 0, 2, 1, int_type, &ScaleTempStep, 1, critical); // read scaling frequency
    258259      } else {
    259         Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl;
     260        DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl);
    260261        Thermostat = None;
    261262      }
     
    265266        ParseForParameter(verbose,fb,"Thermostat", 0, 2, 1, int_type, &ScaleTempStep, 1, critical); // read collision rate
    266267      } else {
    267         Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl;
     268        DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl);
    268269        Thermostat = None;
    269270      }
     
    273274        ParseForParameter(verbose,fb,"Thermostat", 0, 2, 1, double_type, &TempFrequency, 1, critical); // read gamma
    274275        if (ParseForParameter(verbose,fb,"Thermostat", 0, 3, 1, double_type, &alpha, 1, optional)) {
    275           Log() << Verbose(2) << "Extended Stochastic Thermostat detected with interpolation coefficient " << alpha << "." << endl;
     276          DoLog(2) && (Log() << Verbose(2) << "Extended Stochastic Thermostat detected with interpolation coefficient " << alpha << "." << endl);
    276277        } else {
    277278          alpha = 1.;
    278279        }
    279280      } else {
    280         Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl;
     281        DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl);
    281282        Thermostat = None;
    282283      }
     
    286287        ParseForParameter(verbose,fb,"Thermostat", 0, 2, 1, double_type, &TempFrequency, 1, critical); // read \tau_T
    287288      } else {
    288         Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl;
     289        DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl);
    289290        Thermostat = None;
    290291      }
     
    295296        alpha = 0.;
    296297      } else {
    297         Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl;
     298        DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl);
    298299        Thermostat = None;
    299300      }
    300301    } else {
    301       Log() << Verbose(1) << " Warning: thermostat name was not understood!" << endl;
     302      DoLog(1) && (Log() << Verbose(1) << " Warning: thermostat name was not understood!" << endl);
    302303      Thermostat = None;
    303304    }
    304305  } else {
    305306    if ((MaxOuterStep > 0) && (TargetTemp != 0))
    306       Log() << Verbose(2) <<  "No thermostat chosen despite finite temperature MD, falling back to None." << endl;
     307      DoLog(2) && (Log() << Verbose(2) <<  "No thermostat chosen despite finite temperature MD, falling back to None." << endl);
    307308    Thermostat = None;
    308309  }
     
    320321
    321322  do {
    322     Log() << Verbose(0) << "===========EDIT CONFIGURATION============================" << endl;
    323     Log() << Verbose(0) << " A - mainname (prefix for all runtime files)" << endl;
    324     Log() << Verbose(0) << " B - Default path (for runtime files)" << endl;
    325     Log() << Verbose(0) << " C - Path of pseudopotential files" << endl;
    326     Log() << Verbose(0) << " D - Number of coefficient sharing processes" << endl;
    327     Log() << Verbose(0) << " E - Number of wave function sharing processes" << endl;
    328     Log() << Verbose(0) << " F - 0: Don't output density for OpenDX, 1: do" << endl;
    329     Log() << Verbose(0) << " G - 0: Don't output physical data, 1: do" << endl;
    330     Log() << Verbose(0) << " H - 0: Don't output densities of each unperturbed orbital for OpenDX, 1: do" << endl;
    331     Log() << Verbose(0) << " I - 0: Don't output current density for OpenDX, 1: do" << endl;
    332     Log() << Verbose(0) << " J - 0: Don't do the full current calculation, 1: do" << endl;
    333     Log() << Verbose(0) << " K - 0: Don't do perturbation calculation to obtain susceptibility and shielding, 1: do" << endl;
    334     Log() << Verbose(0) << " L - 0: Wannier centres as calculated, 1: common centre for all, 2: unite centres according to spread, 3: cell centre, 4: shifted to nearest grid point" << endl;
    335     Log() << Verbose(0) << " M - Absolute begin of unphysical sawtooth transfer for position operator within cell" << endl;
    336     Log() << Verbose(0) << " N - (0,1,2) x,y,z-plane to do two-dimensional current vector cut" << endl;
    337     Log() << Verbose(0) << " O - Absolute position along vector cut axis for cut plane" << endl;
    338     Log() << Verbose(0) << " P - Additional Gram-Schmidt-Orthonormalization to stabilize numerics" << endl;
    339     Log() << Verbose(0) << " Q - Initial integer value of random number generator" << endl;
    340     Log() << Verbose(0) << " R - for perturbation 0, for structure optimization defines upper limit of iterations" << endl;
    341     Log() << Verbose(0) << " T - Output visual after ...th step" << endl;
    342     Log() << Verbose(0) << " U - Output source densities of wave functions after ...th step" << endl;
    343     Log() << Verbose(0) << " X - minimization iterations per wave function, if unsure leave at default value 0" << endl;
    344     Log() << Verbose(0) << " Y - tolerance value for total spread in iterative Jacobi diagonalization" << endl;
    345     Log() << Verbose(0) << " Z - Maximum number of minimization iterations" << endl;
    346     Log() << Verbose(0) << " a - Relative change in total energy to stop min. iteration" << endl;
    347     Log() << Verbose(0) << " b - Relative change in kinetic energy to stop min. iteration" << endl;
    348     Log() << Verbose(0) << " c - Check stop conditions every ..th step during min. iteration" << endl;
    349     Log() << Verbose(0) << " e - Maximum number of minimization iterations during initial level" << endl;
    350     Log() << Verbose(0) << " f - Relative change in total energy to stop min. iteration during initial level" << endl;
    351     Log() << Verbose(0) << " g - Relative change in kinetic energy to stop min. iteration during initial level" << endl;
    352     Log() << Verbose(0) << " h - Check stop conditions every ..th step during min. iteration during initial level" << endl;
     323    DoLog(0) && (Log() << Verbose(0) << "===========EDIT CONFIGURATION============================" << endl);
     324    DoLog(0) && (Log() << Verbose(0) << " A - mainname (prefix for all runtime files)" << endl);
     325    DoLog(0) && (Log() << Verbose(0) << " B - Default path (for runtime files)" << endl);
     326    DoLog(0) && (Log() << Verbose(0) << " C - Path of pseudopotential files" << endl);
     327    DoLog(0) && (Log() << Verbose(0) << " D - Number of coefficient sharing processes" << endl);
     328    DoLog(0) && (Log() << Verbose(0) << " E - Number of wave function sharing processes" << endl);
     329    DoLog(0) && (Log() << Verbose(0) << " F - 0: Don't output density for OpenDX, 1: do" << endl);
     330    DoLog(0) && (Log() << Verbose(0) << " G - 0: Don't output physical data, 1: do" << endl);
     331    DoLog(0) && (Log() << Verbose(0) << " H - 0: Don't output densities of each unperturbed orbital for OpenDX, 1: do" << endl);
     332    DoLog(0) && (Log() << Verbose(0) << " I - 0: Don't output current density for OpenDX, 1: do" << endl);
     333    DoLog(0) && (Log() << Verbose(0) << " J - 0: Don't do the full current calculation, 1: do" << endl);
     334    DoLog(0) && (Log() << Verbose(0) << " K - 0: Don't do perturbation calculation to obtain susceptibility and shielding, 1: do" << endl);
     335    DoLog(0) && (Log() << Verbose(0) << " L - 0: Wannier centres as calculated, 1: common centre for all, 2: unite centres according to spread, 3: cell centre, 4: shifted to nearest grid point" << endl);
     336    DoLog(0) && (Log() << Verbose(0) << " M - Absolute begin of unphysical sawtooth transfer for position operator within cell" << endl);
     337    DoLog(0) && (Log() << Verbose(0) << " N - (0,1,2) x,y,z-plane to do two-dimensional current vector cut" << endl);
     338    DoLog(0) && (Log() << Verbose(0) << " O - Absolute position along vector cut axis for cut plane" << endl);
     339    DoLog(0) && (Log() << Verbose(0) << " P - Additional Gram-Schmidt-Orthonormalization to stabilize numerics" << endl);
     340    DoLog(0) && (Log() << Verbose(0) << " Q - Initial integer value of random number generator" << endl);
     341    DoLog(0) && (Log() << Verbose(0) << " R - for perturbation 0, for structure optimization defines upper limit of iterations" << endl);
     342    DoLog(0) && (Log() << Verbose(0) << " T - Output visual after ...th step" << endl);
     343    DoLog(0) && (Log() << Verbose(0) << " U - Output source densities of wave functions after ...th step" << endl);
     344    DoLog(0) && (Log() << Verbose(0) << " X - minimization iterations per wave function, if unsure leave at default value 0" << endl);
     345    DoLog(0) && (Log() << Verbose(0) << " Y - tolerance value for total spread in iterative Jacobi diagonalization" << endl);
     346    DoLog(0) && (Log() << Verbose(0) << " Z - Maximum number of minimization iterations" << endl);
     347    DoLog(0) && (Log() << Verbose(0) << " a - Relative change in total energy to stop min. iteration" << endl);
     348    DoLog(0) && (Log() << Verbose(0) << " b - Relative change in kinetic energy to stop min. iteration" << endl);
     349    DoLog(0) && (Log() << Verbose(0) << " c - Check stop conditions every ..th step during min. iteration" << endl);
     350    DoLog(0) && (Log() << Verbose(0) << " e - Maximum number of minimization iterations during initial level" << endl);
     351    DoLog(0) && (Log() << Verbose(0) << " f - Relative change in total energy to stop min. iteration during initial level" << endl);
     352    DoLog(0) && (Log() << Verbose(0) << " g - Relative change in kinetic energy to stop min. iteration during initial level" << endl);
     353    DoLog(0) && (Log() << Verbose(0) << " h - Check stop conditions every ..th step during min. iteration during initial level" << endl);
    353354//    Log() << Verbose(0) << " j - six lower diagonal entries of matrix, defining the unit cell" << endl;
    354     Log() << Verbose(0) << " k - Energy cutoff of plane wave basis in Hartree" << endl;
    355     Log() << Verbose(0) << " l - Maximum number of levels in multi-level-ansatz" << endl;
    356     Log() << Verbose(0) << " m - Factor by which grid nodes increase between standard and upper level" << endl;
    357     Log() << Verbose(0) << " n - 0: Don't use RiemannTensor, 1: Do" << endl;
    358     Log() << Verbose(0) << " o - Factor by which grid nodes increase between Riemann and standard(?) level" << endl;
    359     Log() << Verbose(0) << " p - Number of Riemann levels" << endl;
    360     Log() << Verbose(0) << " r - 0: Don't Use RiemannTensor, 1: Do" << endl;
    361     Log() << Verbose(0) << " s - 0: Doubly occupied orbitals, 1: Up-/Down-Orbitals" << endl;
    362     Log() << Verbose(0) << " t - Number of orbitals (depends pn SpinType)" << endl;
    363     Log() << Verbose(0) << " u - Number of SpinUp orbitals (depends on SpinType)" << endl;
    364     Log() << Verbose(0) << " v - Number of SpinDown orbitals (depends on SpinType)" << endl;
    365     Log() << Verbose(0) << " w - Number of additional, unoccupied orbitals" << endl;
    366     Log() << Verbose(0) << " x - radial cutoff for ewald summation in Bohrradii" << endl;
    367     Log() << Verbose(0) << " y - 0: Don't do structure optimization beforehand, 1: Do" << endl;
    368     Log() << Verbose(0) << " z - 0: Units are in Bohr radii, 1: units are in Aengstrom" << endl;
    369     Log() << Verbose(0) << " i - 0: Coordinates given in file are absolute, 1: ... are relative to unit cell" << endl;
    370     Log() << Verbose(0) << "=========================================================" << endl;
    371     Log() << Verbose(0) << "INPUT: ";
     355    DoLog(0) && (Log() << Verbose(0) << " k - Energy cutoff of plane wave basis in Hartree" << endl);
     356    DoLog(0) && (Log() << Verbose(0) << " l - Maximum number of levels in multi-level-ansatz" << endl);
     357    DoLog(0) && (Log() << Verbose(0) << " m - Factor by which grid nodes increase between standard and upper level" << endl);
     358    DoLog(0) && (Log() << Verbose(0) << " n - 0: Don't use RiemannTensor, 1: Do" << endl);
     359    DoLog(0) && (Log() << Verbose(0) << " o - Factor by which grid nodes increase between Riemann and standard(?) level" << endl);
     360    DoLog(0) && (Log() << Verbose(0) << " p - Number of Riemann levels" << endl);
     361    DoLog(0) && (Log() << Verbose(0) << " r - 0: Don't Use RiemannTensor, 1: Do" << endl);
     362    DoLog(0) && (Log() << Verbose(0) << " s - 0: Doubly occupied orbitals, 1: Up-/Down-Orbitals" << endl);
     363    DoLog(0) && (Log() << Verbose(0) << " t - Number of orbitals (depends pn SpinType)" << endl);
     364    DoLog(0) && (Log() << Verbose(0) << " u - Number of SpinUp orbitals (depends on SpinType)" << endl);
     365    DoLog(0) && (Log() << Verbose(0) << " v - Number of SpinDown orbitals (depends on SpinType)" << endl);
     366    DoLog(0) && (Log() << Verbose(0) << " w - Number of additional, unoccupied orbitals" << endl);
     367    DoLog(0) && (Log() << Verbose(0) << " x - radial cutoff for ewald summation in Bohrradii" << endl);
     368    DoLog(0) && (Log() << Verbose(0) << " y - 0: Don't do structure optimization beforehand, 1: Do" << endl);
     369    DoLog(0) && (Log() << Verbose(0) << " z - 0: Units are in Bohr radii, 1: units are in Aengstrom" << endl);
     370    DoLog(0) && (Log() << Verbose(0) << " i - 0: Coordinates given in file are absolute, 1: ... are relative to unit cell" << endl);
     371    DoLog(0) && (Log() << Verbose(0) << "=========================================================" << endl);
     372    DoLog(0) && (Log() << Verbose(0) << "INPUT: ");
    372373    cin >> choice;
    373374
    374375    switch (choice) {
    375376        case 'A': // mainname
    376           Log() << Verbose(0) << "Old: " << config::mainname << "\t new: ";
     377          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::mainname << "\t new: ");
    377378          cin >> config::mainname;
    378379          break;
    379380        case 'B': // defaultpath
    380           Log() << Verbose(0) << "Old: " << config::defaultpath << "\t new: ";
     381          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::defaultpath << "\t new: ");
    381382          cin >> config::defaultpath;
    382383          break;
    383384        case 'C': // pseudopotpath
    384           Log() << Verbose(0) << "Old: " << config::pseudopotpath << "\t new: ";
     385          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::pseudopotpath << "\t new: ");
    385386          cin >> config::pseudopotpath;
    386387          break;
    387388
    388389        case 'D': // ProcPEGamma
    389           Log() << Verbose(0) << "Old: " << config::ProcPEGamma << "\t new: ";
     390          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::ProcPEGamma << "\t new: ");
    390391          cin >> config::ProcPEGamma;
    391392          break;
    392393        case 'E': // ProcPEPsi
    393           Log() << Verbose(0) << "Old: " << config::ProcPEPsi << "\t new: ";
     394          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::ProcPEPsi << "\t new: ");
    394395          cin >> config::ProcPEPsi;
    395396          break;
    396397        case 'F': // DoOutVis
    397           Log() << Verbose(0) << "Old: " << config::DoOutVis << "\t new: ";
     398          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::DoOutVis << "\t new: ");
    398399          cin >> config::DoOutVis;
    399400          break;
    400401        case 'G': // DoOutMes
    401           Log() << Verbose(0) << "Old: " << config::DoOutMes << "\t new: ";
     402          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::DoOutMes << "\t new: ");
    402403          cin >> config::DoOutMes;
    403404          break;
    404405        case 'H': // DoOutOrbitals
    405           Log() << Verbose(0) << "Old: " << config::DoOutOrbitals << "\t new: ";
     406          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::DoOutOrbitals << "\t new: ");
    406407          cin >> config::DoOutOrbitals;
    407408          break;
    408409        case 'I': // DoOutCurrent
    409           Log() << Verbose(0) << "Old: " << config::DoOutCurrent << "\t new: ";
     410          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::DoOutCurrent << "\t new: ");
    410411          cin >> config::DoOutCurrent;
    411412          break;
    412413        case 'J': // DoFullCurrent
    413           Log() << Verbose(0) << "Old: " << config::DoFullCurrent << "\t new: ";
     414          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::DoFullCurrent << "\t new: ");
    414415          cin >> config::DoFullCurrent;
    415416          break;
    416417        case 'K': // DoPerturbation
    417           Log() << Verbose(0) << "Old: " << config::DoPerturbation << "\t new: ";
     418          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::DoPerturbation << "\t new: ");
    418419          cin >> config::DoPerturbation;
    419420          break;
    420421        case 'L': // CommonWannier
    421           Log() << Verbose(0) << "Old: " << config::CommonWannier << "\t new: ";
     422          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::CommonWannier << "\t new: ");
    422423          cin >> config::CommonWannier;
    423424          break;
    424425        case 'M': // SawtoothStart
    425           Log() << Verbose(0) << "Old: " << config::SawtoothStart << "\t new: ";
     426          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::SawtoothStart << "\t new: ");
    426427          cin >> config::SawtoothStart;
    427428          break;
    428429        case 'N': // VectorPlane
    429           Log() << Verbose(0) << "Old: " << config::VectorPlane << "\t new: ";
     430          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::VectorPlane << "\t new: ");
    430431          cin >> config::VectorPlane;
    431432          break;
    432433        case 'O': // VectorCut
    433           Log() << Verbose(0) << "Old: " << config::VectorCut << "\t new: ";
     434          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::VectorCut << "\t new: ");
    434435          cin >> config::VectorCut;
    435436          break;
    436437        case 'P': // UseAddGramSch
    437           Log() << Verbose(0) << "Old: " << config::UseAddGramSch << "\t new: ";
     438          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::UseAddGramSch << "\t new: ");
    438439          cin >> config::UseAddGramSch;
    439440          break;
    440441        case 'Q': // Seed
    441           Log() << Verbose(0) << "Old: " << config::Seed << "\t new: ";
     442          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::Seed << "\t new: ");
    442443          cin >> config::Seed;
    443444          break;
    444445
    445446        case 'R': // MaxOuterStep
    446           Log() << Verbose(0) << "Old: " << config::MaxOuterStep << "\t new: ";
     447          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::MaxOuterStep << "\t new: ");
    447448          cin >> config::MaxOuterStep;
    448449          break;
    449450        case 'T': // OutVisStep
    450           Log() << Verbose(0) << "Old: " << config::OutVisStep << "\t new: ";
     451          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::OutVisStep << "\t new: ");
    451452          cin >> config::OutVisStep;
    452453          break;
    453454        case 'U': // OutSrcStep
    454           Log() << Verbose(0) << "Old: " << config::OutSrcStep << "\t new: ";
     455          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::OutSrcStep << "\t new: ");
    455456          cin >> config::OutSrcStep;
    456457          break;
    457458        case 'X': // MaxPsiStep
    458           Log() << Verbose(0) << "Old: " << config::MaxPsiStep << "\t new: ";
     459          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::MaxPsiStep << "\t new: ");
    459460          cin >> config::MaxPsiStep;
    460461          break;
    461462        case 'Y': // EpsWannier
    462           Log() << Verbose(0) << "Old: " << config::EpsWannier << "\t new: ";
     463          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::EpsWannier << "\t new: ");
    463464          cin >> config::EpsWannier;
    464465          break;
    465466
    466467        case 'Z': // MaxMinStep
    467           Log() << Verbose(0) << "Old: " << config::MaxMinStep << "\t new: ";
     468          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::MaxMinStep << "\t new: ");
    468469          cin >> config::MaxMinStep;
    469470          break;
    470471        case 'a': // RelEpsTotalEnergy
    471           Log() << Verbose(0) << "Old: " << config::RelEpsTotalEnergy << "\t new: ";
     472          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::RelEpsTotalEnergy << "\t new: ");
    472473          cin >> config::RelEpsTotalEnergy;
    473474          break;
    474475        case 'b': // RelEpsKineticEnergy
    475           Log() << Verbose(0) << "Old: " << config::RelEpsKineticEnergy << "\t new: ";
     476          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::RelEpsKineticEnergy << "\t new: ");
    476477          cin >> config::RelEpsKineticEnergy;
    477478          break;
    478479        case 'c': // MaxMinStopStep
    479           Log() << Verbose(0) << "Old: " << config::MaxMinStopStep << "\t new: ";
     480          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::MaxMinStopStep << "\t new: ");
    480481          cin >> config::MaxMinStopStep;
    481482          break;
    482483        case 'e': // MaxInitMinStep
    483           Log() << Verbose(0) << "Old: " << config::MaxInitMinStep << "\t new: ";
     484          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::MaxInitMinStep << "\t new: ");
    484485          cin >> config::MaxInitMinStep;
    485486          break;
    486487        case 'f': // InitRelEpsTotalEnergy
    487           Log() << Verbose(0) << "Old: " << config::InitRelEpsTotalEnergy << "\t new: ";
     488          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::InitRelEpsTotalEnergy << "\t new: ");
    488489          cin >> config::InitRelEpsTotalEnergy;
    489490          break;
    490491        case 'g': // InitRelEpsKineticEnergy
    491           Log() << Verbose(0) << "Old: " << config::InitRelEpsKineticEnergy << "\t new: ";
     492          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::InitRelEpsKineticEnergy << "\t new: ");
    492493          cin >> config::InitRelEpsKineticEnergy;
    493494          break;
    494495        case 'h': // InitMaxMinStopStep
    495           Log() << Verbose(0) << "Old: " << config::InitMaxMinStopStep << "\t new: ";
     496          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::InitMaxMinStopStep << "\t new: ");
    496497          cin >> config::InitMaxMinStopStep;
    497498          break;
     
    499500//        case 'j': // BoxLength
    500501//          Log() << Verbose(0) << "enter lower triadiagonalo form of basis matrix" << endl << endl;
     502//          double * const cell_size = World::get()->cell_size;
    501503//          for (int i=0;i<6;i++) {
    502504//            Log() << Verbose(0) << "Cell size" << i << ": ";
    503 //            cin >> mol->cell_size[i];
     505//            cin >> cell_size[i];
    504506//          }
    505507//          break;
    506508
    507509        case 'k': // ECut
    508           Log() << Verbose(0) << "Old: " << config::ECut << "\t new: ";
     510          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::ECut << "\t new: ");
    509511          cin >> config::ECut;
    510512          break;
    511513        case 'l': // MaxLevel
    512           Log() << Verbose(0) << "Old: " << config::MaxLevel << "\t new: ";
     514          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::MaxLevel << "\t new: ");
    513515          cin >> config::MaxLevel;
    514516          break;
    515517        case 'm': // RiemannTensor
    516           Log() << Verbose(0) << "Old: " << config::RiemannTensor << "\t new: ";
     518          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::RiemannTensor << "\t new: ");
    517519          cin >> config::RiemannTensor;
    518520          break;
    519521        case 'n': // LevRFactor
    520           Log() << Verbose(0) << "Old: " << config::LevRFactor << "\t new: ";
     522          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::LevRFactor << "\t new: ");
    521523          cin >> config::LevRFactor;
    522524          break;
    523525        case 'o': // RiemannLevel
    524           Log() << Verbose(0) << "Old: " << config::RiemannLevel << "\t new: ";
     526          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::RiemannLevel << "\t new: ");
    525527          cin >> config::RiemannLevel;
    526528          break;
    527529        case 'p': // Lev0Factor
    528           Log() << Verbose(0) << "Old: " << config::Lev0Factor << "\t new: ";
     530          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::Lev0Factor << "\t new: ");
    529531          cin >> config::Lev0Factor;
    530532          break;
    531533        case 'r': // RTActualUse
    532           Log() << Verbose(0) << "Old: " << config::RTActualUse << "\t new: ";
     534          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::RTActualUse << "\t new: ");
    533535          cin >> config::RTActualUse;
    534536          break;
    535537        case 's': // PsiType
    536           Log() << Verbose(0) << "Old: " << config::PsiType << "\t new: ";
     538          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::PsiType << "\t new: ");
    537539          cin >> config::PsiType;
    538540          break;
    539541        case 't': // MaxPsiDouble
    540           Log() << Verbose(0) << "Old: " << config::MaxPsiDouble << "\t new: ";
     542          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::MaxPsiDouble << "\t new: ");
    541543          cin >> config::MaxPsiDouble;
    542544          break;
    543545        case 'u': // PsiMaxNoUp
    544           Log() << Verbose(0) << "Old: " << config::PsiMaxNoUp << "\t new: ";
     546          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::PsiMaxNoUp << "\t new: ");
    545547          cin >> config::PsiMaxNoUp;
    546548          break;
    547549        case 'v': // PsiMaxNoDown
    548           Log() << Verbose(0) << "Old: " << config::PsiMaxNoDown << "\t new: ";
     550          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::PsiMaxNoDown << "\t new: ");
    549551          cin >> config::PsiMaxNoDown;
    550552          break;
    551553        case 'w': // AddPsis
    552           Log() << Verbose(0) << "Old: " << config::AddPsis << "\t new: ";
     554          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::AddPsis << "\t new: ");
    553555          cin >> config::AddPsis;
    554556          break;
    555557
    556558        case 'x': // RCut
    557           Log() << Verbose(0) << "Old: " << config::RCut << "\t new: ";
     559          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::RCut << "\t new: ");
    558560          cin >> config::RCut;
    559561          break;
    560562        case 'y': // StructOpt
    561           Log() << Verbose(0) << "Old: " << config::StructOpt << "\t new: ";
     563          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::StructOpt << "\t new: ");
    562564          cin >> config::StructOpt;
    563565          break;
    564566        case 'z': // IsAngstroem
    565           Log() << Verbose(0) << "Old: " << config::IsAngstroem << "\t new: ";
     567          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::IsAngstroem << "\t new: ");
    566568          cin >> config::IsAngstroem;
    567569          break;
    568570        case 'i': // RelativeCoord
    569           Log() << Verbose(0) << "Old: " << config::RelativeCoord << "\t new: ";
     571          DoLog(0) && (Log() << Verbose(0) << "Old: " << config::RelativeCoord << "\t new: ");
    570572          cin >> config::RelativeCoord;
    571573          break;
     
    646648  }
    647649  strcpy(configname, ptr);
    648   Log() << Verbose(0) << "Found configpath: " << configpath << ", dir slash was found at " << last << ", config name is " << configname << "." << endl;
     650  DoLog(0) && (Log() << Verbose(0) << "Found configpath: " << configpath << ", dir slash was found at " << last << ", config name is " << configname << "." << endl);
    649651  delete[](buffer);
    650652};
     
    657659{
    658660  if (FileBuffer != NULL) {
    659     eLog() << Verbose(2) << "deleting present FileBuffer in PrepareFileBuffer()." << endl;
     661    DoeLog(2) && (eLog()<< Verbose(2) << "deleting present FileBuffer in PrepareFileBuffer()." << endl);
    660662    delete(FileBuffer);
    661663  }
     
    683685
    684686  if (mol == NULL) {
    685     eLog() << Verbose(0) << "Molecule is not allocated in LoadMolecule(), exit.";
     687    DoeLog(0) && (eLog()<< Verbose(0) << "Molecule is not allocated in LoadMolecule(), exit.");
    686688    performCriticalExit();
    687689  }
     
    689691  ParseForParameter(verbose,FileBuffer,"MaxTypes", 0, 1, 1, int_type, &(MaxTypes), 1, critical);
    690692  if (MaxTypes == 0) {
    691     eLog() << Verbose(0) << "There are no atoms according to MaxTypes in this config file." << endl;
    692     performCriticalExit();
     693    DoeLog(1) && (eLog()<< Verbose(1) << "There are no atoms according to MaxTypes in this config file." << endl);
     694    //performCriticalExit();
    693695  } else {
    694696    // prescan number of ions per type
    695     Log() << Verbose(0) << "Prescanning ions per type: " << endl;
     697    DoLog(0) && (Log() << Verbose(0) << "Prescanning ions per type: " << endl);
    696698    int NoAtoms = 0;
    697699    for (int i=0; i < MaxTypes; i++) {
     
    700702      ParseForParameter(verbose,FileBuffer, name, 0, 2, 1, int_type, &Z, 1, critical);
    701703      elementhash[i] = periode->FindElement(Z);
    702       Log() << Verbose(1) << i << ". Z = " << elementhash[i]->Z << " with " << No[i] << " ions." << endl;
     704      DoLog(1) && (Log() << Verbose(1) << i << ". Z = " << elementhash[i]->Z << " with " << No[i] << " ions." << endl);
    703705      NoAtoms += No[i];
    704706    }
     
    708710    sprintf(name,"Ion_Type%i",MaxTypes);
    709711    if (!ParseForParameter(verbose,FileBuffer, (const char*)name, 1, 1, 1, int_type, &value[0], 1, critical)) {
    710       eLog() << Verbose(0) << "There are no atoms in the config file!" << endl;
     712      DoeLog(0) && (eLog()<< Verbose(0) << "There are no atoms in the config file!" << endl);
    711713      performCriticalExit();
    712714      return;
     
    726728      bool status = true;
    727729      while (status) {
    728         Log() << Verbose(0) << "Currently parsing MD step " << repetition << "." << endl;
     730        DoLog(0) && (Log() << Verbose(0) << "Currently parsing MD step " << repetition << "." << endl);
    729731        for (int i=0; i < MaxTypes; i++) {
    730732          sprintf(name,"Ion_Type%i",i+1);
     
    792794      }
    793795      repetition--;
    794       Log() << Verbose(0) << "Found " << repetition << " trajectory steps." << endl;
     796      DoLog(0) && (Log() << Verbose(0) << "Found " << repetition << " trajectory steps." << endl);
    795797      if (repetition <= 1)  // if onyl one step, desactivate use of trajectories
    796798        mol->MDSteps = 0;
     
    804806              ParseForParameter(verbose,FileBuffer, "Ion_Type1_1", 0, 3, 1, double_type, &value[2], repetition, (repetition == 0) ? critical : optional))
    805807        repetition++;
    806       Log() << Verbose(0) << "I found " << repetition << " times the keyword Ion_Type1_1." << endl;
     808      DoLog(0) && (Log() << Verbose(0) << "I found " << repetition << " times the keyword Ion_Type1_1." << endl);
    807809      // parse in molecule coordinates
    808810      for (int i=0; i < MaxTypes; i++) {
     
    853855  ifstream *file = new ifstream(filename);
    854856  if (file == NULL) {
    855     eLog() << Verbose(1) << "config file " << filename << " missing!" << endl;
     857    DoeLog(1) && (eLog()<< Verbose(1) << "config file " << filename << " missing!" << endl);
    856858    return;
    857859  }
     
    965967  // Unit cell and magnetic field
    966968  ParseForParameter(verbose,FileBuffer, "BoxLength", 0, 3, 3, lower_trigrid, BoxLength, 1, critical); /* Lattice->RealBasis */
    967   mol->cell_size[0] = BoxLength[0];
    968   mol->cell_size[1] = BoxLength[3];
    969   mol->cell_size[2] = BoxLength[4];
    970   mol->cell_size[3] = BoxLength[6];
    971   mol->cell_size[4] = BoxLength[7];
    972   mol->cell_size[5] = BoxLength[8];
     969  double * const cell_size = World::get()->cell_size;
     970  cell_size[0] = BoxLength[0];
     971  cell_size[1] = BoxLength[3];
     972  cell_size[2] = BoxLength[4];
     973  cell_size[3] = BoxLength[6];
     974  cell_size[4] = BoxLength[7];
     975  cell_size[5] = BoxLength[8];
    973976  //if (1) fprintf(stderr,"\n");
    974977
     
    10601063    BG = new BondGraph(IsAngstroem);
    10611064    if (BG->LoadBondLengthTable(BondGraphFileName)) {
    1062       Log() << Verbose(0) << "Bond length table loaded successfully." << endl;
     1065      DoLog(0) && (Log() << Verbose(0) << "Bond length table loaded successfully." << endl);
    10631066    } else {
    1064       eLog() << Verbose(1) << "Bond length table loading failed." << endl;
     1067      DoeLog(1) && (eLog()<< Verbose(1) << "Bond length table loading failed." << endl);
    10651068    }
    10661069  }
     
    10911094  ifstream *file = new ifstream(filename);
    10921095  if (file == NULL) {
    1093     eLog() << Verbose(1) << "config file " << filename << " missing!" << endl;
     1096    DoeLog(1) && (eLog()<< Verbose(1) << "config file " << filename << " missing!" << endl);
    10941097    return;
    10951098  }
     
    11691172
    11701173  ParseForParameter(verbose,file, "BoxLength", 0, 3, 3, lower_trigrid, BoxLength, 1, critical); /* Lattice->RealBasis */
    1171   mol->cell_size[0] = BoxLength[0];
    1172   mol->cell_size[1] = BoxLength[3];
    1173   mol->cell_size[2] = BoxLength[4];
    1174   mol->cell_size[3] = BoxLength[6];
    1175   mol->cell_size[4] = BoxLength[7];
    1176   mol->cell_size[5] = BoxLength[8];
     1174  double * const cell_size = World::get()->cell_size;
     1175  cell_size[0] = BoxLength[0];
     1176  cell_size[1] = BoxLength[3];
     1177  cell_size[2] = BoxLength[4];
     1178  cell_size[3] = BoxLength[6];
     1179  cell_size[4] = BoxLength[7];
     1180  cell_size[5] = BoxLength[8];
    11771181  if (1) fprintf(stderr,"\n");
    11781182  config::DoPerturbation = 0;
     
    12501254  BG = new BondGraph(IsAngstroem);
    12511255  if (BG->LoadBondLengthTable(BondGraphFileName)) {
    1252     Log() << Verbose(0) << "Bond length table loaded successfully." << endl;
     1256    DoLog(0) && (Log() << Verbose(0) << "Bond length table loaded successfully." << endl);
    12531257  } else {
    1254     Log() << Verbose(0) << "Bond length table loading failed." << endl;
     1258    DoLog(0) && (Log() << Verbose(0) << "Bond length table loading failed." << endl);
    12551259  }
    12561260
     
    12591263  for (i=MAX_ELEMENTS;i--;)
    12601264    elementhash[i] = NULL;
    1261   Log() << Verbose(0) << "Parsing Ions ..." << endl;
     1265  DoLog(0) && (Log() << Verbose(0) << "Parsing Ions ..." << endl);
    12621266  No=0;
    12631267  found = 0;
    12641268  while (getline(*file,zeile,'\n')) {
    12651269    if (zeile.find("Ions_Data") == 0) {
    1266       Log() << Verbose(1) << "found Ions_Data...begin parsing" << endl;
     1270      DoLog(1) && (Log() << Verbose(1) << "found Ions_Data...begin parsing" << endl);
    12671271      found ++;
    12681272    }
     
    12781282      input >> b;     // element mass
    12791283      elementhash[No] = periode->FindElement(Z);
    1280       Log() << Verbose(1) << "AtomNo: " << AtomNo << "\tZ: " << Z << "\ta:" << a << "\tl:"  << l << "\b:" << b << "\tElement:" << elementhash[No] << "\t:" << endl;
     1284      DoLog(1) && (Log() << Verbose(1) << "AtomNo: " << AtomNo << "\tZ: " << Z << "\ta:" << a << "\tl:"  << l << "\b:" << b << "\tElement:" << elementhash[No] << "\t:" << endl);
    12811285      for(i=0;i<AtomNo;i++) {
    12821286        if (!getline(*file,zeile,'\n')) {// parse on and on
    1283           Log() << Verbose(2) << "Error: Too few items in ionic list of element" << elementhash[No] << "." << endl << "Exiting." << endl;
     1287          DoLog(2) && (Log() << Verbose(2) << "Error: Too few items in ionic list of element" << elementhash[No] << "." << endl << "Exiting." << endl);
    12841288          // return 1;
    12851289        } else {
     
    13121316  // bring MaxTypes up to date
    13131317  mol->CountElements();
     1318  const double * const cell_size = World::get()->cell_size;
    13141319  ofstream * const output = new ofstream(filename, ios::out);
    13151320  if (output != NULL) {
     
    13821387    *output << endl;
    13831388    *output << "BoxLength\t\t\t# (Length of a unit cell)" << endl;
    1384     *output << mol->cell_size[0] << "\t" << endl;
    1385     *output << mol->cell_size[1] << "\t" << mol->cell_size[2] << "\t" << endl;
    1386     *output << mol->cell_size[3] << "\t" << mol->cell_size[4] << "\t" << mol->cell_size[5] << "\t" << endl;
     1389    *output << cell_size[0] << "\t" << endl;
     1390    *output << cell_size[1] << "\t" << cell_size[2] << "\t" << endl;
     1391    *output << cell_size[3] << "\t" << cell_size[4] << "\t" << cell_size[5] << "\t" << endl;
    13871392    // FIXME
    13881393    *output << endl;
     
    14281433    return result;
    14291434  } else {
    1430     eLog() << Verbose(1) << "Cannot open output file:" << filename << endl;
     1435    DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open output file:" << filename << endl);
    14311436    return false;
    14321437  }
     
    14501455    output = new ofstream(fname->str().c_str(), ios::out);
    14511456    if (output == NULL) {
    1452       eLog() << Verbose(1) << "Cannot open mpqc output file:" << fname << endl;
     1457      DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open mpqc output file:" << fname << endl);
    14531458      delete(fname);
    14541459      return false;
     
    14931498    output = new ofstream(fname->str().c_str(), ios::out);
    14941499    if (output == NULL) {
    1495       eLog() << Verbose(1) << "Cannot open mpqc hessian output file:" << fname << endl;
     1500      DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open mpqc hessian output file:" << fname << endl);
    14961501      delete(fname);
    14971502      return false;
     
    15491554  f = fopen(name, "w" );
    15501555  if (f == NULL) {
    1551     eLog() << Verbose(1) << "Cannot open pdb output file:" << name << endl;
     1556    DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open pdb output file:" << name << endl);
    15521557    return false;
    15531558  }
     
    16041609  f = fopen(name, "w" );
    16051610  if (f == NULL) {
    1606     eLog() << Verbose(1) << "Cannot open pdb output file:" << name << endl;
     1611    DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open pdb output file:" << name << endl);
    16071612    Free(&elementNo);
    16081613    return false;
     
    16411646/** Stores all atoms in a TREMOLO data input file.
    16421647 * Note that this format cannot be parsed again.
     1648 * Note that TREMOLO does not like Id starting at 0, but at 1. Atoms with Id 0 are discarded!
    16431649 * \param *filename name of file (without ".in" suffix!)
    16441650 * \param *mol pointer to molecule
     
    16531659  output = new ofstream(fname->str().c_str(), ios::out);
    16541660  if (output == NULL) {
    1655     eLog() << Verbose(1) << "Cannot open tremolo output file:" << fname << endl;
     1661    DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open tremolo output file:" << fname << endl);
    16561662    delete(fname);
    16571663    return false;
     
    16951701/** Stores all atoms from all molecules in a TREMOLO data input file.
    16961702 * Note that this format cannot be parsed again.
     1703 * Note that TREMOLO does not like Id starting at 0, but at 1. Atoms with Id 0 are discarded!
    16971704 * \param *filename name of file (without ".in" suffix!)
    16981705 * \param *MolList pointer to MoleculeListClass containing all atoms
     
    17071714  output = new ofstream(fname->str().c_str(), ios::out);
    17081715  if (output == NULL) {
    1709     eLog() << Verbose(1) << "Cannot open tremolo output file:" << fname << endl;
     1716    DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open tremolo output file:" << fname << endl);
    17101717    delete(fname);
    17111718    return false;
     
    17471754      while (Walker->next != (*MolWalker)->end) {
    17481755        Walker = Walker->next;
    1749         *output << AtomNo << "\t";
     1756        *output << AtomNo+1 << "\t";
    17501757        *output << Walker->Name << "\t";
    17511758        *output << (*MolWalker)->name << "\t";
    1752         *output << MolCounter << "\t";
     1759        *output << MolCounter+1 << "\t";
    17531760        *output << Walker->node->x[0] << "\t" << Walker->node->x[1] << "\t" << Walker->node->x[2] << "\t";
    17541761        *output << (double)Walker->type->Valence << "\t";
    17551762        *output << Walker->type->symbol << "\t";
    17561763        for (BondList::iterator runner = Walker->ListOfBonds.begin(); runner != Walker->ListOfBonds.end(); runner++)
    1757           *output << LocalNotoGlobalNoMap[MolCounter][ (*runner)->GetOtherAtom(Walker)->nr ] << "\t";
     1764          *output << LocalNotoGlobalNoMap[MolCounter][ (*runner)->GetOtherAtom(Walker)->nr ]+1 << "\t";
    17581765        for(int i=Walker->ListOfBonds.size(); i < MaxNeighbours; i++)
    17591766          *output << "-\t";
Note: See TracChangeset for help on using the changeset viewer.