From f9a47060ff35b0df6e5d9908f5c7bcc9f9d43a20 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= <klinkjak@fjfi.cvut.cz>
Date: Tue, 18 Oct 2016 20:05:06 +0200
Subject: [PATCH] Cosmetic changes in meshes

---
 .../layers/MeshSuperentityAccess.h            | 26 +++++++++----------
 .../layers/MeshSuperentityStorageLayer.h      | 18 +++++++------
 .../traits/MeshSuperentityTraits.h            |  2 +-
 3 files changed, 24 insertions(+), 22 deletions(-)

diff --git a/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityAccess.h b/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityAccess.h
index 3cbe770e91..78af104b41 100644
--- a/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityAccess.h
+++ b/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityAccess.h
@@ -51,37 +51,37 @@ class MeshSuperentityAccess
 
 template< typename MeshConfig,
           typename MeshEntity,
-          typename Dimension >
+          typename DimensionsTag >
 class MeshSuperentityAccessLayer< MeshConfig,
                                   MeshEntity,
-                                  Dimensions,
+                                  DimensionsTag,
                                   true >
-   : public MeshSuperentityAccessLayer< MeshConfig, MeshEntity, typename Dimensions::Decrement >
+   : public MeshSuperentityAccessLayer< MeshConfig, MeshEntity, typename DimensionsTag::Decrement >
 {
-	typedef MeshSuperentityAccessLayer< MeshConfig, MeshEntity, typename Dimension::Decrement > BaseType;
+	typedef MeshSuperentityAccessLayer< MeshConfig, MeshEntity, typename DimensionsTag::Decrement > BaseType;
 
    public:
       typedef MeshTraits< MeshConfig >                                                             MeshTraitsType;
-      typedef typename MeshTraitsType::template SuperentityTraits< MeshEntity, Dimension::value > SuperentityTraitsType;
+      typedef typename MeshTraitsType::template SuperentityTraits< MeshEntity, DimensionsTag::value > SuperentityTraitsType;
       typedef typename MeshTraitsType::IdArrayAccessorType                                         IdArrayAccessorType;
       typedef typename SuperentityTraitsType::StorageNetworkType                                   StorageNetworkType;
       typedef typename SuperentityTraitsType::SuperentityAccessorType                              SuperentityAccessorType;
       //typedef typename StorageNetworkType::PortsType                            SuperentityAccessorType;
 
 	   using BaseType::superentityIds;
-	   IdArrayAccessorType superentityIds( Dimension ) const { return m_superentityIndices; }
+	   IdArrayAccessorType superentityIds( DimensionsTag ) const { return m_superentityIndices; }
 
 	   using BaseType::superentityIdsArray;
-	   IdArrayAccessorType &superentityIdsArray( Dimension ) { return m_superentityIndices; }
+	   IdArrayAccessorType &superentityIdsArray( DimensionsTag ) { return m_superentityIndices; }
  
       using BaseType::getSuperentityIndices;
-      const SuperentityAccessorType& getSuperentityIndices( Dimension ) const
+      const SuperentityAccessorType& getSuperentityIndices( DimensionsTag ) const
       {
          std::cerr << "###" << std::endl;
          return this->superentityIndices;
       }
  
-      SuperentityAccessorType& getSuperentityIndices( Dimension )
+      SuperentityAccessorType& getSuperentityIndices( DimensionsTag )
       {
          std::cerr << "######" << std::endl;
          return this->superentityIndices;
@@ -89,7 +89,7 @@ class MeshSuperentityAccessLayer< MeshConfig,
  
       void print( std::ostream& str ) const
       {
-         str << "Superentities with " << Dimension::value << " dimensions are: " <<
+         str << "Superentities with " << DimensionsTag::value << " dimensions are: " <<
             this->superentityIndices << std::endl;
          BaseType::print( str );
       }
@@ -104,12 +104,12 @@ class MeshSuperentityAccessLayer< MeshConfig,
 
 template< typename MeshConfig,
           typename MeshEntity,
-          typename Dimension >
+          typename DimensionsTag >
 class MeshSuperentityAccessLayer< MeshConfig,
                                   MeshEntity,
-                                  Dimensions,
+                                  DimensionsTag,
                                   false >
-   : public MeshSuperentityAccessLayer< MeshConfig, MeshEntity, typename Dimensions::Decrement >
+   : public MeshSuperentityAccessLayer< MeshConfig, MeshEntity, typename DimensionsTag::Decrement >
 {
 };
 
diff --git a/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityStorageLayer.h b/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityStorageLayer.h
index 902a3e4f07..5b7525d581 100644
--- a/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityStorageLayer.h
+++ b/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityStorageLayer.h
@@ -166,8 +166,10 @@ protected:
 private:
     StorageArrayType superentitiesIndices;
 
+    // TODO: removed even from MeshSubentityStorageLayer
     AccessArrayType sharedSuperentitiesIndices;
  
+    // TODO: unused???
     StorageNetworkType storageNetwork;
  
    // TODO: this is only for the mesh initializer - fix it
@@ -200,7 +202,7 @@ class MeshSuperentityStorageLayer< MeshConfig, EntityTopology, MeshDimensionTag<
    static const int Dimensions = EntityTopology::dimensions;
    typedef MeshDimensionsTag< EntityTopology::dimensions >     DimensionsTag;
 
-   typedef MeshSuperentityTraits< MeshConfig, EntityTopology, Dimension >      SuperentityTraits;
+   typedef MeshSuperentityTraits< MeshConfig, EntityTopology, Dimensions >      SuperentityTraitsType;
 
    typedef MeshSuperentityStorageLayer< MeshConfig,
                                         EntityTopology,
@@ -208,12 +210,12 @@ class MeshSuperentityStorageLayer< MeshConfig, EntityTopology, MeshDimensionTag<
                                         false > ThisType;
 
 protected:
-   typedef typename SuperentityTraits::ContainerType           ContainerType;
-   typedef typename ContainerType::ElementType                 GlobalIndexType;
-   // FIXME: take it from MeshConfig or something
-   typedef int                                                 LocalIndexType;
+   typedef typename SuperentityTraitsType::StorageArrayType       StorageArrayType;
+   typedef typename SuperentityTraitsType::AccessArrayType        AccessArrayType;
+   typedef typename SuperentityTraitsType::GlobalIndexType        GlobalIndexType;
+   typedef typename SuperentityTraitsType::LocalIndexType         LocalIndexType;
 
-   typedef typename SuperentityTraits::StorageNetworkType      StorageNetworkType;
+   typedef typename SuperentityTraitsType::StorageNetworkType     StorageNetworkType;
  
    /****
     * These methods are due to 'using BaseType::...;' in the derived classes.
@@ -234,9 +236,9 @@ protected:
       return true;
    }
 
-   ContainerType& getSuperentityIndices() {}
+   AccessArrayType& getSuperentityIndices() {}
 
-   const ContainerType& getSuperentityIndices() const {}
+   const AccessArrayType& getSuperentityIndices() const {}
 
    bool save( File& file ) const
    {
diff --git a/src/TNL/Meshes/MeshDetails/traits/MeshSuperentityTraits.h b/src/TNL/Meshes/MeshDetails/traits/MeshSuperentityTraits.h
index ad5ede2e3e..a70cc109d2 100644
--- a/src/TNL/Meshes/MeshDetails/traits/MeshSuperentityTraits.h
+++ b/src/TNL/Meshes/MeshDetails/traits/MeshSuperentityTraits.h
@@ -57,7 +57,7 @@ class MeshSuperentityTraits
    typedef MeshSuperentityAccessor< typename StorageNetworkType::ValuesAccessorType > SuperentityAccessorType;
  
    /****
-    * Type for passing the superentities indecis by the getSuperentityIndices()
+    * Type for passing the superentities indices by the getSuperentityIndices()
     * method. We introduce it because of the compatibility with the subentities
     * which are usually stored in static array.
     */
-- 
GitLab