Changeset 555063
- Timestamp:
- Apr 28, 2008, 1:53:54 PM (17 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:
- 5b15ab
- Parents:
- c67e16
- Location:
- src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/molecules.cpp
rc67e16 r555063 1871 1871 } // else it's "-1" or else and thus must not be added 1872 1872 } 1873 *out << Verbose(1) << "The scanned KeySet is "; 1874 for(KeySet::iterator runner = CurrentSet.begin(); runner != CurrentSet.end(); runner++) { 1875 *out << (*runner) << "\t"; 1876 } 1877 *out << endl; 1873 1878 return (status != 0); 1874 1879 }; … … 2151 2156 BondFragments[FragmentCounter] = NULL; 2152 2157 if (Scheme == ANOVA) { 2153 BondFragments[FragmentCounter] = MolecularWalker->Leaf->FragmentBOSSANOVA(out,BottomUpOrder,configuration); 2158 Graph *FragmentList = MolecularWalker->Leaf->FragmentBOSSANOVA(out,BottomUpOrder,configuration); 2159 2160 // allocate memory for the pointer array and transmorph graphs into full molecular fragments 2161 int TotalNumberOfMolecules = 0; 2162 for(Graph::iterator runner = FragmentList->begin(); runner != FragmentList->end(); runner++) 2163 TotalNumberOfMolecules++; 2164 BondFragments[FragmentCounter] = new MoleculeListClass(TotalNumberOfMolecules, AtomCount); 2165 int k=0; 2166 for(Graph::iterator runner = FragmentList->begin(); runner != FragmentList->end(); runner++) { 2167 KeySet test = (*runner).first; 2168 BondFragments[FragmentCounter]->ListOfMolecules[k] = StoreFragmentFromKeySet(out, test, configuration); 2169 BondFragments[FragmentCounter]->TEList[k] = ((*runner).second).second; 2170 k++; 2171 } 2154 2172 } 2155 2173 if ((Scheme == BottomUp) || (Scheme == Combined)) { // get overlapping subgraphs … … 2802 2820 // first create the minimal set of atoms from the KeySet 2803 2821 for(KeySet::iterator runner = Leaflet.begin(); runner != Leaflet.end(); runner++) { 2804 FatherOfRunner = 2822 FatherOfRunner = FindAtom((*runner)); // find the id 2805 2823 SonList[FatherOfRunner->nr] = Leaf->AddCopyAtom(FatherOfRunner); 2806 2824 } … … 3135 3153 //if ((!FragmentSearch->UsedList[OtherWalker->nr][i]) && (FragmentSearch->Labels[OtherWalker->nr] > FragmentSearch->Labels[FragmentSearch->Root->nr])) { 3136 3154 //*out << Verbose(2+verbosity) << "Not used so far, label " << FragmentSearch->Labels[OtherWalker->nr] << " is bigger than Root's " << FragmentSearch->Labels[FragmentSearch->Root->nr] << "." << endl; 3137 *out << Verbose(2+verbosity) << "Adding " << *OtherWalker << " ." << endl;3155 *out << Verbose(2+verbosity) << "Adding " << *OtherWalker << " with nr " << OtherWalker->nr << "." << endl; 3138 3156 TouchedList[TouchedIndex++] = OtherWalker->nr; // note as added 3139 FragmentSearch->FragmentSet->insert( FragmentSearch->FragmentSet->end(), OtherWalker->nr);3157 FragmentSearch->FragmentSet->insert(OtherWalker->GetTrueFather()->nr); 3140 3158 //FragmentSearch->UsedList[OtherWalker->nr][i] = true; 3141 3159 //} … … 3314 3332 } 3315 3333 Walker = FindAtom(AtomKeyNr); 3316 *out << Verbose(0) << "Current Walker is: " << *Walker << " with label " << FragmentSearch.Labels[AtomKeyNr] << " and SP of " << SP << "." << endl;3334 *out << Verbose(0) << "Current Walker is: " << *Walker << " with nr " << Walker->nr << " and label " << FragmentSearch.Labels[AtomKeyNr] << " and SP of " << SP << "." << endl; 3317 3335 // check for new sp level 3318 3336 // go through all its bonds … … 3326 3344 #endif 3327 3345 ) { // skip hydrogens and restrict to fragment 3328 *out << Verbose(2) << "Current partner is " << *OtherWalker << " in bond " << *Binder << "." << endl;3346 *out << Verbose(2) << "Current partner is " << *OtherWalker << " with nr " << OtherWalker->nr << " in bond " << *Binder << "." << endl; 3329 3347 // set the label if not set (and push on root stack as well) 3330 3348 if (FragmentSearch.Labels[OtherWalker->nr] == -1) { … … 3408 3426 *out << Verbose(0) << "Starting fragment generation with " << *FragmentSearch.Root << "." << endl; 3409 3427 FragmentSearch.FragmentSet->clear(); 3410 FragmentSearch.FragmentSet->insert(FragmentSearch.Root-> nr);3428 FragmentSearch.FragmentSet->insert(FragmentSearch.Root->GetTrueFather()->nr); 3411 3429 3412 3430 if (FragmentSearch.FragmentSet->size() == (unsigned int) Order) { … … 3681 3699 * \param ANOVAOrder ANOVA expansion is truncated above this order 3682 3700 * \param *configuration configuration for writing config files for each fragment 3683 * \return pointer to MoleculeListClass with all the fragments or NULL if something went wrong.3684 */ 3685 MoleculeListClass* molecule::FragmentBOSSANOVA(ofstream *out, int ANOVAOrder, config *configuration)3701 * \return pointer to Graph list 3702 */ 3703 Graph * molecule::FragmentBOSSANOVA(ofstream *out, int ANOVAOrder, config *configuration) 3686 3704 { 3687 3705 Graph *FragmentList = NULL, ***FragmentLowerOrdersList = NULL; 3688 MoleculeListClass *FragmentMoleculeList = NULL;3706 //MoleculeListClass *FragmentMoleculeList = NULL; 3689 3707 int Order, NumLevels, NumMolecules, TotalNumMolecules = 0, *NumMoleculesOfOrder = NULL; 3690 3708 int counter = 0; … … 3702 3720 while (Walker->next != end) { 3703 3721 Walker = Walker->next; 3704 CompleteMolecule.insert(Walker-> nr);3722 CompleteMolecule.insert(Walker->GetTrueFather()->nr); 3705 3723 } 3706 3724 … … 3775 3793 Free((void **)&FragmentLowerOrdersList, "molecule::FragmentBOSSANOVA: ***FragmentLowerOrdersList"); 3776 3794 Free((void **)&NumMoleculesOfOrder, "molecule::FragmentBOSSANOVA: *NumMoleculesOfOrder"); 3777 // allocate memory for the pointer array and transmorph graphs into full molecular fragments3778 FragmentMoleculeList = new MoleculeListClass(TotalNumMolecules, AtomCount);3779 int k=0;3780 for(Graph::iterator runner = FragmentList->begin(); runner != FragmentList->end(); runner++) {3781 KeySet test = (*runner).first;3782 FragmentMoleculeList->ListOfMolecules[k] = StoreFragmentFromKeySet(out, test, configuration);3783 FragmentMoleculeList->TEList[k] = ((*runner).second).second;3784 k++;3785 }3786 3795 3787 3796 *out << Verbose(0) << "End of FragmentBOSSANOVA." << endl; 3788 delete(FragmentList); 3789 return FragmentMoleculeList; 3797 return FragmentList; 3790 3798 }; 3791 3799 -
src/molecules.hpp
rc67e16 r555063 532 532 void FragmentMoleculeByBond(ofstream *out, bond *Bond, molecule **LeftFragment, molecule **RightFragment, bool IsAngstroem, enum CutCyclicBond CutCyclic); 533 533 /// -# BOSSANOVA 534 MoleculeListClass* FragmentBOSSANOVA(ofstream *out, int ANOVAOrder, config *configuration);534 Graph * FragmentBOSSANOVA(ofstream *out, int ANOVAOrder, config *configuration); 535 535 int CreateListOfUniqueFragmentsOfOrder(ofstream *out, int Order, Graph *ListOfGraph, KeySet Fragment, double TEFactor, config *configuration); 536 536 bool BuildInducedSubgraph(ofstream *out, const molecule *Father);
Note:
See TracChangeset
for help on using the changeset viewer.