9#include <kernel/shape.hpp>
10#include <kernel/cubature/scalar/gauss_legendre_driver.hpp>
11#include <kernel/cubature/lauffer_driver.hpp>
12#include <kernel/cubature/hammer_stroud_driver.hpp>
13#include <kernel/cubature/dunavant_driver.hpp>
14#include <kernel/cubature/shunn_ham_driver.hpp>
27 template<
typename Shape_>
32 template<
typename Shape_>
45 if(parts.size() < std::size_t(2))
49 String param(parts.back());
51 String auto_part(parts.back());
58 if(args.front().compare_no_case(
"auto") != 0)
62 if((args.size() == std::size_t(2)) && (args.back().compare_no_case(
"degree") == 0))
66 if(!param.
parse(degree))
70 String alias(Intern::AutoDegree<Shape_>::choose(degree));
88 class AutoDegree< Shape::Simplex<1> >
92 static constexpr int max_degree = 2*Scalar::GaussLegendreDriver::max_points - 1;
98 Index k = degree/2 + 1;
101 k = std::max(k,
Index(Scalar::GaussLegendreDriver::min_points));
102 k = std::min(k,
Index(Scalar::GaussLegendreDriver::max_points));
106#ifdef FEAT_CUBATURE_SCALAR_PREFIX
109 Scalar::GaussLegendreDriver::name() +
":" +
stringify(k);
114 class AutoDegree< Shape::Simplex<2> >
117 static constexpr int max_degree = 19;
119 static String choose(Index degree)
125 return BarycentreDriver<Shape::Simplex<2> >::name();
127 return DunavantDriver<Shape::Simplex<2> >::name() +
":2";
130 return DunavantDriver<Shape::Simplex<2> >::name() +
":4";
132 return DunavantDriver<Shape::Simplex<2> >::name() +
":5";
134 return DunavantDriver<Shape::Simplex<2> >::name() +
":6";
137 return DunavantDriver<Shape::Simplex<2> >::name() +
":8";
139 return DunavantDriver<Shape::Simplex<2> >::name() +
":9";
141 return DunavantDriver<Shape::Simplex<2> >::name() +
":10";
144 return DunavantDriver<Shape::Simplex<2> >::name() +
":12";
146 return DunavantDriver<Shape::Simplex<2> >::name() +
":13";
148 return DunavantDriver<Shape::Simplex<2> >::name() +
":14";
152 return DunavantDriver<Shape::Simplex<2> >::name() +
":17";
156 return DunavantDriver<Shape::Simplex<2> >::name() +
":19";
162 class AutoDegree< Shape::Simplex<3> >
165 static constexpr int max_degree = 5;
167 static String choose(Index degree)
170 return BarycentreDriver<Shape::Simplex<3> >::name();
172 return ShunnHamDriver<Shape::Simplex<3>>::name() +
":2";
174 return ShunnHamDriver<Shape::Simplex<3>>::name() +
":3";
176 return ShunnHamDriver<Shape::Simplex<3>>::name() +
":4";
178 return ShunnHamDriver<Shape::Simplex<3>>::name() +
":5";
180 return ShunnHamDriver<Shape::Simplex<3>>::name() +
":6";
185 class AutoDegree< Shape::Hypercube<dim_> >
189 static constexpr int max_degree = 2*Scalar::GaussLegendreDriver::max_points - 1;
191 static String choose(Index degree)
195 Index k = degree/2 + 1;
198 k = std::max(k,
Index(Scalar::GaussLegendreDriver::min_points));
199 k = std::min(k,
Index(Scalar::GaussLegendreDriver::max_points));
203#ifdef FEAT_CUBATURE_TENSOR_PREFIX
206 Scalar::GaussLegendreDriver::name() +
":" +
stringify(k);
static constexpr int max_auto_degree
Maximum specialized auto-degree parameter.
String class implementation.
bool parse(T_ &t) const
Parses the string and stores its value in the provided variable.
std::deque< String > split_by_string(const String &delimiter) const
Splits the string by a delimiter substring.
String stringify(const T_ &item)
Converts an item into a String.
String stringify_join(Iterator_ first, Iterator_ last, const String &delimiter="")
Joins a sequence of strings.
std::uint64_t Index
Index data type.