7#include <range/v3/range/conversion.hpp>
8#include <range/v3/view/transform.hpp>
25 npmesh.getMaximumNConnectedNodesToNode();
39 auto const global_idcs =
41 ranges::views::transform([&](
auto&& l)
43 ranges::to<std::vector>();
50 auto const& an = node_adjacency_table.getAdjacentNodes(n);
51 auto const n_self_dof = global_idcs[n].size();
52 auto const n_connected_dof =
53 std::accumulate(cbegin(an), cend(an), 0,
54 [&](
auto const result,
auto const i)
55 {
return result + global_idcs[i].size(); });
56 auto const n_dof = n_self_dof + n_connected_dof;
57 for (
auto global_index : global_idcs[n])
59 sparsity_pattern[global_index] = n_dof;
63 return sparsity_pattern;
75 return computeSparsityPatternNonPETSc(dof_table, mesh);
GlobalSparsityPattern computeSparsityPatternPETSc(NumLib::LocalToGlobalIndexMap const &dof_table, MeshLib::Mesh const &mesh)
MathLib::SparsityPattern< GlobalIndexType > GlobalSparsityPattern
std::size_t getNumberOfNodes() const
Get the number of nodes.
std::size_t dofSizeWithGhosts() const
int getNumberOfGlobalComponents() const
std::vector< GlobalIndexType > getGlobalIndices(const MeshLib::Location &l) const
Forwards the respective method from MeshComponentMap.
auto meshLocations(Mesh const &mesh, MeshItemType const item_type)
GlobalSparsityPattern computeSparsityPattern(LocalToGlobalIndexMap const &dof_table, MeshLib::Mesh const &mesh)
Computes a sparsity pattern for the given inputs.