44 return _data[node_id].size();
48 std::size_t
const node_id)
const
50 return _data[node_id];
56 if (
_data.size() != nodes.size())
58 _data.resize(nodes.size());
61 auto const& connections =
63 for (
auto const* node : nodes)
65 auto const node_id = node->getID();
66 auto const& connected_nodes = connections[node_id];
67 std::vector<std::size_t>& row =
_data[node_id];
68 row.reserve(connected_nodes.size());
69 std::transform(connected_nodes.cbegin(), connected_nodes.cend(),
70 std::back_inserter(row),
71 [](
Node const*
const n) { return n->getID(); });
76 std::vector<std::vector<std::size_t>>
_data;
Definition of the Mesh class.
Definition of the Node class.
std::vector< Node * > const & getNodes() const
Get the nodes-vector for the mesh.
void createTable(Mesh const &mesh)
std::size_t getNodeDegree(std::size_t const node_id) const
std::vector< std::vector< std::size_t > > _data
NodeAdjacencyTable(Mesh const &mesh)
std::vector< std::size_t > const & getAdjacentNodes(std::size_t const node_id) const
std::vector< std::vector< Node * > > calculateNodesConnectedByElements(Mesh const &mesh)