Add a parenthesis access for tree container
Sumary
The tree container is intended to be used together with the forEachLeafNode
algorithm to access each of the values of the tree. There you get the path tree and access is pretty simple. However, if one wants to access one of the value because the tree structure is known (e.g. taylor-hood basis in a local operator), the signature seems to me rather large and non-idiomatic.
Proposal
Add a parenthesis signature that receives HybridTreePath
values.
using namespace Dune::TypeTree;
using namespace Dune::Indices;
auto tree = ...;
auto container = makeTreeContainer<double>(tree);
// bracket operator
container[hybridTreePath(_0,_1)] = 1.;
// parenthesis operator
container(_0,_1) = 2.;
Edited by Santiago Ospina De Los Ríos