Changeset 6bd7e0 for src/LinkedCell


Ignore:
Timestamp:
Jan 2, 2012, 1:34:28 PM (13 years ago)
Author:
Frederik Heber <heber@…>
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)
Message:

Renamed old LinkedCell class to LinkedCell_deprecated.

  • this is preparatory for a smooth transition to the new implementation.
  • note that class LinkedCell and namespace LinkedCell bite each other so far.
Location:
src/LinkedCell
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/LinkedCell/linkedcell.cpp

    rf55ae5 r6bd7e0  
    88/** \file linkedcell.cpp
    99 *
    10  * Function implementations for the class LinkedCell.
     10 * Function implementations for the class LinkedCell_deprecated.
    1111 *
    1212 */
     
    3030#include "Tesselation/tesselation.hpp"
    3131
    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 */
     36LinkedCell_deprecated::LinkedCell_deprecated() :
    3737  LC(NULL),
    3838  RADIUS(0.),
     
    4949 * \param RADIUS edge length of cells
    5050 */
    51 LinkedCell::LinkedCell(IPointCloud & set, const double radius) :
     51LinkedCell_deprecated::LinkedCell_deprecated(IPointCloud & set, const double radius) :
    5252  LC(NULL),
    5353  RADIUS(radius),
     
    122122
    123123
    124 /** Destructor for class LinkedCell.
    125  */
    126 LinkedCell::~LinkedCell()
     124/** Destructor for class LinkedCell_deprecated.
     125 */
     126LinkedCell_deprecated::~LinkedCell_deprecated()
    127127{
    128128  if (LC != NULL)
     
    135135};
    136136
    137 /** Checks whether LinkedCell::n[] is each within [0,N[]].
     137/** Checks whether LinkedCell_deprecated::n[] is each within [0,N[]].
    138138 * \return if all in intervals - true, else -false
    139139 */
    140 bool LinkedCell::CheckBounds() const
     140bool LinkedCell_deprecated::CheckBounds() const
    141141{
    142142  bool status = true;
     
    148148};
    149149
    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[]].
    151151 * Note that for this check we don't admonish if out of bounds.
    152152 * \param relative[NDIM] relative offset to current cell
    153153 * \return if all in intervals - true, else -false
    154154 */
    155 bool LinkedCell::CheckBounds(const int relative[NDIM]) const
     155bool LinkedCell_deprecated::CheckBounds(const int relative[NDIM]) const
    156156{
    157157  bool status = true;
     
    163163
    164164/** 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() const
     165 * \return LinkedAtoms pointer to current cell, NULL if LinkedCell_deprecated::n[] are out of bounds.
     166 */
     167const TesselPointSTLList* LinkedCell_deprecated::GetCurrentCell() const
    168168{
    169169  if (CheckBounds()) {
     
    176176
    177177/** 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]) const
     178 * \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 */
     181const TesselPointSTLList* LinkedCell_deprecated::GetRelativeToCurrentCell(const int relative[NDIM]) const
    182182{
    183183  if (CheckBounds(relative)) {
     
    193193 * \return Vector is inside bounding box - true, else - false
    194194 */
    195 bool LinkedCell::SetIndexToVector(const Vector & x) const
     195bool LinkedCell_deprecated::SetIndexToVector(const Vector & x) const
    196196{
    197197  for (int i=0;i<NDIM;i++)
     
    205205 * \return if the atom is also found in this cell - true, else - false
    206206 */
    207 bool LinkedCell::SetIndexToNode(const TesselPoint * const Walker) const
     207bool LinkedCell_deprecated::SetIndexToNode(const TesselPoint * const Walker) const
    208208{
    209209  bool status = false;
     
    227227 * \param step how deep to check the neighbouring cells (i.e. number of layers to check)
    228228 */
    229 void LinkedCell::GetNeighbourBounds(int lower[NDIM], int upper[NDIM], int step) const
     229void LinkedCell_deprecated::GetNeighbourBounds(int lower[NDIM], int upper[NDIM], int step) const
    230230{
    231231  for (int i=0;i<NDIM;i++) {
     
    244244};
    245245
    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.
    247247 * \param distance (if no distance, then adjacent cells are taken)
    248248 * \return list of tesselpoints
    249249 */
    250 TesselPointSTLList* LinkedCell::GetallNeighbours(const double distance) const
     250TesselPointSTLList* LinkedCell_deprecated::GetallNeighbours(const double distance) const
    251251{
    252252  int Nlower[NDIM], Nupper[NDIM];
     
    273273};
    274274
    275 /** Set the index to the cell containing a given Vector *x, which is not inside the LinkedCell's domain
     275/** Set the index to the cell containing a given Vector *x, which is not inside the LinkedCell_deprecated's domain
    276276 * 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.
    278278 * \param *x Vector with coordinates
    279279 * \return minimum squared distance of cell to given vector (if inside of domain, distance is 0)
    280280 */
    281 double LinkedCell::SetClosestIndexToOutsideVector(const Vector * const x) const
     281double LinkedCell_deprecated::SetClosestIndexToOutsideVector(const Vector * const x) const
    282282{
    283283  for (int i=0;i<NDIM;i++) {
     
    291291  // calculate distance of cell to vector
    292292  double distanceSquared = 0.;
    293   bool outside = true;  // flag whether x is found in- or outside of LinkedCell's domain/closest cell
     293  bool outside = true;  // flag whether x is found in- or outside of LinkedCell_deprecated's domain/closest cell
    294294  Vector corner; // current corner of closest cell
    295295  Vector tester; // Vector pointing from corner to center of closest cell
     
    326326 * \return list of all points inside sphere
    327327 */
    328 TesselPointSTLList* LinkedCell::GetPointsInsideSphere(const double radius, const Vector * const center) const
     328TesselPointSTLList* LinkedCell_deprecated::GetPointsInsideSphere(const double radius, const Vector * const center) const
    329329{
    330330  const double radiusSquared = radius*radius;
  • src/LinkedCell/linkedcell.hpp

    rf55ae5 r6bd7e0  
    4848/** Linked Cell class for containing Vectors in real space efficiently.
    4949 */
    50 class LinkedCell {
     50class LinkedCell_deprecated {
    5151private:
    5252
     
    6060    mutable int index;        // temporary index variable , access by index = n[0] * N[1] * N[2] + n[1] * N[2] + n[2];
    6161
    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();
    6565    const TesselPointSTLList* GetCurrentCell()const ;
    6666    const TesselPointSTLList* GetRelativeToCurrentCell(const int relative[NDIM])const ;
  • src/LinkedCell/unittests/linkedcellUnitTest.cpp

    rf55ae5 r6bd7e0  
    7676  // construct linked cell
    7777  PointCloudAdaptor<molecule> cloud(TestMolecule, TestMolecule->name);
    78   LC = new LinkedCell (cloud, 1.);
     78  LC = new LinkedCell_deprecated (cloud, 1.);
    7979  CPPUNIT_ASSERT(LC != NULL && "could not create LinkedCell");
    8080
     
    9191
    9292
    93 /** UnitTest for LinkedCell::CheckBounds().
     93/** UnitTest for LinkedCell_deprecated::CheckBounds().
    9494 */
    9595void linkedcelltest::CheckBoundsTest()
     
    121121
    122122
    123 /** UnitTest for LinkedCell::GetCurrentCell().
     123/** UnitTest for LinkedCell_deprecated::GetCurrentCell().
    124124 * Note that CheckBounds() is used and has to be tested already.
    125125 */
     
    143143};
    144144
    145 /** UnitTest for LinkedCell::GetRelativeToCurrentCell().
     145/** UnitTest for LinkedCell_deprecated::GetRelativeToCurrentCell().
    146146 */
    147147void linkedcelltest::GetRelativeToCurrentCellTest()
     
    200200
    201201
    202 /** UnitTest for LinkedCell::SetIndexToNode().
     202/** UnitTest for LinkedCell_deprecated::SetIndexToNode().
    203203 */
    204204void linkedcelltest::SetIndexToNodeTest()
     
    225225
    226226
    227 /** UnitTest for LinkedCell::SetIndexToVector().
     227/** UnitTest for LinkedCell_deprecated::SetIndexToVector().
    228228 */
    229229void linkedcelltest::SetIndexToVectorTest()
     
    261261
    262262
    263 /** UnitTest for LinkedCell::GetNeighbourBounds().
     263/** UnitTest for LinkedCell_deprecated::GetNeighbourBounds().
    264264 */
    265265void linkedcelltest::GetNeighbourBoundsTest()
     
    278278
    279279
    280 /** UnitTest for LinkedCell::GetallNeighbours().
     280/** UnitTest for LinkedCell_deprecated::GetallNeighbours().
    281281 */
    282282void linkedcelltest::GetallNeighboursTest()
     
    339339
    340340
    341 /** UnitTest for LinkedCell::GetPointsInsideSphere().
     341/** UnitTest for LinkedCell_deprecated::GetPointsInsideSphere().
    342342 */
    343343void linkedcelltest::GetPointsInsideSphereTest()
  • src/LinkedCell/unittests/linkedcellUnitTest.hpp

    rf55ae5 r6bd7e0  
    1919
    2020class element;
    21 class LinkedCell;
     21class LinkedCell_deprecated;
    2222class molecule;
    2323class periodentafel;
     
    5555      molecule *TestMolecule;
    5656      const element *hydrogen;
    57       LinkedCell *LC;
     57      LinkedCell_deprecated *LC;
    5858};
    5959
Note: See TracChangeset for help on using the changeset viewer.