Changeset 073a9e4 for src/atom_bondedparticle.cpp
- Timestamp:
- Feb 24, 2011, 7:26:14 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, 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:
- 1e6249
- Parents:
- d557374
- git-author:
- Frederik Heber <heber@…> (02/24/11 14:32:36)
- git-committer:
- Frederik Heber <heber@…> (02/24/11 19:26:14)
- File:
-
- 1 edited
-
src/atom_bondedparticle.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/atom_bondedparticle.cpp
rd557374 r073a9e4 103 103 * bond already exists. 104 104 * 105 * @param _step time step to access 105 106 * \param bonding partner 106 107 */ 107 void BondedParticle::addBond( BondedParticle* Partner) {108 if (IsBondedTo( Partner)) {108 void BondedParticle::addBond(const unsigned int _step, BondedParticle* Partner) { 109 if (IsBondedTo(_step, Partner)) { 109 110 return; 110 111 } 111 112 112 113 bond* newBond = new bond((atom*) this, (atom*) Partner, 1, 0); 113 RegisterBond( newBond);114 Partner->RegisterBond( newBond);114 RegisterBond(_step, newBond); 115 Partner->RegisterBond(_step, newBond); 115 116 } 116 117 117 118 /** Puts a given bond into atom::ListOfBonds. 119 * @param _step time step to access 118 120 * \param *Binder bond to insert 119 121 */ 120 bool BondedParticle::RegisterBond( bond *Binder)122 bool BondedParticle::RegisterBond(const unsigned int _step, bond *Binder) 121 123 { 122 124 bool status = false; … … 124 126 if (Binder->Contains(this)) { 125 127 //LOG(3,"INFO: Registering bond "<< *Binder << " with atom " << *this << " at step " << _step); 126 BondList& ListOfBonds = getListOfBonds ();128 BondList& ListOfBonds = getListOfBondsAtStep(_step); 127 129 ListOfBonds.push_back(Binder); 128 130 status = true; … … 245 247 246 248 /** Checks whether there is a bond between \a this atom and the given \a *BondPartner. 249 * @param _step time step to access 247 250 * \param *BondPartner atom to check for 248 251 * \return true - bond exists, false - bond does not exist 249 252 */ 250 bool BondedParticle::IsBondedTo( BondedParticle * const BondPartner)253 bool BondedParticle::IsBondedTo(const unsigned int _step, BondedParticle * const BondPartner) const 251 254 { 252 255 bool status = false; 253 256 254 const BondList& ListOfBonds = getListOfBonds(); 255 for (BondList::const_iterator runner = ListOfBonds.begin(); runner != ListOfBonds.end(); runner++) { 257 const BondList& ListOfBonds = getListOfBondsAtStep(_step); 258 for (BondList::const_iterator runner = ListOfBonds.begin(); 259 runner != ListOfBonds.end(); 260 runner++) { 256 261 status = status || ((*runner)->Contains(BondPartner)); 257 262 }
Note:
See TracChangeset
for help on using the changeset viewer.
