Changeset cee9e8 for src/Fragmentation/Interfragmenter.cpp
- Timestamp:
- Oct 13, 2015, 8:14:32 PM (10 years ago)
- 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:
- 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)
- File:
-
- 1 edited
-
src/Fragmentation/Interfragmenter.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Fragmentation/Interfragmenter.cpp
rb1c5f46 rcee9e8 42 42 #include "LinearAlgebra/Vector.hpp" 43 43 44 #include "Descriptors/AtomDescriptor.hpp" 44 45 #include "Element/element.hpp" 45 46 #include "Fragmentation/Graph.hpp" … … 234 235 TotalGraph.InsertGraph(InterFragments, counter); 235 236 } 237 238 double 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 }
Note:
See TracChangeset
for help on using the changeset viewer.
