Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/config.cpp

    r49e1ae r58ed4a  
    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  }
     
    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
     
    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    }
     
    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;
     
    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
     
    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;
     
    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
     
    10621065      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;
     
    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.