Ignore:
Timestamp:
Mar 1, 2011, 10:16:39 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:
5309ba
Parents:
a479fa
git-author:
Frederik Heber <heber@…> (02/22/11 00:15:33)
git-committer:
Frederik Heber <heber@…> (03/01/11 10:16:39)
Message:

ParticleInfo::ParticleInfo_nr is protected and accessed via getter/setter.

  • many changes (~400) in molecule- and tesselation-related functions.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/molecule_fragmentation.cpp

    ra479fa r735b1c  
    425425    No = (*runner).second.first;
    426426    Walker = mol->FindAtom(No);
    427     //if (Walker->AdaptiveOrder < MinimumRingSize[Walker->ParticleInfo_nr]) {
     427    //if (Walker->AdaptiveOrder < MinimumRingSize[Walker->getNr()]) {
    428428      DoLog(2) && (Log() << Verbose(2) << "Root " << No << " is still above threshold (10^{" << Order <<"}: " << runner->first << ", setting entry " << No << " of Atom mask to true." << endl);
    429429      AtomMask[No] = true;
    430430      status = true;
    431431    //} else
    432       //Log() << Verbose(2) << "Root " << No << " is still above threshold (10^{" << Order <<"}: " << runner->first << ", however MinimumRingSize of " << MinimumRingSize[Walker->ParticleInfo_nr] << " does not allow further adaptive increase." << endl;
     432      //Log() << Verbose(2) << "Root " << No << " is still above threshold (10^{" << Order <<"}: " << runner->first << ", however MinimumRingSize of " << MinimumRingSize[Walker->getNr()] << " does not allow further adaptive increase." << endl;
    433433  }
    434434  return status;
     
    488488    #endif
    489489        {
    490           AtomMask[(*iter)->ParticleInfo_nr] = true;  // include all (non-hydrogen) atoms
     490          AtomMask[(*iter)->getNr()] = true;  // include all (non-hydrogen) atoms
    491491          status = true;
    492492        }
     
    508508  #endif
    509509      {
    510         AtomMask[(*iter)->ParticleInfo_nr] = true;  // include all (non-hydrogen) atoms
    511         if ((Order != 0) && ((*iter)->AdaptiveOrder < Order)) // && ((*iter)->AdaptiveOrder < MinimumRingSize[(*iter)->ParticleInfo_nr]))
     510        AtomMask[(*iter)->getNr()] = true;  // include all (non-hydrogen) atoms
     511        if ((Order != 0) && ((*iter)->AdaptiveOrder < Order)) // && ((*iter)->AdaptiveOrder < MinimumRingSize[(*iter)->getNr()]))
    512512          status = true;
    513513      }
     
    546546  int AtomNo = 0;
    547547  for(internal_iterator iter=atoms.begin();iter!=atoms.end();++iter){
    548     ASSERT(SortIndex[(*iter)->ParticleInfo_nr]==-1,"Same SortIndex set twice");
    549     SortIndex[(*iter)->ParticleInfo_nr] = AtomNo++;
     548    ASSERT(SortIndex[(*iter)->getNr()]==-1,"Same SortIndex set twice");
     549    SortIndex[(*iter)->getNr()] = AtomNo++;
    550550  }
    551551
     
    575575  if (count == 0) {
    576576    for (molecule::iterator iter = begin(); iter != end(); ++iter) { // create a lookup table (Atom::ParticleInfo_nr -> atom) used as a marker table lateron
    577       count = (count < (*iter)->GetTrueFather()->ParticleInfo_nr) ? (*iter)->GetTrueFather()->ParticleInfo_nr : count;
     577      count = (count < (*iter)->GetTrueFather()->getNr()) ? (*iter)->GetTrueFather()->getNr() : count;
    578578    }
    579579  }
     
    593593      LookupTable[i] = NULL;
    594594    for (molecule::iterator iter = begin(); iter != end(); ++iter) {
    595       AtomNo = (*iter)->GetTrueFather()->ParticleInfo_nr;
     595      AtomNo = (*iter)->GetTrueFather()->getNr();
    596596      if ((AtomNo >= 0) && (AtomNo < count)) {
    597597        //*out << "Setting LookupTable[" << AtomNo << "] to " << *(*iter) << endl;
     
    917917    // set atom values
    918918    for(internal_iterator iter=atoms.begin();iter!=atoms.end();++iter){
    919       (*iter)->AdaptiveOrder = OrderArray[(*iter)->ParticleInfo_nr];
    920       (*iter)->MaxOrder = MaxArray[(*iter)->ParticleInfo_nr];
    921     }
    922     //SetAtomValueToIndexedArray( OrderArray, &atom::ParticleInfo_nr, &atom::AdaptiveOrder );
    923     //SetAtomValueToIndexedArray( MaxArray, &atom::ParticleInfo_nr, &atom::MaxOrder );
     919      (*iter)->AdaptiveOrder = OrderArray[(*iter)->getNr()];
     920      (*iter)->MaxOrder = MaxArray[(*iter)->getNr()];
     921    }
     922    //SetAtomValueToIndexedArray( OrderArray, &atom::getNr(), &atom::AdaptiveOrder );
     923    //SetAtomValueToIndexedArray( MaxArray, &atom::getNr(), &atom::MaxOrder );
    924924
    925925    DoLog(1) && (Log() << Verbose(1) << "\t ... done." << endl);
     
    981981  for(KeySet::iterator runner = Leaflet.begin(); runner != Leaflet.end(); runner++) {
    982982    FatherOfRunner = mol->FindAtom((*runner));  // find the id
    983     SonList[FatherOfRunner->ParticleInfo_nr] = Leaf->AddCopyAtom(FatherOfRunner);
     983    SonList[FatherOfRunner->getNr()] = Leaf->AddCopyAtom(FatherOfRunner);
    984984    size++;
    985985  }
     
    10081008    FatherOfRunner = (*iter)->father;
    10091009    ASSERT(FatherOfRunner,"Atom without father found");
    1010     if (SonList[FatherOfRunner->ParticleInfo_nr] != NULL)  {  // check if this, our father, is present in list
     1010    if (SonList[FatherOfRunner->getNr()] != NULL)  {  // check if this, our father, is present in list
    10111011      // create all bonds
    10121012      const BondList& ListOfBonds = FatherOfRunner->getListOfBonds();
     
    10151015          ++BondRunner) {
    10161016        OtherFather = (*BondRunner)->GetOtherAtom(FatherOfRunner);
    1017 //        Log() << Verbose(2) << "Father " << *FatherOfRunner << " of son " << *SonList[FatherOfRunner->ParticleInfo_nr] << " is bound to " << *OtherFather;
    1018         if (SonList[OtherFather->ParticleInfo_nr] != NULL) {
    1019 //          Log() << Verbose(0) << ", whose son is " << *SonList[OtherFather->ParticleInfo_nr] << "." << endl;
    1020           if (OtherFather->ParticleInfo_nr > FatherOfRunner->ParticleInfo_nr) { // add bond (ParticleInfo_nr check is for adding only one of both variants: ab, ba)
     1017//        Log() << Verbose(2) << "Father " << *FatherOfRunner << " of son " << *SonList[FatherOfRunner->getNr()] << " is bound to " << *OtherFather;
     1018        if (SonList[OtherFather->getNr()] != NULL) {
     1019//          Log() << Verbose(0) << ", whose son is " << *SonList[OtherFather->getNr()] << "." << endl;
     1020          if (OtherFather->getNr() > FatherOfRunner->getNr()) { // add bond (ParticleInfo_nr check is for adding only one of both variants: ab, ba)
    10211021//            Log() << Verbose(3) << "Adding Bond: ";
    10221022//            Log() << Verbose(0) <<
    1023             Leaf->AddBond((*iter), SonList[OtherFather->ParticleInfo_nr], (*BondRunner)->BondDegree);
     1023            Leaf->AddBond((*iter), SonList[OtherFather->getNr()], (*BondRunner)->BondDegree);
    10241024//            Log() << Verbose(0) << "." << endl;
    1025             //NumBonds[(*iter)->ParticleInfo_nr]++;
     1025            //NumBonds[(*iter)->getNr()]++;
    10261026          } else {
    10271027//            Log() << Verbose(3) << "Not adding bond, labels in wrong order." << endl;
     
    10351035            exit(1);
    10361036#endif
    1037           //NumBonds[(*iter)->ParticleInfo_nr] += Binder->BondDegree;
     1037          //NumBonds[(*iter)->getNr()] += Binder->BondDegree;
    10381038        }
    10391039      }
    10401040    } else {
    1041     DoeLog(1) && (eLog()<< Verbose(1) << "Son " << (*iter)->getName() << " has father " << FatherOfRunner->getName() << " but its entry in SonList is " << SonList[FatherOfRunner->ParticleInfo_nr] << "!" << endl);
     1041    DoeLog(1) && (eLog()<< Verbose(1) << "Son " << (*iter)->getName() << " has father " << FatherOfRunner->getName() << " but its entry in SonList is " << SonList[FatherOfRunner->getNr()] << "!" << endl);
    10421042    }
    10431043    if ((LonelyFlag) && (Leaf->getAtomCount() > 1)) {
     
    11211121      OtherWalker = BondsSet[j]->rightatom;  // rightatom is always the one more distant, i.e. the one to add
    11221122      //Log() << Verbose(1+verbosity) << "Current Bond is " << BondsSet[j] << ", checking on " << *OtherWalker << "." << endl;
    1123       Log() << Verbose(2+verbosity) << "Adding " << *OtherWalker << " with nr " << OtherWalker->ParticleInfo_nr << "." << endl;
    1124       TestKeySetInsert = FragmentSet->insert(OtherWalker->ParticleInfo_nr);
     1123      Log() << Verbose(2+verbosity) << "Adding " << *OtherWalker << " with nr " << OtherWalker->getNr() << "." << endl;
     1124      TestKeySetInsert = FragmentSet->insert(OtherWalker->getNr());
    11251125      if (TestKeySetInsert.second) {
    1126         TouchedList[TouchedIndex++] = OtherWalker->ParticleInfo_nr;  // note as added
     1126        TouchedList[TouchedIndex++] = OtherWalker->getNr();  // note as added
    11271127        Added++;
    11281128      } else {
     
    11721172      ++Binder) {
    11731173    for (int k=0;k<TouchedIndex;k++) {
    1174       if ((*Binder)->leftatom->ParticleInfo_nr == TouchedList[k])   // leftatom is always the closer one
     1174      if ((*Binder)->leftatom->getNr() == TouchedList[k])   // leftatom is always the closer one
    11751175        BondsList[SetDimension++] = (*Binder);
    11761176    }
     
    13301330{
    13311331  // prepare Label and SP arrays of the BFS search
    1332   FragmentSearch.ShortestPathList[FragmentSearch.Root->ParticleInfo_nr] = 0;
     1332  FragmentSearch.ShortestPathList[FragmentSearch.Root->getNr()] = 0;
    13331333
    13341334  // prepare root level (SP = 0) and a loop bond denoting Root
     
    13541354        iter != FragmentSearch.BondsPerSPList[i].end();
    13551355        ++iter) {
    1356       // Log() << Verbose(0) << "Removing atom " << Binder->leftatom->ParticleInfo_nr << " and " << Binder->rightatom->ParticleInfo_nr << "." << endl; // make sure numbers are local
    1357       FragmentSearch.ShortestPathList[(*iter)->leftatom->ParticleInfo_nr] = -1;
    1358       FragmentSearch.ShortestPathList[(*iter)->rightatom->ParticleInfo_nr] = -1;
     1356      // Log() << Verbose(0) << "Removing atom " << Binder->leftatom->getNr() << " and " << Binder->rightatom->getNr() << "." << endl; // make sure numbers are local
     1357      FragmentSearch.ShortestPathList[(*iter)->leftatom->getNr()] = -1;
     1358      FragmentSearch.ShortestPathList[(*iter)->rightatom->getNr()] = -1;
    13591359    }
    13601360    // delete added bonds
     
    13911391  atom *Predecessor = NULL;
    13921392  bond *Binder = NULL;
    1393   int RootKeyNr = FragmentSearch.Root->GetTrueFather()->ParticleInfo_nr;
     1393  int RootKeyNr = FragmentSearch.Root->GetTrueFather()->getNr();
    13941394  int RemainingWalkers = -1;
    13951395  int SP = -1;
     
    14111411      Walker = (*CurrentEdge)->rightatom;    // rightatom is always the one more distant
    14121412      Predecessor = (*CurrentEdge)->leftatom;    // ... and leftatom is predecessor
    1413       AtomKeyNr = Walker->ParticleInfo_nr;
    1414       DoLog(0) && (Log() << Verbose(0) << "Current Walker is: " << *Walker << " with nr " << Walker->ParticleInfo_nr << " and SP of " << SP << ", with " << RemainingWalkers << " remaining walkers on this level." << endl);
     1413      AtomKeyNr = Walker->getNr();
     1414      DoLog(0) && (Log() << Verbose(0) << "Current Walker is: " << *Walker << " with nr " << Walker->getNr() << " and SP of " << SP << ", with " << RemainingWalkers << " remaining walkers on this level." << endl);
    14151415      // check for new sp level
    14161416      // go through all its bonds
     
    14211421          ++Runner) {
    14221422        OtherWalker = (*Runner)->GetOtherAtom(Walker);
    1423         if ((RestrictedKeySet.find(OtherWalker->ParticleInfo_nr) != RestrictedKeySet.end())
     1423        if ((RestrictedKeySet.find(OtherWalker->getNr()) != RestrictedKeySet.end())
    14241424  #ifdef ADDHYDROGEN
    14251425         && (OtherWalker->getType()->getAtomicNumber() != 1)
    14261426  #endif
    14271427                                                              ) {  // skip hydrogens and restrict to fragment
    1428           DoLog(2) && (Log() << Verbose(2) << "Current partner is " << *OtherWalker << " with nr " << OtherWalker->ParticleInfo_nr << " in bond " << *(*Runner) << "." << endl);
     1428          DoLog(2) && (Log() << Verbose(2) << "Current partner is " << *OtherWalker << " with nr " << OtherWalker->getNr() << " in bond " << *(*Runner) << "." << endl);
    14291429          // set the label if not set (and push on root stack as well)
    1430           if ((OtherWalker != Predecessor) && (OtherWalker->GetTrueFather()->ParticleInfo_nr > RootKeyNr)) { // only pass through those with label bigger than Root's
    1431             FragmentSearch.ShortestPathList[OtherWalker->ParticleInfo_nr] = SP+1;
    1432             DoLog(3) && (Log() << Verbose(3) << "Set Shortest Path to " << FragmentSearch.ShortestPathList[OtherWalker->ParticleInfo_nr] << "." << endl);
     1430          if ((OtherWalker != Predecessor) && (OtherWalker->GetTrueFather()->getNr() > RootKeyNr)) { // only pass through those with label bigger than Root's
     1431            FragmentSearch.ShortestPathList[OtherWalker->getNr()] = SP+1;
     1432            DoLog(3) && (Log() << Verbose(3) << "Set Shortest Path to " << FragmentSearch.ShortestPathList[OtherWalker->getNr()] << "." << endl);
    14331433            // add the bond in between to the SP list
    14341434            Binder = new bond(Walker, OtherWalker); // create a new bond in such a manner, that bond::rightatom is always the one more distant
     
    14381438          } else {
    14391439            if (OtherWalker != Predecessor)
    1440               DoLog(3) && (Log() << Verbose(3) << "Not passing on, as index of " << *OtherWalker << " " << OtherWalker->GetTrueFather()->ParticleInfo_nr << " is smaller than that of Root " << RootKeyNr << "." << endl);
     1440              DoLog(3) && (Log() << Verbose(3) << "Not passing on, as index of " << *OtherWalker << " " << OtherWalker->GetTrueFather()->getNr() << " is smaller than that of Root " << RootKeyNr << "." << endl);
    14411441            else
    14421442              DoLog(3) && (Log() << Verbose(3) << "This is my predecessor " << *Predecessor << "." << endl);
     
    15191519  if (SP >= (Order-1)) {
    15201520    // start with root (push on fragment stack)
    1521     DoLog(0) && (Log() << Verbose(0) << "Starting fragment generation with " << *FragmentSearch.Root << ", local nr is " << FragmentSearch.Root->ParticleInfo_nr << "." << endl);
     1521    DoLog(0) && (Log() << Verbose(0) << "Starting fragment generation with " << *FragmentSearch.Root << ", local nr is " << FragmentSearch.Root->getNr() << "." << endl);
    15221522    FragmentSearch.FragmentSet->clear();
    15231523    DoLog(0) && (Log() << Verbose(0) << "Preparing subset for this root and calling generator." << endl);
     
    15381538  // remove root from stack
    15391539  DoLog(0) && (Log() << Verbose(0) << "Removing root again from stack." << endl);
    1540   FragmentSearch.FragmentSet->erase(FragmentSearch.Root->ParticleInfo_nr);
     1540  FragmentSearch.FragmentSet->erase(FragmentSearch.Root->getNr());
    15411541
    15421542  // free'ing the bonds lists
     
    16091609      }
    16101610    }
    1611     RootStack.push_back(Walker->ParticleInfo_nr);
     1611    RootStack.push_back(Walker->getNr());
    16121612    RootNr++;
    16131613  } while (RootKeyNr != StartNr);
     
    17001700  KeySet CompleteMolecule;
    17011701  for (molecule::const_iterator iter = begin(); iter != end(); ++iter) {
    1702     CompleteMolecule.insert((*iter)->GetTrueFather()->ParticleInfo_nr);
     1702    CompleteMolecule.insert((*iter)->GetTrueFather()->getNr());
    17031703  }
    17041704
     
    17131713    atom *Walker = FindAtom(RootKeyNr);
    17141714    // check cyclic lengths
    1715     //if ((MinimumRingSize[Walker->GetTrueFather()->ParticleInfo_nr] != -1) && (Walker->GetTrueFather()->AdaptiveOrder+1 > MinimumRingSize[Walker->GetTrueFather()->ParticleInfo_nr])) {
     1715    //if ((MinimumRingSize[Walker->GetTrueFather()->getNr()] != -1) && (Walker->GetTrueFather()->AdaptiveOrder+1 > MinimumRingSize[Walker->GetTrueFather()->getNr()])) {
    17161716    //  Log() << Verbose(0) << "Bond order " << Walker->GetTrueFather()->AdaptiveOrder << " of Root " << *Walker << " greater than or equal to Minimum Ring size of " << MinimumRingSize << " found is not allowed." << endl;
    17171717    //} else
     
    18491849        AtomStack->pop_front();
    18501850        //Log() << Verbose (3) << "Current Walker is: " << *Walker << "." << endl;
    1851         ColorList[Walker->ParticleInfo_nr] = black;    // mark as explored
     1851        ColorList[Walker->getNr()] = black;    // mark as explored
    18521852        *Walker += Translationvector; // translate
    18531853        const BondList& ListOfBonds = Walker->getListOfBonds();
     
    18571857          if ((*Runner) != Binder) {
    18581858            OtherWalker = (*Runner)->GetOtherAtom(Walker);
    1859             if (ColorList[OtherWalker->ParticleInfo_nr] == white) {
     1859            if (ColorList[OtherWalker->getNr()] == white) {
    18601860              AtomStack->push_front(OtherWalker); // push if yet unexplored
    18611861            }
Note: See TracChangeset for help on using the changeset viewer.