Commit 8dcda52e by Praetorius, Simon

### reimplement polynomial order of nodes

parent 605d1fc1
 ... ... @@ -126,20 +126,20 @@ namespace AMDiS * \tparam CN ColNode **/ template int getDegree(int order, int coeffDegree, RN const& rowNode, CN const& colNode) const int getDegree(int derivOrder, int coeffDegree, RN const& rowNode, CN const& colNode) const { assert( bound_ ); test_warning(coeffDegree >= 0, "polynomial order of coefficient function not determined. Use order 4 by default."); int psiDegree = polynomialDegree(rowNode); int phiDegree = polynomialDegree(colNode); int psiDegree = order(rowNode); int phiDegree = order(colNode); int degree = psiDegree + phiDegree + (coeffDegree >= 0 ? coeffDegree : 4); if (isSimplex_) degree -= order; degree -= derivOrder; if (isAffine_) degree += 1; // oder += (order+1) degree += 1; // oder += (derivOrder+1) return degree; } ... ... @@ -151,19 +151,19 @@ namespace AMDiS * the order of derivatives, this operator implements. **/ template int getDegree(int order, int coeffDegree, Node const& node) const int getDegree(int derivOrder, int coeffDegree, Node const& node) const { assert( bound_ ); test_warning(coeffDegree >= 0, "polynomial order of coefficient function not determined. Use order 4 by default."); int psiDegree = polynomialDegree(node); int psiDegree = order(node); int degree = psiDegree + (coeffDegree >= 0 ? coeffDegree : 4); if (isSimplex_) degree -= order; degree -= derivOrder; if (isAffine_) degree += 1; // oder += (order+1) degree += 1; // oder += (derivOrder+1) return degree; } ... ...
 ... ... @@ -4,6 +4,7 @@ #include #include #include #include #include #include ... ... @@ -130,11 +131,12 @@ public: return PartialLocalFunction{globalFunction_, type}; } /// \brief The \ref polynomialDegree() of the LocalFunctions /// \brief The \ref order() of the LocalFunctions int order() const { using AMDiS::order; assert( bound_ ); return polynomialDegree(*subTree_); return order(*subTree_); } /// \brief Return the bound element ... ... @@ -209,8 +211,9 @@ public: int order() const { using AMDiS::order; assert( bound_ ); return std::max(0, polynomialDegree(*subTree_)-1); return std::max(0, order(*subTree_)-1); } /// Return the bound element ... ...
 ... ... @@ -5,6 +5,7 @@ #include #include #include #include #include #include ... ... @@ -16,10 +17,11 @@ namespace AMDiS template struct FiniteElementTypeImpl { static_assert( Dune::AlwaysFalse::value, "Unknown node-type for range definition" ); // polynomial degree of finite-element basis functions static int order(Node const&) { return 0; } using type = tag::unknown; static int order(Node const& node) { return 1; } }; } ... ... @@ -31,12 +33,12 @@ namespace AMDiS using FiniteElementType_t = typename FiniteElementType::type; template int polynomialDegree(Node const& node) auto order(Node const& node) -> decltype(FiniteElementType::order(node)) { return FiniteElementType::order(node); } namespace Impl { // Leaf node ... ... @@ -60,7 +62,8 @@ namespace AMDiS static int order(Node const& node) { return FiniteElementType::order(node.child(0)); using AMDiS::order; return order(node.child(0u)); } }; ... ... @@ -72,14 +75,14 @@ namespace AMDiS static int order(Node const& node) { using AMDiS::order; int degree = 0; Tools::for_range<0,Node::CHILDREN>([&](auto const _i) { degree = std::max(degree, polynomialDegree(node.child(_i))); degree = std::max(degree, order(node.child(_i))); }); return degree; } }; } // end namespace Impl } // end namespace AMDiS
 ... ... @@ -36,14 +36,14 @@ int main() localView.bind(e); auto node = localView.tree(); AMDIS_TEST_EQ( polynomialDegree(node), k+1 ); // maximum over all polynomial degrees AMDIS_TEST_EQ( order(node), k+1 ); // maximum over all polynomial degrees static_assert( std::is_same_v>, "" ); auto v_node = TypeTree::child(node, _0); AMDIS_TEST_EQ( polynomialDegree(v_node), k+1 ); AMDIS_TEST_EQ( order(v_node), k+1 ); auto p_node = TypeTree::child(node, _1); AMDIS_TEST_EQ( polynomialDegree(p_node), k ); AMDIS_TEST_EQ( order(p_node), k ); } return report_errors(); ... ...
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!