74 const unsigned int dofs_per_cell = dof_values.
size();
75 const unsigned int n_quadrature_points = values.size();
77 std::fill(values.begin(),
81 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
83 if (shape_function_data[shape_function]
84 .is_nonzero_shape_function_component)
86 const Number &value = dof_values[shape_function];
90 if (CheckForZero<Number>::value(value) ==
true)
93 const double *shape_value_ptr =
94 &shape_values(shape_function_data[shape_function].row_index, 0);
95 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
96 ++q_point, ++shape_value_ptr)
97 values[q_point] += value * (*shape_value_ptr);
151 &shape_function_data,
153 template solution_laplacian_type<Number>> &laplacians)
155 const unsigned int dofs_per_cell = dof_values.
size();
156 const unsigned int n_quadrature_points = laplacians.size();
162 spacedim>::template solution_laplacian_type<Number>());
164 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
166 if (shape_function_data[shape_function]
167 .is_nonzero_shape_function_component)
169 const Number &value = dof_values[shape_function];
173 if (CheckForZero<Number>::value(value) ==
true)
176 const ::Tensor<2, spacedim> *shape_hessian_ptr =
177 &shape_hessians[shape_function_data[shape_function].row_index][0];
178 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
180 laplacians[q_point] += value *
trace(*shape_hessian_ptr++);
194 &shape_function_data,
199 const unsigned int dofs_per_cell = dof_values.
size();
200 const unsigned int n_quadrature_points = values.size();
207 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
211 shape_function_data[shape_function].single_nonzero_component;
217 const Number &value = dof_values[shape_function];
221 if (CheckForZero<Number>::value(value) ==
true)
226 const unsigned int comp = shape_function_data[shape_function]
227 .single_nonzero_component_index;
228 const double *shape_value_ptr = &shape_values(snc, 0);
229 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
230 ++q_point, ++shape_value_ptr)
231 values[q_point][comp] += value * (*shape_value_ptr);
234 for (
unsigned int d = 0; d < spacedim; ++d)
235 if (shape_function_data[shape_function]
236 .is_nonzero_shape_function_component[d])
238 const double *shape_value_ptr = &shape_values(
239 shape_function_data[shape_function].row_index[d], 0);
240 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
241 ++q_point, ++shape_value_ptr)
242 values[q_point][d] += value * (*shape_value_ptr);
255 &shape_function_data,
260 const unsigned int dofs_per_cell = dof_values.
size();
261 const unsigned int n_quadrature_points = derivatives.size();
269 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
273 shape_function_data[shape_function].single_nonzero_component;
279 const Number &value = dof_values[shape_function];
283 if (CheckForZero<Number>::value(value) ==
true)
288 const unsigned int comp = shape_function_data[shape_function]
289 .single_nonzero_component_index;
290 const ::Tensor<order, spacedim> *shape_derivative_ptr =
291 &shape_derivatives[snc][0];
292 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
294 derivatives[q_point][comp] += value * (*shape_derivative_ptr++);
297 for (
unsigned int d = 0; d < spacedim; ++d)
298 if (shape_function_data[shape_function]
299 .is_nonzero_shape_function_component[d])
301 const ::Tensor<order, spacedim> *shape_derivative_ptr =
302 &shape_derivatives[shape_function_data[shape_function]
304 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
306 derivatives[q_point][d] +=
307 value * (*shape_derivative_ptr++);
320 &shape_function_data,
324 &symmetric_gradients)
326 const unsigned int dofs_per_cell = dof_values.
size();
327 const unsigned int n_quadrature_points = symmetric_gradients.size();
330 symmetric_gradients.begin(),
331 symmetric_gradients.end(),
335 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
339 shape_function_data[shape_function].single_nonzero_component;
345 const Number &value = dof_values[shape_function];
349 if (CheckForZero<Number>::value(value) ==
true)
354 const unsigned int comp = shape_function_data[shape_function]
355 .single_nonzero_component_index;
356 const ::Tensor<1, spacedim> *shape_gradient_ptr =
357 &shape_gradients[snc][0];
358 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
361 for (
unsigned int d = 0; d < dim; ++d)
362 symmetric_gradients[q_point][comp][d] +=
363 0.5 * value * (*shape_gradient_ptr)[d];
364 symmetric_gradients[q_point][comp][comp] +=
365 0.5 * value * (*shape_gradient_ptr++)[comp];
369 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
374 for (
unsigned int d = 0; d < spacedim; ++d)
375 if (shape_function_data[shape_function]
376 .is_nonzero_shape_function_component[d])
379 shape_gradients[shape_function_data[shape_function]
380 .row_index[d]][q_point];
381 symmetric_gradients[q_point] +=
symmetrize(grad);
394 &shape_function_data,
396 template solution_divergence_type<Number>> &divergences)
398 const unsigned int dofs_per_cell = dof_values.
size();
399 const unsigned int n_quadrature_points = divergences.size();
405 spacedim>::template solution_divergence_type<Number>());
407 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
411 shape_function_data[shape_function].single_nonzero_component;
417 const Number &value = dof_values[shape_function];
421 if (CheckForZero<Number>::value(value) ==
true)
426 const unsigned int comp = shape_function_data[shape_function]
427 .single_nonzero_component_index;
428 const ::Tensor<1, spacedim> *shape_gradient_ptr =
429 &shape_gradients[snc][0];
430 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
432 divergences[q_point] += value * (*shape_gradient_ptr++)[comp];
435 for (
unsigned int d = 0; d < spacedim; ++d)
436 if (shape_function_data[shape_function]
437 .is_nonzero_shape_function_component[d])
439 const ::Tensor<1, spacedim> *shape_gradient_ptr =
440 &shape_gradients[shape_function_data[shape_function]
442 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
444 divergences[q_point] += value * (*shape_gradient_ptr++)[d];
457 &shape_function_data,
460 typename ::internal::CurlType<spacedim>>::type> &curls)
462 const unsigned int dofs_per_cell = dof_values.
size();
463 const unsigned int n_quadrature_points = curls.size();
465 std::fill(curls.begin(),
469 typename ::internal::CurlType<spacedim>>::type());
471 if constexpr (spacedim == 1)
475 "Computing the curl in 1d is not a useful operation"));
477 else if constexpr (spacedim == 2)
479 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
483 shape_function_data[shape_function].single_nonzero_component;
489 const Number &value = dof_values[shape_function];
493 if (CheckForZero<Number>::value(value) ==
true)
498 const ::Tensor<1, spacedim> *shape_gradient_ptr =
499 &shape_gradients[snc][0];
501 Assert(shape_function_data[shape_function]
502 .single_nonzero_component >= 0,
505 if (shape_function_data[shape_function]
506 .single_nonzero_component_index == 0)
507 for (
unsigned int q_point = 0;
508 q_point < n_quadrature_points;
510 curls[q_point] -= value * (*shape_gradient_ptr++)[1];
512 for (
unsigned int q_point = 0;
513 q_point < n_quadrature_points;
515 curls[q_point] += value * (*shape_gradient_ptr++)[0];
523 if (shape_function_data[shape_function]
524 .is_nonzero_shape_function_component[0])
526 const ::Tensor<1, spacedim> *shape_gradient_ptr =
527 &shape_gradients[shape_function_data[shape_function]
530 for (
unsigned int q_point = 0;
531 q_point < n_quadrature_points;
533 curls[q_point] -= value * (*shape_gradient_ptr++)[1];
536 if (shape_function_data[shape_function]
537 .is_nonzero_shape_function_component[1])
539 const ::Tensor<1, spacedim> *shape_gradient_ptr =
540 &shape_gradients[shape_function_data[shape_function]
543 for (
unsigned int q_point = 0;
544 q_point < n_quadrature_points;
546 curls[q_point] += value * (*shape_gradient_ptr++)[0];
551 else if constexpr (spacedim == 3)
553 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
557 shape_function_data[shape_function].single_nonzero_component;
563 const Number &value = dof_values[shape_function];
567 if (CheckForZero<Number>::value(value) ==
true)
572 const ::Tensor<1, spacedim> *shape_gradient_ptr =
573 &shape_gradients[snc][0];
575 switch (shape_function_data[shape_function]
576 .single_nonzero_component_index)
580 for (
unsigned int q_point = 0;
581 q_point < n_quadrature_points;
585 value * (*shape_gradient_ptr)[2];
587 value * (*shape_gradient_ptr++)[1];
595 for (
unsigned int q_point = 0;
596 q_point < n_quadrature_points;
600 value * (*shape_gradient_ptr)[2];
602 value * (*shape_gradient_ptr++)[0];
610 for (
unsigned int q_point = 0;
611 q_point < n_quadrature_points;
615 value * (*shape_gradient_ptr)[1];
617 value * (*shape_gradient_ptr++)[0];
632 if (shape_function_data[shape_function]
633 .is_nonzero_shape_function_component[0])
635 const ::Tensor<1, spacedim> *shape_gradient_ptr =
636 &shape_gradients[shape_function_data[shape_function]
639 for (
unsigned int q_point = 0;
640 q_point < n_quadrature_points;
643 curls[q_point][1] += value * (*shape_gradient_ptr)[2];
645 value * (*shape_gradient_ptr++)[1];
649 if (shape_function_data[shape_function]
650 .is_nonzero_shape_function_component[1])
652 const ::Tensor<1, spacedim> *shape_gradient_ptr =
653 &shape_gradients[shape_function_data[shape_function]
656 for (
unsigned int q_point = 0;
657 q_point < n_quadrature_points;
660 curls[q_point][0] -= value * (*shape_gradient_ptr)[2];
662 value * (*shape_gradient_ptr++)[0];
666 if (shape_function_data[shape_function]
667 .is_nonzero_shape_function_component[2])
669 const ::Tensor<1, spacedim> *shape_gradient_ptr =
670 &shape_gradients[shape_function_data[shape_function]
673 for (
unsigned int q_point = 0;
674 q_point < n_quadrature_points;
677 curls[q_point][0] += value * (*shape_gradient_ptr)[1];
679 value * (*shape_gradient_ptr++)[0];
697 &shape_function_data,
699 template solution_laplacian_type<Number>> &laplacians)
701 const unsigned int dofs_per_cell = dof_values.
size();
702 const unsigned int n_quadrature_points = laplacians.size();
708 spacedim>::template solution_laplacian_type<Number>());
710 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
714 shape_function_data[shape_function].single_nonzero_component;
720 const Number &value = dof_values[shape_function];
724 if (CheckForZero<Number>::value(value) ==
true)
729 const unsigned int comp = shape_function_data[shape_function]
730 .single_nonzero_component_index;
731 const ::Tensor<2, spacedim> *shape_hessian_ptr =
732 &shape_hessians[snc][0];
733 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
735 laplacians[q_point][comp] +=
736 value *
trace(*shape_hessian_ptr++);
739 for (
unsigned int d = 0; d < spacedim; ++d)
740 if (shape_function_data[shape_function]
741 .is_nonzero_shape_function_component[d])
743 const ::Tensor<2, spacedim> *shape_hessian_ptr =
744 &shape_hessians[shape_function_data[shape_function]
746 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
748 laplacians[q_point][d] +=
749 value *
trace(*shape_hessian_ptr++);
762 const ::Table<2, double> &shape_values,
765 &shape_function_data,
771 const unsigned int dofs_per_cell = dof_values.
size();
772 const unsigned int n_quadrature_points = values.size();
780 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
784 shape_function_data[shape_function].single_nonzero_component;
790 const Number &value = dof_values[shape_function];
794 if (CheckForZero<Number>::value(value) ==
true)
801 shape_function_data[shape_function]
802 .single_nonzero_component_index);
803 const double *shape_value_ptr = &shape_values(snc, 0);
804 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
805 ++q_point, ++shape_value_ptr)
806 values[q_point][comp] += value * (*shape_value_ptr);
809 for (
unsigned int d = 0;
813 if (shape_function_data[shape_function]
814 .is_nonzero_shape_function_component[d])
819 const double *shape_value_ptr = &shape_values(
820 shape_function_data[shape_function].row_index[d], 0);
821 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
822 ++q_point, ++shape_value_ptr)
823 values[q_point][comp] += value * (*shape_value_ptr);
837 &shape_function_data,
839 template solution_divergence_type<Number>> &divergences)
841 const unsigned int dofs_per_cell = dof_values.
size();
842 const unsigned int n_quadrature_points = divergences.size();
844 std::fill(divergences.begin(),
847 template solution_divergence_type<Number>());
849 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
853 shape_function_data[shape_function].single_nonzero_component;
859 const Number &value = dof_values[shape_function];
863 if (CheckForZero<Number>::value(value) ==
true)
868 const unsigned int comp = shape_function_data[shape_function]
869 .single_nonzero_component_index;
871 const ::Tensor<1, spacedim> *shape_gradient_ptr =
872 &shape_gradients[snc][0];
879 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
880 ++q_point, ++shape_gradient_ptr)
882 divergences[q_point][ii] += value * (*shape_gradient_ptr)[jj];
885 divergences[q_point][jj] +=
886 value * (*shape_gradient_ptr)[ii];
891 for (
unsigned int d = 0;
894 spacedim>::n_independent_components;
896 if (shape_function_data[shape_function]
897 .is_nonzero_shape_function_component[d])
909 const unsigned int comp =
910 shape_function_data[shape_function]
911 .single_nonzero_component_index;
913 const ::Tensor<1, spacedim> *shape_gradient_ptr =
914 &shape_gradients[shape_function_data[shape_function]
916 for (
unsigned int q_point = 0;
917 q_point < n_quadrature_points;
918 ++q_point, ++shape_gradient_ptr)
920 for (
unsigned int j = 0; j < spacedim;
921 ++j, ++shape_gradient_ptr)
923 const unsigned int vector_component =
927 divergences[q_point][vector_component] +=
928 value * (*shape_gradient_ptr)[j];
942 const ::Table<2, double> &shape_values,
944 &shape_function_data,
949 const unsigned int dofs_per_cell = dof_values.
size();
950 const unsigned int n_quadrature_points = values.size();
957 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
961 shape_function_data[shape_function].single_nonzero_component;
967 const Number &value = dof_values[shape_function];
971 if (CheckForZero<Number>::value(value) ==
true)
976 const unsigned int comp = shape_function_data[shape_function]
977 .single_nonzero_component_index;
983 const double *shape_value_ptr = &shape_values(snc, 0);
984 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
985 ++q_point, ++shape_value_ptr)
986 values[q_point][indices] += value * (*shape_value_ptr);
989 for (
unsigned int d = 0; d < dim * dim; ++d)
990 if (shape_function_data[shape_function]
991 .is_nonzero_shape_function_component[d])
997 const double *shape_value_ptr = &shape_values(
998 shape_function_data[shape_function].row_index[d], 0);
999 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1000 ++q_point, ++shape_value_ptr)
1001 values[q_point][indices] += value * (*shape_value_ptr);
1014 &shape_function_data,
1016 template solution_divergence_type<Number>> &divergences)
1018 const unsigned int dofs_per_cell = dof_values.
size();
1019 const unsigned int n_quadrature_points = divergences.size();
1022 divergences.begin(),
1027 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
1031 shape_function_data[shape_function].single_nonzero_component;
1037 const Number &value = dof_values[shape_function];
1041 if (CheckForZero<Number>::value(value) ==
true)
1046 const unsigned int comp = shape_function_data[shape_function]
1047 .single_nonzero_component_index;
1049 const ::Tensor<1, spacedim> *shape_gradient_ptr =
1050 &shape_gradients[snc][0];
1055 const unsigned int ii = indices[0];
1056 const unsigned int jj = indices[1];
1058 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1059 ++q_point, ++shape_gradient_ptr)
1061 divergences[q_point][ii] += value * (*shape_gradient_ptr)[jj];
1066 for (
unsigned int d = 0; d < dim * dim; ++d)
1067 if (shape_function_data[shape_function]
1068 .is_nonzero_shape_function_component[d])
1084 &shape_function_data,
1086 template solution_gradient_type<Number>> &gradients)
1088 const unsigned int dofs_per_cell = dof_values.
size();
1089 const unsigned int n_quadrature_points = gradients.size();
1097 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
1101 shape_function_data[shape_function].single_nonzero_component;
1107 const Number &value = dof_values[shape_function];
1111 if (CheckForZero<Number>::value(value) ==
true)
1116 const unsigned int comp = shape_function_data[shape_function]
1117 .single_nonzero_component_index;
1119 const ::Tensor<1, spacedim> *shape_gradient_ptr =
1120 &shape_gradients[snc][0];
1125 const unsigned int ii = indices[0];
1126 const unsigned int jj = indices[1];
1128 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1129 ++q_point, ++shape_gradient_ptr)
1131 gradients[q_point][ii][jj] += value * (*shape_gradient_ptr);
1136 for (
unsigned int d = 0; d < dim * dim; ++d)
1137 if (shape_function_data[shape_function]
1138 .is_nonzero_shape_function_component[d])