Ignore:
Timestamp:
Mar 2, 2011, 9:53:08 PM (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:
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)
Message:

Moved CyclicStructureAnalysis from molecule_graph.cpp into own functor in Graph/.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/molecule_fragmentation.cpp

    r2e4105 re73ad9a  
    2929#include "config.hpp"
    3030#include "element.hpp"
     31#include "Graph/BondGraph.hpp"
     32#include "Graph/CyclicStructureAnalysis.hpp"
    3133#include "Helpers/helpers.hpp"
    32 #include "Graph/BondGraph.hpp"
    3334#include "LinearAlgebra/RealSpaceMatrix.hpp"
    3435#include "molecule.hpp"
     
    456457 * \param *GlobalKeySetList list of keysets with global ids (valid in "this" molecule) needed for adaptive increase
    457458 * \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 loops
    459459 * \param path path to ENERGYPERFRAGMENT file (may be NULL if Order is non-negative)
    460460 * \return true - needs further fragmentation, false - does not need fragmentation
    461461 */
    462 bool molecule::CheckOrderAtSite(bool *AtomMask, Graph *GlobalKeySetList, int Order, int *MinimumRingSize, std::string path)
     462bool molecule::CheckOrderAtSite(bool *AtomMask, Graph *GlobalKeySetList, int Order, std::string path)
    463463{
    464464  bool status = false;
     
    628628{
    629629  MoleculeListClass *BondFragments = NULL;
    630   int *MinimumRingSize = new int[getAtomCount()];
    631630  int FragmentCounter;
    632631  MoleculeLeafClass *MolecularWalker = NULL;
     
    675674
    676675  // analysis of the cycles (print rings, get minimum cycle length) for each subgraph
    677   for(int i=getAtomCount();i--;)
    678     MinimumRingSize[i] = getAtomCount();
    679676  MolecularWalker = Subgraphs;
    680677  const int LeafCount = Subgraphs->next->Count();
     
    697694    MolecularWalker->Leaf->PickLocalBackEdges(ListOfAtoms, BackEdgeStack, LocalBackEdgeStack);
    698695    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();
    700699    DoLog(0) && (Log() << Verbose(0) << "Done with Analysing the cycles of subgraph " << MolecularWalker->Leaf << " with nr. " << FragmentCounter << "." << endl);
    701700    delete(LocalBackEdgeStack);
     
    725724  AtomMask[getAtomCount()] = false;
    726725  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))) {
    728727    FragmentationToDo = FragmentationToDo || CheckOrder;
    729728    AtomMask[getAtomCount()] = true;   // last plus one entry is used as marker that we have been through this loop once already in CheckOrderAtSite()
     
    740739        // call BOSSANOVA method
    741740        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]);
    743742      } else {
    744743        DoeLog(1) && (eLog()<< Verbose(1) << "Subgraph " << MolecularWalker << " has no atoms!" << endl);
     
    751750  delete[](AtomMask);
    752751  delete(ParsedFragmentList);
    753   delete[](MinimumRingSize);
    754752
    755753  // ==================================== End of FRAGMENTATION ============================================
     
    16461644 * \param Fragment&*List list of already present keystacks (adaptive scheme) or empty list
    16471645 * \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)
    16491646 * \return pointer to Graph list
    16501647 */
    1651 void molecule::FragmentBOSSANOVA(Graph *&FragmentList, KeyStack &RootStack, int *MinimumRingSize)
     1648void molecule::FragmentBOSSANOVA(Graph *&FragmentList, KeyStack &RootStack)
    16521649{
    16531650  Graph ***FragmentLowerOrdersList = NULL;
Note: See TracChangeset for help on using the changeset viewer.