Global DOF IDs
For parallel computations one has to identify DOFs in the global grid uniquely. This requires knowledge of the connectivity of DOFs and can not generically be extracted from the global basis without any specialization.
So, this MR adds a global IdSet for DOFs in a GlobalBasis. The GlobalBasisIdSet
must be bound to an element and can then extract the globally unique id of a local DOF:
using IdSet = GlobalBasisIdSet<GlobalBasis>;
IdSet idSet(basis);
for (const auto& e : elements(basis.gridView()))
{
idSet.bind(e);
for (std::size_t i = 0; i < idSet.size(); ++i)
{
auto id = idSet.id(i);
}
idSet.unbind();
}
Merge request reports
Activity
- Resolved by Praetorius, Simon
There is an issue with
NodeIdSet<PowerPreBasis>
right now. It only binds to the first node, which makes certain calls (likenode.localIndex(...)
) return wrong results.We could basically copy-paste the implementation from
NodeIdSet<CompositePreBasis>
, however this would be likely inefficient since we have a homogeneous type ofPowerPreBases
. Is there some array-like structure that allows constructing from arguments, like below?protected: using SubPreBasis = typename PreBasis::SubPreBasis; using SubTreePath = decltype(Dune::TypeTree::push_back(std::declval<TP>(), std::size_t{})); using SubNodeIdSet = SomeContainer<NodeIdSet<SubPreBasis, SubTreePath>, C>; static const std::size_t children = C; public: NodeIdSet(GridView const& gridView) : subIds_(gridView) // initializes C objects {} /// \brief Bind the view to a grid element void bind(const Node& node) { node_ = &node; - subIds_.bind(node.child(0)); + for (std::size_t i = 0; i < children; ++i) + subIds_[i].bind(node.child(i)); } ... /// Maps from subtree index set [0..size-1] to a globally unique id in global basis template <class It> It fillIn(It it, size_type shift = 0) const { for (std::size_t i = 0; i < children; ++i) { size_type subTreeSize = subIds_.size(); - it = subIds_.fillIn(it, shift); + it = subIds_[i].fillIn(it, shift); shift += subTreeSize; } return it; }
We could then remove the shift with a call to
node.localIndex(...)
.
added 1 commit
- 7a4b78c2 - add general implementation and specialization for TaylorHoodBasis
added 1 commit
- 63213d40 - corrected treepath of velocity component in taylorhoodbasis
- Resolved by Müller, Felix
added 1 commit
- 0e93dd09 - Added function returning the entityID of a DOF
mentioned in commit e07d2372