From 005a9cb5fddf6aae46838fd35c65385479bcfc67 Mon Sep 17 00:00:00 2001
From: Michael Kuron <mkuron@icp.uni-stuttgart.de>
Date: Fri, 6 Mar 2020 14:57:03 +0100
Subject: [PATCH] clean up flattened fields code

---
 src/field/GhostLayerField.h               | 14 +++++++-------
 src/field/GhostLayerField.impl.h          |  6 +++---
 src/field/blockforest/BlockDataHandling.h |  4 ++--
 tests/field/AddToStorageTest.cpp          |  4 ++--
 4 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/field/GhostLayerField.h b/src/field/GhostLayerField.h
index 7ab587975..e6c8b454c 100644
--- a/src/field/GhostLayerField.h
+++ b/src/field/GhostLayerField.h
@@ -70,7 +70,7 @@ namespace field {
       typedef typename std::conditional<VectorTrait<T>::F_SIZE!=0,
                                         GhostLayerField<typename VectorTrait<T>::OutputType, VectorTrait<T>::F_SIZE*fSize_>,
                                         GhostLayerField<T, fSize_>
-                                        >::type FlattenedGhostLayerField;
+                                        >::type FlattenedField;
       //@}
       //****************************************************************************************************************
 
@@ -102,7 +102,7 @@ namespace field {
                  const shared_ptr<FieldAllocator<T> > &alloc = shared_ptr<FieldAllocator<T> >() );
 
 
-      virtual void resize( uint_t xSize, uint_t ySize, uint_t zSize ) override;
+      virtual void resize( uint_t xSize, uint_t ySize, uint_t zSize );
               void resize( uint_t xSize, uint_t ySize, uint_t zSize, uint_t gl );
 
       using Field<T,fSize_>::resize;
@@ -110,7 +110,7 @@ namespace field {
       inline GhostLayerField<T,fSize_> * clone()              const;
       inline GhostLayerField<T,fSize_> * cloneUninitialized() const;
       inline GhostLayerField<T,fSize_> * cloneShallowCopy()   const;
-      inline FlattenedGhostLayerField * flattenedShallowCopy() const;
+      inline FlattenedField * flattenedShallowCopy() const;
       //@}
       //****************************************************************************************************************
 
@@ -200,8 +200,8 @@ namespace field {
       /*! \name Slicing */
       //@{
       GhostLayerField<T,fSize_> * getSlicedField( const CellInterval & interval ) const;
-      virtual void slice           ( const CellInterval & interval ) override;
-      virtual void shiftCoordinates( cell_idx_t cx, cell_idx_t cy, cell_idx_t cz ) override;
+      virtual void slice           ( const CellInterval & interval );
+      virtual void shiftCoordinates( cell_idx_t cx, cell_idx_t cy, cell_idx_t cz );
       //@}
       //****************************************************************************************************************
 
@@ -214,8 +214,8 @@ namespace field {
       //** Shallow Copy ************************************************************************************************
       /*! \name Shallow Copy */
       //@{
-      virtual Field<T,fSize_> * cloneShallowCopyInternal()   const override;
-      virtual typename Field<T,fSize_>::FlattenedField * flattenedShallowCopyInternal() const override;
+      virtual Field<T,fSize_> * cloneShallowCopyInternal()   const;
+      virtual typename Field<T,fSize_>::FlattenedField * flattenedShallowCopyInternal() const;
       GhostLayerField(const GhostLayerField<T,fSize_> & other);
       template <typename T2, uint_t fSize2>
       GhostLayerField(const GhostLayerField<T2, fSize2> & other);
diff --git a/src/field/GhostLayerField.impl.h b/src/field/GhostLayerField.impl.h
index 3ccbcb8c3..5a8c6cc7a 100644
--- a/src/field/GhostLayerField.impl.h
+++ b/src/field/GhostLayerField.impl.h
@@ -724,7 +724,7 @@ namespace field {
    template<typename T, uint_t fSize_>
    typename Field<T,fSize_>::FlattenedField * GhostLayerField<T,fSize_>::flattenedShallowCopyInternal() const
    {
-      return new GhostLayerField<T,fSize_>::FlattenedGhostLayerField(*this);
+      return new GhostLayerField<T,fSize_>::FlattenedField(*this);
    }
 
 
@@ -747,9 +747,9 @@ namespace field {
    }
 
    template<typename T, uint_t fSize_>
-   typename GhostLayerField<T,fSize_>::FlattenedGhostLayerField * GhostLayerField<T,fSize_>::flattenedShallowCopy() const
+   typename GhostLayerField<T,fSize_>::FlattenedField * GhostLayerField<T,fSize_>::flattenedShallowCopy() const
    {
-      return dynamic_cast<GhostLayerField<T,fSize_>::FlattenedGhostLayerField* > (Field<T,fSize_>::flattenedShallowCopy() );
+      return dynamic_cast<GhostLayerField<T,fSize_>::FlattenedField* > (Field<T,fSize_>::flattenedShallowCopy() );
    }
 
    template<typename T, uint_t fSize_>
diff --git a/src/field/blockforest/BlockDataHandling.h b/src/field/blockforest/BlockDataHandling.h
index 711259355..dc6328a66 100644
--- a/src/field/blockforest/BlockDataHandling.h
+++ b/src/field/blockforest/BlockDataHandling.h
@@ -542,7 +542,7 @@ private:
 
 
 template< typename Field_T >
-class FlattenedShallowCopyBlockDataHandling : public blockforest::AlwaysInitializeBlockDataHandling< typename Field_T::FlattenedGhostLayerField >
+class FlattenedShallowCopyBlockDataHandling : public blockforest::AlwaysInitializeBlockDataHandling< typename Field_T::FlattenedField >
 {
 public:
 
@@ -550,7 +550,7 @@ public:
       fieldToClone_( fieldToClone )
    {}
 
-   typename Field_T::FlattenedGhostLayerField * initialize( IBlock * const block )
+   typename Field_T::FlattenedField * initialize( IBlock * const block )
    {
       const Field_T * toClone = block->template getData< Field_T >( fieldToClone_ );
       return toClone->flattenedShallowCopy();
diff --git a/tests/field/AddToStorageTest.cpp b/tests/field/AddToStorageTest.cpp
index 2117f7557..270826cea 100644
--- a/tests/field/AddToStorageTest.cpp
+++ b/tests/field/AddToStorageTest.cpp
@@ -49,7 +49,7 @@ int main( int argc, char ** argv )
    {
       VectorField * field = blockIt->getData<VectorField>( fieldID );
 
-      for( auto cellIt = field->beginXYZ(); cellIt != field->end(); ++cellIt )
+      for( auto cellIt = field->beginWithGhostLayerXYZ(); cellIt != field->end(); ++cellIt )
       {
          for( uint_t f = 0; f < 3; ++f)
          {
@@ -67,7 +67,7 @@ int main( int argc, char ** argv )
       FlattenedField * flattened = blockIt->getData<FlattenedField>( flattenedID );
       VectorField * copy = blockIt->getData<VectorField>( copyID );
 
-      for( auto cellIt = field->beginXYZ(); cellIt != field->end(); ++cellIt )
+      for( auto cellIt = field->beginWithGhostLayerXYZ(); cellIt != field->end(); ++cellIt )
       {
          for( uint_t f = 0; f < 3; ++f)
          {
-- 
GitLab