Commit 7d009faf authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Removed GlobalIndexType and LocalIndexType from the public interface of MeshEntityTraits

parent ec4fa43c
Loading
Loading
Loading
Loading
+16 −14
Original line number Diff line number Diff line
@@ -60,15 +60,15 @@ public:
   }

   template< int Subdimension >
   static constexpr typename SubentityTraits< Subdimension >::LocalIndexType getSubentitiesCount()
   static constexpr typename MeshTraitsType::LocalIndexType getSubentitiesCount()
   {
      return SubentityTraits< Subdimension >::count;
   }

   template< int Subdimension >
   __cuda_callable__
   void setSubentityIndex( const typename SubentityTraits< Subdimension >::LocalIndexType& localIndex,
                           const typename SubentityTraits< Subdimension >::GlobalIndexType& globalIndex )
   void setSubentityIndex( const typename MeshTraitsType::LocalIndexType& localIndex,
                           const typename MeshTraitsType::GlobalIndexType& globalIndex )
   {
      static_assert( SubentityTraits< Subdimension >::storageEnabled, "You try to set subentity which is not configured for storage." );
      BaseType::setSubentityIndex( Meshes::DimensionTag< Subdimension >(),
@@ -78,8 +78,8 @@ public:

   template< int Subdimension >
   __cuda_callable__
   typename SubentityTraits< Subdimension >::GlobalIndexType
   getSubentityIndex( const typename SubentityTraits< Subdimension >::LocalIndexType localIndex ) const
   typename MeshTraitsType::GlobalIndexType
   getSubentityIndex( const typename MeshTraitsType::LocalIndexType localIndex ) const
   {
      static_assert( SubentityTraits< Subdimension >::storageEnabled, "You try to get subentity which is not configured for storage." );
      return BaseType::getSubentityIndex( Meshes::DimensionTag< Subdimension >(),
@@ -96,7 +96,7 @@ public:

   template< int Subdimension >
   __cuda_callable__
   typename SubentityTraits< Subdimension >::IdPermutationArrayType getSubentityOrientation( typename SubentityTraits< Subdimension >::LocalIndexType index ) const
   typename SubentityTraits< Subdimension >::IdPermutationArrayType getSubentityOrientation( typename MeshTraitsType::LocalIndexType index ) const
   {
      static_assert( SubentityTraits< Subdimension >::orientationEnabled, "You try to get subentity orientation which is not configured for storage." );
      return BaseType::getSubentityOrientation( Meshes::DimensionTag< Subdimension >(), index );
@@ -139,8 +139,8 @@ class SubentityAccessLayer< MeshConfig,
   using SubentityTraitsType    = typename MeshTraitsType::template SubentityTraits< EntityTopology, DimensionTag::value >;

protected:
   using GlobalIndexType        = typename SubentityTraitsType::GlobalIndexType;
   using LocalIndexType         = typename SubentityTraitsType::LocalIndexType;
   using GlobalIndexType        = typename MeshTraitsType::GlobalIndexType;
   using LocalIndexType         = typename MeshTraitsType::LocalIndexType;
   using SubentityAccessorType  = typename SubentityTraitsType::SubentityAccessorType;
   using OrientationArrayType   = typename SubentityTraitsType::OrientationArrayType;
   using IdPermutationArrayType = typename SubentityTraitsType::IdPermutationArrayType;
@@ -263,8 +263,8 @@ class SubentityAccessLayer< MeshConfig,
   using SubentityTraitsType   = typename MeshTraitsType::template SubentityTraits< EntityTopology, DimensionTag::value >;

protected:
   using GlobalIndexType       = typename SubentityTraitsType::GlobalIndexType;
   using LocalIndexType        = typename SubentityTraitsType::LocalIndexType;
   using GlobalIndexType       = typename MeshTraitsType::GlobalIndexType;
   using LocalIndexType        = typename MeshTraitsType::LocalIndexType;
   using SubentityAccessorType = typename SubentityTraitsType::SubentityAccessorType;

   SubentityAccessLayer() = default;
@@ -360,6 +360,9 @@ class SubentityAccessLayer< MeshConfig,
   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
    */
@@ -368,11 +371,9 @@ protected:
   void bindSubentitiesStorageNetwork( DimensionTag,
                                       const SubentityAccessorType& storage ) {}
   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,
@@ -407,6 +408,9 @@ class SubentityAccessLayer< MeshConfig,
                            false >
{
protected:
   using GlobalIndexType = typename MeshConfig::GlobalIndexType;
   using LocalIndexType  = typename MeshConfig::LocalIndexType;

   /***
    * Necessary because of 'using BaseType::...;' in the derived classes
    */
@@ -416,11 +420,9 @@ protected:
                                       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,
+10 −10
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ public:

   template< int Superdimension >
   __cuda_callable__
   void setNumberOfSuperentities( const typename SuperentityTraits< Superdimension >::LocalIndexType size )
   void setNumberOfSuperentities( const typename MeshTraitsType::LocalIndexType size )
   {
      static_assert( SuperentityTraits< Superdimension >::storageEnabled, "You try to set number of superentities which are not configured for storage." );
      BaseType::setNumberOfSuperentities( Meshes::DimensionTag< Superdimension >(),
@@ -70,7 +70,7 @@ public:

   template< int Superdimension >
   __cuda_callable__
   typename SuperentityTraits< Superdimension >::LocalIndexType
   typename MeshTraitsType::LocalIndexType
   getSuperentitiesCount() const
   {
      static_assert( SuperentityTraits< Superdimension >::storageEnabled, "You try to get number of superentities which are not configured for storage." );
@@ -80,8 +80,8 @@ public:
   template< int Superdimension >
   __cuda_callable__
   void
   setSuperentityIndex( const typename SuperentityTraits< Superdimension >::LocalIndexType& localIndex,
                        const typename SuperentityTraits< Superdimension >::GlobalIndexType& globalIndex )
   setSuperentityIndex( const typename MeshTraitsType::LocalIndexType& localIndex,
                        const typename MeshTraitsType::GlobalIndexType& globalIndex )
   {
      static_assert( SuperentityTraits< Superdimension >::storageEnabled, "You try to set superentities which are not configured for storage." );
      BaseType::setSuperentityIndex( Meshes::DimensionTag< Superdimension >(),
@@ -91,8 +91,8 @@ public:

   template< int Superdimension >
   __cuda_callable__
   typename SuperentityTraits< Superdimension >::GlobalIndexType
   getSuperentityIndex( const typename SuperentityTraits< Superdimension >::LocalIndexType localIndex ) const
   typename MeshTraitsType::GlobalIndexType
   getSuperentityIndex( const typename MeshTraitsType::LocalIndexType localIndex ) const
   {
      static_assert( SuperentityTraits< Superdimension >::storageEnabled, "You try to get superentities which are not configured for storage." );
      return BaseType::getSuperentityIndex( Meshes::DimensionTag< Superdimension >(),
@@ -127,8 +127,8 @@ class SuperentityAccessLayer< MeshConfig,
   using SuperentityTraitsType = typename MeshTraitsType::template SuperentityTraits< EntityTopology, DimensionTag::value >;

public:
   using GlobalIndexType         = typename SuperentityTraitsType::GlobalIndexType;
   using LocalIndexType          = typename SuperentityTraitsType::LocalIndexType;
   using GlobalIndexType         = typename MeshTraitsType::GlobalIndexType;
   using LocalIndexType          = typename MeshTraitsType::LocalIndexType;
   using SuperentityAccessorType = typename SuperentityTraitsType::SuperentityAccessorType;

   /****
+2 −2
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ public:

protected:
   template< int Dimension >
   void setEntitiesCount( const typename EntityTraits< Dimension >::GlobalIndexType& entitiesCount )
   void setEntitiesCount( const typename MeshTraitsType::GlobalIndexType& entitiesCount )
   {
      static_assert( EntityTraits< Dimension >::storageEnabled, "You try to set number of entities which are not configured for storage." );
      BaseType::setEntitiesCount( DimensionTag< Dimension >(), entitiesCount );
@@ -97,9 +97,9 @@ class StorageLayer< MeshConfig,
public:
   using BaseType = StorageLayer< MeshConfig, Device, typename DimensionTag::Increment >;
   using MeshTraitsType   = MeshTraits< MeshConfig, Device >;
   using GlobalIndexType  = typename MeshTraitsType::GlobalIndexType;
   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 = SubentityStorageLayerFamily< MeshConfig, Device, EntityTopology >;
+1 −2
Original line number Diff line number Diff line
@@ -71,8 +71,7 @@ class SubentityStorageLayer< MeshConfig,
   using SubentityTraitsType = typename MeshTraitsType::template SubentityTraits< EntityTopology, SubdimensionTag::value >;

protected:
   using GlobalIndexType    = typename SubentityTraitsType::GlobalIndexType;
   using LocalIndexType     = typename SubentityTraitsType::LocalIndexType;
   using GlobalIndexType    = typename MeshTraitsType::GlobalIndexType;
   using StorageNetworkType = typename SubentityTraitsType::StorageNetworkType;

   SubentityStorageLayer() = default;
+1 −1
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ class SuperentityStorageLayer< MeshConfig, Device, EntityTopology, Superdimensio
   using SuperentityTraitsType = typename MeshTraitsType::template SuperentityTraits< EntityTopology, SuperdimensionTag::value >;

protected:
   using GlobalIndexType    = typename SuperentityTraitsType::GlobalIndexType;
   using GlobalIndexType    = typename MeshTraitsType::GlobalIndexType;
   using StorageNetworkType = typename SuperentityTraitsType::StorageNetworkType;
 
   SuperentityStorageLayer() = default;
Loading