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

Add number of item access

parent a0d1c80f
No related branches found
No related tags found
1 merge request!7Feature/itemvalue
......@@ -439,7 +439,7 @@ class Connectivity final
}
KOKKOS_INLINE_FUNCTION
size_t numberOfNodes() const
size_t numberOfNodes() const final
{
const auto& node_to_cell_matrix
= this->getMatrix(ItemType::node,ItemType::cell);
......@@ -447,7 +447,15 @@ class Connectivity final
}
KOKKOS_INLINE_FUNCTION
size_t numberOfFaces() const
size_t numberOfEdges() const final
{
const auto& edge_to_node_matrix
= this->getMatrix(ItemType::edge,ItemType::node);
return edge_to_node_matrix.numRows();
}
KOKKOS_INLINE_FUNCTION
size_t numberOfFaces() const final
{
const auto& face_to_node_matrix
= this->getMatrix(ItemType::face,ItemType::cell);
......@@ -455,7 +463,7 @@ class Connectivity final
}
KOKKOS_INLINE_FUNCTION
size_t numberOfCells() const
size_t numberOfCells() const final
{
const auto& cell_to_node_matrix
= this->getMatrix(ItemType::cell,ItemType::node);
......
......@@ -10,6 +10,42 @@ struct IConnectivity
getMatrix(const ItemType& item_type_0,
const ItemType& item_type_1) const = 0;
virtual size_t numberOfNodes() const = 0;
virtual size_t numberOfEdges() const = 0;
virtual size_t numberOfFaces() const = 0;
virtual size_t numberOfCells() const = 0;
template <ItemType item_type>
size_t numberOf() const = delete;
template <>
KOKKOS_INLINE_FUNCTION
size_t numberOf<ItemType::node>() const
{
return this->numberOfNodes();
}
template <>
KOKKOS_INLINE_FUNCTION
size_t numberOf<ItemType::edge>() const
{
return this->numberOfEdges();
}
template <>
KOKKOS_INLINE_FUNCTION
size_t numberOf<ItemType::face>() const
{
return this->numberOfFaces();
}
template <>
KOKKOS_INLINE_FUNCTION
size_t numberOf<ItemType::cell>() const
{
return this->numberOfCells();
}
IConnectivity() = default;
IConnectivity(const IConnectivity&) = delete;
~IConnectivity() = default;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment