71 const unsigned int dofs_per_cell = dof_values.
size();
72 const unsigned int n_quadrature_points = values.size();
74 std::fill(values.begin(),
78 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
80 if (shape_function_data[shape_function]
81 .is_nonzero_shape_function_component)
83 const Number &value = dof_values[shape_function];
87 if (CheckForZero<Number>::value(value) ==
true)
90 const double *shape_value_ptr =
91 &shape_values(shape_function_data[shape_function].row_index, 0);
92 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
93 ++q_point, ++shape_value_ptr)
94 values[q_point] += value * (*shape_value_ptr);
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;
227 ++q_point, ++shape_value_ptr)
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;
238 ++q_point, ++shape_value_ptr)
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;
822 ++q_point, ++shape_value_ptr)
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;
839 ++q_point, ++shape_value_ptr)
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;
938 ++j, ++shape_gradient_ptr)
940 const unsigned int vector_component =
944 divergences[q_point][vector_component] +=
945 value * (*shape_gradient_ptr)[j];
959 const ::Table<2, double> &shape_values,
961 &shape_function_data,
966 const unsigned int dofs_per_cell = dof_values.
size();
967 const unsigned int n_quadrature_points = values.size();
974 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
978 shape_function_data[shape_function].single_nonzero_component;
984 const Number &value = dof_values[shape_function];
988 if (CheckForZero<Number>::value(value) ==
true)
993 const unsigned int comp = shape_function_data[shape_function]
994 .single_nonzero_component_index;
1000 const double *shape_value_ptr = &shape_values(snc, 0);
1001 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1002 ++q_point, ++shape_value_ptr)
1003 values[q_point][indices] += value * (*shape_value_ptr);
1006 for (
unsigned int d = 0; d < dim * dim; ++d)
1007 if (shape_function_data[shape_function]
1008 .is_nonzero_shape_function_component[d])
1014 const double *shape_value_ptr = &shape_values(
1015 shape_function_data[shape_function].row_index[d], 0);
1016 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1017 ++q_point, ++shape_value_ptr)
1018 values[q_point][indices] += value * (*shape_value_ptr);
1031 &shape_function_data,
1033 template solution_divergence_type<Number>> &divergences)
1035 const unsigned int dofs_per_cell = dof_values.
size();
1036 const unsigned int n_quadrature_points = divergences.size();
1039 divergences.begin(),
1044 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
1048 shape_function_data[shape_function].single_nonzero_component;
1054 const Number &value = dof_values[shape_function];
1058 if (CheckForZero<Number>::value(value) ==
true)
1063 const unsigned int comp = shape_function_data[shape_function]
1064 .single_nonzero_component_index;
1066 const ::Tensor<1, spacedim> *shape_gradient_ptr =
1067 &shape_gradients[snc][0];
1072 const unsigned int ii = indices[0];
1073 const unsigned int jj = indices[1];
1075 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1076 ++q_point, ++shape_gradient_ptr)
1078 divergences[q_point][ii] += value * (*shape_gradient_ptr)[jj];
1083 for (
unsigned int d = 0; d < dim * dim; ++d)
1084 if (shape_function_data[shape_function]
1085 .is_nonzero_shape_function_component[d])
1101 &shape_function_data,
1103 template solution_gradient_type<Number>> &gradients)
1105 const unsigned int dofs_per_cell = dof_values.
size();
1106 const unsigned int n_quadrature_points = gradients.size();
1114 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
1118 shape_function_data[shape_function].single_nonzero_component;
1124 const Number &value = dof_values[shape_function];
1128 if (CheckForZero<Number>::value(value) ==
true)
1133 const unsigned int comp = shape_function_data[shape_function]
1134 .single_nonzero_component_index;
1136 const ::Tensor<1, spacedim> *shape_gradient_ptr =
1137 &shape_gradients[snc][0];
1142 const unsigned int ii = indices[0];
1143 const unsigned int jj = indices[1];
1145 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1146 ++q_point, ++shape_gradient_ptr)
1148 gradients[q_point][ii][jj] += value * (*shape_gradient_ptr);
1153 for (
unsigned int d = 0; d < dim * dim; ++d)
1154 if (shape_function_data[shape_function]
1155 .is_nonzero_shape_function_component[d])