From 7d009faf9ae55bd20dddb4c80d432a576ef87bd5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= <klinkjak@fjfi.cvut.cz>
Date: Sun, 12 Nov 2017 01:01:10 +0100
Subject: [PATCH] Removed GlobalIndexType and LocalIndexType from the public
 interface of MeshEntityTraits

---
 .../EntityLayers/SubentityAccess.h            | 30 ++++++++++---------
 .../EntityLayers/SuperentityAccess.h          | 20 ++++++-------
 .../MeshDetails/MeshLayers/StorageLayer.h     |  4 +--
 .../MeshLayers/SubentityStorageLayer.h        |  3 +-
 .../MeshLayers/SuperentityStorageLayer.h      |  2 +-
 .../initializer/EntityInitializer.h           | 20 ++++++-------
 .../MeshDetails/traits/MeshEntityTraits.h     |  5 ++--
 .../MeshDetails/traits/MeshSubentityTraits.h  |  5 ++--
 .../traits/MeshSuperentityTraits.h            |  5 ++--
 src/TNL/Meshes/Readers/NetgenReader.h         |  2 +-
 src/UnitTests/Meshes/MeshOrderingTest.h       |  6 ++--
 11 files changed, 52 insertions(+), 50 deletions(-)

diff --git a/src/TNL/Meshes/MeshDetails/EntityLayers/SubentityAccess.h b/src/TNL/Meshes/MeshDetails/EntityLayers/SubentityAccess.h
index 3458ffc30e..1906ec4158 100644
--- a/src/TNL/Meshes/MeshDetails/EntityLayers/SubentityAccess.h
+++ b/src/TNL/Meshes/MeshDetails/EntityLayers/SubentityAccess.h
@@ -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,
diff --git a/src/TNL/Meshes/MeshDetails/EntityLayers/SuperentityAccess.h b/src/TNL/Meshes/MeshDetails/EntityLayers/SuperentityAccess.h
index 78372ba57f..9ffef4a607 100644
--- a/src/TNL/Meshes/MeshDetails/EntityLayers/SuperentityAccess.h
+++ b/src/TNL/Meshes/MeshDetails/EntityLayers/SuperentityAccess.h
@@ -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;
 
    /****
@@ -249,8 +249,8 @@ class SuperentityAccessLayer< MeshConfig,
    using DimensionTag = Meshes::DimensionTag< EntityTopology::dimension >;
 
 protected:
-   using GlobalIndexType         = typename MeshConfig::GlobalIndexType;
-   using LocalIndexType          = typename MeshConfig::LocalIndexType;
+   using GlobalIndexType = typename MeshConfig::GlobalIndexType;
+   using LocalIndexType  = typename MeshConfig::LocalIndexType;
 
    /***
     * Necessary because of 'using BaseType::...;' in the derived classes
diff --git a/src/TNL/Meshes/MeshDetails/MeshLayers/StorageLayer.h b/src/TNL/Meshes/MeshDetails/MeshLayers/StorageLayer.h
index c4bda9a551..af0db87757 100644
--- a/src/TNL/Meshes/MeshDetails/MeshLayers/StorageLayer.h
+++ b/src/TNL/Meshes/MeshDetails/MeshLayers/StorageLayer.h
@@ -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 >;
diff --git a/src/TNL/Meshes/MeshDetails/MeshLayers/SubentityStorageLayer.h b/src/TNL/Meshes/MeshDetails/MeshLayers/SubentityStorageLayer.h
index 0b2220aff5..c26e525a9c 100644
--- a/src/TNL/Meshes/MeshDetails/MeshLayers/SubentityStorageLayer.h
+++ b/src/TNL/Meshes/MeshDetails/MeshLayers/SubentityStorageLayer.h
@@ -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;
diff --git a/src/TNL/Meshes/MeshDetails/MeshLayers/SuperentityStorageLayer.h b/src/TNL/Meshes/MeshDetails/MeshLayers/SuperentityStorageLayer.h
index 86233ec99b..62d86fe7bf 100644
--- a/src/TNL/Meshes/MeshDetails/MeshLayers/SuperentityStorageLayer.h
+++ b/src/TNL/Meshes/MeshDetails/MeshLayers/SuperentityStorageLayer.h
@@ -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;
diff --git a/src/TNL/Meshes/MeshDetails/initializer/EntityInitializer.h b/src/TNL/Meshes/MeshDetails/initializer/EntityInitializer.h
index 92f14ecc9d..684e60543b 100644
--- a/src/TNL/Meshes/MeshDetails/initializer/EntityInitializer.h
+++ b/src/TNL/Meshes/MeshDetails/initializer/EntityInitializer.h
@@ -127,10 +127,10 @@ class EntityInitializerLayer< MeshConfig,
    using InitializerType            = Initializer< MeshConfig >;
    using MeshType                   = typename InitializerType::MeshType;
 
+   using GlobalIndexType            = typename MeshTraits< MeshConfig >::GlobalIndexType;
+   using LocalIndexType             = typename MeshTraits< MeshConfig >::LocalIndexType;
    using SuperentityTraitsType      = typename MeshTraits< MeshConfig >::template EntityTraits< SuperdimensionTag::value >;
    using SuperentityTopology        = typename SuperentityTraitsType::EntityTopology;
-   using GlobalIndexType            = typename SuperentityTraitsType::GlobalIndexType;
-   using LocalIndexType             = typename SuperentityTraitsType::LocalIndexType;
    using SubentitySeedsCreatorType  = SubentitySeedsCreator< MeshConfig, SuperdimensionTag, SubdimensionTag >;
    using SuperentityInitializerType = SuperentityStorageInitializer< MeshConfig, SubdimensionTag, SuperdimensionTag >;
 
@@ -187,10 +187,10 @@ class EntityInitializerLayer< MeshConfig,
    using InitializerType            = Initializer< MeshConfig >;
    using MeshType                   = typename InitializerType::MeshType;
 
+   using GlobalIndexType            = typename MeshTraits< MeshConfig >::GlobalIndexType;
+   using LocalIndexType             = typename MeshTraits< MeshConfig >::LocalIndexType;
    using SuperentityTraitsType      = typename MeshTraits< MeshConfig >::template EntityTraits< SuperdimensionTag::value >;
    using SuperentityTopology        = typename SuperentityTraitsType::EntityTopology;
-   using GlobalIndexType            = typename SuperentityTraitsType::GlobalIndexType;
-   using LocalIndexType             = typename SuperentityTraitsType::LocalIndexType;
    using SubentitySeedsCreatorType  = SubentitySeedsCreator< MeshConfig, SuperdimensionTag, SubdimensionTag >;
    using SuperentityInitializerType = SuperentityStorageInitializer< MeshConfig, SubdimensionTag, SuperdimensionTag >;
 
@@ -251,10 +251,10 @@ class EntityInitializerLayer< MeshConfig,
    using InitializerType           = Initializer< MeshConfig >;
    using MeshType                  = typename InitializerType::MeshType;
 
+   using GlobalIndexType           = typename MeshTraits< MeshConfig >::GlobalIndexType;
+   using LocalIndexType            = typename MeshTraits< MeshConfig >::LocalIndexType;
    using SuperentityTraitsType     = typename MeshTraits< MeshConfig >::template EntityTraits< SuperdimensionTag::value >;
    using SuperentityTopology       = typename SuperentityTraitsType::EntityTopology;
-   using GlobalIndexType           = typename SuperentityTraitsType::GlobalIndexType;
-   using LocalIndexType            = typename SuperentityTraitsType::LocalIndexType;
    using SubentitySeedsCreatorType = SubentitySeedsCreator< MeshConfig, SuperdimensionTag, SubdimensionTag >;
 
 public:
@@ -309,10 +309,10 @@ class EntityInitializerLayer< MeshConfig,
    using InitializerType           = Initializer< MeshConfig >;
    using MeshType                  = typename InitializerType::MeshType;
 
+   using GlobalIndexType           = typename MeshTraits< MeshConfig >::GlobalIndexType;
+   using LocalIndexType            = typename MeshTraits< MeshConfig >::LocalIndexType;
    using SuperentityTraitsType     = typename MeshTraits< MeshConfig >::template EntityTraits< SuperdimensionTag::value >;
    using SuperentityTopology       = typename SuperentityTraitsType::EntityTopology;
-   using GlobalIndexType           = typename SuperentityTraitsType::GlobalIndexType;
-   using LocalIndexType            = typename SuperentityTraitsType::LocalIndexType;
    using SubentitySeedsCreatorType = SubentitySeedsCreator< MeshConfig, SuperdimensionTag, SubdimensionTag >;
 
 public:
@@ -363,10 +363,10 @@ class EntityInitializerLayer< MeshConfig,
    using InitializerType            = Initializer< MeshConfig >;
    using MeshType                   = typename InitializerType::MeshType;
 
+   using GlobalIndexType            = typename MeshTraits< MeshConfig >::GlobalIndexType;
+   using LocalIndexType             = typename MeshTraits< MeshConfig >::LocalIndexType;
    using SuperentityTraitsType      = typename MeshTraits< MeshConfig >::template EntityTraits< SuperdimensionTag::value >;
    using SuperentityTopology        = typename SuperentityTraitsType::EntityTopology;
-   using GlobalIndexType            = typename SuperentityTraitsType::GlobalIndexType;
-   using LocalIndexType             = typename SuperentityTraitsType::LocalIndexType;
    using SubentitySeedsCreatorType  = SubentitySeedsCreator< MeshConfig, SuperdimensionTag, SubdimensionTag >;
    using SuperentityInitializerType = SuperentityStorageInitializer< MeshConfig, SubdimensionTag, SuperdimensionTag >;
 
diff --git a/src/TNL/Meshes/MeshDetails/traits/MeshEntityTraits.h b/src/TNL/Meshes/MeshDetails/traits/MeshEntityTraits.h
index 51fb817b55..31660471db 100644
--- a/src/TNL/Meshes/MeshDetails/traits/MeshEntityTraits.h
+++ b/src/TNL/Meshes/MeshDetails/traits/MeshEntityTraits.h
@@ -70,13 +70,12 @@ template< typename MeshConfig,
           int Dimension >
 class MeshEntityTraits
 {
+   using GlobalIndexType = typename MeshConfig::GlobalIndexType;
+
 public:
    static_assert( 0 <= Dimension && Dimension <= MeshConfig::meshDimension, "invalid dimension" );
 
-   using GlobalIndexType               = typename MeshConfig::GlobalIndexType;
-   using LocalIndexType                = typename MeshConfig::LocalIndexType;
    using EntityTopology                = typename EntityTopologyGetter< MeshConfig, DimensionTag< Dimension > >::Topology;
-
    using EntityType                    = MeshEntity< MeshConfig, Device, EntityTopology >;
    using SeedType                      = EntitySeed< MeshConfig, EntityTopology >;
    using ReferenceOrientationType      = MeshEntityReferenceOrientation< MeshConfig, EntityTopology >;
diff --git a/src/TNL/Meshes/MeshDetails/traits/MeshSubentityTraits.h b/src/TNL/Meshes/MeshDetails/traits/MeshSubentityTraits.h
index d04ff3f89f..70ed6ffcad 100644
--- a/src/TNL/Meshes/MeshDetails/traits/MeshSubentityTraits.h
+++ b/src/TNL/Meshes/MeshDetails/traits/MeshSubentityTraits.h
@@ -36,6 +36,9 @@ template< typename MeshConfig,
           int Dimension >
 class MeshSubentityTraits
 {
+   using GlobalIndexType = typename MeshConfig::GlobalIndexType;
+   using LocalIndexType  = typename MeshConfig::LocalIndexType;
+
 public:
    static_assert( 0 <= Dimension && Dimension <= MeshConfig::meshDimension, "invalid dimension" );
    static_assert( EntityTopology::dimension > Dimension, "Subentity dimension must be smaller than the entity dimension." );
@@ -44,8 +47,6 @@ public:
    static constexpr bool orientationEnabled = MeshConfig::subentityOrientationStorage( EntityTopology(), Dimension );
    static constexpr int count = Topologies::Subtopology< EntityTopology, Dimension >::count;
 
-   using GlobalIndexType   = typename MeshConfig::GlobalIndexType;
-   using LocalIndexType    = typename MeshConfig::LocalIndexType;
    using SubentityTopology = typename MeshEntityTraits< MeshConfig, Device, Dimension >::EntityTopology;
    using SubentityType     = typename MeshEntityTraits< MeshConfig, Device, Dimension >::EntityType;
    using Seed              = EntitySeed< MeshConfig, SubentityTopology >;
diff --git a/src/TNL/Meshes/MeshDetails/traits/MeshSuperentityTraits.h b/src/TNL/Meshes/MeshDetails/traits/MeshSuperentityTraits.h
index a26761b33e..0b5d3e831f 100644
--- a/src/TNL/Meshes/MeshDetails/traits/MeshSuperentityTraits.h
+++ b/src/TNL/Meshes/MeshDetails/traits/MeshSuperentityTraits.h
@@ -29,14 +29,15 @@ template< typename MeshConfig,
           int Dimension >
 class MeshSuperentityTraits
 {
+   using GlobalIndexType = typename MeshConfig::GlobalIndexType;
+   using LocalIndexType  = typename MeshConfig::LocalIndexType;
+
 public:
    static_assert( 0 <= Dimension && Dimension <= MeshConfig::meshDimension, "invalid dimension" );
    static_assert( EntityTopology::dimension < Dimension, "Superentity dimension must be higher than the entity dimension." );
 
    static constexpr bool storageEnabled = MeshConfig::template superentityStorage< EntityTopology >( EntityTopology(), Dimension );
 
-   using GlobalIndexType     = typename MeshConfig::GlobalIndexType;
-   using LocalIndexType      = typename MeshConfig::LocalIndexType;
    using SuperentityTopology = typename MeshEntityTraits< MeshConfig, Device, Dimension >::EntityTopology;
    using SuperentityType     = typename MeshEntityTraits< MeshConfig, Device, Dimension >::EntityType;
 
diff --git a/src/TNL/Meshes/Readers/NetgenReader.h b/src/TNL/Meshes/Readers/NetgenReader.h
index fda934926a..f9674e1554 100644
--- a/src/TNL/Meshes/Readers/NetgenReader.h
+++ b/src/TNL/Meshes/Readers/NetgenReader.h
@@ -176,7 +176,7 @@ public:
          return false;
       getline( inputFile, line );
       iss.str( line );
-      typedef typename MeshType::MeshTraitsType::template EntityTraits< 0 >::GlobalIndexType VertexIndexType;
+      typedef typename MeshType::Config::GlobalIndexType VertexIndexType;
       VertexIndexType pointsCount;
       iss >> pointsCount;
       meshBuilder.setPointsCount( pointsCount );
diff --git a/src/UnitTests/Meshes/MeshOrderingTest.h b/src/UnitTests/Meshes/MeshOrderingTest.h
index ceb985d2e9..c34cb780aa 100644
--- a/src/UnitTests/Meshes/MeshOrderingTest.h
+++ b/src/UnitTests/Meshes/MeshOrderingTest.h
@@ -247,7 +247,7 @@ TEST( MeshOrderingTest, OrderingOnHost )
    MeshHost mesh;
    ASSERT_TRUE( buildTriangleMesh( mesh ) );
 
-   using PermutationVector = typename MeshHost::IndexPermutationVector;
+   using PermutationVector = typename MeshHost::GlobalIndexVector;
    PermutationVector vertexIdentity, edgeIdentity, cellIdentity,
                      vertexPermutation, edgePermutation, cellPermutation,
                      vertexInversePermutation, edgeInversePermutation, cellInversePermutation;
@@ -282,7 +282,7 @@ TEST( MeshOrderingTest, OrderingOnCuda )
    ASSERT_TRUE( buildTriangleMesh( meshHost ) );
    mesh = meshHost;
 
-   using PermutationCuda = typename MeshCuda::IndexPermutationVector;
+   using PermutationCuda = typename MeshCuda::GlobalIndexVector;
    PermutationCuda vertexIdentity, edgeIdentity, cellIdentity,
                    vertexPermutation, edgePermutation, cellPermutation,
                    vertexInversePermutation, edgeInversePermutation, cellInversePermutation;
@@ -303,7 +303,7 @@ TEST( MeshOrderingTest, OrderingOnCuda )
    // test is on host
    {
       // local scope so we can use the same names
-      using PermutationVector = typename MeshHost::IndexPermutationVector;
+      using PermutationVector = typename MeshHost::GlobalIndexVector;
       PermutationVector vertexIdentity, edgeIdentity, cellIdentity,
                         vertexPermutation, edgePermutation, cellPermutation,
                         vertexInversePermutation, edgeInversePermutation, cellInversePermutation;
-- 
GitLab