diff --git a/src/TNL/Meshes/MeshDetails/layers/MeshSubentityAccess.h b/src/TNL/Meshes/MeshDetails/layers/MeshSubentityAccess.h index 2c169a1ca69a1928f8f0159c8f04db36d4e0e4a1..ef363857612619dd259991f3b6c26b4b2d0714ab 100644 --- a/src/TNL/Meshes/MeshDetails/layers/MeshSubentityAccess.h +++ b/src/TNL/Meshes/MeshDetails/layers/MeshSubentityAccess.h @@ -386,124 +386,7 @@ private: }; -template< typename MeshConfig, - typename Device, - typename EntityTopology > -class MeshSubentityAccessLayer< MeshConfig, - Device, - EntityTopology, - Meshes::DimensionTag< EntityTopology::dimension >, - true, - true > -{ - using DimensionTag = Meshes::DimensionTag< EntityTopology::dimension >; - -protected: - /*** - * Necessary because of 'using BaseType::...;' in the derived classes - */ - template< typename SubentityAccessorType > - __cuda_callable__ - void bindSubentitiesStorageNetwork( DimensionTag, - const SubentityAccessorType& storage ) {} - __cuda_callable__ - void getSubentitiesCount( DimensionTag ) const {} - template< typename LocalIndexType > - __cuda_callable__ - void getSubentityIndex( DimensionTag, - const LocalIndexType localIndex ) const {} - template< typename LocalIndexType, typename GlobalIndexType > - __cuda_callable__ - void setSubentityIndex( DimensionTag, - const LocalIndexType& localIndex, - const GlobalIndexType& globalIndex ) {} - __cuda_callable__ - void getSubentityIndices() {} - - template< typename LocalIndexType > - __cuda_callable__ - void getSubentityOrientation( DimensionTag, LocalIndexType index) const {} - __cuda_callable__ - void subentityOrientationsArray( DimensionTag ) {} - - bool save( File& file ) const - { - return true; - } - - bool load( File& file ) - { - return true; - } - - __cuda_callable__ - bool operator==( const MeshSubentityAccessLayer& other ) const - { - return true; - } - - void print( std::ostream& str ) const {} -}; - -template< typename MeshConfig, - typename Device, - typename EntityTopology > -class MeshSubentityAccessLayer< MeshConfig, - Device, - EntityTopology, - Meshes::DimensionTag< EntityTopology::dimension >, - true, - false > -{ - using DimensionTag = Meshes::DimensionTag< EntityTopology::dimension >; - -protected: - /*** - * Necessary because of 'using BaseType::...;' in the derived classes - */ - template< typename SubentityAccessorType > - __cuda_callable__ - void bindSubentitiesStorageNetwork( DimensionTag, - const SubentityAccessorType& storage ) {} - __cuda_callable__ - void getSubentitiesCount( DimensionTag ) const {} - template< typename LocalIndexType > - __cuda_callable__ - void getSubentityIndex( DimensionTag, - const LocalIndexType localIndex ) const {} - template< typename LocalIndexType, typename GlobalIndexType > - __cuda_callable__ - void setSubentityIndex( DimensionTag, - const LocalIndexType& localIndex, - const GlobalIndexType& globalIndex ) {} - __cuda_callable__ - void getSubentityIndices() {} - - template< typename LocalIndexType > - __cuda_callable__ - void getSubentityOrientation( DimensionTag, LocalIndexType index) const {} - __cuda_callable__ - void subentityOrientationsArray( DimensionTag ) {} - - bool save( File& file ) const - { - return true; - } - - bool load( File& file ) - { - return true; - } - - __cuda_callable__ - bool operator==( const MeshSubentityAccessLayer& other ) const - { - return true; - } - - void print( std::ostream& str ) const {} -}; - +// termination of recursive inheritance (everything is reduced to EntityStorage == false thanks to the WeakSubentityStorageTrait) template< typename MeshConfig, typename Device, typename EntityTopology > diff --git a/src/TNL/Meshes/MeshDetails/layers/MeshSubentityStorageLayer.h b/src/TNL/Meshes/MeshDetails/layers/MeshSubentityStorageLayer.h index 8a521bb02b29bd695c5cf6d280f66daea726e303..28557bd2d858e51b5d6973b74e80b16f5dfd74f3 100644 --- a/src/TNL/Meshes/MeshDetails/layers/MeshSubentityStorageLayer.h +++ b/src/TNL/Meshes/MeshDetails/layers/MeshSubentityStorageLayer.h @@ -195,52 +195,7 @@ public: { return *this; } }; - -template< typename MeshConfig, - typename Device, - typename EntityTopology > -class MeshSubentityStorageLayer< MeshConfig, - Device, - EntityTopology, - DimensionTag< EntityTopology::dimension >, - true > -{ - using SubdimensionTag = DimensionTag< EntityTopology::dimension >; - -protected: - MeshSubentityStorageLayer() = default; - explicit MeshSubentityStorageLayer( const MeshSubentityStorageLayer& other ) {} - template< typename Device_ > - MeshSubentityStorageLayer( const MeshSubentityStorageLayer< MeshConfig, Device_, EntityTopology, SubdimensionTag >& other ) {} - template< typename Device_ > - MeshSubentityStorageLayer& operator=( const MeshSubentityStorageLayer< MeshConfig, Device_, EntityTopology, SubdimensionTag >& other ) { return *this; } - - /**** - * These methods are due to 'using BaseType::...;' in the derived classes. - */ - template< typename GlobalIndexType > - void setEntitiesCount( const GlobalIndexType& entitiesCount ) {} - - void print( std::ostream& str ) const {} - - bool operator==( const MeshSubentityStorageLayer& layer ) const - { - return true; - } - - bool save( File& file ) const - { - return true; - } - - bool load( File& file ) - { - return true; - } - - void getSubentityStorageNetwork( SubdimensionTag ) {} -}; - +// termination of recursive inheritance (everything is reduced to EntityStorage == false thanks to the WeakSubentityStorageTrait) template< typename MeshConfig, typename Device, typename EntityTopology > @@ -253,6 +208,8 @@ class MeshSubentityStorageLayer< MeshConfig, using SubdimensionTag = DimensionTag< EntityTopology::dimension >; protected: + using GlobalIndexType = typename MeshConfig::GlobalIndexType; + MeshSubentityStorageLayer() = default; explicit MeshSubentityStorageLayer( const MeshSubentityStorageLayer& other ) {} template< typename Device_ > @@ -260,11 +217,7 @@ protected: template< typename Device_ > MeshSubentityStorageLayer& operator=( const MeshSubentityStorageLayer< MeshConfig, Device_, EntityTopology, SubdimensionTag >& other ) { return *this; } - /**** - * These methods are due to 'using BaseType::...;' in the derived classes. - */ - template< typename GlobalIndexType > - void setEntitiesCount( const GlobalIndexType& entitiesCount ) {} + void setEntitiesCount( GlobalIndexType entitiesCount ) {} void print( std::ostream& str ) const {} diff --git a/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityAccess.h b/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityAccess.h index f06c23a3497f8200730462e73e4425702bdc48ed..dd338bc63cb508781edcb1d4fc358626f682a957 100644 --- a/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityAccess.h +++ b/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityAccess.h @@ -236,6 +236,7 @@ class MeshSuperentityAccessLayer< MeshConfig, { }; +// termination of recursive inheritance (everything is reduced to EntityStorage == false thanks to the WeakSuperentityStorageTrait) template< typename MeshConfig, typename Device, typename EntityTopology > @@ -282,51 +283,5 @@ protected: void print( std::ostream& str ) const {} }; -template< typename MeshConfig, - typename Device, - typename EntityTopology > -class MeshSuperentityAccessLayer< MeshConfig, - Device, - EntityTopology, - Meshes::DimensionTag< EntityTopology::dimension >, - true > -{ - using DimensionTag = Meshes::DimensionTag< EntityTopology::dimension >; - -protected: - using GlobalIndexType = typename MeshConfig::GlobalIndexType; - using LocalIndexType = typename MeshConfig::LocalIndexType; - - /*** - * Necessary because of 'using BaseType::...;' in the derived classes - */ - template< typename SuperentityAccessorType > - __cuda_callable__ - void bindSuperentitiesStorageNetwork( DimensionTag, - const SuperentityAccessorType& storage ) {} - __cuda_callable__ - void setNumberOfSuperentities( DimensionTag, - const LocalIndexType size ) {} - __cuda_callable__ - void getSuperentitiesCount( DimensionTag ) const {} - __cuda_callable__ - void getSuperentityIndex( DimensionTag, - const LocalIndexType localIndex ) const {} - __cuda_callable__ - void setSuperentityIndex( DimensionTag, - const LocalIndexType& localIndex, - const GlobalIndexType& globalIndex ) {} - __cuda_callable__ - void getSuperentityIndices() {} - - __cuda_callable__ - bool operator==( const MeshSuperentityAccessLayer& other ) const - { - return true; - } - - void print( std::ostream& str ) const {} -}; - } // namespace Meshes } // namespace TNL diff --git a/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityStorageLayer.h b/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityStorageLayer.h index f67a233ffaefc9b0203f0d9d563cae85c3fda494..5ba307fb877a053f2f71e68c7fba14d8871dec4b 100644 --- a/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityStorageLayer.h +++ b/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityStorageLayer.h @@ -191,6 +191,7 @@ public: { return *this; } }; +// termination of recursive inheritance (everything is reduced to EntityStorage == false thanks to the WeakSuperentityStorageTrait) template< typename MeshConfig, typename Device, typename EntityTopology > @@ -208,56 +209,7 @@ protected: template< typename Device_ > MeshSuperentityStorageLayer& operator=( const MeshSuperentityStorageLayer< MeshConfig, Device_, EntityTopology, SuperdimensionTag >& other ) { return *this; } - /**** - * These methods are due to 'using BaseType::...;' in the derived classes. - */ - void setEntitiesCount( const GlobalIndexType& entitiesCount ) {} - - void print( std::ostream& str ) const {} - - bool operator==( const MeshSuperentityStorageLayer& layer ) const - { - return true; - } - - bool save( File& file ) const - { - return true; - } - - bool load( File& file ) - { - return true; - } - - void getSuperentityStorageNetwork( SuperdimensionTag ) {} -}; - -template< typename MeshConfig, - typename Device, - typename EntityTopology > -class MeshSuperentityStorageLayer< MeshConfig, - Device, - EntityTopology, - DimensionTag< EntityTopology::dimension >, - true > -{ - using SuperdimensionTag = DimensionTag< EntityTopology::dimension >; - -protected: - using GlobalIndexType = typename MeshConfig::GlobalIndexType; - - MeshSuperentityStorageLayer() = default; - explicit MeshSuperentityStorageLayer( const MeshSuperentityStorageLayer& other ) {} - template< typename Device_ > - MeshSuperentityStorageLayer( const MeshSuperentityStorageLayer< MeshConfig, Device_, EntityTopology, SuperdimensionTag >& other ) {} - template< typename Device_ > - MeshSuperentityStorageLayer& operator=( const MeshSuperentityStorageLayer< MeshConfig, Device_, EntityTopology, SuperdimensionTag >& other ) { return *this; } - - /**** - * These methods are due to 'using BaseType::...;' in the derived classes. - */ - void setEntitiesCount( const GlobalIndexType& entitiesCount ) {} + void setEntitiesCount( GlobalIndexType entitiesCount ) {} void print( std::ostream& str ) const {}