[dune-functions] [Dune-functions-commit] [Commit] dune-functions - 3979792: Add helper to directly access the type of nested children
Christian Engwer
christian.engwer at uni-muenster.de
Wed Sep 9 23:32:53 CEST 2015
shouldn't parts of these changes go to typetree?
Christian
On Wed, Sep 09, 2015 at 11:28:30PM +0200, Carsten Gräser wrote:
> New commit, appeared at Wed Sep 9 23:28:30 2015 +0200
> as part of the following ref changes:
>
> branch refs/heads/master updated from 3c6f97c -> 4d7b5b3
>
> Browsable version: http://cgit.dune-project.org/repositories/dune-functions/commit/?id=3979792d3142a7e4301cf4a8a870efaad82d3972
>
> ======================================================================
>
> commit 3979792d3142a7e4301cf4a8a870efaad82d3972
> Author: Carsten Gräser <graeser at mi.fu-berlin.de>
> Date: Wed Sep 9 23:24:05 2015 +0200
>
> Add helper to directly access the type of nested children
>
> To get the type of the child with relative tree path (3,7,1)
> you can now use ChildType<Node, 3, 7, 1>
>
> dune/functions/functionspacebases/tupletreepath.hh | 25 ++++++++++++++++++++++
> 1 file changed, 25 insertions(+)
>
>
>
> diff --git a/dune/functions/functionspacebases/tupletreepath.hh b/dune/functions/functionspacebases/tupletreepath.hh
> index e4f6bc8..7504caf 100644
> --- a/dune/functions/functionspacebases/tupletreepath.hh
> +++ b/dune/functions/functionspacebases/tupletreepath.hh
> @@ -196,6 +196,31 @@ auto getChild(Tree&& tree, const std::tuple<I...>& tp)
>
>
>
> +namespace Imp {
> +
> +template<class Node, int... Path>
> +struct ChildTypeHelper{};
> +
> +template<class Node, int FirstChild, int... Path>
> +struct ChildTypeHelper<Node, FirstChild, Path...>
> +{
> + using Type = typename ChildTypeHelper<typename Node::template Child<FirstChild>::Type, Path...>::Type;
> +};
> +
> +template<class Node>
> +struct ChildTypeHelper<Node>
> +{
> + using Type = Node;
> +};
> +
> +
> +}
> +
> +// Simplify access to type of child
> +template<class Node, int... Path>
> +using ChildType = typename Imp::ChildTypeHelper<Node, Path...>::Type;
> +
> +
> } // namespace Functions
> } // namespace Dune
>
>
> _______________________________________________
> Dune-functions-commit mailing list
> Dune-functions-commit at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-functions-commit
--
Prof. Dr. Christian Engwer
Institut für Numerische und Angewandte Mathematik
Fachbereich Mathematik und Informatik der Universität Münster
Einsteinstrasse 62
48149 Münster
E-Mail christian.engwer at uni-muenster.de
Telefon +49 251 83-35067
FAX +49 251 83-32729
More information about the dune-functions
mailing list