Commit 94bab4a6 authored by Praetorius, Simon's avatar Praetorius, Simon

dune 2.6 can not used forEachLeafNode

parent 639d762d
Pipeline #1493 failed with stage
in 7 minutes and 49 seconds
......@@ -38,6 +38,8 @@ namespace Dune
std::swap(oldVector, newVector);
}
#if DUNE_VERSION_GT(DUNE_GRID,2,6)
template <class Vector, class Basis>
void operator()(Vector const& oldVector, Basis const& oldBasis,
Vector& newVector, Basis const& newBasis) const
......@@ -61,6 +63,32 @@ namespace Dune
});
}
}
#else
template <class Vector, class Basis>
void operator()(Vector const& oldVector, Basis const& oldBasis,
Vector& newVector, Basis const& newBasis) const
{
auto oldCoeff = Functions::istlVectorBackend(oldVector);
auto newCoeff = Functions::istlVectorBackend(newVector);
newCoeff.resize(newBasis);
for (const auto& e : master_leaf_elements(grids_, master_))
{
// NOTE: entities are not necessarily leaf entities
auto const& oldEntity = e[1 - master_];
auto const& newEntity = e[master_];
auto oldLocalView = oldBasis.localView();
auto newLocalView = newBasis.localView();
auto isLeafNode = std::integral_constant<bool, oldLocalView.tree().isLeaf && newLocalView.tree().isLeaf>{};
assert(isLeafNode);
Hybrid::ifElse(isLeafNode, [&](auto id) {
this->interpolate(oldCoeff, oldEntity, id(oldLocalView), newCoeff, newEntity, id(newLocalView));
});
}
}
#endif
template <class OldCoeff, class NewCoeff, class LocalView>
void interpolate(OldCoeff oldCoeff, const HostEntity& oldEntity, LocalView& oldLocalView,
......
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