Changeset b8d1aeb for src/config.cpp


Ignore:
Timestamp:
Feb 2, 2010, 11:38:06 AM (16 years ago)
Author:
Tillmann Crueger <crueger@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, Candidate_v1.7.0, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
Children:
7ba324
Parents:
9fe36b (diff), 2ededc2 (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 branch 'MenuRefactoring' into QT4Refactoring

Conflicts:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/config.cpp

    r9fe36b rb8d1aeb  
    66
    77#include <stdio.h>
     8#include <cstring>
    89
    910#include "atom.hpp"
     
    2728    char number1[8];
    2829    char number2[8];
    29     char *dummy1, *dummy2;
     30    const char *dummy1, *dummy2;
    3031    //Log() << Verbose(0) << s1 << "  " << s2 << endl;
    3132    dummy1 = strchr(s1, '_')+sizeof(char)*5;  // go just after "Ion_Type"
     
    140141void ConfigFileBuffer::MapIonTypesInBuffer(const int NoAtoms)
    141142{
    142   map<const char *, int, IonTypeCompare> LineList;
     143  map<const char *, int, IonTypeCompare> IonTypeLineMap;
    143144  if (LineMapping == NULL) {
    144145    eLog() << Verbose(0) << "map pointer is NULL: " << LineMapping << endl;
     
    149150  // put all into hashed map
    150151  for (int i=0; i<NoAtoms; ++i) {
    151     LineList.insert(pair<const char *, int> (buffer[CurrentLine+i], CurrentLine+i));
     152    IonTypeLineMap.insert(pair<const char *, int> (buffer[CurrentLine+i], CurrentLine+i));
    152153  }
    153154
    154155  // fill map
    155156  int nr=0;
    156   for (map<const char *, int, IonTypeCompare>::iterator runner = LineList.begin(); runner != LineList.end(); ++runner) {
     157  for (map<const char *, int, IonTypeCompare>::iterator runner = IonTypeLineMap.begin(); runner != IonTypeLineMap.end(); ++runner) {
    157158    if (CurrentLine+nr < NoLines)
    158159      LineMapping[CurrentLine+(nr++)] = runner->second;
     
    10561057
    10571058  // 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;
     1059  if (BG == NULL) {
     1060    BG = new BondGraph(IsAngstroem);
     1061    if (BG->LoadBondLengthTable(BondGraphFileName)) {
     1062      Log() << Verbose(0) << "Bond length table loaded successfully." << endl;
     1063    } else {
     1064      eLog() << Verbose(1) << "Bond length table loading failed." << endl;
     1065    }
    10631066  }
    10641067
    10651068  // 3. parse the molecule in
    10661069  LoadMolecule(mol, FileBuffer, periode, FastParsing);
     1070  mol->SetNameFromFilename(filename);
    10671071  mol->ActiveFlag = true;
     1072  MolList->insert(mol);
    10681073
    10691074  // 4. dissect the molecule into connected subgraphs
    1070   MolList->DissectMoleculeIntoConnectedSubgraphs(mol,this);
    1071 
    1072   delete(mol);
     1075  // don't do this here ...
     1076  //MolList->DissectMoleculeIntoConnectedSubgraphs(mol,this);
     1077  //delete(mol);
     1078
    10731079  delete(FileBuffer);
    10741080};
     
    17821788  ofstream output;
    17831789  molecule *mol = new molecule(periode);
     1790  mol->SetNameFromFilename(ConfigFileName);
    17841791
    17851792  if (!strcmp(configpath, GetDefaultPath())) {
     
    17911798  if (ConfigFileName != NULL)
    17921799    strcpy(filename, ConfigFileName);
    1793   else
     1800  if (output == NULL)
    17941801    strcpy(filename,"main_pcp_linux");
    17951802  Log() << Verbose(0) << "Saving as pdb input ";
     
    18021809  if (ConfigFileName != NULL)
    18031810    strcpy(filename, ConfigFileName);
    1804   else
     1811  if (output == NULL)
    18051812    strcpy(filename,"main_pcp_linux");
    18061813  Log() << Verbose(0) << "Saving as tremolo data input ";
     
    18561863    output.open(filename, ios::trunc);
    18571864  }
    1858   else {
     1865  if (output == NULL) {
    18591866    strcpy(filename,"main_pcp_linux");
    18601867    strcat(filename, ".xyz");
     
    18791886  if (ConfigFileName != NULL)
    18801887    strcpy(filename, ConfigFileName);
    1881   else
     1888  if (output == NULL)
    18821889    strcpy(filename,"main_pcp_linux");
    18831890  Log() << Verbose(0) << "Saving as mpqc input ";
     
    22412248              }
    22422249              line++;
    2243             } while (dummy1 != NULL && (dummy1[0] == '#') || (dummy1[0] == '\n'));
     2250            } while ((dummy1 != NULL) && ((dummy1[0] == '#') || (dummy1[0] == '\n')));
    22442251            dummy = dummy1;
    22452252          } else { // simple int, strings or doubles start in the same line
Note: See TracChangeset for help on using the changeset viewer.