Ignore:
Timestamp:
Feb 24, 2011, 6:51:32 PM (15 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, 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)
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/molecule_fragmentation.cpp

    rc0d9eb r9d83b6  
    5656  // get maximum bond degree
    5757  for (molecule::const_iterator iter = begin(); iter != end(); ++iter) {
    58     c = ((*iter)->ListOfBonds.size() > c) ? (*iter)->ListOfBonds.size() : c;
     58    const BondList& ListOfBonds = (*iter)->getListOfBonds();
     59    c = (ListOfBonds.size() > c) ? ListOfBonds.size() : c;
    5960  }
    6061  FragmentCount = NoNonHydrogen*(1 << (c*order));
     
    670671        atomiter != (*iter)->end();
    671672        ++atomiter) {
    672       for (BondList::iterator bonditer = (*atomiter)->ListOfBonds.begin();
    673           bonditer != (*atomiter)->ListOfBonds.end();
     673      const BondList& ListOfBonds = (*atomiter)->getListOfBonds();
     674      for (BondList::const_iterator bonditer = ListOfBonds.begin();
     675          bonditer != ListOfBonds.end();
    674676          ++bonditer) {
    675677        (*bonditer)->BondDegree = 1;
     
    10091011    if (SonList[FatherOfRunner->nr] != NULL)  {  // check if this, our father, is present in list
    10101012      // create all bonds
    1011       for (BondList::const_iterator BondRunner = FatherOfRunner->ListOfBonds.begin(); BondRunner != FatherOfRunner->ListOfBonds.end(); (++BondRunner)) {
     1013      const BondList& ListOfBonds = FatherOfRunner->getListOfBonds();
     1014      for (BondList::const_iterator BondRunner = ListOfBonds.begin();
     1015          BondRunner != ListOfBonds.end();
     1016          ++BondRunner) {
    10121017        OtherFather = (*BondRunner)->GetOtherAtom(FatherOfRunner);
    10131018//        Log() << Verbose(2) << "Father " << *FatherOfRunner << " of son " << *SonList[FatherOfRunner->nr] << " is bound to " << *OtherFather;
     
    14161421      // go through all its bonds
    14171422      DoLog(1) && (Log() << Verbose(1) << "Going through all bonds of Walker." << endl);
    1418       for (BondList::const_iterator Runner = Walker->ListOfBonds.begin(); Runner != Walker->ListOfBonds.end(); (++Runner)) {
     1423      const BondList& ListOfBonds = Walker->getListOfBonds();
     1424      for (BondList::const_iterator Runner = ListOfBonds.begin();
     1425          Runner != ListOfBonds.end();
     1426          ++Runner) {
    14191427        OtherWalker = (*Runner)->GetOtherAtom(Walker);
    14201428        if ((RestrictedKeySet.find(OtherWalker->nr) != RestrictedKeySet.end())
     
    18111819    // scan all bonds
    18121820    flag = false;
    1813     for(molecule::iterator AtomRunner = begin(); (!flag) && (AtomRunner != end()); ++AtomRunner)
    1814       for(BondList::iterator BondRunner = (*AtomRunner)->ListOfBonds.begin(); (!flag) && (BondRunner != (*AtomRunner)->ListOfBonds.end()); ++BondRunner) {
     1821    for(molecule::iterator AtomRunner = begin(); (!flag) && (AtomRunner != end()); ++AtomRunner) {
     1822      const BondList& ListOfBonds = (*AtomRunner)->getListOfBonds();
     1823      for(BondList::const_iterator BondRunner = ListOfBonds.begin();
     1824          (!flag) && (BondRunner != ListOfBonds.end());
     1825          ++BondRunner) {
    18151826        Binder = (*BondRunner);
    18161827        for (int i=NDIM;i--;) {
     
    18321843        }
    18331844      }
     1845    }
    18341846    //if (flag) {
    18351847    if (0) {
     
    18531865        ColorList[Walker->nr] = black;    // mark as explored
    18541866        *Walker += Translationvector; // translate
    1855         for (BondList::const_iterator Runner = Walker->ListOfBonds.begin(); Runner != Walker->ListOfBonds.end(); (++Runner)) {
     1867        const BondList& ListOfBonds = Walker->getListOfBonds();
     1868        for (BondList::const_iterator Runner = ListOfBonds.begin();
     1869            Runner != ListOfBonds.end();
     1870            ++Runner) {
    18561871          if ((*Runner) != Binder) {
    18571872            OtherWalker = (*Runner)->GetOtherAtom(Walker);
Note: See TracChangeset for help on using the changeset viewer.