typename Number>
struct FEFaceEvaluationImpl
{
+ // We enable a transformation to collocation for derivatives if it gives
+ // correct results (first two conditions), if it is the most efficient
+ // choice in terms of operation counts (third condition) and if we were
+ // able to initialize the fields in shape_info.templates.h from the
+ // polynomials (fourth condition).
+ static constexpr bool use_collocation =
+ symmetric_evaluate &&
+ n_q_points_1d > fe_degree &&n_q_points_1d <= 3 * fe_degree / 2 + 1 &&
+ n_q_points_1d < 200;
+
static void
evaluate_in_face(const MatrixFreeFunctions::ShapeInfo<Number> &data,
Number * values_dofs,
switch (dim)
{
case 3:
- if (symmetric_evaluate && n_q_points_1d > fe_degree)
+ if (use_collocation)
{
eval1.template values<0, true, false>(values_dofs,
values_quad);
2 * n_q_points);
eval1.template values<0, false, false>(
gradients_quad + 2 * n_q_points, values_dofs + size_deg);
- if (symmetric_evaluate && n_q_points_1d > fe_degree)
+ if (use_collocation)
{
internal::EvaluatorTensorProduct<
internal::evaluate_evenodd,
n_q_points_1d,
typename std::enable_if<(n_q_points_1d < degree + 3)>::type>
{
+ /**
+ * We enable a transformation to collocation for derivatives if it gives
+ * correct results (first condition), if it is the most efficient choice
+ * in terms of operation counts (second condition) and if we were able
+ * to initialize the fields in shape_info.templates.h from the
+ * polynomials (third condition).
+ */
+ static constexpr bool use_collocation =
+ n_q_points_1d > degree &&n_q_points_1d <= 3 * degree / 2 + 1 &&
+ n_q_points_1d < 200;
+
static inline void
evaluate(
const internal::MatrixFreeFunctions::ShapeInfo<Number> &shape_info,
evaluate_values,
evaluate_gradients,
evaluate_hessians);
- else if (degree < n_q_points_1d)
+ else if (use_collocation)
internal::FEEvaluationImplTransformToCollocation<
dim,
degree,
integrate_values,
integrate_gradients,
sum_into_values_array);
- else if (degree < n_q_points_1d)
+ else if (use_collocation)
internal::FEEvaluationImplTransformToCollocation<
dim,
degree,
typename Number>
struct SelectEvaluator
{
+ /**
+ * We enable a transformation to collocation for derivatives if it gives
+ * correct results (first condition), if it is the most efficient choice in
+ * terms of operation counts (second condition) and if we were able to
+ * initialize the fields in shape_info.templates.h from the polynomials
+ * (third condition).
+ */
+ static constexpr bool use_collocation =
+ n_q_points_1d > fe_degree &&n_q_points_1d <= 3 * fe_degree / 2 + 1 &&
+ n_q_points_1d < 200;
+
/**
* Chooses an appropriate evaluation strategy for the evaluate function, i.e.
* this calls internal::FEEvaluationImpl::evaluate(),
evaluate_gradients,
evaluate_hessians);
}
- else if (fe_degree < n_q_points_1d &&
- shape_info.element_type <=
- internal::MatrixFreeFunctions::tensor_symmetric)
+ // '<=' on type means tensor_symmetric or tensor_symmetric_hermite, see
+ // shape_info.h for more details
+ else if (use_collocation && shape_info.element_type <=
+ internal::MatrixFreeFunctions::tensor_symmetric)
{
internal::FEEvaluationImplTransformToCollocation<
dim,
evaluate_gradients,
evaluate_hessians);
}
- else if (shape_info.element_type ==
+ else if (shape_info.element_type <=
internal::MatrixFreeFunctions::tensor_symmetric)
{
internal::FEEvaluationImpl<
integrate_gradients,
sum_into_values_array);
}
- else if (fe_degree < n_q_points_1d &&
- shape_info.element_type <=
- internal::MatrixFreeFunctions::tensor_symmetric)
+ // '<=' on type means tensor_symmetric or tensor_symmetric_hermite, see
+ // shape_info.h for more details
+ else if (use_collocation && shape_info.element_type <=
+ internal::MatrixFreeFunctions::tensor_symmetric)
{
internal::FEEvaluationImplTransformToCollocation<
dim,
integrate_gradients,
sum_into_values_array);
}
- else if (shape_info.element_type ==
+ else if (shape_info.element_type <=
internal::MatrixFreeFunctions::tensor_symmetric)
{
internal::FEEvaluationImpl<