Changeset b8d1aeb for src/config.cpp
- Timestamp:
- Feb 2, 2010, 11:38:06 AM (16 years ago)
- 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. - File:
-
- 1 edited
-
src/config.cpp (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/config.cpp
r9fe36b rb8d1aeb 6 6 7 7 #include <stdio.h> 8 #include <cstring> 8 9 9 10 #include "atom.hpp" … … 27 28 char number1[8]; 28 29 char number2[8]; 29 c har *dummy1, *dummy2;30 const char *dummy1, *dummy2; 30 31 //Log() << Verbose(0) << s1 << " " << s2 << endl; 31 32 dummy1 = strchr(s1, '_')+sizeof(char)*5; // go just after "Ion_Type" … … 140 141 void ConfigFileBuffer::MapIonTypesInBuffer(const int NoAtoms) 141 142 { 142 map<const char *, int, IonTypeCompare> LineList;143 map<const char *, int, IonTypeCompare> IonTypeLineMap; 143 144 if (LineMapping == NULL) { 144 145 eLog() << Verbose(0) << "map pointer is NULL: " << LineMapping << endl; … … 149 150 // put all into hashed map 150 151 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)); 152 153 } 153 154 154 155 // fill map 155 156 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) { 157 158 if (CurrentLine+nr < NoLines) 158 159 LineMapping[CurrentLine+(nr++)] = runner->second; … … 1056 1057 1057 1058 // 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 } 1063 1066 } 1064 1067 1065 1068 // 3. parse the molecule in 1066 1069 LoadMolecule(mol, FileBuffer, periode, FastParsing); 1070 mol->SetNameFromFilename(filename); 1067 1071 mol->ActiveFlag = true; 1072 MolList->insert(mol); 1068 1073 1069 1074 // 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 1073 1079 delete(FileBuffer); 1074 1080 }; … … 1782 1788 ofstream output; 1783 1789 molecule *mol = new molecule(periode); 1790 mol->SetNameFromFilename(ConfigFileName); 1784 1791 1785 1792 if (!strcmp(configpath, GetDefaultPath())) { … … 1791 1798 if (ConfigFileName != NULL) 1792 1799 strcpy(filename, ConfigFileName); 1793 else1800 if (output == NULL) 1794 1801 strcpy(filename,"main_pcp_linux"); 1795 1802 Log() << Verbose(0) << "Saving as pdb input "; … … 1802 1809 if (ConfigFileName != NULL) 1803 1810 strcpy(filename, ConfigFileName); 1804 else1811 if (output == NULL) 1805 1812 strcpy(filename,"main_pcp_linux"); 1806 1813 Log() << Verbose(0) << "Saving as tremolo data input "; … … 1856 1863 output.open(filename, ios::trunc); 1857 1864 } 1858 else{1865 if (output == NULL) { 1859 1866 strcpy(filename,"main_pcp_linux"); 1860 1867 strcat(filename, ".xyz"); … … 1879 1886 if (ConfigFileName != NULL) 1880 1887 strcpy(filename, ConfigFileName); 1881 else1888 if (output == NULL) 1882 1889 strcpy(filename,"main_pcp_linux"); 1883 1890 Log() << Verbose(0) << "Saving as mpqc input "; … … 2241 2248 } 2242 2249 line++; 2243 } while ( dummy1 != NULL && (dummy1[0] == '#') || (dummy1[0] == '\n'));2250 } while ((dummy1 != NULL) && ((dummy1[0] == '#') || (dummy1[0] == '\n'))); 2244 2251 dummy = dummy1; 2245 2252 } else { // simple int, strings or doubles start in the same line
Note:
See TracChangeset
for help on using the changeset viewer.
