Skip to content
Snippets Groups Projects
Commit 3e78df21 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Add itemLocalNumbersInTheirSubItems template version for genericity

parent bf7a8f8f
No related branches found
No related tags found
1 merge request!176Add HDF5 support
...@@ -570,6 +570,41 @@ class Connectivity final : public IConnectivity ...@@ -570,6 +570,41 @@ class Connectivity final : public IConnectivity
return m_node_local_numbers_in_their_edges; return m_node_local_numbers_in_their_edges;
} }
template <typename ItemOfItemType>
PUGS_INLINE SubItemValuePerItem<const uint16_t, ItemOfItemType>
itemLocalNumbersInTheirSubItems() const
{
if constexpr (std::is_same_v<ItemOfItemType, NodeOfCell>) {
return cellLocalNumbersInTheirNodes();
} else if constexpr (std::is_same_v<ItemOfItemType, EdgeOfCell>) {
return cellLocalNumbersInTheirEdges();
} else if constexpr (std::is_same_v<ItemOfItemType, FaceOfCell>) {
return cellLocalNumbersInTheirFaces();
} else if constexpr (std::is_same_v<ItemOfItemType, NodeOfFace> and (Dimension > 1)) {
return faceLocalNumbersInTheirNodes();
} else if constexpr (std::is_same_v<ItemOfItemType, EdgeOfFace> and (Dimension > 2)) {
return faceLocalNumbersInTheirEdges();
} else if constexpr (std::is_same_v<ItemOfItemType, CellOfFace>) {
return faceLocalNumbersInTheirCells();
} else if constexpr (std::is_same_v<ItemOfItemType, NodeOfEdge> and (Dimension > 1)) {
return edgeLocalNumbersInTheirNodes();
} else if constexpr (std::is_same_v<ItemOfItemType, FaceOfEdge> and (Dimension > 2)) {
return edgeLocalNumbersInTheirFaces()();
} else if constexpr (std::is_same_v<ItemOfItemType, CellOfEdge>) {
return edgeLocalNumbersInTheirCells();
} else if constexpr (std::is_same_v<ItemOfItemType, EdgeOfNode> and (Dimension > 1)) {
return nodeLocalNumbersInTheirEdges();
} else if constexpr (std::is_same_v<ItemOfItemType, FaceOfNode> and (Dimension > 1)) {
return nodeLocalNumbersInTheirFaces()();
} else if constexpr (std::is_same_v<ItemOfItemType, CellOfNode>) {
return nodeLocalNumbersInTheirCells();
} else {
// LCOV_EXCL_START
throw UnexpectedError("invalid ItemOfItemType");
// LCOV_EXCL_STOP
}
}
template <ItemType item_type> template <ItemType item_type>
size_t size_t
numberOfRefItemList() const numberOfRefItemList() const
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment