17 #ifndef dealii_matrix_free_evaluation_selector_h
18 #define dealii_matrix_free_evaluation_selector_h
29 namespace EvaluationSelectorImplementation
51 template <
int dim,
int n_components,
typename Number>
57 Number * values_dofs_actual,
59 Number * gradients_quad,
60 Number * hessians_quad,
61 Number * scratch_data,
62 const bool evaluate_values,
63 const bool evaluate_gradients,
64 const bool evaluate_hessians)
72 Number>::evaluate(shape_info,
86 Number * values_dofs_actual,
88 Number * gradients_quad,
89 Number * scratch_data,
90 const bool integrate_values,
91 const bool integrate_gradients,
92 const bool sum_into_values_array =
false)
100 Number>::integrate(shape_info,
107 sum_into_values_array);
120 int n_q_points_1d = 0,
122 struct Factory : Default<dim, n_components, Number>
130 template <
int n_q_po
ints_1d,
int dim,
int n_components,
typename Number>
132 : Default<dim, n_components, Number>
140 template <
int degree,
151 typename std::enable_if<n_q_points_1d == degree + 3>::type>
152 : Default<dim, n_components, Number>
158 template <
int degree,
168 Number * values_dofs_actual,
169 Number * values_quad,
170 Number * gradients_quad,
171 Number * hessians_quad,
172 Number * scratch_data,
173 const bool evaluate_values,
174 const bool evaluate_gradients,
175 const bool evaluate_hessians)
177 const unsigned int runtime_degree = shape_info.
data.front().fe_degree;
178 constexpr
unsigned int start_n_q_points = degree + 1;
179 if (runtime_degree == degree)
206 Number * values_dofs_actual,
207 Number * values_quad,
208 Number * gradients_quad,
209 Number * scratch_data,
210 const bool integrate_values,
211 const bool integrate_gradients,
212 const bool sum_into_values_array =
false)
214 const int runtime_degree = shape_info.
data.front().fe_degree;
215 constexpr
unsigned int start_n_q_points = degree + 1;
216 if (runtime_degree == degree)
225 sum_into_values_array);
235 sum_into_values_array);
243 template <
int degree,
254 typename std::enable_if<(n_q_points_1d < degree + 3)>::type>
263 static constexpr
bool use_collocation =
264 n_q_points_1d > degree &&n_q_points_1d <= 3 * degree / 2 + 1 &&
270 Number * values_dofs_actual,
271 Number * values_quad,
272 Number * gradients_quad,
273 Number * hessians_quad,
274 Number * scratch_data,
275 const bool evaluate_values,
276 const bool evaluate_gradients,
277 const bool evaluate_hessians)
279 const int runtime_n_q_points_1d = shape_info.
data.front().n_q_points_1d;
280 if (runtime_n_q_points_1d == n_q_points_1d)
282 if (n_q_points_1d == degree + 1 &&
296 else if (use_collocation)
302 Number>::evaluate(shape_info,
318 Number>::evaluate(shape_info,
344 Number * values_dofs_actual,
345 Number * values_quad,
346 Number * gradients_quad,
347 Number * scratch_data,
348 const bool integrate_values,
349 const bool integrate_gradients,
350 const bool sum_into_values_array)
352 const int runtime_n_q_points_1d = shape_info.
data.front().n_q_points_1d;
353 if (runtime_n_q_points_1d == n_q_points_1d)
355 if (n_q_points_1d == degree + 1 &&
367 sum_into_values_array);
368 else if (use_collocation)
374 Number>::integrate(shape_info,
381 sum_into_values_array);
389 Number>::integrate(shape_info,
396 sum_into_values_array);
407 sum_into_values_array);
417 template <
int dim,
int n_components,
typename Number>
419 symmetric_selector_evaluate(
421 Number * values_dofs_actual,
422 Number * values_quad,
423 Number * gradients_quad,
424 Number * hessians_quad,
425 Number * scratch_data,
426 const bool evaluate_values,
427 const bool evaluate_gradients,
428 const bool evaluate_hessians)
450 template <
int dim,
int n_components,
typename Number>
452 symmetric_selector_integrate(
454 Number * values_dofs_actual,
455 Number * values_quad,
456 Number * gradients_quad,
457 Number * scratch_data,
458 const bool integrate_values,
459 const bool integrate_gradients,
460 const bool sum_into_values_array =
false)
472 sum_into_values_array);
505 n_q_points_1d > fe_degree &&n_q_points_1d <= 3 * fe_degree / 2 + 1 &&
517 Number * values_dofs_actual,
518 Number * values_quad,
519 Number * gradients_quad,
520 Number * hessians_quad,
521 Number * scratch_data,
522 const bool evaluate_values,
523 const bool evaluate_gradients,
524 const bool evaluate_hessians);
535 Number * values_dofs_actual,
536 Number * values_quad,
537 Number * gradients_quad,
538 Number * scratch_data,
539 const bool integrate_values,
540 const bool integrate_gradients,
541 const bool sum_into_values_array =
false);
554 template <
int dim,
int n_q_po
ints_1d,
int n_components,
typename Number>
567 Number * values_dofs_actual,
568 Number * values_quad,
569 Number * gradients_quad,
570 Number * hessians_quad,
571 Number * scratch_data,
572 const bool evaluate_values,
573 const bool evaluate_gradients,
574 const bool evaluate_hessians);
586 Number * values_dofs_actual,
587 Number * values_quad,
588 Number * gradients_quad,
589 Number * scratch_data,
590 const bool integrate_values,
591 const bool integrate_gradients,
592 const bool sum_into_values_array =
false);
606 Number * values_dofs_actual,
607 Number * values_quad,
608 Number * gradients_quad,
609 Number * hessians_quad,
610 Number * scratch_data,
611 const bool evaluate_values,
612 const bool evaluate_gradients,
613 const bool evaluate_hessians)
617 if (fe_degree + 1 == n_q_points_1d &&
643 Number>::evaluate(shape_info,
662 Number>::evaluate(shape_info,
681 Number>::evaluate(shape_info,
700 Number>::evaluate(shape_info,
718 Number>::evaluate(shape_info,
742 Number * values_dofs_actual,
743 Number * values_quad,
744 Number * gradients_quad,
745 Number * scratch_data,
746 const bool integrate_values,
747 const bool integrate_gradients,
748 const bool sum_into_values_array)
752 if (fe_degree + 1 == n_q_points_1d &&
765 sum_into_values_array);
777 Number>::integrate(shape_info,
784 sum_into_values_array);
795 Number>::integrate(shape_info,
802 sum_into_values_array);
813 Number>::integrate(shape_info,
820 sum_into_values_array);
831 Number>::integrate(shape_info,
838 sum_into_values_array);
848 Number>::integrate(shape_info,
855 sum_into_values_array);
863 template <
int dim,
int dummy,
int n_components,
typename Number>
867 Number * values_dofs_actual,
868 Number * values_quad,
869 Number * gradients_quad,
870 Number * hessians_quad,
871 Number * scratch_data,
872 const bool evaluate_values,
873 const bool evaluate_gradients,
874 const bool evaluate_hessians)
885 Number>::evaluate(shape_info,
904 Number>::evaluate(shape_info,
921 Number>::evaluate(shape_info,
931 internal::EvaluationSelectorImplementation::
932 symmetric_selector_evaluate<dim, n_components, Number>(shape_info,
945 template <
int dim,
int dummy,
int n_components,
typename Number>
949 Number * values_dofs_actual,
950 Number * values_quad,
951 Number * gradients_quad,
952 Number * scratch_data,
953 const bool integrate_values,
954 const bool integrate_gradients,
955 const bool sum_into_values_array)
966 Number>::integrate(shape_info,
973 sum_into_values_array);
984 Number>::integrate(shape_info,
991 sum_into_values_array);
1000 Number>::integrate(shape_info,
1006 integrate_gradients,
1007 sum_into_values_array);
1009 internal::EvaluationSelectorImplementation::
1010 symmetric_selector_integrate<dim, n_components, Number>(
1017 integrate_gradients,
1018 sum_into_values_array);