From 700974dc4444fd6bf4b2573d12d08cd3965747dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= <klinkjak@fjfi.cvut.cz> Date: Thu, 26 Jan 2017 16:28:32 +0100 Subject: [PATCH] Removed getEntityMeasure method from grids It was unused and pointless (use entity.getMeasure() instead). --- src/TNL/Meshes/GridDetails/Grid1D.h | 12 +++----- src/TNL/Meshes/GridDetails/Grid1D_impl.h | 34 ++++++++--------------- src/TNL/Meshes/GridDetails/Grid2D.h | 12 +++----- src/TNL/Meshes/GridDetails/Grid2D_impl.h | 35 ++++++++---------------- src/TNL/Meshes/GridDetails/Grid3D.h | 10 ++----- src/TNL/Meshes/GridDetails/Grid3D_impl.h | 34 ++++++++--------------- 6 files changed, 44 insertions(+), 93 deletions(-) diff --git a/src/TNL/Meshes/GridDetails/Grid1D.h b/src/TNL/Meshes/GridDetails/Grid1D.h index fee2cf52a3..cead5c51a9 100644 --- a/src/TNL/Meshes/GridDetails/Grid1D.h +++ b/src/TNL/Meshes/GridDetails/Grid1D.h @@ -90,13 +90,6 @@ class Grid< 1, Real, Device, Index > : public Object __cuda_callable__ inline Index getEntityIndex( const Entity& entity ) const; - template< typename Entity > - __cuda_callable__ - RealType getEntityMeasure( const Entity& entity ) const; - - __cuda_callable__ - inline const RealType& getCellMeasure() const; - __cuda_callable__ inline const PointType& getSpaceSteps() const; @@ -105,7 +98,10 @@ class Grid< 1, Real, Device, Index > : public Object const RealType& getSpaceStepsProducts() const; __cuda_callable__ - RealType getSmallestSpaceStep() const; + inline const RealType& getCellMeasure() const; + + __cuda_callable__ + inline RealType getSmallestSpaceStep() const; template< typename GridFunction > diff --git a/src/TNL/Meshes/GridDetails/Grid1D_impl.h b/src/TNL/Meshes/GridDetails/Grid1D_impl.h index 89ceaab3ed..3c388fff33 100644 --- a/src/TNL/Meshes/GridDetails/Grid1D_impl.h +++ b/src/TNL/Meshes/GridDetails/Grid1D_impl.h @@ -211,29 +211,6 @@ getEntityIndex( const Entity& entity ) const return GridEntityGetter< ThisType, Entity >::getEntityIndex( *this, entity ); } -template< typename Real, - typename Device, - typename Index > - template< typename Entity > -__cuda_callable__ -Real -Grid< 1, Real, Device, Index >:: -getEntityMeasure( const Entity& entity ) const -{ - return GridEntityMeasureGetter< ThisType, Entity::getEntityDimension() >::getMeasure( *this, entity ); -} - -template< typename Real, - typename Device, - typename Index > -__cuda_callable__ -const Real& -Grid< 1, Real, Device, Index >:: -getCellMeasure() const -{ - return this->template getSpaceStepsProducts< 1 >(); -} - template< typename Real, typename Device, typename Index > @@ -259,6 +236,17 @@ getSpaceStepsProducts() const return this->spaceStepsProducts[ xPow + 2 ]; } +template< typename Real, + typename Device, + typename Index > +__cuda_callable__ +const Real& +Grid< 1, Real, Device, Index >:: +getCellMeasure() const +{ + return this->template getSpaceStepsProducts< 1 >(); +} + template< typename Real, typename Device, typename Index > diff --git a/src/TNL/Meshes/GridDetails/Grid2D.h b/src/TNL/Meshes/GridDetails/Grid2D.h index 96eea08e15..e56b50a404 100644 --- a/src/TNL/Meshes/GridDetails/Grid2D.h +++ b/src/TNL/Meshes/GridDetails/Grid2D.h @@ -95,13 +95,6 @@ class Grid< 2, Real, Device, Index > : public Object __cuda_callable__ inline Index getEntityIndex( const Entity& entity ) const; - template< typename Entity > - __cuda_callable__ - RealType getEntityMeasure( const Entity& entity ) const; - - __cuda_callable__ - inline const RealType& getCellMeasure() const; - __cuda_callable__ inline const PointType& getSpaceSteps() const; @@ -110,7 +103,10 @@ class Grid< 2, Real, Device, Index > : public Object const RealType& getSpaceStepsProducts() const; __cuda_callable__ - RealType getSmallestSpaceStep() const; + inline const RealType& getCellMeasure() const; + + __cuda_callable__ + inline RealType getSmallestSpaceStep() const; template< typename GridFunction > diff --git a/src/TNL/Meshes/GridDetails/Grid2D_impl.h b/src/TNL/Meshes/GridDetails/Grid2D_impl.h index 336c118292..90a1ae99bb 100644 --- a/src/TNL/Meshes/GridDetails/Grid2D_impl.h +++ b/src/TNL/Meshes/GridDetails/Grid2D_impl.h @@ -264,30 +264,6 @@ getEntityIndex( const Entity& entity ) const return GridEntityGetter< ThisType, Entity >::getEntityIndex( *this, entity ); } -template< typename Real, - typename Device, - typename Index > - template< typename Entity > -__cuda_callable__ -Real -Grid< 2, Real, Device, Index >:: -getEntityMeasure( const Entity& entity ) const -{ - return GridEntityMeasureGetter< ThisType, Entity::getEntityDimension() >::getMeasure( *this, entity ); -} - -template< typename Real, - typename Device, - typename Index > -__cuda_callable__ -const Real& -Grid< 2, Real, Device, Index >:: -getCellMeasure() const -{ - return this->template getSpaceStepsProducts< 1, 1 >(); -} - - template< typename Real, typename Device, typename Index > @@ -316,6 +292,17 @@ getSpaceStepsProducts() const return this->spaceStepsProducts[ xPow + 2 ][ yPow + 2 ]; } +template< typename Real, + typename Device, + typename Index > +__cuda_callable__ +const Real& +Grid< 2, Real, Device, Index >:: +getCellMeasure() const +{ + return this->template getSpaceStepsProducts< 1, 1 >(); +} + template< typename Real, typename Device, typename Index > diff --git a/src/TNL/Meshes/GridDetails/Grid3D.h b/src/TNL/Meshes/GridDetails/Grid3D.h index c319fa3b7f..b9cf126353 100644 --- a/src/TNL/Meshes/GridDetails/Grid3D.h +++ b/src/TNL/Meshes/GridDetails/Grid3D.h @@ -88,13 +88,6 @@ class Grid< 3, Real, Device, Index > : public Object __cuda_callable__ inline Index getEntityIndex( const Entity& entity ) const; - template< typename Entity > - __cuda_callable__ - RealType getEntityMeasure( const Entity& entity ) const; - - __cuda_callable__ - inline const RealType& getCellMeasure() const; - __cuda_callable__ inline const PointType& getSpaceSteps() const; @@ -102,6 +95,9 @@ class Grid< 3, Real, Device, Index > : public Object __cuda_callable__ const RealType& getSpaceStepsProducts() const; + __cuda_callable__ + inline const RealType& getCellMeasure() const; + __cuda_callable__ RealType getSmallestSpaceStep() const; diff --git a/src/TNL/Meshes/GridDetails/Grid3D_impl.h b/src/TNL/Meshes/GridDetails/Grid3D_impl.h index de59b9aab4..ee3e10d4b1 100644 --- a/src/TNL/Meshes/GridDetails/Grid3D_impl.h +++ b/src/TNL/Meshes/GridDetails/Grid3D_impl.h @@ -311,29 +311,6 @@ getEntityIndex( const Entity& entity ) const return GridEntityGetter< ThisType, Entity >::getEntityIndex( *this, entity ); } -template< typename Real, - typename Device, - typename Index > - template< typename Entity > -__cuda_callable__ -Real -Grid< 3, Real, Device, Index >:: -getEntityMeasure( const Entity& entity ) const -{ - return GridEntityMeasureGetter< ThisType, Entity::getEntityDimension() >::getMeasure( *this, entity ); -} - -template< typename Real, - typename Device, - typename Index > -__cuda_callable__ -const Real& -Grid< 3, Real, Device, Index >:: -getCellMeasure() const -{ - return this->template getSpaceStepsProducts< 1, 1, 1 >(); -} - template< typename Real, typename Device, typename Index > @@ -364,6 +341,17 @@ getSpaceStepsProducts() const return this->spaceStepsProducts[ xPow + 2 ][ yPow + 2 ][ zPow + 2 ]; } +template< typename Real, + typename Device, + typename Index > +__cuda_callable__ +const Real& +Grid< 3, Real, Device, Index >:: +getCellMeasure() const +{ + return this->template getSpaceStepsProducts< 1, 1, 1 >(); +} + template< typename Real, typename Device, typename Index > -- GitLab