148 &shape_function_data,
150 template solution_laplacian_type<Number>> &laplacians)
152 const unsigned int dofs_per_cell = dof_values.
size();
153 const unsigned int n_quadrature_points = laplacians.size();
159 spacedim>::template solution_laplacian_type<Number>());
161 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
163 if (shape_function_data[shape_function]
164 .is_nonzero_shape_function_component)
166 const Number value = dof_values[shape_function];
170 if (CheckForZero<Number>::value(value) ==
true)
173 const ::Tensor<2, spacedim> *shape_hessian_ptr =
174 &shape_hessians[shape_function_data[shape_function].row_index][0];
175 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
177 laplacians[q_point] += value *
trace(*shape_hessian_ptr++);
191 &shape_function_data,
196 const unsigned int dofs_per_cell = dof_values.
size();
197 const unsigned int n_quadrature_points = values.size();
204 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
208 shape_function_data[shape_function].single_nonzero_component;
214 const Number value = dof_values[shape_function];
218 if (CheckForZero<Number>::value(value) ==
true)
223 const unsigned int comp = shape_function_data[shape_function]
224 .single_nonzero_component_index;
225 const double *shape_value_ptr = &shape_values(snc, 0);
226 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
228 values[q_point][comp] += value * (*shape_value_ptr++);
231 for (
unsigned int d = 0; d < spacedim; ++d)
232 if (shape_function_data[shape_function]
233 .is_nonzero_shape_function_component[d])
235 const double *shape_value_ptr = &shape_values(
236 shape_function_data[shape_function].row_index[d], 0);
237 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
239 values[q_point][d] += value * (*shape_value_ptr++);
252 &shape_function_data,
257 const unsigned int dofs_per_cell = dof_values.
size();
258 const unsigned int n_quadrature_points = derivatives.size();
266 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
270 shape_function_data[shape_function].single_nonzero_component;
276 const Number value = dof_values[shape_function];
280 if (CheckForZero<Number>::value(value) ==
true)
285 const unsigned int comp = shape_function_data[shape_function]
286 .single_nonzero_component_index;
287 const ::Tensor<order, spacedim> *shape_derivative_ptr =
288 &shape_derivatives[snc][0];
289 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
291 derivatives[q_point][comp] += value * (*shape_derivative_ptr++);
294 for (
unsigned int d = 0; d < spacedim; ++d)
295 if (shape_function_data[shape_function]
296 .is_nonzero_shape_function_component[d])
298 const ::Tensor<order, spacedim> *shape_derivative_ptr =
299 &shape_derivatives[shape_function_data[shape_function]
301 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
303 derivatives[q_point][d] +=
304 value * (*shape_derivative_ptr++);
317 &shape_function_data,
321 &symmetric_gradients)
323 const unsigned int dofs_per_cell = dof_values.
size();
324 const unsigned int n_quadrature_points = symmetric_gradients.size();
327 symmetric_gradients.begin(),
328 symmetric_gradients.end(),
332 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
336 shape_function_data[shape_function].single_nonzero_component;
342 const Number value = dof_values[shape_function];
346 if (CheckForZero<Number>::value(value) ==
true)
351 const unsigned int comp = shape_function_data[shape_function]
352 .single_nonzero_component_index;
353 const ::Tensor<1, spacedim> *shape_gradient_ptr =
354 &shape_gradients[snc][0];
355 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
358 for (
unsigned int d = 0; d < dim; ++d)
359 symmetric_gradients[q_point][comp][d] +=
360 0.5 * value * (*shape_gradient_ptr)[d];
361 symmetric_gradients[q_point][comp][comp] +=
362 0.5 * value * (*shape_gradient_ptr++)[comp];
366 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
371 for (
unsigned int d = 0; d < spacedim; ++d)
372 if (shape_function_data[shape_function]
373 .is_nonzero_shape_function_component[d])
376 shape_gradients[shape_function_data[shape_function]
377 .row_index[d]][q_point];
378 symmetric_gradients[q_point] +=
symmetrize(grad);
391 &shape_function_data,
393 template solution_divergence_type<Number>> &divergences)
395 const unsigned int dofs_per_cell = dof_values.
size();
396 const unsigned int n_quadrature_points = divergences.size();
402 spacedim>::template solution_divergence_type<Number>());
404 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
408 shape_function_data[shape_function].single_nonzero_component;
414 const Number value = dof_values[shape_function];
418 if (CheckForZero<Number>::value(value) ==
true)
423 const unsigned int comp = shape_function_data[shape_function]
424 .single_nonzero_component_index;
425 const ::Tensor<1, spacedim> *shape_gradient_ptr =
426 &shape_gradients[snc][0];
427 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
429 divergences[q_point] += value * (*shape_gradient_ptr++)[comp];
432 for (
unsigned int d = 0; d < spacedim; ++d)
433 if (shape_function_data[shape_function]
434 .is_nonzero_shape_function_component[d])
436 const ::Tensor<1, spacedim> *shape_gradient_ptr =
437 &shape_gradients[shape_function_data[shape_function]
439 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
441 divergences[q_point] += value * (*shape_gradient_ptr++)[d];
454 &shape_function_data,
457 typename ::internal::CurlType<spacedim>::type>::type> &curls)
459 const unsigned int dofs_per_cell = dof_values.
size();
460 const unsigned int n_quadrature_points = curls.size();
462 std::fill(curls.begin(),
466 typename ::internal::CurlType<spacedim>::type>::type());
474 "Computing the curl in 1d is not a useful operation"));
480 for (
unsigned int shape_function = 0;
481 shape_function < dofs_per_cell;
484 const int snc = shape_function_data[shape_function]
485 .single_nonzero_component;
491 const Number value = dof_values[shape_function];
495 if (CheckForZero<Number>::value(value) ==
true)
500 const ::Tensor<1, spacedim> *shape_gradient_ptr =
501 &shape_gradients[snc][0];
503 Assert(shape_function_data[shape_function]
504 .single_nonzero_component >= 0,
507 if (shape_function_data[shape_function]
508 .single_nonzero_component_index == 0)
509 for (
unsigned int q_point = 0;
510 q_point < n_quadrature_points;
513 value * (*shape_gradient_ptr++)[1];
515 for (
unsigned int q_point = 0;
516 q_point < n_quadrature_points;
519 value * (*shape_gradient_ptr++)[0];
527 if (shape_function_data[shape_function]
528 .is_nonzero_shape_function_component[0])
531 spacedim> *shape_gradient_ptr =
532 &shape_gradients[shape_function_data[shape_function]
535 for (
unsigned int q_point = 0;
536 q_point < n_quadrature_points;
539 value * (*shape_gradient_ptr++)[1];
542 if (shape_function_data[shape_function]
543 .is_nonzero_shape_function_component[1])
546 spacedim> *shape_gradient_ptr =
547 &shape_gradients[shape_function_data[shape_function]
550 for (
unsigned int q_point = 0;
551 q_point < n_quadrature_points;
554 value * (*shape_gradient_ptr++)[0];
563 for (
unsigned int shape_function = 0;
564 shape_function < dofs_per_cell;
567 const int snc = shape_function_data[shape_function]
568 .single_nonzero_component;
574 const Number value = dof_values[shape_function];
578 if (CheckForZero<Number>::value(value) ==
true)
583 const ::Tensor<1, spacedim> *shape_gradient_ptr =
584 &shape_gradients[snc][0];
586 switch (shape_function_data[shape_function]
587 .single_nonzero_component_index)
591 for (
unsigned int q_point = 0;
592 q_point < n_quadrature_points;
596 value * (*shape_gradient_ptr)[2];
598 value * (*shape_gradient_ptr++)[1];
606 for (
unsigned int q_point = 0;
607 q_point < n_quadrature_points;
611 value * (*shape_gradient_ptr)[2];
613 value * (*shape_gradient_ptr++)[0];
621 for (
unsigned int q_point = 0;
622 q_point < n_quadrature_points;
626 value * (*shape_gradient_ptr)[1];
628 value * (*shape_gradient_ptr++)[0];
644 if (shape_function_data[shape_function]
645 .is_nonzero_shape_function_component[0])
648 spacedim> *shape_gradient_ptr =
649 &shape_gradients[shape_function_data[shape_function]
652 for (
unsigned int q_point = 0;
653 q_point < n_quadrature_points;
657 value * (*shape_gradient_ptr)[2];
659 value * (*shape_gradient_ptr++)[1];
663 if (shape_function_data[shape_function]
664 .is_nonzero_shape_function_component[1])
667 spacedim> *shape_gradient_ptr =
668 &shape_gradients[shape_function_data[shape_function]
671 for (
unsigned int q_point = 0;
672 q_point < n_quadrature_points;
676 value * (*shape_gradient_ptr)[2];
678 value * (*shape_gradient_ptr++)[0];
682 if (shape_function_data[shape_function]
683 .is_nonzero_shape_function_component[2])
686 spacedim> *shape_gradient_ptr =
687 &shape_gradients[shape_function_data[shape_function]
690 for (
unsigned int q_point = 0;
691 q_point < n_quadrature_points;
695 value * (*shape_gradient_ptr)[1];
697 value * (*shape_gradient_ptr++)[0];
714 &shape_function_data,
716 template solution_laplacian_type<Number>> &laplacians)
718 const unsigned int dofs_per_cell = dof_values.
size();
719 const unsigned int n_quadrature_points = laplacians.size();
725 spacedim>::template solution_laplacian_type<Number>());
727 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
731 shape_function_data[shape_function].single_nonzero_component;
737 const Number value = dof_values[shape_function];
741 if (CheckForZero<Number>::value(value) ==
true)
746 const unsigned int comp = shape_function_data[shape_function]
747 .single_nonzero_component_index;
748 const ::Tensor<2, spacedim> *shape_hessian_ptr =
749 &shape_hessians[snc][0];
750 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
752 laplacians[q_point][comp] +=
753 value *
trace(*shape_hessian_ptr++);
756 for (
unsigned int d = 0; d < spacedim; ++d)
757 if (shape_function_data[shape_function]
758 .is_nonzero_shape_function_component[d])
760 const ::Tensor<2, spacedim> *shape_hessian_ptr =
761 &shape_hessians[shape_function_data[shape_function]
763 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
765 laplacians[q_point][d] +=
766 value *
trace(*shape_hessian_ptr++);
779 const ::Table<2, double> &shape_values,
782 &shape_function_data,
788 const unsigned int dofs_per_cell = dof_values.
size();
789 const unsigned int n_quadrature_points = values.size();
797 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
801 shape_function_data[shape_function].single_nonzero_component;
807 const Number value = dof_values[shape_function];
811 if (CheckForZero<Number>::value(value) ==
true)
818 shape_function_data[shape_function]
819 .single_nonzero_component_index);
820 const double *shape_value_ptr = &shape_values(snc, 0);
821 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
823 values[q_point][comp] += value * (*shape_value_ptr++);
826 for (
unsigned int d = 0;
830 if (shape_function_data[shape_function]
831 .is_nonzero_shape_function_component[d])
836 const double *shape_value_ptr = &shape_values(
837 shape_function_data[shape_function].row_index[d], 0);
838 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
840 values[q_point][comp] += value * (*shape_value_ptr++);
854 &shape_function_data,
856 template solution_divergence_type<Number>> &divergences)
858 const unsigned int dofs_per_cell = dof_values.
size();
859 const unsigned int n_quadrature_points = divergences.size();
861 std::fill(divergences.begin(),
864 template solution_divergence_type<Number>());
866 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
870 shape_function_data[shape_function].single_nonzero_component;
876 const Number value = dof_values[shape_function];
880 if (CheckForZero<Number>::value(value) ==
true)
885 const unsigned int comp = shape_function_data[shape_function]
886 .single_nonzero_component_index;
888 const ::Tensor<1, spacedim> *shape_gradient_ptr =
889 &shape_gradients[snc][0];
896 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
897 ++q_point, ++shape_gradient_ptr)
899 divergences[q_point][ii] += value * (*shape_gradient_ptr)[jj];
902 divergences[q_point][jj] +=
903 value * (*shape_gradient_ptr)[ii];
908 for (
unsigned int d = 0;
911 spacedim>::n_independent_components;
913 if (shape_function_data[shape_function]
914 .is_nonzero_shape_function_component[d])
926 const unsigned int comp =
927 shape_function_data[shape_function]
928 .single_nonzero_component_index;
930 const ::Tensor<1, spacedim> *shape_gradient_ptr =
931 &shape_gradients[shape_function_data[shape_function]
933 for (
unsigned int q_point = 0;
934 q_point < n_quadrature_points;
935 ++q_point, ++shape_gradient_ptr)
937 for (
unsigned int j = 0; j < spacedim; ++j)
939 const unsigned int vector_component =
943 divergences[q_point][vector_component] +=
944 value * (*shape_gradient_ptr++)[j];
958 const ::Table<2, double> &shape_values,
960 &shape_function_data,
965 const unsigned int dofs_per_cell = dof_values.
size();
966 const unsigned int n_quadrature_points = values.size();
973 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
977 shape_function_data[shape_function].single_nonzero_component;
983 const Number value = dof_values[shape_function];
987 if (CheckForZero<Number>::value(value) ==
true)
992 const unsigned int comp = shape_function_data[shape_function]
993 .single_nonzero_component_index;
999 const double *shape_value_ptr = &shape_values(snc, 0);
1000 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1002 values[q_point][indices] += value * (*shape_value_ptr++);
1005 for (
unsigned int d = 0; d < dim * dim; ++d)
1006 if (shape_function_data[shape_function]
1007 .is_nonzero_shape_function_component[d])
1013 const double *shape_value_ptr = &shape_values(
1014 shape_function_data[shape_function].row_index[d], 0);
1015 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1017 values[q_point][indices] += value * (*shape_value_ptr++);
1030 &shape_function_data,
1032 template solution_divergence_type<Number>> &divergences)
1034 const unsigned int dofs_per_cell = dof_values.
size();
1035 const unsigned int n_quadrature_points = divergences.size();
1038 divergences.begin(),
1043 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
1047 shape_function_data[shape_function].single_nonzero_component;
1053 const Number value = dof_values[shape_function];
1057 if (CheckForZero<Number>::value(value) ==
true)
1062 const unsigned int comp = shape_function_data[shape_function]
1063 .single_nonzero_component_index;
1065 const ::Tensor<1, spacedim> *shape_gradient_ptr =
1066 &shape_gradients[snc][0];
1071 const unsigned int ii = indices[0];
1072 const unsigned int jj = indices[1];
1074 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1075 ++q_point, ++shape_gradient_ptr)
1077 divergences[q_point][ii] += value * (*shape_gradient_ptr)[jj];
1082 for (
unsigned int d = 0; d < dim * dim; ++d)
1083 if (shape_function_data[shape_function]
1084 .is_nonzero_shape_function_component[d])
1100 &shape_function_data,
1102 template solution_gradient_type<Number>> &gradients)
1104 const unsigned int dofs_per_cell = dof_values.
size();
1105 const unsigned int n_quadrature_points = gradients.size();
1113 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
1117 shape_function_data[shape_function].single_nonzero_component;
1123 const Number value = dof_values[shape_function];
1127 if (CheckForZero<Number>::value(value) ==
true)
1132 const unsigned int comp = shape_function_data[shape_function]
1133 .single_nonzero_component_index;
1135 const ::Tensor<1, spacedim> *shape_gradient_ptr =
1136 &shape_gradients[snc][0];
1141 const unsigned int ii = indices[0];
1142 const unsigned int jj = indices[1];
1144 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1145 ++q_point, ++shape_gradient_ptr)
1147 gradients[q_point][ii][jj] += value * (*shape_gradient_ptr);
1152 for (
unsigned int d = 0; d < dim * dim; ++d)
1153 if (shape_function_data[shape_function]
1154 .is_nonzero_shape_function_component[d])