Changeset 72d90e


Ignore:
Timestamp:
Mar 1, 2011, 10:16:39 AM (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:
e7350d4
Parents:
f71baf
git-author:
Frederik Heber <heber@…> (02/18/11 14:24:43)
git-committer:
Frederik Heber <heber@…> (03/01/11 10:16:39)
Message:

New function BondGraph::getMinMaxDistance().

Location:
src
Files:
5 edited

Legend:

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

    rf71baf r72d90e  
    135135                          ASSERT(OtherWalker,"TesselPoint that was not an atom retrieved from LinkedNode");
    136136                          //Log() << Verbose(1) << "Checking distance " << OtherWalker->x.PeriodicDistanceSquared(&(Walker->x), cell_size) << " against typical bond length of " << bonddistance*bonddistance << "." << endl;
    137                           BG->CovalentMinMaxDistance(Walker, OtherWalker, MinDistance, MaxDistance, IsAngstroem);
     137                          BG->getMinMaxDistance(Walker, OtherWalker, MinDistance, MaxDistance, IsAngstroem);
    138138                          const double distance = domain.periodicDistanceSquared(OtherWalker->getPosition(),Walker->getPosition());
    139139                          const bool status = (distance <= MaxDistance * MaxDistance) && (distance >= MinDistance * MinDistance);
  • src/Actions/FragmentationAction/DepthFirstSearchAction.cpp

    rf71baf r72d90e  
    5353  std::deque<bond *> *LocalBackEdgeStack = NULL;
    5454  BondGraph *BG = World::getInstance().getBondGraph();
    55   if (BG != NULL)
    56     mol->CreateAdjacencyList(params.distance, World::getInstance().getConfig()->GetIsAngstroem(), &BondGraph::BondLengthMatrixMinMaxDistance, BG);
    57   else
    58     mol->CreateAdjacencyList(params.distance, World::getInstance().getConfig()->GetIsAngstroem(), &BondGraph::CovalentMinMaxDistance, NULL);
     55  mol->CreateAdjacencyList(params.distance, World::getInstance().getConfig()->GetIsAngstroem(), &BondGraph::getMinMaxDistance, BG);
    5956  Subgraphs = mol->DepthFirstSearchAnalysis(BackEdgeStack);
    6057  if (Subgraphs != NULL) {
  • src/Actions/FragmentationAction/FragmentationAction.cpp

    rf71baf r72d90e  
    5555    DoLog(0) && (Log() << Verbose(0) << "Creating connection matrix..." << endl);
    5656    start = clock();
    57     mol->CreateAdjacencyList(params.distance, configuration->GetIsAngstroem(), &BondGraph::CovalentMinMaxDistance, NULL);
     57    mol->CreateAdjacencyList(params.distance, configuration->GetIsAngstroem(), &BondGraph::getMinMaxDistance, World::getInstance().getBondGraph());
    5858    DoLog(0) && (Log() << Verbose(0) << "Fragmenting molecule with current connection matrix ..." << endl);
    5959    if (mol->hasBondStructure()) {
  • src/bondgraph.cpp

    rf71baf r72d90e  
    113113    return false;
    114114
    115   if (BondLengthMatrix == NULL) { // no bond length matrix parsed?
    116     SetMaxDistanceToMaxOfCovalentRadii(mol);
    117     mol->CreateAdjacencyList(max_distance, IsAngstroem, &BondGraph::CovalentMinMaxDistance, this);
    118   } else
    119     mol->CreateAdjacencyList(max_distance, IsAngstroem, &BondGraph::BondLengthMatrixMinMaxDistance, this);
     115  SetMaxDistanceToMaxOfCovalentRadii(mol);
     116  mol->CreateAdjacencyList(max_distance, IsAngstroem, &BondGraph::getMinMaxDistance, this);
    120117
    121118  return status;
     
    193190void BondGraph::BondLengthMatrixMinMaxDistance(BondedParticle * const Walker, BondedParticle * const OtherWalker, double &MinDistance, double &MaxDistance, bool IsAngstroem)
    194191{
     192  ASSERT(BondLengthMatrix != NULL,
     193      "BondGraph::BondLengthMatrixMinMaxDistance() called without NULL BondLengthMatrix.");
     194  MinDistance = GetBondLength(Walker->getType()->getAtomicNumber()-1, OtherWalker->getType()->getAtomicNumber()-1);
     195  MinDistance *= (IsAngstroem) ? 1. : 1. / AtomicLengthToAngstroem;
     196  MaxDistance = MinDistance + BondThreshold;
     197  MinDistance -= BondThreshold;
     198};
     199
     200void BondGraph::getMinMaxDistance(BondedParticle * const Walker, BondedParticle * const OtherWalker, double &MinDistance, double &MaxDistance, bool IsAngstroem)
     201{
    195202  if (BondLengthMatrix == NULL) {// safety measure if no matrix has been parsed yet
    196     DoeLog(2) && (eLog()<< Verbose(2) << "BondLengthMatrixMinMaxDistance() called without having parsed the bond length matrix yet!" << endl);
     203    LOG(2, "INFO: Using Covalent radii criterion for [min,max] distances.");
    197204    CovalentMinMaxDistance(Walker, OtherWalker, MinDistance, MaxDistance, IsAngstroem);
    198205  } else {
    199     MinDistance = GetBondLength(Walker->getType()->getAtomicNumber()-1, OtherWalker->getType()->getAtomicNumber()-1);
    200     MinDistance *= (IsAngstroem) ? 1. : 1. / AtomicLengthToAngstroem;
    201     MaxDistance = MinDistance + BondThreshold;
    202     MinDistance -= BondThreshold;
    203   }
    204 };
     206    LOG(2, "INFO: Using Covalent radii criterion for [min,max] distances.");
     207    BondLengthMatrixMinMaxDistance(Walker, OtherWalker, MinDistance, MaxDistance, IsAngstroem);
     208  }
     209}
  • src/bondgraph.hpp

    rf71baf r72d90e  
    4141  double SetMaxDistanceToMaxOfCovalentRadii(const molecule * const mol);
    4242
    43   void BondLengthMatrixMinMaxDistance(BondedParticle * const Walker, BondedParticle * const OtherWalker, double &MinDistance, double &MaxDistance, bool IsAngstroem);
    44   void CovalentMinMaxDistance(BondedParticle * const Walker, BondedParticle * const OtherWalker, double &MinDistance, double &MaxDistance, bool IsAngstroem);
     43
     44  /** Returns bond criterion for given pair based on a bond length matrix.
     45   * This calls either the covalent or the bond matrix criterion.
     46   * \param *Walker first BondedParticle
     47   * \param *OtherWalker second BondedParticle
     48   * \param &MinDistance lower bond bound on return
     49   * \param &MaxDistance upper bond bound on return
     50   * \param IsAngstroem whether units are in angstroem or bohr radii
     51   */
     52  void getMinMaxDistance(BondedParticle * const Walker, BondedParticle * const OtherWalker, double &MinDistance, double &MaxDistance, bool IsAngstroem);
    4553
    4654  double getMaxDistance() const;
     
    4856private:
    4957  static const double BondThreshold;
     58
     59  void BondLengthMatrixMinMaxDistance(BondedParticle * const Walker, BondedParticle * const OtherWalker, double &MinDistance, double &MaxDistance, bool IsAngstroem);
     60
     61  void CovalentMinMaxDistance(BondedParticle * const Walker, BondedParticle * const OtherWalker, double &MinDistance, double &MaxDistance, bool IsAngstroem);
    5062
    5163  MatrixContainer *BondLengthMatrix;
Note: See TracChangeset for help on using the changeset viewer.