Changeset 41182a for molecuilder/src/config.cpp
- Timestamp:
- Jan 26, 2010, 12:45:41 PM (16 years ago)
- 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. - File:
-
- 1 edited
-
molecuilder/src/config.cpp (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/config.cpp
r931903 r41182a 140 140 void ConfigFileBuffer::MapIonTypesInBuffer(const int NoAtoms) 141 141 { 142 map<const char *, int, IonTypeCompare> LineList;142 map<const char *, int, IonTypeCompare> IonTypeLineMap; 143 143 if (LineMapping == NULL) { 144 144 eLog() << Verbose(0) << "map pointer is NULL: " << LineMapping << endl; … … 149 149 // put all into hashed map 150 150 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)); 152 152 } 153 153 154 154 // fill map 155 155 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) { 157 157 if (CurrentLine+nr < NoLines) 158 158 LineMapping[CurrentLine+(nr++)] = runner->second; … … 1056 1056 1057 1057 // 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 } 1063 1065 } 1064 1066 1065 1067 // 3. parse the molecule in 1066 1068 LoadMolecule(mol, FileBuffer, periode, FastParsing); 1069 mol->SetNameFromFilename(filename); 1067 1070 mol->ActiveFlag = true; 1071 MolList->insert(mol); 1068 1072 1069 1073 // 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 1073 1078 delete(FileBuffer); 1074 1079 }; … … 1782 1787 ofstream output; 1783 1788 molecule *mol = new molecule(periode); 1784 1785 if (!strcmp(configpath, GetDefaultPath())) { 1789 mol->SetNameFromFilename(ConfigFileName); 1790 1791 if (!strcmp(configuration->configpath, configuration->GetDefaultPath())) { 1786 1792 eLog() << Verbose(2) << "config is found under different path then stated in config file::defaultpath!" << endl; 1787 1793 } … … 1791 1797 if (ConfigFileName != NULL) 1792 1798 strcpy(filename, ConfigFileName); 1793 else1799 if (output == NULL) 1794 1800 strcpy(filename,"main_pcp_linux"); 1795 1801 Log() << Verbose(0) << "Saving as pdb input "; 1796 if ( SavePDB(filename, molecules))1802 if (configuration->SavePDB(filename, molecules)) 1797 1803 Log() << Verbose(0) << "done." << endl; 1798 1804 else … … 1802 1808 if (ConfigFileName != NULL) 1803 1809 strcpy(filename, ConfigFileName); 1804 else1810 if (output == NULL) 1805 1811 strcpy(filename,"main_pcp_linux"); 1806 1812 Log() << Verbose(0) << "Saving as tremolo data input "; 1807 if ( SaveTREMOLO(filename, molecules))1813 if (configuration->SaveTREMOLO(filename, molecules)) 1808 1814 Log() << Verbose(0) << "done." << endl; 1809 1815 else … … 1830 1836 Log() << Verbose(0) << "Storing configuration ... " << endl; 1831 1837 // get correct valence orbitals 1832 mol->CalculateOrbitals(* this);1833 InitMaxMinStopStep = MaxMinStopStep =MaxPsiDouble;1838 mol->CalculateOrbitals(*configuration); 1839 configuration->InitMaxMinStopStep = configuration->MaxMinStopStep = configuration->MaxPsiDouble; 1834 1840 if (ConfigFileName != NULL) { // test the file name 1835 1841 strcpy(filename, ConfigFileName); 1836 1842 output.open(filename, ios::trunc); 1837 } else if (strlen(config name) != 0) {1838 strcpy(filename, config name);1839 output.open(config name, ios::trunc);1843 } else if (strlen(configuration->configname) != 0) { 1844 strcpy(filename, configuration->configname); 1845 output.open(configuration->configname, ios::trunc); 1840 1846 } else { 1841 1847 strcpy(filename, DEFAULTCONFIG); … … 1845 1851 output.clear(); 1846 1852 Log() << Verbose(0) << "Saving of config file "; 1847 if ( Save(filename, periode, mol))1853 if (configuration->Save(filename, periode, mol)) 1848 1854 Log() << Verbose(0) << "successful." << endl; 1849 1855 else … … 1856 1862 output.open(filename, ios::trunc); 1857 1863 } 1858 else{1864 if (output == NULL) { 1859 1865 strcpy(filename,"main_pcp_linux"); 1860 1866 strcat(filename, ".xyz"); … … 1879 1885 if (ConfigFileName != NULL) 1880 1886 strcpy(filename, ConfigFileName); 1881 else1887 if (output == NULL) 1882 1888 strcpy(filename,"main_pcp_linux"); 1883 1889 Log() << Verbose(0) << "Saving as mpqc input "; 1884 if ( SaveMPQC(filename, mol))1890 if (configuration->SaveMPQC(filename, mol)) 1885 1891 Log() << Verbose(0) << "done." << endl; 1886 1892 else 1887 1893 Log() << Verbose(0) << "failed." << endl; 1888 1894 1889 if (!strcmp(config path,GetDefaultPath())) {1895 if (!strcmp(configuration->configpath, configuration->GetDefaultPath())) { 1890 1896 eLog() << Verbose(2) << "config is found under different path then stated in config file::defaultpath!" << endl; 1891 1897 }
Note:
See TracChangeset
for help on using the changeset viewer.
