Changeset 34c43a for src/linkedcell.cpp
- Timestamp:
- Mar 1, 2011, 10:16:38 AM (15 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:
- caa06ef
- Parents:
- ba5215
- git-author:
- Frederik Heber <heber@…> (02/21/11 18:02:41)
- git-committer:
- Frederik Heber <heber@…> (03/01/11 10:16:38)
- File:
-
- 1 edited
-
src/linkedcell.cpp (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/linkedcell.cpp
rba5215 r34c43a 25 25 #include "CodePatterns/Log.hpp" 26 26 #include "molecule.hpp" 27 #include " PointCloud.hpp"27 #include "IPointCloud.hpp" 28 28 #include "tesselation.hpp" 29 29 #include "LinearAlgebra/Vector.hpp" 30 30 31 31 // ========================================================= class LinkedCell =========================================== 32 33 /** Constructor for class LinkedCell::LinkedNodes.34 */35 LinkedCell::LinkedNodes::LinkedNodes()36 {}37 38 /** Destructor for class LinkedCell::LinkedNodes.39 */40 LinkedCell::LinkedNodes::~LinkedNodes()41 {}42 43 TesselPoint * LinkedCell::LinkedNodes::getValue (const_iterator &rhs) const44 {45 return *rhs;46 }47 48 TesselPoint * LinkedCell::LinkedNodes::getValue (iterator &rhs) const49 {50 return *rhs;51 }52 32 53 33 /** Constructor for class LinkedCell. … … 68 48 * \param RADIUS edge length of cells 69 49 */ 70 LinkedCell::LinkedCell( constPointCloud & set, const double radius) :50 LinkedCell::LinkedCell(IPointCloud & set, const double radius) : 71 51 LC(NULL), 72 52 RADIUS(radius), … … 117 97 } 118 98 ASSERT(N[0]*N[1]*N[2] < MAX_LINKEDCELLNODES, "Number linked of linked cell nodes exceded hard-coded limit, use greater edge length!"); 119 LC = new LinkedNodes[N[0]*N[1]*N[2]];99 LC = new TesselPointSTLList[N[0]*N[1]*N[2]]; 120 100 for (index=0;index<N[0]*N[1]*N[2];index++) { 121 101 LC [index].clear(); … … 184 164 * \return LinkedAtoms pointer to current cell, NULL if LinkedCell::n[] are out of bounds. 185 165 */ 186 const LinkedCell::LinkedNodes* LinkedCell::GetCurrentCell() const166 const TesselPointSTLList* LinkedCell::GetCurrentCell() const 187 167 { 188 168 if (CheckBounds()) { … … 198 178 * \return LinkedAtoms pointer to current cell, NULL if LinkedCell::n[]+relative[] are out of bounds. 199 179 */ 200 const LinkedCell::LinkedNodes* LinkedCell::GetRelativeToCurrentCell(const int relative[NDIM]) const180 const TesselPointSTLList* LinkedCell::GetRelativeToCurrentCell(const int relative[NDIM]) const 201 181 { 202 182 if (CheckBounds(relative)) { … … 232 212 index = n[0] * N[1] * N[2] + n[1] * N[2] + n[2]; 233 213 if (CheckBounds()) { 234 for ( LinkedNodes::iterator Runner = LC[index].begin(); Runner != LC[index].end(); Runner++)214 for (TesselPointSTLList::iterator Runner = LC[index].begin(); Runner != LC[index].end(); Runner++) 235 215 status = status || ((*Runner) == Walker); 236 216 return status; … … 267 247 * \return list of tesselpoints 268 248 */ 269 LinkedCell::LinkedNodes* LinkedCell::GetallNeighbours(const double distance) const249 TesselPointSTLList* LinkedCell::GetallNeighbours(const double distance) const 270 250 { 271 251 int Nlower[NDIM], Nupper[NDIM]; 272 252 TesselPoint *Walker = NULL; 273 LinkedNodes *TesselList = new LinkedNodes;253 TesselPointSTLList *TesselList = new TesselPointSTLList; 274 254 275 255 // then go through the current and all neighbouring cells and check the contained points for possible candidates … … 281 261 for (n[1] = Nlower[1]; n[1] <= Nupper[1]; n[1]++) 282 262 for (n[2] = Nlower[2]; n[2] <= Nupper[2]; n[2]++) { 283 const LinkedNodes*List = GetCurrentCell();263 const TesselPointSTLList *List = GetCurrentCell(); 284 264 //Log() << Verbose(1) << "Current cell is " << n[0] << ", " << n[1] << ", " << n[2] << " with No. " << index << "." << endl; 285 265 if (List != NULL) { 286 for ( LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {266 for (TesselPointSTLList::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) { 287 267 Walker = *Runner; 288 268 TesselList->push_back(Walker); … … 346 326 * \return list of all points inside sphere 347 327 */ 348 LinkedCell::LinkedNodes* LinkedCell::GetPointsInsideSphere(const double radius, const Vector * const center) const328 TesselPointSTLList* LinkedCell::GetPointsInsideSphere(const double radius, const Vector * const center) const 349 329 { 350 330 const double radiusSquared = radius*radius; 351 331 TesselPoint *Walker = NULL; 352 LinkedNodes *TesselList = new LinkedNodes;353 LinkedNodes*NeighbourList = NULL;332 TesselPointSTLList *TesselList = new TesselPointSTLList; 333 TesselPointSTLList *NeighbourList = NULL; 354 334 355 335 // set index of LC to center of sphere … … 365 345 //Log() << Verbose(1) << "I found " << NeighbourList->size() << " neighbours to check." << endl; 366 346 if (NeighbourList != NULL) { 367 for ( LinkedNodes::const_iterator Runner = NeighbourList->begin(); Runner != NeighbourList->end(); Runner++) {347 for (TesselPointSTLList::const_iterator Runner = NeighbourList->begin(); Runner != NeighbourList->end(); Runner++) { 368 348 Walker = *Runner; 369 349 //Log() << Verbose(1) << "Current neighbour is at " << *Walker->node << "." << endl;
Note:
See TracChangeset
for help on using the changeset viewer.
