Changeset f63e41 for src/Atom


Ignore:
Timestamp:
Dec 14, 2012, 2:30:23 PM (12 years ago)
Author:
Frederik Heber <heber@…>
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:
8b886f
Parents:
cb2465
git-author:
Frederik Heber <heber@…> (11/14/12 10:37:48)
git-committer:
Frederik Heber <heber@…> (12/14/12 14:30:23)
Message:

Added Actions to add and remove a bond in between two atoms.

  • added new menu "bond".
  • added new CommandLineParser options "bond".
  • added new regression test folder "bond".
  • also added regression tests with undo/redo for the new actions.
Location:
src/Atom
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/Atom/atom_bondedparticle.cpp

    rcb2465 rf63e41  
    3434
    3535#include "CodePatterns/MemDebug.hpp"
     36
     37#include <algorithm>
     38#include <boost/bind.hpp>
    3639
    3740#include "atom.hpp"
     
    116119
    117120  return newBond;
     121}
     122
     123/** Removes a bond of this atom to a given \a Partner.
     124 *
     125 * @param _step time step
     126 * @param Partner bond partner
     127 */
     128void BondedParticle::removeBond(const unsigned int _step, BondedParticle * const Partner)
     129{
     130  const BondList& ListOfBonds = getListOfBondsAtStep(_step);
     131  BondList::const_iterator iter = std::find_if(ListOfBonds.begin(), ListOfBonds.end(),
     132      boost::bind(
     133          static_cast<bool (bond::*)(const ParticleInfo * const) const>(&bond::Contains),
     134          _1,
     135          boost::cref(Partner)));
     136  if (iter != ListOfBonds.end()) {
     137    delete *iter; //dstor takes care of unregistering and all
     138  } else
     139    ELOG(1, "BondedParticle::removeBond() - I cannot find the bond in between "
     140        +toString(getName())+" and "+toString(Partner->getName())+".");
    118141}
    119142
  • src/Atom/atom_bondedparticle.hpp

    rcb2465 rf63e41  
    3838
    3939  bond * const addBond(const unsigned int _step, BondedParticle* Partner);
     40  void removeBond(const unsigned int _step, BondedParticle* Partner);
    4041  void removeBond(bond *binder);
    4142  void removeAllBonds();
  • src/Atom/atom_bondedparticleinfo.hpp

    rcb2465 rf63e41  
    2828class BondedParticle;
    2929
    30 #define BondList list<bond *>
     30#define BondList std::list<bond *>
    3131
    3232/********************************************** declarations *******************************/
Note: See TracChangeset for help on using the changeset viewer.