- Timestamp:
- Feb 10, 2015, 1:51:55 PM (10 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:
- e23fec
- Parents:
- b56114
- git-author:
- Frederik Heber <heber@…> (02/10/15 09:23:51)
- git-committer:
- Frederik Heber <heber@…> (02/10/15 13:51:55)
- Location:
- src/Bond
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Bond/BondInfo.cpp
rb56114 r917300 62 62 if ((leftatom == NULL) || (rightatom == NULL)) { 63 63 ELOG(1, "Either of the two atoms " << leftid << " or " 64 << rightid << " does not exist sin the world.");64 << rightid << " does not exist in the world."); 65 65 return false; 66 66 } 67 67 const BondList &leftbonds = leftatom->getListOfBonds(); 68 boost::function< bool (const bond::ptr )> predicate = 68 const BondList &rightbonds = rightatom->getListOfBonds(); 69 boost::function< bool (const bond::ptr )> leftpredicate = 69 70 boost::bind(static_cast<bool (bond::*)(const int) const>(&bond::Contains), _1, rightid); 70 if (std::find_if(leftbonds.begin(), leftbonds.end(), predicate) != leftbonds.end()) 71 return false; 72 73 const BondList &rightbonds = rightatom->getListOfBonds(); 74 if (std::find_if(rightbonds.begin(), rightbonds.end(), predicate) != rightbonds.end()) 75 return false; 71 boost::function< bool (const bond::ptr )> rightpredicate = 72 boost::bind(static_cast<bool (bond::*)(const int) const>(&bond::Contains), _1, leftid); 73 if ((std::find_if(leftbonds.begin(), leftbonds.end(), leftpredicate) != leftbonds.end()) 74 || (std::find_if(rightbonds.begin(), rightbonds.end(), rightpredicate) != rightbonds.end())) { 75 LOG(3, "DEBUG: Bond between atoms " << leftid << " or " 76 << rightid << " is already present in the world."); 77 return true; 78 } 76 79 77 80 // create bond … … 81 84 return true; 82 85 } 86 87 void BondInfo::RemoveBond() const 88 { 89 atom * leftatom = World::getInstance().getAtom(AtomById(leftid)); 90 atom * rightatom = World::getInstance().getAtom(AtomById(rightid)); 91 leftatom->removeBond(rightatom); 92 } -
src/Bond/BondInfo.hpp
rb56114 r917300 37 37 bool RecreateBond() const; 38 38 39 /** Removes the bond whose state is contained in this BondInfo. 40 * 41 */ 42 void RemoveBond() const; 43 39 44 //!> id of left bond partner 40 45 atomId_t leftid;
Note:
See TracChangeset
for help on using the changeset viewer.