Ignore:
Timestamp:
Feb 24, 2011, 6:51:32 PM (14 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:
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)
Message:

BondedParticleInfo now has vector<BondList>

  • vector<BondList> ListOfBonds is private, getter for (non-)const access.
  • Access everywhere to ListOfBonds replaced by respective getter.
  • Access is as of now always to time step zero.
  • greatest impact is on molecule... files, and ListOfBondsUnitTest.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/analysis_bonds.cpp

    rc0d9eb r9d83b6  
    4343  int AtomCount = 0;
    4444  for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) {
    45     const int count = (*iter)->ListOfBonds.size();
     45    const BondList& ListOfBonds = (*iter)->getListOfBonds();
     46    const int count = ListOfBonds.size();
    4647    if (Max < count)
    4748      Max = count;
     
    7273  int AtomNo = 0;
    7374  for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) {
    74     if ((*iter)->getType() == type1)
    75       for (BondList::const_iterator BondRunner = (*iter)->ListOfBonds.begin(); BondRunner != (*iter)->ListOfBonds.end(); BondRunner++)
     75    if ((*iter)->getType() == type1) {
     76      const BondList& ListOfBonds = (*iter)->getListOfBonds();
     77      for (BondList::const_iterator BondRunner = ListOfBonds.begin();
     78          BondRunner != ListOfBonds.end();
     79          BondRunner++)
    7680        if ((*BondRunner)->GetOtherAtom((*iter))->getType() == type2) {
    7781          const double distance = (*BondRunner)->GetDistanceSquared();
     
    8387          AtomNo++;
    8488        }
     89    }
    8590  }
    8691  if (Max < 0) {
     
    161166              InterfaceFlag = (InterfaceElement == NULL);
    162167              Interface2Flag = (Interface2Element == NULL);
    163               for (BondList::const_iterator BondRunner = (*Runner)->ListOfBonds.begin(); BondRunner != (*Runner)->ListOfBonds.end(); BondRunner++) {
     168              const BondList& ListOfBonds = (*Runner)->getListOfBonds();
     169              for (BondList::const_iterator BondRunner = ListOfBonds.begin();
     170                  BondRunner != ListOfBonds.end();
     171                  BondRunner++) {
    164172                atom * const OtherAtom = (*BondRunner)->GetOtherAtom(*Runner);
    165173                // if hydrogen, check angle to be greater(!) than 30 degrees
     
    187195              if (InterfaceFlag && Interface2Flag && OtherHydrogenFlag) {
    188196                // on this element (Walker) we check for bond to hydrogen, i.e. part of water molecule
    189                 for (BondList::const_iterator BondRunner = (*Walker)->ListOfBonds.begin(); BondRunner != (*Walker)->ListOfBonds.end(); BondRunner++) {
     197                const BondList& ListOfBonds = (*Walker)->getListOfBonds();
     198                for (BondList::const_iterator BondRunner = ListOfBonds.begin();
     199                    BondRunner != ListOfBonds.end();
     200                    BondRunner++) {
    190201                  atom * const OtherAtom = (*BondRunner)->GetOtherAtom(*Walker);
    191202                  if (OtherAtom->getType()->getAtomicNumber() == 1) {
     
    223234      atom * theAtom = *Walker;
    224235      if ((theAtom->getType() == first) || (theAtom->getType() == second)) {  // first element matches
    225         for (BondList::const_iterator BondRunner = theAtom->ListOfBonds.begin(); BondRunner != theAtom->ListOfBonds.end(); BondRunner++) {
     236        const BondList& ListOfBonds = theAtom->getListOfBonds();
     237        for (BondList::const_iterator BondRunner = ListOfBonds.begin();
     238            BondRunner != ListOfBonds.end();
     239            BondRunner++) {
    226240          atom * const OtherAtom = (*BondRunner)->GetOtherAtom(theAtom);
    227241          if (((OtherAtom->getType() == first) || (OtherAtom->getType() == second)) && (theAtom->nr < OtherAtom->nr)) {
     
    261275        for (int i=0;i<2;i++)
    262276          MatchFlag[i] = false;
    263         for (BondList::const_iterator BondRunner = theAtom->ListOfBonds.begin(); BondRunner != theAtom->ListOfBonds.end(); BondRunner++) {
     277        const BondList& ListOfBonds = theAtom->getListOfBonds();
     278        for (BondList::const_iterator BondRunner = ListOfBonds.begin();
     279            BondRunner != ListOfBonds.end();
     280            BondRunner++) {
    264281          atom * const OtherAtom = (*BondRunner)->GetOtherAtom(theAtom);
    265282          for (int i=0;i<2;i++)
Note: See TracChangeset for help on using the changeset viewer.