Changeset 9d83b6 for src/molecule.cpp
- Timestamp:
- Feb 24, 2011, 6:51:32 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, 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:
- a2bdbe
- Parents:
- c0d9eb
- git-author:
- Frederik Heber <heber@…> (02/24/11 14:41:13)
- git-committer:
- Frederik Heber <heber@…> (02/24/11 18:51:32)
- File:
-
- 1 edited
-
src/molecule.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/molecule.cpp
rc0d9eb r9d83b6 26 26 #include <gsl/gsl_heapsort.h> 27 27 28 #include "World.hpp"29 28 #include "atom.hpp" 30 29 #include "bond.hpp" 30 #include "Box.hpp" 31 #include "CodePatterns/enumeration.hpp" 32 #include "CodePatterns/Log.hpp" 31 33 #include "config.hpp" 32 34 #include "element.hpp" 35 #include "Exceptions/LinearDependenceException.hpp" 33 36 #include "graph.hpp" 34 37 #include "Helpers/helpers.hpp" 35 38 #include "LinearAlgebra/leastsquaremin.hpp" 39 #include "LinearAlgebra/Plane.hpp" 40 #include "LinearAlgebra/RealSpaceMatrix.hpp" 41 #include "LinearAlgebra/Vector.hpp" 36 42 #include "linkedcell.hpp" 37 43 #include "lists.hpp" 38 #include "CodePatterns/Log.hpp"39 44 #include "molecule.hpp" 40 41 45 #include "periodentafel.hpp" 42 46 #include "tesselation.hpp" 43 #include "LinearAlgebra/Vector.hpp"44 #include "LinearAlgebra/RealSpaceMatrix.hpp"45 47 #include "World.hpp" 46 #include "Box.hpp" 47 #include "LinearAlgebra/Plane.hpp" 48 #include "Exceptions/LinearDependenceException.hpp" 49 50 #include "CodePatterns/enumeration.hpp" 48 #include "WorldTime.hpp" 49 51 50 52 51 /************************************* Functions for class molecule *********************************/ … … 383 382 break; 384 383 case 2: 385 // determine two other bonds (warning if there are more than two other) plus valence sanity check 386 for (BondList::const_iterator Runner = TopOrigin->ListOfBonds.begin(); Runner != TopOrigin->ListOfBonds.end(); (++Runner)) { 387 if ((*Runner) != TopBond) { 388 if (FirstBond == NULL) { 389 FirstBond = (*Runner); 390 FirstOtherAtom = (*Runner)->GetOtherAtom(TopOrigin); 391 } else if (SecondBond == NULL) { 392 SecondBond = (*Runner); 393 SecondOtherAtom = (*Runner)->GetOtherAtom(TopOrigin); 394 } else { 395 DoeLog(2) && (eLog()<< Verbose(2) << "Detected more than four bonds for atom " << TopOrigin->getName()); 384 { 385 // determine two other bonds (warning if there are more than two other) plus valence sanity check 386 const BondList& ListOfBonds = TopOrigin->getListOfBonds(); 387 for (BondList::const_iterator Runner = ListOfBonds.begin(); 388 Runner != ListOfBonds.end(); 389 ++Runner) { 390 if ((*Runner) != TopBond) { 391 if (FirstBond == NULL) { 392 FirstBond = (*Runner); 393 FirstOtherAtom = (*Runner)->GetOtherAtom(TopOrigin); 394 } else if (SecondBond == NULL) { 395 SecondBond = (*Runner); 396 SecondOtherAtom = (*Runner)->GetOtherAtom(TopOrigin); 397 } else { 398 DoeLog(2) && (eLog()<< Verbose(2) << "Detected more than four bonds for atom " << TopOrigin->getName()); 399 } 396 400 } 397 401 } … … 642 646 643 647 // copy all bonds 644 for(molecule::const_iterator AtomRunner = begin(); AtomRunner != end(); ++AtomRunner) 645 for(BondList::const_iterator BondRunner = (*AtomRunner)->ListOfBonds.begin(); BondRunner != (*AtomRunner)->ListOfBonds.end(); ++BondRunner) 648 for(molecule::const_iterator AtomRunner = begin(); AtomRunner != end(); ++AtomRunner) { 649 const BondList& ListOfBonds = (*AtomRunner)->getListOfBonds(); 650 for(BondList::const_iterator BondRunner = ListOfBonds.begin(); 651 BondRunner != ListOfBonds.end(); 652 ++BondRunner) 646 653 if ((*BondRunner)->leftatom == *AtomRunner) { 647 654 bond *Binder = (*BondRunner); … … 660 667 NewBond->Type = Binder->Type; 661 668 } 669 } 662 670 // correct fathers 663 671 for_each(atoms.begin(),atoms.end(),mem_fun(&atom::CorrectFather)); … … 749 757 //DoeLog(1) && (eLog()<< Verbose(1) << "molecule::RemoveBond: Function not implemented yet." << endl); 750 758 BondList::const_iterator ForeRunner; 751 while (!BondPartner->ListOfBonds.empty()) { 752 ForeRunner = BondPartner->ListOfBonds.begin(); 759 BondList& ListOfBonds = BondPartner->getListOfBonds(); 760 while (!ListOfBonds.empty()) { 761 ForeRunner = ListOfBonds.begin(); 753 762 RemoveBond(*ForeRunner); 754 763 }
Note:
See TracChangeset
for help on using the changeset viewer.
