Changeset 266237 for src/molecule_fragmentation.cpp
- Timestamp:
- Oct 18, 2009, 2:51:38 PM (16 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, 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:
- 174e0e
- Parents:
- b8b75d
- git-author:
- Frederik Heber <heber@…> (10/18/09 14:15:37)
- git-committer:
- Frederik Heber <heber@…> (10/18/09 14:51:38)
- File:
-
- 1 edited
-
src/molecule_fragmentation.cpp (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/molecule_fragmentation.cpp
rb8b75d r266237 31 31 int molecule::GuesstimateFragmentCount(ofstream *out, int order) 32 32 { 33 int c = 0;33 size_t c = 0; 34 34 int FragmentCount; 35 35 // get maximum bond degree … … 37 37 while (Walker->next != end) { 38 38 Walker = Walker->next; 39 c = ( NumberOfBondsPerAtom[Walker->nr] > c) ? NumberOfBondsPerAtom[Walker->nr]: c;39 c = (Walker->ListOfBonds.size() > c) ? Walker->ListOfBonds.size() : c; 40 40 } 41 41 FragmentCount = NoNonHydrogen*(1 << (c*order)); … … 564 564 565 565 // ===== 1. Check whether bond structure is same as stored in files ==== 566 567 // fill the adjacency list568 CreateListOfBondsPerAtom(out);569 566 570 567 // create lookup table for Atom::nr … … 630 627 MolecularWalker = MolecularWalker->next; 631 628 *out << Verbose(1) << "Fragmenting subgraph " << MolecularWalker << "." << endl; 632 //MolecularWalker->Leaf->OutputListOfBonds(out); // output ListOfBondsPerAtomfor debugging629 //MolecularWalker->Leaf->OutputListOfBonds(out); // output atom::ListOfBonds for debugging 633 630 if (MolecularWalker->Leaf->first->next != MolecularWalker->Leaf->last) { 634 631 // call BOSSANOVA method … … 879 876 if (SonList[FatherOfRunner->nr] != NULL) { // check if this, our father, is present in list 880 877 // create all bonds 881 for ( int i=0;i<mol->NumberOfBondsPerAtom[FatherOfRunner->nr];i++) { // go through every bond of father882 OtherFather = mol->ListOfBondsPerAtom[FatherOfRunner->nr][i]->GetOtherAtom(FatherOfRunner);878 for (BondList::const_iterator BondRunner = FatherOfRunner->ListOfBonds.begin(); BondRunner != FatherOfRunner->ListOfBonds.end(); (++BondRunner)) { 879 OtherFather = (*BondRunner)->GetOtherAtom(FatherOfRunner); 883 880 // *out << Verbose(2) << "Father " << *FatherOfRunner << " of son " << *SonList[FatherOfRunner->nr] << " is bound to " << *OtherFather; 884 881 if (SonList[OtherFather->nr] != NULL) { … … 887 884 // *out << Verbose(3) << "Adding Bond: "; 888 885 // *out << 889 Leaf->AddBond(Runner, SonList[OtherFather->nr], mol->ListOfBondsPerAtom[FatherOfRunner->nr][i]->BondDegree);886 Leaf->AddBond(Runner, SonList[OtherFather->nr], (*BondRunner)->BondDegree); 890 887 // *out << "." << endl; 891 888 //NumBonds[Runner->nr]++; … … 898 895 #ifdef ADDHYDROGEN 899 896 //*out << Verbose(3) << "Adding Hydrogen to " << Runner->Name << " and a bond in between." << endl; 900 if(!Leaf->AddHydrogenReplacementAtom(out, mol->ListOfBondsPerAtom[FatherOfRunner->nr][i], Runner, FatherOfRunner, OtherFather, mol->ListOfBondsPerAtom[FatherOfRunner->nr],mol->NumberOfBondsPerAtom[FatherOfRunner->nr], IsAngstroem))897 if(!Leaf->AddHydrogenReplacementAtom(out, (*BondRunner), Runner, FatherOfRunner, OtherFather, IsAngstroem)) 901 898 exit(1); 902 899 #endif 903 //NumBonds[Runner->nr] += ListOfBondsPerAtom[FatherOfRunner->nr][i]->BondDegree;900 //NumBonds[Runner->nr] += Binder->BondDegree; 904 901 } 905 902 } … … 936 933 CreateInducedSubgraphOfFragment(out, this, Leaf, SonList, IsAngstroem); 937 934 938 Leaf->CreateListOfBondsPerAtom(out);939 935 //Leaflet->Leaf->ScanForPeriodicCorrection(out); 940 936 Free(&SonList); … … 981 977 if (bit) { // if bit is set, we add this bond partner 982 978 OtherWalker = BondsSet[j]->rightatom; // rightatom is always the one more distant, i.e. the one to add 983 //*out << Verbose(1+verbosity) << "Current Bond is " << ListOfBondsPerAtom[Walker->nr][CurrentCombination] << ", checking on " << *OtherWalker << "." << endl;979 //*out << Verbose(1+verbosity) << "Current Bond is " << BondsSet[j] << ", checking on " << *OtherWalker << "." << endl; 984 980 *out << Verbose(2+verbosity) << "Adding " << *OtherWalker << " with nr " << OtherWalker->nr << "." << endl; 985 981 TestKeySetInsert = FragmentSet->insert(OtherWalker->nr); … … 1089 1085 NumCombinations = 1 << SetDimension; 1090 1086 1091 // Hier muessen von 1 bis NumberOfBondsPerAtom[Walker->nr] alle Kombinationen1092 // von Endstuecken (aus den Bonds) hinzugefuegt werden und fuer verbleibende ANOVAOrder1093 // re kursiv GraphCrawler in der naechsten Ebene aufgerufen werden1087 // here for all bonds of Walker all combinations of end pieces (from the bonds) 1088 // have to be added and for the remaining ANOVA order GraphCrawler be called 1089 // recursively for the next level 1094 1090 1095 1091 *out << Verbose(1+verbosity) << "Begin of SPFragmentGenerator." << endl; … … 1258 1254 atom *OtherWalker = NULL; 1259 1255 atom *Predecessor = NULL; 1256 bond *CurrentEdge = NULL; 1260 1257 bond *Binder = NULL; 1261 bond *CurrentEdge = NULL;1262 1258 int RootKeyNr = FragmentSearch.Root->GetTrueFather()->nr; 1263 1259 int RemainingWalkers = -1; … … 1285 1281 // go through all its bonds 1286 1282 *out << Verbose(1) << "Going through all bonds of Walker." << endl; 1287 for (int i=0;i<mol->NumberOfBondsPerAtom[AtomKeyNr];i++) { 1288 Binder = mol->ListOfBondsPerAtom[AtomKeyNr][i]; 1289 OtherWalker = Binder->GetOtherAtom(Walker); 1283 for (BondList::const_iterator Runner = Walker->ListOfBonds.begin(); Runner != Walker->ListOfBonds.end(); (++Runner)) { 1284 OtherWalker = (*Runner)->GetOtherAtom(Walker); 1290 1285 if ((RestrictedKeySet.find(OtherWalker->nr) != RestrictedKeySet.end()) 1291 1286 #ifdef ADDHYDROGEN … … 1293 1288 #endif 1294 1289 ) { // skip hydrogens and restrict to fragment 1295 *out << Verbose(2) << "Current partner is " << *OtherWalker << " with nr " << OtherWalker->nr << " in bond " << * Binder<< "." << endl;1290 *out << Verbose(2) << "Current partner is " << *OtherWalker << " with nr " << OtherWalker->nr << " in bond " << *(*Runner) << "." << endl; 1296 1291 // set the label if not set (and push on root stack as well) 1297 1292 if ((OtherWalker != Predecessor) && (OtherWalker->GetTrueFather()->nr > RootKeyNr)) { // only pass through those with label bigger than Root's … … 1712 1707 ColorList[Walker->nr] = black; // mark as explored 1713 1708 Walker->x.AddVector(&Translationvector); // translate 1714 for ( int i=0;i<NumberOfBondsPerAtom[Walker->nr];i++) { // go through all binding partners1715 if ( ListOfBondsPerAtom[Walker->nr][i]!= Binder) {1716 OtherWalker = ListOfBondsPerAtom[Walker->nr][i]->GetOtherAtom(Walker);1709 for (BondList::const_iterator Runner = Walker->ListOfBonds.begin(); Runner != Walker->ListOfBonds.end(); (++Runner)) { 1710 if ((*Runner) != Binder) { 1711 OtherWalker = (*Runner)->GetOtherAtom(Walker); 1717 1712 if (ColorList[OtherWalker->nr] == white) { 1718 1713 AtomStack->Push(OtherWalker); // push if yet unexplored
Note:
See TracChangeset
for help on using the changeset viewer.
