Changeset 68f03d for src/molecule_graph.cpp
- Timestamp:
- May 8, 2010, 12:47:57 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, 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:
- 6d789df
- Parents:
- 6f646d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/molecule_graph.cpp
r6f646d r68f03d 317 317 Walker->GraphNr = DFS.CurrentGraphNr; 318 318 Walker->LowpointNr = DFS.CurrentGraphNr; 319 DoLog(1) && (Log() << Verbose(1) << "Setting Walker[" << Walker-> Name<< "]'s number to " << Walker->GraphNr << " with Lowpoint " << Walker->LowpointNr << "." << endl);319 DoLog(1) && (Log() << Verbose(1) << "Setting Walker[" << Walker->getName() << "]'s number to " << Walker->GraphNr << " with Lowpoint " << Walker->LowpointNr << "." << endl); 320 320 DFS.AtomStack->Push(Walker); 321 321 DFS.CurrentGraphNr++; … … 348 348 Binder->MarkUsed(black); 349 349 OtherAtom = Binder->GetOtherAtom(Walker); 350 DoLog(2) && (Log() << Verbose(2) << "(4) OtherAtom is " << OtherAtom-> Name<< "." << endl);350 DoLog(2) && (Log() << Verbose(2) << "(4) OtherAtom is " << OtherAtom->getName() << "." << endl); 351 351 if (OtherAtom->GraphNr != -1) { 352 352 // (4a) ... if "other" atom has been visited (GraphNr != 0), set lowpoint to minimum of both, go to (3) … … 354 354 DFS.BackEdgeStack->Push(Binder); 355 355 Walker->LowpointNr = (Walker->LowpointNr < OtherAtom->GraphNr) ? Walker->LowpointNr : OtherAtom->GraphNr; 356 DoLog(3) && (Log() << Verbose(3) << "(4a) Visited: Setting Lowpoint of Walker[" << Walker-> Name<< "] to " << Walker->LowpointNr << "." << endl);356 DoLog(3) && (Log() << Verbose(3) << "(4a) Visited: Setting Lowpoint of Walker[" << Walker->getName() << "] to " << Walker->LowpointNr << "." << endl); 357 357 } else { 358 358 // (4b) ... otherwise set OtherAtom as Ancestor of Walker and Walker as OtherAtom, go to (2) … … 360 360 OtherAtom->Ancestor = Walker; 361 361 Walker = OtherAtom; 362 DoLog(3) && (Log() << Verbose(3) << "(4b) Not Visited: OtherAtom[" << OtherAtom-> Name << "]'s Ancestor is now " << OtherAtom->Ancestor->Name << ", Walker is OtherAtom " << OtherAtom->Name<< "." << endl);362 DoLog(3) && (Log() << Verbose(3) << "(4b) Not Visited: OtherAtom[" << OtherAtom->getName() << "]'s Ancestor is now " << OtherAtom->Ancestor->getName() << ", Walker is OtherAtom " << OtherAtom->getName() << "." << endl); 363 363 break; 364 364 } … … 382 382 383 383 // (5) if Ancestor of Walker is ... 384 DoLog(1) && (Log() << Verbose(1) << "(5) Number of Walker[" << Walker-> Name << "]'s Ancestor[" << Walker->Ancestor->Name<< "] is " << Walker->Ancestor->GraphNr << "." << endl);384 DoLog(1) && (Log() << Verbose(1) << "(5) Number of Walker[" << Walker->getName() << "]'s Ancestor[" << Walker->Ancestor->getName() << "] is " << Walker->Ancestor->GraphNr << "." << endl); 385 385 386 386 if (Walker->Ancestor->GraphNr != DFS.Root->GraphNr) { … … 389 389 // (6a) set Ancestor's Lowpoint number to minimum of of its Ancestor and itself, go to Step(8) 390 390 Walker->Ancestor->LowpointNr = (Walker->Ancestor->LowpointNr < Walker->LowpointNr) ? Walker->Ancestor->LowpointNr : Walker->LowpointNr; 391 DoLog(2) && (Log() << Verbose(2) << "(6) Setting Walker[" << Walker-> Name << "]'s Ancestor[" << Walker->Ancestor->Name<< "]'s Lowpoint to " << Walker->Ancestor->LowpointNr << "." << endl);391 DoLog(2) && (Log() << Verbose(2) << "(6) Setting Walker[" << Walker->getName() << "]'s Ancestor[" << Walker->Ancestor->getName() << "]'s Lowpoint to " << Walker->Ancestor->LowpointNr << "." << endl); 392 392 } else { 393 393 // (7) (Ancestor of Walker is a separating vertex, remove all from stack till Walker (including), these and Ancestor form a component 394 394 Walker->Ancestor->SeparationVertex = true; 395 DoLog(2) && (Log() << Verbose(2) << "(7) Walker[" << Walker-> Name << "]'s Ancestor[" << Walker->Ancestor->Name<< "]'s is a separating vertex, creating component." << endl);395 DoLog(2) && (Log() << Verbose(2) << "(7) Walker[" << Walker->getName() << "]'s Ancestor[" << Walker->Ancestor->getName() << "]'s is a separating vertex, creating component." << endl); 396 396 mol->SetNextComponentNumber(Walker->Ancestor, DFS.ComponentNumber); 397 DoLog(3) && (Log() << Verbose(3) << "(7) Walker[" << Walker-> Name<< "]'s Ancestor's Compont is " << DFS.ComponentNumber << "." << endl);397 DoLog(3) && (Log() << Verbose(3) << "(7) Walker[" << Walker->getName() << "]'s Ancestor's Compont is " << DFS.ComponentNumber << "." << endl); 398 398 mol->SetNextComponentNumber(Walker, DFS.ComponentNumber); 399 DoLog(3) && (Log() << Verbose(3) << "(7) Walker[" << Walker-> Name<< "]'s Compont is " << DFS.ComponentNumber << "." << endl);399 DoLog(3) && (Log() << Verbose(3) << "(7) Walker[" << Walker->getName() << "]'s Compont is " << DFS.ComponentNumber << "." << endl); 400 400 do { 401 401 OtherAtom = DFS.AtomStack->PopLast(); 402 402 LeafWalker->Leaf->AddCopyAtom(OtherAtom); 403 403 mol->SetNextComponentNumber(OtherAtom, DFS.ComponentNumber); 404 DoLog(3) && (Log() << Verbose(3) << "(7) Other[" << OtherAtom-> Name<< "]'s Compont is " << DFS.ComponentNumber << "." << endl);404 DoLog(3) && (Log() << Verbose(3) << "(7) Other[" << OtherAtom->getName() << "]'s Compont is " << DFS.ComponentNumber << "." << endl); 405 405 } while (OtherAtom != Walker); 406 406 DFS.ComponentNumber++; 407 407 } 408 408 // (8) Walker becomes its Ancestor, go to (3) 409 DoLog(2) && (Log() << Verbose(2) << "(8) Walker[" << Walker-> Name << "] is now its Ancestor " << Walker->Ancestor->Name<< ", backstepping. " << endl);409 DoLog(2) && (Log() << Verbose(2) << "(8) Walker[" << Walker->getName() << "] is now its Ancestor " << Walker->Ancestor->getName() << ", backstepping. " << endl); 410 410 Walker = Walker->Ancestor; 411 411 DFS.BackStepping = true; … … 431 431 //DFS.AtomStack->Output(out); 432 432 mol->SetNextComponentNumber(DFS.Root, DFS.ComponentNumber); 433 DoLog(3) && (Log() << Verbose(3) << "(9) Root[" << DFS.Root-> Name<< "]'s Component is " << DFS.ComponentNumber << "." << endl);433 DoLog(3) && (Log() << Verbose(3) << "(9) Root[" << DFS.Root->getName() << "]'s Component is " << DFS.ComponentNumber << "." << endl); 434 434 mol->SetNextComponentNumber(Walker, DFS.ComponentNumber); 435 DoLog(3) && (Log() << Verbose(3) << "(9) Walker[" << Walker-> Name<< "]'s Component is " << DFS.ComponentNumber << "." << endl);435 DoLog(3) && (Log() << Verbose(3) << "(9) Walker[" << Walker->getName() << "]'s Component is " << DFS.ComponentNumber << "." << endl); 436 436 do { 437 437 OtherAtom = DFS.AtomStack->PopLast(); 438 438 LeafWalker->Leaf->AddCopyAtom(OtherAtom); 439 439 mol->SetNextComponentNumber(OtherAtom, DFS.ComponentNumber); 440 DoLog(3) && (Log() << Verbose(3) << "(7) Other[" << OtherAtom-> Name<< "]'s Compont is " << DFS.ComponentNumber << "." << endl);440 DoLog(3) && (Log() << Verbose(3) << "(7) Other[" << OtherAtom->getName() << "]'s Compont is " << DFS.ComponentNumber << "." << endl); 441 441 } while (OtherAtom != Walker); 442 442 DFS.ComponentNumber++; … … 445 445 Walker = DFS.Root; 446 446 Binder = mol->FindNextUnused(Walker); 447 DoLog(1) && (Log() << Verbose(1) << "(10) Walker is Root[" << DFS.Root-> Name<< "], next Unused Bond is " << Binder << "." << endl);447 DoLog(1) && (Log() << Verbose(1) << "(10) Walker is Root[" << DFS.Root->getName() << "], next Unused Bond is " << Binder << "." << endl); 448 448 if (Binder != NULL) { // Root is separation vertex 449 449 DoLog(1) && (Log() << Verbose(1) << "(11) Root is a separation vertex." << endl); … … 692 692 if (OtherAtom->type->Z != 1) { 693 693 #endif 694 DoLog(2) && (Log() << Verbose(2) << "Current OtherAtom is: " << OtherAtom-> Name<< " for bond " << *(*Runner) << "." << endl);694 DoLog(2) && (Log() << Verbose(2) << "Current OtherAtom is: " << OtherAtom->getName() << " for bond " << *(*Runner) << "." << endl); 695 695 if (BFS.ColorList[OtherAtom->nr] == white) { 696 696 BFS.TouchedStack->Push(OtherAtom); … … 698 698 BFS.PredecessorList[OtherAtom->nr] = Walker; // Walker is the predecessor 699 699 BFS.ShortestPathList[OtherAtom->nr] = BFS.ShortestPathList[Walker->nr] + 1; 700 DoLog(2) && (Log() << Verbose(2) << "Coloring OtherAtom " << OtherAtom-> Name << " lightgray, its predecessor is " << Walker->Name<< " and its Shortest Path is " << BFS.ShortestPathList[OtherAtom->nr] << " egde(s) long." << endl);700 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); 701 701 //if (BFS.ShortestPathList[OtherAtom->nr] < MinimumRingSize[Walker->GetTrueFather()->nr]) { // Check for maximum distance 702 702 DoLog(3) && (Log() << Verbose(3) << "Putting OtherAtom into queue." << endl); … … 719 719 } 720 720 BFS.ColorList[Walker->nr] = black; 721 DoLog(1) && (Log() << Verbose(1) << "Coloring Walker " << Walker-> Name<< " black." << endl);721 DoLog(1) && (Log() << Verbose(1) << "Coloring Walker " << Walker->getName() << " black." << endl); 722 722 if (OtherAtom == BFS.Root) { // if we have found the root, check whether this cycle wasn't already found beforehand 723 723 // step through predecessor list … … 770 770 Walker = BFS.Root; 771 771 while (Walker != BackEdge->rightatom) { 772 DoLog(0) && (Log() << Verbose(0) << Walker-> Name<< " <-> ");772 DoLog(0) && (Log() << Verbose(0) << Walker->getName() << " <-> "); 773 773 Walker = BFS.PredecessorList[Walker->nr]; 774 774 Walker->GetTrueFather()->IsCyclic = true; 775 775 RingSize++; 776 776 } 777 DoLog(0) && (Log() << Verbose(0) << Walker-> Name<< " with a length of " << RingSize << "." << endl << endl);777 DoLog(0) && (Log() << Verbose(0) << Walker->getName() << " with a length of " << RingSize << "." << endl << endl); 778 778 // walk through all and set MinimumRingSize 779 779 Walker = BFS.Root; … … 1233 1233 BFS.PredecessorList[OtherAtom->nr] = Walker; // Walker is the predecessor 1234 1234 BFS.ShortestPathList[OtherAtom->nr] = BFS.ShortestPathList[Walker->nr] + 1; 1235 DoLog(2) && (Log() << Verbose(2) << "Coloring OtherAtom " << OtherAtom-> Name << " " << ((BFS.ColorList[OtherAtom->nr] == white) ? "white" : "lightgray") << ", its predecessor is " << Walker->Name<< " and its Shortest Path is " << BFS.ShortestPathList[OtherAtom->nr] << " egde(s) long." << endl);1235 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); 1236 1236 if ((((BFS.ShortestPathList[OtherAtom->nr] < BFS.BondOrder) && (Binder != Bond)))) { // Check for maximum distance 1237 1237 DoLog(3) && (Log() << Verbose(3)); 1238 1238 if (AddedAtomList[OtherAtom->nr] == NULL) { // add if it's not been so far 1239 1239 AddedAtomList[OtherAtom->nr] = Mol->AddCopyAtom(OtherAtom); 1240 DoLog(0) && (Log() << Verbose(0) << "Added OtherAtom " << OtherAtom-> Name);1240 DoLog(0) && (Log() << Verbose(0) << "Added OtherAtom " << OtherAtom->getName()); 1241 1241 AddedBondList[Binder->nr] = Mol->CopyBond(AddedAtomList[Walker->nr], AddedAtomList[OtherAtom->nr], Binder); 1242 1242 DoLog(0) && (Log() << Verbose(0) << " and bond " << *(AddedBondList[Binder->nr]) << ", "); 1243 1243 } 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) 1244 DoLog(0) && (Log() << Verbose(0) << "Not adding OtherAtom " << OtherAtom-> Name);1244 DoLog(0) && (Log() << Verbose(0) << "Not adding OtherAtom " << OtherAtom->getName()); 1245 1245 if (AddedBondList[Binder->nr] == NULL) { 1246 1246 AddedBondList[Binder->nr] = Mol->CopyBond(AddedAtomList[Walker->nr], AddedAtomList[OtherAtom->nr], Binder); … … 1322 1322 // followed by n+1 till top of stack. 1323 1323 Walker = BFS.BFSStack->PopFirst(); // pop oldest added 1324 DoLog(1) && (Log() << Verbose(1) << "Current Walker is: " << Walker-> Name<< ", and has " << Walker->ListOfBonds.size() << " bonds." << endl);1324 DoLog(1) && (Log() << Verbose(1) << "Current Walker is: " << Walker->getName() << ", and has " << Walker->ListOfBonds.size() << " bonds." << endl); 1325 1325 for (BondList::const_iterator Runner = Walker->ListOfBonds.begin(); Runner != Walker->ListOfBonds.end(); (++Runner)) { 1326 1326 if ((*Runner) != NULL) { // don't look at bond equal NULL 1327 1327 Binder = (*Runner); 1328 1328 OtherAtom = (*Runner)->GetOtherAtom(Walker); 1329 DoLog(2) && (Log() << Verbose(2) << "Current OtherAtom is: " << OtherAtom-> Name<< " for bond " << *(*Runner) << "." << endl);1329 DoLog(2) && (Log() << Verbose(2) << "Current OtherAtom is: " << OtherAtom->getName() << " for bond " << *(*Runner) << "." << endl); 1330 1330 if (BFS.ColorList[OtherAtom->nr] == white) { 1331 1331 BreadthFirstSearchAdd_UnvisitedNode(Mol, BFS, Walker, OtherAtom, Binder, Bond, AddedAtomList, AddedBondList, IsAngstroem); … … 1336 1336 } 1337 1337 BFS.ColorList[Walker->nr] = black; 1338 DoLog(1) && (Log() << Verbose(1) << "Coloring Walker " << Walker-> Name<< " black." << endl);1338 DoLog(1) && (Log() << Verbose(1) << "Coloring Walker " << Walker->getName() << " black." << endl); 1339 1339 } 1340 1340 BreadthFirstSearchAdd_Free(BFS); … … 1403 1403 OtherAtom = (*Runner)->GetOtherAtom(Walker); 1404 1404 if (ParentList[OtherAtom->nr] != NULL) { // if otheratom is also a father of an atom on this molecule, create the bond 1405 DoLog(4) && (Log() << Verbose(4) << "Endpoints of Bond " << (*Runner) << " are both present: " << ParentList[Walker->nr]-> Name << " and " << ParentList[OtherAtom->nr]->Name<< "." << endl);1405 DoLog(4) && (Log() << Verbose(4) << "Endpoints of Bond " << (*Runner) << " are both present: " << ParentList[Walker->nr]->getName() << " and " << ParentList[OtherAtom->nr]->getName() << "." << endl); 1406 1406 mol->AddBond(ParentList[Walker->nr], ParentList[OtherAtom->nr], (*Runner)->BondDegree); 1407 1407 }
Note:
See TracChangeset
for help on using the changeset viewer.