From 762f9972c3edb8082fd36f1296cadc47a6f20e3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= <klinkjak@fjfi.cvut.cz> Date: Sat, 15 Oct 2016 17:57:40 +0200 Subject: [PATCH] Readability edits in Meshes/ --- src/TNL/Meshes/DummyMesh.h | 6 +- src/TNL/Meshes/Mesh.h | 12 +- src/TNL/Meshes/MeshConfigBase.h | 10 +- .../MeshEntityReferenceOrientation.h | 8 +- src/TNL/Meshes/MeshDetails/MeshEntity_impl.h | 22 +- .../Meshes/MeshDetails/layers/CMakeLists.txt | 4 +- .../MeshDetails/layers/MeshStorageLayer.h | 69 ++-- .../layers/MeshSubentityStorageLayer.h | 119 ++++--- .../layers/MeshSuperentityAccess.h | 47 ++- .../layers/MeshSuperentityAccessor.h | 7 +- .../layers/MeshSuperentityStorageLayer.h | 300 +++++++++--------- .../Meshes/MeshDetails/traits/MeshTraits.h | 47 ++- src/TNL/Meshes/MeshEntity.h | 33 +- 13 files changed, 332 insertions(+), 352 deletions(-) diff --git a/src/TNL/Meshes/DummyMesh.h b/src/TNL/Meshes/DummyMesh.h index ce4cd0bf42..80d2d6153c 100644 --- a/src/TNL/Meshes/DummyMesh.h +++ b/src/TNL/Meshes/DummyMesh.h @@ -10,6 +10,9 @@ #pragma once +#include <TNL/String.h> +#include <TNL/Devices/Host.h> + namespace TNL { namespace Meshes { @@ -18,8 +21,7 @@ template< typename Real = double, typename Index = int > class DummyMesh { - public: - +public: typedef Real RealType; typedef Device DeviceType; typedef Index IndexType; diff --git a/src/TNL/Meshes/Mesh.h b/src/TNL/Meshes/Mesh.h index 47060304a5..999bedb53d 100644 --- a/src/TNL/Meshes/Mesh.h +++ b/src/TNL/Meshes/Mesh.h @@ -65,8 +65,8 @@ class Mesh : public Object/*, const CellType& getCell( const GlobalIndexType entityIndex ) const; - template< int Dimension > - EntityType< Dimension >& getEntity( const GlobalIndexType entityIndex ); + template< int Dimensions > + EntityType< Dimensions >& getEntity( const GlobalIndexType entityIndex ); template< int Dimension > const EntityType< Dimension >& getEntity( const GlobalIndexType entityIndex ) const; @@ -83,12 +83,12 @@ class Mesh : public Object/*, bool operator==( const Mesh& mesh ) const; // TODO: this is only for mesh intializer - remove it if possible - template< typename DimensionTag > - typename EntityTraits< DimensionTag::value >::StorageArrayType& entitiesArray(); + template< typename DimensionsTag > + typename EntityTraits< DimensionsTag::value >::StorageArrayType& entitiesArray(); - template< typename DimensionTag, typename SuperDimensionTag > - typename MeshTraits< MeshConfig >::GlobalIdArrayType& superentityIdsArray(); + template< typename DimensionsTag, typename SuperDimensionsTag > + typename MeshTraits< MeshConfig >::GlobalIdArrayType& superentityIdsArray(); template< typename EntityTopology, typename SuperdimensionsTag > typename MeshTraitsType::template SuperentityTraits< EntityTopology, SuperdimensionsTag::value >::StorageNetworkType& diff --git a/src/TNL/Meshes/MeshConfigBase.h b/src/TNL/Meshes/MeshConfigBase.h index 523afce5b6..cad2bb1c92 100644 --- a/src/TNL/Meshes/MeshConfigBase.h +++ b/src/TNL/Meshes/MeshConfigBase.h @@ -16,6 +16,8 @@ #pragma once +#include <TNL/String.h> + namespace TNL { namespace Meshes { @@ -39,8 +41,10 @@ struct MeshConfigBase typedef LocalIndex LocalIndexType; typedef Id IdType; - static const int worldDimension = WorldDimension; - static const int meshDimension = Cell::dimensions; + static const int worldDimensions = WorldDimensions; + static const int meshDimensions = Cell::dimensions; + + static_assert( worldDimensions >= meshDimensions, "The cell dimension cannot be larger than the world dimension." ); static String getType() { @@ -91,8 +95,6 @@ struct MeshConfigBase return true; //return false; } - - static_assert( WorldDimension >= Cell::dimensions, "The number of the cell dimensions cannot be larger than the world dimension." ); }; } // namespace Meshes diff --git a/src/TNL/Meshes/MeshDetails/MeshEntityReferenceOrientation.h b/src/TNL/Meshes/MeshDetails/MeshEntityReferenceOrientation.h index bad26901bc..4a8279555f 100644 --- a/src/TNL/Meshes/MeshDetails/MeshEntityReferenceOrientation.h +++ b/src/TNL/Meshes/MeshDetails/MeshEntityReferenceOrientation.h @@ -16,6 +16,10 @@ #pragma once +#include <map> + +#include <TNL/Meshes/MeshDetails/MeshEntityOrientation.h> + namespace TNL { namespace Meshes { @@ -26,8 +30,8 @@ class MeshEntityReferenceOrientation typedef typename MeshTraits< MeshConfig >::GlobalIndexType GlobalIndexType; public: - typedef MeshEntitySeed< MeshConfig, EntityTopology > SeedType; - typedef MeshEntityOrientation< MeshConfig, EntityTopology > EntityOrientation; + typedef MeshEntitySeed< MeshConfig, EntityTopology > SeedType; + typedef MeshEntityOrientation< MeshConfig, EntityTopology > EntityOrientation; MeshEntityReferenceOrientation() = default; diff --git a/src/TNL/Meshes/MeshDetails/MeshEntity_impl.h b/src/TNL/Meshes/MeshDetails/MeshEntity_impl.h index 9e9ff9b8aa..cbbcbed652 100644 --- a/src/TNL/Meshes/MeshDetails/MeshEntity_impl.h +++ b/src/TNL/Meshes/MeshDetails/MeshEntity_impl.h @@ -109,7 +109,7 @@ operator==( const MeshEntity& entity ) const return ( MeshSubentityStorageLayers< MeshConfig, EntityTopology >::operator==( entity ) && MeshSuperentityAccess< MeshConfig, EntityTopology >::operator==( entity ) && MeshEntityId< typename MeshConfig::IdType, - typename MeshConfig::GlobalIndexType >::operator==( entity ) ); + typename MeshConfig::GlobalIndexType >::operator==( entity ) ); } template< typename MeshConfig, @@ -152,11 +152,10 @@ MeshEntity< MeshConfig, EntityTopology >:: getSubentityIndex( const LocalIndexType localIndex) const { static_assert( SubentityTraits< Subdimensions >::storageEnabled, "You try to get subentity which is not configured for storage." ); - TNL_ASSERT( 0 <= localIndex && - localIndex < SubentityTraits< Subdimensions >::count, + Assert( 0 <= localIndex && localIndex < SubentityTraits< Subdimensions >::count, std::cerr << "localIndex = " << localIndex - << " subentitiesCount = " - << SubentityTraits< Subdimensions >::count ); + << " subentitiesCount = " + << SubentityTraits< Subdimensions >::count ); typedef MeshSubentityStorageLayers< MeshConfig, EntityTopology > SubentityBaseType; return SubentityBaseType::getSubentityIndex( MeshDimensionTag< Subdimensions >(), localIndex ); @@ -208,7 +207,7 @@ getSuperentityIndex( const LocalIndexType localIndex ) const static_assert( SuperentityTraits< SuperDimension >::storageEnabled, "You try to get superentity which is not configured for storage." ); TNL_ASSERT( localIndex < this->getNumberOfSuperentities< SuperDimension >(), std::cerr << " localIndex = " << localIndex - << " this->getNumberOfSuperentities< Dimension >() = " << this->getNumberOfSuperentities< SuperDimension >() << std::endl; ); + << " this->getNumberOfSuperentities< Dimensions >() = " << this->getNumberOfSuperentities< SuperDimensions >() << std::endl; ); typedef MeshSuperentityAccess< MeshConfig, EntityTopology > SuperentityBaseType; return SuperentityBaseType::getSuperentityIndex( MeshDimensionTag< SuperDimension >(), localIndex ); @@ -300,11 +299,10 @@ setSubentityIndex( const LocalIndexType localIndex, const GlobalIndexType globalIndex ) { static_assert( SubentityTraits< Subdimensions >::storageEnabled, "You try to set subentity which is not configured for storage." ); - TNL_ASSERT( 0 <= localIndex && - localIndex < SubentityTraits< Subdimensions >::count, + Assert( 0 <= localIndex && localIndex < SubentityTraits< Subdimensions >::count, std::cerr << "localIndex = " << localIndex - << " subentitiesCount = " - << SubentityTraits< Subdimensions >::count ); + << " subentitiesCount = " + << SubentityTraits< Subdimensions >::count ); typedef MeshSubentityStorageLayers< MeshConfig, EntityTopology > SubentityBaseType; SubentityBaseType::setSubentityIndex( MeshDimensionTag< Subdimensions >(), localIndex, @@ -406,7 +404,7 @@ operator==( const MeshEntity& entity ) const { return ( //MeshSuperentityAccess< MeshConfig, MeshVertexTopology >::operator==( entity ) && MeshEntityId< typename MeshConfig::IdType, - typename MeshConfig::GlobalIndexType >::operator==( entity ) && + typename MeshConfig::GlobalIndexType >::operator==( entity ) && point == entity.point ); } @@ -456,7 +454,7 @@ getSuperentityIndex( const LocalIndexType localIndex ) const { TNL_ASSERT( localIndex < this->getNumberOfSuperentities< Dimension >(), std::cerr << " localIndex = " << localIndex - << " this->getNumberOfSuperentities< Dimension >() = " << this->getNumberOfSuperentities< Dimension >() << std::endl; ); + << " this->getNumberOfSuperentities< Dimensions >() = " << this->getNumberOfSuperentities< Dimensions >() << std::endl; ); typedef MeshSuperentityAccess< MeshConfig, MeshVertexTopology > SuperentityBaseType; return SuperentityBaseType::getSuperentityIndex( MeshDimensionTag< Dimension >(), localIndex ); diff --git a/src/TNL/Meshes/MeshDetails/layers/CMakeLists.txt b/src/TNL/Meshes/MeshDetails/layers/CMakeLists.txt index 04987a5db3..aafecf9759 100644 --- a/src/TNL/Meshes/MeshDetails/layers/CMakeLists.txt +++ b/src/TNL/Meshes/MeshDetails/layers/CMakeLists.txt @@ -1,5 +1,7 @@ SET( headers MeshStorageLayer.h MeshSubentityStorageLayer.h + MeshSuperentityAccess.h + MeshSuperentityAccessor.h MeshSuperentityStorageLayer.h ) -INSTALL( FILES ${headers} DESTINATION ${TNL_TARGET_INCLUDE_DIRECTORY}/Meshes/MeshDetails/layers ) \ No newline at end of file +INSTALL( FILES ${headers} DESTINATION ${TNL_TARGET_INCLUDE_DIRECTORY}/Meshes/MeshDetails/layers ) diff --git a/src/TNL/Meshes/MeshDetails/layers/MeshStorageLayer.h b/src/TNL/Meshes/MeshDetails/layers/MeshStorageLayer.h index bd31795a5c..31faf5da10 100644 --- a/src/TNL/Meshes/MeshDetails/layers/MeshStorageLayer.h +++ b/src/TNL/Meshes/MeshDetails/layers/MeshStorageLayer.h @@ -20,6 +20,8 @@ #include <TNL/Meshes/MeshDetails/traits/MeshTraits.h> #include <TNL/Meshes/MeshDetails/traits/MeshEntityTraits.h> #include <TNL/Meshes/MeshDetails/traits/MeshTraits.h> +#include <TNL/Meshes/MeshDetails/layers/MeshSubentityStorageLayer.h> +#include <TNL/Meshes/MeshDetails/layers/MeshSuperentityStorageLayer.h> namespace TNL { namespace Meshes { @@ -40,27 +42,26 @@ class MeshStorageLayers template< typename MeshConfig, typename DimensionTag > class MeshStorageLayer< MeshConfig, - DimensionTag, - true > - : public MeshStorageLayer< MeshConfig, typename DimensionTag::Decrement >, + DimensionsTag, + true > + : public MeshStorageLayer< MeshConfig, typename DimensionsTag::Decrement >, public MeshSuperentityStorageLayers< MeshConfig, - typename MeshTraits< MeshConfig >::template EntityTraits< DimensionTag::value >::EntityTopology > + typename MeshTraits< MeshConfig >::template EntityTraits< DimensionsTag::value >::EntityTopology > { public: - static const int Dimension = DimensionTag::value; - typedef MeshStorageLayer< MeshConfig, typename DimensionTag::Decrement > BaseType; + static const int Dimensions = DimensionsTag::value; + typedef MeshStorageLayer< MeshConfig, typename DimensionsTag::Decrement > BaseType; typedef MeshSuperentityStorageLayers< MeshConfig, - typename MeshTraits< MeshConfig >::template EntityTraits< DimensionTag::value >::EntityTopology > SuperentityStorageBaseType; - typedef MeshTraits< MeshConfig > MeshTraitsType; - typedef typename MeshTraitsType::template EntityTraits< Dimension > EntityTraitsType; - - typedef typename EntityTraitsType::StorageArrayType StorageArrayType; - typedef typename EntityTraitsType::AccessArrayType AccessArrayType; - typedef typename EntityTraitsType::GlobalIndexType GlobalIndexType; - typedef typename EntityTraitsType::EntityType EntityType; - typedef typename EntityTraitsType::EntityTopology EntityTopology; + typename MeshTraits< MeshConfig >::template EntityTraits< DimensionsTag::value >::EntityTopology > SuperentityStorageBaseType; + typedef MeshTraits< MeshConfig > MeshTraitsType; + typedef typename MeshTraitsType::template EntityTraits< Dimensions > EntityTraitsType; + typedef typename EntityTraitsType::StorageArrayType StorageArrayType; + typedef typename EntityTraitsType::AccessArrayType AccessArrayType; + typedef typename EntityTraitsType::GlobalIndexType GlobalIndexType; + typedef typename EntityTraitsType::EntityType EntityType; + typedef typename EntityTraitsType::EntityTopology EntityTopology; using BaseType::getNumberOfEntities; using BaseType::getEntity; @@ -139,7 +140,6 @@ class MeshStorageLayer< MeshConfig, return ( BaseType::operator==( meshLayer ) && entities == meshLayer.entities ); } - protected: StorageArrayType entities; @@ -147,7 +147,6 @@ class MeshStorageLayer< MeshConfig, // TODO: this is only for the mesh initializer - fix it public: - using BaseType::entitiesArray; typename EntityTraitsType::StorageArrayType& entitiesArray( DimensionTag ) @@ -180,27 +179,26 @@ class MeshStorageLayer< MeshConfig, DimensionTag, false > }; template< typename MeshConfig > -class MeshStorageLayer< MeshConfig, MeshDimensionTag< 0 >, true > : - public MeshSuperentityStorageLayers< MeshConfig, - MeshVertexTopology > +class MeshStorageLayer< MeshConfig, MeshDimensionsTag< 0 >, true > + : public MeshSuperentityStorageLayers< MeshConfig, + MeshVertexTopology > { - public: - - typedef MeshDimensionTag< 0 > DimensionTag; +public: + typedef MeshDimensionsTag< 0 > DimensionsTag; typedef MeshSuperentityStorageLayers< MeshConfig, - MeshVertexTopology > SuperentityStorageBaseType; + MeshVertexTopology > SuperentityStorageBaseType; - typedef MeshTraits< MeshConfig > MeshTraitsType; - typedef typename MeshTraitsType::template EntityTraits< 0 > EntityTraitsType; + typedef MeshTraits< MeshConfig > MeshTraitsType; + typedef typename MeshTraitsType::template EntityTraits< 0 > EntityTraitsType; - typedef typename EntityTraitsType::StorageArrayType StorageArrayType; - typedef typename EntityTraitsType::AccessArrayType AccessArrayType; - typedef typename EntityTraitsType::GlobalIndexType GlobalIndexType; - typedef typename EntityTraitsType::EntityType VertexType; - typedef typename VertexType::PointType PointType; - typedef MeshVertexTopology EntityTopology; + typedef typename EntityTraitsType::StorageArrayType StorageArrayType; + typedef typename EntityTraitsType::AccessArrayType AccessArrayType; + typedef typename EntityTraitsType::GlobalIndexType GlobalIndexType; + typedef typename EntityTraitsType::EntityType VertexType; + typedef typename VertexType::PointType PointType; + typedef MeshVertexTopology EntityTopology; MeshStorageLayer() { @@ -227,7 +225,6 @@ class MeshStorageLayer< MeshConfig, MeshDimensionTag< 0 >, true > : return this->vertices[ vertexIndex ]; } - void setVertex( const GlobalIndexType vertexIndex, const PointType& point ) { @@ -302,7 +299,7 @@ class MeshStorageLayer< MeshConfig, MeshDimensionTag< 0 >, true > : return ( vertices == meshLayer.vertices ); } - private: +private: StorageArrayType vertices; @@ -310,8 +307,7 @@ class MeshStorageLayer< MeshConfig, MeshDimensionTag< 0 >, true > : // TODO: this is only for the mesh initializer - fix it public: - - typename EntityTraitsType::StorageArrayType& entitiesArray( DimensionTag ) + typename EntityTraitsType::StorageArrayType& entitiesArray( DimensionsTag ) { return vertices; } @@ -328,7 +324,6 @@ class MeshStorageLayer< MeshConfig, MeshDimensionTag< 0 >, true > : { return SuperentityStorageBaseType::getStorageNetwork( SuperdimensionsTag() ); } - }; /**** diff --git a/src/TNL/Meshes/MeshDetails/layers/MeshSubentityStorageLayer.h b/src/TNL/Meshes/MeshDetails/layers/MeshSubentityStorageLayer.h index 13d40fd980..16cc52c7da 100644 --- a/src/TNL/Meshes/MeshDetails/layers/MeshSubentityStorageLayer.h +++ b/src/TNL/Meshes/MeshDetails/layers/MeshSubentityStorageLayer.h @@ -28,9 +28,9 @@ template< typename MeshConfig, typename EntityTopology, typename DimensionTag, bool SubentityStorage = - MeshTraits< MeshConfig >::template SubentityTraits< EntityTopology, DimensionTag::value >::storageEnabled, + MeshTraits< MeshConfig >::template SubentityTraits< EntityTopology, DimensionsTag::value >::storageEnabled, bool SubentityOrientationStorage = - MeshTraits< MeshConfig >::template SubentityTraits< EntityTopology, DimensionTag::value >::orientationEnabled > + MeshTraits< MeshConfig >::template SubentityTraits< EntityTopology, DimensionsTag::value >::orientationEnabled > class MeshSubentityStorageLayer; @@ -38,8 +38,8 @@ template< typename MeshConfig, typename EntityTopology > class MeshSubentityStorageLayers : public MeshSubentityStorageLayer< MeshConfig, - EntityTopology, - MeshDimensionTag< EntityTopology::dimensions - 1 > > + EntityTopology, + MeshDimensionsTag< EntityTopology::dimensions - 1 > > { }; @@ -48,23 +48,22 @@ template< typename MeshConfig, typename EntityTopology, typename DimensionTag > class MeshSubentityStorageLayer< MeshConfig, - EntityTopology, - DimensionTag, - true, - true > + EntityTopology, + DimensionsTag, + true, + true > : public MeshSubentityStorageLayer< MeshConfig, - EntityTopology, - typename DimensionTag::Decrement > + EntityTopology, + typename DimensionsTag::Decrement > { typedef MeshSubentityStorageLayer< MeshConfig, - EntityTopology, - typename DimensionTag::Decrement > BaseType; + EntityTopology, + typename DimensionsTag::Decrement > BaseType; - protected: - - static const int Dimension = DimensionTag::value; - typedef MeshTraits< MeshConfig > MeshTraitsType; - typedef typename MeshTraitsType::template SubentityTraits< EntityTopology, Dimension > SubentityTraitsType; +protected: + static const int Dimensions = DimensionsTag::value; + typedef MeshTraits< MeshConfig > MeshTraitsType; + typedef typename MeshTraitsType::template SubentityTraits< EntityTopology, Dimensions > SubentityTraitsType; typedef typename MeshTraitsType::GlobalIndexType GlobalIndexType; typedef typename MeshTraitsType::LocalIndexType LocalIndexType; typedef typename SubentityTraitsType::IdArrayType IdArrayType; @@ -159,10 +158,10 @@ class MeshSubentityStorageLayer< MeshConfig, using BaseType::subentityOrientationsArray; OrientationArrayType& subentityOrientationsArray( DimensionTag ) { return this->subentityOrientations; } - private: - IdArrayType subentitiesIndices; +private: + IdArrayType subentitiesIndices; - OrientationArrayType subentityOrientations; + OrientationArrayType subentityOrientations; }; @@ -170,23 +169,22 @@ template< typename MeshConfig, typename EntityTopology, typename DimensionTag > class MeshSubentityStorageLayer< MeshConfig, - EntityTopology, - DimensionTag, - true, - false > + EntityTopology, + DimensionsTag, + true, + false > : public MeshSubentityStorageLayer< MeshConfig, - EntityTopology, - typename DimensionTag::Decrement > + EntityTopology, + typename DimensionsTag::Decrement > { typedef MeshSubentityStorageLayer< MeshConfig, - EntityTopology, - typename DimensionTag::Decrement > BaseType; + EntityTopology, + typename DimensionsTag::Decrement > BaseType; - protected: - - static const int Dimension = DimensionTag::value; - typedef MeshTraits< MeshConfig > MeshTraitsType; - typedef typename MeshTraitsType::template SubentityTraits< EntityTopology, Dimension > SubentityTraitsType; +protected: + static const int Dimensions = DimensionsTag::value; + typedef MeshTraits< MeshConfig > MeshTraitsType; + typedef typename MeshTraitsType::template SubentityTraits< EntityTopology, Dimensions > SubentityTraitsType; typedef typename MeshTraitsType::GlobalIndexType GlobalIndexType; typedef typename MeshTraitsType::LocalIndexType LocalIndexType; typedef typename SubentityTraitsType::IdArrayType IdArrayType; @@ -273,21 +271,21 @@ class MeshSubentityStorageLayer< MeshConfig, using BaseType::subentityOrientationsArray; void subentityOrientationsArray() {} - private: - IdArrayType subentitiesIndices; +private: + IdArrayType subentitiesIndices; }; template< typename MeshConfig, typename EntityTopology, typename DimensionTag > class MeshSubentityStorageLayer< MeshConfig, - EntityTopology, - DimensionTag, - false, - false > + EntityTopology, + DimensionsTag, + false, + false > : public MeshSubentityStorageLayer< MeshConfig, - EntityTopology, - typename DimensionTag::Decrement > + EntityTopology, + typename DimensionsTag::Decrement > { }; @@ -295,15 +293,15 @@ class MeshSubentityStorageLayer< MeshConfig, template< typename MeshConfig, typename EntityTopology > class MeshSubentityStorageLayer< MeshConfig, - EntityTopology, - MeshDimensionTag< 0 >, - true, - false > + EntityTopology, + MeshDimensionsTag< 0 >, + true, + false > { typedef MeshDimensionTag< 0 > DimensionTag; - protected: - static const int Dimension = 0; +protected: + static const int Dimensions = 0; typedef MeshTraits< MeshConfig > MeshTraitsType; typedef typename MeshTraitsType::template SubentityTraits< EntityTopology, Dimension > SubentityTraitsType; typedef typename MeshTraitsType::GlobalIndexType GlobalIndexType; @@ -371,27 +369,25 @@ class MeshSubentityStorageLayer< MeshConfig, IdArrayType& subentityIdsArray( DimensionTag ) { return this->verticesIndices; } - protected: - - /*** - * Necessary because of 'using TBase::...;' in the derived classes - */ - void subentityOrientation() {} - void subentityOrientationsArray() {} +protected: + /*** + * Necessary because of 'using TBase::...;' in the derived classes + */ + void subentityOrientation() {} + void subentityOrientationsArray() {} - IdArrayType verticesIndices; + IdArrayType verticesIndices; }; template< typename MeshConfig, typename EntityTopology > class MeshSubentityStorageLayer< MeshConfig, - EntityTopology, - MeshDimensionTag< 0 >, - false, - false > + EntityTopology, + MeshDimensionsTag< 0 >, + false, + false > { - public: - +public: bool save( File& file ) const { return true; @@ -401,7 +397,6 @@ class MeshSubentityStorageLayer< MeshConfig, { return true; } - }; } // namespace Meshes diff --git a/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityAccess.h b/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityAccess.h index 44476c81cd..3cbe770e91 100644 --- a/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityAccess.h +++ b/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityAccess.h @@ -31,15 +31,15 @@ class MeshSuperentityAccessLayer; template< typename MeshConfig, typename MeshEntity > -class MeshSuperentityAccess : - public MeshSuperentityAccessLayer< MeshConfig, - MeshEntity, - MeshDimensionTag< MeshTraits< MeshConfig >::meshDimension > > +class MeshSuperentityAccess + : public MeshSuperentityAccessLayer< MeshConfig, + MeshEntity, + MeshDimensionsTag< MeshTraits< MeshConfig >::meshDimensions > > { public: typedef MeshSuperentityAccessLayer< MeshConfig, - MeshEntity, - MeshDimensionTag< MeshTraits< MeshConfig >::meshDimension > > BaseType; + MeshEntity, + MeshDimensionsTag< MeshTraits< MeshConfig >::meshDimensions > > BaseType; bool operator == ( const MeshSuperentityAccess< MeshConfig, MeshEntity>& a ) const { return true; } // TODO: fix @@ -47,22 +47,20 @@ class MeshSuperentityAccess : { BaseType::print( str ); }; - }; template< typename MeshConfig, typename MeshEntity, typename Dimension > class MeshSuperentityAccessLayer< MeshConfig, - MeshEntity, - Dimension, - true > : - public MeshSuperentityAccessLayer< MeshConfig, MeshEntity, typename Dimension::Decrement > + MeshEntity, + Dimensions, + true > + : public MeshSuperentityAccessLayer< MeshConfig, MeshEntity, typename Dimensions::Decrement > { typedef MeshSuperentityAccessLayer< MeshConfig, MeshEntity, typename Dimension::Decrement > BaseType; public: - typedef MeshTraits< MeshConfig > MeshTraitsType; typedef typename MeshTraitsType::template SuperentityTraits< MeshEntity, Dimension::value > SuperentityTraitsType; typedef typename MeshTraitsType::IdArrayAccessorType IdArrayAccessorType; @@ -102,30 +100,29 @@ class MeshSuperentityAccessLayer< MeshConfig, IdArrayAccessorType m_superentityIndices; SuperentityAccessorType superentityIndices; - }; template< typename MeshConfig, typename MeshEntity, typename Dimension > class MeshSuperentityAccessLayer< MeshConfig, - MeshEntity, - Dimension, - false > : - public MeshSuperentityAccessLayer< MeshConfig, MeshEntity, typename Dimension::Decrement > + MeshEntity, + Dimensions, + false > + : public MeshSuperentityAccessLayer< MeshConfig, MeshEntity, typename Dimensions::Decrement > { }; template< typename MeshConfig, typename MeshEntity > class MeshSuperentityAccessLayer< MeshConfig, - MeshEntity, - MeshDimensionTag< MeshEntity::dimensions >, - false > + MeshEntity, + MeshDimensionsTag< MeshEntity::dimensions >, + false > { protected: /*** - * Necessary because of 'using TBase::...;' in the derived classes + * Necessary because of 'using BaseType::...;' in the derived classes */ void superentityIds() {} void superentityIdsArray() {} @@ -138,13 +135,13 @@ class MeshSuperentityAccessLayer< MeshConfig, template< typename MeshConfig, typename MeshEntity > class MeshSuperentityAccessLayer< MeshConfig, - MeshEntity, - MeshDimensionTag< MeshEntity::dimensions >, - true > + MeshEntity, + MeshDimensionsTag< MeshEntity::dimensions >, + true > { protected: /*** - * Necessary because of 'using TBase::...;' in the derived classes + * Necessary because of 'using BaseType::...;' in the derived classes */ void superentityIds() {} void superentityIdsArray() {} diff --git a/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityAccessor.h b/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityAccessor.h index ebe8ee4194..e74a7978d5 100644 --- a/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityAccessor.h +++ b/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityAccessor.h @@ -16,6 +16,8 @@ #pragma once +#include <fstream> + namespace TNL { namespace Meshes { @@ -23,7 +25,6 @@ template< typename IndexMultimapValues > class MeshSuperentityAccessor { public: - typedef typename IndexMultimapValues::IndexType GlobalIndexType; typedef typename IndexMultimapValues::IndexType LocalIndexType; @@ -32,7 +33,7 @@ class MeshSuperentityAccessor LocalIndexType getSupernetitiesCount() const { return this->indexes.getPortsCount(); - }; + } void setSuperentityIndex( const LocalIndexType localIndex, const GlobalIndexType globalIndex ) @@ -61,9 +62,7 @@ class MeshSuperentityAccessor } protected: - IndexMultimapValues indexes; - }; template< typename IndexMultimapValues > diff --git a/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityStorageLayer.h b/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityStorageLayer.h index d02a1beafb..8a57f9a38d 100644 --- a/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityStorageLayer.h +++ b/src/TNL/Meshes/MeshDetails/layers/MeshSuperentityStorageLayer.h @@ -28,15 +28,15 @@ template< typename MeshConfig, typename EntityTopology, typename DimensionTag, bool SuperentityStorage = - MeshSuperentityTraits< MeshConfig, EntityTopology, DimensionTag::value >::storageEnabled > + MeshSuperentityTraits< MeshConfig, EntityTopology, DimensionsTag::value >::storageEnabled > class MeshSuperentityStorageLayer; template< typename MeshConfig, typename EntityTopology > class MeshSuperentityStorageLayers : public MeshSuperentityStorageLayer< MeshConfig, - EntityTopology, - MeshDimensionTag< MeshTraits< MeshConfig >::meshDimension > > + EntityTopology, + MeshDimensionsTag< MeshTraits< MeshConfig >::meshDimensions > > { }; @@ -46,127 +46,124 @@ template< typename MeshConfig, class MeshSuperentityStorageLayer< MeshConfig, EntityTopology, DimensionTag, true > : public MeshSuperentityStorageLayer< MeshConfig, EntityTopology, typename DimensionTag::Decrement > { - typedef - MeshSuperentityStorageLayer< MeshConfig, EntityTopology, typename DimensionTag::Decrement > BaseType; + typedef MeshSuperentityStorageLayer< MeshConfig, EntityTopology, typename DimensionsTag::Decrement > BaseType; static const int Dimension = DimensionTag::value; typedef MeshTraits< MeshConfig > MeshTraitsType; typedef typename MeshTraitsType::template SuperentityTraits< EntityTopology, Dimension > SuperentityTraitsType; - protected: - +protected: typedef typename SuperentityTraitsType::StorageArrayType StorageArrayType; typedef typename SuperentityTraitsType::AccessArrayType AccessArrayType; typedef typename SuperentityTraitsType::GlobalIndexType GlobalIndexType; typedef typename SuperentityTraitsType::LocalIndexType LocalIndexType; - typedef typename SuperentityTraitsType::StorageNetworkType StorageNetworkType; + typedef typename SuperentityTraitsType::StorageNetworkType StorageNetworkType; /**** * Make visible setters and getters of the lower superentities */ - using BaseType::setNumberOfSuperentities; - using BaseType::getNumberOfSuperentities; - using BaseType::getSuperentityIndex; - using BaseType::setSuperentityIndex; - using BaseType::getSuperentitiesIndices; - - MeshSuperentityStorageLayer() - { - } - - /*~MeshSuperentityStorageLayer() - { - std::cerr << " Destroying " << this->superentitiesIndices.getSize() << " superentities with "<< DimensionTag::value << " dimensions." << std::endl; - std::cerr << " this->superentitiesIndices.getName() = " << this->superentitiesIndices.getName() << std::endl; - std::cerr << " this->sharedSuperentitiesIndices.getName() = " << this->sharedSuperentitiesIndices.getName() << std::endl; - }*/ - - MeshSuperentityStorageLayer& operator = ( const MeshSuperentityStorageLayer& layer ) - { - this->superentitiesIndices.setSize( layer.superentitiesIndices.getSize() ); - this->superentitiesIndices = layer.superentitiesIndices; - this->sharedSuperentitiesIndices.bind( this->superentitiesIndices ); - return *this; - } - - /**** - * Define setter/getter for the current level of the superentities - */ - bool setNumberOfSuperentities( DimensionTag, - const LocalIndexType size ) - { - if( ! this->superentitiesIndices.setSize( size ) ) - return false; - this->superentitiesIndices.setValue( -1 ); - this->sharedSuperentitiesIndices.bind( this->superentitiesIndices ); - return true; - } - - LocalIndexType getNumberOfSuperentities( DimensionTag ) const - { - return this->superentitiesIndices.getSize(); - } - - void setSuperentityIndex( DimensionTag, - const LocalIndexType localIndex, - const GlobalIndexType globalIndex ) - { - this->superentitiesIndices[ localIndex ] = globalIndex; - } - - GlobalIndexType getSuperentityIndex( DimensionTag, - const LocalIndexType localIndex ) const - { - return this->superentitiesIndices[ localIndex ]; - } - - AccessArrayType& getSuperentitiesIndices( DimensionTag ) - { - return this->sharedSuperentitiesIndices; - } - - const AccessArrayType& getSuperentitiesIndices( DimensionTag ) const - { - return this->sharedSuperentitiesIndices; - } - - bool save( File& file ) const - { - if( ! BaseType::save( file ) || - ! this->superentitiesIndices.save( file ) ) - { - //cerr << "Saving of the entity superentities layer with " << DimensionTag::value << " failed." << std::endl; - return false; - } - return true; - } - - bool load( File& file ) - { - if( ! BaseType::load( file ) || - ! this->superentitiesIndices.load( file ) ) - { - //cerr << "Loading of the entity superentities layer with " << DimensionTag::value << " failed." << std::endl; - return false; - } - return true; - } - - void print( std::ostream& str ) const - { - BaseType::print( str ); - str << std::endl << "\t Superentities with " << DimensionTag::value << " dimensions are: " << this->superentitiesIndices << "."; - } - - bool operator==( const MeshSuperentityStorageLayer& layer ) const - { - return ( BaseType::operator==( layer ) && - superentitiesIndices == layer.superentitiesIndices ); - } - - private: + using BaseType::setNumberOfSuperentities; + using BaseType::getNumberOfSuperentities; + using BaseType::getSuperentityIndex; + using BaseType::setSuperentityIndex; + using BaseType::getSuperentitiesIndices; + + MeshSuperentityStorageLayer() + { + } + + /*~MeshSuperentityStorageLayer() + { + std::cerr << " Destroying " << this->superentitiesIndices.getSize() << " superentities with "<< DimensionsTag::value << " dimensions." << std::endl; + std::cerr << " this->superentitiesIndices.getName() = " << this->superentitiesIndices.getName() << std::endl; + std::cerr << " this->sharedSuperentitiesIndices.getName() = " << this->sharedSuperentitiesIndices.getName() << std::endl; + }*/ + + MeshSuperentityStorageLayer& operator = ( const MeshSuperentityStorageLayer& layer ) + { + this->superentitiesIndices.setSize( layer.superentitiesIndices.getSize() ); + this->superentitiesIndices = layer.superentitiesIndices; + this->sharedSuperentitiesIndices.bind( this->superentitiesIndices ); + return *this; + } + + /**** + * Define setter/getter for the current level of the superentities + */ + bool setNumberOfSuperentities( DimensionsTag, + const LocalIndexType size ) + { + if( ! this->superentitiesIndices.setSize( size ) ) + return false; + this->superentitiesIndices.setValue( -1 ); + this->sharedSuperentitiesIndices.bind( this->superentitiesIndices ); + return true; + } + + LocalIndexType getNumberOfSuperentities( DimensionsTag ) const + { + return this->superentitiesIndices.getSize(); + } + + void setSuperentityIndex( DimensionsTag, + const LocalIndexType localIndex, + const GlobalIndexType globalIndex ) + { + this->superentitiesIndices[ localIndex ] = globalIndex; + } + + GlobalIndexType getSuperentityIndex( DimensionsTag, + const LocalIndexType localIndex ) const + { + return this->superentitiesIndices[ localIndex ]; + } + + AccessArrayType& getSuperentitiesIndices( DimensionsTag ) + { + return this->sharedSuperentitiesIndices; + } + + const AccessArrayType& getSuperentitiesIndices( DimensionsTag ) const + { + return this->sharedSuperentitiesIndices; + } + bool save( File& file ) const + { + if( ! BaseType::save( file ) || + ! this->superentitiesIndices.save( file ) ) + { + //cerr << "Saving of the entity superentities layer with " << DimensionsTag::value << " failed." << std::endl; + return false; + } + return true; + } + + bool load( File& file ) + { + if( ! BaseType::load( file ) || + ! this->superentitiesIndices.load( file ) ) + { + //cerr << "Loading of the entity superentities layer with " << DimensionsTag::value << " failed." << std::endl; + return false; + } + return true; + } + + void print( std::ostream& str ) const + { + BaseType::print( str ); + str << std::endl << "\t Superentities with " << DimensionsTag::value << " dimensions are: " << this->superentitiesIndices << "."; + } + + bool operator==( const MeshSuperentityStorageLayer& layer ) const + { + return ( BaseType::operator==( layer ) && + superentitiesIndices == layer.superentitiesIndices ); + } + +private: StorageArrayType superentitiesIndices; AccessArrayType sharedSuperentitiesIndices; @@ -175,7 +172,6 @@ class MeshSuperentityStorageLayer< MeshConfig, EntityTopology, DimensionTag, tru // TODO: this is only for the mesh initializer - fix it public: - using BaseType::superentityIdsArray; typename MeshTraits< MeshConfig >::GlobalIdArrayType& superentityIdsArray( DimensionTag ) { @@ -195,39 +191,37 @@ template< typename MeshConfig, class MeshSuperentityStorageLayer< MeshConfig, EntityTopology, DimensionTag, false > : public MeshSuperentityStorageLayer< MeshConfig, EntityTopology, typename DimensionTag::Decrement > { - public: - }; template< typename MeshConfig, typename EntityTopology > class MeshSuperentityStorageLayer< MeshConfig, EntityTopology, MeshDimensionTag< EntityTopology::dimensions >, false > { - static const int Dimension = EntityTopology::dimensions; - typedef MeshDimensionTag< EntityTopology::dimensions > DimensionTag; + static const int Dimensions = EntityTopology::dimensions; + typedef MeshDimensionsTag< EntityTopology::dimensions > DimensionsTag; typedef MeshSuperentityTraits< MeshConfig, EntityTopology, Dimension > SuperentityTraits; typedef MeshSuperentityStorageLayer< MeshConfig, - EntityTopology, - DimensionTag, - false > ThisType; - - protected: + EntityTopology, + DimensionsTag, + false > ThisType; - typedef typename SuperentityTraits::ContainerType ContainerType; +protected: + typedef typename SuperentityTraits::ContainerType ContainerType; typedef typename ContainerType::ElementType GlobalIndexType; + // FIXME: take it from MeshConfig or something typedef int LocalIndexType; - typedef typename SuperentityTraits::StorageNetworkType StorageNetworkType; + typedef typename SuperentityTraits::StorageNetworkType StorageNetworkType; /**** * These methods are due to 'using BaseType::...;' in the derived classes. */ - bool setNumberOfSuperentities( DimensionTag, - const LocalIndexType size ); - LocalIndexType getNumberOfSuperentities( DimensionTag ) const; - GlobalIndexType getSuperentityIndex( DimensionTag, + bool setNumberOfSuperentities( DimensionsTag, + const LocalIndexType size ); + LocalIndexType getNumberOfSuperentities( DimensionsTag ) const; + GlobalIndexType getSuperentityIndex( DimensionsTag, const LocalIndexType localIndex ){} void setSuperentityIndex( DimensionTag, const LocalIndexType localIndex, @@ -235,14 +229,14 @@ class MeshSuperentityStorageLayer< MeshConfig, EntityTopology, MeshDimensionTag< void print( std::ostream& str ) const{} - bool operator==( const ThisType& layer ) const + bool operator==( const ThisType& layer ) const { return true; } - ContainerType& getSuperentitiesIndices(){} + ContainerType& getSuperentitiesIndices() {} - const ContainerType& getSuperentitiesIndices() const{} + const ContainerType& getSuperentitiesIndices() const {} bool save( File& file ) const { @@ -265,48 +259,46 @@ class MeshSuperentityStorageLayer< MeshConfig, EntityTopology, MeshDimensionTag< TNL_ASSERT( false, ); //return this->storageNetwork; } - }; template< typename MeshConfig, typename EntityTopology > class MeshSuperentityStorageLayer< MeshConfig, - EntityTopology, - MeshDimensionTag< EntityTopology::dimensions >, - true > + EntityTopology, + MeshDimensionsTag< EntityTopology::dimensions >, + true > { - static const int Dimension = EntityTopology::dimensions; - typedef MeshDimensionTag< Dimension > DimensionTag; + static const int Dimensions = EntityTopology::dimensions; + typedef MeshDimensionsTag< Dimensions > DimensionsTag; typedef MeshSuperentityTraits< MeshConfig, - EntityTopology, - Dimension > SuperentityTraits; + EntityTopology, + Dimensions > SuperentityTraits; typedef MeshSuperentityStorageLayer< MeshConfig, - EntityTopology, - DimensionTag, - true > ThisType; + EntityTopology, + DimensionsTag, + true > ThisType; - protected: +protected: + typedef typename SuperentityTraits::StorageArrayType StorageArrayType; + typedef typename SuperentityTraits::GlobalIndexType GlobalIndexType; + typedef typename SuperentityTraits::LocalIndexType LocalIndexType; - typedef typename SuperentityTraits::StorageArrayType StorageArrayType; - typedef typename SuperentityTraits::GlobalIndexType GlobalIndexType; - typedef typename SuperentityTraits::LocalIndexType LocalIndexType; - - typedef typename SuperentityTraits::StorageNetworkType StorageNetworkType; + typedef typename SuperentityTraits::StorageNetworkType StorageNetworkType; /**** * These methods are due to 'using BaseType::...;' in the derived classes. */ - bool setNumberOfSuperentities( DimensionTag, - const LocalIndexType size ); - LocalIndexType getNumberOfSuperentities( DimensionTag ) const; - GlobalIndexType getSuperentityIndex( DimensionTag, - const LocalIndexType localIndex ){} - void setSuperentityIndex( DimensionTag, + bool setNumberOfSuperentities( DimensionsTag, + const LocalIndexType size ); + LocalIndexType getNumberOfSuperentities( DimensionsTag ) const; + GlobalIndexType getSuperentityIndex( DimensionsTag, + const LocalIndexType localIndex ) {} + void setSuperentityIndex( DimensionsTag, const LocalIndexType localIndex, const GlobalIndexType globalIndex ) {} - void print( std::ostream& str ) const{} + void print( std::ostream& str ) const {} bool operator==( const ThisType& layer ) const { @@ -315,7 +307,7 @@ class MeshSuperentityStorageLayer< MeshConfig, StorageArrayType& getSuperentitiesIndices(){} - const StorageArrayType& getSuperentitiesIndices() const{} + const StorageArrayType& getSuperentitiesIndices() const {} bool save( File& file ) const { @@ -338,8 +330,6 @@ class MeshSuperentityStorageLayer< MeshConfig, TNL_ASSERT( false, ); //return this->storageNetwork; } - - }; } // namespace Meshes diff --git a/src/TNL/Meshes/MeshDetails/traits/MeshTraits.h b/src/TNL/Meshes/MeshDetails/traits/MeshTraits.h index 4cd115593b..75e6fc6640 100644 --- a/src/TNL/Meshes/MeshDetails/traits/MeshTraits.h +++ b/src/TNL/Meshes/MeshDetails/traits/MeshTraits.h @@ -37,38 +37,35 @@ template< typename MeshConfig, class MeshTraits { public: - - static const int meshDimension = MeshConfig::CellTopology::dimensions; - static const int worldDimension = MeshConfig::worldDimension; + static const int meshDimensions = MeshConfig::CellTopology::dimensions; + static const int worldDimensions = MeshConfig::worldDimensions; - typedef Device DeviceType; - typedef typename MeshConfig::GlobalIndexType GlobalIndexType; - typedef typename MeshConfig::LocalIndexType LocalIndexType; - - typedef typename MeshConfig::CellTopology CellTopology; - typedef MeshEntity< MeshConfig, CellTopology > CellType; - typedef MeshEntity< MeshConfig, MeshVertexTopology > VertexType; - typedef Containers::StaticVector< worldDimension, typename MeshConfig::RealType > PointType; - typedef MeshEntitySeed< MeshConfig, CellTopology > CellSeedType; + typedef Device DeviceType; + typedef typename MeshConfig::GlobalIndexType GlobalIndexType; + typedef typename MeshConfig::LocalIndexType LocalIndexType; - typedef Containers::Array< PointType, Devices::Host, GlobalIndexType > PointArrayType; - typedef Containers::Array< CellSeedType, Devices::Host, GlobalIndexType > CellSeedArrayType; - typedef Containers::Array< GlobalIndexType, Devices::Host, GlobalIndexType > GlobalIdArrayType; - typedef Containers::tnlConstSharedArray< GlobalIndexType, Devices::Host, LocalIndexType > IdArrayAccessorType; - typedef Containers::tnlConstSharedArray< LocalIndexType, Devices::Host, LocalIndexType > IdPermutationArrayAccessorType; + typedef typename MeshConfig::CellTopology CellTopology; + typedef MeshEntity< MeshConfig, CellTopology > CellType; + typedef MeshEntity< MeshConfig, MeshVertexTopology > VertexType; + typedef Containers::StaticVector< worldDimensions, typename MeshConfig::RealType > PointType; + typedef MeshEntitySeed< MeshConfig, CellTopology > CellSeedType; - template< int Dimension > using EntityTraits = - MeshEntityTraits< MeshConfig, Dimension >; + typedef Containers::Array< PointType, Devices::Host, GlobalIndexType > PointArrayType; + typedef Containers::Array< CellSeedType, Devices::Host, GlobalIndexType > CellSeedArrayType; + typedef Containers::Array< GlobalIndexType, Devices::Host, GlobalIndexType > GlobalIdArrayType; + typedef Containers::tnlConstSharedArray< GlobalIndexType, Devices::Host, LocalIndexType > IdArrayAccessorType; + typedef Containers::tnlConstSharedArray< LocalIndexType, Devices::Host, LocalIndexType > IdPermutationArrayAccessorType; - template< typename EntityTopology, int SubDimension > using SubentityTraits = - MeshSubentityTraits< MeshConfig, EntityTopology, SubDimension >; + template< int Dimensions > + using EntityTraits = MeshEntityTraits< MeshConfig, Dimensions >; - template< typename EntityTopology, int SuperDimension > using SuperentityTraits = - MeshSuperentityTraits< MeshConfig, EntityTopology, SuperDimension >; + template< typename EntityTopology, int SubDimensions > + using SubentityTraits = MeshSubentityTraits< MeshConfig, EntityTopology, SubDimensions >; + template< typename EntityTopology, int SuperDimensions > + using SuperentityTraits = MeshSuperentityTraits< MeshConfig, EntityTopology, SuperDimensions >; - typedef MeshDimensionTag< meshDimension > DimensionTag; - + typedef MeshDimensionsTag< meshDimensions > DimensionsTag; }; } // namespace Meshes diff --git a/src/TNL/Meshes/MeshEntity.h b/src/TNL/Meshes/MeshEntity.h index 0aedeb356d..f5df2f2258 100644 --- a/src/TNL/Meshes/MeshEntity.h +++ b/src/TNL/Meshes/MeshEntity.h @@ -39,7 +39,7 @@ class MeshEntity : public MeshSubentityStorageLayers< MeshConfig, EntityTopology_ >, public MeshSuperentityAccess< MeshConfig, EntityTopology_ >, public MeshEntityId< typename MeshConfig::IdType, - typename MeshConfig::GlobalIndexType > + typename MeshConfig::GlobalIndexType > { public: @@ -48,13 +48,13 @@ class MeshEntity typedef typename MeshTraitsType::GlobalIndexType GlobalIndexType; typedef typename MeshTraitsType::LocalIndexType LocalIndexType; typedef typename MeshTraitsType::IdPermutationArrayAccessorType IdPermutationArrayAccessorType; - typedef MeshEntitySeed< MeshConfig, EntityTopology > SeedType; + typedef MeshEntitySeed< MeshConfig, EntityTopology > SeedType; - template< int Subdimensions > using SubentityTraits = - typename MeshTraitsType::template SubentityTraits< EntityTopology, Subdimensions >; + template< int Subdimensions > + using SubentityTraits = typename MeshTraitsType::template SubentityTraits< EntityTopology, Subdimensions >; - template< int SuperDimension > using SuperentityTraits = - typename MeshTraitsType::template SuperentityTraits< EntityTopology, SuperDimension >; + template< int SuperDimensions > + using SuperentityTraits = typename MeshTraitsType::template SuperentityTraits< EntityTopology, SuperDimensions >; MeshEntity( const SeedType& entitySeed ); @@ -103,11 +103,11 @@ class MeshEntity template< int SuperDimension > GlobalIndexType getSuperentityIndex( const LocalIndexType localIndex ) const; - template< int SuperDimension > - typename SuperentityTraits< SuperDimension >::AccessArrayType& getSuperentitiesIndices(); + template< int SuperDimensions > + typename SuperentityTraits< SuperDimensions >::AccessArrayType& getSuperentitiesIndices(); - template< int SuperDimension > - const typename SuperentityTraits< SuperDimension >::AccessArrayType& getSuperentitiesIndices() const; + template< int SuperDimensions > + const typename SuperentityTraits< SuperDimensions >::AccessArrayType& getSuperentitiesIndices() const; /**** * Vertices @@ -146,7 +146,6 @@ class MeshEntity typename SubentityTraits< Subdimensions >::OrientationArrayType& subentityOrientationsArray(); friend MeshInitializer< MeshConfig >; - }; /**** @@ -156,7 +155,7 @@ template< typename MeshConfig > class MeshEntity< MeshConfig, MeshVertexTopology > : public MeshSuperentityAccess< MeshConfig, MeshVertexTopology >, public MeshEntityId< typename MeshConfig::IdType, - typename MeshConfig::GlobalIndexType > + typename MeshConfig::GlobalIndexType > { public: @@ -168,8 +167,8 @@ class MeshEntity< MeshConfig, MeshVertexTopology > typedef typename MeshTraitsType::IdPermutationArrayAccessorType IdPermutationArrayAccessorType; typedef MeshEntitySeed< MeshConfig, EntityTopology > SeedType; - template< int SuperDimension > using SuperentityTraits = - typename MeshTraitsType::template SuperentityTraits< EntityTopology, SuperDimension >; + template< int SuperDimensions > + using SuperentityTraits = typename MeshTraitsType::template SuperentityTraits< EntityTopology, SuperDimensions >; static String getType(); @@ -190,10 +189,10 @@ class MeshEntity< MeshConfig, MeshVertexTopology > template< int Superdimensions > LocalIndexType getNumberOfSuperentities() const; template< int Superdimensions > - typename SuperentityTraits< Superdimensions >::AccessArrayType& getSuperentitiesIndices(); + typename SuperentityTraits< Superdimensions >::AccessArrayType& getSuperentitiesIndices(); template< int Superdimensions > - const typename SuperentityTraits< Superdimensions >::AccessArrayType& getSuperentitiesIndeces() const; + const typename SuperentityTraits< Superdimensions >::AccessArrayType& getSuperentitiesIndeces() const; template< int Dimension > GlobalIndexType getSuperentityIndex( const LocalIndexType localIndex ) const; @@ -207,7 +206,7 @@ class MeshEntity< MeshConfig, MeshVertexTopology > protected: - typedef typename MeshTraitsType::IdArrayAccessorType IdArrayAccessorType; + typedef typename MeshTraitsType::IdArrayAccessorType IdArrayAccessorType; typedef MeshSuperentityAccess< MeshConfig, MeshVertexTopology > SuperentityAccessBase; template< int Superdimensions > -- GitLab