76 const unsigned int dofs_per_cell = dof_values.
size();
77 const unsigned int n_quadrature_points = values.size();
79 std::fill(values.begin(),
83 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
85 if (shape_function_data[shape_function]
86 .is_nonzero_shape_function_component)
88 const Number &value = dof_values[shape_function];
92 if (CheckForZero<Number>::value(value) ==
true)
95 const double *shape_value_ptr =
96 &shape_values(shape_function_data[shape_function].row_index, 0);
97 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
98 ++q_point, ++shape_value_ptr)
99 values[q_point] += value * (*shape_value_ptr);
153 &shape_function_data,
155 template solution_laplacian_type<Number>> &laplacians)
157 const unsigned int dofs_per_cell = dof_values.
size();
158 const unsigned int n_quadrature_points = laplacians.size();
164 spacedim>::template solution_laplacian_type<Number>());
166 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
168 if (shape_function_data[shape_function]
169 .is_nonzero_shape_function_component)
171 const Number &value = dof_values[shape_function];
175 if (CheckForZero<Number>::value(value) ==
true)
178 const ::Tensor<2, spacedim> *shape_hessian_ptr =
179 &shape_hessians[shape_function_data[shape_function].row_index][0];
180 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
182 laplacians[q_point] += value *
trace(*shape_hessian_ptr++);
196 &shape_function_data,
201 const unsigned int dofs_per_cell = dof_values.
size();
202 const unsigned int n_quadrature_points = values.size();
209 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
213 shape_function_data[shape_function].single_nonzero_component;
219 const Number &value = dof_values[shape_function];
223 if (CheckForZero<Number>::value(value) ==
true)
228 const unsigned int comp = shape_function_data[shape_function]
229 .single_nonzero_component_index;
230 const double *shape_value_ptr = &shape_values(snc, 0);
231 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
232 ++q_point, ++shape_value_ptr)
233 values[q_point][comp] += value * (*shape_value_ptr);
236 for (
unsigned int d = 0; d < spacedim; ++d)
237 if (shape_function_data[shape_function]
238 .is_nonzero_shape_function_component[d])
240 const double *shape_value_ptr = &shape_values(
241 shape_function_data[shape_function].row_index[d], 0);
242 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
243 ++q_point, ++shape_value_ptr)
244 values[q_point][d] += value * (*shape_value_ptr);
257 &shape_function_data,
262 const unsigned int dofs_per_cell = dof_values.
size();
263 const unsigned int n_quadrature_points = derivatives.size();
271 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
275 shape_function_data[shape_function].single_nonzero_component;
281 const Number &value = dof_values[shape_function];
285 if (CheckForZero<Number>::value(value) ==
true)
290 const unsigned int comp = shape_function_data[shape_function]
291 .single_nonzero_component_index;
292 const ::Tensor<order, spacedim> *shape_derivative_ptr =
293 &shape_derivatives[snc][0];
294 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
296 derivatives[q_point][comp] += value * (*shape_derivative_ptr++);
299 for (
unsigned int d = 0; d < spacedim; ++d)
300 if (shape_function_data[shape_function]
301 .is_nonzero_shape_function_component[d])
303 const ::Tensor<order, spacedim> *shape_derivative_ptr =
304 &shape_derivatives[shape_function_data[shape_function]
306 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
308 derivatives[q_point][d] +=
309 value * (*shape_derivative_ptr++);
322 &shape_function_data,
326 &symmetric_gradients)
328 const unsigned int dofs_per_cell = dof_values.
size();
329 const unsigned int n_quadrature_points = symmetric_gradients.size();
332 symmetric_gradients.begin(),
333 symmetric_gradients.end(),
337 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
341 shape_function_data[shape_function].single_nonzero_component;
347 const Number &value = dof_values[shape_function];
351 if (CheckForZero<Number>::value(value) ==
true)
356 const unsigned int comp = shape_function_data[shape_function]
357 .single_nonzero_component_index;
358 const ::Tensor<1, spacedim> *shape_gradient_ptr =
359 &shape_gradients[snc][0];
360 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
363 for (
unsigned int d = 0; d < dim; ++d)
364 symmetric_gradients[q_point][comp][d] +=
365 0.5 * value * (*shape_gradient_ptr)[d];
366 symmetric_gradients[q_point][comp][comp] +=
367 0.5 * value * (*shape_gradient_ptr++)[comp];
371 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
376 for (
unsigned int d = 0; d < spacedim; ++d)
377 if (shape_function_data[shape_function]
378 .is_nonzero_shape_function_component[d])
381 shape_gradients[shape_function_data[shape_function]
382 .row_index[d]][q_point];
383 symmetric_gradients[q_point] +=
symmetrize(grad);
396 &shape_function_data,
398 template solution_divergence_type<Number>> &divergences)
400 const unsigned int dofs_per_cell = dof_values.
size();
401 const unsigned int n_quadrature_points = divergences.size();
407 spacedim>::template solution_divergence_type<Number>());
409 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
413 shape_function_data[shape_function].single_nonzero_component;
419 const Number &value = dof_values[shape_function];
423 if (CheckForZero<Number>::value(value) ==
true)
428 const unsigned int comp = shape_function_data[shape_function]
429 .single_nonzero_component_index;
430 const ::Tensor<1, spacedim> *shape_gradient_ptr =
431 &shape_gradients[snc][0];
432 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
434 divergences[q_point] += value * (*shape_gradient_ptr++)[comp];
437 for (
unsigned int d = 0; d < spacedim; ++d)
438 if (shape_function_data[shape_function]
439 .is_nonzero_shape_function_component[d])
441 const ::Tensor<1, spacedim> *shape_gradient_ptr =
442 &shape_gradients[shape_function_data[shape_function]
444 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
446 divergences[q_point] += value * (*shape_gradient_ptr++)[d];
459 &shape_function_data,
462 typename ::internal::CurlType<spacedim>::type>::type> &curls)
464 const unsigned int dofs_per_cell = dof_values.
size();
465 const unsigned int n_quadrature_points = curls.size();
467 std::fill(curls.begin(),
471 typename ::internal::CurlType<spacedim>::type>::type());
479 "Computing the curl in 1d is not a useful operation"));
485 for (
unsigned int shape_function = 0;
486 shape_function < dofs_per_cell;
489 const int snc = shape_function_data[shape_function]
490 .single_nonzero_component;
496 const Number &value = dof_values[shape_function];
500 if (CheckForZero<Number>::value(value) ==
true)
505 const ::Tensor<1, spacedim> *shape_gradient_ptr =
506 &shape_gradients[snc][0];
508 Assert(shape_function_data[shape_function]
509 .single_nonzero_component >= 0,
512 if (shape_function_data[shape_function]
513 .single_nonzero_component_index == 0)
514 for (
unsigned int q_point = 0;
515 q_point < n_quadrature_points;
518 value * (*shape_gradient_ptr++)[1];
520 for (
unsigned int q_point = 0;
521 q_point < n_quadrature_points;
524 value * (*shape_gradient_ptr++)[0];
532 if (shape_function_data[shape_function]
533 .is_nonzero_shape_function_component[0])
536 spacedim> *shape_gradient_ptr =
537 &shape_gradients[shape_function_data[shape_function]
540 for (
unsigned int q_point = 0;
541 q_point < n_quadrature_points;
544 value * (*shape_gradient_ptr++)[1];
547 if (shape_function_data[shape_function]
548 .is_nonzero_shape_function_component[1])
551 spacedim> *shape_gradient_ptr =
552 &shape_gradients[shape_function_data[shape_function]
555 for (
unsigned int q_point = 0;
556 q_point < n_quadrature_points;
559 value * (*shape_gradient_ptr++)[0];
568 for (
unsigned int shape_function = 0;
569 shape_function < dofs_per_cell;
572 const int snc = shape_function_data[shape_function]
573 .single_nonzero_component;
579 const Number &value = dof_values[shape_function];
583 if (CheckForZero<Number>::value(value) ==
true)
588 const ::Tensor<1, spacedim> *shape_gradient_ptr =
589 &shape_gradients[snc][0];
591 switch (shape_function_data[shape_function]
592 .single_nonzero_component_index)
596 for (
unsigned int q_point = 0;
597 q_point < n_quadrature_points;
601 value * (*shape_gradient_ptr)[2];
603 value * (*shape_gradient_ptr++)[1];
611 for (
unsigned int q_point = 0;
612 q_point < n_quadrature_points;
616 value * (*shape_gradient_ptr)[2];
618 value * (*shape_gradient_ptr++)[0];
626 for (
unsigned int q_point = 0;
627 q_point < n_quadrature_points;
631 value * (*shape_gradient_ptr)[1];
633 value * (*shape_gradient_ptr++)[0];
649 if (shape_function_data[shape_function]
650 .is_nonzero_shape_function_component[0])
653 spacedim> *shape_gradient_ptr =
654 &shape_gradients[shape_function_data[shape_function]
657 for (
unsigned int q_point = 0;
658 q_point < n_quadrature_points;
662 value * (*shape_gradient_ptr)[2];
664 value * (*shape_gradient_ptr++)[1];
668 if (shape_function_data[shape_function]
669 .is_nonzero_shape_function_component[1])
672 spacedim> *shape_gradient_ptr =
673 &shape_gradients[shape_function_data[shape_function]
676 for (
unsigned int q_point = 0;
677 q_point < n_quadrature_points;
681 value * (*shape_gradient_ptr)[2];
683 value * (*shape_gradient_ptr++)[0];
687 if (shape_function_data[shape_function]
688 .is_nonzero_shape_function_component[2])
691 spacedim> *shape_gradient_ptr =
692 &shape_gradients[shape_function_data[shape_function]
695 for (
unsigned int q_point = 0;
696 q_point < n_quadrature_points;
700 value * (*shape_gradient_ptr)[1];
702 value * (*shape_gradient_ptr++)[0];
719 &shape_function_data,
721 template solution_laplacian_type<Number>> &laplacians)
723 const unsigned int dofs_per_cell = dof_values.
size();
724 const unsigned int n_quadrature_points = laplacians.size();
730 spacedim>::template solution_laplacian_type<Number>());
732 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
736 shape_function_data[shape_function].single_nonzero_component;
742 const Number &value = dof_values[shape_function];
746 if (CheckForZero<Number>::value(value) ==
true)
751 const unsigned int comp = shape_function_data[shape_function]
752 .single_nonzero_component_index;
753 const ::Tensor<2, spacedim> *shape_hessian_ptr =
754 &shape_hessians[snc][0];
755 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
757 laplacians[q_point][comp] +=
758 value *
trace(*shape_hessian_ptr++);
761 for (
unsigned int d = 0; d < spacedim; ++d)
762 if (shape_function_data[shape_function]
763 .is_nonzero_shape_function_component[d])
765 const ::Tensor<2, spacedim> *shape_hessian_ptr =
766 &shape_hessians[shape_function_data[shape_function]
768 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
770 laplacians[q_point][d] +=
771 value *
trace(*shape_hessian_ptr++);
784 const ::Table<2, double> &shape_values,
787 &shape_function_data,
793 const unsigned int dofs_per_cell = dof_values.
size();
794 const unsigned int n_quadrature_points = values.size();
802 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
806 shape_function_data[shape_function].single_nonzero_component;
812 const Number &value = dof_values[shape_function];
816 if (CheckForZero<Number>::value(value) ==
true)
823 shape_function_data[shape_function]
824 .single_nonzero_component_index);
825 const double *shape_value_ptr = &shape_values(snc, 0);
826 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
827 ++q_point, ++shape_value_ptr)
828 values[q_point][comp] += value * (*shape_value_ptr);
831 for (
unsigned int d = 0;
835 if (shape_function_data[shape_function]
836 .is_nonzero_shape_function_component[d])
841 const double *shape_value_ptr = &shape_values(
842 shape_function_data[shape_function].row_index[d], 0);
843 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
844 ++q_point, ++shape_value_ptr)
845 values[q_point][comp] += value * (*shape_value_ptr);
859 &shape_function_data,
861 template solution_divergence_type<Number>> &divergences)
863 const unsigned int dofs_per_cell = dof_values.
size();
864 const unsigned int n_quadrature_points = divergences.size();
866 std::fill(divergences.begin(),
869 template solution_divergence_type<Number>());
871 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
875 shape_function_data[shape_function].single_nonzero_component;
881 const Number &value = dof_values[shape_function];
885 if (CheckForZero<Number>::value(value) ==
true)
890 const unsigned int comp = shape_function_data[shape_function]
891 .single_nonzero_component_index;
893 const ::Tensor<1, spacedim> *shape_gradient_ptr =
894 &shape_gradients[snc][0];
901 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
902 ++q_point, ++shape_gradient_ptr)
904 divergences[q_point][ii] += value * (*shape_gradient_ptr)[jj];
907 divergences[q_point][jj] +=
908 value * (*shape_gradient_ptr)[ii];
913 for (
unsigned int d = 0;
916 spacedim>::n_independent_components;
918 if (shape_function_data[shape_function]
919 .is_nonzero_shape_function_component[d])
931 const unsigned int comp =
932 shape_function_data[shape_function]
933 .single_nonzero_component_index;
935 const ::Tensor<1, spacedim> *shape_gradient_ptr =
936 &shape_gradients[shape_function_data[shape_function]
938 for (
unsigned int q_point = 0;
939 q_point < n_quadrature_points;
940 ++q_point, ++shape_gradient_ptr)
942 for (
unsigned int j = 0; j < spacedim;
943 ++j, ++shape_gradient_ptr)
945 const unsigned int vector_component =
949 divergences[q_point][vector_component] +=
950 value * (*shape_gradient_ptr)[j];
964 const ::Table<2, double> &shape_values,
966 &shape_function_data,
971 const unsigned int dofs_per_cell = dof_values.
size();
972 const unsigned int n_quadrature_points = values.size();
979 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
983 shape_function_data[shape_function].single_nonzero_component;
989 const Number &value = dof_values[shape_function];
993 if (CheckForZero<Number>::value(value) ==
true)
998 const unsigned int comp = shape_function_data[shape_function]
999 .single_nonzero_component_index;
1005 const double *shape_value_ptr = &shape_values(snc, 0);
1006 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1007 ++q_point, ++shape_value_ptr)
1008 values[q_point][indices] += value * (*shape_value_ptr);
1011 for (
unsigned int d = 0; d < dim * dim; ++d)
1012 if (shape_function_data[shape_function]
1013 .is_nonzero_shape_function_component[d])
1019 const double *shape_value_ptr = &shape_values(
1020 shape_function_data[shape_function].row_index[d], 0);
1021 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1022 ++q_point, ++shape_value_ptr)
1023 values[q_point][indices] += value * (*shape_value_ptr);
1036 &shape_function_data,
1038 template solution_divergence_type<Number>> &divergences)
1040 const unsigned int dofs_per_cell = dof_values.
size();
1041 const unsigned int n_quadrature_points = divergences.size();
1044 divergences.begin(),
1049 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
1053 shape_function_data[shape_function].single_nonzero_component;
1059 const Number &value = dof_values[shape_function];
1063 if (CheckForZero<Number>::value(value) ==
true)
1068 const unsigned int comp = shape_function_data[shape_function]
1069 .single_nonzero_component_index;
1071 const ::Tensor<1, spacedim> *shape_gradient_ptr =
1072 &shape_gradients[snc][0];
1077 const unsigned int ii = indices[0];
1078 const unsigned int jj = indices[1];
1080 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1081 ++q_point, ++shape_gradient_ptr)
1083 divergences[q_point][ii] += value * (*shape_gradient_ptr)[jj];
1088 for (
unsigned int d = 0; d < dim * dim; ++d)
1089 if (shape_function_data[shape_function]
1090 .is_nonzero_shape_function_component[d])
1106 &shape_function_data,
1108 template solution_gradient_type<Number>> &gradients)
1110 const unsigned int dofs_per_cell = dof_values.
size();
1111 const unsigned int n_quadrature_points = gradients.size();
1119 for (
unsigned int shape_function = 0; shape_function < dofs_per_cell;
1123 shape_function_data[shape_function].single_nonzero_component;
1129 const Number &value = dof_values[shape_function];
1133 if (CheckForZero<Number>::value(value) ==
true)
1138 const unsigned int comp = shape_function_data[shape_function]
1139 .single_nonzero_component_index;
1141 const ::Tensor<1, spacedim> *shape_gradient_ptr =
1142 &shape_gradients[snc][0];
1147 const unsigned int ii = indices[0];
1148 const unsigned int jj = indices[1];
1150 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1151 ++q_point, ++shape_gradient_ptr)
1153 gradients[q_point][ii][jj] += value * (*shape_gradient_ptr);
1158 for (
unsigned int d = 0; d < dim * dim; ++d)
1159 if (shape_function_data[shape_function]
1160 .is_nonzero_shape_function_component[d])