Changeset cee9e8


Ignore:
Timestamp:
Oct 13, 2015, 8:14:32 PM (9 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:
92232f
Parents:
b1c5f46
git-author:
Frederik Heber <heber@…> (09/01/15 13:47:28)
git-committer:
Frederik Heber <heber@…> (10/13/15 20:14:32)
Message:

Added Interfragmenter::findLargestCutoff() to find largest Rcut not causing additional inter-fragments.

Location:
src
Files:
3 edited

Legend:

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

    rb1c5f46 rcee9e8  
    259259        << params.InterOrder.get() << " and distance of "
    260260        << params.distance.get() << ".");
     261    const enum HydrogenTreatment treatment =
     262        params.HowtoTreatHydrogen.get() ? ExcludeHydrogen : IncludeHydrogen;
     263    const double UpperBound = std::max(10., params.distance.get());
    261264    Interfragmenter fragmenter(TotalGraph);
    262     const enum HydrogenTreatment treatment =  params.HowtoTreatHydrogen.get() ? ExcludeHydrogen : IncludeHydrogen;
     265
     266    // check the largest Rcut that causes no additional inter-fragments
     267    const double Min_Rcut =
     268        fragmenter.findLargestCutoff(params.InterOrder.get(), UpperBound, treatment);
     269
     270    // then add fragments
    263271    fragmenter(params.InterOrder.get(), params.distance.get(), treatment);
     272
    264273    LOG(0, "STATUS: There are now " << TotalGraph.size() << " fragments after interfragmenting.");
    265274  }
  • TabularUnified src/Fragmentation/Interfragmenter.cpp

    rb1c5f46 rcee9e8  
    4242#include "LinearAlgebra/Vector.hpp"
    4343
     44#include "Descriptors/AtomDescriptor.hpp"
    4445#include "Element/element.hpp"
    4546#include "Fragmentation/Graph.hpp"
     
    234235  TotalGraph.InsertGraph(InterFragments, counter);
    235236}
     237
     238double Interfragmenter::findLargestCutoff(
     239    const size_t _MaxOrder,
     240    const double _upperbound,
     241    const enum HydrogenTreatment _treatment) const
     242{
     243  double Rcut = _upperbound*_upperbound;
     244  std::pair<atomId_t, atomId_t> ClosestPair;
     245  // place all atoms into LC grid with some upper bound
     246  const LinkedCell::LinkedCell_View view = World::getInstance().getLinkedCell(_upperbound);
     247
     248  atomkeyset_t atomkeyset = getAtomKeySetMap(_MaxOrder);
     249
     250  // go through each atom and find closest atom not in the same keyset
     251  for (Graph::const_iterator keysetiter = TotalGraph.begin();
     252      keysetiter != TotalGraph.end(); ++keysetiter) {
     253    const KeySet &keyset = keysetiter->first;
     254    LOG(2, "DEBUG: Current keyset is " << keyset);
     255    const AtomIdSet atoms(keyset);
     256
     257    // get neighboring atoms outside the current molecule
     258    const candidates_t candidates = getNeighborsOutsideMolecule(atoms, _upperbound, _treatment);
     259    const Vector center = getAtomIdSetCenter(atoms);
     260
     261    for (candidates_t::const_iterator candidateiter = candidates.begin();
     262        candidateiter != candidates.end(); ++candidateiter) {
     263      atom const * const Walker = *candidateiter;
     264      // go through each atom in set and pick minimal distance
     265      for (AtomIdSet::const_iterator setiter = atoms.begin(); setiter != atoms.end(); ++setiter) {
     266        const double distanceSquared = Walker->getPosition().DistanceSquared(center);
     267        // pick the smallest compared to current Rcut if smaller
     268        if (distanceSquared < Rcut) {
     269          Rcut = distanceSquared;
     270          ClosestPair.first = (*setiter)->getId();
     271          ClosestPair.second = Walker->getId();
     272        }
     273      }
     274    }
     275  }
     276  LOG(1, "INFO: Largest inter-fragment distance to cause no additional fragments: " << Rcut);
     277
     278  return Rcut;
     279}
  • TabularUnified src/Fragmentation/Interfragmenter.hpp

    rb1c5f46 rcee9e8  
    5656      const double Rcut,
    5757      const enum HydrogenTreatment treatment);
     58
     59  /** This finds the largest cut off distance (\a Rcut) such that when running
     60   * operator() no additional inter-fragments would be produced.
     61   *
     62   * \param MaxOrder maximum order for fragments to interrelate
     63   * \param _upperbound upper bound on \a Rcut above which we do not look
     64   * \param treatment whether hydrogens are treated specially or not
     65   * \return largest cutoff distance to cause no additional inter-fragments
     66   */
     67  double findLargestCutoff(
     68      const size_t _MaxOrder,
     69      const double _upperbound,
     70      const enum HydrogenTreatment _treatment) const;
    5871
    5972private:
Note: See TracChangeset for help on using the changeset viewer.