Loading src/TNL/Meshes/MeshEntity.h +3 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,9 @@ class MeshEntity protected MeshSuperentityAccess< MeshConfig, EntityTopology_ >, public MeshEntityIndex< typename MeshConfig::IdType > { static_assert( is_compatible_topology< typename MeshConfig::CellTopology, EntityTopology_ >::value, "Specified entity topology is not compatible with the MeshConfig." ); public: using MeshTraitsType = MeshTraits< MeshConfig >; using EntityTopology = EntityTopology_; Loading src/TNL/Meshes/Topologies/MeshEntityTopology.h +19 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ #pragma once #include <type_traits> #include <TNL/Meshes/DimensionTag.h> namespace TNL { Loading Loading @@ -50,5 +52,22 @@ struct MeshEntityTopology< MeshConfig, DimensionTag< MeshConfig::CellTopology::d using Topology = typename MeshConfig::CellTopology; }; /* Helper struct to determine if one topology is compatible with another one. */ template< typename Supertopology, typename Subtopology > struct is_compatible_topology { static_assert( Supertopology::dimension >= Subtopology::dimension, "wrong order of topologies in template parameters" ); static constexpr bool value = std::is_same< typename MeshSubtopology< Supertopology, Subtopology::dimension >::Topology, Subtopology >::value; }; template< typename Supertopology > struct is_compatible_topology< Supertopology, Supertopology > { static constexpr bool value = true; }; } // namespace Meshes } // namespace TNL Loading
src/TNL/Meshes/MeshEntity.h +3 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,9 @@ class MeshEntity protected MeshSuperentityAccess< MeshConfig, EntityTopology_ >, public MeshEntityIndex< typename MeshConfig::IdType > { static_assert( is_compatible_topology< typename MeshConfig::CellTopology, EntityTopology_ >::value, "Specified entity topology is not compatible with the MeshConfig." ); public: using MeshTraitsType = MeshTraits< MeshConfig >; using EntityTopology = EntityTopology_; Loading
src/TNL/Meshes/Topologies/MeshEntityTopology.h +19 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ #pragma once #include <type_traits> #include <TNL/Meshes/DimensionTag.h> namespace TNL { Loading Loading @@ -50,5 +52,22 @@ struct MeshEntityTopology< MeshConfig, DimensionTag< MeshConfig::CellTopology::d using Topology = typename MeshConfig::CellTopology; }; /* Helper struct to determine if one topology is compatible with another one. */ template< typename Supertopology, typename Subtopology > struct is_compatible_topology { static_assert( Supertopology::dimension >= Subtopology::dimension, "wrong order of topologies in template parameters" ); static constexpr bool value = std::is_same< typename MeshSubtopology< Supertopology, Subtopology::dimension >::Topology, Subtopology >::value; }; template< typename Supertopology > struct is_compatible_topology< Supertopology, Supertopology > { static constexpr bool value = true; }; } // namespace Meshes } // namespace TNL