Changeset 274d45 for src/config.cpp
- Timestamp:
- Jun 19, 2010, 3:54:47 PM (15 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, 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:
- bf0edf
- Parents:
- ad2b411
- git-author:
- Frederik Heber <heber@…> (06/19/10 12:35:01)
- git-committer:
- Frederik Heber <heber@…> (06/19/10 15:54:47)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/config.cpp
rad2b411 r274d45 1784 1784 char filename[MAXSTRINGSIZE]; 1785 1785 ofstream output; 1786 molecule *mol = World::getInstance().createMolecule(); 1787 mol->SetNameFromFilename(ConfigFileName); 1786 molecule *mol = NULL; 1788 1787 1789 1788 if (!strcmp(configpath, GetDefaultPath())) { … … 1816 1815 // translate each to its center and merge all molecules in MoleculeListClass into this molecule 1817 1816 int N = molecules->ListOfMolecules.size(); 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.); 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 } 1832 1839 } 1833 1840 1834 1841 Log() << Verbose(0) << "Storing configuration ... " << endl; 1835 1842 // get correct valence orbitals 1836 mol->CalculateOrbitals(*this);1837 InitMaxMinStopStep = MaxMinStopStep = MaxPsiDouble;1838 1843 if (ConfigFileName != NULL) { // test the file name 1839 1844 strcpy(filename, ConfigFileName); … … 1895 1900 } 1896 1901 1897 World::getInstance().destroyMolecule(mol); 1902 // don't destroy molecule as it contains all our atoms 1903 //World::getInstance().destroyMolecule(mol); 1898 1904 }; 1899 1905
Note:
See TracChangeset
for help on using the changeset viewer.