Changeset e73ad9a for src/molecule_fragmentation.cpp
- Timestamp:
- Mar 2, 2011, 9:53:08 PM (14 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:
- 1a4d4fe
- Parents:
- 2e4105
- git-author:
- Frederik Heber <heber@…> (02/25/11 20:52:50)
- git-committer:
- Frederik Heber <heber@…> (03/02/11 21:53:08)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/molecule_fragmentation.cpp
r2e4105 re73ad9a 29 29 #include "config.hpp" 30 30 #include "element.hpp" 31 #include "Graph/BondGraph.hpp" 32 #include "Graph/CyclicStructureAnalysis.hpp" 31 33 #include "Helpers/helpers.hpp" 32 #include "Graph/BondGraph.hpp"33 34 #include "LinearAlgebra/RealSpaceMatrix.hpp" 34 35 #include "molecule.hpp" … … 456 457 * \param *GlobalKeySetList list of keysets with global ids (valid in "this" molecule) needed for adaptive increase 457 458 * \param Order desired Order if positive, desired exponent in threshold criteria if negative (0 is single-step) 458 * \param *MinimumRingSize array of max. possible order to avoid loops459 459 * \param path path to ENERGYPERFRAGMENT file (may be NULL if Order is non-negative) 460 460 * \return true - needs further fragmentation, false - does not need fragmentation 461 461 */ 462 bool molecule::CheckOrderAtSite(bool *AtomMask, Graph *GlobalKeySetList, int Order, int *MinimumRingSize,std::string path)462 bool molecule::CheckOrderAtSite(bool *AtomMask, Graph *GlobalKeySetList, int Order, std::string path) 463 463 { 464 464 bool status = false; … … 628 628 { 629 629 MoleculeListClass *BondFragments = NULL; 630 int *MinimumRingSize = new int[getAtomCount()];631 630 int FragmentCounter; 632 631 MoleculeLeafClass *MolecularWalker = NULL; … … 675 674 676 675 // analysis of the cycles (print rings, get minimum cycle length) for each subgraph 677 for(int i=getAtomCount();i--;)678 MinimumRingSize[i] = getAtomCount();679 676 MolecularWalker = Subgraphs; 680 677 const int LeafCount = Subgraphs->next->Count(); … … 697 694 MolecularWalker->Leaf->PickLocalBackEdges(ListOfAtoms, BackEdgeStack, LocalBackEdgeStack); 698 695 DoLog(0) && (Log() << Verbose(0) << "Analysing the cycles of subgraph " << MolecularWalker->Leaf << " with nr. " << FragmentCounter << "." << endl); 699 MolecularWalker->Leaf->CyclicStructureAnalysis(LocalBackEdgeStack, MinimumRingSize); 696 CyclicStructureAnalysis CycleAnalysis; 697 CycleAnalysis(LocalBackEdgeStack); 698 CycleAnalysis.getMinimumRingSize(); 700 699 DoLog(0) && (Log() << Verbose(0) << "Done with Analysing the cycles of subgraph " << MolecularWalker->Leaf << " with nr. " << FragmentCounter << "." << endl); 701 700 delete(LocalBackEdgeStack); … … 725 724 AtomMask[getAtomCount()] = false; 726 725 FragmentationToDo = false; // if CheckOrderAtSite just ones recommends fragmentation, we will save fragments afterwards 727 while ((CheckOrder = CheckOrderAtSite(AtomMask, ParsedFragmentList, Order, MinimumRingSize,prefix))) {726 while ((CheckOrder = CheckOrderAtSite(AtomMask, ParsedFragmentList, Order, prefix))) { 728 727 FragmentationToDo = FragmentationToDo || CheckOrder; 729 728 AtomMask[getAtomCount()] = true; // last plus one entry is used as marker that we have been through this loop once already in CheckOrderAtSite() … … 740 739 // call BOSSANOVA method 741 740 DoLog(0) && (Log() << Verbose(0) << endl << " ========== BOND ENERGY of subgraph " << FragmentCounter << " ========================= " << endl); 742 MolecularWalker->Leaf->FragmentBOSSANOVA(FragmentList[FragmentCounter], RootStack[FragmentCounter] , MinimumRingSize);741 MolecularWalker->Leaf->FragmentBOSSANOVA(FragmentList[FragmentCounter], RootStack[FragmentCounter]); 743 742 } else { 744 743 DoeLog(1) && (eLog()<< Verbose(1) << "Subgraph " << MolecularWalker << " has no atoms!" << endl); … … 751 750 delete[](AtomMask); 752 751 delete(ParsedFragmentList); 753 delete[](MinimumRingSize);754 752 755 753 // ==================================== End of FRAGMENTATION ============================================ … … 1646 1644 * \param Fragment&*List list of already present keystacks (adaptive scheme) or empty list 1647 1645 * \param &RootStack stack with all root candidates (unequal to each atom in complete molecule if adaptive scheme is applied) 1648 * \param *MinimumRingSize minimum ring size for each atom (molecule::Atomcount)1649 1646 * \return pointer to Graph list 1650 1647 */ 1651 void molecule::FragmentBOSSANOVA(Graph *&FragmentList, KeyStack &RootStack , int *MinimumRingSize)1648 void molecule::FragmentBOSSANOVA(Graph *&FragmentList, KeyStack &RootStack) 1652 1649 { 1653 1650 Graph ***FragmentLowerOrdersList = NULL;
Note:
See TracChangeset
for help on using the changeset viewer.