From 512752ece817f03bb0f0ed90d913c103ff62cfe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= <klinkjak@fjfi.cvut.cz> Date: Mon, 17 Oct 2016 16:01:38 +0200 Subject: [PATCH] Unified convention of method naming The "getSuperentityIndices" and "getSubentityIndices" names are also the only grammatically correct variant. --- src/TNL/Meshes/MeshDetails/MeshEntity_impl.h | 36 ++++++++++--------- .../initializer/MeshEntityInitializer.h | 2 +- .../layers/MeshSuperentityStorageLayer.h | 14 ++++---- .../traits/MeshSuperentityTraits.h | 2 +- src/TNL/Meshes/MeshEntity.h | 12 +++---- src/UnitTests/Meshes/MeshEntityTest.h | 30 ++++++++-------- 6 files changed, 49 insertions(+), 47 deletions(-) diff --git a/src/TNL/Meshes/MeshDetails/MeshEntity_impl.h b/src/TNL/Meshes/MeshDetails/MeshEntity_impl.h index 147537fa47..ab4ed9af9f 100644 --- a/src/TNL/Meshes/MeshDetails/MeshEntity_impl.h +++ b/src/TNL/Meshes/MeshDetails/MeshEntity_impl.h @@ -132,7 +132,7 @@ MeshEntity< MeshConfig, EntityTopology >:: subentitiesAvailable() const { return SubentityTraits< Subdimensions >::storageEnabled; -}; +} template< typename MeshConfig, typename EntityTopology > @@ -142,7 +142,7 @@ MeshEntity< MeshConfig, EntityTopology >:: getNumberOfSubentities() const { return SubentityTraits< Subdimensions >::count; -}; +} template< typename MeshConfig, typename EntityTopology > @@ -166,11 +166,12 @@ template< typename MeshConfig, template< int Subdimensions > typename MeshEntity< MeshConfig, EntityTopology >::template SubentityTraits< Subdimensions >::AccessArrayType& MeshEntity< MeshConfig, EntityTopology >:: - getSubentitiesIndices() +getSubentityIndices() { static_assert( SubentityTraits< Subdimensions >::storageEnabled, "You try to get subentities which are not configured for storage." ); typedef MeshSubentityStorageLayers< MeshConfig, EntityTopology > SubentityBaseType; - return SubentityBaseType::getSubentitiesIndices( MeshDimensionTag< Subdimensions >() ); + // FIXME: method does not exist + return SubentityBaseType::getSubentityIndices( MeshDimensionsTag< Subdimensions >() ); } template< typename MeshConfig, @@ -178,11 +179,12 @@ template< typename MeshConfig, template< int Subdimensions > const typename MeshEntity< MeshConfig, EntityTopology >::template SubentityTraits< Subdimensions >::AccessArrayType& MeshEntity< MeshConfig, EntityTopology >:: -getSubentitiesIndices() const +getSubentityIndices() const { static_assert( SubentityTraits< Subdimensions >::storageEnabled, "You try to set subentities which are not configured for storage." ); typedef MeshSubentityStorageLayers< MeshConfig, EntityTopology > SubentityBaseType; - return SubentityBaseType::getSubentitiesIndices( MeshDimensionTag< Subdimensions >() ); + // FIXME: method does not exist + return SubentityBaseType::getSubentityIndices( MeshDimensionsTag< Subdimensions >() ); } template< typename MeshConfig, @@ -204,7 +206,7 @@ typename MeshEntity< MeshConfig, EntityTopology >::GlobalIndexType MeshEntity< MeshConfig, EntityTopology >:: getSuperentityIndex( const LocalIndexType localIndex ) const { - return this->template getSuperentitiesIndices< SuperDimensions >().getSuperentityIndex( localIndex ); + return this->template getSuperentityIndices< SuperDimensions >().getSuperentityIndex( localIndex ); } template< typename MeshConfig, @@ -212,11 +214,11 @@ template< typename MeshConfig, template< int SuperDimension > typename MeshEntity< MeshConfig, EntityTopology >::template SuperentityTraits< SuperDimension >::AccessArrayType& MeshEntity< MeshConfig, EntityTopology >:: -getSuperentitiesIndices() +getSuperentityIndices() { static_assert( SuperentityTraits< SuperDimension >::storageEnabled, "You try to get superentities which are not configured for storage." ); typedef MeshSuperentityAccess< MeshConfig, EntityTopology > SuperentityBaseType; - return SuperentityBaseType::getSuperentitiesIndices( MeshDimensionsTag< SuperDimensions >() ); + return SuperentityBaseType::getSuperentityIndices( MeshDimensionsTag< SuperDimensions >() ); } template< typename MeshConfig, @@ -224,11 +226,11 @@ template< typename MeshConfig, template< int SuperDimension > const typename MeshEntity< MeshConfig, EntityTopology >::template SuperentityTraits< SuperDimension >::AccessArrayType& MeshEntity< MeshConfig, EntityTopology >:: -getSuperentitiesIndices() const +getSuperentityIndices() const { static_assert( SuperentityTraits< SuperDimension >::storageEnabled, "You try to get superentities which are not configured for storage." ); typedef MeshSuperentityAccess< MeshConfig, EntityTopology > SuperentityBaseType; - return SuperentityBaseType::getSubentitiesIndices( MeshDimensionTag< SuperDimension >() ); + return SuperentityBaseType::getSuperentityIndices( MeshDimensionsTag< SuperDimensions >() ); } template< typename MeshConfig, @@ -255,7 +257,7 @@ typename MeshEntity< MeshConfig, EntityTopology >::template SubentityTraits< 0 > MeshEntity< MeshConfig, EntityTopology >:: getVerticesIndices() { - return this->getSubentitiesIndices< 0 >(); + return this->getSubentityIndices< 0 >(); } template< typename MeshConfig, @@ -264,7 +266,7 @@ const typename MeshEntity< MeshConfig, EntityTopology >::template SubentityTrait MeshEntity< MeshConfig, EntityTopology >:: getVerticesIndices() const { - return this->getSubentitiesIndices< 0 >(); + return this->getSubentityIndices< 0 >(); } template< typename MeshConfig, @@ -424,20 +426,20 @@ template< typename MeshConfig > template< int Superdimensions > typename MeshEntity< MeshConfig, MeshVertexTopology >::template SuperentityTraits< Superdimensions >::AccessArrayType& MeshEntity< MeshConfig, MeshVertexTopology >:: -getSuperentitiesIndices() +getSuperentityIndices() { typedef MeshSuperentityAccess< MeshConfig, MeshVertexTopology > SuperentityBaseType; - return SuperentityBaseType::getSuperentitiesIndices( MeshDimensionTag< Superdimensions >() ); + return SuperentityBaseType::getSuperentityIndices( MeshDimensionsTag< Superdimensions >() ); } template< typename MeshConfig > template< int Superdimensions > const typename MeshEntity< MeshConfig, MeshVertexTopology >::template SuperentityTraits< Superdimensions >::AccessArrayType& MeshEntity< MeshConfig, MeshVertexTopology >:: -getSuperentitiesIndeces() const +getSuperentityIndices() const { typedef MeshSuperentityAccess< MeshConfig, MeshVertexTopology > SuperentityBaseType; - return SuperentityBaseType::getSubentitiesIndices( MeshDimensionTag< Superdimensions >() ); + return SuperentityBaseType::getSuperentityIndices( MeshDimensionsTag< Superdimensions >() ); } template< typename MeshConfig > diff --git a/src/TNL/Meshes/MeshDetails/initializer/MeshEntityInitializer.h b/src/TNL/Meshes/MeshDetails/initializer/MeshEntityInitializer.h index 162ff64306..85d19ba6fe 100644 --- a/src/TNL/Meshes/MeshDetails/initializer/MeshEntityInitializer.h +++ b/src/TNL/Meshes/MeshDetails/initializer/MeshEntityInitializer.h @@ -93,7 +93,7 @@ class MeshEntityInitializer template< typename SuperentityDimensionTag > typename MeshSuperentityTraits< MeshConfig, EntityTopology, SuperentityDimensionTag::value >::SharedContainerType& getSuperentityContainer( SuperentityDimensionTag ) { - return this->entity->template getSuperentitiesIndices< SuperentityDimensionTag::value >(); + return this->entity->template getSuperentityIndices< SuperentityDimensionTag::value >(); } static void setEntityVertex( EntityType& entity, diff --git a/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityStorageLayer.h b/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityStorageLayer.h index 8a57f9a38d..902a3e4f07 100644 --- a/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityStorageLayer.h +++ b/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityStorageLayer.h @@ -67,7 +67,7 @@ protected: using BaseType::getNumberOfSuperentities; using BaseType::getSuperentityIndex; using BaseType::setSuperentityIndex; - using BaseType::getSuperentitiesIndices; + using BaseType::getSuperentityIndices; MeshSuperentityStorageLayer() { @@ -119,12 +119,12 @@ protected: return this->superentitiesIndices[ localIndex ]; } - AccessArrayType& getSuperentitiesIndices( DimensionsTag ) + AccessArrayType& getSuperentityIndices( DimensionsTag ) { return this->sharedSuperentitiesIndices; } - const AccessArrayType& getSuperentitiesIndices( DimensionsTag ) const + const AccessArrayType& getSuperentityIndices( DimensionsTag ) const { return this->sharedSuperentitiesIndices; } @@ -234,9 +234,9 @@ protected: return true; } - ContainerType& getSuperentitiesIndices() {} + ContainerType& getSuperentityIndices() {} - const ContainerType& getSuperentitiesIndices() const {} + const ContainerType& getSuperentityIndices() const {} bool save( File& file ) const { @@ -305,9 +305,9 @@ protected: return true; } - StorageArrayType& getSuperentitiesIndices(){} + StorageArrayType& getSuperentityIndices(){} - const StorageArrayType& getSuperentitiesIndices() const {} + const StorageArrayType& getSuperentityIndices() const {} bool save( File& file ) const { diff --git a/src/TNL/Meshes/MeshDetails/traits/MeshSuperentityTraits.h b/src/TNL/Meshes/MeshDetails/traits/MeshSuperentityTraits.h index f56b96df56..ad5ede2e3e 100644 --- a/src/TNL/Meshes/MeshDetails/traits/MeshSuperentityTraits.h +++ b/src/TNL/Meshes/MeshDetails/traits/MeshSuperentityTraits.h @@ -57,7 +57,7 @@ class MeshSuperentityTraits typedef MeshSuperentityAccessor< typename StorageNetworkType::ValuesAccessorType > SuperentityAccessorType; /**** - * Type for passing the superentities indecis by the getSuperentitiesIndices() + * Type for passing the superentities indecis by the getSuperentityIndices() * method. We introduce it because of the compatibility with the subentities * which are usually stored in static array. */ diff --git a/src/TNL/Meshes/MeshEntity.h b/src/TNL/Meshes/MeshEntity.h index 312b3452b5..abf5279185 100644 --- a/src/TNL/Meshes/MeshEntity.h +++ b/src/TNL/Meshes/MeshEntity.h @@ -89,10 +89,10 @@ class MeshEntity GlobalIndexType getSubentityIndex( const LocalIndexType localIndex) const; template< int Subdimensions > - typename SubentityTraits< Subdimensions >::AccessArrayType& getSubentitiesIndices(); + typename SubentityTraits< Subdimensions >::AccessArrayType& getSubentityIndices(); template< int Subdimensions > - const typename SubentityTraits< Subdimensions >::AccessArrayType& getSubentitiesIndices() const; + const typename SubentityTraits< Subdimensions >::AccessArrayType& getSubentityIndices() const; /**** * Superentities @@ -104,10 +104,10 @@ class MeshEntity GlobalIndexType getSuperentityIndex( const LocalIndexType localIndex ) const; template< int SuperDimensions > - typename SuperentityTraits< SuperDimensions >::AccessArrayType& getSuperentitiesIndices(); + typename SuperentityTraits< SuperDimensions >::AccessArrayType& getSuperentityIndices(); template< int SuperDimensions > - const typename SuperentityTraits< SuperDimensions >::AccessArrayType& getSuperentitiesIndices() const; + const typename SuperentityTraits< SuperDimensions >::AccessArrayType& getSuperentityIndices() const; /**** * Vertices @@ -189,10 +189,10 @@ class MeshEntity< MeshConfig, MeshVertexTopology > template< int Superdimensions > LocalIndexType getNumberOfSuperentities() const; template< int Superdimensions > - typename SuperentityTraits< Superdimensions >::AccessArrayType& getSuperentitiesIndices(); + typename SuperentityTraits< Superdimensions >::AccessArrayType& getSuperentityIndices(); template< int Superdimensions > - const typename SuperentityTraits< Superdimensions >::AccessArrayType& getSuperentitiesIndeces() const; + const typename SuperentityTraits< Superdimensions >::AccessArrayType& getSuperentityIndices() const; template< int Dimension > GlobalIndexType getSuperentityIndex( const LocalIndexType localIndex ) const; diff --git a/src/UnitTests/Meshes/MeshEntityTest.h b/src/UnitTests/Meshes/MeshEntityTest.h index 594b6dfa25..5f2ed305cd 100644 --- a/src/UnitTests/Meshes/MeshEntityTest.h +++ b/src/UnitTests/Meshes/MeshEntityTest.h @@ -428,18 +428,18 @@ TEST( MeshEntityTest, TwoTrianglesMeshEntityTest ) ASSERT_TRUE( triangleEntities[ 1 ].template getSubentityIndex< 1 >( 1 ) == 3 ); ASSERT_TRUE( triangleEntities[ 1 ].template getSubentityIndex< 1 >( 2 ) == 4 ); - /*vertexEntities[ 0 ].template setNumberOfSuperentities< 1 >( 2 ); - vertexEntities[ 0 ].template setSuperentityIndex< 1 >( 0, 2 ); - vertexEntities[ 0 ].template setSuperentityIndex< 1 >( 1, 1 ); +// vertexEntities[ 0 ].template setNumberOfSuperentities< 1 >( 2 ); +// vertexEntities[ 0 ].template setSuperentityIndex< 1 >( 0, 2 ); +// vertexEntities[ 0 ].template setSuperentityIndex< 1 >( 1, 1 ); - vertexEntities[ 1 ].template setNumberOfSuperentities< 1 >( 3 ); - vertexEntities[ 1 ].template setSuperentityIndex< 1 >( 0, 0 ); - vertexEntities[ 1 ].template setSuperentityIndex< 1 >( 1, 2 ); - vertexEntities[ 1 ].template setSuperentityIndex< 1 >( 2, 4 ); +// vertexEntities[ 1 ].template setNumberOfSuperentities< 1 >( 3 ); +// vertexEntities[ 1 ].template setSuperentityIndex< 1 >( 0, 0 ); +// vertexEntities[ 1 ].template setSuperentityIndex< 1 >( 1, 2 ); +// vertexEntities[ 1 ].template setSuperentityIndex< 1 >( 2, 4 ); - vertexEntities[ 1 ].template setNumberOfSuperentities< 2 >( 2 ); - vertexEntities[ 1 ].template setSuperentityIndex< 2 >( 0, 0 ); - vertexEntities[ 1 ].template setSuperentityIndex< 2 >( 1, 1 );*/ +// vertexEntities[ 1 ].template setNumberOfSuperentities< 2 >( 2 ); +// vertexEntities[ 1 ].template setSuperentityIndex< 2 >( 0, 0 ); +// vertexEntities[ 1 ].template setSuperentityIndex< 2 >( 1, 1 ); // ASSERT_TRUE( vertexEntities[ 0 ].template getNumberOfSuperentities< 1 >() == 2 ); // ASSERT_TRUE( vertexEntities[ 0 ].template getSuperentityIndex< 1 >( 0 ) == 2 ); @@ -454,12 +454,12 @@ TEST( MeshEntityTest, TwoTrianglesMeshEntityTest ) // ASSERT_TRUE( vertexEntities[ 1 ].template getSuperentityIndex< 2 >( 0 ) == 0 ); // ASSERT_TRUE( vertexEntities[ 1 ].template getSuperentityIndex< 2 >( 1 ) == 1 ); - /*edgeEntities[ 0 ].template setNumberOfSuperentities< 2 >( 2 ); - edgeEntities[ 0 ].template setSuperentityIndex< 2 >( 0, 0 ); - edgeEntities[ 0 ].template setSuperentityIndex< 2 >( 1, 1 );*/ +// edgeEntities[ 0 ].template setNumberOfSuperentities< 2 >( 2 ); +// edgeEntities[ 0 ].template setSuperentityIndex< 2 >( 0, 0 ); +// edgeEntities[ 0 ].template setSuperentityIndex< 2 >( 1, 1 ); - /*ASSERT_TRUE( edgeEntities[ 0 ].template getNumberOfSuperentities< 2 >() == 2 ); - ASSERT_TRUE( edgeEntities[ 0 ].template getSuperentityIndex< 2 >( 0 ) == 0 );*/ +// ASSERT_TRUE( edgeEntities[ 0 ].template getNumberOfSuperentities< 2 >() == 2 ); +// ASSERT_TRUE( edgeEntities[ 0 ].template getSuperentityIndex< 2 >( 0 ) == 0 ); } #endif -- GitLab