Changeset 108968 for src/Graph/BondGraph.hpp
- Timestamp:
- Apr 3, 2012, 8:00:19 AM (13 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, 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:
- e791dc
- Parents:
- 08a0f52
- git-author:
- Frederik Heber <heber@…> (03/13/12 17:37:53)
- git-committer:
- Frederik Heber <heber@…> (04/03/12 08:00:19)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Graph/BondGraph.hpp
r08a0f52 r108968 19 19 20 20 #include <iosfwd> 21 #include <set> 21 22 22 23 #include <boost/serialization/array.hpp> … … 75 76 void CleanupBondLengthTable(); 76 77 78 /** Internal helper to convert a set of atomicNumber_t to element refs. 79 * 80 * @param Set set of atomicNumber_t 81 * @return set of element refs 82 */ 83 std::set< const element *> getElementSetFromNumbers(const std::set<atomicNumber_t> &Set) const; 84 77 85 /** Determines the maximum of all element::CovalentRadius for elements present in \a &Set. 78 86 * … … 80 88 * e.g. to be used for LinkedCell_deprecated or others. 81 89 * 82 * \param &Set AtomSetMixin with all particles to consider 83 */ 84 template <class container_type, 85 class iterator_type, 86 class const_iterator_type> 90 * \param &PresentElements set of elements whose maximal pair to find 91 */ 87 92 double getMaxPossibleBondDistance( 88 const AtomSetMixin<container_type,iterator_type,const_iterator_type> &Set) const93 const std::set< const element *> &PresentElements) const 89 94 { 90 95 double max_distance = 0.; 91 // get all elements 92 std::set< const element *> PresentElements; 93 for(const_iterator_type AtomRunner = Set.begin(); AtomRunner != Set.end(); ++AtomRunner) { 94 PresentElements.insert( (*AtomRunner)->getType() ); 95 } 96 96 97 // create all element combinations 97 98 for (std::set< const element *>::const_iterator iter = PresentElements.begin(); … … 114 115 * e.g. to be used for LinkedCell_deprecated or others. 115 116 * 116 * \param &Set AtomSetMixin with all particles to consider 117 */ 118 template <class container_type, 119 class iterator_type, 120 class const_iterator_type> 117 * \param Walker element first element in the pair 118 * \param &PresentElements set of elements whose maximal pair to find 119 */ 121 120 double getMaxPossibleBondDistance( 122 121 const element * const Walker, 123 const AtomSetMixin<container_type,iterator_type,const_iterator_type> &Set) const122 const std::set< const element *> &PresentElements) const 124 123 { 125 124 double max_distance = 0.; 126 // get all elements 127 std::set< const element *> PresentElements; 128 for(const_iterator_type AtomRunner = Set.begin(); AtomRunner != Set.end(); ++AtomRunner) { 129 PresentElements.insert( (*AtomRunner)->getType() ); 130 } 125 131 126 // create all element combinations 132 127 for (std::set< const element *>::const_iterator iter = PresentElements.begin(); … … 182 177 cleanAdjacencyList(Set); 183 178 179 // gather set of all present elements 180 std::set<atomicNumber_t> elements; 181 for(typename AtomSetMixin<container_type,iterator_type,const_iterator_type>::iterator iter = Set.begin(); 182 iter != Set.end(); ++iter) { 183 const atom * const Walker = dynamic_cast<const atom *>(*iter); 184 ASSERT(Walker != NULL, 185 "BondGraph::CreateAdjacency() - TesselPoint " 186 +(*iter)->getName()+" that was not an atom retrieved from given set"); 187 elements.insert( Walker->getElementNo() ); 188 } 189 // get all elements 190 std::set< const element *> PresentElements = getElementSetFromNumbers(elements); 191 184 192 // count atoms in molecule = dimension of matrix (also give each unique name and continuous numbering) 185 193 const unsigned int counter = Set.size(); 186 194 if (counter > 1) { 187 195 LOG(1, "STATUS: Setting max bond distance."); 188 LinkedCell::LinkedCell_View LC = getLinkedCell(getMaxPossibleBondDistance( Set));196 LinkedCell::LinkedCell_View LC = getLinkedCell(getMaxPossibleBondDistance(PresentElements)); 189 197 190 198 LOG(1, "STATUS: Creating LinkedCell structure for given " << counter << " atoms."); … … 205 213 // obtain all possible neighbors 206 214 LinkedCell::LinkedList ListOfNeighbors = LC.getAllNeighbors( 207 getMaxPossibleBondDistance(Walker->getType(), Set),215 getMaxPossibleBondDistance(Walker->getType(), PresentElements), 208 216 Walker->getPosition()); 209 217 if (!ListOfNeighbors.empty()) {
Note:
See TracChangeset
for help on using the changeset viewer.