Changeset 0ec7fe
- Timestamp:
- Mar 1, 2011, 1:17:08 PM (14 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:
- 111f4a
- Parents:
- 300220
- git-author:
- Frederik Heber <heber@…> (02/28/11 15:11:16)
- git-committer:
- Frederik Heber <heber@…> (03/01/11 13:17:08)
- Location:
- src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/FragmentationAction/CreateAdjacencyAction.cpp
r300220 r0ec7fe 59 59 BondGraph *BG = World::getInstance().getBondGraph(); 60 60 ASSERT(BG != NULL, "FragmentationCreateAdjacencyAction: BondGraph is NULL."); 61 BG->SetMaxDistanceToMaxOfCovalentRadii(AtomSetMixin<std::vector<atom *> >(World::getInstance().getSelectedAtoms())); 62 double BondDistance = BG->getMaxDistance(); 61 double BondDistance = BG->getMaxPossibleBondDistance(AtomSetMixin<std::vector<atom *> >(World::getInstance().getSelectedAtoms())); 63 62 bool IsAngstroem = configuration->GetIsAngstroem(); 64 63 -
src/bondgraph.cpp
r300220 r0ec7fe 42 42 BondGraph::BondGraph(bool IsA) : 43 43 BondLengthMatrix(NULL), 44 max_distance(0),45 44 IsAngstroem(IsA) 46 45 {} … … 73 72 status = false; 74 73 } 75 76 // find greatest distance77 max_distance=0;78 if (status) {79 for(int i=0;i<TempContainer->RowCounter[0];i++)80 for(int j=i;j<TempContainer->ColumnCounter[0];j++)81 if (TempContainer->Matrix[0][i][j] > max_distance)82 max_distance = TempContainer->Matrix[0][i][j];83 }84 max_distance += BondThreshold;85 74 86 75 if (status) // set to not NULL only if matrix was parsed … … 105 94 return (BondLengthMatrix->Matrix[0][firstZ][secondZ]); 106 95 } 107 }108 109 double BondGraph::getMaxDistance() const110 {111 return max_distance;112 96 } 113 97 -
src/bondgraph.hpp
r300220 r0ec7fe 68 68 /** Determines the maximum of all element::CovalentRadius for elements present in \a &Set. 69 69 * 70 * Sets BondGraph::max_distance 71 * 72 * \param &Set PointCloud with all particles 73 */ 74 template <class container_type, 75 class iterator_type, 76 class const_iterator_type> 77 double SetMaxDistanceToMaxOfCovalentRadii(const AtomSetMixin<container_type,iterator_type,const_iterator_type> &Set) 78 { 79 max_distance = 0.; 80 70 * I.e. the function returns a sensible cutoff criteria for bond recognition, 71 * e.g. to be used for LinkedCell or others. 72 * 73 * \param &Set AtomSetMixin with all particles to consider 74 */ 75 template <class container_type, 76 class iterator_type, 77 class const_iterator_type> 78 double getMaxPossibleBondDistance( 79 const AtomSetMixin<container_type,iterator_type,const_iterator_type> &Set) const 80 { 81 double max_distance = 0.; 82 // get all elements 83 std::set< const element *> PresentElements; 81 84 for(const_iterator_type AtomRunner = Set.begin(); AtomRunner != Set.end(); ++AtomRunner) { 82 const double radius = (*AtomRunner)->getType()->getCovalentRadius(); 83 if (radius > max_distance) 84 max_distance = radius; 85 } 86 max_distance *= 2.; 87 max_distance += BondThreshold; 88 85 PresentElements.insert( (*AtomRunner)->getType() ); 86 } 87 // create all element combinations 88 for (std::set< const element *>::const_iterator iter = PresentElements.begin(); 89 iter != PresentElements.end(); 90 ++iter) { 91 for (std::set< const element *>::const_iterator otheriter = iter; 92 otheriter != PresentElements.end(); 93 ++otheriter) { 94 range<double> MinMaxDistance(0.,0.); 95 getMinMaxDistance((*iter),(*otheriter), MinMaxDistance, IsAngstroem); 96 if (MinMaxDistance.last > max_distance) 97 max_distance = MinMaxDistance.last; 98 } 99 } 89 100 return max_distance; 90 101 } 91 92 /** Returns the upper limit on possible bond distances.93 *94 * Is set by SetMaxDistanceToMaxOfCovalentRadii(), is needed e.g. as cutoff95 * for linked-cell.96 *97 * \return maximum possible bond distance98 */99 double getMaxDistance() const;100 102 101 103 /** Returns bond criterion for given pair based on a bond length matrix. … … 142 144 if (counter > 1) { 143 145 LOG(1, "STATUS: Setting max bond distance."); 144 SetMaxDistanceToMaxOfCovalentRadii(Set);146 const double max_distance = getMaxPossibleBondDistance(Set); 145 147 146 148 LOG(1, "STATUS: Creating LinkedCell structure for given " << counter << " atoms."); … … 399 401 //!> Matrix with bond lenth per two elements 400 402 MatrixContainer *BondLengthMatrix; 401 //!> maximum distance over all bonds possible402 double max_distance;403 403 //!> distance units are angstroem (true), bohr radii (false) 404 404 bool IsAngstroem;
Note:
See TracChangeset
for help on using the changeset viewer.