[dune-functions] Questions about interpolate.hh

Carsten Gräser graeser at mi.fu-berlin.de
Tue Mar 1 12:35:47 CET 2016


Am 01.03.2016 um 12:10 schrieb Oliver Sander:
> Hi all,
> 
> in the file functionspacebases/interpolate.hh there are several methods that accept
> a tree path argument.  The type of this argument is a template parameter, but why?
> Presumably, only objects of type HybridTreePath make sense here.
> 
> The question is not purely academic: I would like to add a method
> 
> template <class B, class C, class F, class BV>
> void interpolate(const B& basis, C&& coeff, const F& f, const BV& bitVector)
> {
>   auto root = Dune::TypeTree::hybridTreePath();
>   interpolateTreeSubset(basis, root, coeff, f, makeDefaultNodeToRangeMap(basis, root), bitVector);
> }
> 
> for interpolation with scalar bases and a bit field.  However, this currently cannot be done,
> because the signature is ambiguous wrt
> 
> template <class B, class TreePath, class C, class F>
> void interpolate(const B& basis, const TreePath& treePath, C&& coeff, const F& f)
> 
> Hardwiring the TreePath parameter to HybridTreePath in the latter would fix this.
I don't see a reason why

  template <class B, class C, class F, class... TreeIndices>
  void interpolate(const B& basis, const HybridTreePath<TreeIndices...>& treePath, C&& coeff, const F& f)

should not work, so go ahead.

BTW: I don't like the current variants of interpolate(...).
The present solution does not follow any rules but just
tries to avoid ambiguities like this.

We should look for either (a) good method names or
(b) an understandable ordering scheme for the arguments.
(a) would be something like

  constraintInterpolate()
  interpolateSubtree()
  constraintInterpolateSubtree()

But I'm not happy with this and any suggestions are welcome.

Best,
Carsten

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <https://lists.dune-project.org/pipermail/dune-functions/attachments/20160301/e21f64bb/attachment.sig>


More information about the dune-functions mailing list