From fdd8c9b3d4076b93356ed9f90662674913205228 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= Date: Mon, 18 Oct 2021 15:42:19 +0200 Subject: [PATCH 1/2] Renamed WorldDimension to SpaceDimension --- Documentation/Tutorials/Meshes/GameOfLife.cpp | 12 ++-- .../Meshes/MeshConfigurationExample.cpp | 4 +- src/TNL/Meshes/DefaultConfig.h | 4 +- .../Meshes/Geometry/getOutwardNormalVector.h | 4 +- src/TNL/Meshes/MeshDetails/ConfigValidator.h | 2 +- .../Meshes/MeshDetails/traits/MeshTraits.h | 4 +- src/TNL/Meshes/Readers/MeshReader.h | 8 +-- src/TNL/Meshes/Readers/NetgenReader.h | 8 +-- src/TNL/Meshes/Readers/PVTIReader.h | 6 +- src/TNL/Meshes/Readers/PVTUReader.h | 2 +- src/TNL/Meshes/Readers/VTIReader.h | 2 +- src/TNL/Meshes/Readers/VTKReader.h | 6 +- src/TNL/Meshes/Readers/VTUReader.h | 6 +- src/TNL/Meshes/TypeResolver/BuildConfigTags.h | 16 +++--- .../Meshes/TypeResolver/MeshTypeResolver.h | 32 +++++------ .../Meshes/TypeResolver/MeshTypeResolver.hpp | 56 +++++++++---------- src/TNL/Meshes/Writers/VTKWriter.h | 4 +- src/TNL/Meshes/Writers/VTUWriter.h | 4 +- src/Tools/tnl-decompose-mesh.cpp | 12 ++-- src/Tools/tnl-game-of-life.cpp | 12 ++-- src/Tools/tnl-mesh-converter.cpp | 12 ++-- src/Tools/tnl-test-distributed-mesh.h | 12 ++-- 22 files changed, 114 insertions(+), 114 deletions(-) diff --git a/Documentation/Tutorials/Meshes/GameOfLife.cpp b/Documentation/Tutorials/Meshes/GameOfLife.cpp index 9d3fc251b..6f585d9ab 100644 --- a/Documentation/Tutorials/Meshes/GameOfLife.cpp +++ b/Documentation/Tutorials/Meshes/GameOfLife.cpp @@ -24,10 +24,10 @@ template<> struct MeshCellTopologyTag< MyConfigTag, Topologies::Quadrangle > { e //template<> struct MeshCellTopologyTag< MyConfigTag, Topologies::Tetrahedron > { enum { enabled = true }; }; //template<> struct MeshCellTopologyTag< MyConfigTag, Topologies::Hexahedron > { enum { enabled = true }; }; -// Meshes are enabled only for the world dimension equal to the cell dimension. -template< typename CellTopology, int WorldDimension > -struct MeshWorldDimensionTag< MyConfigTag, CellTopology, WorldDimension > -{ enum { enabled = ( WorldDimension == CellTopology::dimension ) }; }; +// Meshes are enabled only for the space dimension equal to the cell dimension. +template< typename CellTopology, int SpaceDimension > +struct MeshSpaceDimensionTag< MyConfigTag, CellTopology, SpaceDimension > +{ enum { enabled = ( SpaceDimension == CellTopology::dimension ) }; }; // Meshes are enabled only for types explicitly listed below. template<> struct MeshRealTag< MyConfigTag, float > { enum { enabled = false }; }; @@ -41,12 +41,12 @@ template<> struct MeshConfigTemplateTag< MyConfigTag > { template< typename Cell, - int WorldDimension = Cell::dimension, + int SpaceDimension = Cell::dimension, typename Real = double, typename GlobalIndex = int, typename LocalIndex = short int > struct MeshConfig - : public DefaultConfig< Cell, WorldDimension, Real, GlobalIndex, LocalIndex > + : public DefaultConfig< Cell, SpaceDimension, Real, GlobalIndex, LocalIndex > { template< typename EntityTopology > static constexpr bool subentityStorage( EntityTopology, int SubentityDimension ) diff --git a/Documentation/Tutorials/Meshes/MeshConfigurationExample.cpp b/Documentation/Tutorials/Meshes/MeshConfigurationExample.cpp index 174748ad3..383a80217 100644 --- a/Documentation/Tutorials/Meshes/MeshConfigurationExample.cpp +++ b/Documentation/Tutorials/Meshes/MeshConfigurationExample.cpp @@ -13,12 +13,12 @@ template<> struct MeshConfigTemplateTag< MyConfigTag > { template< typename Cell, - int WorldDimension = Cell::dimension, + int SpaceDimension = Cell::dimension, typename Real = double, typename GlobalIndex = int, typename LocalIndex = short int > struct MeshConfig - : public DefaultConfig< Cell, WorldDimension, Real, GlobalIndex, LocalIndex > + : public DefaultConfig< Cell, SpaceDimension, Real, GlobalIndex, LocalIndex > { template< typename EntityTopology > static constexpr bool subentityStorage( EntityTopology, int SubentityDimension ) diff --git a/src/TNL/Meshes/DefaultConfig.h b/src/TNL/Meshes/DefaultConfig.h index a07ef511b..b8cb18605 100644 --- a/src/TNL/Meshes/DefaultConfig.h +++ b/src/TNL/Meshes/DefaultConfig.h @@ -25,7 +25,7 @@ namespace Meshes { * Basic structure for mesh configuration. */ template< typename Cell, - int WorldDimension = Cell::dimension, + int SpaceDimension = Cell::dimension, typename Real = double, typename GlobalIndex = int, typename LocalIndex = short int > @@ -36,7 +36,7 @@ struct DefaultConfig using GlobalIndexType = GlobalIndex; using LocalIndexType = LocalIndex; - static constexpr int worldDimension = WorldDimension; + static constexpr int spaceDimension = SpaceDimension; static constexpr int meshDimension = Cell::dimension; /**** diff --git a/src/TNL/Meshes/Geometry/getOutwardNormalVector.h b/src/TNL/Meshes/Geometry/getOutwardNormalVector.h index d3fa6ea50..6221236f5 100644 --- a/src/TNL/Meshes/Geometry/getOutwardNormalVector.h +++ b/src/TNL/Meshes/Geometry/getOutwardNormalVector.h @@ -99,7 +99,7 @@ getOutwardNormalVector( const Mesh< MeshConfig, Device > & mesh, using FaceType = MeshEntity< MeshConfig, Device, Topologies::Edge >; using PointType = typename MeshTraits< MeshConfig >::PointType; static_assert( std::is_same< typename MeshType::Face, FaceType >::value, "getOutwardNormalVector called for an entity which is not a face" ); - static_assert( MeshConfig::worldDimension == 2, "TODO: normal vectors for 2D meshes in a 3D space are not implemented yet" ); + static_assert( MeshConfig::spaceDimension == 2, "TODO: normal vectors for 2D meshes in a 3D space are not implemented yet" ); const auto& v0 = mesh.getPoint( face.template getSubentityIndex< 0 >( 0 ) ); const auto& v1 = mesh.getPoint( face.template getSubentityIndex< 0 >( 1 ) ); @@ -125,7 +125,7 @@ getOutwardNormalVector( const Mesh< MeshConfig, Device > & mesh, using FaceType = MeshEntity< MeshConfig, Device, EntityTopology >; using PointType = typename MeshTraits< MeshConfig >::PointType; static_assert( std::is_same< typename MeshType::Face, FaceType >::value, "getOutwardNormalVector called for an entity which is not a face" ); - static_assert( MeshConfig::worldDimension == 3, "general overload intended for 3D was called with the wrong world dimension" ); + static_assert( MeshConfig::spaceDimension == 3, "general overload intended for 3D was called with the wrong space dimension" ); const auto& v0 = mesh.getPoint( face.template getSubentityIndex< 0 >( 0 ) ); const auto& v1 = mesh.getPoint( face.template getSubentityIndex< 0 >( 1 ) ); diff --git a/src/TNL/Meshes/MeshDetails/ConfigValidator.h b/src/TNL/Meshes/MeshDetails/ConfigValidator.h index 0680026f0..bd04275a7 100644 --- a/src/TNL/Meshes/MeshDetails/ConfigValidator.h +++ b/src/TNL/Meshes/MeshDetails/ConfigValidator.h @@ -98,7 +98,7 @@ class ConfigValidator static constexpr int meshDimension = MeshConfig::CellTopology::dimension; static_assert( 1 <= meshDimension, "zero dimensional meshes are not supported" ); - static_assert( meshDimension <= MeshConfig::worldDimension, "world dimension must not be less than mesh dimension" ); + static_assert( meshDimension <= MeshConfig::spaceDimension, "space dimension must not be less than mesh dimension" ); }; } // namespace Meshes diff --git a/src/TNL/Meshes/MeshDetails/traits/MeshTraits.h b/src/TNL/Meshes/MeshDetails/traits/MeshTraits.h index 1bad55de4..3f8c5f444 100644 --- a/src/TNL/Meshes/MeshDetails/traits/MeshTraits.h +++ b/src/TNL/Meshes/MeshDetails/traits/MeshTraits.h @@ -45,7 +45,7 @@ class MeshTraits { public: static constexpr int meshDimension = MeshConfig::CellTopology::dimension; - static constexpr int worldDimension = MeshConfig::worldDimension; + static constexpr int spaceDimension = MeshConfig::spaceDimension; using DeviceType = Device; using GlobalIndexType = typename MeshConfig::GlobalIndexType; @@ -54,7 +54,7 @@ public: using CellTopology = typename MeshConfig::CellTopology; using CellType = MeshEntity< MeshConfig, Device, CellTopology >; using VertexType = MeshEntity< MeshConfig, Device, Topologies::Vertex >; - using PointType = Containers::StaticVector< worldDimension, typename MeshConfig::RealType >; + using PointType = Containers::StaticVector< spaceDimension, typename MeshConfig::RealType >; using CellSeedType = EntitySeed< MeshConfig, CellTopology >; using EntityTagType = std::uint8_t; diff --git a/src/TNL/Meshes/Readers/MeshReader.h b/src/TNL/Meshes/Readers/MeshReader.h index 778d0faa2..6d7398c28 100644 --- a/src/TNL/Meshes/Readers/MeshReader.h +++ b/src/TNL/Meshes/Readers/MeshReader.h @@ -239,9 +239,9 @@ public: } int - getWorldDimension() const + getSpaceDimension() const { - return worldDimension; + return spaceDimension; } VTK::EntityShape @@ -279,7 +279,7 @@ protected: // attributes of the mesh std::size_t NumberOfPoints, NumberOfCells; - int meshDimension, worldDimension; + int meshDimension, spaceDimension; VTK::EntityShape cellShape = VTK::EntityShape::Vertex; // intermediate representation of a grid (this is relevant only for TNL::Meshes::Grid) @@ -296,7 +296,7 @@ protected: { meshType = ""; NumberOfPoints = NumberOfCells = 0; - meshDimension = worldDimension = 0; + meshDimension = spaceDimension = 0; cellShape = VTK::EntityShape::Vertex; gridExtent = {}; diff --git a/src/TNL/Meshes/Readers/NetgenReader.h b/src/TNL/Meshes/Readers/NetgenReader.h index 3cd69a1ab..432776ec4 100644 --- a/src/TNL/Meshes/Readers/NetgenReader.h +++ b/src/TNL/Meshes/Readers/NetgenReader.h @@ -70,7 +70,7 @@ public: std::vector< std::uint8_t > typesArray; // read points - worldDimension = 0; + spaceDimension = 0; for( std::size_t pointIndex = 0; pointIndex < NumberOfPoints; pointIndex++ ) { if( ! inputFile ) { reset(); @@ -78,7 +78,7 @@ public: } getline( inputFile, line ); - // read the coordinates and compute the world dimension + // read the coordinates and compute the space dimension iss.clear(); iss.str( line ); for( int i = 0; i < 3; i++ ) { @@ -89,13 +89,13 @@ public: aux = 0; } if( aux != 0.0 ) - worldDimension = std::max( worldDimension, i + 1 ); + spaceDimension = std::max( spaceDimension, i + 1 ); pointsArray.push_back( aux ); } } // netgen supports only triangular and tetrahedral meshes - meshDimension = worldDimension; + meshDimension = spaceDimension; if( meshDimension == 1 ) cellShape = VTK::EntityShape::Line; else if( meshDimension == 2 ) diff --git a/src/TNL/Meshes/Readers/PVTIReader.h b/src/TNL/Meshes/Readers/PVTIReader.h index 2d53908e4..3e9bf7200 100644 --- a/src/TNL/Meshes/Readers/PVTIReader.h +++ b/src/TNL/Meshes/Readers/PVTIReader.h @@ -104,7 +104,7 @@ class PVTIReader dim++; else break; - worldDimension = meshDimension = dim; + spaceDimension = meshDimension = dim; // populate cellShape (just for completeness, not necessary for GridTypeResolver) if( meshDimension == 1 ) @@ -153,8 +153,8 @@ class PVTIReader localReader.detectMesh(); // check that local attributes are the same as global attributes - if( getWorldDimension() != localReader.getWorldDimension() ) - throw MeshReaderError( "PVTIReader", "the world dimension of a subdomain does not match the global grid." ); + if( getSpaceDimension() != localReader.getSpaceDimension() ) + throw MeshReaderError( "PVTIReader", "the space dimension of a subdomain does not match the global grid." ); if( getMeshDimension() != localReader.getMeshDimension() ) throw MeshReaderError( "PVTIReader", "the mesh dimension of a subdomain does not match the global grid." ); if( getCellShape() != localReader.getCellShape() ) diff --git a/src/TNL/Meshes/Readers/PVTUReader.h b/src/TNL/Meshes/Readers/PVTUReader.h index 827f2c579..87379c732 100644 --- a/src/TNL/Meshes/Readers/PVTUReader.h +++ b/src/TNL/Meshes/Readers/PVTUReader.h @@ -79,7 +79,7 @@ class PVTUReader localReader.detectMesh(); // copy attributes from the local reader - worldDimension = localReader.getWorldDimension(); + spaceDimension = localReader.getSpaceDimension(); meshDimension = localReader.getMeshDimension(); cellShape = localReader.getCellShape(); pointsType = localReader.getRealType(); diff --git a/src/TNL/Meshes/Readers/VTIReader.h b/src/TNL/Meshes/Readers/VTIReader.h index c1ea0cd51..df6725bd7 100644 --- a/src/TNL/Meshes/Readers/VTIReader.h +++ b/src/TNL/Meshes/Readers/VTIReader.h @@ -102,7 +102,7 @@ class VTIReader dim++; else break; - worldDimension = meshDimension = dim; + spaceDimension = meshDimension = dim; // populate cellShape (just for completeness, not necessary for GridTypeResolver) if( meshDimension == 1 ) diff --git a/src/TNL/Meshes/Readers/VTKReader.h b/src/TNL/Meshes/Readers/VTKReader.h index 530ef7b46..a4a1c943e 100644 --- a/src/TNL/Meshes/Readers/VTKReader.h +++ b/src/TNL/Meshes/Readers/VTKReader.h @@ -78,12 +78,12 @@ public: std::vector< std::uint8_t > typesArray; // read points - worldDimension = 0; + spaceDimension = 0; for( std::size_t pointIndex = 0; pointIndex < NumberOfPoints; pointIndex++ ) { if( ! inputFile ) throw MeshReaderError( "VTKReader", "unable to read enough vertices, the file may be invalid or corrupted" ); - // read the coordinates and compute the world dimension + // read the coordinates and compute the space dimension for( int i = 0; i < 3; i++ ) { double aux = 0; if( pointsType == "float" ) @@ -93,7 +93,7 @@ public: if( ! inputFile ) throw MeshReaderError( "VTKReader", "unable to read " + std::to_string(i) + "th component of the vertex number " + std::to_string(pointIndex) ); if( aux != 0.0 ) - worldDimension = std::max( worldDimension, i + 1 ); + spaceDimension = std::max( spaceDimension, i + 1 ); pointsArray.push_back( aux ); } } diff --git a/src/TNL/Meshes/Readers/VTUReader.h b/src/TNL/Meshes/Readers/VTUReader.h index 3a7ce1aae..bae1c3381 100644 --- a/src/TNL/Meshes/Readers/VTUReader.h +++ b/src/TNL/Meshes/Readers/VTUReader.h @@ -71,13 +71,13 @@ class VTUReader if( array.size() != 3 * NumberOfPoints ) throw MeshReaderError( "VTUReader", "invalid size of the Points data array (" + std::to_string(array.size()) + " vs " + std::to_string(NumberOfPoints) + ")" ); - // set worldDimension - worldDimension = 1; + // set spaceDimension + spaceDimension = 1; std::size_t i = 0; for( auto c : array ) { if( c != 0 ) { int dim = i % 3 + 1; - worldDimension = std::max( worldDimension, dim ); + spaceDimension = std::max( spaceDimension, dim ); } ++i; } diff --git a/src/TNL/Meshes/TypeResolver/BuildConfigTags.h b/src/TNL/Meshes/TypeResolver/BuildConfigTags.h index b2c138e9e..dd83a017a 100644 --- a/src/TNL/Meshes/TypeResolver/BuildConfigTags.h +++ b/src/TNL/Meshes/TypeResolver/BuildConfigTags.h @@ -87,8 +87,8 @@ template< typename ConfigTag, typename CellTopology > struct MeshCellTopologyTag // TODO: Simplex has not been tested yet //template< typename ConfigTag > struct MeshCellTopologyTag< ConfigTag, Topologies::Simplex > { enum { enabled = true }; }; -// All sensible world dimensions are enabled by default. -template< typename ConfigTag, typename CellTopology, int WorldDimension > struct MeshWorldDimensionTag { enum { enabled = ( WorldDimension >= CellTopology::dimension && WorldDimension <= 3 ) }; }; +// All sensible space dimensions are enabled by default. +template< typename ConfigTag, typename CellTopology, int SpaceDimension > struct MeshSpaceDimensionTag { enum { enabled = ( SpaceDimension >= CellTopology::dimension && SpaceDimension <= 3 ) }; }; // Meshes are enabled only for the `float` and `double` real types by default. template< typename ConfigTag, typename Real > struct MeshRealTag { enum { enabled = false }; }; @@ -108,11 +108,11 @@ template< typename ConfigTag > struct MeshLocalIndexTag< ConfigTag, short int > template< typename ConfigTag > struct MeshConfigTemplateTag { - template< typename Cell, int WorldDimension, typename Real, typename GlobalIndex, typename LocalIndex > - using MeshConfig = DefaultConfig< Cell, WorldDimension, Real, GlobalIndex, LocalIndex >; + template< typename Cell, int SpaceDimension, typename Real, typename GlobalIndex, typename LocalIndex > + using MeshConfig = DefaultConfig< Cell, SpaceDimension, Real, GlobalIndex, LocalIndex >; }; -// The Mesh is enabled for allowed Device, CellTopology, WorldDimension, Real, +// The Mesh is enabled for allowed Device, CellTopology, SpaceDimension, Real, // GlobalIndex, LocalIndex and Id types as specified above. // // By specializing this tag you can enable or disable custom combinations of @@ -126,15 +126,15 @@ struct MeshConfigTemplateTag // // struct MeshTag< ConfigTag, // Mesh< typename MeshConfigTemplateTag< ConfigTag >:: -// template MeshConfig< CellTopology, WorldDimension, Real, GlobalIndex, LocalIndex > > > +// template MeshConfig< CellTopology, SpaceDimension, Real, GlobalIndex, LocalIndex > > > // -template< typename ConfigTag, typename Device, typename CellTopology, int WorldDimension, typename Real, typename GlobalIndex, typename LocalIndex > +template< typename ConfigTag, typename Device, typename CellTopology, int SpaceDimension, typename Real, typename GlobalIndex, typename LocalIndex > struct MeshTag { enum { enabled = MeshDeviceTag< ConfigTag, Device >::enabled && MeshCellTopologyTag< ConfigTag, CellTopology >::enabled && - MeshWorldDimensionTag< ConfigTag, CellTopology, WorldDimension >::enabled && + MeshSpaceDimensionTag< ConfigTag, CellTopology, SpaceDimension >::enabled && MeshRealTag< ConfigTag, Real >::enabled && MeshGlobalIndexTag< ConfigTag, GlobalIndex >::enabled && MeshLocalIndexTag< ConfigTag, LocalIndex >::enabled diff --git a/src/TNL/Meshes/TypeResolver/MeshTypeResolver.h b/src/TNL/Meshes/TypeResolver/MeshTypeResolver.h index 46248e98c..c2439287c 100644 --- a/src/TNL/Meshes/TypeResolver/MeshTypeResolver.h +++ b/src/TNL/Meshes/TypeResolver/MeshTypeResolver.h @@ -40,29 +40,29 @@ protected: template< typename CellTopology, typename = typename std::enable_if< ! BuildConfigTags::MeshCellTopologyTag< ConfigTag, CellTopology >::enabled >::type, typename = void > - static bool resolveWorldDimension( Reader& reader, Functor&& functor ); + static bool resolveSpaceDimension( Reader& reader, Functor&& functor ); // Overload for enabled cell topologies template< typename CellTopology, typename = typename std::enable_if< BuildConfigTags::MeshCellTopologyTag< ConfigTag, CellTopology >::enabled >::type > - static bool resolveWorldDimension( Reader& reader, Functor&& functor ); + static bool resolveSpaceDimension( Reader& reader, Functor&& functor ); - // Overload for disabled world dimensions + // Overload for disabled space dimensions template< typename CellTopology, - int WorldDimension, - typename = typename std::enable_if< ! BuildConfigTags::MeshWorldDimensionTag< ConfigTag, CellTopology, WorldDimension >::enabled >::type, + int SpaceDimension, + typename = typename std::enable_if< ! BuildConfigTags::MeshSpaceDimensionTag< ConfigTag, CellTopology, SpaceDimension >::enabled >::type, typename = void > static bool resolveReal( Reader& reader, Functor&& functor ); - // Overload for enabled world dimensions + // Overload for enabled space dimensions template< typename CellTopology, - int WorldDimension, - typename = typename std::enable_if< BuildConfigTags::MeshWorldDimensionTag< ConfigTag, CellTopology, WorldDimension >::enabled >::type > + int SpaceDimension, + typename = typename std::enable_if< BuildConfigTags::MeshSpaceDimensionTag< ConfigTag, CellTopology, SpaceDimension >::enabled >::type > static bool resolveReal( Reader& reader, Functor&& functor ); // Overload for disabled real types template< typename CellTopology, - int WorldDimension, + int SpaceDimension, typename Real, typename = typename std::enable_if< ! BuildConfigTags::MeshRealTag< ConfigTag, Real >::enabled >::type, typename = void > @@ -70,14 +70,14 @@ protected: // Overload for enabled real types template< typename CellTopology, - int WorldDimension, + int SpaceDimension, typename Real, typename = typename std::enable_if< BuildConfigTags::MeshRealTag< ConfigTag, Real >::enabled >::type > static bool resolveGlobalIndex( Reader& reader, Functor&& functor ); // Overload for disabled global index types template< typename CellTopology, - int WorldDimension, + int SpaceDimension, typename Real, typename GlobalIndex, typename = typename std::enable_if< ! BuildConfigTags::MeshGlobalIndexTag< ConfigTag, GlobalIndex >::enabled >::type, @@ -86,7 +86,7 @@ protected: // Overload for enabled global index types template< typename CellTopology, - int WorldDimension, + int SpaceDimension, typename Real, typename GlobalIndex, typename = typename std::enable_if< BuildConfigTags::MeshGlobalIndexTag< ConfigTag, GlobalIndex >::enabled >::type > @@ -94,7 +94,7 @@ protected: // Overload for disabled local index types template< typename CellTopology, - int WorldDimension, + int SpaceDimension, typename Real, typename GlobalIndex, typename LocalIndex, @@ -104,7 +104,7 @@ protected: // Overload for enabled local index types template< typename CellTopology, - int WorldDimension, + int SpaceDimension, typename Real, typename GlobalIndex, typename LocalIndex, @@ -117,7 +117,7 @@ protected: ! BuildConfigTags::MeshTag< ConfigTag, Device, typename MeshConfig::CellTopology, - MeshConfig::worldDimension, + MeshConfig::spaceDimension, typename MeshConfig::RealType, typename MeshConfig::GlobalIndexType, typename MeshConfig::LocalIndexType @@ -131,7 +131,7 @@ protected: BuildConfigTags::MeshTag< ConfigTag, Device, typename MeshConfig::CellTopology, - MeshConfig::worldDimension, + MeshConfig::spaceDimension, typename MeshConfig::RealType, typename MeshConfig::GlobalIndexType, typename MeshConfig::LocalIndexType diff --git a/src/TNL/Meshes/TypeResolver/MeshTypeResolver.hpp b/src/TNL/Meshes/TypeResolver/MeshTypeResolver.hpp index 803cf84e9..72d3c8ef7 100644 --- a/src/TNL/Meshes/TypeResolver/MeshTypeResolver.hpp +++ b/src/TNL/Meshes/TypeResolver/MeshTypeResolver.hpp @@ -42,15 +42,15 @@ resolveCellTopology( Reader& reader, Functor&& functor ) switch( reader.getCellShape() ) { case VTK::EntityShape::Line: - return resolveWorldDimension< Topologies::Edge >( reader, std::forward(functor) ); + return resolveSpaceDimension< Topologies::Edge >( reader, std::forward(functor) ); case VTK::EntityShape::Triangle: - return resolveWorldDimension< Topologies::Triangle >( reader, std::forward(functor) ); + return resolveSpaceDimension< Topologies::Triangle >( reader, std::forward(functor) ); case VTK::EntityShape::Quad: - return resolveWorldDimension< Topologies::Quadrangle >( reader, std::forward(functor) ); + return resolveSpaceDimension< Topologies::Quadrangle >( reader, std::forward(functor) ); case VTK::EntityShape::Tetra: - return resolveWorldDimension< Topologies::Tetrahedron >( reader, std::forward(functor) ); + return resolveSpaceDimension< Topologies::Tetrahedron >( reader, std::forward(functor) ); case VTK::EntityShape::Hexahedron: - return resolveWorldDimension< Topologies::Hexahedron >( reader, std::forward(functor) ); + return resolveSpaceDimension< Topologies::Hexahedron >( reader, std::forward(functor) ); default: std::cerr << "unsupported cell topology: " << VTK::getShapeName( reader.getCellShape() ) << std::endl; return false; @@ -65,7 +65,7 @@ template< typename ConfigTag, typename, typename > bool MeshTypeResolver< ConfigTag, Device >::detail< Reader, Functor >:: -resolveWorldDimension( Reader& reader, Functor&& functor ) +resolveSpaceDimension( Reader& reader, Functor&& functor ) { std::cerr << "The cell topology " << getType< CellTopology >() << " is disabled in the build configuration." << std::endl; return false; @@ -79,9 +79,9 @@ template< typename ConfigTag, typename > bool MeshTypeResolver< ConfigTag, Device >::detail< Reader, Functor >:: -resolveWorldDimension( Reader& reader, Functor&& functor ) +resolveSpaceDimension( Reader& reader, Functor&& functor ) { - switch( reader.getWorldDimension() ) + switch( reader.getSpaceDimension() ) { case 1: return resolveReal< CellTopology, 1 >( reader, std::forward(functor) ); @@ -90,7 +90,7 @@ resolveWorldDimension( Reader& reader, Functor&& functor ) case 3: return resolveReal< CellTopology, 3 >( reader, std::forward(functor) ); default: - std::cerr << "unsupported world dimension: " << reader.getWorldDimension() << std::endl; + std::cerr << "unsupported space dimension: " << reader.getSpaceDimension() << std::endl; return false; } } @@ -100,13 +100,13 @@ template< typename ConfigTag, template< typename Reader, typename Functor > template< typename CellTopology, - int WorldDimension, + int SpaceDimension, typename, typename > bool MeshTypeResolver< ConfigTag, Device >::detail< Reader, Functor >:: resolveReal( Reader& reader, Functor&& functor ) { - std::cerr << "The combination of world dimension (" << WorldDimension + std::cerr << "The combination of space dimension (" << SpaceDimension << ") and mesh dimension (" << CellTopology::dimension << ") is either invalid or disabled in the build configuration." << std::endl; return false; @@ -117,18 +117,18 @@ template< typename ConfigTag, template< typename Reader, typename Functor > template< typename CellTopology, - int WorldDimension, + int SpaceDimension, typename > bool MeshTypeResolver< ConfigTag, Device >::detail< Reader, Functor >:: resolveReal( Reader& reader, Functor&& functor ) { if( reader.getRealType() == "float" ) - return resolveGlobalIndex< CellTopology, WorldDimension, float >( reader, std::forward(functor) ); + return resolveGlobalIndex< CellTopology, SpaceDimension, float >( reader, std::forward(functor) ); if( reader.getRealType() == "double" ) - return resolveGlobalIndex< CellTopology, WorldDimension, double >( reader, std::forward(functor) ); + return resolveGlobalIndex< CellTopology, SpaceDimension, double >( reader, std::forward(functor) ); if( reader.getRealType() == "long double" ) - return resolveGlobalIndex< CellTopology, WorldDimension, long double >( reader, std::forward(functor) ); + return resolveGlobalIndex< CellTopology, SpaceDimension, long double >( reader, std::forward(functor) ); std::cerr << "Unsupported real type: " << reader.getRealType() << std::endl; return false; } @@ -138,7 +138,7 @@ template< typename ConfigTag, template< typename Reader, typename Functor > template< typename CellTopology, - int WorldDimension, + int SpaceDimension, typename Real, typename, typename > bool @@ -154,7 +154,7 @@ template< typename ConfigTag, template< typename Reader, typename Functor > template< typename CellTopology, - int WorldDimension, + int SpaceDimension, typename Real, typename > bool @@ -165,16 +165,16 @@ resolveGlobalIndex( Reader& reader, Functor&& functor ) reader.getGlobalIndexType() == "short int" || reader.getGlobalIndexType() == "std::int16_t" || reader.getGlobalIndexType() == "std::uint16_t" ) - return resolveLocalIndex< CellTopology, WorldDimension, Real, short int >( reader, std::forward(functor) ); + return resolveLocalIndex< CellTopology, SpaceDimension, Real, short int >( reader, std::forward(functor) ); if( reader.getGlobalIndexType() == "int" || reader.getGlobalIndexType() == "std::int32_t" || reader.getGlobalIndexType() == "std::uint32_t" ) - return resolveLocalIndex< CellTopology, WorldDimension, Real, int >( reader, std::forward(functor) ); + return resolveLocalIndex< CellTopology, SpaceDimension, Real, int >( reader, std::forward(functor) ); if( reader.getGlobalIndexType() == "long" || reader.getGlobalIndexType() == "long int" || reader.getGlobalIndexType() == "std::int64_t" || reader.getGlobalIndexType() == "std::uint64_t" ) - return resolveLocalIndex< CellTopology, WorldDimension, Real, long int >( reader, std::forward(functor) ); + return resolveLocalIndex< CellTopology, SpaceDimension, Real, long int >( reader, std::forward(functor) ); std::cerr << "Unsupported global index type: " << reader.getGlobalIndexType() << std::endl; return false; } @@ -184,7 +184,7 @@ template< typename ConfigTag, template< typename Reader, typename Functor > template< typename CellTopology, - int WorldDimension, + int SpaceDimension, typename Real, typename GlobalIndex, typename, typename > @@ -201,7 +201,7 @@ template< typename ConfigTag, template< typename Reader, typename Functor > template< typename CellTopology, - int WorldDimension, + int SpaceDimension, typename Real, typename GlobalIndex, typename > @@ -213,16 +213,16 @@ resolveLocalIndex( Reader& reader, Functor&& functor ) reader.getLocalIndexType() == "short int" || reader.getLocalIndexType() == "std::int16_t" || reader.getLocalIndexType() == "std::uint16_t" ) - return resolveMeshType< CellTopology, WorldDimension, Real, GlobalIndex, short int >( reader, std::forward(functor) ); + return resolveMeshType< CellTopology, SpaceDimension, Real, GlobalIndex, short int >( reader, std::forward(functor) ); if( reader.getLocalIndexType() == "int" || reader.getLocalIndexType() == "std::int32_t" || reader.getLocalIndexType() == "std::uint32_t" ) - return resolveMeshType< CellTopology, WorldDimension, Real, GlobalIndex, int >( reader, std::forward(functor) ); + return resolveMeshType< CellTopology, SpaceDimension, Real, GlobalIndex, int >( reader, std::forward(functor) ); if( reader.getLocalIndexType() == "long" || reader.getLocalIndexType() == "long int" || reader.getLocalIndexType() == "std::int64_t" || reader.getLocalIndexType() == "std::uint64_t" ) - return resolveMeshType< CellTopology, WorldDimension, Real, GlobalIndex, long int >( reader, std::forward(functor) ); + return resolveMeshType< CellTopology, SpaceDimension, Real, GlobalIndex, long int >( reader, std::forward(functor) ); std::cerr << "Unsupported local index type: " << reader.getLocalIndexType() << std::endl; return false; } @@ -232,7 +232,7 @@ template< typename ConfigTag, template< typename Reader, typename Functor > template< typename CellTopology, - int WorldDimension, + int SpaceDimension, typename Real, typename GlobalIndex, typename LocalIndex, @@ -250,7 +250,7 @@ template< typename ConfigTag, template< typename Reader, typename Functor > template< typename CellTopology, - int WorldDimension, + int SpaceDimension, typename Real, typename GlobalIndex, typename LocalIndex, @@ -259,7 +259,7 @@ bool MeshTypeResolver< ConfigTag, Device >::detail< Reader, Functor >:: resolveMeshType( Reader& reader, Functor&& functor ) { - using MeshConfig = typename BuildConfigTags::MeshConfigTemplateTag< ConfigTag >::template MeshConfig< CellTopology, WorldDimension, Real, GlobalIndex, LocalIndex >; + using MeshConfig = typename BuildConfigTags::MeshConfigTemplateTag< ConfigTag >::template MeshConfig< CellTopology, SpaceDimension, Real, GlobalIndex, LocalIndex >; return resolveTerminate< MeshConfig >( reader, std::forward(functor) ); } diff --git a/src/TNL/Meshes/Writers/VTKWriter.h b/src/TNL/Meshes/Writers/VTKWriter.h index db0c09b13..f5cae9efb 100644 --- a/src/TNL/Meshes/Writers/VTKWriter.h +++ b/src/TNL/Meshes/Writers/VTKWriter.h @@ -30,8 +30,8 @@ template< typename Mesh > class VTKWriter { static_assert( Mesh::getMeshDimension() <= 3, "The VTK format supports only 1D, 2D and 3D meshes." ); - // TODO: check also world dimension when grids allow it -// static_assert( Mesh::getWorldDimension() <= 3, "The VTK format supports only 1D, 2D and 3D meshes." ); + // TODO: check also space dimension when grids allow it +// static_assert( Mesh::getSpaceDimension() <= 3, "The VTK format supports only 1D, 2D and 3D meshes." ); template< int EntityDimension > using EntitiesWriter = details::MeshEntitiesVTKWriter< Mesh, EntityDimension >; diff --git a/src/TNL/Meshes/Writers/VTUWriter.h b/src/TNL/Meshes/Writers/VTUWriter.h index 00765cc0d..3359566ba 100644 --- a/src/TNL/Meshes/Writers/VTUWriter.h +++ b/src/TNL/Meshes/Writers/VTUWriter.h @@ -30,8 +30,8 @@ template< typename Mesh > class VTUWriter { static_assert( Mesh::getMeshDimension() <= 3, "The VTK format supports only 1D, 2D and 3D meshes." ); - // TODO: check also world dimension when grids allow it -// static_assert( Mesh::getWorldDimension() <= 3, "The VTK format supports only 1D, 2D and 3D meshes." ); + // TODO: check also space dimension when grids allow it +// static_assert( Mesh::getSpaceDimension() <= 3, "The VTK format supports only 1D, 2D and 3D meshes." ); template< int EntityDimension > using EntitiesCollector = details::MeshEntitiesVTUCollector< Mesh, EntityDimension >; diff --git a/src/Tools/tnl-decompose-mesh.cpp b/src/Tools/tnl-decompose-mesh.cpp index 3bd66fec8..98443a770 100644 --- a/src/Tools/tnl-decompose-mesh.cpp +++ b/src/Tools/tnl-decompose-mesh.cpp @@ -50,10 +50,10 @@ template<> struct MeshCellTopologyTag< DecomposeMeshConfigTag, Topologies::Quadr template<> struct MeshCellTopologyTag< DecomposeMeshConfigTag, Topologies::Tetrahedron > { enum { enabled = true }; }; template<> struct MeshCellTopologyTag< DecomposeMeshConfigTag, Topologies::Hexahedron > { enum { enabled = true }; }; -// Meshes are enabled only for the world dimension equal to the cell dimension. -template< typename CellTopology, int WorldDimension > -struct MeshWorldDimensionTag< DecomposeMeshConfigTag, CellTopology, WorldDimension > -{ enum { enabled = ( WorldDimension == CellTopology::dimension ) }; }; +// Meshes are enabled only for the space dimension equal to the cell dimension. +template< typename CellTopology, int SpaceDimension > +struct MeshSpaceDimensionTag< DecomposeMeshConfigTag, CellTopology, SpaceDimension > +{ enum { enabled = ( SpaceDimension == CellTopology::dimension ) }; }; // Meshes are enabled only for types explicitly listed below. template<> struct MeshRealTag< DecomposeMeshConfigTag, float > { enum { enabled = true }; }; @@ -67,7 +67,7 @@ template<> struct MeshConfigTemplateTag< DecomposeMeshConfigTag > { template< typename Cell, - int WorldDimension = Cell::dimension, + int SpaceDimension = Cell::dimension, typename Real = double, typename GlobalIndex = int, typename LocalIndex = GlobalIndex > @@ -78,7 +78,7 @@ struct MeshConfigTemplateTag< DecomposeMeshConfigTag > using GlobalIndexType = GlobalIndex; using LocalIndexType = LocalIndex; - static constexpr int worldDimension = WorldDimension; + static constexpr int spaceDimension = SpaceDimension; static constexpr int meshDimension = Cell::dimension; template< typename EntityTopology > diff --git a/src/Tools/tnl-game-of-life.cpp b/src/Tools/tnl-game-of-life.cpp index 8292d5483..541b21378 100644 --- a/src/Tools/tnl-game-of-life.cpp +++ b/src/Tools/tnl-game-of-life.cpp @@ -38,10 +38,10 @@ template<> struct MeshCellTopologyTag< MyConfigTag, Topologies::Quadrangle > { e //template<> struct MeshCellTopologyTag< MyConfigTag, Topologies::Tetrahedron > { enum { enabled = true }; }; //template<> struct MeshCellTopologyTag< MyConfigTag, Topologies::Hexahedron > { enum { enabled = true }; }; -// Meshes are enabled only for the world dimension equal to the cell dimension. -template< typename CellTopology, int WorldDimension > -struct MeshWorldDimensionTag< MyConfigTag, CellTopology, WorldDimension > -{ enum { enabled = ( WorldDimension == CellTopology::dimension ) }; }; +// Meshes are enabled only for the space dimension equal to the cell dimension. +template< typename CellTopology, int SpaceDimension > +struct MeshSpaceDimensionTag< MyConfigTag, CellTopology, SpaceDimension > +{ enum { enabled = ( SpaceDimension == CellTopology::dimension ) }; }; // Meshes are enabled only for types explicitly listed below. template<> struct MeshRealTag< MyConfigTag, float > { enum { enabled = true }; }; @@ -55,12 +55,12 @@ template<> struct MeshConfigTemplateTag< MyConfigTag > { template< typename Cell, - int WorldDimension = Cell::dimension, + int SpaceDimension = Cell::dimension, typename Real = double, typename GlobalIndex = int, typename LocalIndex = GlobalIndex > struct MeshConfig - : public DefaultConfig< Cell, WorldDimension, Real, GlobalIndex, LocalIndex > + : public DefaultConfig< Cell, SpaceDimension, Real, GlobalIndex, LocalIndex > { template< typename EntityTopology > static constexpr bool subentityStorage( EntityTopology, int SubentityDimension ) diff --git a/src/Tools/tnl-mesh-converter.cpp b/src/Tools/tnl-mesh-converter.cpp index 5298ea8f4..9f191904a 100644 --- a/src/Tools/tnl-mesh-converter.cpp +++ b/src/Tools/tnl-mesh-converter.cpp @@ -44,10 +44,10 @@ template<> struct MeshCellTopologyTag< MeshConverterConfigTag, Topologies::Quadr template<> struct MeshCellTopologyTag< MeshConverterConfigTag, Topologies::Tetrahedron > { enum { enabled = true }; }; template<> struct MeshCellTopologyTag< MeshConverterConfigTag, Topologies::Hexahedron > { enum { enabled = true }; }; -// Meshes are enabled only for the world dimension equal to the cell dimension. -template< typename CellTopology, int WorldDimension > -struct MeshWorldDimensionTag< MeshConverterConfigTag, CellTopology, WorldDimension > -{ enum { enabled = ( WorldDimension == CellTopology::dimension ) }; }; +// Meshes are enabled only for the space dimension equal to the cell dimension. +template< typename CellTopology, int SpaceDimension > +struct MeshSpaceDimensionTag< MeshConverterConfigTag, CellTopology, SpaceDimension > +{ enum { enabled = ( SpaceDimension == CellTopology::dimension ) }; }; // Meshes are enabled only for types explicitly listed below. template<> struct MeshRealTag< MeshConverterConfigTag, float > { enum { enabled = true }; }; @@ -61,7 +61,7 @@ template<> struct MeshConfigTemplateTag< MeshConverterConfigTag > { template< typename Cell, - int WorldDimension = Cell::dimension, + int SpaceDimension = Cell::dimension, typename Real = double, typename GlobalIndex = int, typename LocalIndex = GlobalIndex > @@ -72,7 +72,7 @@ struct MeshConfigTemplateTag< MeshConverterConfigTag > using GlobalIndexType = GlobalIndex; using LocalIndexType = LocalIndex; - static constexpr int worldDimension = WorldDimension; + static constexpr int spaceDimension = SpaceDimension; static constexpr int meshDimension = Cell::dimension; template< typename EntityTopology > diff --git a/src/Tools/tnl-test-distributed-mesh.h b/src/Tools/tnl-test-distributed-mesh.h index 65e4c6348..38cd8f6c2 100644 --- a/src/Tools/tnl-test-distributed-mesh.h +++ b/src/Tools/tnl-test-distributed-mesh.h @@ -40,10 +40,10 @@ template<> struct MeshCellTopologyTag< MyConfigTag, Topologies::Triangle > { enu template<> struct MeshCellTopologyTag< MyConfigTag, Topologies::Tetrahedron > { enum { enabled = true }; }; //template<> struct MeshCellTopologyTag< MyConfigTag, Topologies::Hexahedron > { enum { enabled = true }; }; -// Meshes are enabled only for the world dimension equal to the cell dimension. -template< typename CellTopology, int WorldDimension > -struct MeshWorldDimensionTag< MyConfigTag, CellTopology, WorldDimension > -{ enum { enabled = ( WorldDimension == CellTopology::dimension ) }; }; +// Meshes are enabled only for the space dimension equal to the cell dimension. +template< typename CellTopology, int SpaceDimension > +struct MeshSpaceDimensionTag< MyConfigTag, CellTopology, SpaceDimension > +{ enum { enabled = ( SpaceDimension == CellTopology::dimension ) }; }; // Meshes are enabled only for types explicitly listed below. template<> struct MeshRealTag< MyConfigTag, float > { enum { enabled = true }; }; @@ -57,7 +57,7 @@ template<> struct MeshConfigTemplateTag< MyConfigTag > { template< typename Cell, - int WorldDimension = Cell::dimension, + int SpaceDimension = Cell::dimension, typename Real = double, typename GlobalIndex = int, typename LocalIndex = GlobalIndex > @@ -68,7 +68,7 @@ struct MeshConfigTemplateTag< MyConfigTag > using GlobalIndexType = GlobalIndex; using LocalIndexType = LocalIndex; - static constexpr int worldDimension = WorldDimension; + static constexpr int spaceDimension = SpaceDimension; static constexpr int meshDimension = Cell::dimension; template< typename EntityTopology > -- GitLab From 9fa0f15763d20eaadf65aa6d4bfd524841f84ed8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= Date: Thu, 21 Oct 2021 10:39:53 +0200 Subject: [PATCH 2/2] Simplified mesh configuration Storage of subentities, superentities and tags is configured by dimension rather than entity topology. --- Documentation/Tutorials/Meshes/GameOfLife.cpp | 15 ++++++-------- .../Meshes/MeshConfigurationExample.cpp | 5 ++--- src/TNL/Meshes/DefaultConfig.h | 14 +++++-------- .../DistributedMeshes/DistributedMesh.h | 4 ++-- src/TNL/Meshes/MeshDetails/ConfigValidator.h | 18 ++++++++--------- .../initializer/EntityInitializer.h | 11 +++------- .../MeshDetails/layers/DualGraphLayer.h | 2 +- .../layers/EntityTags/ConfigValidator.h | 17 +++++++--------- .../layers/EntityTags/Initializer.h | 9 +++------ .../MeshDetails/layers/EntityTags/Traits.h | 3 +-- .../MeshDetails/traits/MeshSubentityTraits.h | 2 +- .../traits/MeshSuperentityTraits.h | 2 +- src/Tools/tnl-decompose-mesh.cpp | 15 ++++++-------- src/Tools/tnl-game-of-life.cpp | 15 ++++++-------- src/Tools/tnl-mesh-converter.cpp | 11 ++++------ src/Tools/tnl-test-distributed-mesh.h | 17 +++++++--------- src/UnitTests/Meshes/EntityTagsTest.h | 7 +++---- src/UnitTests/Meshes/MeshOrderingTest.h | 5 ++--- src/UnitTests/Meshes/MeshTest.h | 20 ++++++++----------- src/UnitTests/Meshes/MeshTraverserTest.h | 10 ++++------ 20 files changed, 81 insertions(+), 121 deletions(-) diff --git a/Documentation/Tutorials/Meshes/GameOfLife.cpp b/Documentation/Tutorials/Meshes/GameOfLife.cpp index 6f585d9ab..16cecc1ad 100644 --- a/Documentation/Tutorials/Meshes/GameOfLife.cpp +++ b/Documentation/Tutorials/Meshes/GameOfLife.cpp @@ -48,24 +48,21 @@ struct MeshConfigTemplateTag< MyConfigTag > struct MeshConfig : public DefaultConfig< Cell, SpaceDimension, Real, GlobalIndex, LocalIndex > { - template< typename EntityTopology > - static constexpr bool subentityStorage( EntityTopology, int SubentityDimension ) + static constexpr bool subentityStorage( int entityDimension, int SubentityDimension ) { - return SubentityDimension == 0 && EntityTopology::dimension >= Cell::dimension - 1; + return SubentityDimension == 0 && entityDimension >= Cell::dimension - 1; } - template< typename EntityTopology > - static constexpr bool superentityStorage( EntityTopology, int SuperentityDimension ) + static constexpr bool superentityStorage( int entityDimension, int SuperentityDimension ) { // return false; - return (EntityTopology::dimension == 0 || EntityTopology::dimension == Cell::dimension - 1) && SuperentityDimension == Cell::dimension; + return (entityDimension == 0 || entityDimension == Cell::dimension - 1) && SuperentityDimension == Cell::dimension; } - template< typename EntityTopology > - static constexpr bool entityTagsStorage( EntityTopology ) + static constexpr bool entityTagsStorage( int entityDimension ) { // return false; - return EntityTopology::dimension == 0 || EntityTopology::dimension >= Cell::dimension - 1; + return entityDimension == 0 || entityDimension >= Cell::dimension - 1; } static constexpr bool dualGraphStorage() diff --git a/Documentation/Tutorials/Meshes/MeshConfigurationExample.cpp b/Documentation/Tutorials/Meshes/MeshConfigurationExample.cpp index 383a80217..312e7dd4b 100644 --- a/Documentation/Tutorials/Meshes/MeshConfigurationExample.cpp +++ b/Documentation/Tutorials/Meshes/MeshConfigurationExample.cpp @@ -20,10 +20,9 @@ struct MeshConfigTemplateTag< MyConfigTag > struct MeshConfig : public DefaultConfig< Cell, SpaceDimension, Real, GlobalIndex, LocalIndex > { - template< typename EntityTopology > - static constexpr bool subentityStorage( EntityTopology, int SubentityDimension ) + static constexpr bool subentityStorage( int entityDimension, int subentityDimension ) { - return SubentityDimension == 0 && EntityTopology::dimension >= Cell::dimension - 1; + return subentityDimension == 0 && entityDimension >= Cell::dimension - 1; } }; }; diff --git a/src/TNL/Meshes/DefaultConfig.h b/src/TNL/Meshes/DefaultConfig.h index b8cb18605..abe1726a2 100644 --- a/src/TNL/Meshes/DefaultConfig.h +++ b/src/TNL/Meshes/DefaultConfig.h @@ -42,8 +42,7 @@ struct DefaultConfig /**** * Storage of subentities of mesh entities. */ - template< typename EntityTopology > - static constexpr bool subentityStorage( EntityTopology, int SubentityDimension ) + static constexpr bool subentityStorage( int entityDimension, int subentityDimension ) { return true; // Subvertices must be stored for all entities which appear in other @@ -54,8 +53,7 @@ struct DefaultConfig /**** * Storage of superentities of mesh entities. */ - template< typename EntityTopology > - static constexpr bool superentityStorage( EntityTopology, int SuperentityDimension ) + static constexpr bool superentityStorage( int entityDimension, int superentityDimension ) { return true; } @@ -69,12 +67,10 @@ struct DefaultConfig * - if dim(entity) < dim(face), the entities on which the tags are stored * must be stored as subentities of faces */ - template< typename EntityTopology > - static constexpr bool entityTagsStorage( EntityTopology ) + static constexpr bool entityTagsStorage( int entityDimension ) { - using FaceTopology = typename Topologies::Subtopology< CellTopology, meshDimension - 1 >::Topology; - return superentityStorage( FaceTopology(), meshDimension ) && - ( EntityTopology::dimension >= meshDimension - 1 || subentityStorage( FaceTopology(), EntityTopology::dimension ) ); + return superentityStorage( meshDimension - 1, meshDimension ) && + ( entityDimension >= meshDimension - 1 || subentityStorage( meshDimension - 1, entityDimension ) ); //return false; } diff --git a/src/TNL/Meshes/DistributedMeshes/DistributedMesh.h b/src/TNL/Meshes/DistributedMeshes/DistributedMesh.h index 210b6fa00..a0c5d29c5 100644 --- a/src/TNL/Meshes/DistributedMeshes/DistributedMesh.h +++ b/src/TNL/Meshes/DistributedMeshes/DistributedMesh.h @@ -90,9 +90,9 @@ public: using Face = typename MeshType::template EntityType< getMeshDimension() - 1 >; using Vertex = typename MeshType::template EntityType< 0 >; - static_assert( Mesh::Config::entityTagsStorage( typename Cell::EntityTopology{} ), + static_assert( Mesh::Config::entityTagsStorage( getMeshDimension() ), "DistributedMesh must store entity tags on cells" ); - static_assert( Mesh::Config::entityTagsStorage( typename Vertex::EntityTopology{} ), + static_assert( Mesh::Config::entityTagsStorage( 0 ), "DistributedMesh must store entity tags on vertices" ); diff --git a/src/TNL/Meshes/MeshDetails/ConfigValidator.h b/src/TNL/Meshes/MeshDetails/ConfigValidator.h index bd04275a7..665574c0d 100644 --- a/src/TNL/Meshes/MeshDetails/ConfigValidator.h +++ b/src/TNL/Meshes/MeshDetails/ConfigValidator.h @@ -28,11 +28,11 @@ template< typename MeshConfig, class ConfigValidatorSubtopologyLayer : public ConfigValidatorSubtopologyLayer< MeshConfig, EntityTopology, typename DimensionTag::Decrement > { - static_assert( ! MeshConfig::subentityStorage( EntityTopology(), DimensionTag::value ) || - MeshConfig::subentityStorage( EntityTopology(), 0 ), + static_assert( ! MeshConfig::subentityStorage( EntityTopology::dimension, DimensionTag::value ) || + MeshConfig::subentityStorage( EntityTopology::dimension, 0 ), "entities of which subentities are stored must store their subvertices" ); - static_assert( ! MeshConfig::subentityStorage( EntityTopology(), DimensionTag::value ) || - MeshConfig::subentityStorage( EntityTopology(), 0 ), + static_assert( ! MeshConfig::subentityStorage( EntityTopology::dimension, DimensionTag::value ) || + MeshConfig::subentityStorage( EntityTopology::dimension, 0 ), "entities that are stored as subentities must store their subvertices" ); }; @@ -48,11 +48,11 @@ template< typename MeshConfig, class ConfigValidatorSupertopologyLayer : public ConfigValidatorSupertopologyLayer< MeshConfig, EntityTopology, typename DimensionTag::Decrement > { - static_assert( ! MeshConfig::superentityStorage( EntityTopology(), DimensionTag::value ) || - MeshConfig::subentityStorage( EntityTopology(), 0 ), + static_assert( ! MeshConfig::superentityStorage( EntityTopology::dimension, DimensionTag::value ) || + MeshConfig::subentityStorage( EntityTopology::dimension, 0 ), "entities of which superentities are stored must store their subvertices"); - static_assert( ! MeshConfig::superentityStorage( EntityTopology(), DimensionTag::value ) || - MeshConfig::subentityStorage( EntityTopology(), 0 ), + static_assert( ! MeshConfig::superentityStorage( EntityTopology::dimension, DimensionTag::value ) || + MeshConfig::subentityStorage( EntityTopology::dimension, 0 ), "entities that are stored as superentities must store their subvertices"); }; @@ -87,7 +87,7 @@ class ConfigValidatorLayerCell { using CellTopology = typename MeshConfig::CellTopology; - static_assert( MeshConfig::subentityStorage( CellTopology(), 0 ), + static_assert( MeshConfig::subentityStorage( CellTopology::dimension, 0 ), "subvertices of cells must be stored" ); }; diff --git a/src/TNL/Meshes/MeshDetails/initializer/EntityInitializer.h b/src/TNL/Meshes/MeshDetails/initializer/EntityInitializer.h index 498dc27fe..d7bab6523 100644 --- a/src/TNL/Meshes/MeshDetails/initializer/EntityInitializer.h +++ b/src/TNL/Meshes/MeshDetails/initializer/EntityInitializer.h @@ -29,21 +29,16 @@ template< typename MeshConfig, typename SubdimensionTag, typename SuperdimensionTag, // storage in the superentity - bool SubentityStorage = - MeshConfig::subentityStorage( typename MeshTraits< MeshConfig >::template EntityTraits< SuperdimensionTag::value >::EntityTopology(), - SubdimensionTag::value ), + bool SubentityStorage = MeshConfig::subentityStorage( SuperdimensionTag::value, SubdimensionTag::value ), // storage in the subentity - bool SuperentityStorage = - MeshConfig::superentityStorage( typename MeshTraits< MeshConfig >::template EntityTraits< SubdimensionTag::value >::EntityTopology(), - SuperdimensionTag::value ), + bool SuperentityStorage = MeshConfig::superentityStorage( SubdimensionTag::value, SuperdimensionTag::value ), // necessary to disambiguate the stop condition for specializations bool valid_dimension = ! std::is_same< SubdimensionTag, SuperdimensionTag >::value > class EntityInitializerLayer; template< typename MeshConfig, typename EntityTopology, - bool SubvertexStorage = - MeshConfig::subentityStorage( typename MeshTraits< MeshConfig >::template EntityTraits< EntityTopology::dimension >::EntityTopology(), 0 ) > + bool SubvertexStorage = MeshConfig::subentityStorage( EntityTopology::dimension, 0 ) > class EntityInitializer : public EntityInitializerLayer< MeshConfig, DimensionTag< EntityTopology::dimension >, diff --git a/src/TNL/Meshes/MeshDetails/layers/DualGraphLayer.h b/src/TNL/Meshes/MeshDetails/layers/DualGraphLayer.h index f171f4469..3ca05fc00 100644 --- a/src/TNL/Meshes/MeshDetails/layers/DualGraphLayer.h +++ b/src/TNL/Meshes/MeshDetails/layers/DualGraphLayer.h @@ -87,7 +87,7 @@ public: { static_assert( std::is_same< MeshConfig, typename Mesh::Config >::value, "mismatched MeshConfig type" ); - static_assert( MeshConfig::superentityStorage( typename Mesh::Vertex::EntityTopology{}, Mesh::getMeshDimension() ), + static_assert( MeshConfig::superentityStorage( 0, Mesh::getMeshDimension() ), "The dual graph cannot be initialized when links from vertices to cells are not stored in the mesh." ); static_assert( MeshConfig::dualGraphMinCommonVertices >= 1, "MeshConfig error: dualGraphMinCommonVertices must be at least 1." ); diff --git a/src/TNL/Meshes/MeshDetails/layers/EntityTags/ConfigValidator.h b/src/TNL/Meshes/MeshDetails/layers/EntityTags/ConfigValidator.h index 3aa4963c3..216c755e4 100644 --- a/src/TNL/Meshes/MeshDetails/layers/EntityTags/ConfigValidator.h +++ b/src/TNL/Meshes/MeshDetails/layers/EntityTags/ConfigValidator.h @@ -18,21 +18,19 @@ namespace Meshes { namespace EntityTags { template< typename MeshConfig, - typename EntityTopology, - bool entityTagsStorage = MeshConfig::entityTagsStorage( EntityTopology() ) > + int EntityDimension, + bool entityTagsStorage = MeshConfig::entityTagsStorage( EntityDimension ) > class ConfigValidatorEntityTagsLayer { - using FaceTopology = typename Topologies::Subtopology< typename MeshConfig::CellTopology, MeshConfig::meshDimension - 1 >::Topology; - - static_assert( MeshConfig::superentityStorage( FaceTopology(), MeshConfig::meshDimension ), + static_assert( MeshConfig::superentityStorage( MeshConfig::meshDimension - 1, MeshConfig::meshDimension ), "Faces must store the cell superentity indices when any entity has boundary tags." ); - static_assert( EntityTopology::dimension >= MeshConfig::meshDimension - 1 || MeshConfig::subentityStorage( FaceTopology(), EntityTopology::dimension ), + static_assert( EntityDimension >= MeshConfig::meshDimension - 1 || MeshConfig::subentityStorage( MeshConfig::meshDimension - 1, EntityDimension ), "Faces must store the subentity indices of the entities on which the boundary tags are stored." ); }; template< typename MeshConfig, - typename EntityTopology > -class ConfigValidatorEntityTagsLayer< MeshConfig, EntityTopology, false > + int EntityDimension > +class ConfigValidatorEntityTagsLayer< MeshConfig, EntityDimension, false > { }; @@ -40,8 +38,7 @@ class ConfigValidatorEntityTagsLayer< MeshConfig, EntityTopology, false > template< typename MeshConfig, int dimension = MeshConfig::meshDimension > class ConfigValidatorLayer : public ConfigValidatorLayer< MeshConfig, dimension - 1 >, - public ConfigValidatorEntityTagsLayer< MeshConfig, - typename MeshTraits< MeshConfig >::template EntityTraits< dimension >::EntityTopology > + public ConfigValidatorEntityTagsLayer< MeshConfig, dimension > { }; diff --git a/src/TNL/Meshes/MeshDetails/layers/EntityTags/Initializer.h b/src/TNL/Meshes/MeshDetails/layers/EntityTags/Initializer.h index 55d55890f..8b44ae593 100644 --- a/src/TNL/Meshes/MeshDetails/layers/EntityTags/Initializer.h +++ b/src/TNL/Meshes/MeshDetails/layers/EntityTags/Initializer.h @@ -35,16 +35,14 @@ protected: template< typename CurrentDimension = DimensionTag< MeshConfig::meshDimension >, typename _T = void > struct EntityTagsNeedInitialization { - using EntityTopology = typename MeshEntityTraits< MeshConfig, DeviceType, CurrentDimension::value >::EntityTopology; - static constexpr bool value = MeshConfig::entityTagsStorage( EntityTopology() ) || + static constexpr bool value = MeshConfig::entityTagsStorage( CurrentDimension::value ) || EntityTagsNeedInitialization< typename CurrentDimension::Decrement >::value; }; template< typename _T > struct EntityTagsNeedInitialization< DimensionTag< 0 >, _T > { - using EntityTopology = typename MeshEntityTraits< MeshConfig, DeviceType, 0 >::EntityTopology; - static constexpr bool value = MeshConfig::entityTagsStorage( EntityTopology() ); + static constexpr bool value = MeshConfig::entityTagsStorage( 0 ); }; template< int Dimension > @@ -80,8 +78,7 @@ protected: template< int Subdimension > class InitializeSubentities { - using SubentityTopology = typename MeshEntityTraits< MeshConfig, DeviceType, Subdimension >::EntityTopology; - static constexpr bool enabled = MeshConfig::entityTagsStorage( SubentityTopology() ); + static constexpr bool enabled = MeshConfig::entityTagsStorage( Subdimension ); // _T is necessary to force *partial* specialization, since explicit specializations // at class scope are forbidden diff --git a/src/TNL/Meshes/MeshDetails/layers/EntityTags/Traits.h b/src/TNL/Meshes/MeshDetails/layers/EntityTags/Traits.h index b7c28f155..eee755f7c 100644 --- a/src/TNL/Meshes/MeshDetails/layers/EntityTags/Traits.h +++ b/src/TNL/Meshes/MeshDetails/layers/EntityTags/Traits.h @@ -22,8 +22,7 @@ template< typename MeshConfig, bool sensible = (DimensionTag::value <= MeshConfig::meshDimension) > struct WeakStorageTrait { - using EntityTopology = typename MeshTraits< MeshConfig >::template EntityTraits< DimensionTag::value >::EntityTopology; - static constexpr bool entityTagsEnabled = MeshConfig::entityTagsStorage( EntityTopology() ); + static constexpr bool entityTagsEnabled = MeshConfig::entityTagsStorage( DimensionTag::value ); }; template< typename MeshConfig, diff --git a/src/TNL/Meshes/MeshDetails/traits/MeshSubentityTraits.h b/src/TNL/Meshes/MeshDetails/traits/MeshSubentityTraits.h index b5d3df4d5..830db3f2b 100644 --- a/src/TNL/Meshes/MeshDetails/traits/MeshSubentityTraits.h +++ b/src/TNL/Meshes/MeshDetails/traits/MeshSubentityTraits.h @@ -36,7 +36,7 @@ public: static_assert( 0 <= Dimension && Dimension <= MeshConfig::meshDimension, "invalid dimension" ); static_assert( EntityTopology::dimension > Dimension, "Subentity dimension must be smaller than the entity dimension." ); - static constexpr bool storageEnabled = MeshConfig::subentityStorage( EntityTopology(), Dimension ); + static constexpr bool storageEnabled = MeshConfig::subentityStorage( EntityTopology::dimension, Dimension ); static constexpr int count = Topologies::Subtopology< EntityTopology, Dimension >::count; using SubentityTopology = typename MeshEntityTraits< MeshConfig, Device, Dimension >::EntityTopology; diff --git a/src/TNL/Meshes/MeshDetails/traits/MeshSuperentityTraits.h b/src/TNL/Meshes/MeshDetails/traits/MeshSuperentityTraits.h index 4b5e38819..7c2714843 100644 --- a/src/TNL/Meshes/MeshDetails/traits/MeshSuperentityTraits.h +++ b/src/TNL/Meshes/MeshDetails/traits/MeshSuperentityTraits.h @@ -34,7 +34,7 @@ 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 ); + static constexpr bool storageEnabled = MeshConfig::superentityStorage( EntityTopology::dimension, Dimension ); using SuperentityTopology = typename MeshEntityTraits< MeshConfig, Device, Dimension >::EntityTopology; using SuperentityType = typename MeshEntityTraits< MeshConfig, Device, Dimension >::EntityType; diff --git a/src/Tools/tnl-decompose-mesh.cpp b/src/Tools/tnl-decompose-mesh.cpp index 98443a770..39612729b 100644 --- a/src/Tools/tnl-decompose-mesh.cpp +++ b/src/Tools/tnl-decompose-mesh.cpp @@ -81,24 +81,21 @@ struct MeshConfigTemplateTag< DecomposeMeshConfigTag > static constexpr int spaceDimension = SpaceDimension; static constexpr int meshDimension = Cell::dimension; - template< typename EntityTopology > - static constexpr bool subentityStorage( EntityTopology, int SubentityDimension ) + static constexpr bool subentityStorage( int entityDimension, int subentityDimension ) { // subvertices of faces are needed due to cell boundary tags - return SubentityDimension == 0 && EntityTopology::dimension >= meshDimension - 1; + return subentityDimension == 0 && entityDimension >= meshDimension - 1; } - template< typename EntityTopology > - static constexpr bool superentityStorage( EntityTopology, int SuperentityDimension ) + static constexpr bool superentityStorage( int entityDimension, int superentityDimension ) { // superentities from faces to cells are needed due to cell boundary tags - return SuperentityDimension == meshDimension && EntityTopology::dimension == meshDimension - 1; + return superentityDimension == meshDimension && entityDimension == meshDimension - 1; } - template< typename EntityTopology > - static constexpr bool entityTagsStorage( EntityTopology ) + static constexpr bool entityTagsStorage( int entityDimension ) { - return EntityTopology::dimension >= meshDimension - 1; + return entityDimension >= meshDimension - 1; } static constexpr bool dualGraphStorage() diff --git a/src/Tools/tnl-game-of-life.cpp b/src/Tools/tnl-game-of-life.cpp index 541b21378..e2f19c2ea 100644 --- a/src/Tools/tnl-game-of-life.cpp +++ b/src/Tools/tnl-game-of-life.cpp @@ -62,24 +62,21 @@ struct MeshConfigTemplateTag< MyConfigTag > struct MeshConfig : public DefaultConfig< Cell, SpaceDimension, Real, GlobalIndex, LocalIndex > { - template< typename EntityTopology > - static constexpr bool subentityStorage( EntityTopology, int SubentityDimension ) + static constexpr bool subentityStorage( int entityDimension, int subentityDimension ) { - return SubentityDimension == 0 && EntityTopology::dimension >= Cell::dimension - 1; + return subentityDimension == 0 && entityDimension >= Cell::dimension - 1; } - template< typename EntityTopology > - static constexpr bool superentityStorage( EntityTopology, int SuperentityDimension ) + static constexpr bool superentityStorage( int entityDimension, int superentityDimension ) { // return false; - return (EntityTopology::dimension == 0 || EntityTopology::dimension == Cell::dimension - 1) && SuperentityDimension == Cell::dimension; + return (entityDimension == 0 || entityDimension == Cell::dimension - 1) && superentityDimension == Cell::dimension; } - template< typename EntityTopology > - static constexpr bool entityTagsStorage( EntityTopology ) + static constexpr bool entityTagsStorage( int entityDimension ) { // return false; - return EntityTopology::dimension == 0 || EntityTopology::dimension >= Cell::dimension - 1; + return entityDimension == 0 || entityDimension >= Cell::dimension - 1; } static constexpr bool dualGraphStorage() diff --git a/src/Tools/tnl-mesh-converter.cpp b/src/Tools/tnl-mesh-converter.cpp index 9f191904a..bbaf82175 100644 --- a/src/Tools/tnl-mesh-converter.cpp +++ b/src/Tools/tnl-mesh-converter.cpp @@ -75,20 +75,17 @@ struct MeshConfigTemplateTag< MeshConverterConfigTag > static constexpr int spaceDimension = SpaceDimension; static constexpr int meshDimension = Cell::dimension; - template< typename EntityTopology > - static constexpr bool subentityStorage( EntityTopology, int SubentityDimension ) + static constexpr bool subentityStorage( int entityDimension, int subentityDimension ) { - return SubentityDimension == 0 && EntityTopology::dimension == meshDimension; + return subentityDimension == 0 && entityDimension == meshDimension; } - template< typename EntityTopology > - static constexpr bool superentityStorage( EntityTopology, int SuperentityDimension ) + static constexpr bool superentityStorage( int entityDimension, int superentityDimension ) { return false; } - template< typename EntityTopology > - static constexpr bool entityTagsStorage( EntityTopology ) + static constexpr bool entityTagsStorage( int entityDimension ) { return false; } diff --git a/src/Tools/tnl-test-distributed-mesh.h b/src/Tools/tnl-test-distributed-mesh.h index 38cd8f6c2..47e326676 100644 --- a/src/Tools/tnl-test-distributed-mesh.h +++ b/src/Tools/tnl-test-distributed-mesh.h @@ -71,25 +71,22 @@ struct MeshConfigTemplateTag< MyConfigTag > static constexpr int spaceDimension = SpaceDimension; static constexpr int meshDimension = Cell::dimension; - template< typename EntityTopology > - static constexpr bool subentityStorage( EntityTopology, int SubentityDimension ) + static constexpr bool subentityStorage( int entityDimension, int subentityDimension ) { - return ( SubentityDimension == 0 && EntityTopology::dimension >= meshDimension - 1 ) - || SubentityDimension == meshDimension - 1; + return ( subentityDimension == 0 && entityDimension >= meshDimension - 1 ) + || subentityDimension == meshDimension - 1; } - template< typename EntityTopology > - static constexpr bool superentityStorage( EntityTopology, int SuperentityDimension ) + static constexpr bool superentityStorage( int entityDimension, int superentityDimension ) { // return false; - return (EntityTopology::dimension == 0 || EntityTopology::dimension == meshDimension - 1) && SuperentityDimension >= meshDimension - 1; + return (entityDimension == 0 || entityDimension == meshDimension - 1) && superentityDimension >= meshDimension - 1; } - template< typename EntityTopology > - static constexpr bool entityTagsStorage( EntityTopology ) + static constexpr bool entityTagsStorage( int entityDimension ) { // return false; - return EntityTopology::dimension == 0 || EntityTopology::dimension >= meshDimension - 1; + return entityDimension == 0 || entityDimension >= meshDimension - 1; } static constexpr bool dualGraphStorage() diff --git a/src/UnitTests/Meshes/EntityTagsTest.h b/src/UnitTests/Meshes/EntityTagsTest.h index 855e29249..775cb1aeb 100644 --- a/src/UnitTests/Meshes/EntityTagsTest.h +++ b/src/UnitTests/Meshes/EntityTagsTest.h @@ -23,10 +23,9 @@ using IndexType = int; class TestQuadrangleMeshConfig : public DefaultConfig< Topologies::Quadrangle > { public: - static constexpr bool entityStorage( int dimensions ) { return true; } - template< typename EntityTopology > static constexpr bool subentityStorage( EntityTopology, int SubentityDimensions ) { return true; } - template< typename EntityTopology > static constexpr bool superentityStorage( EntityTopology, int SuperentityDimensions ) { return true; } - template< typename EntityTopology > static constexpr bool boundaryTagsStorage( EntityTopology ) { return true; } + static constexpr bool subentityStorage( int entityDimension, int subentityDimension ) { return true; } + static constexpr bool superentityStorage( int entityDimension, int superentityDimension ) { return true; } + static constexpr bool boundaryTagsStorage( int entityDimension ) { return true; } }; TEST( MeshTest, RegularMeshOfQuadranglesTest ) diff --git a/src/UnitTests/Meshes/MeshOrderingTest.h b/src/UnitTests/Meshes/MeshOrderingTest.h index 4d5d2e512..998e8b245 100644 --- a/src/UnitTests/Meshes/MeshOrderingTest.h +++ b/src/UnitTests/Meshes/MeshOrderingTest.h @@ -20,9 +20,8 @@ class TestTriangleMeshConfig : public DefaultConfig< Topologies::Triangle, 2, double, int, short int > { public: - static constexpr bool entityStorage( int dimensions ) { return true; } - template< typename EntityTopology > static constexpr bool subentityStorage( EntityTopology, int SubentityDimensions ) { return true; } - template< typename EntityTopology > static constexpr bool superentityStorage( EntityTopology, int SuperentityDimensions ) { return true; } + static constexpr bool subentityStorage( int entityDimension, int subentityDimension ) { return true; } + static constexpr bool superentityStorage( int entityDimension, int superentityDimension ) { return true; } }; template< typename Device > diff --git a/src/UnitTests/Meshes/MeshTest.h b/src/UnitTests/Meshes/MeshTest.h index aa5d4cfda..9125e04e8 100644 --- a/src/UnitTests/Meshes/MeshTest.h +++ b/src/UnitTests/Meshes/MeshTest.h @@ -30,33 +30,29 @@ using IndexType = int; class TestTriangleMeshConfig : public DefaultConfig< Topologies::Triangle > { public: - static constexpr bool entityStorage( int dimensions ) { return true; } - template< typename EntityTopology > static constexpr bool subentityStorage( EntityTopology, int SubentityDimensions ) { return true; } - template< typename EntityTopology > static constexpr bool superentityStorage( EntityTopology, int SuperentityDimensions ) { return true; } + static constexpr bool subentityStorage( int entityDimension, int subentityDimension ) { return true; } + static constexpr bool superentityStorage( int entityDimension, int superentityDimension ) { return true; } }; class TestQuadrangleMeshConfig : public DefaultConfig< Topologies::Quadrangle > { public: - static constexpr bool entityStorage( int dimensions ) { return true; } - template< typename EntityTopology > static constexpr bool subentityStorage( EntityTopology, int SubentityDimensions ) { return true; } - template< typename EntityTopology > static constexpr bool superentityStorage( EntityTopology, int SuperentityDimensions ) { return true; } + static constexpr bool subentityStorage( int entityDimension, int subentityDimension ) { return true; } + static constexpr bool superentityStorage( int entityDimension, int superentityDimension ) { return true; } }; class TestTetrahedronMeshConfig : public DefaultConfig< Topologies::Tetrahedron > { public: - static constexpr bool entityStorage( int dimensions ) { return true; } - template< typename EntityTopology > static constexpr bool subentityStorage( EntityTopology, int SubentityDimensions ) { return true; } - template< typename EntityTopology > static constexpr bool superentityStorage( EntityTopology, int SuperentityDimensions ) { return true; } + static constexpr bool subentityStorage( int entityDimension, int subentityDimension ) { return true; } + static constexpr bool superentityStorage( int entityDimension, int superentityDimension ) { return true; } }; class TestHexahedronMeshConfig : public DefaultConfig< Topologies::Hexahedron > { public: - static constexpr bool entityStorage( int dimensions ) { return true; } - template< typename EntityTopology > static constexpr bool subentityStorage( EntityTopology, int SubentityDimensions ) { return true; } - template< typename EntityTopology > static constexpr bool superentityStorage( EntityTopology, int SuperentityDimensions ) { return true; } + static constexpr bool subentityStorage( int entityDimension, int subentityDimension ) { return true; } + static constexpr bool superentityStorage( int entityDimension, int superentityDimension ) { return true; } }; template< typename Object1, typename Object2 > diff --git a/src/UnitTests/Meshes/MeshTraverserTest.h b/src/UnitTests/Meshes/MeshTraverserTest.h index 2a0a9ce9a..d0c16bfe4 100644 --- a/src/UnitTests/Meshes/MeshTraverserTest.h +++ b/src/UnitTests/Meshes/MeshTraverserTest.h @@ -23,17 +23,15 @@ using IndexType = int; class TestQuadrangleMeshConfig : public DefaultConfig< Topologies::Quadrangle > { public: - static constexpr bool entityStorage( int dimensions ) { return true; } - template< typename EntityTopology > static constexpr bool subentityStorage( EntityTopology, int SubentityDimensions ) { return true; } - template< typename EntityTopology > static constexpr bool superentityStorage( EntityTopology, int SuperentityDimensions ) { return true; } + static constexpr bool subentityStorage( int entityDimension, int subentityDimension ) { return true; } + static constexpr bool superentityStorage( int entityDimension, int superentityDimension ) { return true; } }; class TestHexahedronMeshConfig : public DefaultConfig< Topologies::Hexahedron > { public: - static constexpr bool entityStorage( int dimensions ) { return true; } - template< typename EntityTopology > static constexpr bool subentityStorage( EntityTopology, int SubentityDimensions ) { return true; } - template< typename EntityTopology > static constexpr bool superentityStorage( EntityTopology, int SuperentityDimensions ) { return true; } + static constexpr bool subentityStorage( int entityDimension, int subentityDimension ) { return true; } + static constexpr bool superentityStorage( int entityDimension, int superentityDimension ) { return true; } }; struct TestEntitiesProcessor -- GitLab