Ignore:
Timestamp:
Mar 1, 2011, 10:16:38 AM (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:
735b1c
Parents:
5702cdb
git-author:
Frederik Heber <heber@…> (02/21/11 23:50:41)
git-committer:
Frederik Heber <heber@…> (03/01/11 10:16:38)
Message:

Renamed ParticleInfo::nr to ParticleInfo::ParticleInfo_nr for easier privatization.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/molecule_graph.cpp

    r5702cdb ra479fa  
    165165    LC = new LinkedCell(cloud, bonddistance);
    166166
    167     // create a list to map Tesselpoint::nr to atom *
     167    // create a list to map Tesselpoint::ParticleInfo_nr to atom *
    168168    DoLog(2) && (Log() << Verbose(2) << "Creating TesselPoint to atom map ... " << endl);
    169169
     
    171171    int i=0;
    172172    for(internal_iterator iter = atoms.begin();iter!= atoms.end(); ++iter){
    173       (*iter)->nr = i++;
     173      (*iter)->setNr(i++);
    174174    }
    175175
     
    194194                      Log() << Verbose(2) << "Current relative cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << " containing " << List->size() << " points." << endl;
    195195                      for (TesselPointSTLList::const_iterator OtherRunner = OtherList->begin(); OtherRunner != OtherList->end(); OtherRunner++) {
    196                         if ((*OtherRunner)->nr > Walker->nr) {
     196                        if ((*OtherRunner)->ParticleInfo_nr > Walker->ParticleInfo_nr) {
    197197                          OtherWalker = dynamic_cast<atom*>(*OtherRunner);
    198198                          ASSERT(OtherWalker,"TesselPoint that was not an atom retrieved from LinkedNode");
     
    202202                          const bool status = (distance <= MaxDistance * MaxDistance) && (distance >= MinDistance * MinDistance);
    203203                          Log() << Verbose(1) << "MinDistance is " << MinDistance << " and MaxDistance is " << MaxDistance << "." << endl;
    204                           if (OtherWalker->father->nr > Walker->father->nr) {
     204                          if (OtherWalker->father->ParticleInfo_nr > Walker->father->ParticleInfo_nr) {
    205205                            if (status) { // create bond if distance is smaller
    206206                              Log() << Verbose(1) << "Adding Bond between " << *Walker << " and " << *OtherWalker << " in distance " << sqrt(distance) << "." << endl;
     
    740740    Walker = BFS.TouchedStack->front();
    741741    BFS.TouchedStack->pop_front();
    742     BFS.PredecessorList[Walker->nr] = NULL;
    743     BFS.ShortestPathList[Walker->nr] = -1;
    744     BFS.ColorList[Walker->nr] = white;
     742    BFS.PredecessorList[Walker->ParticleInfo_nr] = NULL;
     743    BFS.ShortestPathList[Walker->ParticleInfo_nr] = -1;
     744    BFS.ColorList[Walker->ParticleInfo_nr] = white;
    745745  }
    746746};
     
    752752void ResetBFSAccounting(atom *&Walker, struct BFSAccounting &BFS)
    753753{
    754   BFS.ShortestPathList[Walker->nr] = 0;
     754  BFS.ShortestPathList[Walker->ParticleInfo_nr] = 0;
    755755  BFS.BFSStack->clear(); // start with empty BFS stack
    756756  BFS.BFSStack->push_front(Walker);
     
    781781#endif
    782782        DoLog(2) && (Log() << Verbose(2) << "Current OtherAtom is: " << OtherAtom->getName() << " for bond " << *(*Runner) << "." << endl);
    783         if (BFS.ColorList[OtherAtom->nr] == white) {
     783        if (BFS.ColorList[OtherAtom->ParticleInfo_nr] == white) {
    784784          BFS.TouchedStack->push_front(OtherAtom);
    785           BFS.ColorList[OtherAtom->nr] = lightgray;
    786           BFS.PredecessorList[OtherAtom->nr] = Walker; // Walker is the predecessor
    787           BFS.ShortestPathList[OtherAtom->nr] = BFS.ShortestPathList[Walker->nr] + 1;
    788           DoLog(2) && (Log() << Verbose(2) << "Coloring OtherAtom " << OtherAtom->getName() << " lightgray, its predecessor is " << Walker->getName() << " and its Shortest Path is " << BFS.ShortestPathList[OtherAtom->nr] << " egde(s) long." << endl);
    789           //if (BFS.ShortestPathList[OtherAtom->nr] < MinimumRingSize[Walker->GetTrueFather()->nr]) { // Check for maximum distance
     785          BFS.ColorList[OtherAtom->ParticleInfo_nr] = lightgray;
     786          BFS.PredecessorList[OtherAtom->ParticleInfo_nr] = Walker; // Walker is the predecessor
     787          BFS.ShortestPathList[OtherAtom->ParticleInfo_nr] = BFS.ShortestPathList[Walker->ParticleInfo_nr] + 1;
     788          DoLog(2) && (Log() << Verbose(2) << "Coloring OtherAtom " << OtherAtom->getName() << " lightgray, its predecessor is " << Walker->getName() << " and its Shortest Path is " << BFS.ShortestPathList[OtherAtom->ParticleInfo_nr] << " egde(s) long." << endl);
     789          //if (BFS.ShortestPathList[OtherAtom->ParticleInfo_nr] < MinimumRingSize[Walker->GetTrueFather()->nr]) { // Check for maximum distance
    790790          DoLog(3) && (Log() << Verbose(3) << "Putting OtherAtom into queue." << endl);
    791791          BFS.BFSStack->push_front(OtherAtom);
     
    799799      } else {
    800800        DoLog(2) && (Log() << Verbose(2) << "Skipping hydrogen atom " << *OtherAtom << "." << endl);
    801         BFS.ColorList[OtherAtom->nr] = black;
     801        BFS.ColorList[OtherAtom->ParticleInfo_nr] = black;
    802802      }
    803803#endif
     
    806806      }
    807807    }
    808     BFS.ColorList[Walker->nr] = black;
     808    BFS.ColorList[Walker->ParticleInfo_nr] = black;
    809809    DoLog(1) && (Log() << Verbose(1) << "Coloring Walker " << Walker->getName() << " black." << endl);
    810810    if (OtherAtom == BFS.Root) { // if we have found the root, check whether this cycle wasn't already found beforehand
     
    814814          break;
    815815        else
    816           OtherAtom = BFS.PredecessorList[OtherAtom->nr];
     816          OtherAtom = BFS.PredecessorList[OtherAtom->ParticleInfo_nr];
    817817      }
    818818      if (OtherAtom == BackEdge->rightatom) { // if each atom in found cycle is cyclic, loop's been found before already
     
    822822          OtherAtom = BFS.TouchedStack->front();
    823823          BFS.TouchedStack->pop_front();
    824           if (BFS.PredecessorList[OtherAtom->nr] == Walker) {
     824          if (BFS.PredecessorList[OtherAtom->ParticleInfo_nr] == Walker) {
    825825            DoLog(4) && (Log() << Verbose(4) << "Removing " << *OtherAtom << " from lists and stacks." << endl);
    826             BFS.PredecessorList[OtherAtom->nr] = NULL;
    827             BFS.ShortestPathList[OtherAtom->nr] = -1;
    828             BFS.ColorList[OtherAtom->nr] = white;
     826            BFS.PredecessorList[OtherAtom->ParticleInfo_nr] = NULL;
     827            BFS.ShortestPathList[OtherAtom->ParticleInfo_nr] = -1;
     828            BFS.ColorList[OtherAtom->ParticleInfo_nr] = white;
    829829            // rats ... deque has no find()
    830830            std::deque<atom *>::iterator iter = find(
     
    836836            BFS.BFSStack->erase(iter);
    837837          }
    838         } while ((!BFS.TouchedStack->empty()) && (BFS.PredecessorList[OtherAtom->nr] == NULL));
     838        } while ((!BFS.TouchedStack->empty()) && (BFS.PredecessorList[OtherAtom->ParticleInfo_nr] == NULL));
    839839        BFS.TouchedStack->push_front(OtherAtom); // last was wrongly popped
    840840        OtherAtom = BackEdge->rightatom; // set to not Root
     
    842842        OtherAtom = BFS.Root;
    843843    }
    844   } while ((!BFS.BFSStack->empty()) && (OtherAtom != BFS.Root) && (OtherAtom != NULL)); // || (ShortestPathList[OtherAtom->nr] < MinimumRingSize[Walker->GetTrueFather()->nr])));
     844  } while ((!BFS.BFSStack->empty()) && (OtherAtom != BFS.Root) && (OtherAtom != NULL)); // || (ShortestPathList[OtherAtom->ParticleInfo_nr] < MinimumRingSize[Walker->GetTrueFather()->ParticleInfo_nr])));
    845845};
    846846
     
    867867    while (Walker != BackEdge->rightatom) {
    868868      DoLog(0) && (Log() << Verbose(0) << Walker->getName() << " <-> ");
    869       Walker = BFS.PredecessorList[Walker->nr];
     869      Walker = BFS.PredecessorList[Walker->ParticleInfo_nr];
    870870      Walker->GetTrueFather()->IsCyclic = true;
    871871      RingSize++;
     
    874874    // walk through all and set MinimumRingSize
    875875    Walker = BFS.Root;
    876     MinimumRingSize[Walker->GetTrueFather()->nr] = RingSize;
     876    MinimumRingSize[Walker->GetTrueFather()->ParticleInfo_nr] = RingSize;
    877877    while (Walker != BackEdge->rightatom) {
    878       Walker = BFS.PredecessorList[Walker->nr];
    879       if (RingSize < MinimumRingSize[Walker->GetTrueFather()->nr])
    880         MinimumRingSize[Walker->GetTrueFather()->nr] = RingSize;
     878      Walker = BFS.PredecessorList[Walker->ParticleInfo_nr];
     879      if (RingSize < MinimumRingSize[Walker->GetTrueFather()->ParticleInfo_nr])
     880        MinimumRingSize[Walker->GetTrueFather()->ParticleInfo_nr] = RingSize;
    881881    }
    882882    if ((RingSize < MinRingSize) || (MinRingSize == -1))
    883883      MinRingSize = RingSize;
    884884  } else {
    885     DoLog(1) && (Log() << Verbose(1) << "No ring containing " << *BFS.Root << " with length equal to or smaller than " << MinimumRingSize[BFS.Root->GetTrueFather()->nr] << " found." << endl);
     885    DoLog(1) && (Log() << Verbose(1) << "No ring containing " << *BFS.Root << " with length equal to or smaller than " << MinimumRingSize[BFS.Root->GetTrueFather()->ParticleInfo_nr] << " found." << endl);
    886886  }
    887887};
     
    913913        OtherAtom = (*Runner)->GetOtherAtom(Walker);
    914914        //Log() << Verbose(2) << "Current OtherAtom is: " << OtherAtom->Name << " for bond " << *Binder << "." << endl;
    915         if (BFS.ColorList[OtherAtom->nr] == white) {
     915        if (BFS.ColorList[OtherAtom->ParticleInfo_nr] == white) {
    916916          BFS.TouchedStack->push_front(OtherAtom);
    917           BFS.ColorList[OtherAtom->nr] = lightgray;
    918           BFS.PredecessorList[OtherAtom->nr] = Walker; // Walker is the predecessor
    919           BFS.ShortestPathList[OtherAtom->nr] = BFS.ShortestPathList[Walker->nr] + 1;
    920           //Log() << Verbose(2) << "Coloring OtherAtom " << OtherAtom->Name << " lightgray, its predecessor is " << Walker->Name << " and its Shortest Path is " << ShortestPathList[OtherAtom->nr] << " egde(s) long." << endl;
     917          BFS.ColorList[OtherAtom->ParticleInfo_nr] = lightgray;
     918          BFS.PredecessorList[OtherAtom->ParticleInfo_nr] = Walker; // Walker is the predecessor
     919          BFS.ShortestPathList[OtherAtom->ParticleInfo_nr] = BFS.ShortestPathList[Walker->ParticleInfo_nr] + 1;
     920          //Log() << Verbose(2) << "Coloring OtherAtom " << OtherAtom->Name << " lightgray, its predecessor is " << Walker->Name << " and its Shortest Path is " << ShortestPathList[OtherAtom->ParticleInfo_nr] << " egde(s) long." << endl;
    921921          if (OtherAtom->GetTrueFather()->IsCyclic) { // if the other atom is connected to a ring
    922             MinimumRingSize[Root->GetTrueFather()->nr] = BFS.ShortestPathList[OtherAtom->nr] + MinimumRingSize[OtherAtom->GetTrueFather()->nr];
     922            MinimumRingSize[Root->GetTrueFather()->ParticleInfo_nr] = BFS.ShortestPathList[OtherAtom->ParticleInfo_nr] + MinimumRingSize[OtherAtom->GetTrueFather()->ParticleInfo_nr];
    923923            OtherAtom = NULL; //break;
    924924            break;
     
    932932      }
    933933    }
    934     BFS.ColorList[Walker->nr] = black;
     934    BFS.ColorList[Walker->ParticleInfo_nr] = black;
    935935    //Log() << Verbose(1) << "Coloring Walker " << Walker->Name << " black." << endl;
    936936  }
     
    956956      Root = *iter;
    957957
    958       if (MinimumRingSize[Root->GetTrueFather()->nr] == mol->getAtomCount()) { // check whether MinimumRingSize is set, if not BFS to next where it is
     958      if (MinimumRingSize[Root->GetTrueFather()->ParticleInfo_nr] == mol->getAtomCount()) { // check whether MinimumRingSize is set, if not BFS to next where it is
    959959        Walker = Root;
    960960
     
    963963
    964964      }
    965       DoLog(1) && (Log() << Verbose(1) << "Minimum ring size of " << *Root << " is " << MinimumRingSize[Root->GetTrueFather()->nr] << "." << endl);
     965      DoLog(1) && (Log() << Verbose(1) << "Minimum ring size of " << *Root << " is " << MinimumRingSize[Root->GetTrueFather()->ParticleInfo_nr] << "." << endl);
    966966    }
    967967    DoLog(1) && (Log() << Verbose(1) << "Minimum ring size is " << MinRingSize << ", over " << NumCycles << " cycles total." << endl);
     
    10251025 * This is O(N) as the number of bonds per atom is bound.
    10261026 * \param *vertex atom whose next atom::*ComponentNr is to be set
    1027  * \param nr number to use
     1027 * \param ParticleInfo_nr number to use
    10281028 */
    10291029void molecule::SetNextComponentNumber(atom *vertex, int nr) const
     
    10951095
    10961096/** Storing the bond structure of a molecule to file.
    1097  * Simply stores Atom::nr and then the Atom::nr of all bond partners per line.
     1097 * Simply stores Atom::ParticleInfo_nr and then the Atom::ParticleInfo_nr of all bond partners per line.
    10981098 * \param &filename name of file
    10991099 * \param path path to file, defaults to empty
     
    11271127
    11281128/** Storing the bond structure of a molecule to file.
    1129  * Simply stores Atom::nr and then the Atom::nr of all bond partners, one per line.
     1129 * Simply stores Atom::ParticleInfo_nr and then the Atom::ParticleInfo_nr of all bond partners, one per line.
    11301130 * \param &filename name of file
    11311131 * \param path path to file, defaults to empty
     
    11941194        Runner != ListOfBonds.end();
    11951195        ++Runner) {
    1196       id = (*Runner)->GetOtherAtom(Walker)->nr;
     1196      id = (*Runner)->GetOtherAtom(Walker)->ParticleInfo_nr;
    11971197      j = 0;
    11981198      for (; (j < CurrentBondsOfAtom) && (CurrentBonds[j++] != id);)
     
    12171217/** Checks contents of adjacency file against bond structure in structure molecule.
    12181218 * \param *path path to file
    1219  * \param **ListOfAtoms allocated (molecule::AtomCount) and filled lookup table for ids (Atom::nr) to *Atom
     1219 * \param **ListOfAtoms allocated (molecule::AtomCount) and filled lookup table for ids (Atom::ParticleInfo_nr) to *Atom
    12201220 * \return true - structure is equal, false - not equivalence
    12211221 */
     
    12731273
    12741274/** Picks from a global stack with all back edges the ones in the fragment.
    1275  * \param **ListOfLocalAtoms array of father atom::nr to local atom::nr (reverse of atom::father)
     1275 * \param **ListOfLocalAtoms array of father atom::ParticleInfo_nr to local atom::ParticleInfo_nr (reverse of atom::father)
    12761276 * \param *ReferenceStack stack with all the back egdes
    12771277 * \param *LocalStack stack to be filled
     
    12921292
    12931293  do { // go through all bonds and push local ones
    1294     Walker = ListOfLocalAtoms[Binder->leftatom->nr]; // get one atom in the reference molecule
     1294    Walker = ListOfLocalAtoms[Binder->leftatom->ParticleInfo_nr]; // get one atom in the reference molecule
    12951295    if (Walker != NULL) { // if this Walker exists in the subgraph ...
    12961296      const BondList& ListOfBonds = Walker->getListOfBonds();
     
    12991299          ++Runner) {
    13001300        OtherAtom = (*Runner)->GetOtherAtom(Walker);
    1301         if (OtherAtom == ListOfLocalAtoms[(*Runner)->rightatom->nr]) { // found the bond
     1301        if (OtherAtom == ListOfLocalAtoms[(*Runner)->rightatom->ParticleInfo_nr]) { // found the bond
    13021302          LocalStack->push_front((*Runner));
    13031303          DoLog(3) && (Log() << Verbose(3) << "Found local edge " << *(*Runner) << "." << endl);
     
    13391339      BFS.ColorList[i] = white;
    13401340  }
    1341   //BFS.ShortestPathList[Root->nr] = 0; // done by Calloc
     1341  //BFS.ShortestPathList[Root->ParticleInfo_nr] = 0; // done by Calloc
    13421342}
    13431343;
     
    13561356{
    13571357  if (Binder != Bond) // let other atom white if it's via Root bond. In case it's cyclic it has to be reached again (yet Root is from OtherAtom already black, thus no problem)
    1358     BFS.ColorList[OtherAtom->nr] = lightgray;
    1359   BFS.PredecessorList[OtherAtom->nr] = Walker; // Walker is the predecessor
    1360   BFS.ShortestPathList[OtherAtom->nr] = BFS.ShortestPathList[Walker->nr] + 1;
    1361   DoLog(2) && (Log() << Verbose(2) << "Coloring OtherAtom " << OtherAtom->getName() << " " << ((BFS.ColorList[OtherAtom->nr] == white) ? "white" : "lightgray") << ", its predecessor is " << Walker->getName() << " and its Shortest Path is " << BFS.ShortestPathList[OtherAtom->nr] << " egde(s) long." << endl);
    1362   if ((((BFS.ShortestPathList[OtherAtom->nr] < BFS.BondOrder) && (Binder != Bond)))) { // Check for maximum distance
     1358    BFS.ColorList[OtherAtom->ParticleInfo_nr] = lightgray;
     1359  BFS.PredecessorList[OtherAtom->ParticleInfo_nr] = Walker; // Walker is the predecessor
     1360  BFS.ShortestPathList[OtherAtom->ParticleInfo_nr] = BFS.ShortestPathList[Walker->ParticleInfo_nr] + 1;
     1361  DoLog(2) && (Log() << Verbose(2) << "Coloring OtherAtom " << OtherAtom->getName() << " " << ((BFS.ColorList[OtherAtom->ParticleInfo_nr] == white) ? "white" : "lightgray") << ", its predecessor is " << Walker->getName() << " and its Shortest Path is " << BFS.ShortestPathList[OtherAtom->ParticleInfo_nr] << " egde(s) long." << endl);
     1362  if ((((BFS.ShortestPathList[OtherAtom->ParticleInfo_nr] < BFS.BondOrder) && (Binder != Bond)))) { // Check for maximum distance
    13631363    DoLog(3) && (Log() << Verbose(3));
    1364     if (AddedAtomList[OtherAtom->nr] == NULL) { // add if it's not been so far
    1365       AddedAtomList[OtherAtom->nr] = Mol->AddCopyAtom(OtherAtom);
     1364    if (AddedAtomList[OtherAtom->ParticleInfo_nr] == NULL) { // add if it's not been so far
     1365      AddedAtomList[OtherAtom->ParticleInfo_nr] = Mol->AddCopyAtom(OtherAtom);
    13661366      DoLog(0) && (Log() << Verbose(0) << "Added OtherAtom " << OtherAtom->getName());
    1367       AddedBondList[Binder->nr] = Mol->CopyBond(AddedAtomList[Walker->nr], AddedAtomList[OtherAtom->nr], Binder);
     1367      AddedBondList[Binder->nr] = Mol->CopyBond(AddedAtomList[Walker->ParticleInfo_nr], AddedAtomList[OtherAtom->ParticleInfo_nr], Binder);
    13681368      DoLog(0) && (Log() << Verbose(0) << " and bond " << *(AddedBondList[Binder->nr]) << ", ");
    13691369    } else { // this code should actually never come into play (all white atoms are not yet present in BondMolecule, that's why they are white in the first place)
    13701370      DoLog(0) && (Log() << Verbose(0) << "Not adding OtherAtom " << OtherAtom->getName());
    13711371      if (AddedBondList[Binder->nr] == NULL) {
    1372         AddedBondList[Binder->nr] = Mol->CopyBond(AddedAtomList[Walker->nr], AddedAtomList[OtherAtom->nr], Binder);
     1372        AddedBondList[Binder->nr] = Mol->CopyBond(AddedAtomList[Walker->ParticleInfo_nr], AddedAtomList[OtherAtom->ParticleInfo_nr], Binder);
    13731373        DoLog(0) && (Log() << Verbose(0) << ", added Bond " << *(AddedBondList[Binder->nr]));
    13741374      } else
     
    13781378    BFS.BFSStack->push_front(OtherAtom);
    13791379  } else { // out of bond order, then replace
    1380     if ((AddedAtomList[OtherAtom->nr] == NULL) && (Binder->Cyclic))
    1381       BFS.ColorList[OtherAtom->nr] = white; // unmark if it has not been queued/added, to make it available via its other bonds (cyclic)
     1380    if ((AddedAtomList[OtherAtom->ParticleInfo_nr] == NULL) && (Binder->Cyclic))
     1381      BFS.ColorList[OtherAtom->ParticleInfo_nr] = white; // unmark if it has not been queued/added, to make it available via its other bonds (cyclic)
    13821382    if (Binder == Bond)
    13831383      DoLog(3) && (Log() << Verbose(3) << "Not Queueing, is the Root bond");
    1384     else if (BFS.ShortestPathList[OtherAtom->nr] >= BFS.BondOrder)
     1384    else if (BFS.ShortestPathList[OtherAtom->ParticleInfo_nr] >= BFS.BondOrder)
    13851385      DoLog(3) && (Log() << Verbose(3) << "Not Queueing, is out of Bond Count of " << BFS.BondOrder);
    13861386    if (!Binder->Cyclic)
    13871387      DoLog(0) && (Log() << Verbose(0) << ", is not part of a cyclic bond, saturating bond with Hydrogen." << endl);
    13881388    if (AddedBondList[Binder->nr] == NULL) {
    1389       if ((AddedAtomList[OtherAtom->nr] != NULL)) { // .. whether we add or saturate
    1390         AddedBondList[Binder->nr] = Mol->CopyBond(AddedAtomList[Walker->nr], AddedAtomList[OtherAtom->nr], Binder);
     1389      if ((AddedAtomList[OtherAtom->ParticleInfo_nr] != NULL)) { // .. whether we add or saturate
     1390        AddedBondList[Binder->nr] = Mol->CopyBond(AddedAtomList[Walker->ParticleInfo_nr], AddedAtomList[OtherAtom->ParticleInfo_nr], Binder);
    13911391      } else {
    13921392#ifdef ADDHYDROGEN
    1393         if (!Mol->AddHydrogenReplacementAtom(Binder, AddedAtomList[Walker->nr], Walker, OtherAtom, IsAngstroem))
     1393        if (!Mol->AddHydrogenReplacementAtom(Binder, AddedAtomList[Walker->ParticleInfo_nr], Walker, OtherAtom, IsAngstroem))
    13941394        exit(1);
    13951395#endif
     
    14051405  // This has to be a cyclic bond, check whether it's present ...
    14061406  if (AddedBondList[Binder->nr] == NULL) {
    1407     if ((Binder != Bond) && (Binder->Cyclic) && (((BFS.ShortestPathList[Walker->nr] + 1) < BFS.BondOrder))) {
    1408       AddedBondList[Binder->nr] = Mol->CopyBond(AddedAtomList[Walker->nr], AddedAtomList[OtherAtom->nr], Binder);
     1407    if ((Binder != Bond) && (Binder->Cyclic) && (((BFS.ShortestPathList[Walker->ParticleInfo_nr] + 1) < BFS.BondOrder))) {
     1408      AddedBondList[Binder->nr] = Mol->CopyBond(AddedAtomList[Walker->ParticleInfo_nr], AddedAtomList[OtherAtom->ParticleInfo_nr], Binder);
    14091409    } else { // if it's root bond it has to broken (otherwise we would not create the fragments)
    14101410#ifdef ADDHYDROGEN
    1411       if(!Mol->AddHydrogenReplacementAtom(Binder, AddedAtomList[Walker->nr], Walker, OtherAtom, IsAngstroem))
     1411      if(!Mol->AddHydrogenReplacementAtom(Binder, AddedAtomList[Walker->ParticleInfo_nr], Walker, OtherAtom, IsAngstroem))
    14121412      exit(1);
    14131413#endif
     
    14351435
    14361436  // add Root if not done yet
    1437   if (AddedAtomList[Root->nr] == NULL) // add Root if not yet present
    1438     AddedAtomList[Root->nr] = Mol->AddCopyAtom(Root);
     1437  if (AddedAtomList[Root->ParticleInfo_nr] == NULL) // add Root if not yet present
     1438    AddedAtomList[Root->ParticleInfo_nr] = Mol->AddCopyAtom(Root);
    14391439
    14401440  BreadthFirstSearchAdd_Init(BFS, Root, BondOrder, getAtomCount(), AddedAtomList);
     
    14571457        OtherAtom = (*Runner)->GetOtherAtom(Walker);
    14581458        DoLog(2) && (Log() << Verbose(2) << "Current OtherAtom is: " << OtherAtom->getName() << " for bond " << *(*Runner) << "." << endl);
    1459         if (BFS.ColorList[OtherAtom->nr] == white) {
     1459        if (BFS.ColorList[OtherAtom->ParticleInfo_nr] == white) {
    14601460          BreadthFirstSearchAdd_UnvisitedNode(Mol, BFS, Walker, OtherAtom, Binder, Bond, AddedAtomList, AddedBondList, IsAngstroem);
    14611461        } else {
     
    14641464      }
    14651465    }
    1466     BFS.ColorList[Walker->nr] = black;
     1466    BFS.ColorList[Walker->ParticleInfo_nr] = black;
    14671467    DoLog(1) && (Log() << Verbose(1) << "Coloring Walker " << Walker->getName() << " black." << endl);
    14681468  }
     
    15011501  DoLog(3) && (Log() << Verbose(3) << "Filling Parent List." << endl);
    15021502  for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) {
    1503     ParentList[(*iter)->father->nr] = (*iter);
     1503    ParentList[(*iter)->father->ParticleInfo_nr] = (*iter);
    15041504    // Outputting List for debugging
    1505     DoLog(4) && (Log() << Verbose(4) << "Son[" << (*iter)->father->nr << "] of " << (*iter)->father << " is " << ParentList[(*iter)->father->nr] << "." << endl);
     1505    DoLog(4) && (Log() << Verbose(4) << "Son[" << (*iter)->father->ParticleInfo_nr << "] of " << (*iter)->father << " is " << ParentList[(*iter)->father->ParticleInfo_nr] << "." << endl);
    15061506  }
    15071507};
     
    15201520  DoLog(3) && (Log() << Verbose(3) << "Creating bonds." << endl);
    15211521  for (molecule::const_iterator iter = Father->begin(); iter != Father->end(); ++iter) {
    1522     if (ParentList[(*iter)->nr] != NULL) {
    1523       if (ParentList[(*iter)->nr]->father != (*iter)) {
     1522    if (ParentList[(*iter)->ParticleInfo_nr] != NULL) {
     1523      if (ParentList[(*iter)->ParticleInfo_nr]->father != (*iter)) {
    15241524        status = false;
    15251525      } else {
     
    15291529            ++Runner) {
    15301530          OtherAtom = (*Runner)->GetOtherAtom((*iter));
    1531           if (ParentList[OtherAtom->nr] != NULL) { // if otheratom is also a father of an atom on this molecule, create the bond
    1532             DoLog(4) && (Log() << Verbose(4) << "Endpoints of Bond " << (*Runner) << " are both present: " << ParentList[(*iter)->nr]->getName() << " and " << ParentList[OtherAtom->nr]->getName() << "." << endl);
    1533             mol->AddBond(ParentList[(*iter)->nr], ParentList[OtherAtom->nr], (*Runner)->BondDegree);
     1531          if (ParentList[OtherAtom->ParticleInfo_nr] != NULL) { // if otheratom is also a father of an atom on this molecule, create the bond
     1532            DoLog(4) && (Log() << Verbose(4) << "Endpoints of Bond " << (*Runner) << " are both present: " << ParentList[(*iter)->ParticleInfo_nr]->getName() << " and " << ParentList[OtherAtom->ParticleInfo_nr]->getName() << "." << endl);
     1533            mol->AddBond(ParentList[(*iter)->ParticleInfo_nr], ParentList[OtherAtom->ParticleInfo_nr], (*Runner)->BondDegree);
    15341534          }
    15351535        }
Note: See TracChangeset for help on using the changeset viewer.