MCPcopy Create free account
hub / github.com/FEniCS/dolfinx / weights_src

Method weights_src

cpp/dolfinx/common/IndexMap.cpp:1316–1329  ·  view source on GitHub ↗

-----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1314std::span<const int> IndexMap::dest() const noexcept { return _dest; }
1315//-----------------------------------------------------------------------------
1316std::vector<std::int32_t> IndexMap::weights_src() const
1317{
1318 std::vector<std::int32_t> weights(_src.size(), 0);
1319 for (int r : _owners)
1320 {
1321 auto it = std::ranges::lower_bound(_src, r);
1322 assert(it != _src.end() and *it == r);
1323 std::size_t pos = std::distance(_src.begin(), it);
1324 assert(pos < weights.size());
1325 weights[pos] += 1;
1326 }
1327
1328 return weights;
1329}
1330//-----------------------------------------------------------------------------
1331std::vector<std::int32_t> IndexMap::weights_dest() const
1332{

Callers 2

weights_destMethod · 0.95
test_rank_weightsFunction · 0.80

Calls 1

sizeMethod · 0.45

Tested by 1

test_rank_weightsFunction · 0.64