Commit ef36a574 authored by Lukas Riedel's avatar Lukas Riedel

Support position vector output for FV backend vectors

The backend vector for FV solvers are trivially-blocked (block size 1),
therefore the container index only has a single entry. The function
`position_vector` now returns a valid position vector for a FV solver.
parent f1f5522a
......@@ -313,9 +313,18 @@ public:
constexpr auto block_size
= BackendVector::block_type::dimension;
const auto ci = x_view.cache().containerIndex(i);
const auto id_local = ci[0];
const auto id_global = ci[1];
const auto index = id_global * block_size + id_local;
size_t index;
// container index has size 1 (hopefully)
if constexpr (block_size <= 1) {
index = ci[0];
}
// container index has size 2 (hopefully)
else {
const auto id_local = ci[0];
const auto id_global = ci[1];
index = id_global * block_size + id_local;
}
// transform coordinates
const auto pos_global = e.geometry().global(pos);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment