14#include <range/v3/range/conversion.hpp>
15#include <range/v3/view/transform.hpp>
32 npmesh.getMaximumNConnectedNodesToNode();
46 auto const global_idcs =
48 ranges::views::transform([&](
auto&& l)
50 ranges::to<std::vector>();
57 auto const& an = node_adjacency_table.getAdjacentNodes(n);
58 auto const n_self_dof = global_idcs[n].size();
59 auto const n_connected_dof =
60 std::accumulate(cbegin(an), cend(an), 0,
61 [&](
auto const result,
auto const i)
62 {
return result + global_idcs[i].size(); });
63 auto const n_dof = n_self_dof + n_connected_dof;
64 for (
auto global_index : global_idcs[n])
66 sparsity_pattern[global_index] = n_dof;
70 return sparsity_pattern;
82 return computeSparsityPatternNonPETSc(dof_table, mesh);
GlobalSparsityPattern computeSparsityPatternPETSc(NumLib::LocalToGlobalIndexMap const &dof_table, MeshLib::Mesh const &mesh)
MathLib::SparsityPattern< GlobalIndexType > GlobalSparsityPattern
Definition of mesh class for partitioned mesh (by node) for parallel computing within the framework o...
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.