Changeset ae38fb for src/config.cpp


Ignore:
Timestamp:
Nov 3, 2009, 2:34:02 PM (16 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, 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:
3c349b
Parents:
2aeefd
git-author:
Frederik Heber <heber@…> (11/03/09 14:27:15)
git-committer:
Frederik Heber <heber@…> (11/03/09 14:34:02)
Message:

Fixing not created adjacency list, partially fixing subgraph dissection in config::Load()

  • CreateAdjacencyList() was called with zero bonddistance.
  • this was due to max_distance not being initialised in the constructor to 0 and subsequently not set if Bond Length Table was not found.
  • new function SetMaxDistanceToMaxOfCovalentRadii() which sets the max_distance to twice the max of covalent radii of all elements.
  • config::Load() - atoms in copied molecule (by DepthFirstSearchAnalysis()) are made their own father (and originals are removed).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/config.cpp

    r2aeefd rae38fb  
    10511051  } else {
    10521052    cout << Verbose(0) << "Bond length table loading failed." << endl;
     1053    BG->SetMaxDistanceToMaxOfCovalentRadii((ofstream *)&cout, periode);
    10531054  }
    10541055
    10551056  // 3. parse the molecule in
    10561057  LoadMolecule(mol, FileBuffer, periode, FastParsing);
    1057   mol->ActiveFlag = true;
    1058   MolList->insert(mol);
     1058  //mol->ActiveFlag = true;
     1059  //MolList->insert(mol);
    10591060
    10601061  // 4. dissect the molecule into connected subgraphs
    10611062  BG->ConstructBondGraph((ofstream *)&cout, mol);
     1063
     1064  // 5. scan for connected subgraphs
     1065  MoleculeLeafClass *Subgraphs = NULL;      // list of subgraphs from DFS analysis
     1066  class StackClass<bond *> *BackEdgeStack = NULL;
     1067  Subgraphs = mol->DepthFirstSearchAnalysis((ofstream *)&cout, BackEdgeStack);
     1068  delete(BackEdgeStack);
     1069
     1070  // 6. dissect
     1071  atom ***ListOfLocalAtoms = NULL;
     1072  int FragmentCounter = 0;
     1073  MoleculeLeafClass *MolecularWalker = Subgraphs;
     1074  atom *Walker = NULL;
     1075  while (MolecularWalker->next != NULL) {
     1076    MolecularWalker = MolecularWalker->next;
     1077    // fill the bond structure of the individually stored subgraphs (goes through whole chained list by itself)
     1078    MolecularWalker->FillBondStructureFromReference((ofstream *)&cout, mol, FragmentCounter, ListOfLocalAtoms, false);  // we don't want to keep the created ListOfLocalAtoms
     1079    FragmentCounter++;
     1080    MolecularWalker->Leaf->ActiveFlag = true;
     1081    Walker = MolecularWalker->Leaf->start;
     1082    while (Walker->next != MolecularWalker->Leaf->end) {
     1083      Walker = Walker->next;
     1084      Walker->father = Walker;
     1085    }
     1086    MolList->insert(MolecularWalker->Leaf);
     1087    MolecularWalker->Leaf = NULL; // don't remove molecule when deleting MolecularWalker
     1088    delete(MolecularWalker->previous);
     1089  }
     1090  delete(MolecularWalker);
     1091  for (int i=0;i<FragmentCounter;i++)
     1092    Free(&ListOfLocalAtoms[i]);
     1093  Free(&ListOfLocalAtoms);
     1094  cout << Verbose(1) << "I scanned " << FragmentCounter << " molecules." << endl;
     1095
     1096  // 6. free parsed in molecule
     1097  delete(mol);
    10621098
    10631099  delete(FileBuffer);
Note: See TracChangeset for help on using the changeset viewer.