AMDiS 2.11-git
The Adaptive Multi-Dimensional Simulation Toolbox
 
Loading...
Searching...
No Matches
Order.hpp
1#pragma once
2
3#include <amdis/Output.hpp>
4#include <amdis/common/Math.hpp>
5#include <amdis/common/Apply.hpp>
6
7#include <dune/common/typetree/nodeconcepts.hh>
8
9namespace AMDiS
10{
12 template <class N>
13 requires Dune::TypeTree::Concept::TreeNode<N>
14 int order(N const& node)
15 {
16 if constexpr (Dune::TypeTree::Concept::LeafTreeNode<N>)
17 return node.finiteElement().localBasis().order();
18 else if constexpr (Dune::TypeTree::Concept::UniformInnerTreeNode<N>)
19 return order(node.child(0u));
20 else if constexpr (Dune::TypeTree::Concept::StaticDegreeInnerTreeNode<N>)
21 return Ranges::applyIndices<std::size_t(N::degree())>([&](auto... ii) {
22 return Math::max(order(node.child(ii))...);
23 });
24 else {
25 warning("Unknown basis-node type. Assuming polynomial degree 1.");
26 return 1;
27 }
28 }
29
30} // end namespace AMDiS