Changeset 607eab
- Timestamp:
- Mar 1, 2011, 1:17:09 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:
- 632508
- Parents:
- cff66c
- git-author:
- Frederik Heber <heber@…> (02/28/11 16:06:03)
- git-committer:
- Frederik Heber <heber@…> (03/01/11 13:17:09)
- Location:
- src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/FragmentationAction/CreateAdjacencyAction.cpp
rcff66c r607eab 133 133 ASSERT(OtherWalker,"TesselPoint that was not an atom retrieved from LinkedNode"); 134 134 //Log() << Verbose(1) << "Checking distance " << OtherWalker->x.PeriodicDistanceSquared(&(Walker->x), cell_size) << " against typical bond length of " << bonddistance*bonddistance << "." << endl; 135 range<double> MinMaxDistanceSquared(0.,0.);136 BG->getMinMaxDistanceSquared(Walker, OtherWalker, MinMaxDistanceSquared);135 const range<double> MinMaxDistanceSquared( 136 BG->getMinMaxDistanceSquared(Walker, OtherWalker)); 137 137 const double distance = domain.periodicDistanceSquared(OtherWalker->getPosition(),Walker->getPosition()); 138 138 const bool status = MinMaxDistanceSquared.isInRange(distance); -
src/bondgraph.cpp
rcff66c r607eab 97 97 } 98 98 99 voidBondGraph::CovalentMinMaxDistance(99 range<double> BondGraph::CovalentMinMaxDistance( 100 100 const element * const Walker, 101 const element * const OtherWalker ,102 range<double> &MinMaxDistance) const 103 { 101 const element * const OtherWalker) const 102 { 103 range<double> MinMaxDistance(0.,0.); 104 104 MinMaxDistance.first = OtherWalker->getCovalentRadius() + Walker->getCovalentRadius(); 105 105 MinMaxDistance.first *= (IsAngstroem) ? 1. : 1. / AtomicLengthToAngstroem; 106 106 MinMaxDistance.last = MinMaxDistance.first + BondThreshold; 107 107 MinMaxDistance.first -= BondThreshold; 108 } 109 110 void BondGraph::BondLengthMatrixMinMaxDistance( 108 return MinMaxDistance; 109 } 110 111 range<double> BondGraph::BondLengthMatrixMinMaxDistance( 111 112 const element * const Walker, 112 const element * const OtherWalker, 113 range<double> &MinMaxDistance) const 113 const element * const OtherWalker) const 114 114 { 115 115 ASSERT(BondLengthMatrix, "BondGraph::BondLengthMatrixMinMaxDistance() called without NULL BondLengthMatrix."); 116 116 ASSERT(Walker, "BondGraph::BondLengthMatrixMinMaxDistance() - illegal element given."); 117 117 ASSERT(OtherWalker, "BondGraph::BondLengthMatrixMinMaxDistance() - illegal other element given."); 118 range<double> MinMaxDistance(0.,0.); 118 119 MinMaxDistance.first = GetBondLength(Walker->getAtomicNumber()-1, OtherWalker->getAtomicNumber()-1); 119 120 MinMaxDistance.first *= (IsAngstroem) ? 1. : 1. / AtomicLengthToAngstroem; 120 121 MinMaxDistance.last = MinMaxDistance.first + BondThreshold; 121 122 MinMaxDistance.first -= BondThreshold; 122 } 123 124 void BondGraph::getMinMaxDistance( 123 return MinMaxDistance; 124 } 125 126 range<double> BondGraph::getMinMaxDistance( 125 127 const element * const Walker, 126 const element * const OtherWalker ,127 range<double> &MinMaxDistance) const 128 { 128 const element * const OtherWalker) const 129 { 130 range<double> MinMaxDistance(0.,0.); 129 131 if (BondLengthMatrix == NULL) {// safety measure if no matrix has been parsed yet 130 132 LOG(2, "INFO: Using Covalent radii criterion for [min,max) distances."); 131 CovalentMinMaxDistance(Walker, OtherWalker, MinMaxDistance);133 MinMaxDistance = CovalentMinMaxDistance(Walker, OtherWalker); 132 134 } else { 133 135 LOG(2, "INFO: Using Covalent radii criterion for [min,max) distances."); 134 BondLengthMatrixMinMaxDistance(Walker, OtherWalker, MinMaxDistance); 135 } 136 } 137 138 void BondGraph::getMinMaxDistance( 136 MinMaxDistance = BondLengthMatrixMinMaxDistance(Walker, OtherWalker); 137 } 138 return MinMaxDistance; 139 } 140 141 range<double> BondGraph::getMinMaxDistance( 139 142 const BondedParticle * const Walker, 140 const BondedParticle * const OtherWalker, 141 range<double> &MinMaxDistance) const 142 { 143 getMinMaxDistance(Walker->getType(), OtherWalker->getType(),MinMaxDistance); 144 } 145 146 void BondGraph::getMinMaxDistanceSquared( 143 const BondedParticle * const OtherWalker) const 144 { 145 return getMinMaxDistance(Walker->getType(), OtherWalker->getType()); 146 } 147 148 range<double> BondGraph::getMinMaxDistanceSquared( 147 149 const BondedParticle * const Walker, 148 const BondedParticle * const OtherWalker, 149 range<double> &MinMaxDistance) const 150 const BondedParticle * const OtherWalker) const 150 151 { 151 152 // use non-squared version 152 getMinMaxDistance(Walker, OtherWalker,MinMaxDistance);153 range<double> MinMaxDistance(getMinMaxDistance(Walker, OtherWalker)); 153 154 // and square 154 155 MinMaxDistance.first *= MinMaxDistance.first; 155 156 MinMaxDistance.last *= MinMaxDistance.last; 157 return MinMaxDistance; 156 158 } 157 159 … … 189 191 ASSERT(OtherWalker != NULL, 190 192 "BondGraph::CreateAdjacency() - TesselPoint that was not an atom retrieved from LinkedNode"); 191 range<double> MinMaxDistanceSquared(0.,0.);192 getMinMaxDistanceSquared(Walker, OtherWalker, MinMaxDistanceSquared);193 const range<double> MinMaxDistanceSquared( 194 getMinMaxDistanceSquared(Walker, OtherWalker)); 193 195 const double distance = domain.periodicDistanceSquared(OtherWalker->getPosition(),Walker->getPosition()); 194 196 LOG(2, "INFO: Checking squared distance " << distance << " against typical bond length of " << MinMaxDistanceSquared << "."); -
src/bondgraph.hpp
rcff66c r607eab 92 92 otheriter != PresentElements.end(); 93 93 ++otheriter) { 94 range<double> MinMaxDistance(0.,0.); 95 getMinMaxDistance((*iter),(*otheriter), MinMaxDistance); 94 const range<double> MinMaxDistance(getMinMaxDistance((*iter),(*otheriter))); 96 95 if (MinMaxDistance.last > max_distance) 97 96 max_distance = MinMaxDistance.last; … … 105 104 * \param *Walker first BondedParticle 106 105 * \param *OtherWalker second BondedParticle 107 * \ param &MinMaxDistance Range for interval on return108 */ 109 voidgetMinMaxDistance(106 * \return Range with bond interval 107 */ 108 range<double> getMinMaxDistance( 110 109 const BondedParticle * const Walker, 111 const BondedParticle * const OtherWalker, 112 range<double> &MinMaxDistance) const; 110 const BondedParticle * const OtherWalker) const; 113 111 114 112 /** Returns SQUARED bond criterion for given pair based on a bond length matrix. … … 117 115 * \param *Walker first BondedParticle 118 116 * \param *OtherWalker second BondedParticle 119 * \ param &MinMaxDistance Range for interval on return120 */ 121 voidgetMinMaxDistanceSquared(117 * \return Range with bond interval 118 */ 119 range<double> getMinMaxDistanceSquared( 122 120 const BondedParticle * const Walker, 123 const BondedParticle * const OtherWalker, 124 range<double> &MinMaxDistance) const; 121 const BondedParticle * const OtherWalker) const; 125 122 126 123 /** Creates the adjacency list for a given \a Range of iterable atoms. … … 319 316 * \param *Walker first BondedParticle 320 317 * \param *OtherWalker second BondedParticle 321 * \ param &MinMaxDistance Range for interval on return322 */ 323 voidgetMinMaxDistance(318 * \return Range with bond interval 319 */ 320 range<double> getMinMaxDistance( 324 321 const element * const Walker, 325 const element * const OtherWalker, 326 range<double> &MinMaxDistance) const; 322 const element * const OtherWalker) const; 327 323 328 324 /** Returns bond criterion for given pair of elements based on a bond length matrix. … … 331 327 * \param *Walker first element 332 328 * \param *OtherWalker second element 333 * @param MinMaxDistance reference to range type set on return334 */ 335 voidBondLengthMatrixMinMaxDistance(329 * \return Range with bond interval 330 */ 331 range<double> BondLengthMatrixMinMaxDistance( 336 332 const element * const Walker, 337 const element * const OtherWalker, 338 range<double> &MinMaxDistance) const; 333 const element * const OtherWalker) const; 339 334 340 335 /** Returns bond criterion for given pair of elements based on covalent radius. 341 336 * \param *Walker first element 342 337 * \param *OtherWalker second element 343 * @param MinMaxDistance reference to range type set on return344 */ 345 voidCovalentMinMaxDistance(338 * \return Range with bond interval 339 */ 340 range<double> CovalentMinMaxDistance( 346 341 const element * const Walker, 347 const element * const OtherWalker, 348 range<double> &MinMaxDistance) const; 342 const element * const OtherWalker) const; 349 343 350 344 -
src/molecule.cpp
rcff66c r607eab 344 344 // the problem is not the H being out of the box, but InBondvector have the wrong direction 345 345 // due to TopReplacement or Origin being on the wrong side! 346 range<double> MinMaxBondDistance(0.,0.);347 346 const BondGraph * const BG = World::getInstance().getBondGraph(); 348 BG->getMinMaxDistance(TopOrigin,TopReplacement,MinMaxBondDistance); 347 const range<double> MinMaxBondDistance( 348 BG->getMinMaxDistance(TopOrigin,TopReplacement)); 349 349 if (!MinMaxBondDistance.isInRange(bondlength)) { 350 350 // Log() << Verbose(4) << "InBondvector is: "; -
src/molecule_fragmentation.cpp
rcff66c r607eab 1811 1811 tmp = fabs(Binder->leftatom->at(i) - Binder->rightatom->at(i)); 1812 1812 //Log() << Verbose(3) << "Checking " << i << "th distance of " << *Binder->leftatom << " to " << *Binder->rightatom << ": " << tmp << "." << endl; 1813 range<double> MinMaxDistance(0.,0.);1814 BG->getMinMaxDistance(Binder->leftatom, Binder->rightatom, MinMaxDistance);1813 const range<double> MinMaxDistance( 1814 BG->getMinMaxDistance(Binder->leftatom, Binder->rightatom)); 1815 1815 if (!MinMaxDistance.isInRange(tmp)) { 1816 1816 DoLog(2) && (Log() << Verbose(2) << "Correcting at bond " << *Binder << "." << endl); … … 1826 1826 for (int i=NDIM;i--;) { 1827 1827 tmp = Binder->leftatom->at(i) - Binder->rightatom->at(i); 1828 range<double> MinMaxDistance(0.,0.);1829 BG->getMinMaxDistance(Binder->leftatom, Binder->rightatom, MinMaxDistance);1828 const range<double> MinMaxDistance( 1829 BG->getMinMaxDistance(Binder->leftatom, Binder->rightatom)); 1830 1830 if (fabs(tmp) > MinMaxDistance.last) // check against Min is not useful for components 1831 1831 Translationvector[i] = (tmp < 0) ? +1. : -1.; -
src/molecule_geometry.cpp
rcff66c r607eab 393 393 for (int j=0;j<NDIM;j++) { 394 394 tmp = (*iter)->at(j) - (*Runner)->GetOtherAtom(*iter)->at(j); 395 range<double> MinMaxBondDistance(0.,0.);396 BG->getMinMaxDistance((*iter), (*Runner)->GetOtherAtom(*iter), MinMaxBondDistance);395 const range<double> MinMaxBondDistance( 396 BG->getMinMaxDistance((*iter), (*Runner)->GetOtherAtom(*iter))); 397 397 if (fabs(tmp) > MinMaxBondDistance.last) { // check against Min is not useful for components 398 398 flag = false;
Note:
See TracChangeset
for help on using the changeset viewer.