From eda39e8c93b087b7532499adb43d6a52f07e5a87 Mon Sep 17 00:00:00 2001 From: Stephane Del Pino <stephane.delpino44@gmail.com> Date: Wed, 29 Nov 2023 01:57:18 +0100 Subject: [PATCH] Associate numbering to all ItemOfItemType possible instances --- src/mesh/ItemOfItemType.hpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/mesh/ItemOfItemType.hpp b/src/mesh/ItemOfItemType.hpp index 8d27a599b..c6ec3cf16 100644 --- a/src/mesh/ItemOfItemType.hpp +++ b/src/mesh/ItemOfItemType.hpp @@ -30,4 +30,35 @@ using CellOfNode = ItemOfItemType<ItemType::cell, ItemType::node>; using FaceOfNode = ItemOfItemType<ItemType::face, ItemType::node>; using EdgeOfNode = ItemOfItemType<ItemType::edge, ItemType::node>; +template <ItemType sub_item_type, ItemType item_type> +constexpr inline int item_of_item_type_index; + +template <> +constexpr inline int item_of_item_type_index<ItemType::face, ItemType::cell> = 0; +template <> +constexpr inline int item_of_item_type_index<ItemType::edge, ItemType::cell> = 1; +template <> +constexpr inline int item_of_item_type_index<ItemType::node, ItemType::cell> = 2; + +template <> +constexpr inline int item_of_item_type_index<ItemType::cell, ItemType::face> = 3; +template <> +constexpr inline int item_of_item_type_index<ItemType::edge, ItemType::face> = 4; +template <> +constexpr inline int item_of_item_type_index<ItemType::node, ItemType::face> = 5; + +template <> +constexpr inline int item_of_item_type_index<ItemType::cell, ItemType::edge> = 6; +template <> +constexpr inline int item_of_item_type_index<ItemType::face, ItemType::edge> = 7; +template <> +constexpr inline int item_of_item_type_index<ItemType::node, ItemType::edge> = 8; + +template <> +constexpr inline int item_of_item_type_index<ItemType::cell, ItemType::node> = 9; +template <> +constexpr inline int item_of_item_type_index<ItemType::face, ItemType::node> = 10; +template <> +constexpr inline int item_of_item_type_index<ItemType::edge, ItemType::node> = 11; + #endif // ITEM_OF_ITEM_TYPE_HPP -- GitLab