Changeset 55240c4 for src/config.cpp
- Timestamp:
- Jun 21, 2010, 7:56:00 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, Candidate_v1.7.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:
- 2f40c0e
- Parents:
- 1b2d30 (diff), da3024e (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) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/config.cpp
r1b2d30 r55240c4 4 4 * 5 5 */ 6 7 #include "Helpers/MemDebug.hpp" 6 8 7 9 #include <stdio.h> … … 1521 1523 char filename[MAXSTRINGSIZE]; 1522 1524 ofstream output; 1523 molecule *mol = World::getInstance().createMolecule(); 1524 mol->SetNameFromFilename(ConfigFileName); 1525 molecule *mol = NULL; 1525 1526 1526 1527 if (!strcmp(configpath, GetDefaultPath())) { … … 1553 1554 // translate each to its center and merge all molecules in MoleculeListClass into this molecule 1554 1555 int N = molecules->ListOfMolecules.size(); 1555 int *src = new int[N]; 1556 N=0; 1557 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) { 1558 src[N++] = (*ListRunner)->IndexNr; 1559 (*ListRunner)->Translate(&(*ListRunner)->Center); 1560 } 1561 molecules->SimpleMultiAdd(mol, src, N); 1562 delete[](src); 1563 1564 // ... and translate back 1565 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) { 1566 (*ListRunner)->Center.Scale(-1.); 1567 (*ListRunner)->Translate(&(*ListRunner)->Center); 1568 (*ListRunner)->Center.Scale(-1.); 1556 if (N != 1) { // don't do anything in case of only one molecule (shifts mol ids otherwise) 1557 int *src = new int[N]; 1558 N=0; 1559 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) { 1560 src[N++] = (*ListRunner)->IndexNr; 1561 (*ListRunner)->Translate(&(*ListRunner)->Center); 1562 } 1563 mol = World::getInstance().createMolecule(); 1564 mol->SetNameFromFilename(ConfigFileName); 1565 molecules->SimpleMultiMerge(mol, src, N); 1566 mol->doCountAtoms(); 1567 mol->CountElements(); 1568 mol->CalculateOrbitals(*this); 1569 delete[](src); 1570 } else { 1571 if (!molecules->ListOfMolecules.empty()) { 1572 mol = *(molecules->ListOfMolecules.begin()); 1573 mol->doCountAtoms(); 1574 mol->CalculateOrbitals(*this); 1575 } else { 1576 DoeLog(1) && (eLog() << Verbose(1) << "There are no molecules to save!" << endl); 1577 } 1569 1578 } 1570 1579 1571 1580 Log() << Verbose(0) << "Storing configuration ... " << endl; 1572 1581 // get correct valence orbitals 1573 mol->CalculateOrbitals(*this);1574 InitMaxMinStopStep = MaxMinStopStep = MaxPsiDouble;1575 1582 if (ConfigFileName != NULL) { // test the file name 1576 1583 strcpy(filename, ConfigFileName); … … 1632 1639 } 1633 1640 1634 World::getInstance().destroyMolecule(mol); 1641 // don't destroy molecule as it contains all our atoms 1642 //World::getInstance().destroyMolecule(mol); 1635 1643 }; 1636 1644
Note:
See TracChangeset
for help on using the changeset viewer.
