Pass entity and intersection on pattern methods
Summary
Pattern methods have an interface that does not allow to check where in the grid the method is being called, that is, the get local function space objects but they don't get the entity or intersection. This constraint local operator implementors to make decisions on the pattern based on its local context. Moreover, it does not allow combine objects that join several local operators to systematically branch computations based on the context of the local calls (e.g. !531 (merged)).
- I encountered this for multidomain settings and had to implement awful workarounds
- @dominic has also found the same issue while working on skeleton terms in part of the domain in an C0-interior penalty method.
- @linus.seelinger applications may also get some benefit from this (conditional pattern assembly)
Passing entity and intersection is not a big deal as this information is in the engines anyways and no extra performance cost is suffered if these are not used.
Proposal
Change the pattern interface to one that passes the entity and intersection. e.g., move from this
template<typename LFSU, typename LFSV, typename LocalPattern>
void pattern_volume( const LFSU& lfsu, const LFSV& lfsv, LocalPattern& pattern) const;
to this
template<typename EG, typename LFSU, typename LFSV, typename LocalPattern>
void pattern_volume(const EG& eg, const LFSU& lfsu, const LFSV& lfsv, LocalPattern& pattern) const;
Compatibility
The idea would be to deprecate the methods with no entity/intersection information. Although every local operator will be affected by this, most people use the full pattern methods that PDELab provides, so most people wouldn't even notice the change. Those who have custom patterns would have one or two releases to move to the new interface.