Changeset 6bd7e0 for src/LinkedCell
- Timestamp:
- Jan 2, 2012, 1:34:28 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:
- d78531
- Parents:
- f55ae5
- git-author:
- Frederik Heber <heber@…> (12/19/11 16:46:11)
- git-committer:
- Frederik Heber <heber@…> (01/02/12 13:34:28)
- Location:
- src/LinkedCell
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/LinkedCell/linkedcell.cpp
rf55ae5 r6bd7e0 8 8 /** \file linkedcell.cpp 9 9 * 10 * Function implementations for the class LinkedCell .10 * Function implementations for the class LinkedCell_deprecated. 11 11 * 12 12 */ … … 30 30 #include "Tesselation/tesselation.hpp" 31 31 32 // ========================================================= class LinkedCell ===========================================33 34 /** Constructor for class LinkedCell .35 */ 36 LinkedCell ::LinkedCell() :32 // ========================================================= class LinkedCell_deprecated =========================================== 33 34 /** Constructor for class LinkedCell_deprecated. 35 */ 36 LinkedCell_deprecated::LinkedCell_deprecated() : 37 37 LC(NULL), 38 38 RADIUS(0.), … … 49 49 * \param RADIUS edge length of cells 50 50 */ 51 LinkedCell ::LinkedCell(IPointCloud & set, const double radius) :51 LinkedCell_deprecated::LinkedCell_deprecated(IPointCloud & set, const double radius) : 52 52 LC(NULL), 53 53 RADIUS(radius), … … 122 122 123 123 124 /** Destructor for class LinkedCell .125 */ 126 LinkedCell ::~LinkedCell()124 /** Destructor for class LinkedCell_deprecated. 125 */ 126 LinkedCell_deprecated::~LinkedCell_deprecated() 127 127 { 128 128 if (LC != NULL) … … 135 135 }; 136 136 137 /** Checks whether LinkedCell ::n[] is each within [0,N[]].137 /** Checks whether LinkedCell_deprecated::n[] is each within [0,N[]]. 138 138 * \return if all in intervals - true, else -false 139 139 */ 140 bool LinkedCell ::CheckBounds() const140 bool LinkedCell_deprecated::CheckBounds() const 141 141 { 142 142 bool status = true; … … 148 148 }; 149 149 150 /** Checks whether LinkedCell ::n[] plus relative offset is each within [0,N[]].150 /** Checks whether LinkedCell_deprecated::n[] plus relative offset is each within [0,N[]]. 151 151 * Note that for this check we don't admonish if out of bounds. 152 152 * \param relative[NDIM] relative offset to current cell 153 153 * \return if all in intervals - true, else -false 154 154 */ 155 bool LinkedCell ::CheckBounds(const int relative[NDIM]) const155 bool LinkedCell_deprecated::CheckBounds(const int relative[NDIM]) const 156 156 { 157 157 bool status = true; … … 163 163 164 164 /** Returns a pointer to the current cell. 165 * \return LinkedAtoms pointer to current cell, NULL if LinkedCell ::n[] are out of bounds.166 */ 167 const TesselPointSTLList* LinkedCell ::GetCurrentCell() const165 * \return LinkedAtoms pointer to current cell, NULL if LinkedCell_deprecated::n[] are out of bounds. 166 */ 167 const TesselPointSTLList* LinkedCell_deprecated::GetCurrentCell() const 168 168 { 169 169 if (CheckBounds()) { … … 176 176 177 177 /** Returns a pointer to the current cell. 178 * \param relative[NDIM] offset for each axis with respect to the current cell LinkedCell ::n[NDIM]179 * \return LinkedAtoms pointer to current cell, NULL if LinkedCell ::n[]+relative[] are out of bounds.180 */ 181 const TesselPointSTLList* LinkedCell ::GetRelativeToCurrentCell(const int relative[NDIM]) const178 * \param relative[NDIM] offset for each axis with respect to the current cell LinkedCell_deprecated::n[NDIM] 179 * \return LinkedAtoms pointer to current cell, NULL if LinkedCell_deprecated::n[]+relative[] are out of bounds. 180 */ 181 const TesselPointSTLList* LinkedCell_deprecated::GetRelativeToCurrentCell(const int relative[NDIM]) const 182 182 { 183 183 if (CheckBounds(relative)) { … … 193 193 * \return Vector is inside bounding box - true, else - false 194 194 */ 195 bool LinkedCell ::SetIndexToVector(const Vector & x) const195 bool LinkedCell_deprecated::SetIndexToVector(const Vector & x) const 196 196 { 197 197 for (int i=0;i<NDIM;i++) … … 205 205 * \return if the atom is also found in this cell - true, else - false 206 206 */ 207 bool LinkedCell ::SetIndexToNode(const TesselPoint * const Walker) const207 bool LinkedCell_deprecated::SetIndexToNode(const TesselPoint * const Walker) const 208 208 { 209 209 bool status = false; … … 227 227 * \param step how deep to check the neighbouring cells (i.e. number of layers to check) 228 228 */ 229 void LinkedCell ::GetNeighbourBounds(int lower[NDIM], int upper[NDIM], int step) const229 void LinkedCell_deprecated::GetNeighbourBounds(int lower[NDIM], int upper[NDIM], int step) const 230 230 { 231 231 for (int i=0;i<NDIM;i++) { … … 244 244 }; 245 245 246 /** Returns a list with all neighbours from the current LinkedCell ::index.246 /** Returns a list with all neighbours from the current LinkedCell_deprecated::index. 247 247 * \param distance (if no distance, then adjacent cells are taken) 248 248 * \return list of tesselpoints 249 249 */ 250 TesselPointSTLList* LinkedCell ::GetallNeighbours(const double distance) const250 TesselPointSTLList* LinkedCell_deprecated::GetallNeighbours(const double distance) const 251 251 { 252 252 int Nlower[NDIM], Nupper[NDIM]; … … 273 273 }; 274 274 275 /** Set the index to the cell containing a given Vector *x, which is not inside the LinkedCell 's domain275 /** Set the index to the cell containing a given Vector *x, which is not inside the LinkedCell_deprecated's domain 276 276 * Note that as we have to check distance from every corner of the closest cell, this function is faw more 277 * expensive and if Vector is known to be inside LinkedCell 's domain, then SetIndexToVector() should be used.277 * expensive and if Vector is known to be inside LinkedCell_deprecated's domain, then SetIndexToVector() should be used. 278 278 * \param *x Vector with coordinates 279 279 * \return minimum squared distance of cell to given vector (if inside of domain, distance is 0) 280 280 */ 281 double LinkedCell ::SetClosestIndexToOutsideVector(const Vector * const x) const281 double LinkedCell_deprecated::SetClosestIndexToOutsideVector(const Vector * const x) const 282 282 { 283 283 for (int i=0;i<NDIM;i++) { … … 291 291 // calculate distance of cell to vector 292 292 double distanceSquared = 0.; 293 bool outside = true; // flag whether x is found in- or outside of LinkedCell 's domain/closest cell293 bool outside = true; // flag whether x is found in- or outside of LinkedCell_deprecated's domain/closest cell 294 294 Vector corner; // current corner of closest cell 295 295 Vector tester; // Vector pointing from corner to center of closest cell … … 326 326 * \return list of all points inside sphere 327 327 */ 328 TesselPointSTLList* LinkedCell ::GetPointsInsideSphere(const double radius, const Vector * const center) const328 TesselPointSTLList* LinkedCell_deprecated::GetPointsInsideSphere(const double radius, const Vector * const center) const 329 329 { 330 330 const double radiusSquared = radius*radius; -
src/LinkedCell/linkedcell.hpp
rf55ae5 r6bd7e0 48 48 /** Linked Cell class for containing Vectors in real space efficiently. 49 49 */ 50 class LinkedCell {50 class LinkedCell_deprecated { 51 51 private: 52 52 … … 60 60 mutable int index; // temporary index variable , access by index = n[0] * N[1] * N[2] + n[1] * N[2] + n[2]; 61 61 62 LinkedCell ();63 LinkedCell (IPointCloud &set, const double radius);64 ~LinkedCell ();62 LinkedCell_deprecated(); 63 LinkedCell_deprecated(IPointCloud &set, const double radius); 64 ~LinkedCell_deprecated(); 65 65 const TesselPointSTLList* GetCurrentCell()const ; 66 66 const TesselPointSTLList* GetRelativeToCurrentCell(const int relative[NDIM])const ; -
src/LinkedCell/unittests/linkedcellUnitTest.cpp
rf55ae5 r6bd7e0 76 76 // construct linked cell 77 77 PointCloudAdaptor<molecule> cloud(TestMolecule, TestMolecule->name); 78 LC = new LinkedCell (cloud, 1.);78 LC = new LinkedCell_deprecated (cloud, 1.); 79 79 CPPUNIT_ASSERT(LC != NULL && "could not create LinkedCell"); 80 80 … … 91 91 92 92 93 /** UnitTest for LinkedCell ::CheckBounds().93 /** UnitTest for LinkedCell_deprecated::CheckBounds(). 94 94 */ 95 95 void linkedcelltest::CheckBoundsTest() … … 121 121 122 122 123 /** UnitTest for LinkedCell ::GetCurrentCell().123 /** UnitTest for LinkedCell_deprecated::GetCurrentCell(). 124 124 * Note that CheckBounds() is used and has to be tested already. 125 125 */ … … 143 143 }; 144 144 145 /** UnitTest for LinkedCell ::GetRelativeToCurrentCell().145 /** UnitTest for LinkedCell_deprecated::GetRelativeToCurrentCell(). 146 146 */ 147 147 void linkedcelltest::GetRelativeToCurrentCellTest() … … 200 200 201 201 202 /** UnitTest for LinkedCell ::SetIndexToNode().202 /** UnitTest for LinkedCell_deprecated::SetIndexToNode(). 203 203 */ 204 204 void linkedcelltest::SetIndexToNodeTest() … … 225 225 226 226 227 /** UnitTest for LinkedCell ::SetIndexToVector().227 /** UnitTest for LinkedCell_deprecated::SetIndexToVector(). 228 228 */ 229 229 void linkedcelltest::SetIndexToVectorTest() … … 261 261 262 262 263 /** UnitTest for LinkedCell ::GetNeighbourBounds().263 /** UnitTest for LinkedCell_deprecated::GetNeighbourBounds(). 264 264 */ 265 265 void linkedcelltest::GetNeighbourBoundsTest() … … 278 278 279 279 280 /** UnitTest for LinkedCell ::GetallNeighbours().280 /** UnitTest for LinkedCell_deprecated::GetallNeighbours(). 281 281 */ 282 282 void linkedcelltest::GetallNeighboursTest() … … 339 339 340 340 341 /** UnitTest for LinkedCell ::GetPointsInsideSphere().341 /** UnitTest for LinkedCell_deprecated::GetPointsInsideSphere(). 342 342 */ 343 343 void linkedcelltest::GetPointsInsideSphereTest() -
src/LinkedCell/unittests/linkedcellUnitTest.hpp
rf55ae5 r6bd7e0 19 19 20 20 class element; 21 class LinkedCell ;21 class LinkedCell_deprecated; 22 22 class molecule; 23 23 class periodentafel; … … 55 55 molecule *TestMolecule; 56 56 const element *hydrogen; 57 LinkedCell *LC;57 LinkedCell_deprecated *LC; 58 58 }; 59 59
Note:
See TracChangeset
for help on using the changeset viewer.