Changeset 025048
- Timestamp:
- Oct 20, 2011, 12:39:01 PM (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:
- 9317be
- Parents:
- 93d78e8
- Location:
- src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Box.cpp
r93d78e8 r025048 38 38 39 39 using namespace std; 40 41 VECTORSET(std::list) Box::internal_list; 40 42 41 43 Box::Box() : … … 135 137 VECTORSET(std::list) Box::explode(const Vector &point,int n) const{ 136 138 ASSERT(isInside(point),"Exploded point not inside Box"); 137 VECTORSET(std::list) res; 139 internal_explode(point, n); 140 VECTORSET(std::list) res(internal_list); 141 return res; 142 } 143 144 void Box::internal_explode(const Vector &point,int n) const{ 145 internal_list.clear(); 138 146 139 147 Vector translater = translateOut(point); … … 156 164 if(!dims){ 157 165 // all boundaries are ignored 158 res.push_back(point);159 return res;166 internal_list.push_back(point); 167 return; 160 168 } 161 169 … … 189 197 case Ignore: 190 198 ASSERT(0,"Ignored coordinate handled in generation loop"); 199 break; 191 200 default: 192 201 ASSERT(0,"No default case for this switch-case"); 202 break; 193 203 } 194 204 … … 196 206 // add back all ignored coordinates (not handled in above loop) 197 207 helper+=mask; 198 res.push_back(translateIn(helper));208 internal_list.push_back(translateIn(helper)); 199 209 // set the new indexes 200 210 int pos=0; … … 209 219 } 210 220 } 211 return res;212 221 } 213 222 … … 218 227 219 228 double Box::periodicDistanceSquared(const Vector &point1,const Vector &point2) const{ 220 Vector helper1 = WrapPeriodically(point1);221 Vector helper2 = WrapPeriodically(point2);222 VECTORSET(std::list) expansion = explode(helper1);223 double res = expansion.minDistSquared(helper2);229 Vector helper1(!isInside(point1) ? WrapPeriodically(point1) : point1); 230 Vector helper2(!isInside(point2) ? WrapPeriodically(point2) : point2); 231 internal_explode(helper1,1); 232 double res = internal_list.minDistSquared(helper2); 224 233 return res; 225 234 } -
src/Box.hpp
r93d78e8 r025048 122 122 123 123 private: 124 /** Internal explode function that works on the staticly present internal_list 125 * 126 * \todo Note that is not thread-safe! 127 * 128 * Most of the time of explode is consumed by memory allocation if it is called 129 * repeatedly. 130 * 131 * @param point point to explode 132 * @param n neighbour shells to explode 133 */ 134 void internal_explode(const Vector &point,int n) const; 135 136 //!> Internal vector list for exploding vectors and checking. 137 static VECTORSET(std::list) internal_list; 138 124 139 Conditions_t conditions; 125 140 RealSpaceMatrix *M; //!< Defines the layout of the box
Note:
See TracChangeset
for help on using the changeset viewer.