From 9d1f1b3b79a7f5a38b5c051f12c8a1afe7d8fc32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= <klinkjak@fjfi.cvut.cz> Date: Sat, 22 Oct 2016 09:47:11 +0200 Subject: [PATCH] Removed unused methods from the superentity storage layer --- src/TNL/Meshes/MeshDetails/MeshEntity_impl.h | 64 ------------------- .../initializer/MeshEntityInitializer.h | 6 -- .../MeshDetails/initializer/MeshInitializer.h | 18 +----- .../MeshSuperentityStorageInitializer.h | 28 +------- .../layers/MeshSuperentityAccess.h | 16 ----- .../layers/MeshSuperentityStorageLayer.h | 54 ---------------- src/TNL/Meshes/MeshEntity.h | 25 -------- 7 files changed, 5 insertions(+), 206 deletions(-) diff --git a/src/TNL/Meshes/MeshDetails/MeshEntity_impl.h b/src/TNL/Meshes/MeshDetails/MeshEntity_impl.h index 50b366c150..2d4b9a24a2 100644 --- a/src/TNL/Meshes/MeshDetails/MeshEntity_impl.h +++ b/src/TNL/Meshes/MeshDetails/MeshEntity_impl.h @@ -187,30 +187,6 @@ getSubentityIndices() const return SubentityBaseType::getSubentityIndices( MeshDimensionsTag< Subdimensions >() ); } -template< typename MeshConfig, - typename EntityTopology > - template< int SuperDimensions > -typename MeshEntity< MeshConfig, EntityTopology >::template SuperentityTraits< SuperDimensions >::AccessArrayType& -MeshEntity< MeshConfig, EntityTopology >:: -getSuperentityIndices() -{ - static_assert( SuperentityTraits< SuperDimension >::storageEnabled, "You try to get superentities which are not configured for storage." ); - typedef MeshSuperentityAccess< MeshConfig, EntityTopology > SuperentityBaseType; - return SuperentityBaseType::getSuperentityIndices( MeshDimensionsTag< SuperDimensions >() ); -} - -template< typename MeshConfig, - typename EntityTopology > - template< int SuperDimension > -const typename MeshEntity< MeshConfig, EntityTopology >::template SuperentityTraits< SuperDimension >::AccessArrayType& -MeshEntity< MeshConfig, EntityTopology >:: -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::getSuperentityIndices( MeshDimensionsTag< SuperDimensions >() ); -} - template< typename MeshConfig, typename EntityTopology > constexpr typename MeshEntity< MeshConfig, EntityTopology >::LocalIndexType @@ -295,17 +271,6 @@ subentityIdsArray() return SubentityStorageLayers::subentityIdsArray( MeshDimensionsTag< Subdimensions >() ); } -template< typename MeshConfig, - typename EntityTopology > - template< int Superdimensions > -typename MeshEntity< MeshConfig, EntityTopology >::IdArrayAccessorType& -MeshEntity< MeshConfig, EntityTopology >:: -superentityIdsArray() -{ - typedef MeshSuperentityAccess< MeshConfig, EntityTopology > SuperentityAccessBase; - return SuperentityAccessBase::superentityIdsArray( MeshDimensionsTag< Superdimensions >()); -} - template< typename MeshConfig, typename EntityTopology > template< int Subdimensions > @@ -394,26 +359,6 @@ getEntityDimension() const return EntityTopology::dimensions; } -template< typename MeshConfig > - template< int Superdimensions > -typename MeshEntity< MeshConfig, MeshVertexTopology >::template SuperentityTraits< Superdimensions >::AccessArrayType& -MeshEntity< MeshConfig, MeshVertexTopology >:: -getSuperentityIndices() -{ - typedef MeshSuperentityAccess< MeshConfig, MeshVertexTopology > SuperentityBaseType; - return SuperentityBaseType::getSuperentityIndices( MeshDimensionsTag< Superdimensions >() ); -} - -template< typename MeshConfig > - template< int Superdimensions > -const typename MeshEntity< MeshConfig, MeshVertexTopology >::template SuperentityTraits< Superdimensions >::AccessArrayType& -MeshEntity< MeshConfig, MeshVertexTopology >:: -getSuperentityIndices() const -{ - typedef MeshSuperentityAccess< MeshConfig, MeshVertexTopology > SuperentityBaseType; - return SuperentityBaseType::getSuperentityIndices( MeshDimensionsTag< Superdimensions >() ); -} - template< typename MeshConfig > typename MeshEntity< MeshConfig, MeshVertexTopology >::PointType MeshEntity< MeshConfig, MeshVertexTopology >:: @@ -430,15 +375,6 @@ setPoint( const PointType& point ) this->point = point; } -template< typename MeshConfig > - template< int Superdimensions > -typename MeshEntity< MeshConfig, MeshVertexTopology >::MeshTraitsType::IdArrayAccessorType& -MeshEntity< MeshConfig, MeshVertexTopology >:: -superentityIdsArray() -{ - return SuperentityAccessBase::superentityIdsArray( MeshDimensionTag< Superdimensions >()); -} - template< typename MeshConfig, typename EntityTopology > std::ostream& operator <<( std::ostream& str, const MeshEntity< MeshConfig, EntityTopology >& entity ) diff --git a/src/TNL/Meshes/MeshDetails/initializer/MeshEntityInitializer.h b/src/TNL/Meshes/MeshDetails/initializer/MeshEntityInitializer.h index e7c31ac5c3..460f899343 100644 --- a/src/TNL/Meshes/MeshDetails/initializer/MeshEntityInitializer.h +++ b/src/TNL/Meshes/MeshDetails/initializer/MeshEntityInitializer.h @@ -81,12 +81,6 @@ public: BaseType::initSubentities( entity, entityIndex, entitySeed, initializer ); } - template< typename SuperentityDimensionTag > - typename MeshSuperentityTraits< MeshConfig, EntityTopology, SuperentityDimensionTag::value >::SharedContainerType& getSuperentityContainer( SuperentityDimensionTag ) - { - return this->entity->template getSuperentityIndices< SuperentityDimensionTag::value >(); - } - static void setEntityVertex( EntityType& entity, LocalIndexType localIndex, GlobalIndexType globalIndex ) diff --git a/src/TNL/Meshes/MeshDetails/initializer/MeshInitializer.h b/src/TNL/Meshes/MeshDetails/initializer/MeshInitializer.h index 654c833672..5c72fb7d96 100644 --- a/src/TNL/Meshes/MeshDetails/initializer/MeshInitializer.h +++ b/src/TNL/Meshes/MeshDetails/initializer/MeshInitializer.h @@ -102,15 +102,8 @@ class MeshInitializer return entity.template subentityIdsArray< SubDimensionTag::value >(); } - template< typename SuperDimensionTag, typename MeshEntity> - static typename MeshTraitsType::IdArrayAccessorType& - superentityIdsArray( MeshEntity& entity ) - { - return entity.template superentityIdsArray< SuperDimensionTag::value >(); - } - - template<typename SubDimensionTag, typename MeshEntity > - static typename MeshTraitsType::template SubentityTraits< typename MeshEntity::EntityTopology, SubDimensionTag::value >::OrientationArrayType& + template<typename SubDimensionsTag, typename MeshEntity > + static typename MeshTraitsType::template SubentityTraits< typename MeshEntity::EntityTopology, SubDimensionsTag::value >::OrientationArrayType& subentityOrientationsArray( MeshEntity &entity ) { return entity.template subentityOrientationsArray< SubDimensionTag::value >(); @@ -123,13 +116,6 @@ class MeshInitializer return mesh->template entitiesArray< DimensionTag >(); } - template< typename DimensionTag, typename SuperDimensionTag > - typename MeshTraitsType::GlobalIdArrayType& - meshSuperentityIdsArray() - { - return mesh->template superentityIdsArray< DimensionTag, SuperDimensionTag >(); - } - template< typename EntityTopology, typename SuperdimensionsTag > typename MeshTraitsType::template SuperentityTraits< EntityTopology, SuperdimensionsTag::value >::StorageNetworkType& meshSuperentityStorageNetwork() diff --git a/src/TNL/Meshes/MeshDetails/initializer/MeshSuperentityStorageInitializer.h b/src/TNL/Meshes/MeshDetails/initializer/MeshSuperentityStorageInitializer.h index 6fc7cdfc30..ad277f7336 100644 --- a/src/TNL/Meshes/MeshDetails/initializer/MeshSuperentityStorageInitializer.h +++ b/src/TNL/Meshes/MeshDetails/initializer/MeshSuperentityStorageInitializer.h @@ -95,28 +95,6 @@ class MeshSuperentityStorageInitializerLayer< MeshConfig, Assert( (size_t) maxEntityIndex == dynamicStorageNetwork.size() - 1, std::cerr << "Superentities for some entities are missing." << std::endl; ); - // TODO: what's this supposed to do? -// std::cout << "There are " << superentityIdsArray.getSize() << " superentities with " << DimensionsTag::value << " dimensions of enities with dimension " << EntityDimensions::value << " ... " << std::endl; -// GlobalIdArrayType &superentityIdsArray = meshInitializer.template meshSuperentityIdsArray< EntityDimensions, DimensionsTag >(); -// superentityIdsArray.setSize( dynamicStorageNetwork.size() ); -// GlobalIndexType currentBegin = 0; -// GlobalIndexType lastEntityIndex = 0; -// for( GlobalIndexType i = 0; i < superentityIdsArray.getSize(); i++) -// { -// superentityIdsArray[ i ] = indexPairs[i].superentityIndex; -// -// //cout << "Adding superentity " << indexPairs[i].superentityIndex << " to entity " << lastEntityIndex << std::endl; -// if( indexPairs[ i ].entityIndex != lastEntityIndex ) -// { -// meshInitializer.template superentityIdsArray< DimensionsTag >( meshInitializer.template meshEntitiesArray< EntityDimensions >()[ lastEntityIndex ] ).bind( superentityIdsArray, currentBegin, i - currentBegin ); -// currentBegin = i; -// lastEntityIndex = indexPairs[ i ].entityIndex; -// } -// } -// -// meshInitializer.template superentityIdsArray< DimensionsTag >( meshInitializer.template meshEntitiesArray< EntityDimensions >()[ lastEntityIndex ] ).bind( superentityIdsArray, currentBegin, superentityIdsArray.getSize() - currentBegin ); -// indexPairs.clear(); - /**** * Network initializer */ @@ -167,9 +145,9 @@ class MeshSuperentityStorageInitializerLayer< MeshConfig, using MeshInitializerType = MeshInitializer< MeshConfig >; public: - void addSuperentity() {} // This method is due to 'using BaseType::...;' in the derived classes. - using BaseType::initSuperentities; - void initSuperentities( MeshInitializerType& ) { std::cerr << "***" << std::endl;} + // Necessary due to 'using BaseType::...;' in the derived classes. + void addSuperentity() {} + void initSuperentities( MeshInitializerType& ) {} }; template< typename MeshConfig, diff --git a/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityAccess.h b/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityAccess.h index 08ecb94b62..b34b00b650 100644 --- a/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityAccess.h +++ b/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityAccess.h @@ -114,7 +114,6 @@ class MeshSuperentityAccessLayer< MeshConfig, using SuperentityTraitsType = typename MeshTraitsType::template SuperentityTraits< EntityTopology, DimensionsTag::value >; public: - using IdArrayAccessorType = typename MeshTraitsType::IdArrayAccessorType; using GlobalIndexType = typename SuperentityTraitsType::GlobalIndexType; using LocalIndexType = typename SuperentityTraitsType::LocalIndexType; using StorageNetworkType = typename SuperentityTraitsType::StorageNetworkType; @@ -162,12 +161,6 @@ public: return this->superentityIndices[ localIndex ]; } - using BaseType::superentityIds; - IdArrayAccessorType superentityIds( DimensionsTag ) const { return m_superentityIndices; } - - using BaseType::superentityIdsArray; - IdArrayAccessorType &superentityIdsArray( DimensionsTag ) { return m_superentityIndices; } - using BaseType::getSuperentityIndices; const SuperentityAccessorType& getSuperentityIndices( DimensionsTag ) const { @@ -188,9 +181,6 @@ public: //bool operator == ( const MeshSuperentityAccessLayer< MeshConfig, EntityTopology, Dimensions, tnlStorageTraits< true > >& l ) { return true; } // TODO: fix private: - // TODO: used only in mesh initializer, should be removed - IdArrayAccessorType m_superentityIndices; - SuperentityAccessorType superentityIndices; }; @@ -236,9 +226,6 @@ protected: const LocalIndexType& localIndex, const GlobalIndexType& globalIndex ) {} - void superentityIds() {} - void superentityIdsArray() {} - void getSuperentityIndices() {} void print( std::ostream& str ) const {} @@ -275,9 +262,6 @@ protected: const LocalIndexType& localIndex, const GlobalIndexType& globalIndex ) {} - void superentityIds() {} - void superentityIdsArray() {} - void getSuperentityIndices() {} void print( std::ostream& str ) const {} diff --git a/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityStorageLayer.h b/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityStorageLayer.h index 07eb9a1b12..df392b5eeb 100644 --- a/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityStorageLayer.h +++ b/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityStorageLayer.h @@ -54,7 +54,6 @@ class MeshSuperentityStorageLayer< MeshConfig, EntityTopology, DimensionTag, tru protected: typedef typename SuperentityTraitsType::StorageArrayType StorageArrayType; - typedef typename SuperentityTraitsType::AccessArrayType AccessArrayType; typedef typename SuperentityTraitsType::GlobalIndexType GlobalIndexType; typedef typename SuperentityTraitsType::LocalIndexType LocalIndexType; @@ -77,58 +76,15 @@ protected: { std::cerr << " Destroying " << this->superentitiesIndices.getSize() << " superentities with "<< DimensionsTag::value << " dimensions." << std::endl; std::cerr << " this->superentitiesIndices.getName() = " << this->superentitiesIndices.getName() << std::endl; - std::cerr << " this->sharedSuperentitiesIndices.getName() = " << this->sharedSuperentitiesIndices.getName() << std::endl; }*/ MeshSuperentityStorageLayer& operator = ( const MeshSuperentityStorageLayer& layer ) { this->superentitiesIndices.setSize( layer.superentitiesIndices.getSize() ); this->superentitiesIndices = layer.superentitiesIndices; - this->sharedSuperentitiesIndices.bind( this->superentitiesIndices ); return *this; } - /**** - * Define setter/getter for the current level of the superentities - */ - bool setNumberOfSuperentities( DimensionsTag, - const LocalIndexType size ) - { - if( ! this->superentitiesIndices.setSize( size ) ) - return false; - this->superentitiesIndices.setValue( -1 ); - this->sharedSuperentitiesIndices.bind( this->superentitiesIndices ); - return true; - } - - LocalIndexType getNumberOfSuperentities( DimensionsTag ) const - { - return this->superentitiesIndices.getSize(); - } - - void setSuperentityIndex( DimensionsTag, - const LocalIndexType localIndex, - const GlobalIndexType globalIndex ) - { - this->superentitiesIndices[ localIndex ] = globalIndex; - } - - GlobalIndexType getSuperentityIndex( DimensionsTag, - const LocalIndexType localIndex ) const - { - return this->superentitiesIndices[ localIndex ]; - } - - AccessArrayType& getSuperentityIndices( DimensionsTag ) - { - return this->sharedSuperentitiesIndices; - } - - const AccessArrayType& getSuperentityIndices( DimensionsTag ) const - { - return this->sharedSuperentitiesIndices; - } - bool save( File& file ) const { if( ! BaseType::save( file ) || @@ -166,20 +122,10 @@ protected: private: StorageArrayType superentitiesIndices; - // TODO: removed even from MeshSubentityStorageLayer - AccessArrayType sharedSuperentitiesIndices; - - // TODO: unused??? StorageNetworkType storageNetwork; // TODO: this is only for the mesh initializer - fix it public: - using BaseType::superentityIdsArray; - typename MeshTraits< MeshConfig >::GlobalIdArrayType& superentityIdsArray( DimensionTag ) - { - return this->superentitiesIndices; - } - using BaseType::getStorageNetwork; StorageNetworkType& getStorageNetwork( DimensionTag ) { diff --git a/src/TNL/Meshes/MeshEntity.h b/src/TNL/Meshes/MeshEntity.h index bd6f30ba4e..0cb09303d4 100644 --- a/src/TNL/Meshes/MeshEntity.h +++ b/src/TNL/Meshes/MeshEntity.h @@ -100,13 +100,6 @@ class MeshEntity using MeshSuperentityAccess< MeshConfig, EntityTopology_ >::getNumberOfSuperentities; using MeshSuperentityAccess< MeshConfig, EntityTopology_ >::getSuperentityIndex; - // TODO: used only in MeshInitializer, should be removed - template< int SuperDimensions > - typename SuperentityTraits< SuperDimensions >::AccessArrayType& getSuperentityIndices(); - - template< int SuperDimensions > - const typename SuperentityTraits< SuperDimensions >::AccessArrayType& getSuperentityIndices() const; - /**** * Vertices */ @@ -125,8 +118,6 @@ class MeshEntity /**** * Methods for the mesh initialization */ - typedef typename MeshTraitsType::IdArrayAccessorType IdArrayAccessorType; - using MeshSuperentityAccess< MeshConfig, EntityTopology_ >::bindSuperentitiesStorageNetwork; using MeshSuperentityAccess< MeshConfig, EntityTopology_ >::setNumberOfSuperentities; using MeshSuperentityAccess< MeshConfig, EntityTopology_ >::setSuperentityIndex; @@ -138,9 +129,6 @@ class MeshEntity template< int Subdimensions > typename SubentityTraits< Subdimensions >::IdArrayType& subentityIdsArray(); - template< int Superdimensions > - IdArrayAccessorType& superentityIdsArray(); - template< int Subdimensions > typename SubentityTraits< Subdimensions >::OrientationArrayType& subentityOrientationsArray(); @@ -191,13 +179,6 @@ class MeshEntity< MeshConfig, MeshVertexTopology > using MeshSuperentityAccess< MeshConfig, MeshVertexTopology >::getNumberOfSuperentities; using MeshSuperentityAccess< MeshConfig, MeshVertexTopology >::getSuperentityIndex; - // TODO: used only in MeshInitializer, should be removed - template< int Superdimensions > - typename SuperentityTraits< Superdimensions >::AccessArrayType& getSuperentityIndices(); - - template< int Superdimensions > - const typename SuperentityTraits< Superdimensions >::AccessArrayType& getSuperentityIndices() const; - /**** * Points */ @@ -210,12 +191,6 @@ class MeshEntity< MeshConfig, MeshVertexTopology > using MeshSuperentityAccess< MeshConfig, MeshVertexTopology >::setNumberOfSuperentities; using MeshSuperentityAccess< MeshConfig, MeshVertexTopology >::setSuperentityIndex; - typedef typename MeshTraitsType::IdArrayAccessorType IdArrayAccessorType; - typedef MeshSuperentityAccess< MeshConfig, MeshVertexTopology > SuperentityAccessBase; - - template< int Superdimensions > - IdArrayAccessorType& superentityIdsArray(); - PointType point; friend MeshInitializer< MeshConfig >; -- GitLab