Changes in src/config.cpp [274d45:112b09]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/config.cpp
r274d45 r112b09 1784 1784 char filename[MAXSTRINGSIZE]; 1785 1785 ofstream output; 1786 molecule *mol = NULL; 1786 molecule *mol = World::getInstance().createMolecule(); 1787 mol->SetNameFromFilename(ConfigFileName); 1787 1788 1788 1789 if (!strcmp(configpath, GetDefaultPath())) { … … 1815 1816 // translate each to its center and merge all molecules in MoleculeListClass into this molecule 1816 1817 int N = molecules->ListOfMolecules.size(); 1817 if (N != 1) { // don't do anything in case of only one molecule (shifts mol ids otherwise) 1818 int *src = new int[N]; 1819 N=0; 1820 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) { 1821 src[N++] = (*ListRunner)->IndexNr; 1822 (*ListRunner)->Translate(&(*ListRunner)->Center); 1823 } 1824 mol = World::getInstance().createMolecule(); 1825 mol->SetNameFromFilename(ConfigFileName); 1826 molecules->SimpleMultiMerge(mol, src, N); 1827 mol->doCountAtoms(); 1828 mol->CountElements(); 1829 mol->CalculateOrbitals(*this); 1830 delete[](src); 1831 } else { 1832 if (!molecules->ListOfMolecules.empty()) { 1833 mol = *(molecules->ListOfMolecules.begin()); 1834 mol->doCountAtoms(); 1835 mol->CalculateOrbitals(*this); 1836 } else { 1837 DoeLog(1) && (eLog() << Verbose(1) << "There are no molecules to save!" << endl); 1838 } 1818 int *src = new int[N]; 1819 N=0; 1820 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) { 1821 src[N++] = (*ListRunner)->IndexNr; 1822 (*ListRunner)->Translate(&(*ListRunner)->Center); 1823 } 1824 molecules->SimpleMultiAdd(mol, src, N); 1825 delete[](src); 1826 1827 // ... and translate back 1828 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) { 1829 (*ListRunner)->Center.Scale(-1.); 1830 (*ListRunner)->Translate(&(*ListRunner)->Center); 1831 (*ListRunner)->Center.Scale(-1.); 1839 1832 } 1840 1833 1841 1834 Log() << Verbose(0) << "Storing configuration ... " << endl; 1842 1835 // get correct valence orbitals 1836 mol->CalculateOrbitals(*this); 1837 InitMaxMinStopStep = MaxMinStopStep = MaxPsiDouble; 1843 1838 if (ConfigFileName != NULL) { // test the file name 1844 1839 strcpy(filename, ConfigFileName); … … 1900 1895 } 1901 1896 1902 // don't destroy molecule as it contains all our atoms 1903 //World::getInstance().destroyMolecule(mol); 1897 World::getInstance().destroyMolecule(mol); 1904 1898 }; 1905 1899
Note:
See TracChangeset
for help on using the changeset viewer.