Ignore:
Timestamp:
Jan 26, 2010, 12:45:41 PM (16 years ago)
Author:
Tillmann Crueger <crueger@…>
Children:
d34341
Parents:
931903 (diff), 16807e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge commit 'heber/Analysis_PairCorrelation' into MenuRefactoring

Conflicts:

Makefile.am
molecuilder/src/Makefile.am
molecuilder/src/builder.cpp
molecuilder/src/unittests/Makefile.am

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/config.cpp

    r931903 r41182a  
    140140void ConfigFileBuffer::MapIonTypesInBuffer(const int NoAtoms)
    141141{
    142   map<const char *, int, IonTypeCompare> LineList;
     142  map<const char *, int, IonTypeCompare> IonTypeLineMap;
    143143  if (LineMapping == NULL) {
    144144    eLog() << Verbose(0) << "map pointer is NULL: " << LineMapping << endl;
     
    149149  // put all into hashed map
    150150  for (int i=0; i<NoAtoms; ++i) {
    151     LineList.insert(pair<const char *, int> (buffer[CurrentLine+i], CurrentLine+i));
     151    IonTypeLineMap.insert(pair<const char *, int> (buffer[CurrentLine+i], CurrentLine+i));
    152152  }
    153153
    154154  // fill map
    155155  int nr=0;
    156   for (map<const char *, int, IonTypeCompare>::iterator runner = LineList.begin(); runner != LineList.end(); ++runner) {
     156  for (map<const char *, int, IonTypeCompare>::iterator runner = IonTypeLineMap.begin(); runner != IonTypeLineMap.end(); ++runner) {
    157157    if (CurrentLine+nr < NoLines)
    158158      LineMapping[CurrentLine+(nr++)] = runner->second;
     
    10561056
    10571057  // 2. parse the bond graph file if given
    1058   BG = new BondGraph(IsAngstroem);
    1059   if (BG->LoadBondLengthTable(BondGraphFileName)) {
    1060     Log() << Verbose(0) << "Bond length table loaded successfully." << endl;
    1061   } else {
    1062     eLog() << Verbose(1) << "Bond length table loading failed." << endl;
     1058  if (BG == NULL) {
     1059    BG = new BondGraph(IsAngstroem);
     1060    if (BG->LoadBondLengthTable(BondGraphFileName)) {
     1061      Log() << Verbose(0) << "Bond length table loaded successfully." << endl;
     1062    } else {
     1063      eLog() << Verbose(1) << "Bond length table loading failed." << endl;
     1064    }
    10631065  }
    10641066
    10651067  // 3. parse the molecule in
    10661068  LoadMolecule(mol, FileBuffer, periode, FastParsing);
     1069  mol->SetNameFromFilename(filename);
    10671070  mol->ActiveFlag = true;
     1071  MolList->insert(mol);
    10681072
    10691073  // 4. dissect the molecule into connected subgraphs
    1070   MolList->DissectMoleculeIntoConnectedSubgraphs(mol,this);
    1071 
    1072   delete(mol);
     1074  // don't do this here ...
     1075  //MolList->DissectMoleculeIntoConnectedSubgraphs(mol,this);
     1076  //delete(mol);
     1077
    10731078  delete(FileBuffer);
    10741079};
     
    17821787  ofstream output;
    17831788  molecule *mol = new molecule(periode);
    1784 
    1785   if (!strcmp(configpath, GetDefaultPath())) {
     1789  mol->SetNameFromFilename(ConfigFileName);
     1790
     1791  if (!strcmp(configuration->configpath, configuration->GetDefaultPath())) {
    17861792    eLog() << Verbose(2) << "config is found under different path then stated in config file::defaultpath!" << endl;
    17871793  }
     
    17911797  if (ConfigFileName != NULL)
    17921798    strcpy(filename, ConfigFileName);
    1793   else
     1799  if (output == NULL)
    17941800    strcpy(filename,"main_pcp_linux");
    17951801  Log() << Verbose(0) << "Saving as pdb input ";
    1796   if (SavePDB(filename, molecules))
     1802  if (configuration->SavePDB(filename, molecules))
    17971803    Log() << Verbose(0) << "done." << endl;
    17981804  else
     
    18021808  if (ConfigFileName != NULL)
    18031809    strcpy(filename, ConfigFileName);
    1804   else
     1810  if (output == NULL)
    18051811    strcpy(filename,"main_pcp_linux");
    18061812  Log() << Verbose(0) << "Saving as tremolo data input ";
    1807   if (SaveTREMOLO(filename, molecules))
     1813  if (configuration->SaveTREMOLO(filename, molecules))
    18081814    Log() << Verbose(0) << "done." << endl;
    18091815  else
     
    18301836  Log() << Verbose(0) << "Storing configuration ... " << endl;
    18311837  // get correct valence orbitals
    1832   mol->CalculateOrbitals(*this);
    1833   InitMaxMinStopStep = MaxMinStopStep = MaxPsiDouble;
     1838  mol->CalculateOrbitals(*configuration);
     1839  configuration->InitMaxMinStopStep = configuration->MaxMinStopStep = configuration->MaxPsiDouble;
    18341840  if (ConfigFileName != NULL) { // test the file name
    18351841    strcpy(filename, ConfigFileName);
    18361842    output.open(filename, ios::trunc);
    1837   } else if (strlen(configname) != 0) {
    1838     strcpy(filename, configname);
    1839     output.open(configname, ios::trunc);
     1843  } else if (strlen(configuration->configname) != 0) {
     1844    strcpy(filename, configuration->configname);
     1845    output.open(configuration->configname, ios::trunc);
    18401846    } else {
    18411847      strcpy(filename, DEFAULTCONFIG);
     
    18451851  output.clear();
    18461852  Log() << Verbose(0) << "Saving of config file ";
    1847   if (Save(filename, periode, mol))
     1853  if (configuration->Save(filename, periode, mol))
    18481854    Log() << Verbose(0) << "successful." << endl;
    18491855  else
     
    18561862    output.open(filename, ios::trunc);
    18571863  }
    1858   else {
     1864  if (output == NULL) {
    18591865    strcpy(filename,"main_pcp_linux");
    18601866    strcat(filename, ".xyz");
     
    18791885  if (ConfigFileName != NULL)
    18801886    strcpy(filename, ConfigFileName);
    1881   else
     1887  if (output == NULL)
    18821888    strcpy(filename,"main_pcp_linux");
    18831889  Log() << Verbose(0) << "Saving as mpqc input ";
    1884   if (SaveMPQC(filename, mol))
     1890  if (configuration->SaveMPQC(filename, mol))
    18851891    Log() << Verbose(0) << "done." << endl;
    18861892  else
    18871893    Log() << Verbose(0) << "failed." << endl;
    18881894
    1889   if (!strcmp(configpath, GetDefaultPath())) {
     1895  if (!strcmp(configuration->configpath, configuration->GetDefaultPath())) {
    18901896    eLog() << Verbose(2) << "config is found under different path then stated in config file::defaultpath!" << endl;
    18911897  }
Note: See TracChangeset for help on using the changeset viewer.