Ignore:
Timestamp:
Mar 1, 2011, 12:49:28 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:
0cbad2
Parents:
ce5f05
git-author:
Frederik Heber <heber@…> (02/26/11 00:10:05)
git-committer:
Frederik Heber <heber@…> (03/01/11 12:49:28)
Message:

Moved molecule::CreateAdjacencyList over to class BondGraph.

to make this possible we had to:

other changes:

TESTFIXES:

  • the regression test for all Actions mentioned above that don't create adjacency themselves anymore needed to be prepended with --select-all-atoms --create-adjacency.
Location:
src/Actions/FragmentationAction
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/FragmentationAction/CreateAdjacencyAction.cpp

    rce5f05 r3738f0  
    5858  BondGraph *BG = World::getInstance().getBondGraph();
    5959  ASSERT(BG != NULL, "FragmentationCreateAdjacencyAction: BondGraph is NULL.");
     60  BG->SetMaxDistanceToMaxOfCovalentRadii(AtomSetMixin<std::vector<atom *> >(World::getInstance().getSelectedAtoms()));
    6061  double BondDistance = BG->getMaxDistance();
    6162  bool IsAngstroem = configuration->GetIsAngstroem();
  • src/Actions/FragmentationAction/DepthFirstSearchAction.cpp

    rce5f05 r3738f0  
    5252  std::deque<bond *> *BackEdgeStack = NULL;
    5353  std::deque<bond *> *LocalBackEdgeStack = NULL;
    54   BondGraph *BG = World::getInstance().getBondGraph();
    55   mol->CreateAdjacencyList(params.distance, World::getInstance().getConfig()->GetIsAngstroem(), &BondGraph::getMinMaxDistance, BG);
    5654  Subgraphs = mol->DepthFirstSearchAnalysis(BackEdgeStack);
    5755  if (Subgraphs != NULL) {
  • src/Actions/FragmentationAction/FragmentationAction.cpp

    rce5f05 r3738f0  
    4343  clock_t start,end;
    4444  molecule *mol = NULL;
    45   config *configuration = World::getInstance().getConfig();
    4645  int ExitFlag = 0;
    4746
     
    5554    DoLog(0) && (Log() << Verbose(0) << "Creating connection matrix..." << endl);
    5655    start = clock();
    57     mol->CreateAdjacencyList(params.distance, configuration->GetIsAngstroem(), &BondGraph::getMinMaxDistance, World::getInstance().getBondGraph());
    5856    DoLog(0) && (Log() << Verbose(0) << "Fragmenting molecule with current connection matrix ..." << endl);
    5957    if (mol->hasBondStructure()) {
  • src/Actions/FragmentationAction/SubgraphDissectionAction.cpp

    rce5f05 r3738f0  
    5050  getParametersfromValueStorage();
    5151
    52   DoLog(1) && (Log() << Verbose(1) << "Dissecting molecular system into a set of disconnected subgraphs ... " << endl);
    5352
    5453  // first create stuff for undo state
     54  LOG(0, "STATUS: Creating undo state.");
    5555  MolAtomList moleculelist;
    5656  vector<molecule *> allmolecules = World::getInstance().getAllMolecules();
     
    6666
    6767  // 0a. remove all present molecules
     68  LOG(0, "STATUS: Removing all present molecules.");
    6869  MoleculeListClass *molecules = World::getInstance().getMolecules();
    6970  for (vector<molecule *>::iterator MolRunner = allmolecules.begin(); MolRunner != allmolecules.end(); ++MolRunner) {
     
    8889
    8990  // 1. create the bond structure of the single molecule
     91  LOG(0, "STATUS: (Re-)constructing adjacency.");
    9092  if (mol->getBondCount() == 0) {
    9193    BondGraph *BG = World::getInstance().getBondGraph();
    92     if (!BG->CreateAdjacencyForMolecule(mol)) {
    93       World::getInstance().destroyMolecule(mol);
    94       DoeLog(1) && (eLog()<< Verbose(1) << "There are no bonds." << endl);
    95       return Action::failure;
    96     }
     94    molecule::atomVector Set = mol->getAtomSet();
     95    BG->CreateAdjacency(Set);
     96//    if (mol->getBondCount() == 0) {
     97//      World::getInstance().destroyMolecule(mol);
     98//      ELOG(1, "There are no bonds.");
     99//      return Action::failure;
     100//    }
    97101  }
    98102
    99103  // 2. scan for connected subgraphs
     104  LOG(0, "STATUS: Analysing adjacency graph.");
    100105  MoleculeLeafClass *Subgraphs = NULL;      // list of subgraphs from DFS analysis
    101106  std::deque<bond *> *BackEdgeStack = NULL;
     
    111116
    112117  // TODO: When DepthFirstSearchAnalysis does not use AddCopyAtom() anymore, we don't need to delete all original atoms
     118  LOG(0, "STATUS: Creating molecules as connected subgraphs.");
    113119  {
    114120    {
     
    152158
    153159  // 4. free Leafs
     160  LOG(0, "STATUS: Done.");
    154161  MoleculeLeafClass *MolecularWalker = Subgraphs;
    155162  while (MolecularWalker->next != NULL) {
Note: See TracChangeset for help on using the changeset viewer.