diff --git a/src/TNL/Meshes/Mesh.h b/src/TNL/Meshes/Mesh.h index c719734c70ca2f3657b6125f38f5a7e67e8782aa..bae9d6b7410db777d531ec02119d029f0348bc3f 100644 --- a/src/TNL/Meshes/Mesh.h +++ b/src/TNL/Meshes/Mesh.h @@ -21,7 +21,7 @@ #include <TNL/Logger.h> #include <TNL/Meshes/MeshEntity.h> #include <TNL/Meshes/MeshDetails/traits/MeshTraits.h> -#include <TNL/Meshes/MeshDetails/layers/MeshStorageLayer.h> +#include <TNL/Meshes/MeshDetails/MeshLayers/StorageLayer.h> #include <TNL/Meshes/MeshDetails/ConfigValidator.h> namespace TNL { @@ -29,9 +29,8 @@ namespace Meshes { template< typename MeshConfig > class Initializer; template< typename Mesh > class BoundaryTagsInitializer; -template< typename Mesh > class MeshEntityStorageRebinder; -template< typename Mesh, int Dimension > -struct IndexPermutationApplier; +template< typename Mesh > class EntityStorageRebinder; +template< typename Mesh, int Dimension > struct IndexPermutationApplier; template< typename MeshConfig, typename Device, typename MeshType > @@ -57,10 +56,10 @@ template< typename MeshConfig, class Mesh : public Object, public ConfigValidator< MeshConfig >, - protected MeshStorageLayers< MeshConfig, Device >, + protected StorageLayerFamily< MeshConfig, Device >, public MeshInitializableBase< MeshConfig, Device, Mesh< MeshConfig, Device > > { - using StorageBaseType = MeshStorageLayers< MeshConfig, Device >; + using StorageBaseType = StorageLayerFamily< MeshConfig, Device >; public: using Config = MeshConfig; @@ -183,7 +182,7 @@ class Mesh friend BoundaryTagsInitializer< Mesh >; - friend MeshEntityStorageRebinder< Mesh >; + friend EntityStorageRebinder< Mesh >; template< typename Mesh, int Dimension > friend struct IndexPermutationApplier; diff --git a/src/TNL/Meshes/MeshDetails/CMakeLists.txt b/src/TNL/Meshes/MeshDetails/CMakeLists.txt index 283124680a8e13383c22dcf0192a80c40e432067..308ae217eb162189c935fd30ec960eb508334ea4 100644 --- a/src/TNL/Meshes/MeshDetails/CMakeLists.txt +++ b/src/TNL/Meshes/MeshDetails/CMakeLists.txt @@ -1,8 +1,10 @@ ADD_SUBDIRECTORY( initializer ) -ADD_SUBDIRECTORY( layers ) +ADD_SUBDIRECTORY( EntityLayers ) +ADD_SUBDIRECTORY( MeshLayers ) ADD_SUBDIRECTORY( traits ) SET( headers ConfigValidator.h + EntityStorageRebinder.h IndexPermutationApplier.h MeshEntityIndex.h MeshEntityIntegrityChecker.h diff --git a/src/TNL/Meshes/MeshDetails/EntityLayers/CMakeLists.txt b/src/TNL/Meshes/MeshDetails/EntityLayers/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..3d9ac0091be5aad614de9ff5fa2cdd1837674041 --- /dev/null +++ b/src/TNL/Meshes/MeshDetails/EntityLayers/CMakeLists.txt @@ -0,0 +1,5 @@ +SET( headers SubentityAccess.h + SuperentityAccess.h +) + +INSTALL( FILES ${headers} DESTINATION include/tnl-${tnlVersion}/TNL/Meshes/MeshDetails/EntityLayers ) diff --git a/src/TNL/Meshes/MeshDetails/layers/MeshSubentityAccess.h b/src/TNL/Meshes/MeshDetails/EntityLayers/SubentityAccess.h similarity index 79% rename from src/TNL/Meshes/MeshDetails/layers/MeshSubentityAccess.h rename to src/TNL/Meshes/MeshDetails/EntityLayers/SubentityAccess.h index a3d81a6c66feb014e05bf4eb42f5f8fa0aa45686..3458ffc30e7b786801abf16eb4ce97f4c494c167 100644 --- a/src/TNL/Meshes/MeshDetails/layers/MeshSubentityAccess.h +++ b/src/TNL/Meshes/MeshDetails/EntityLayers/SubentityAccess.h @@ -1,5 +1,5 @@ /*************************************************************************** - MeshSubentityAccess.h - description + SubentityAccess.h - description ------------------- begin : Oct 26, 2016 copyright : (C) 2014 by Tomas Oberhuber et al. @@ -27,22 +27,22 @@ template< typename MeshConfig, WeakSubentityStorageTrait< MeshConfig, Device, EntityTopology, DimensionTag >::storageEnabled, bool SubentityOrientationStorage = MeshConfig::subentityOrientationStorage( EntityTopology(), DimensionTag::value ) > -class MeshSubentityAccessLayer; +class SubentityAccessLayer; template< typename MeshConfig, typename Device, typename EntityTopology > -class MeshSubentityAccess - : public MeshSubentityAccessLayer< MeshConfig, - Device, - EntityTopology, - Meshes::DimensionTag< 0 > > +class SubentityAccessLayerFamily + : public SubentityAccessLayer< MeshConfig, + Device, + EntityTopology, + Meshes::DimensionTag< 0 > > { - using BaseType = MeshSubentityAccessLayer< MeshConfig, - Device, - EntityTopology, - Meshes::DimensionTag< 0 > >; + using BaseType = SubentityAccessLayer< MeshConfig, + Device, + EntityTopology, + Meshes::DimensionTag< 0 > >; using MeshTraitsType = MeshTraits< MeshConfig, Device >; @@ -103,7 +103,7 @@ public: } __cuda_callable__ - bool operator==( const MeshSubentityAccess& other ) const + bool operator==( const SubentityAccessLayerFamily& other ) const { return BaseType::operator==( other ); } @@ -119,21 +119,21 @@ template< typename MeshConfig, typename Device, typename EntityTopology, typename DimensionTag > -class MeshSubentityAccessLayer< MeshConfig, - Device, - EntityTopology, - DimensionTag, - true, - true > - : public MeshSubentityAccessLayer< MeshConfig, - Device, - EntityTopology, - typename DimensionTag::Increment > +class SubentityAccessLayer< MeshConfig, + Device, + EntityTopology, + DimensionTag, + true, + true > + : public SubentityAccessLayer< MeshConfig, + Device, + EntityTopology, + typename DimensionTag::Increment > { - using BaseType = MeshSubentityAccessLayer< MeshConfig, - Device, - EntityTopology, - typename DimensionTag::Increment >; + using BaseType = SubentityAccessLayer< MeshConfig, + Device, + EntityTopology, + typename DimensionTag::Increment >; using MeshTraitsType = MeshTraits< MeshConfig, Device >; using SubentityTraitsType = typename MeshTraitsType::template SubentityTraits< EntityTopology, DimensionTag::value >; @@ -145,16 +145,16 @@ protected: using OrientationArrayType = typename SubentityTraitsType::OrientationArrayType; using IdPermutationArrayType = typename SubentityTraitsType::IdPermutationArrayType; - MeshSubentityAccessLayer() = default; + SubentityAccessLayer() = default; - explicit MeshSubentityAccessLayer( const MeshSubentityAccessLayer& layer ) + explicit SubentityAccessLayer( const SubentityAccessLayer& layer ) : BaseType( layer ) { this->subentityIndices.bind( layer.subentityIndices ); } __cuda_callable__ - MeshSubentityAccessLayer& operator=( const MeshSubentityAccessLayer& layer ) + SubentityAccessLayer& operator=( const SubentityAccessLayer& layer ) { BaseType::operator=( layer ); this->subentityIndices.bind( layer.subentityIndices ); @@ -168,7 +168,7 @@ protected: } __cuda_callable__ - bool operator==( const MeshSubentityAccessLayer& layer ) const + bool operator==( const SubentityAccessLayer& layer ) const { return ( BaseType::operator==( layer ) && subentityIndices == layer.subentityIndices ); @@ -242,22 +242,22 @@ template< typename MeshConfig, typename Device, typename EntityTopology, typename DimensionTag > -class MeshSubentityAccessLayer< MeshConfig, - Device, - EntityTopology, - DimensionTag, - true, - false > - : public MeshSubentityAccessLayer< MeshConfig, - Device, - EntityTopology, - typename DimensionTag::Increment > +class SubentityAccessLayer< MeshConfig, + Device, + EntityTopology, + DimensionTag, + true, + false > + : public SubentityAccessLayer< MeshConfig, + Device, + EntityTopology, + typename DimensionTag::Increment > { static_assert( DimensionTag::value < EntityTopology::dimension, "" ); - using BaseType = MeshSubentityAccessLayer< MeshConfig, - Device, - EntityTopology, - typename DimensionTag::Increment >; + using BaseType = SubentityAccessLayer< MeshConfig, + Device, + EntityTopology, + typename DimensionTag::Increment >; using MeshTraitsType = MeshTraits< MeshConfig, Device >; using SubentityTraitsType = typename MeshTraitsType::template SubentityTraits< EntityTopology, DimensionTag::value >; @@ -267,16 +267,16 @@ protected: using LocalIndexType = typename SubentityTraitsType::LocalIndexType; using SubentityAccessorType = typename SubentityTraitsType::SubentityAccessorType; - MeshSubentityAccessLayer() = default; + SubentityAccessLayer() = default; - explicit MeshSubentityAccessLayer( const MeshSubentityAccessLayer& layer ) + explicit SubentityAccessLayer( const SubentityAccessLayer& layer ) : BaseType( layer ) { this->subentityIndices.bind( layer.subentityIndices ); } __cuda_callable__ - MeshSubentityAccessLayer& operator=( const MeshSubentityAccessLayer& layer ) + SubentityAccessLayer& operator=( const SubentityAccessLayer& layer ) { BaseType::operator=( layer ); this->subentityIndices.bind( layer.subentityIndices ); @@ -290,7 +290,7 @@ protected: } __cuda_callable__ - bool operator==( const MeshSubentityAccessLayer& layer ) const + bool operator==( const SubentityAccessLayer& layer ) const { return ( BaseType::operator==( layer ) && subentityIndices == layer.subentityIndices ); @@ -350,12 +350,12 @@ private: template< typename MeshConfig, typename Device, typename EntityTopology > -class MeshSubentityAccessLayer< MeshConfig, - Device, - EntityTopology, - Meshes::DimensionTag< EntityTopology::dimension >, - false, - true > +class SubentityAccessLayer< MeshConfig, + Device, + EntityTopology, + Meshes::DimensionTag< EntityTopology::dimension >, + false, + true > { using DimensionTag = Meshes::DimensionTag< EntityTopology::dimension >; @@ -387,7 +387,7 @@ protected: void subentityOrientationsArray( DimensionTag ) {} __cuda_callable__ - bool operator==( const MeshSubentityAccessLayer& other ) const + bool operator==( const SubentityAccessLayer& other ) const { return true; } @@ -399,12 +399,12 @@ template< typename MeshConfig, typename Device, typename EntityTopology, typename DimensionTag > -class MeshSubentityAccessLayer< MeshConfig, - Device, - EntityTopology, - DimensionTag, - false, - false > +class SubentityAccessLayer< MeshConfig, + Device, + EntityTopology, + DimensionTag, + false, + false > { protected: /*** @@ -435,7 +435,7 @@ protected: void subentityOrientationsArray( DimensionTag ) {} __cuda_callable__ - bool operator==( const MeshSubentityAccessLayer& other ) const + bool operator==( const SubentityAccessLayer& other ) const { return true; } diff --git a/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityAccess.h b/src/TNL/Meshes/MeshDetails/EntityLayers/SuperentityAccess.h similarity index 79% rename from src/TNL/Meshes/MeshDetails/layers/MeshSuperentityAccess.h rename to src/TNL/Meshes/MeshDetails/EntityLayers/SuperentityAccess.h index dd338bc63cb508781edcb1d4fc358626f682a957..78372ba57fbeb5951cd2e6570ea8a3d9dd49317b 100644 --- a/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityAccess.h +++ b/src/TNL/Meshes/MeshDetails/EntityLayers/SuperentityAccess.h @@ -1,5 +1,5 @@ /*************************************************************************** - MeshSuperentityAccess.h - description + SuperentityAccess.h - description ------------------- begin : Aug 15, 2015 copyright : (C) 2015 by Tomas Oberhuber et al. @@ -27,22 +27,22 @@ template< typename MeshConfig, typename EntityTopology, typename DimensionTag, bool SuperentityStorage = WeakSuperentityStorageTrait< MeshConfig, Device, EntityTopology, DimensionTag >::storageEnabled > -class MeshSuperentityAccessLayer; +class SuperentityAccessLayer; template< typename MeshConfig, typename Device, typename EntityTopology > -class MeshSuperentityAccess - : public MeshSuperentityAccessLayer< MeshConfig, - Device, - EntityTopology, - Meshes::DimensionTag< MeshTraits< MeshConfig, Device >::meshDimension > > +class SuperentityAccessLayerFamily + : public SuperentityAccessLayer< MeshConfig, + Device, + EntityTopology, + Meshes::DimensionTag< MeshTraits< MeshConfig, Device >::meshDimension > > { - using BaseType = MeshSuperentityAccessLayer< MeshConfig, - Device, - EntityTopology, - Meshes::DimensionTag< MeshTraits< MeshConfig, Device >::meshDimension > >; + using BaseType = SuperentityAccessLayer< MeshConfig, + Device, + EntityTopology, + Meshes::DimensionTag< MeshTraits< MeshConfig, Device >::meshDimension > >; using MeshTraitsType = MeshTraits< MeshConfig, Device >; @@ -100,7 +100,7 @@ public: } __cuda_callable__ - bool operator==( const MeshSuperentityAccess& other ) const + bool operator==( const SuperentityAccessLayerFamily& other ) const { return BaseType::operator==( other ); } @@ -115,14 +115,14 @@ template< typename MeshConfig, typename Device, typename EntityTopology, typename DimensionTag > -class MeshSuperentityAccessLayer< MeshConfig, - Device, - EntityTopology, - DimensionTag, - true > - : public MeshSuperentityAccessLayer< MeshConfig, Device, EntityTopology, typename DimensionTag::Decrement > +class SuperentityAccessLayer< MeshConfig, + Device, + EntityTopology, + DimensionTag, + true > + : public SuperentityAccessLayer< MeshConfig, Device, EntityTopology, typename DimensionTag::Decrement > { - using BaseType = MeshSuperentityAccessLayer< MeshConfig, Device, EntityTopology, typename DimensionTag::Decrement >; + using BaseType = SuperentityAccessLayer< MeshConfig, Device, EntityTopology, typename DimensionTag::Decrement >; using MeshTraitsType = MeshTraits< MeshConfig, Device >; using SuperentityTraitsType = typename MeshTraitsType::template SuperentityTraits< EntityTopology, DimensionTag::value >; @@ -141,16 +141,16 @@ public: using BaseType::getSuperentityIndex; using BaseType::getSuperentityIndices; - MeshSuperentityAccessLayer() = default; + SuperentityAccessLayer() = default; - explicit MeshSuperentityAccessLayer( const MeshSuperentityAccessLayer& layer ) + explicit SuperentityAccessLayer( const SuperentityAccessLayer& layer ) : BaseType( layer ) { this->superentityIndices.bind( layer.superentityIndices ); } __cuda_callable__ - MeshSuperentityAccessLayer& operator=( const MeshSuperentityAccessLayer& layer ) + SuperentityAccessLayer& operator=( const SuperentityAccessLayer& layer ) { BaseType::operator=( layer ); this->superentityIndices.bind( layer.superentityIndices ); @@ -208,7 +208,7 @@ public: } __cuda_callable__ - bool operator==( const MeshSuperentityAccessLayer& other ) const + bool operator==( const SuperentityAccessLayer& other ) const { return ( BaseType::operator==( other ) && superentityIndices == other.superentityIndices ); } @@ -227,12 +227,12 @@ template< typename MeshConfig, typename Device, typename EntityTopology, typename DimensionTag > -class MeshSuperentityAccessLayer< MeshConfig, - Device, - EntityTopology, - DimensionTag, - false > - : public MeshSuperentityAccessLayer< MeshConfig, Device, EntityTopology, typename DimensionTag::Decrement > +class SuperentityAccessLayer< MeshConfig, + Device, + EntityTopology, + DimensionTag, + false > + : public SuperentityAccessLayer< MeshConfig, Device, EntityTopology, typename DimensionTag::Decrement > { }; @@ -240,11 +240,11 @@ class MeshSuperentityAccessLayer< MeshConfig, template< typename MeshConfig, typename Device, typename EntityTopology > -class MeshSuperentityAccessLayer< MeshConfig, - Device, - EntityTopology, - Meshes::DimensionTag< EntityTopology::dimension >, - false > +class SuperentityAccessLayer< MeshConfig, + Device, + EntityTopology, + Meshes::DimensionTag< EntityTopology::dimension >, + false > { using DimensionTag = Meshes::DimensionTag< EntityTopology::dimension >; @@ -275,7 +275,7 @@ protected: void getSuperentityIndices() {} __cuda_callable__ - bool operator==( const MeshSuperentityAccessLayer& other ) const + bool operator==( const SuperentityAccessLayer& other ) const { return true; } diff --git a/src/TNL/Meshes/MeshDetails/layers/MeshEntityStorageRebinder.h b/src/TNL/Meshes/MeshDetails/EntityStorageRebinder.h similarity index 98% rename from src/TNL/Meshes/MeshDetails/layers/MeshEntityStorageRebinder.h rename to src/TNL/Meshes/MeshDetails/EntityStorageRebinder.h index c5a36d304fe8af9f09baf0cb2a11f7fa0d8073f3..c5c6516cc8936c953a71c265bc024a323a41afb7 100644 --- a/src/TNL/Meshes/MeshDetails/layers/MeshEntityStorageRebinder.h +++ b/src/TNL/Meshes/MeshDetails/EntityStorageRebinder.h @@ -1,5 +1,5 @@ /*************************************************************************** - MeshEntityStorageRebinder.h - description + EntityStorageRebinder.h - description ------------------- begin : Oct 22, 2016 copyright : (C) 2014 by Tomas Oberhuber et al. @@ -35,7 +35,7 @@ namespace TNL { namespace Meshes { template< typename Mesh > -class MeshEntityStorageRebinder +class EntityStorageRebinder { using IndexType = typename Mesh::GlobalIndexType; using DeviceType = typename Mesh::DeviceType; diff --git a/src/TNL/Meshes/MeshDetails/MeshEntity_impl.h b/src/TNL/Meshes/MeshDetails/MeshEntity_impl.h index 6597b1304baf5435b825d59670c9979c759ec189..b1c39c1956eaf8b6bc2181b3c00d8cc4103455f1 100644 --- a/src/TNL/Meshes/MeshDetails/MeshEntity_impl.h +++ b/src/TNL/Meshes/MeshDetails/MeshEntity_impl.h @@ -26,8 +26,8 @@ template< typename MeshConfig, typename EntityTopology > MeshEntity< MeshConfig, Device, EntityTopology >:: MeshEntity( const MeshEntity& entity ) - : MeshSubentityAccess< MeshConfig, Device, EntityTopology >( entity ), - MeshSuperentityAccess< MeshConfig, Device, EntityTopology >( entity ), + : SubentityAccessLayerFamily< MeshConfig, Device, EntityTopology >( entity ), + SuperentityAccessLayerFamily< MeshConfig, Device, EntityTopology >( entity ), MeshEntityIndex< typename MeshConfig::IdType >( entity ) { } @@ -52,8 +52,8 @@ MeshEntity< MeshConfig, Device, EntityTopology >& MeshEntity< MeshConfig, Device, EntityTopology >:: operator=( const MeshEntity& entity ) { - MeshSubentityAccess< MeshConfig, Device, EntityTopology >::operator=( entity ); - MeshSuperentityAccess< MeshConfig, Device, EntityTopology >::operator=( entity ); + SubentityAccessLayerFamily< MeshConfig, Device, EntityTopology >::operator=( entity ); + SuperentityAccessLayerFamily< MeshConfig, Device, EntityTopology >::operator=( entity ); MeshEntityIndex< typename MeshConfig::IdType >::operator=( entity ); return *this; } @@ -126,8 +126,8 @@ MeshEntity< MeshConfig, Device, EntityTopology >:: print( std::ostream& str ) const { str << "\t Mesh entity dimension: " << EntityTopology::dimension << std::endl; - MeshSubentityAccess< MeshConfig, Device, EntityTopology >::print( str ); - MeshSuperentityAccess< MeshConfig, Device, EntityTopology >::print( str ); + SubentityAccessLayerFamily< MeshConfig, Device, EntityTopology >::print( str ); + SuperentityAccessLayerFamily< MeshConfig, Device, EntityTopology >::print( str ); } template< typename MeshConfig, @@ -138,8 +138,8 @@ bool MeshEntity< MeshConfig, Device, EntityTopology >:: operator==( const MeshEntity& entity ) const { - return ( MeshSubentityAccess< MeshConfig, Device, EntityTopology >::operator==( entity ) && - MeshSuperentityAccess< MeshConfig, Device, EntityTopology >::operator==( entity ) && + return ( SubentityAccessLayerFamily< MeshConfig, Device, EntityTopology >::operator==( entity ) && + SuperentityAccessLayerFamily< MeshConfig, Device, EntityTopology >::operator==( entity ) && MeshEntityIndex< typename MeshConfig::IdType >::operator==( entity ) ); } @@ -194,7 +194,7 @@ getVertexIndex( const LocalIndexType localIndex ) const template< typename MeshConfig, typename Device > MeshEntity< MeshConfig, Device, Topologies::Vertex >:: MeshEntity( const MeshEntity& entity ) - : MeshSuperentityAccess< MeshConfig, Device, Topologies::Vertex >( entity ), + : SuperentityAccessLayerFamily< MeshConfig, Device, Topologies::Vertex >( entity ), MeshEntityIndex< typename MeshConfig::IdType >( entity ) { setPoint( entity.getPoint() ); @@ -218,7 +218,7 @@ MeshEntity< MeshConfig, Device, Topologies::Vertex >& MeshEntity< MeshConfig, Device, Topologies::Vertex >:: operator=( const MeshEntity& entity ) { - MeshSuperentityAccess< MeshConfig, Device, Topologies::Vertex >::operator=( entity ); + SuperentityAccessLayerFamily< MeshConfig, Device, Topologies::Vertex >::operator=( entity ); MeshEntityIndex< typename MeshConfig::IdType >::operator=( entity ); setPoint( entity.getPoint() ); return *this; @@ -284,7 +284,7 @@ print( std::ostream& str ) const { str << "\t Mesh entity dimension: " << Topologies::Vertex::dimension << std::endl; str << "\t Coordinates = " << point << std::endl; - MeshSuperentityAccess< MeshConfig, Device, Topologies::Vertex >::print( str ); + SuperentityAccessLayerFamily< MeshConfig, Device, Topologies::Vertex >::print( str ); } template< typename MeshConfig, typename Device > @@ -293,7 +293,7 @@ bool MeshEntity< MeshConfig, Device, Topologies::Vertex >:: operator==( const MeshEntity& entity ) const { - return ( MeshSuperentityAccess< MeshConfig, Device, Topologies::Vertex >::operator==( entity ) && + return ( SuperentityAccessLayerFamily< MeshConfig, Device, Topologies::Vertex >::operator==( entity ) && MeshEntityIndex< typename MeshConfig::IdType >::operator==( entity ) && point == entity.point ); } diff --git a/src/TNL/Meshes/MeshDetails/layers/MeshBoundaryTagsLayer.h b/src/TNL/Meshes/MeshDetails/MeshLayers/BoundaryTagsLayer.h similarity index 88% rename from src/TNL/Meshes/MeshDetails/layers/MeshBoundaryTagsLayer.h rename to src/TNL/Meshes/MeshDetails/MeshLayers/BoundaryTagsLayer.h index 73dc1900c758a77aa4318d1b135fbbe6b844721a..4ec31be7ec94a7755b987ad5f5baaf771500fe4c 100644 --- a/src/TNL/Meshes/MeshDetails/layers/MeshBoundaryTagsLayer.h +++ b/src/TNL/Meshes/MeshDetails/MeshLayers/BoundaryTagsLayer.h @@ -1,5 +1,5 @@ /*************************************************************************** - MeshBoundaryTagsLayer.h - description + BoundaryTagsLayer.h - description ------------------- begin : Dec 25, 2016 copyright : (C) 2016 by Tomas Oberhuber et al. @@ -18,12 +18,12 @@ namespace TNL { namespace Meshes { // This is the implementation of the BoundaryTags layer for one specific dimension. -// It is inherited by MeshStorageLayer. +// It is inherited by the StorageLayer. template< typename MeshConfig, typename Device, typename DimensionTag, bool TagStorage = MeshConfig::boundaryTagsStorage( typename MeshTraits< MeshConfig, Device >::template EntityTraits< DimensionTag::value >::EntityTopology() ) > -class MeshBoundaryTagsLayer +class BoundaryTagsLayer { using MeshTraitsType = MeshTraits< MeshConfig, Device >; using EntityTraitsType = typename MeshTraitsType::template EntityTraits< DimensionTag::value >; @@ -33,20 +33,20 @@ public: using BoundaryTagsArray = typename MeshTraitsType::BoundaryTagsArrayType; using OrderingArray = typename MeshTraitsType::GlobalIndexOrderingArrayType; - MeshBoundaryTagsLayer() = default; + BoundaryTagsLayer() = default; - explicit MeshBoundaryTagsLayer( const MeshBoundaryTagsLayer& other ) + explicit BoundaryTagsLayer( const BoundaryTagsLayer& other ) { operator=( other ); } template< typename Device_ > - MeshBoundaryTagsLayer( const MeshBoundaryTagsLayer< MeshConfig, Device_, DimensionTag >& other ) + BoundaryTagsLayer( const BoundaryTagsLayer< MeshConfig, Device_, DimensionTag >& other ) { operator=( other ); } - MeshBoundaryTagsLayer& operator=( const MeshBoundaryTagsLayer& other ) + BoundaryTagsLayer& operator=( const BoundaryTagsLayer& other ) { boundaryTags.setLike( other.boundaryTags ); boundaryIndices.setLike( other.boundaryIndices ); @@ -58,7 +58,7 @@ public: } template< typename Device_ > - MeshBoundaryTagsLayer& operator=( const MeshBoundaryTagsLayer< MeshConfig, Device_, DimensionTag >& other ) + BoundaryTagsLayer& operator=( const BoundaryTagsLayer< MeshConfig, Device_, DimensionTag >& other ) { boundaryTags.setLike( other.boundaryTags ); boundaryIndices.setLike( other.boundaryIndices ); @@ -197,7 +197,7 @@ public: str << interiorIndices << std::endl; } - bool operator==( const MeshBoundaryTagsLayer& layer ) const + bool operator==( const BoundaryTagsLayer& layer ) const { TNL_ASSERT( ( boundaryTags == layer.boundaryTags && boundaryIndices == layer.boundaryIndices && interiorIndices == layer.interiorIndices ) || ( boundaryTags != layer.boundaryTags && boundaryIndices != layer.boundaryIndices && interiorIndices != layer.interiorIndices ), @@ -218,13 +218,13 @@ private: // friend class is needed for templated assignment operators template< typename MeshConfig_, typename Device_, typename DimensionTag_, bool TagStorage_ > - friend class MeshBoundaryTagsLayer; + friend class BoundaryTagsLayer; }; template< typename MeshConfig, typename Device, typename DimensionTag > -class MeshBoundaryTagsLayer< MeshConfig, Device, DimensionTag, false > +class BoundaryTagsLayer< MeshConfig, Device, DimensionTag, false > { using MeshTraitsType = MeshTraits< MeshConfig, Device >; using EntityTraitsType = typename MeshTraitsType::template EntityTraits< DimensionTag::value >; @@ -232,13 +232,13 @@ class MeshBoundaryTagsLayer< MeshConfig, Device, DimensionTag, false > public: using GlobalIndexType = typename EntityTraitsType::GlobalIndexType; - MeshBoundaryTagsLayer() = default; - explicit MeshBoundaryTagsLayer( const MeshBoundaryTagsLayer& other ) {} + BoundaryTagsLayer() = default; + explicit BoundaryTagsLayer( const BoundaryTagsLayer& other ) {} template< typename Device_ > - MeshBoundaryTagsLayer( const MeshBoundaryTagsLayer< MeshConfig, Device_, DimensionTag >& other ) {} - MeshBoundaryTagsLayer& operator=( const MeshBoundaryTagsLayer& other ) { return *this; } + BoundaryTagsLayer( const BoundaryTagsLayer< MeshConfig, Device_, DimensionTag >& other ) {} + BoundaryTagsLayer& operator=( const BoundaryTagsLayer& other ) { return *this; } template< typename Device_ > - MeshBoundaryTagsLayer& operator=( const MeshBoundaryTagsLayer< MeshConfig, Device_, DimensionTag >& other ) { return *this; } + BoundaryTagsLayer& operator=( const BoundaryTagsLayer< MeshConfig, Device_, DimensionTag >& other ) { return *this; } void setEntitiesCount( const GlobalIndexType& entitiesCount ) {} @@ -263,7 +263,7 @@ public: void print( std::ostream& str ) const {} - bool operator==( const MeshBoundaryTagsLayer& layer ) const + bool operator==( const BoundaryTagsLayer& layer ) const { return true; } diff --git a/src/TNL/Meshes/MeshDetails/MeshLayers/CMakeLists.txt b/src/TNL/Meshes/MeshDetails/MeshLayers/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..f73dce69e86c6565ba6339f03ec9ab4a54214721 --- /dev/null +++ b/src/TNL/Meshes/MeshDetails/MeshLayers/CMakeLists.txt @@ -0,0 +1,7 @@ +SET( headers BoundaryTagsLayer.h + StorageLayer.h + SubentityStorageLayer.h + SuperentityStorageLayer.h +) + +INSTALL( FILES ${headers} DESTINATION include/tnl-${tnlVersion}/TNL/Meshes/MeshDetails/MeshLayers ) diff --git a/src/TNL/Meshes/MeshDetails/layers/MeshStorageLayer.h b/src/TNL/Meshes/MeshDetails/MeshLayers/StorageLayer.h similarity index 78% rename from src/TNL/Meshes/MeshDetails/layers/MeshStorageLayer.h rename to src/TNL/Meshes/MeshDetails/MeshLayers/StorageLayer.h index 9d580e613ffea24a0ab94171a5bc3a30370d9b5f..bbe174216f203f9a630de637771b0c7760fae45c 100644 --- a/src/TNL/Meshes/MeshDetails/layers/MeshStorageLayer.h +++ b/src/TNL/Meshes/MeshDetails/MeshLayers/StorageLayer.h @@ -1,5 +1,5 @@ /*************************************************************************** - MeshStorageLayer.h - description + StorageLayer.h - description ------------------- begin : Feb 11, 2014 copyright : (C) 2014 by Tomas Oberhuber et al. @@ -18,9 +18,9 @@ #include <TNL/File.h> #include <TNL/Meshes/MeshDetails/traits/WeakStorageTraits.h> -#include <TNL/Meshes/MeshDetails/layers/MeshSubentityStorageLayer.h> -#include <TNL/Meshes/MeshDetails/layers/MeshSuperentityStorageLayer.h> -#include <TNL/Meshes/MeshDetails/layers/MeshBoundaryTagsLayer.h> +#include <TNL/Meshes/MeshDetails/MeshLayers/SubentityStorageLayer.h> +#include <TNL/Meshes/MeshDetails/MeshLayers/SuperentityStorageLayer.h> +#include <TNL/Meshes/MeshDetails/MeshLayers/BoundaryTagsLayer.h> namespace TNL { namespace Meshes { @@ -29,23 +29,23 @@ template< typename MeshConfig, typename Device, typename DimensionTag, bool EntityStorage = WeakEntityStorageTrait< MeshConfig, Device, DimensionTag >::storageEnabled > -class MeshStorageLayer; +class StorageLayer; template< typename MeshConfig, typename Device > -class MeshStorageLayers - : public MeshStorageLayer< MeshConfig, Device, DimensionTag< 0 > > +class StorageLayerFamily + : public StorageLayer< MeshConfig, Device, DimensionTag< 0 > > { using MeshTraitsType = MeshTraits< MeshConfig, Device >; - using BaseType = MeshStorageLayer< MeshConfig, Device, DimensionTag< 0 > >; + using BaseType = StorageLayer< MeshConfig, Device, DimensionTag< 0 > >; template< int Dimension > using EntityTraits = typename MeshTraitsType::template EntityTraits< Dimension >; public: - MeshStorageLayers() = default; - explicit MeshStorageLayers( const MeshStorageLayers& other ) : BaseType( other ) {} + StorageLayerFamily() = default; + explicit StorageLayerFamily( const StorageLayerFamily& other ) : BaseType( other ) {} template< typename Device_ > - MeshStorageLayers( const MeshStorageLayers< MeshConfig, Device_ >& other ) : BaseType( other ) {} + StorageLayerFamily( const StorageLayerFamily< MeshConfig, Device_ >& other ) : BaseType( other ) {} protected: template< int Dimension > @@ -61,7 +61,7 @@ protected: { static_assert( EntityTraits< Dimension >::storageEnabled, "You try to get subentity storage of entities which are not configured for storage." ); static_assert( Dimension > Subdimension, "Invalid combination of Dimension and Subdimension." ); - using BaseType = MeshSubentityStorageLayers< MeshConfig, + using BaseType = SubentityStorageLayerFamily< MeshConfig, Device, typename EntityTraits< Dimension >::EntityTopology >; return BaseType::template getSubentityStorageNetwork< Subdimension >(); @@ -73,7 +73,7 @@ protected: { static_assert( EntityTraits< Dimension >::storageEnabled, "You try to get superentity storage of entities which are not configured for storage." ); static_assert( Dimension < Superdimension, "Invalid combination of Dimension and Superdimension." ); - using BaseType = MeshSuperentityStorageLayers< MeshConfig, + using BaseType = SuperentityStorageLayerFamily< MeshConfig, Device, typename EntityTraits< Dimension >::EntityTopology >; return BaseType::template getSuperentityStorageNetwork< Superdimension >(); @@ -148,30 +148,30 @@ protected: template< typename MeshConfig, typename Device, typename DimensionTag > -class MeshStorageLayer< MeshConfig, - Device, - DimensionTag, - true > - : public MeshSubentityStorageLayers< MeshConfig, - Device, - typename MeshTraits< MeshConfig, Device >::template EntityTraits< DimensionTag::value >::EntityTopology >, - public MeshSuperentityStorageLayers< MeshConfig, - Device, - typename MeshTraits< MeshConfig, Device >::template EntityTraits< DimensionTag::value >::EntityTopology >, - public MeshBoundaryTagsLayer< MeshConfig, Device, DimensionTag >, - public MeshStorageLayer< MeshConfig, Device, typename DimensionTag::Increment > +class StorageLayer< MeshConfig, + Device, + DimensionTag, + true > + : public SubentityStorageLayerFamily< MeshConfig, + Device, + typename MeshTraits< MeshConfig, Device >::template EntityTraits< DimensionTag::value >::EntityTopology >, + public SuperentityStorageLayerFamily< MeshConfig, + Device, + typename MeshTraits< MeshConfig, Device >::template EntityTraits< DimensionTag::value >::EntityTopology >, + public BoundaryTagsLayer< MeshConfig, Device, DimensionTag >, + public StorageLayer< MeshConfig, Device, typename DimensionTag::Increment > { public: - using BaseType = MeshStorageLayer< MeshConfig, Device, typename DimensionTag::Increment >; + using BaseType = StorageLayer< MeshConfig, Device, typename DimensionTag::Increment >; using MeshTraitsType = MeshTraits< MeshConfig, Device >; using EntityTraitsType = typename MeshTraitsType::template EntityTraits< DimensionTag::value >; using StorageArrayType = typename EntityTraitsType::StorageArrayType; using GlobalIndexType = typename EntityTraitsType::GlobalIndexType; using EntityType = typename EntityTraitsType::EntityType; using EntityTopology = typename EntityTraitsType::EntityTopology; - using SubentityStorageBaseType = MeshSubentityStorageLayers< MeshConfig, Device, EntityTopology >; - using SuperentityStorageBaseType = MeshSuperentityStorageLayers< MeshConfig, Device, EntityTopology >; - using BoundaryTagsBaseType = MeshBoundaryTagsLayer< MeshConfig, Device, DimensionTag >; + using SubentityStorageBaseType = SubentityStorageLayerFamily< MeshConfig, Device, EntityTopology >; + using SuperentityStorageBaseType = SuperentityStorageLayerFamily< MeshConfig, Device, EntityTopology >; + using BoundaryTagsBaseType = BoundaryTagsLayer< MeshConfig, Device, DimensionTag >; /**** * Make visible getters of the lower layer @@ -198,20 +198,20 @@ public: using BoundaryTagsBaseType::getInteriorEntitiesCount; using BoundaryTagsBaseType::getInteriorEntityIndex; - MeshStorageLayer() = default; + StorageLayer() = default; - explicit MeshStorageLayer( const MeshStorageLayer& other ) + explicit StorageLayer( const StorageLayer& other ) { operator=( other ); } template< typename Device_ > - MeshStorageLayer( const MeshStorageLayer< MeshConfig, Device_, DimensionTag >& other ) + StorageLayer( const StorageLayer< MeshConfig, Device_, DimensionTag >& other ) { operator=( other ); } - MeshStorageLayer& operator=( const MeshStorageLayer& other ) + StorageLayer& operator=( const StorageLayer& other ) { entities.setLike( other.entities); entities = other.entities; @@ -223,7 +223,7 @@ public: } template< typename Device_ > - MeshStorageLayer& operator=( const MeshStorageLayer< MeshConfig, Device_, DimensionTag >& other ) + StorageLayer& operator=( const StorageLayer< MeshConfig, Device_, DimensionTag >& other ) { entities.setLike( other.entities); entities = other.entities; @@ -303,7 +303,7 @@ public: BaseType::print( str ); } - bool operator==( const MeshStorageLayer& meshLayer ) const + bool operator==( const StorageLayer& meshLayer ) const { return ( entities == meshLayer.entities && SubentityStorageBaseType::operator==( meshLayer ) && @@ -317,20 +317,20 @@ protected: // friend class is needed for templated assignment operators template< typename MeshConfig_, typename Device_, typename DimensionTag_, bool Storage_ > - friend class MeshStorageLayer; + friend class StorageLayer; }; template< typename MeshConfig, typename Device, typename DimensionTag > -class MeshStorageLayer< MeshConfig, Device, DimensionTag, false > - : public MeshStorageLayer< MeshConfig, Device, typename DimensionTag::Decrement > +class StorageLayer< MeshConfig, Device, DimensionTag, false > + : public StorageLayer< MeshConfig, Device, typename DimensionTag::Decrement > { public: - using BaseType = MeshStorageLayer< MeshConfig, Device, typename DimensionTag::Decrement >; + using BaseType = StorageLayer< MeshConfig, Device, typename DimensionTag::Decrement >; - MeshStorageLayer() = default; - explicit MeshStorageLayer( const MeshStorageLayer& other ) + StorageLayer() = default; + explicit StorageLayer( const StorageLayer& other ) : BaseType( other ) {} }; @@ -338,26 +338,26 @@ public: // termination of recursive inheritance (everything is reduced to EntityStorage == false thanks to the WeakEntityStorageTrait) template< typename MeshConfig, typename Device > -class MeshStorageLayer< MeshConfig, Device, DimensionTag< MeshConfig::meshDimension + 1 >, false > +class StorageLayer< MeshConfig, Device, DimensionTag< MeshConfig::meshDimension + 1 >, false > { public: using DimensionTag = DimensionTag< MeshConfig::meshDimension >; using GlobalIndexType = typename MeshConfig::GlobalIndexType; - MeshStorageLayer() = default; + StorageLayer() = default; - explicit MeshStorageLayer( const MeshStorageLayer& other ) {} + explicit StorageLayer( const StorageLayer& other ) {} template< typename Device_ > - MeshStorageLayer( const MeshStorageLayer< MeshConfig, Device_, DimensionTag >& other ) {} + StorageLayer( const StorageLayer< MeshConfig, Device_, DimensionTag >& other ) {} - MeshStorageLayer& operator=( const MeshStorageLayer& other ) + StorageLayer& operator=( const StorageLayer& other ) { return *this; } template< typename Device_ > - MeshStorageLayer& operator=( const MeshStorageLayer< MeshConfig, Device_, DimensionTag >& other ) + StorageLayer& operator=( const StorageLayer< MeshConfig, Device_, DimensionTag >& other ) { return *this; } @@ -379,7 +379,7 @@ public: void print( std::ostream& str ) const {} - bool operator==( const MeshStorageLayer& meshLayer ) const + bool operator==( const StorageLayer& meshLayer ) const { return true; } diff --git a/src/TNL/Meshes/MeshDetails/layers/MeshSubentityStorageLayer.h b/src/TNL/Meshes/MeshDetails/MeshLayers/SubentityStorageLayer.h similarity index 63% rename from src/TNL/Meshes/MeshDetails/layers/MeshSubentityStorageLayer.h rename to src/TNL/Meshes/MeshDetails/MeshLayers/SubentityStorageLayer.h index ebd67aa96cf8c4b46336abb85d9d41a7ed29a46b..0fb4b5bda35040211c131eab8c80bbd2a697439c 100644 --- a/src/TNL/Meshes/MeshDetails/layers/MeshSubentityStorageLayer.h +++ b/src/TNL/Meshes/MeshDetails/MeshLayers/SubentityStorageLayer.h @@ -1,5 +1,5 @@ /*************************************************************************** - MeshSubentityStorageLayer.h - description + SubentityStorageLayer.h - description ------------------- begin : Feb 11, 2014 copyright : (C) 2014 by Tomas Oberhuber et al. @@ -29,24 +29,24 @@ template< typename MeshConfig, typename EntityTopology, typename SubdimensionTag, bool SubentityStorage = WeakSubentityStorageTrait< MeshConfig, Device, EntityTopology, SubdimensionTag >::storageEnabled > -class MeshSubentityStorageLayer; +class SubentityStorageLayer; template< typename MeshConfig, typename Device, typename EntityTopology > -class MeshSubentityStorageLayers - : public MeshSubentityStorageLayer< MeshConfig, Device, EntityTopology, DimensionTag< 0 > > +class SubentityStorageLayerFamily + : public SubentityStorageLayer< MeshConfig, Device, EntityTopology, DimensionTag< 0 > > { - using BaseType = MeshSubentityStorageLayer< MeshConfig, Device, EntityTopology, DimensionTag< 0 > >; + using BaseType = SubentityStorageLayer< MeshConfig, Device, EntityTopology, DimensionTag< 0 > >; using MeshTraitsType = MeshTraits< MeshConfig, Device >; public: - MeshSubentityStorageLayers() = default; - explicit MeshSubentityStorageLayers( const MeshSubentityStorageLayers& other ) + SubentityStorageLayerFamily() = default; + explicit SubentityStorageLayerFamily( const SubentityStorageLayerFamily& other ) : BaseType( other ) {} template< typename Device_ > - MeshSubentityStorageLayers( const MeshSubentityStorageLayers< MeshConfig, Device_, EntityTopology >& other ) + SubentityStorageLayerFamily( const SubentityStorageLayerFamily< MeshConfig, Device_, EntityTopology >& other ) : BaseType( other ) {} @@ -63,14 +63,14 @@ template< typename MeshConfig, typename Device, typename EntityTopology, typename SubdimensionTag > -class MeshSubentityStorageLayer< MeshConfig, - Device, - EntityTopology, - SubdimensionTag, - true > - : public MeshSubentityStorageLayer< MeshConfig, Device, EntityTopology, typename SubdimensionTag::Increment > +class SubentityStorageLayer< MeshConfig, + Device, + EntityTopology, + SubdimensionTag, + true > + : public SubentityStorageLayer< MeshConfig, Device, EntityTopology, typename SubdimensionTag::Increment > { - using BaseType = MeshSubentityStorageLayer< MeshConfig, Device, EntityTopology, typename SubdimensionTag::Increment >; + using BaseType = SubentityStorageLayer< MeshConfig, Device, EntityTopology, typename SubdimensionTag::Increment >; using MeshTraitsType = MeshTraits< MeshConfig, Device >; using SubentityTraitsType = typename MeshTraitsType::template SubentityTraits< EntityTopology, SubdimensionTag::value >; @@ -79,20 +79,20 @@ protected: using LocalIndexType = typename SubentityTraitsType::LocalIndexType; using StorageNetworkType = typename SubentityTraitsType::StorageNetworkType; - MeshSubentityStorageLayer() = default; + SubentityStorageLayer() = default; - explicit MeshSubentityStorageLayer( const MeshSubentityStorageLayer& other ) + explicit SubentityStorageLayer( const SubentityStorageLayer& other ) { operator=( other ); } template< typename Device_ > - MeshSubentityStorageLayer( const MeshSubentityStorageLayer< MeshConfig, Device_, EntityTopology, SubdimensionTag >& other ) + SubentityStorageLayer( const SubentityStorageLayer< MeshConfig, Device_, EntityTopology, SubdimensionTag >& other ) { operator=( other ); } - MeshSubentityStorageLayer& operator=( const MeshSubentityStorageLayer& other ) + SubentityStorageLayer& operator=( const SubentityStorageLayer& other ) { BaseType::operator=( other ); storageNetwork.setLike( other.storageNetwork ); @@ -101,7 +101,7 @@ protected: } template< typename Device_ > - MeshSubentityStorageLayer& operator=( const MeshSubentityStorageLayer< MeshConfig, Device_, EntityTopology, SubdimensionTag >& other ) + SubentityStorageLayer& operator=( const SubentityStorageLayer< MeshConfig, Device_, EntityTopology, SubdimensionTag >& other ) { BaseType::operator=( other ); storageNetwork.setLike( other.storageNetwork ); @@ -146,7 +146,7 @@ protected: str << this->storageNetwork << std::endl; } - bool operator==( const MeshSubentityStorageLayer& layer ) const + bool operator==( const SubentityStorageLayer& layer ) const { return ( BaseType::operator==( layer ) && storageNetwork == layer.storageNetwork ); @@ -163,33 +163,33 @@ private: // friend class is needed for templated assignment operators template< typename MeshConfig_, typename Device_, typename EntityTopology_, typename SubdimensionTag_, bool Storage_ > - friend class MeshSubentityStorageLayer; + friend class SubentityStorageLayer; }; template< typename MeshConfig, typename Device, typename EntityTopology, typename SubdimensionTag > -class MeshSubentityStorageLayer< MeshConfig, - Device, - EntityTopology, - SubdimensionTag, - false > - : public MeshSubentityStorageLayer< MeshConfig, Device, EntityTopology, typename SubdimensionTag::Increment > +class SubentityStorageLayer< MeshConfig, + Device, + EntityTopology, + SubdimensionTag, + false > + : public SubentityStorageLayer< MeshConfig, Device, EntityTopology, typename SubdimensionTag::Increment > { public: - using BaseType = MeshSubentityStorageLayer< MeshConfig, Device, EntityTopology, typename SubdimensionTag::Increment >; + using BaseType = SubentityStorageLayer< MeshConfig, Device, EntityTopology, typename SubdimensionTag::Increment >; - MeshSubentityStorageLayer() = default; - explicit MeshSubentityStorageLayer( const MeshSubentityStorageLayer& other ) + SubentityStorageLayer() = default; + explicit SubentityStorageLayer( const SubentityStorageLayer& other ) : BaseType( other ) {} template< typename Device_ > - MeshSubentityStorageLayer( const MeshSubentityStorageLayer< MeshConfig, Device_, EntityTopology, SubdimensionTag >& other ) + SubentityStorageLayer( const SubentityStorageLayer< MeshConfig, Device_, EntityTopology, SubdimensionTag >& other ) : BaseType( other ) {} template< typename Device_ > - MeshSubentityStorageLayer& operator=( const MeshSubentityStorageLayer< MeshConfig, Device_, EntityTopology, SubdimensionTag >& other ) + SubentityStorageLayer& operator=( const SubentityStorageLayer< MeshConfig, Device_, EntityTopology, SubdimensionTag >& other ) { return *this; } }; @@ -197,29 +197,29 @@ public: template< typename MeshConfig, typename Device, typename EntityTopology > -class MeshSubentityStorageLayer< MeshConfig, - Device, - EntityTopology, - DimensionTag< EntityTopology::dimension >, - false > +class SubentityStorageLayer< MeshConfig, + Device, + EntityTopology, + DimensionTag< EntityTopology::dimension >, + false > { using SubdimensionTag = DimensionTag< EntityTopology::dimension >; protected: using GlobalIndexType = typename MeshConfig::GlobalIndexType; - MeshSubentityStorageLayer() = default; - explicit MeshSubentityStorageLayer( const MeshSubentityStorageLayer& other ) {} + SubentityStorageLayer() = default; + explicit SubentityStorageLayer( const SubentityStorageLayer& other ) {} template< typename Device_ > - MeshSubentityStorageLayer( const MeshSubentityStorageLayer< MeshConfig, Device_, EntityTopology, SubdimensionTag >& other ) {} + SubentityStorageLayer( const SubentityStorageLayer< MeshConfig, Device_, EntityTopology, SubdimensionTag >& other ) {} template< typename Device_ > - MeshSubentityStorageLayer& operator=( const MeshSubentityStorageLayer< MeshConfig, Device_, EntityTopology, SubdimensionTag >& other ) { return *this; } + SubentityStorageLayer& operator=( const SubentityStorageLayer< MeshConfig, Device_, EntityTopology, SubdimensionTag >& other ) { return *this; } void setEntitiesCount( GlobalIndexType entitiesCount ) {} void print( std::ostream& str ) const {} - bool operator==( const MeshSubentityStorageLayer& layer ) const + bool operator==( const SubentityStorageLayer& layer ) const { return true; } diff --git a/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityStorageLayer.h b/src/TNL/Meshes/MeshDetails/MeshLayers/SuperentityStorageLayer.h similarity index 62% rename from src/TNL/Meshes/MeshDetails/layers/MeshSuperentityStorageLayer.h rename to src/TNL/Meshes/MeshDetails/MeshLayers/SuperentityStorageLayer.h index 9fe663a32f526f580538beb52b155d8ee7f08928..1e917a48a1d883a746360ced622115a4f067f74b 100644 --- a/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityStorageLayer.h +++ b/src/TNL/Meshes/MeshDetails/MeshLayers/SuperentityStorageLayer.h @@ -1,5 +1,5 @@ /*************************************************************************** - MeshSuperentityStorageLayer.h - description + SuperentityStorageLayer.h - description ------------------- begin : Feb 13, 2014 copyright : (C) 2014 by Tomas Oberhuber et al. @@ -29,30 +29,30 @@ template< typename MeshConfig, typename EntityTopology, typename SuperdimensionTag, bool SuperentityStorage = WeakSuperentityStorageTrait< MeshConfig, Device, EntityTopology, SuperdimensionTag >::storageEnabled > -class MeshSuperentityStorageLayer; +class SuperentityStorageLayer; template< typename MeshConfig, typename Device, typename EntityTopology > -class MeshSuperentityStorageLayers - : public MeshSuperentityStorageLayer< MeshConfig, - Device, - EntityTopology, - DimensionTag< MeshTraits< MeshConfig, Device >::meshDimension > > +class SuperentityStorageLayerFamily + : public SuperentityStorageLayer< MeshConfig, + Device, + EntityTopology, + DimensionTag< MeshTraits< MeshConfig, Device >::meshDimension > > { - using BaseType = MeshSuperentityStorageLayer< MeshConfig, - Device, - EntityTopology, - DimensionTag< MeshTraits< MeshConfig, Device >::meshDimension > >; + using BaseType = SuperentityStorageLayer< MeshConfig, + Device, + EntityTopology, + DimensionTag< MeshTraits< MeshConfig, Device >::meshDimension > >; using MeshTraitsType = MeshTraits< MeshConfig, Device >; public: - MeshSuperentityStorageLayers() = default; - explicit MeshSuperentityStorageLayers( const MeshSuperentityStorageLayers& other ) + SuperentityStorageLayerFamily() = default; + explicit SuperentityStorageLayerFamily( const SuperentityStorageLayerFamily& other ) : BaseType( other ) {} template< typename Device_ > - MeshSuperentityStorageLayers( const MeshSuperentityStorageLayers< MeshConfig, Device_, EntityTopology >& other ) + SuperentityStorageLayerFamily( const SuperentityStorageLayerFamily< MeshConfig, Device_, EntityTopology >& other ) : BaseType( other ) {} @@ -69,10 +69,10 @@ template< typename MeshConfig, typename Device, typename EntityTopology, typename SuperdimensionTag > -class MeshSuperentityStorageLayer< MeshConfig, Device, EntityTopology, SuperdimensionTag, true > - : public MeshSuperentityStorageLayer< MeshConfig, Device, EntityTopology, typename SuperdimensionTag::Decrement > +class SuperentityStorageLayer< MeshConfig, Device, EntityTopology, SuperdimensionTag, true > + : public SuperentityStorageLayer< MeshConfig, Device, EntityTopology, typename SuperdimensionTag::Decrement > { - using BaseType = MeshSuperentityStorageLayer< MeshConfig, Device, EntityTopology, typename SuperdimensionTag::Decrement >; + using BaseType = SuperentityStorageLayer< MeshConfig, Device, EntityTopology, typename SuperdimensionTag::Decrement >; using MeshTraitsType = MeshTraits< MeshConfig, Device >; using SuperentityTraitsType = typename MeshTraitsType::template SuperentityTraits< EntityTopology, SuperdimensionTag::value >; @@ -80,20 +80,20 @@ protected: using GlobalIndexType = typename SuperentityTraitsType::GlobalIndexType; using StorageNetworkType = typename SuperentityTraitsType::StorageNetworkType; - MeshSuperentityStorageLayer() = default; + SuperentityStorageLayer() = default; - explicit MeshSuperentityStorageLayer( const MeshSuperentityStorageLayer& other ) + explicit SuperentityStorageLayer( const SuperentityStorageLayer& other ) { operator=( other ); } template< typename Device_ > - MeshSuperentityStorageLayer( const MeshSuperentityStorageLayer< MeshConfig, Device_, EntityTopology, SuperdimensionTag >& other ) + SuperentityStorageLayer( const SuperentityStorageLayer< MeshConfig, Device_, EntityTopology, SuperdimensionTag >& other ) { operator=( other ); } - MeshSuperentityStorageLayer& operator=( const MeshSuperentityStorageLayer& other ) + SuperentityStorageLayer& operator=( const SuperentityStorageLayer& other ) { BaseType::operator=( other ); storageNetwork.setLike( other.storageNetwork ); @@ -102,7 +102,7 @@ protected: } template< typename Device_ > - MeshSuperentityStorageLayer& operator=( const MeshSuperentityStorageLayer< MeshConfig, Device_, EntityTopology, SuperdimensionTag >& other ) + SuperentityStorageLayer& operator=( const SuperentityStorageLayer< MeshConfig, Device_, EntityTopology, SuperdimensionTag >& other ) { BaseType::operator=( other ); storageNetwork.setLike( other.storageNetwork ); @@ -146,7 +146,7 @@ protected: str << this->storageNetwork << std::endl; } - bool operator==( const MeshSuperentityStorageLayer& layer ) const + bool operator==( const SuperentityStorageLayer& layer ) const { return ( BaseType::operator==( layer ) && storageNetwork == layer.storageNetwork ); @@ -163,29 +163,29 @@ private: // friend class is needed for templated assignment operators template< typename MeshConfig_, typename Device_, typename EntityTopology_, typename SuperdimensionTag_, bool Storage_ > - friend class MeshSuperentityStorageLayer; + friend class SuperentityStorageLayer; }; template< typename MeshConfig, typename Device, typename EntityTopology, typename SuperdimensionTag > -class MeshSuperentityStorageLayer< MeshConfig, Device, EntityTopology, SuperdimensionTag, false > - : public MeshSuperentityStorageLayer< MeshConfig, Device, EntityTopology, typename SuperdimensionTag::Decrement > +class SuperentityStorageLayer< MeshConfig, Device, EntityTopology, SuperdimensionTag, false > + : public SuperentityStorageLayer< MeshConfig, Device, EntityTopology, typename SuperdimensionTag::Decrement > { public: - using BaseType = MeshSuperentityStorageLayer< MeshConfig, Device, EntityTopology, typename SuperdimensionTag::Decrement >; + using BaseType = SuperentityStorageLayer< MeshConfig, Device, EntityTopology, typename SuperdimensionTag::Decrement >; - MeshSuperentityStorageLayer() = default; - explicit MeshSuperentityStorageLayer( const MeshSuperentityStorageLayer& other ) + SuperentityStorageLayer() = default; + explicit SuperentityStorageLayer( const SuperentityStorageLayer& other ) : BaseType( other ) {} template< typename Device_ > - MeshSuperentityStorageLayer( const MeshSuperentityStorageLayer< MeshConfig, Device_, EntityTopology, SuperdimensionTag >& other ) + SuperentityStorageLayer( const SuperentityStorageLayer< MeshConfig, Device_, EntityTopology, SuperdimensionTag >& other ) : BaseType( other ) {} template< typename Device_ > - MeshSuperentityStorageLayer& operator=( const MeshSuperentityStorageLayer< MeshConfig, Device_, EntityTopology, SuperdimensionTag >& other ) + SuperentityStorageLayer& operator=( const SuperentityStorageLayer< MeshConfig, Device_, EntityTopology, SuperdimensionTag >& other ) { return *this; } }; @@ -193,25 +193,25 @@ public: template< typename MeshConfig, typename Device, typename EntityTopology > -class MeshSuperentityStorageLayer< MeshConfig, Device, EntityTopology, DimensionTag< EntityTopology::dimension >, false > +class SuperentityStorageLayer< MeshConfig, Device, EntityTopology, DimensionTag< EntityTopology::dimension >, false > { using SuperdimensionTag = DimensionTag< EntityTopology::dimension >; protected: using GlobalIndexType = typename MeshConfig::GlobalIndexType; - MeshSuperentityStorageLayer() = default; - explicit MeshSuperentityStorageLayer( const MeshSuperentityStorageLayer& other ) {} + SuperentityStorageLayer() = default; + explicit SuperentityStorageLayer( const SuperentityStorageLayer& other ) {} template< typename Device_ > - MeshSuperentityStorageLayer( const MeshSuperentityStorageLayer< MeshConfig, Device_, EntityTopology, SuperdimensionTag >& other ) {} + SuperentityStorageLayer( const SuperentityStorageLayer< MeshConfig, Device_, EntityTopology, SuperdimensionTag >& other ) {} template< typename Device_ > - MeshSuperentityStorageLayer& operator=( const MeshSuperentityStorageLayer< MeshConfig, Device_, EntityTopology, SuperdimensionTag >& other ) { return *this; } + SuperentityStorageLayer& operator=( const SuperentityStorageLayer< MeshConfig, Device_, EntityTopology, SuperdimensionTag >& other ) { return *this; } void setEntitiesCount( GlobalIndexType entitiesCount ) {} void print( std::ostream& str ) const {} - bool operator==( const MeshSuperentityStorageLayer& layer ) const + bool operator==( const SuperentityStorageLayer& layer ) const { return true; } diff --git a/src/TNL/Meshes/MeshDetails/Mesh_impl.h b/src/TNL/Meshes/MeshDetails/Mesh_impl.h index 3e3500244a6b5d70c2b957d8725e5a2d9c604602..9f534b8cc0bd42c9ba1938b8e6bbfff81f5b519a 100644 --- a/src/TNL/Meshes/MeshDetails/Mesh_impl.h +++ b/src/TNL/Meshes/MeshDetails/Mesh_impl.h @@ -17,9 +17,9 @@ #pragma once #include <TNL/Meshes/Mesh.h> -#include <TNL/Meshes/MeshDetails/layers/MeshEntityStorageRebinder.h> -#include <TNL/Meshes/MeshDetails/initializer/Initializer.h> +#include <TNL/Meshes/MeshDetails/EntityStorageRebinder.h> #include <TNL/Meshes/MeshDetails/IndexPermutationApplier.h> +#include <TNL/Meshes/MeshDetails/initializer/Initializer.h> namespace TNL { namespace Meshes { @@ -41,7 +41,7 @@ Mesh( const Mesh& mesh ) : StorageBaseType( mesh ) { // update pointers from entities into the subentity and superentity storage networks - MeshEntityStorageRebinder< Mesh< MeshConfig, Device > >::exec( *this ); + EntityStorageRebinder< Mesh< MeshConfig, Device > >::exec( *this ); } template< typename MeshConfig, typename Device > @@ -50,11 +50,11 @@ Mesh< MeshConfig, Device >:: Mesh( const Mesh< MeshConfig, Device_ >& mesh ) // clang complains that subclass cannot be cast to its private/protected base type, // but for some reason it works fine for the non-template copy-constructor -// : StorageBaseType( *static_cast< const MeshStorageLayers< MeshConfig, Device_ >* >( &mesh ) ) - : StorageBaseType( *( (const MeshStorageLayers< MeshConfig, Device_ >*) &mesh ) ) +// : StorageBaseType( *static_cast< const StorageLayerFamily< MeshConfig, Device_ >* >( &mesh ) ) + : StorageBaseType( *( (const StorageLayerFamily< MeshConfig, Device_ >*) &mesh ) ) { // update pointers from entities into the subentity and superentity storage networks - MeshEntityStorageRebinder< Mesh< MeshConfig, Device > >::exec( *this ); + EntityStorageRebinder< Mesh< MeshConfig, Device > >::exec( *this ); } template< typename MeshConfig, typename Device > @@ -62,9 +62,9 @@ Mesh< MeshConfig, Device >& Mesh< MeshConfig, Device >:: operator=( const Mesh& mesh ) { - StorageBaseType::operator=( *( (const MeshStorageLayers< MeshConfig, Device >*) &mesh ) ); + StorageBaseType::operator=( *( (const StorageLayerFamily< MeshConfig, Device >*) &mesh ) ); // update pointers from entities into the subentity and superentity storage networks - MeshEntityStorageRebinder< Mesh< MeshConfig, Device > >::exec( *this ); + EntityStorageRebinder< Mesh< MeshConfig, Device > >::exec( *this ); return *this; } @@ -74,9 +74,9 @@ Mesh< MeshConfig, Device >& Mesh< MeshConfig, Device >:: operator=( const Mesh< MeshConfig, Device_ >& mesh ) { - StorageBaseType::operator=( *( (const MeshStorageLayers< MeshConfig, Device_ >*) &mesh ) ); + StorageBaseType::operator=( *( (const StorageLayerFamily< MeshConfig, Device_ >*) &mesh ) ); // update pointers from entities into the subentity and superentity storage networks - MeshEntityStorageRebinder< Mesh< MeshConfig, Device > >::exec( *this ); + EntityStorageRebinder< Mesh< MeshConfig, Device > >::exec( *this ); return *this; } @@ -226,7 +226,7 @@ reorderEntities( const IndexPermutationVector& perm, IndexPermutationApplier< Mesh, Dimension >::exec( *this, perm, iperm ); // update pointers from entities into the subentity and superentity storage networks // TODO: it would be enough to rebind just the permuted entities - MeshEntityStorageRebinder< Mesh< MeshConfig, Device > >::exec( *this ); + EntityStorageRebinder< Mesh< MeshConfig, Device > >::exec( *this ); // update boundary tags BoundaryTagsInitializer< Mesh >::exec( *this ); } @@ -258,7 +258,7 @@ load( File& file ) return false; } // update pointers from entities into the subentity and superentity storage networks - MeshEntityStorageRebinder< Mesh< MeshConfig, Device > >::exec( *this ); + EntityStorageRebinder< Mesh< MeshConfig, Device > >::exec( *this ); return true; } diff --git a/src/TNL/Meshes/MeshDetails/initializer/Initializer.h b/src/TNL/Meshes/MeshDetails/initializer/Initializer.h index 4187ff88643412c0fc900d394bedee767da80eee..c6c6f1252a0c12a70bd3c668f0730e3fa93561f5 100644 --- a/src/TNL/Meshes/MeshDetails/initializer/Initializer.h +++ b/src/TNL/Meshes/MeshDetails/initializer/Initializer.h @@ -102,7 +102,7 @@ class Initializer this->mesh = &mesh; BaseType::initEntities( *this, points, cellSeeds, mesh ); // set pointers from entities into the subentity and superentity storage networks - MeshEntityStorageRebinder< Mesh< MeshConfig > >::exec( mesh ); + EntityStorageRebinder< Mesh< MeshConfig > >::exec( mesh ); // init boundary tags BoundaryTagsInitializer< MeshType >::exec( mesh ); } diff --git a/src/TNL/Meshes/MeshDetails/layers/CMakeLists.txt b/src/TNL/Meshes/MeshDetails/layers/CMakeLists.txt deleted file mode 100644 index b23ca1b853e474af0c61401a5ab6262a65566039..0000000000000000000000000000000000000000 --- a/src/TNL/Meshes/MeshDetails/layers/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -SET( headers MeshEntityStorageRebinder.h - MeshStorageLayer.h - MeshSubentityAccess.h - MeshSubentityStorageLayer.h - MeshSuperentityAccess.h - MeshSuperentityStorageLayer.h - MeshBoundaryTagsLayer.h ) - -INSTALL( FILES ${headers} DESTINATION ${TNL_TARGET_INCLUDE_DIRECTORY}/Meshes/MeshDetails/layers ) diff --git a/src/TNL/Meshes/MeshEntity.h b/src/TNL/Meshes/MeshEntity.h index bf5f92d13fcc7d31dbd1d5d5933fcd3c21bca346..e3b148ba079022bda5869ec93492acd040df5800 100644 --- a/src/TNL/Meshes/MeshEntity.h +++ b/src/TNL/Meshes/MeshEntity.h @@ -20,23 +20,23 @@ #include <TNL/Meshes/MeshDetails/traits/MeshTraits.h> #include <TNL/Meshes/Topologies/Vertex.h> #include <TNL/Meshes/MeshDetails/MeshEntityIndex.h> -#include <TNL/Meshes/MeshDetails/layers/MeshSubentityAccess.h> -#include <TNL/Meshes/MeshDetails/layers/MeshSuperentityAccess.h> +#include <TNL/Meshes/MeshDetails/EntityLayers/SubentityAccess.h> +#include <TNL/Meshes/MeshDetails/EntityLayers/SuperentityAccess.h> namespace TNL { namespace Meshes { template< typename MeshConfig, typename Device > class Mesh; template< typename MeshConfig > class Initializer; -template< typename Mesh > class MeshEntityStorageRebinder; +template< typename Mesh > class EntityStorageRebinder; template< typename Mesh, int Dimension > struct IndexPermutationApplier; template< typename MeshConfig, typename Device, typename EntityTopology_ > class MeshEntity - : protected MeshSubentityAccess< MeshConfig, Device, EntityTopology_ >, - protected MeshSuperentityAccess< MeshConfig, Device, EntityTopology_ >, + : protected SubentityAccessLayerFamily< MeshConfig, Device, EntityTopology_ >, + protected SuperentityAccessLayerFamily< MeshConfig, Device, EntityTopology_ >, public MeshEntityIndex< typename MeshConfig::IdType > { static_assert( std::is_same< EntityTopology_, typename MeshTraits< MeshConfig, Device >::template EntityTraits< EntityTopology_::dimension >::EntityTopology >::value, @@ -92,15 +92,15 @@ class MeshEntity /**** * Subentities */ - using MeshSubentityAccess< MeshConfig, Device, EntityTopology_ >::getSubentitiesCount; - using MeshSubentityAccess< MeshConfig, Device, EntityTopology_ >::getSubentityIndex; - using MeshSubentityAccess< MeshConfig, Device, EntityTopology_ >::getSubentityOrientation; + using SubentityAccessLayerFamily< MeshConfig, Device, EntityTopology_ >::getSubentitiesCount; + using SubentityAccessLayerFamily< MeshConfig, Device, EntityTopology_ >::getSubentityIndex; + using SubentityAccessLayerFamily< MeshConfig, Device, EntityTopology_ >::getSubentityOrientation; /**** * Superentities */ - using MeshSuperentityAccess< MeshConfig, Device, EntityTopology_ >::getSuperentitiesCount; - using MeshSuperentityAccess< MeshConfig, Device, EntityTopology_ >::getSuperentityIndex; + using SuperentityAccessLayerFamily< MeshConfig, Device, EntityTopology_ >::getSuperentitiesCount; + using SuperentityAccessLayerFamily< MeshConfig, Device, EntityTopology_ >::getSuperentityIndex; /**** * Vertices @@ -113,17 +113,17 @@ class MeshEntity /**** * Methods for the mesh initialization */ - using MeshSubentityAccess< MeshConfig, Device, EntityTopology_ >::bindSubentitiesStorageNetwork; - using MeshSubentityAccess< MeshConfig, Device, EntityTopology_ >::setSubentityIndex; - using MeshSubentityAccess< MeshConfig, Device, EntityTopology_ >::subentityOrientationsArray; + using SubentityAccessLayerFamily< MeshConfig, Device, EntityTopology_ >::bindSubentitiesStorageNetwork; + using SubentityAccessLayerFamily< MeshConfig, Device, EntityTopology_ >::setSubentityIndex; + using SubentityAccessLayerFamily< MeshConfig, Device, EntityTopology_ >::subentityOrientationsArray; - using MeshSuperentityAccess< MeshConfig, Device, EntityTopology_ >::bindSuperentitiesStorageNetwork; - using MeshSuperentityAccess< MeshConfig, Device, EntityTopology_ >::setNumberOfSuperentities; - using MeshSuperentityAccess< MeshConfig, Device, EntityTopology_ >::setSuperentityIndex; + using SuperentityAccessLayerFamily< MeshConfig, Device, EntityTopology_ >::bindSuperentitiesStorageNetwork; + using SuperentityAccessLayerFamily< MeshConfig, Device, EntityTopology_ >::setNumberOfSuperentities; + using SuperentityAccessLayerFamily< MeshConfig, Device, EntityTopology_ >::setSuperentityIndex; friend Initializer< MeshConfig >; - friend MeshEntityStorageRebinder< Mesh< MeshConfig, DeviceType > >; + friend EntityStorageRebinder< Mesh< MeshConfig, DeviceType > >; template< typename Mesh, int Dimension > friend struct IndexPermutationApplier; @@ -134,7 +134,7 @@ class MeshEntity */ template< typename MeshConfig, typename Device > class MeshEntity< MeshConfig, Device, Topologies::Vertex > - : protected MeshSuperentityAccess< MeshConfig, Device, Topologies::Vertex >, + : protected SuperentityAccessLayerFamily< MeshConfig, Device, Topologies::Vertex >, public MeshEntityIndex< typename MeshConfig::IdType > { public: @@ -185,8 +185,8 @@ class MeshEntity< MeshConfig, Device, Topologies::Vertex > /**** * Superentities */ - using MeshSuperentityAccess< MeshConfig, Device, Topologies::Vertex >::getSuperentitiesCount; - using MeshSuperentityAccess< MeshConfig, Device, Topologies::Vertex >::getSuperentityIndex; + using SuperentityAccessLayerFamily< MeshConfig, Device, Topologies::Vertex >::getSuperentitiesCount; + using SuperentityAccessLayerFamily< MeshConfig, Device, Topologies::Vertex >::getSuperentityIndex; /**** * Points @@ -198,15 +198,15 @@ class MeshEntity< MeshConfig, Device, Topologies::Vertex > void setPoint( const PointType& point ); protected: - using MeshSuperentityAccess< MeshConfig, Device, Topologies::Vertex >::bindSuperentitiesStorageNetwork; - using MeshSuperentityAccess< MeshConfig, Device, Topologies::Vertex >::setNumberOfSuperentities; - using MeshSuperentityAccess< MeshConfig, Device, Topologies::Vertex >::setSuperentityIndex; + using SuperentityAccessLayerFamily< MeshConfig, Device, Topologies::Vertex >::bindSuperentitiesStorageNetwork; + using SuperentityAccessLayerFamily< MeshConfig, Device, Topologies::Vertex >::setNumberOfSuperentities; + using SuperentityAccessLayerFamily< MeshConfig, Device, Topologies::Vertex >::setSuperentityIndex; PointType point; friend Initializer< MeshConfig >; - friend MeshEntityStorageRebinder< Mesh< MeshConfig, DeviceType > >; + friend EntityStorageRebinder< Mesh< MeshConfig, DeviceType > >; template< typename Mesh, int Dimension > friend struct IndexPermutationApplier;