Skip to content

Feature/merge localindexset into localview

This implements two interface simplifications:

  • Add the index() method and the MultiIndex typedef from the LocalIndexSet to the LocalView.
  • Compute indices when LocalView is bound to an element.

The original reason for not having the index() method directly on the LocalView was, that we wanted to be able to replace the indexing scheme while reusing the other stuff. This is now obsolete, because it's achieved in a different way: You can use different NodeIndexSet implementations for the same Node. There's one possible additional reason: By having the LocalIndexSet separately you have the possibility to only bind the LocalView to avoid the computation of indices if you don't need them. However, @oliver.sander and I failed to find any non-artificial use case for this, although we tried hard.

The benefits of the interface change are:

  • User code becomes simpler, because you don't need to pass around two objects.
  • User code is less error prone, because you no longer need to ensure these objects are in sync. This e.g. allows to avoid the hack recently introduced to make copying DiscreteGlobalBasisFunction::LocalFunction save.

The MR implements the change for DefaultLocalView which now contains an index cache and forwards all methods in DefaultLocalIndexSet to DefaultLocalView. Hence you can still use the old interface for transition.

In case someone comes up with a real use case where you need to avoid the index computation, we can add a special purpose version of bind() later, that does not compute the indices. However, @oliver.sander and I would like to postpone this, until there's a very good reason, to keep the interface slim and consistent.

Merge request reports