16 #include <deal.II/base/array_view.h> 17 #include <deal.II/base/memory_consumption.h> 18 #include <deal.II/base/multithread_info.h> 19 #include <deal.II/base/numbers.h> 20 #include <deal.II/base/quadrature.h> 21 #include <deal.II/base/signaling_nan.h> 22 #include <deal.II/base/std_cxx14/memory.h> 23 #include <deal.II/differentiation/ad.h> 24 #include <deal.II/lac/vector.h> 25 #include <deal.II/lac/block_vector.h> 26 #include <deal.II/lac/la_vector.h> 27 #include <deal.II/lac/la_parallel_vector.h> 28 #include <deal.II/lac/la_parallel_block_vector.h> 29 #include <deal.II/lac/vector_element_access.h> 30 #include <deal.II/lac/petsc_parallel_vector.h> 31 #include <deal.II/lac/petsc_parallel_block_vector.h> 32 #include <deal.II/lac/trilinos_vector.h> 33 #include <deal.II/lac/trilinos_parallel_block_vector.h> 34 #include <deal.II/grid/tria_iterator.h> 35 #include <deal.II/grid/tria_accessor.h> 36 #include <deal.II/grid/tria_boundary.h> 37 #include <deal.II/dofs/dof_accessor.h> 38 #include <deal.II/fe/mapping_q1.h> 39 #include <deal.II/fe/fe_values.h> 40 #include <deal.II/fe/fe.h> 43 #include <type_traits> 46 #include <boost/container/small_vector.hpp> 48 DEAL_II_NAMESPACE_OPEN
53 template <
class VectorType>
54 typename VectorType::value_type
56 get_vector_element (
const VectorType &vector,
59 return internal::ElementAccess<VectorType>::get(vector,cell_number);
66 get_vector_element (
const IndexSet &is,
74 template <
int dim,
int spacedim>
76 std::vector<unsigned int>
88 unsigned int nth_nonzero_component = 0;
92 shape_function_to_row_table[i*fe.
n_components()+c] = row + nth_nonzero_component;
93 ++nth_nonzero_component;
98 return shape_function_to_row_table;
105 template <
typename Number,
typename T =
void>
109 value (
const Number &value)
120 template <
typename Number>
121 struct CheckForZero<Number, typename
std::enable_if<Differentiation::AD::is_ad_number<Number>::value>::type>
124 value (
const Number &)
136 template <
int dim,
int spacedim>
138 const unsigned int component)
140 fe_values (&fe_values),
141 component (component),
142 shape_function_data (this->fe_values->fe->dofs_per_cell)
151 const std::vector<unsigned int> shape_function_to_row_table
152 = ::internal::make_shape_function_to_row_table (fe);
158 if (is_primitive ==
true)
177 template <
int dim,
int spacedim>
181 component (
numbers::invalid_unsigned_int)
186 template <
int dim,
int spacedim>
197 template <
int dim,
int spacedim>
199 const unsigned int first_vector_component)
201 fe_values (&fe_values),
202 first_vector_component (first_vector_component),
203 shape_function_data (this->fe_values->fe->dofs_per_cell)
213 const std::vector<unsigned int> shape_function_to_row_table
214 = ::internal::make_shape_function_to_row_table (fe);
216 for (
unsigned int d=0; d<spacedim; ++d)
224 if (is_primitive ==
true)
236 = shape_function_to_row_table[i*fe.
n_components()+component];
245 unsigned int n_nonzero_components = 0;
246 for (
unsigned int d=0; d<spacedim; ++d)
249 ++n_nonzero_components;
251 if (n_nonzero_components == 0)
253 else if (n_nonzero_components > 1)
257 for (
unsigned int d=0; d<spacedim; ++d)
273 template <
int dim,
int spacedim>
277 first_vector_component (
numbers::invalid_unsigned_int)
282 template <
int dim,
int spacedim>
293 template <
int dim,
int spacedim>
296 const unsigned int first_tensor_component)
298 fe_values(&fe_values),
299 first_tensor_component(first_tensor_component),
300 shape_function_data(this->fe_values->fe->dofs_per_cell)
303 Assert(first_tensor_component + (dim*dim+dim)/2 - 1
313 const std::vector<unsigned int> shape_function_to_row_table
314 = ::internal::make_shape_function_to_row_table (fe);
316 for (
unsigned int d = 0; d < ::SymmetricTensor<2,dim>::n_independent_components; ++d)
318 const unsigned int component = first_tensor_component + d;
324 if (is_primitive ==
true)
325 shape_function_data[i].is_nonzero_shape_function_component[d]
329 shape_function_data[i].is_nonzero_shape_function_component[d]
333 if (shape_function_data[i].is_nonzero_shape_function_component[d]
335 shape_function_data[i].row_index[d]
336 = shape_function_to_row_table[i*fe.
n_components()+component];
338 shape_function_data[i].row_index[d]
345 unsigned int n_nonzero_components = 0;
346 for (
unsigned int d = 0; d < ::SymmetricTensor<2,dim>::n_independent_components; ++d)
347 if (shape_function_data[i].is_nonzero_shape_function_component[d]
349 ++n_nonzero_components;
351 if (n_nonzero_components == 0)
352 shape_function_data[i].single_nonzero_component = -2;
353 else if (n_nonzero_components > 1)
354 shape_function_data[i].single_nonzero_component = -1;
357 for (
unsigned int d = 0; d < ::SymmetricTensor<2,dim>::n_independent_components; ++d)
358 if (shape_function_data[i].is_nonzero_shape_function_component[d]
361 shape_function_data[i].single_nonzero_component
362 = shape_function_data[i].row_index[d];
363 shape_function_data[i].single_nonzero_component_index
373 template <
int dim,
int spacedim>
377 first_tensor_component(
numbers::invalid_unsigned_int)
382 template <
int dim,
int spacedim>
393 template <
int dim,
int spacedim>
396 const unsigned int first_tensor_component)
398 fe_values(&fe_values),
399 first_tensor_component(first_tensor_component),
400 shape_function_data(this->fe_values->fe->dofs_per_cell)
403 Assert(first_tensor_component + dim*dim - 1
413 const std::vector<unsigned int> shape_function_to_row_table
414 = ::internal::make_shape_function_to_row_table (fe);
416 for (
unsigned int d = 0; d < dim*dim; ++d)
418 const unsigned int component = first_tensor_component + d;
424 if (is_primitive ==
true)
425 shape_function_data[i].is_nonzero_shape_function_component[d]
429 shape_function_data[i].is_nonzero_shape_function_component[d]
433 if (shape_function_data[i].is_nonzero_shape_function_component[d]
435 shape_function_data[i].row_index[d]
436 = shape_function_to_row_table[i*fe.
n_components()+component];
438 shape_function_data[i].row_index[d]
445 unsigned int n_nonzero_components = 0;
446 for (
unsigned int d = 0; d < dim*dim; ++d)
447 if (shape_function_data[i].is_nonzero_shape_function_component[d]
449 ++n_nonzero_components;
451 if (n_nonzero_components == 0)
452 shape_function_data[i].single_nonzero_component = -2;
453 else if (n_nonzero_components > 1)
454 shape_function_data[i].single_nonzero_component = -1;
457 for (
unsigned int d = 0; d < dim*dim; ++d)
458 if (shape_function_data[i].is_nonzero_shape_function_component[d]
461 shape_function_data[i].single_nonzero_component
462 = shape_function_data[i].row_index[d];
463 shape_function_data[i].single_nonzero_component_index
473 template <
int dim,
int spacedim>
477 first_tensor_component(
numbers::invalid_unsigned_int)
482 template <
int dim,
int spacedim>
499 template <
int dim,
int spacedim,
typename Number>
504 std::vector<
typename ProductType<Number,double>::type> &values)
506 const unsigned int dofs_per_cell = dof_values.
size();
507 const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
508 shape_values.n_cols() : values.
size();
511 std::fill (values.begin(), values.end(),
514 for (
unsigned int shape_function=0;
515 shape_function<dofs_per_cell; ++shape_function)
516 if (shape_function_data[shape_function].is_nonzero_shape_function_component)
518 const Number &value = dof_values[shape_function];
522 if (::internal::CheckForZero<Number>::value(value) ==
true)
525 const double *shape_value_ptr =
526 &shape_values(shape_function_data[shape_function].row_index, 0);
527 for (
unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
528 values[q_point] += value * (*shape_value_ptr++);
536 template <
int order,
int dim,
int spacedim,
typename Number>
540 const std::vector<
typename Scalar<dim,spacedim>::ShapeFunctionData> &shape_function_data,
543 const unsigned int dofs_per_cell = dof_values.
size();
544 const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
545 shape_derivatives[0].size() : derivatives.size();
548 std::fill (derivatives.begin(), derivatives.end(),
551 for (
unsigned int shape_function=0;
552 shape_function<dofs_per_cell; ++shape_function)
553 if (shape_function_data[shape_function].is_nonzero_shape_function_component)
555 const Number &value = dof_values[shape_function];
559 if (::internal::CheckForZero<Number>::value(value) ==
true)
562 const ::Tensor<order,spacedim> *shape_derivative_ptr =
563 &shape_derivatives[shape_function_data[shape_function].row_index][0];
564 for (
unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
565 derivatives[q_point] += value * (*shape_derivative_ptr++);
571 template <
int dim,
int spacedim,
typename Number>
575 const std::vector<
typename Scalar<dim,spacedim>::ShapeFunctionData> &shape_function_data,
576 std::vector<
typename Scalar<dim,spacedim>::template OutputType<Number>::laplacian_type> &laplacians)
578 const unsigned int dofs_per_cell = dof_values.
size();
579 const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
580 shape_hessians[0].size() : laplacians.size();
583 std::fill (laplacians.begin(), laplacians.end(),
584 typename Scalar<dim,spacedim>::template OutputType<Number>::laplacian_type());
586 for (
unsigned int shape_function=0;
587 shape_function<dofs_per_cell; ++shape_function)
588 if (shape_function_data[shape_function].is_nonzero_shape_function_component)
590 const Number &value = dof_values[shape_function];
594 if (::internal::CheckForZero<Number>::value(value) ==
true)
597 const ::Tensor<2,spacedim> *shape_hessian_ptr =
598 &shape_hessians[shape_function_data[shape_function].row_index][0];
599 for (
unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
600 laplacians[q_point] += value *
trace(*shape_hessian_ptr++);
608 template <
int dim,
int spacedim,
typename Number>
611 const std::vector<
typename Vector<dim,spacedim>::ShapeFunctionData> &shape_function_data,
614 const unsigned int dofs_per_cell = dof_values.
size();
615 const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
616 shape_values.n_cols() : values.
size();
619 std::fill (values.begin(), values.end(),
622 for (
unsigned int shape_function=0;
623 shape_function<dofs_per_cell; ++shape_function)
625 const int snc = shape_function_data[shape_function].single_nonzero_component;
631 const Number &value = dof_values[shape_function];
635 if (::internal::CheckForZero<Number>::value(value) ==
true)
640 const unsigned int comp =
641 shape_function_data[shape_function].single_nonzero_component_index;
642 const double *shape_value_ptr = &shape_values(snc,0);
643 for (
unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
644 values[q_point][comp] += value * (*shape_value_ptr++);
647 for (
unsigned int d=0;
d<spacedim; ++
d)
648 if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
650 const double *shape_value_ptr =
651 &shape_values(shape_function_data[shape_function].row_index[d],0);
652 for (
unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
653 values[q_point][d] += value * (*shape_value_ptr++);
660 template <
int order,
int dim,
int spacedim,
typename Number>
664 const std::vector<
typename Vector<dim,spacedim>::ShapeFunctionData> &shape_function_data,
667 const unsigned int dofs_per_cell = dof_values.
size();
668 const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
669 shape_derivatives[0].size() : derivatives.size();
672 std::fill (derivatives.begin(), derivatives.end(),
675 for (
unsigned int shape_function=0;
676 shape_function<dofs_per_cell; ++shape_function)
678 const int snc = shape_function_data[shape_function].single_nonzero_component;
684 const Number &value = dof_values[shape_function];
688 if (::internal::CheckForZero<Number>::value(value) ==
true)
693 const unsigned int comp =
694 shape_function_data[shape_function].single_nonzero_component_index;
695 const ::Tensor<order,spacedim> *shape_derivative_ptr =
696 &shape_derivatives[snc][0];
697 for (
unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
698 derivatives[q_point][comp] += value * (*shape_derivative_ptr++);
701 for (
unsigned int d=0;
d<spacedim; ++
d)
702 if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
704 const ::Tensor<order,spacedim> *shape_derivative_ptr =
705 &shape_derivatives[shape_function_data[shape_function].
707 for (
unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
708 derivatives[q_point][d] += value * (*shape_derivative_ptr++);
715 template <
int dim,
int spacedim,
typename Number>
719 const std::vector<
typename Vector<dim,spacedim>::ShapeFunctionData> &shape_function_data,
722 const unsigned int dofs_per_cell = dof_values.
size();
723 const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
724 shape_gradients[0].size() : symmetric_gradients.size();
727 std::fill (symmetric_gradients.begin(), symmetric_gradients.end(),
730 for (
unsigned int shape_function=0;
731 shape_function<dofs_per_cell; ++shape_function)
733 const int snc = shape_function_data[shape_function].single_nonzero_component;
739 const Number &value = dof_values[shape_function];
743 if (::internal::CheckForZero<Number>::value(value) ==
true)
748 const unsigned int comp =
749 shape_function_data[shape_function].single_nonzero_component_index;
750 const ::Tensor<1,spacedim> *shape_gradient_ptr =
751 &shape_gradients[snc][0];
752 for (
unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
753 symmetric_gradients[q_point] += value *
757 for (
unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
760 for (
unsigned int d=0;
d<spacedim; ++
d)
761 if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
763 shape_gradients[shape_function_data[shape_function].row_index[
d]][q_point];
764 symmetric_gradients[q_point] +=
symmetrize(grad);
771 template <
int dim,
int spacedim,
typename Number>
775 const std::vector<
typename Vector<dim,spacedim>::ShapeFunctionData> &shape_function_data,
776 std::vector<
typename Vector<dim,spacedim>::template OutputType<Number>::divergence_type> &divergences)
778 const unsigned int dofs_per_cell = dof_values.
size();
779 const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
780 shape_gradients[0].size() : divergences.size();
783 std::fill (divergences.begin(), divergences.end(),
784 typename Vector<dim,spacedim>::template OutputType<Number>::divergence_type());
786 for (
unsigned int shape_function=0;
787 shape_function<dofs_per_cell; ++shape_function)
789 const int snc = shape_function_data[shape_function].single_nonzero_component;
795 const Number &value = dof_values[shape_function];
799 if (::internal::CheckForZero<Number>::value(value) ==
true)
804 const unsigned int comp =
805 shape_function_data[shape_function].single_nonzero_component_index;
806 const ::Tensor<1,spacedim> *shape_gradient_ptr = &shape_gradients[snc][0];
807 for (
unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
808 divergences[q_point] += value * (*shape_gradient_ptr++)[comp];
811 for (
unsigned int d=0;
d<spacedim; ++
d)
812 if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
814 const ::Tensor<1,spacedim> *shape_gradient_ptr =
815 &shape_gradients[shape_function_data[shape_function].
817 for (
unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
818 divergences[q_point] += value * (*shape_gradient_ptr++)[
d];
825 template <
int dim,
int spacedim,
typename Number>
829 const std::vector<
typename Vector<dim,spacedim>::ShapeFunctionData> &shape_function_data,
830 std::vector<
typename ProductType<Number,typename ::internal::CurlType<spacedim>::type>::type> &curls)
832 const unsigned int dofs_per_cell = dof_values.
size();
833 const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
834 shape_gradients[0].size() : curls.size();
837 std::fill (curls.begin(), curls.end(),
844 Assert (
false,
ExcMessage(
"Computing the curl in 1d is not a useful operation"));
850 for (
unsigned int shape_function = 0;
851 shape_function < dofs_per_cell; ++shape_function)
853 const int snc = shape_function_data[shape_function].single_nonzero_component;
859 const Number &value = dof_values[shape_function];
863 if (::internal::CheckForZero<Number>::value(value) ==
true)
868 const ::Tensor<1, spacedim> *shape_gradient_ptr =
869 &shape_gradients[snc][0];
871 Assert (shape_function_data[shape_function].single_nonzero_component >= 0,
874 if (shape_function_data[shape_function].single_nonzero_component_index == 0)
875 for (
unsigned int q_point = 0;
876 q_point < n_quadrature_points; ++q_point)
877 curls[q_point][0] -= value * (*shape_gradient_ptr++)[1];
879 for (
unsigned int q_point = 0;
880 q_point < n_quadrature_points; ++q_point)
881 curls[q_point][0] += value * (*shape_gradient_ptr++)[0];
888 if (shape_function_data[shape_function].is_nonzero_shape_function_component[0])
890 const ::Tensor<1,spacedim> *shape_gradient_ptr =
891 &shape_gradients[shape_function_data[shape_function].row_index[0]][0];
893 for (
unsigned int q_point = 0; q_point < n_quadrature_points; ++q_point)
894 curls[q_point][0] -= value * (*shape_gradient_ptr++)[1];
897 if (shape_function_data[shape_function].is_nonzero_shape_function_component[1])
899 const ::Tensor<1,spacedim> *shape_gradient_ptr =
900 &shape_gradients[shape_function_data[shape_function].row_index[1]][0];
902 for (
unsigned int q_point = 0; q_point < n_quadrature_points; ++q_point)
903 curls[q_point][0] += value * (*shape_gradient_ptr++)[0];
912 for (
unsigned int shape_function = 0;
913 shape_function < dofs_per_cell; ++shape_function)
915 const int snc = shape_function_data[shape_function].single_nonzero_component;
921 const Number &value = dof_values[shape_function];
925 if (::internal::CheckForZero<Number>::value(value) ==
true)
930 const ::Tensor<1, spacedim> *shape_gradient_ptr = &shape_gradients[snc][0];
932 switch (shape_function_data[shape_function].single_nonzero_component_index)
936 for (
unsigned int q_point = 0;
937 q_point < n_quadrature_points; ++q_point)
939 curls[q_point][1] += value * (*shape_gradient_ptr)[2];
940 curls[q_point][2] -= value * (*shape_gradient_ptr++)[1];
948 for (
unsigned int q_point = 0;
949 q_point < n_quadrature_points; ++q_point)
951 curls[q_point][0] -= value * (*shape_gradient_ptr)[2];
952 curls[q_point][2] += value * (*shape_gradient_ptr++)[0];
960 for (
unsigned int q_point = 0;
961 q_point < n_quadrature_points; ++q_point)
963 curls[q_point][0] += value * (*shape_gradient_ptr)[1];
964 curls[q_point][1] -= value * (*shape_gradient_ptr++)[0];
979 if (shape_function_data[shape_function].is_nonzero_shape_function_component[0])
981 const ::Tensor<1,spacedim> *shape_gradient_ptr =
982 &shape_gradients[shape_function_data[shape_function].row_index[0]][0];
984 for (
unsigned int q_point = 0; q_point < n_quadrature_points; ++q_point)
986 curls[q_point][1] += value * (*shape_gradient_ptr)[2];
987 curls[q_point][2] -= value * (*shape_gradient_ptr++)[1];
991 if (shape_function_data[shape_function].is_nonzero_shape_function_component[1])
993 const ::Tensor<1,spacedim> *shape_gradient_ptr =
994 &shape_gradients[shape_function_data[shape_function].row_index[1]][0];
996 for (
unsigned int q_point = 0; q_point < n_quadrature_points; ++q_point)
998 curls[q_point][0] -= value * (*shape_gradient_ptr)[2];
999 curls[q_point][2] += value * (*shape_gradient_ptr++)[0];
1003 if (shape_function_data[shape_function].is_nonzero_shape_function_component[2])
1005 const ::Tensor<1,spacedim> *shape_gradient_ptr =
1006 &shape_gradients[shape_function_data[shape_function].row_index[2]][0];
1008 for (
unsigned int q_point = 0; q_point < n_quadrature_points; ++q_point)
1010 curls[q_point][0] += value * (*shape_gradient_ptr)[1];
1011 curls[q_point][1] -= value * (*shape_gradient_ptr++)[0];
1022 template <
int dim,
int spacedim,
typename Number>
1026 const std::vector<
typename Vector<dim,spacedim>::ShapeFunctionData> &shape_function_data,
1027 std::vector<
typename Vector<dim,spacedim>::template OutputType<Number>::laplacian_type> &laplacians)
1029 const unsigned int dofs_per_cell = dof_values.
size();
1030 const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
1031 shape_hessians[0].size() : laplacians.size();
1034 std::fill (laplacians.begin(), laplacians.end(),
1035 typename Vector<dim,spacedim>::template OutputType<Number>::laplacian_type());
1037 for (
unsigned int shape_function=0;
1038 shape_function<dofs_per_cell; ++shape_function)
1040 const int snc = shape_function_data[shape_function].single_nonzero_component;
1046 const Number &value = dof_values[shape_function];
1050 if (::internal::CheckForZero<Number>::value(value) ==
true)
1055 const unsigned int comp =
1056 shape_function_data[shape_function].single_nonzero_component_index;
1057 const ::Tensor<2,spacedim> *shape_hessian_ptr =
1058 &shape_hessians[snc][0];
1059 for (
unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
1060 laplacians[q_point][comp] += value *
trace(*shape_hessian_ptr++);
1063 for (
unsigned int d=0;
d<spacedim; ++
d)
1064 if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
1066 const ::Tensor<2,spacedim> *shape_hessian_ptr =
1067 &shape_hessians[shape_function_data[shape_function].
1069 for (
unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
1070 laplacians[q_point][d] += value *
trace(*shape_hessian_ptr++);
1079 template <
int dim,
int spacedim,
typename Number>
1082 const ::Table<2,double> &shape_values,
1086 const unsigned int dofs_per_cell = dof_values.
size();
1087 const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
1088 shape_values.n_cols() : values.size();
1091 std::fill (values.begin(), values.end(),
1094 for (
unsigned int shape_function=0;
1095 shape_function<dofs_per_cell; ++shape_function)
1097 const int snc = shape_function_data[shape_function].single_nonzero_component;
1103 const Number &value = dof_values[shape_function];
1107 if (::internal::CheckForZero<Number>::value(value) ==
true)
1114 (shape_function_data[shape_function].single_nonzero_component_index);
1115 const double *shape_value_ptr = &shape_values(snc,0);
1116 for (
unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
1117 values[q_point][comp] += value * (*shape_value_ptr++);
1120 for (
unsigned int d=0;
1121 d<::SymmetricTensor<2,spacedim>::n_independent_components; ++
d)
1122 if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
1126 const double *shape_value_ptr =
1127 &shape_values(shape_function_data[shape_function].row_index[d],0);
1128 for (
unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
1129 values[q_point][comp] += value * (*shape_value_ptr++);
1136 template <
int dim,
int spacedim,
typename Number>
1143 const unsigned int dofs_per_cell = dof_values.
size();
1144 const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
1145 shape_gradients[0].size() : divergences.size();
1148 std::fill (divergences.begin(), divergences.end(),
1151 for (
unsigned int shape_function=0;
1152 shape_function<dofs_per_cell; ++shape_function)
1154 const int snc = shape_function_data[shape_function].single_nonzero_component;
1160 const Number &value = dof_values[shape_function];
1164 if (::internal::CheckForZero<Number>::value(value) ==
true)
1169 const unsigned int comp =
1170 shape_function_data[shape_function].single_nonzero_component_index;
1172 const ::Tensor < 1, spacedim> *shape_gradient_ptr =
1173 &shape_gradients[snc][0];
1180 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1181 ++q_point, ++shape_gradient_ptr)
1183 divergences[q_point][ii] += value * (*shape_gradient_ptr)[jj];
1186 divergences[q_point][jj] += value * (*shape_gradient_ptr)[ii];
1191 for (
unsigned int d = 0;
1192 d < ::SymmetricTensor<2,spacedim>::n_independent_components; ++
d)
1193 if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
1205 const unsigned int comp =
1206 shape_function_data[shape_function].single_nonzero_component_index;
1208 const ::Tensor < 1, spacedim> *shape_gradient_ptr =
1209 &shape_gradients[shape_function_data[shape_function].
1211 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1212 ++q_point, ++shape_gradient_ptr)
1214 for (
unsigned int j = 0; j < spacedim; ++j)
1217 divergences[q_point][vector_component] += value * (*shape_gradient_ptr++)[j];
1227 template <
int dim,
int spacedim,
typename Number>
1230 const ::Table<2,double> &shape_values,
1234 const unsigned int dofs_per_cell = dof_values.
size();
1235 const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
1236 shape_values.n_cols() : values.size();
1239 std::fill (values.begin(), values.end(),
1242 for (
unsigned int shape_function=0;
1243 shape_function<dofs_per_cell; ++shape_function)
1245 const int snc = shape_function_data[shape_function].single_nonzero_component;
1251 const Number &value = dof_values[shape_function];
1255 if (::internal::CheckForZero<Number>::value(value) ==
true)
1260 const unsigned int comp =
1261 shape_function_data[shape_function].single_nonzero_component_index;
1265 const double *shape_value_ptr = &shape_values(snc,0);
1266 for (
unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
1267 values[q_point][indices] += value * (*shape_value_ptr++);
1270 for (
unsigned int d=0;
1272 if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
1276 const double *shape_value_ptr =
1277 &shape_values(shape_function_data[shape_function].row_index[d],0);
1278 for (
unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
1279 values[q_point][indices] += value * (*shape_value_ptr++);
1286 template <
int dim,
int spacedim,
typename Number>
1293 const unsigned int dofs_per_cell = dof_values.
size();
1294 const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
1295 shape_gradients[0].size() : divergences.size();
1298 std::fill (divergences.begin(), divergences.end(),
1301 for (
unsigned int shape_function=0;
1302 shape_function<dofs_per_cell; ++shape_function)
1304 const int snc = shape_function_data[shape_function].single_nonzero_component;
1310 const Number &value = dof_values[shape_function];
1314 if (::internal::CheckForZero<Number>::value(value) ==
true)
1319 const unsigned int comp =
1320 shape_function_data[shape_function].single_nonzero_component_index;
1322 const ::Tensor < 1, spacedim> *shape_gradient_ptr =
1323 &shape_gradients[snc][0];
1326 const unsigned int ii = indices[0];
1327 const unsigned int jj = indices[1];
1329 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1330 ++q_point, ++shape_gradient_ptr)
1332 divergences[q_point][ii] += value * (*shape_gradient_ptr)[jj];
1337 for (
unsigned int d = 0;
1339 if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
1349 template <
int dim,
int spacedim,
typename Number>
1356 const unsigned int dofs_per_cell = dof_values.
size();
1357 const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
1358 shape_gradients[0].size() : gradients.size();
1361 std::fill (gradients.begin(), gradients.end(),
1364 for (
unsigned int shape_function=0;
1365 shape_function<dofs_per_cell; ++shape_function)
1367 const int snc = shape_function_data[shape_function].single_nonzero_component;
1373 const Number &value = dof_values[shape_function];
1377 if (::internal::CheckForZero<Number>::value(value) ==
true)
1382 const unsigned int comp =
1383 shape_function_data[shape_function].single_nonzero_component_index;
1385 const ::Tensor < 1, spacedim> *shape_gradient_ptr =
1386 &shape_gradients[snc][0];
1389 const unsigned int ii = indices[0];
1390 const unsigned int jj = indices[1];
1392 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1393 ++q_point, ++shape_gradient_ptr)
1395 gradients[q_point][ii][jj] += value * (*shape_gradient_ptr);
1400 for (
unsigned int d = 0;
1402 if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
1414 template <
int dim,
int spacedim>
1415 template <
class InputVector>
1419 std::vector<
typename ProductType<value_type,typename InputVector::value_type>::type> &values)
const 1423 Assert (fe_values->present_cell.get() !=
nullptr,
1424 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
1426 fe_values->present_cell->n_dofs_for_dof_handler());
1430 fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
1431 internal::do_function_values<dim,spacedim>
1432 (make_array_view(dof_values.begin(), dof_values.end()),
1433 fe_values->finite_element_output.shape_values, shape_function_data, values);
1438 template <
int dim,
int spacedim>
1439 template <
class InputVector>
1447 Assert (fe_values->present_cell.get() !=
nullptr,
1448 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
1451 internal::do_function_values<dim,spacedim>
1452 (make_array_view(dof_values.begin(), dof_values.end()),
1453 fe_values->finite_element_output.shape_values, shape_function_data, values);
1458 template <
int dim,
int spacedim>
1459 template <
class InputVector>
1463 std::vector<
typename ProductType<gradient_type,typename InputVector::value_type>::type> &gradients)
const 1467 Assert (fe_values->present_cell.get() !=
nullptr,
1468 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
1470 fe_values->present_cell->n_dofs_for_dof_handler());
1474 fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
1475 internal::do_function_derivatives<1,dim,spacedim>
1476 (make_array_view(dof_values.begin(), dof_values.end()),
1477 fe_values->finite_element_output.shape_gradients, shape_function_data, gradients);
1482 template <
int dim,
int spacedim>
1483 template <
class InputVector>
1491 Assert (fe_values->present_cell.get() !=
nullptr,
1492 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
1495 internal::do_function_derivatives<1,dim,spacedim>
1496 (make_array_view(dof_values.begin(), dof_values.end()),
1497 fe_values->finite_element_output.shape_gradients, shape_function_data, gradients);
1502 template <
int dim,
int spacedim>
1503 template <
class InputVector>
1507 std::vector<
typename ProductType<hessian_type,typename InputVector::value_type>::type> &hessians)
const 1511 Assert (fe_values->present_cell.get() !=
nullptr,
1512 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
1514 fe_values->present_cell->n_dofs_for_dof_handler());
1518 fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
1519 internal::do_function_derivatives<2,dim,spacedim>
1520 (make_array_view(dof_values.begin(), dof_values.end()),
1521 fe_values->finite_element_output.shape_hessians, shape_function_data, hessians);
1526 template <
int dim,
int spacedim>
1527 template <
class InputVector>
1535 Assert (fe_values->present_cell.get() !=
nullptr,
1536 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
1539 internal::do_function_derivatives<2,dim,spacedim>
1540 (make_array_view(dof_values.begin(), dof_values.end()),
1541 fe_values->finite_element_output.shape_hessians, shape_function_data, hessians);
1546 template <
int dim,
int spacedim>
1547 template <
class InputVector>
1551 std::vector<
typename ProductType<value_type,typename InputVector::value_type>::type> &laplacians)
const 1555 Assert (fe_values->present_cell.get() !=
nullptr,
1556 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
1558 fe_values->present_cell->n_dofs_for_dof_handler());
1562 fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
1563 internal::do_function_laplacians<dim,spacedim>
1564 (make_array_view(dof_values.begin(), dof_values.end()),
1565 fe_values->finite_element_output.shape_hessians, shape_function_data, laplacians);
1570 template <
int dim,
int spacedim>
1571 template <
class InputVector>
1579 Assert (fe_values->present_cell.get() !=
nullptr,
1580 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
1583 internal::do_function_laplacians<dim,spacedim>
1584 (make_array_view(dof_values.begin(), dof_values.end()),
1585 fe_values->finite_element_output.shape_hessians, shape_function_data, laplacians);
1590 template <
int dim,
int spacedim>
1591 template <
class InputVector>
1595 std::vector<
typename ProductType<third_derivative_type,typename InputVector::value_type>::type> &third_derivatives)
const 1599 Assert (fe_values->present_cell.get() !=
nullptr,
1600 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
1602 fe_values->present_cell->n_dofs_for_dof_handler());
1606 fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
1607 internal::do_function_derivatives<3,dim,spacedim>
1608 (make_array_view(dof_values.begin(), dof_values.end()),
1609 fe_values->finite_element_output.shape_3rd_derivatives, shape_function_data, third_derivatives);
1614 template <
int dim,
int spacedim>
1615 template <
class InputVector>
1623 Assert (fe_values->present_cell.get() !=
nullptr,
1624 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
1627 internal::do_function_derivatives<3,dim,spacedim>
1628 (make_array_view(dof_values.begin(), dof_values.end()),
1629 fe_values->finite_element_output.shape_3rd_derivatives, shape_function_data, third_derivatives);
1634 template <
int dim,
int spacedim>
1635 template <
class InputVector>
1639 std::vector<
typename ProductType<value_type,typename InputVector::value_type>::type> &values)
const 1643 Assert (fe_values->present_cell.get() !=
nullptr,
1644 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
1646 fe_values->present_cell->n_dofs_for_dof_handler());
1650 fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
1651 internal::do_function_values<dim,spacedim>
1652 (make_array_view(dof_values.begin(), dof_values.end()),
1653 fe_values->finite_element_output.shape_values, shape_function_data, values);
1658 template <
int dim,
int spacedim>
1659 template <
class InputVector>
1667 Assert (fe_values->present_cell.get() !=
nullptr,
1668 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
1671 internal::do_function_values<dim,spacedim>
1672 (make_array_view(dof_values.begin(), dof_values.end()),
1673 fe_values->finite_element_output.shape_values, shape_function_data, values);
1678 template <
int dim,
int spacedim>
1679 template <
class InputVector>
1683 std::vector<
typename ProductType<gradient_type,typename InputVector::value_type>::type> &gradients)
const 1687 Assert (fe_values->present_cell.get() !=
nullptr,
1688 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
1690 fe_values->present_cell->n_dofs_for_dof_handler());
1694 fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
1695 internal::do_function_derivatives<1,dim,spacedim>
1696 (make_array_view(dof_values.begin(), dof_values.end()),
1697 fe_values->finite_element_output.shape_gradients, shape_function_data, gradients);
1702 template <
int dim,
int spacedim>
1703 template <
class InputVector>
1711 Assert (fe_values->present_cell.get() !=
nullptr,
1712 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
1715 internal::do_function_derivatives<1,dim,spacedim>
1716 (make_array_view(dof_values.begin(), dof_values.end()),
1717 fe_values->finite_element_output.shape_gradients, shape_function_data, gradients);
1722 template <
int dim,
int spacedim>
1723 template <
class InputVector>
1727 std::vector<
typename ProductType<symmetric_gradient_type,typename InputVector::value_type>::type> &symmetric_gradients)
const 1731 Assert (fe_values->present_cell.get() !=
nullptr,
1732 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
1734 fe_values->present_cell->n_dofs_for_dof_handler());
1738 fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
1739 internal::do_function_symmetric_gradients<dim,spacedim>
1740 (make_array_view(dof_values.begin(), dof_values.end()),
1741 fe_values->finite_element_output.shape_gradients, shape_function_data,
1742 symmetric_gradients);
1747 template <
int dim,
int spacedim>
1748 template <
class InputVector>
1756 Assert (fe_values->present_cell.get() !=
nullptr,
1757 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
1760 internal::do_function_symmetric_gradients<dim,spacedim>
1761 (make_array_view(dof_values.begin(), dof_values.end()),
1762 fe_values->finite_element_output.shape_gradients, shape_function_data,
1763 symmetric_gradients);
1768 template <
int dim,
int spacedim>
1769 template <
class InputVector>
1773 std::vector<
typename ProductType<divergence_type,typename InputVector::value_type>::type> &divergences)
const 1777 Assert (fe_values->present_cell.get() !=
nullptr,
1778 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
1780 fe_values->present_cell->n_dofs_for_dof_handler());
1785 fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
1786 internal::do_function_divergences<dim,spacedim>
1787 (make_array_view(dof_values.begin(), dof_values.end()),
1788 fe_values->finite_element_output.shape_gradients, shape_function_data, divergences);
1793 template <
int dim,
int spacedim>
1794 template <
class InputVector>
1802 Assert (fe_values->present_cell.get() !=
nullptr,
1803 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
1806 internal::do_function_divergences<dim,spacedim>
1807 (make_array_view(dof_values.begin(), dof_values.end()),
1808 fe_values->finite_element_output.shape_gradients, shape_function_data, divergences);
1813 template <
int dim,
int spacedim>
1814 template <
class InputVector>
1818 std::vector<
typename ProductType<curl_type,typename InputVector::value_type>::type> &curls)
const 1822 Assert (fe_values->present_cell.get () !=
nullptr,
1823 ExcMessage (
"FEValues object is not reinited to any cell"));
1825 fe_values->present_cell->n_dofs_for_dof_handler ());
1829 fe_values->present_cell->get_interpolated_dof_values (fe_function, dof_values);
1830 internal::do_function_curls<dim,spacedim>
1831 (make_array_view(dof_values.begin(), dof_values.end()),
1832 fe_values->finite_element_output.shape_gradients, shape_function_data, curls);
1837 template <
int dim,
int spacedim>
1838 template <
class InputVector>
1846 Assert (fe_values->present_cell.get () !=
nullptr,
1847 ExcMessage (
"FEValues object is not reinited to any cell"));
1850 internal::do_function_curls<dim,spacedim>
1851 (make_array_view(dof_values.begin(), dof_values.end()),
1852 fe_values->finite_element_output.shape_gradients, shape_function_data, curls);
1857 template <
int dim,
int spacedim>
1858 template <
class InputVector>
1862 std::vector<
typename ProductType<hessian_type,typename InputVector::value_type>::type> &hessians)
const 1866 Assert (fe_values->present_cell.get() !=
nullptr,
1867 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
1869 fe_values->present_cell->n_dofs_for_dof_handler());
1873 fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
1874 internal::do_function_derivatives<2,dim,spacedim>
1875 (make_array_view(dof_values.begin(), dof_values.end()),
1876 fe_values->finite_element_output.shape_hessians, shape_function_data, hessians);
1881 template <
int dim,
int spacedim>
1882 template <
class InputVector>
1890 Assert (fe_values->present_cell.get() !=
nullptr,
1891 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
1894 internal::do_function_derivatives<2,dim,spacedim>
1895 (make_array_view(dof_values.begin(), dof_values.end()),
1896 fe_values->finite_element_output.shape_hessians, shape_function_data, hessians);
1901 template <
int dim,
int spacedim>
1902 template <
class InputVector>
1906 std::vector<
typename ProductType<value_type,typename InputVector::value_type>::type> &laplacians)
const 1910 Assert (laplacians.size() == fe_values->n_quadrature_points,
1912 Assert (fe_values->present_cell.get() !=
nullptr,
1913 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
1914 Assert (fe_function.size() == fe_values->present_cell->n_dofs_for_dof_handler(),
1916 fe_values->present_cell->n_dofs_for_dof_handler()));
1920 fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
1921 internal::do_function_laplacians<dim,spacedim>
1922 (make_array_view(dof_values.begin(), dof_values.end()),
1923 fe_values->finite_element_output.shape_hessians, shape_function_data, laplacians);
1928 template <
int dim,
int spacedim>
1929 template <
class InputVector>
1937 Assert (laplacians.size() == fe_values->n_quadrature_points,
1939 Assert (fe_values->present_cell.get() !=
nullptr,
1940 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
1943 internal::do_function_laplacians<dim,spacedim>
1944 (make_array_view(dof_values.begin(), dof_values.end()),
1945 fe_values->finite_element_output.shape_hessians, shape_function_data, laplacians);
1950 template <
int dim,
int spacedim>
1951 template <
class InputVector>
1955 std::vector<
typename ProductType<third_derivative_type,typename InputVector::value_type>::type> &third_derivatives)
const 1959 Assert (fe_values->present_cell.get() !=
nullptr,
1960 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
1962 fe_values->present_cell->n_dofs_for_dof_handler());
1966 fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
1967 internal::do_function_derivatives<3,dim,spacedim>
1968 (make_array_view(dof_values.begin(), dof_values.end()),
1969 fe_values->finite_element_output.shape_3rd_derivatives, shape_function_data, third_derivatives);
1974 template <
int dim,
int spacedim>
1975 template <
class InputVector>
1983 Assert (fe_values->present_cell.get() !=
nullptr,
1984 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
1987 internal::do_function_derivatives<3,dim,spacedim>
1988 (make_array_view(dof_values.begin(), dof_values.end()),
1989 fe_values->finite_element_output.shape_3rd_derivatives, shape_function_data, third_derivatives);
1994 template <
int dim,
int spacedim>
1995 template <
class InputVector>
1997 SymmetricTensor<2, dim, spacedim>::
1998 get_function_values(
const InputVector &fe_function,
1999 std::vector<
typename ProductType<value_type,typename InputVector::value_type>::type> &values)
const 2003 Assert(fe_values->present_cell.get() !=
nullptr,
2004 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2006 fe_values->present_cell->n_dofs_for_dof_handler());
2010 fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
2011 internal::do_function_values<dim,spacedim>
2012 (make_array_view(dof_values.begin(), dof_values.end()),
2013 fe_values->finite_element_output.shape_values, shape_function_data, values);
2018 template <
int dim,
int spacedim>
2019 template <
class InputVector>
2021 SymmetricTensor<2, dim, spacedim>::
2022 get_function_values_from_local_dof_values(
const InputVector &dof_values,
2027 Assert(fe_values->present_cell.get() !=
nullptr,
2028 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2031 internal::do_function_values<dim,spacedim>
2032 (make_array_view(dof_values.begin(), dof_values.end()),
2033 fe_values->finite_element_output.shape_values, shape_function_data, values);
2038 template <
int dim,
int spacedim>
2039 template <
class InputVector>
2041 SymmetricTensor<2, dim, spacedim>::
2042 get_function_divergences(
const InputVector &fe_function,
2043 std::vector<
typename ProductType<divergence_type,typename InputVector::value_type>::type> &divergences)
const 2047 Assert(fe_values->present_cell.get() !=
nullptr,
2048 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2050 fe_values->present_cell->n_dofs_for_dof_handler());
2055 fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
2056 internal::do_function_divergences<dim,spacedim>
2057 (make_array_view(dof_values.begin(), dof_values.end()),
2058 fe_values->finite_element_output.shape_gradients, shape_function_data, divergences);
2063 template <
int dim,
int spacedim>
2064 template <
class InputVector>
2066 SymmetricTensor<2, dim, spacedim>::
2067 get_function_divergences_from_local_dof_values(
const InputVector &dof_values,
2072 Assert(fe_values->present_cell.get() !=
nullptr,
2073 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2076 internal::do_function_divergences<dim,spacedim>
2077 (make_array_view(dof_values.begin(), dof_values.end()),
2078 fe_values->finite_element_output.shape_gradients, shape_function_data, divergences);
2083 template <
int dim,
int spacedim>
2084 template <
class InputVector>
2086 Tensor<2, dim, spacedim>::
2087 get_function_values(
const InputVector &fe_function,
2088 std::vector<
typename ProductType<value_type,typename InputVector::value_type>::type> &values)
const 2092 Assert(fe_values->present_cell.get() !=
nullptr,
2093 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2095 fe_values->present_cell->n_dofs_for_dof_handler());
2099 fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
2100 internal::do_function_values<dim,spacedim>
2101 (make_array_view(dof_values.begin(), dof_values.end()),
2102 fe_values->finite_element_output.shape_values, shape_function_data, values);
2107 template <
int dim,
int spacedim>
2108 template <
class InputVector>
2110 Tensor<2, dim, spacedim>::
2111 get_function_values_from_local_dof_values (
const InputVector &dof_values,
2116 Assert(fe_values->present_cell.get() !=
nullptr,
2117 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2120 internal::do_function_values<dim,spacedim>
2121 (make_array_view(dof_values.begin(), dof_values.end()),
2122 fe_values->finite_element_output.shape_values, shape_function_data, values);
2127 template <
int dim,
int spacedim>
2128 template <
class InputVector>
2130 Tensor<2, dim, spacedim>::
2131 get_function_divergences(
const InputVector &fe_function,
2132 std::vector<
typename ProductType<divergence_type,typename InputVector::value_type>::type> &divergences)
const 2136 Assert(fe_values->present_cell.get() !=
nullptr,
2137 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2139 fe_values->present_cell->n_dofs_for_dof_handler());
2144 fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
2145 internal::do_function_divergences<dim,spacedim>
2146 (make_array_view(dof_values.begin(), dof_values.end()),
2147 fe_values->finite_element_output.shape_gradients, shape_function_data, divergences);
2152 template <
int dim,
int spacedim>
2153 template <
class InputVector>
2155 Tensor<2, dim, spacedim>::
2156 get_function_divergences_from_local_dof_values (
const InputVector &dof_values,
2161 Assert(fe_values->present_cell.get() !=
nullptr,
2162 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2165 internal::do_function_divergences<dim,spacedim>
2166 (make_array_view(dof_values.begin(), dof_values.end()),
2167 fe_values->finite_element_output.shape_gradients, shape_function_data, divergences);
2172 template <
int dim,
int spacedim>
2173 template <
class InputVector>
2175 Tensor<2, dim, spacedim>::
2176 get_function_gradients(
const InputVector &fe_function,
2177 std::vector<
typename ProductType<gradient_type,typename InputVector::value_type>::type> &gradients)
const 2181 Assert(fe_values->present_cell.get() !=
nullptr,
2182 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2184 fe_values->present_cell->n_dofs_for_dof_handler());
2189 fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
2190 internal::do_function_gradients<dim,spacedim>
2191 (make_array_view(dof_values.begin(), dof_values.end()),
2192 fe_values->finite_element_output.shape_gradients, shape_function_data, gradients);
2197 template <
int dim,
int spacedim>
2198 template <
class InputVector>
2200 Tensor<2, dim, spacedim>::
2201 get_function_gradients_from_local_dof_values (
const InputVector &dof_values,
2206 Assert(fe_values->present_cell.get() !=
nullptr,
2207 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
2210 internal::do_function_gradients<dim,spacedim>
2211 (make_array_view(dof_values.begin(), dof_values.end()),
2212 fe_values->finite_element_output.shape_gradients, shape_function_data, gradients);
2222 template <
int dim,
int spacedim>
2231 scalars.resize (n_scalars);
2232 for (
unsigned int component=0; component<n_scalars; ++component)
2235 typedef ::FEValuesViews::Scalar<dim,spacedim> ScalarView;
2236 scalars[component].ScalarView::~ScalarView ();
2238 new (&scalars[component])
2246 const unsigned int n_vectors = (fe.
n_components() >= spacedim ?
2249 vectors.resize (n_vectors);
2250 for (
unsigned int component=0; component<n_vectors; ++component)
2253 typedef ::FEValuesViews::Vector<dim,spacedim>
VectorView;
2254 vectors[component].VectorView::~VectorView ();
2256 new (&vectors[component])
2262 const unsigned int n_symmetric_second_order_tensors
2266 symmetric_second_order_tensors.resize(n_symmetric_second_order_tensors);
2267 for (
unsigned int component = 0; component < n_symmetric_second_order_tensors; ++component)
2270 typedef ::FEValuesViews::SymmetricTensor<2, dim, spacedim> SymmetricTensorView;
2271 symmetric_second_order_tensors[component].SymmetricTensorView::~SymmetricTensorView();
2273 new (&symmetric_second_order_tensors[component])
2280 const unsigned int n_second_order_tensors
2284 second_order_tensors.resize(n_second_order_tensors);
2285 for (
unsigned int component = 0; component < n_second_order_tensors; ++component)
2288 typedef ::FEValuesViews::Tensor<2, dim, spacedim> TensorView;
2289 second_order_tensors[component].TensorView::~TensorView();
2291 new (&second_order_tensors[component])
2302 template <
int dim,
int spacedim>
2310 virtual ~CellIteratorBase () =
default;
2327 n_dofs_for_dof_handler ()
const = 0;
2329 #include "fe_values.decl.1.inst" 2337 get_interpolated_dof_values (
const IndexSet &in,
2338 Vector<IndexSet::value_type> &out)
const = 0;
2350 template <
int dim,
int spacedim>
2351 template <
typename CI>
2358 CellIterator (
const CI &cell);
2375 n_dofs_for_dof_handler ()
const;
2377 #include "fe_values.decl.2.inst" 2385 get_interpolated_dof_values (
const IndexSet &in,
2386 Vector<IndexSet::value_type> &out)
const;
2415 template <
int dim,
int spacedim>
2440 n_dofs_for_dof_handler ()
const;
2442 #include "fe_values.decl.2.inst" 2450 get_interpolated_dof_values (
const IndexSet &in,
2451 Vector<IndexSet::value_type> &out)
const;
2473 template <
int dim,
int spacedim>
2474 template <
typename CI>
2482 template <
int dim,
int spacedim>
2483 template <
typename CI>
2492 template <
int dim,
int spacedim>
2493 template <
typename CI>
2497 return cell->get_dof_handler().n_dofs();
2502 #include "fe_values.impl.1.inst" 2506 template <
int dim,
int spacedim>
2507 template <
typename CI>
2511 Vector<IndexSet::value_type> &out)
const 2515 std::vector<types::global_dof_index> dof_indices (cell->get_fe().dofs_per_cell);
2516 cell->get_dof_indices (dof_indices);
2518 for (
unsigned int i=0; i<cell->get_fe().dofs_per_cell; ++i)
2519 out[i] = (in.
is_element (dof_indices[i]) ? 1 : 0);
2525 template <
int dim,
int spacedim>
2528 = (
"You have previously called the FEValues::reinit function with a\n" 2529 "cell iterator of type Triangulation<dim,spacedim>::cell_iterator. However,\n" 2530 "when you do this, you cannot call some functions in the FEValues\n" 2531 "class, such as the get_function_values/gradients/hessians/third_derivatives\n" 2532 "functions. If you need these functions, then you need to call\n" 2533 "FEValues::reinit with an iterator type that allows to extract\n" 2534 "degrees of freedom, such as DoFHandler<dim,spacedim>::cell_iterator.");
2538 template <
int dim,
int spacedim>
2547 template <
int dim,
int spacedim>
2556 template <
int dim,
int spacedim>
2566 #include "fe_values.impl.2.inst" 2570 template <
int dim,
int spacedim>
2574 Vector<IndexSet::value_type> &)
const 2583 namespace FEValuesImplementation
2585 template <
int dim,
int spacedim>
2596 numbers::signaling_nan<double>());
2640 template <
int dim,
int spacedim>
2660 template <
int dim,
int spacedim>
2669 this->shape_function_to_row_table
2670 = ::internal::make_shape_function_to_row_table (
fe);
2674 unsigned int n_nonzero_shape_components = 0;
2675 for (
unsigned int i=0; i<
fe.dofs_per_cell; ++i)
2676 n_nonzero_shape_components +=
fe.n_nonzero_components (i);
2677 Assert (n_nonzero_shape_components >=
fe.dofs_per_cell,
2684 this->shape_values.reinit(n_nonzero_shape_components,
2686 this->shape_values.fill(numbers::signaling_nan<double>());
2691 this->shape_gradients.reinit(n_nonzero_shape_components,
2698 this->shape_hessians.reinit(n_nonzero_shape_components,
2705 this->shape_3rd_derivatives.reinit(n_nonzero_shape_components,
2714 template <
int dim,
int spacedim>
2732 template <
int dim,
int spacedim>
2742 fe(&
fe, typeid(*this).name()),
2747 ExcMessage (
"There is nothing useful you can do with an FEValues " 2748 "object when using a quadrature formula with zero " 2749 "quadrature points!"));
2755 template <
int dim,
int spacedim>
2758 tria_listener_refinement.disconnect ();
2759 tria_listener_mesh_transform.disconnect ();
2773 template <
typename Number,
typename Number2>
2775 do_function_values (
const Number2 *dof_values_ptr,
2776 const ::Table<2,double> &shape_values,
2777 std::vector<Number> &values)
2780 const unsigned int dofs_per_cell = shape_values.n_rows();
2781 const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
2782 shape_values.n_cols() : values.size();
2786 std::fill_n (values.begin(), n_quadrature_points,
2796 for (
unsigned int shape_func=0; shape_func<dofs_per_cell; ++shape_func)
2798 const Number2 value = dof_values_ptr[shape_func];
2806 const double *shape_value_ptr = &shape_values(shape_func, 0);
2807 for (
unsigned int point=0; point<n_quadrature_points; ++point)
2808 values[point] += value * (*shape_value_ptr++);
2814 template <
int dim,
int spacedim,
typename VectorType>
2816 do_function_values (
const typename VectorType::value_type *dof_values_ptr,
2817 const ::Table<2,double> &shape_values,
2819 const std::vector<unsigned int> &shape_function_to_row_table,
2821 const bool quadrature_points_fastest =
false,
2822 const unsigned int component_multiple = 1)
2824 typedef typename VectorType::value_type Number;
2826 for (
unsigned int i=0; i<values.
size(); ++i)
2827 std::fill_n (values[i].begin(), values[i].
size(),
2828 typename VectorType::value_type());
2833 if (dofs_per_cell == 0)
2836 const unsigned int n_quadrature_points = shape_values.n_cols();
2840 const unsigned result_components =
n_components * component_multiple;
2841 (void)result_components;
2842 if (quadrature_points_fastest)
2845 for (
unsigned int i=0; i<values.
size(); ++i)
2851 for (
unsigned int i=0; i<values.
size(); ++i)
2858 for (
unsigned int mc = 0; mc < component_multiple; ++mc)
2859 for (
unsigned int shape_func=0; shape_func<dofs_per_cell; ++shape_func)
2861 const Number &value = dof_values_ptr[shape_func+mc*dofs_per_cell];
2865 if (::internal::CheckForZero<Number>::value(value) ==
true)
2870 const unsigned int comp =
2874 row = shape_function_to_row_table[shape_func*
n_components+comp];
2876 const double *shape_value_ptr = &shape_values(row, 0);
2878 if (quadrature_points_fastest)
2880 VectorType &values_comp = values[comp];
2881 for (
unsigned int point=0;
point<n_quadrature_points; ++
point)
2882 values_comp[point] += value * (*shape_value_ptr++);
2885 for (
unsigned int point=0;
point<n_quadrature_points; ++
point)
2886 values[point][comp] += value * (*shape_value_ptr++);
2895 row = shape_function_to_row_table[shape_func*
n_components+c];
2897 const double *shape_value_ptr = &shape_values(row, 0);
2900 if (quadrature_points_fastest)
2902 VectorType &values_comp = values[comp];
2903 for (
unsigned int point=0;
point<n_quadrature_points;
2905 values_comp[point] += value * (*shape_value_ptr++);
2908 for (
unsigned int point=0;
point<n_quadrature_points; ++
point)
2909 values[point][comp] += value * (*shape_value_ptr++);
2918 template <
int order,
int spacedim,
typename Number>
2920 do_function_derivatives (
const Number *dof_values_ptr,
2924 const unsigned int dofs_per_cell = shape_derivatives.size()[0];
2925 const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
2926 shape_derivatives[0].size() : derivatives.size();
2939 for (
unsigned int shape_func=0; shape_func<dofs_per_cell; ++shape_func)
2941 const Number &value = dof_values_ptr[shape_func];
2945 if (::internal::CheckForZero<Number>::value(value) ==
true)
2949 = &shape_derivatives[shape_func][0];
2950 for (
unsigned int point=0;
point<n_quadrature_points; ++
point)
2951 derivatives[point] += value * (*shape_derivative_ptr++);
2957 template <
int order,
int dim,
int spacedim,
typename Number>
2959 do_function_derivatives (
const Number *dof_values_ptr,
2962 const std::vector<unsigned int> &shape_function_to_row_table,
2964 const bool quadrature_points_fastest =
false,
2965 const unsigned int component_multiple = 1)
2968 for (
unsigned int i=0; i<derivatives.size(); ++i)
2969 std::fill_n (derivatives[i].begin(), derivatives[i].size(),
2975 if (dofs_per_cell == 0)
2979 const unsigned int n_quadrature_points = shape_derivatives[0].size();
2983 const unsigned result_components =
n_components * component_multiple;
2984 (void)result_components;
2985 if (quadrature_points_fastest)
2988 for (
unsigned int i=0; i<derivatives.size(); ++i)
2994 for (
unsigned int i=0; i<derivatives.size(); ++i)
3001 for (
unsigned int mc = 0; mc < component_multiple; ++mc)
3002 for (
unsigned int shape_func=0; shape_func<dofs_per_cell; ++shape_func)
3004 const Number &value = dof_values_ptr[shape_func+mc*dofs_per_cell];
3008 if (::internal::CheckForZero<Number>::value(value) ==
true)
3013 const unsigned int comp =
3017 row = shape_function_to_row_table[shape_func*
n_components+comp];
3020 &shape_derivatives[row][0];
3022 if (quadrature_points_fastest)
3023 for (
unsigned int point=0;
point<n_quadrature_points; ++
point)
3024 derivatives[comp][point] += value * (*shape_derivative_ptr++);
3026 for (
unsigned int point=0;
point<n_quadrature_points; ++
point)
3027 derivatives[point][comp] += value * (*shape_derivative_ptr++);
3036 row = shape_function_to_row_table[shape_func*
n_components+c];
3039 &shape_derivatives[row][0];
3042 if (quadrature_points_fastest)
3043 for (
unsigned int point=0;
point<n_quadrature_points; ++
point)
3044 derivatives[comp][point] += value * (*shape_derivative_ptr++);
3046 for (
unsigned int point=0;
point<n_quadrature_points; ++
point)
3047 derivatives[point][comp] += value * (*shape_derivative_ptr++);
3054 template <
int spacedim,
typename Number,
typename Number2>
3056 do_function_laplacians (
const Number2 *dof_values_ptr,
3058 std::vector<Number> &laplacians)
3060 const unsigned int dofs_per_cell = shape_hessians.size()[0];
3061 const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
3062 shape_hessians[0].size() : laplacians.size();
3066 std::fill_n (laplacians.begin(), n_quadrature_points,
3072 for (
unsigned int shape_func=0; shape_func<dofs_per_cell; ++shape_func)
3074 const Number2 value = dof_values_ptr[shape_func];
3083 = &shape_hessians[shape_func][0];
3084 for (
unsigned int point=0;
point<n_quadrature_points; ++
point)
3085 laplacians[point] += value *
trace(*shape_hessian_ptr++);
3091 template <
int dim,
int spacedim,
typename VectorType,
typename Number>
3093 do_function_laplacians (
const Number *dof_values_ptr,
3096 const std::vector<unsigned int> &shape_function_to_row_table,
3097 std::vector<VectorType> &laplacians,
3098 const bool quadrature_points_fastest =
false,
3099 const unsigned int component_multiple = 1)
3102 for (
unsigned int i=0; i<laplacians.size(); ++i)
3103 std::fill_n (laplacians[i].begin(), laplacians[i].size(),
3104 typename VectorType::value_type());
3109 if (dofs_per_cell == 0)
3113 const unsigned int n_quadrature_points = shape_hessians[0].size();
3117 const unsigned result_components =
n_components * component_multiple;
3118 (void)result_components;
3119 if (quadrature_points_fastest)
3122 for (
unsigned int i=0; i<laplacians.size(); ++i)
3128 for (
unsigned int i=0; i<laplacians.size(); ++i)
3135 for (
unsigned int mc = 0; mc < component_multiple; ++mc)
3136 for (
unsigned int shape_func=0; shape_func<dofs_per_cell; ++shape_func)
3138 const Number &value = dof_values_ptr[shape_func+mc*dofs_per_cell];
3142 if (::internal::CheckForZero<Number>::value(value) ==
true)
3147 const unsigned int comp =
3151 row = shape_function_to_row_table[shape_func*
n_components+comp];
3154 &shape_hessians[row][0];
3155 if (quadrature_points_fastest)
3157 VectorType &laplacians_comp = laplacians[comp];
3158 for (
unsigned int point=0;
point<n_quadrature_points; ++
point)
3159 laplacians_comp[point] += value *
trace(*shape_hessian_ptr++);
3162 for (
unsigned int point=0;
point<n_quadrature_points; ++
point)
3163 laplacians[point][comp] += value *
trace(*shape_hessian_ptr++);
3172 row = shape_function_to_row_table[shape_func*
n_components+c];
3175 &shape_hessians[row][0];
3178 if (quadrature_points_fastest)
3180 VectorType &laplacians_comp = laplacians[comp];
3181 for (
unsigned int point=0;
point<n_quadrature_points;
3183 laplacians_comp[point] += value *
trace(*shape_hessian_ptr++);
3186 for (
unsigned int point=0;
point<n_quadrature_points; ++
point)
3187 laplacians[point][comp] += value *
trace(*shape_hessian_ptr++);
3195 template <
int dim,
int spacedim>
3196 template <
class InputVector>
3198 const InputVector &fe_function,
3199 std::vector<typename InputVector::value_type> &values)
const 3201 typedef typename InputVector::value_type Number;
3205 Assert (present_cell.get() !=
nullptr,
3206 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
3208 present_cell->n_dofs_for_dof_handler());
3211 Vector<Number> dof_values (dofs_per_cell);
3212 present_cell->get_interpolated_dof_values(fe_function, dof_values);
3213 internal::do_function_values (dof_values.begin(), this->finite_element_output.shape_values,
3219 template <
int dim,
int spacedim>
3220 template <
class InputVector>
3222 const InputVector &fe_function,
3223 const VectorSlice<
const std::vector<types::global_dof_index> > &indices,
3224 std::vector<typename InputVector::value_type> &values)
const 3226 typedef typename InputVector::value_type Number;
3232 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
3233 for (
unsigned int i=0; i<dofs_per_cell; ++i)
3234 dof_values[i] = internal::get_vector_element (fe_function, indices[i]);
3235 internal::do_function_values(dof_values.data(), this->finite_element_output.shape_values, values);
3240 template <
int dim,
int spacedim>
3241 template <
class InputVector>
3243 const InputVector &fe_function,
3244 std::vector<Vector<typename InputVector::value_type> > &values)
const 3246 typedef typename InputVector::value_type Number;
3247 Assert (present_cell.get() !=
nullptr,
3248 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
3252 AssertDimension (fe_function.size(), present_cell->n_dofs_for_dof_handler());
3255 Vector<Number> dof_values (dofs_per_cell);
3256 present_cell->get_interpolated_dof_values(fe_function, dof_values);
3257 internal::do_function_values(dof_values.begin(),
3258 this->finite_element_output.shape_values,
3260 this->finite_element_output.shape_function_to_row_table,
3266 template <
int dim,
int spacedim>
3267 template <
class InputVector>
3269 const InputVector &fe_function,
3270 const VectorSlice<
const std::vector<types::global_dof_index> > &indices,
3271 std::vector<Vector<typename InputVector::value_type> > &values)
const 3273 typedef typename InputVector::value_type Number;
3276 Assert (indices.size() % dofs_per_cell == 0,
3281 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
3282 for (
unsigned int i=0; i<dofs_per_cell; ++i)
3283 dof_values[i] = internal::get_vector_element (fe_function, indices[i]);
3284 internal::do_function_values(dof_values.data(),
3285 this->finite_element_output.shape_values,
3287 this->finite_element_output.shape_function_to_row_table,
3290 indices.size()/dofs_per_cell);
3295 template <
int dim,
int spacedim>
3296 template <
class InputVector>
3298 const InputVector &fe_function,
3299 const VectorSlice<
const std::vector<types::global_dof_index> > &indices,
3300 VectorSlice<std::vector<std::vector<typename InputVector::value_type> > > values,
3301 bool quadrature_points_fastest)
const 3303 typedef typename InputVector::value_type Number;
3309 Assert (indices.size() % dofs_per_cell == 0,
3312 boost::container::small_vector<Number, 200> dof_values(indices.size());
3313 for (
unsigned int i=0; i<indices.size(); ++i)
3314 dof_values[i] = internal::get_vector_element (fe_function, indices[i]);
3315 internal::do_function_values(dof_values.
data(),
3316 this->finite_element_output.shape_values,
3318 this->finite_element_output.shape_function_to_row_table,
3320 quadrature_points_fastest,
3321 indices.size()/dofs_per_cell);
3326 template <
int dim,
int spacedim>
3327 template <
class InputVector>
3330 const InputVector &fe_function,
3333 typedef typename InputVector::value_type Number;
3337 Assert (present_cell.get() !=
nullptr,
3338 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
3339 AssertDimension (fe_function.size(), present_cell->n_dofs_for_dof_handler());
3342 Vector<Number> dof_values (dofs_per_cell);
3343 present_cell->get_interpolated_dof_values(fe_function, dof_values);
3344 internal::do_function_derivatives(dof_values.begin(), this->finite_element_output.shape_gradients,
3350 template <
int dim,
int spacedim>
3351 template <
class InputVector>
3353 const InputVector &fe_function,
3354 const VectorSlice<
const std::vector<types::global_dof_index> > &indices,
3357 typedef typename InputVector::value_type Number;
3363 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
3364 for (
unsigned int i=0; i<dofs_per_cell; ++i)
3365 dof_values[i] = internal::get_vector_element (fe_function, indices[i]);
3366 internal::do_function_derivatives(dof_values.data(), this->finite_element_output.shape_gradients,
3372 template <
int dim,
int spacedim>
3373 template <
class InputVector>
3376 const InputVector &fe_function,
3379 typedef typename InputVector::value_type Number;
3382 Assert (present_cell.get() !=
nullptr,
3383 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
3384 AssertDimension (fe_function.size(), present_cell->n_dofs_for_dof_handler());
3387 Vector<Number> dof_values (dofs_per_cell);
3388 present_cell->get_interpolated_dof_values(fe_function, dof_values);
3389 internal::do_function_derivatives(dof_values.begin(),
3390 this->finite_element_output.shape_gradients,
3392 this->finite_element_output.shape_function_to_row_table,
3398 template <
int dim,
int spacedim>
3399 template <
class InputVector>
3401 const InputVector &fe_function,
3402 const VectorSlice<
const std::vector<types::global_dof_index> > &indices,
3404 bool quadrature_points_fastest)
const 3406 typedef typename InputVector::value_type Number;
3409 Assert (indices.size() % dofs_per_cell == 0,
3414 boost::container::small_vector<Number, 200> dof_values(indices.size());
3415 for (
unsigned int i=0; i<indices.size(); ++i)
3416 dof_values[i] = internal::get_vector_element (fe_function, indices[i]);
3417 internal::do_function_derivatives(dof_values.
data(),
3418 this->finite_element_output.shape_gradients,
3420 this->finite_element_output.shape_function_to_row_table,
3422 quadrature_points_fastest,
3423 indices.size()/dofs_per_cell);
3428 template <
int dim,
int spacedim>
3429 template <
class InputVector>
3435 typedef typename InputVector::value_type Number;
3439 Assert (present_cell.get() !=
nullptr,
3440 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
3441 AssertDimension (fe_function.size(), present_cell->n_dofs_for_dof_handler());
3444 Vector<Number> dof_values (dofs_per_cell);
3445 present_cell->get_interpolated_dof_values(fe_function, dof_values);
3446 internal::do_function_derivatives(dof_values.begin(), this->finite_element_output.shape_hessians,
3452 template <
int dim,
int spacedim>
3453 template <
class InputVector>
3455 const InputVector &fe_function,
3456 const VectorSlice<
const std::vector<types::global_dof_index> > &indices,
3459 typedef typename InputVector::value_type Number;
3462 AssertDimension (fe_function.size(), present_cell->n_dofs_for_dof_handler());
3465 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
3466 for (
unsigned int i=0; i<dofs_per_cell; ++i)
3467 dof_values[i] = internal::get_vector_element (fe_function, indices[i]);
3468 internal::do_function_derivatives(dof_values.data(), this->finite_element_output.shape_hessians,
3474 template <
int dim,
int spacedim>
3475 template <
class InputVector>
3480 bool quadrature_points_fastest)
const 3482 typedef typename InputVector::value_type Number;
3485 Assert (present_cell.get() !=
nullptr,
3486 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
3487 AssertDimension (fe_function.size(), present_cell->n_dofs_for_dof_handler());
3490 Vector<Number> dof_values (dofs_per_cell);
3491 present_cell->get_interpolated_dof_values(fe_function, dof_values);
3492 internal::do_function_derivatives(dof_values.begin(),
3493 this->finite_element_output.shape_hessians,
3495 this->finite_element_output.shape_function_to_row_table,
3497 quadrature_points_fastest);
3502 template <
int dim,
int spacedim>
3503 template <
class InputVector>
3505 const InputVector &fe_function,
3506 const VectorSlice<
const std::vector<types::global_dof_index> > &indices,
3508 bool quadrature_points_fastest)
const 3510 typedef typename InputVector::value_type Number;
3513 Assert (indices.size() % dofs_per_cell == 0,
3516 boost::container::small_vector<Number, 200> dof_values(indices.size());
3517 for (
unsigned int i=0; i<indices.size(); ++i)
3518 dof_values[i] = internal::get_vector_element (fe_function, indices[i]);
3519 internal::do_function_derivatives(dof_values.
data(),
3520 this->finite_element_output.shape_hessians,
3522 this->finite_element_output.shape_function_to_row_table,
3524 quadrature_points_fastest,
3525 indices.size()/dofs_per_cell);
3530 template <
int dim,
int spacedim>
3531 template <
class InputVector>
3533 const InputVector &fe_function,
3534 std::vector<typename InputVector::value_type> &laplacians)
const 3536 typedef typename InputVector::value_type Number;
3540 Assert (present_cell.get() !=
nullptr,
3541 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
3542 AssertDimension (fe_function.size(), present_cell->n_dofs_for_dof_handler());
3545 Vector<Number> dof_values (dofs_per_cell);
3546 present_cell->get_interpolated_dof_values(fe_function, dof_values);
3547 internal::do_function_laplacians(dof_values.begin(), this->finite_element_output.shape_hessians,
3553 template <
int dim,
int spacedim>
3554 template <
class InputVector>
3556 const InputVector &fe_function,
3557 const VectorSlice<
const std::vector<types::global_dof_index> > &indices,
3558 std::vector<typename InputVector::value_type> &laplacians)
const 3560 typedef typename InputVector::value_type Number;
3566 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
3567 for (
unsigned int i=0; i<dofs_per_cell; ++i)
3568 dof_values[i] = internal::get_vector_element (fe_function, indices[i]);
3569 internal::do_function_laplacians(dof_values.data(), this->finite_element_output.shape_hessians,
3575 template <
int dim,
int spacedim>
3576 template <
class InputVector>
3578 const InputVector &fe_function,
3579 std::vector<Vector<typename InputVector::value_type> > &laplacians)
const 3581 typedef typename InputVector::value_type Number;
3582 Assert (present_cell.get() !=
nullptr,
3583 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
3586 AssertDimension (fe_function.size(), present_cell->n_dofs_for_dof_handler());
3589 Vector<Number> dof_values (dofs_per_cell);
3590 present_cell->get_interpolated_dof_values(fe_function, dof_values);
3591 internal::do_function_laplacians(dof_values.begin(), this->finite_element_output.shape_hessians,
3592 *fe, this->finite_element_output.shape_function_to_row_table,
3598 template <
int dim,
int spacedim>
3599 template <
class InputVector>
3601 const InputVector &fe_function,
3602 const VectorSlice<
const std::vector<types::global_dof_index> > &indices,
3603 std::vector<Vector<typename InputVector::value_type> > &laplacians)
const 3605 typedef typename InputVector::value_type Number;
3608 Assert (indices.size() % dofs_per_cell == 0,
3613 boost::container::small_vector<Number, 200> dof_values(indices.size());
3614 for (
unsigned int i=0; i<indices.size(); ++i)
3615 dof_values[i] = internal::get_vector_element (fe_function, indices[i]);
3616 internal::do_function_laplacians(dof_values.
data(), this->finite_element_output.shape_hessians,
3617 *fe, this->finite_element_output.shape_function_to_row_table,
3619 indices.size()/dofs_per_cell);
3624 template <
int dim,
int spacedim>
3625 template <
class InputVector>
3627 const InputVector &fe_function,
3628 const VectorSlice<
const std::vector<types::global_dof_index> > &indices,
3629 std::vector<std::vector<typename InputVector::value_type> > &laplacians,
3630 bool quadrature_points_fastest)
const 3632 typedef typename InputVector::value_type Number;
3633 Assert (indices.size() % dofs_per_cell == 0,
3638 boost::container::small_vector<Number, 200> dof_values(indices.size());
3639 for (
unsigned int i=0; i<indices.size(); ++i)
3640 dof_values[i] = internal::get_vector_element (fe_function, indices[i]);
3641 internal::do_function_laplacians(dof_values.
data(), this->finite_element_output.shape_hessians,
3642 *fe, this->finite_element_output.shape_function_to_row_table,
3643 laplacians, quadrature_points_fastest,
3644 indices.size()/dofs_per_cell);
3649 template <
int dim,
int spacedim>
3650 template <
class InputVector>
3656 typedef typename InputVector::value_type Number;
3660 Assert (present_cell.get() !=
nullptr,
3661 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
3662 AssertDimension (fe_function.size(), present_cell->n_dofs_for_dof_handler());
3665 Vector<Number> dof_values (dofs_per_cell);
3666 present_cell->get_interpolated_dof_values(fe_function, dof_values);
3667 internal::do_function_derivatives(dof_values.begin(), this->finite_element_output.shape_3rd_derivatives,
3673 template <
int dim,
int spacedim>
3674 template <
class InputVector>
3676 const InputVector &fe_function,
3677 const VectorSlice<
const std::vector<types::global_dof_index> > &indices,
3680 typedef typename InputVector::value_type Number;
3683 AssertDimension (fe_function.size(), present_cell->n_dofs_for_dof_handler());
3686 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
3687 for (
unsigned int i=0; i<dofs_per_cell; ++i)
3688 dof_values[i] = internal::get_vector_element (fe_function, indices[i]);
3689 internal::do_function_derivatives(dof_values.data(), this->finite_element_output.shape_3rd_derivatives,
3695 template <
int dim,
int spacedim>
3696 template <
class InputVector>
3701 bool quadrature_points_fastest)
const 3703 typedef typename InputVector::value_type Number;
3706 Assert (present_cell.get() !=
nullptr,
3707 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
3708 AssertDimension (fe_function.size(), present_cell->n_dofs_for_dof_handler());
3711 Vector<Number> dof_values (dofs_per_cell);
3712 present_cell->get_interpolated_dof_values(fe_function, dof_values);
3713 internal::do_function_derivatives(dof_values.begin(),
3714 this->finite_element_output.shape_3rd_derivatives,
3716 this->finite_element_output.shape_function_to_row_table,
3718 quadrature_points_fastest);
3723 template <
int dim,
int spacedim>
3724 template <
class InputVector>
3726 const InputVector &fe_function,
3727 const VectorSlice<
const std::vector<types::global_dof_index> > &indices,
3729 bool quadrature_points_fastest)
const 3731 typedef typename InputVector::value_type Number;
3734 Assert (indices.size() % dofs_per_cell == 0,
3737 boost::container::small_vector<Number, 200> dof_values(indices.size());
3738 for (
unsigned int i=0; i<indices.size(); ++i)
3739 dof_values[i] = internal::get_vector_element (fe_function, indices[i]);
3740 internal::do_function_derivatives(dof_values.
data(),
3741 this->finite_element_output.shape_3rd_derivatives,
3743 this->finite_element_output.shape_function_to_row_table,
3745 quadrature_points_fastest,
3746 indices.size()/dofs_per_cell);
3751 template <
int dim,
int spacedim>
3755 return *present_cell;
3760 template <
int dim,
int spacedim>
3761 const std::vector<Tensor<1,spacedim> > &
3766 return get_normal_vectors();
3771 template <
int dim,
int spacedim>
3772 const std::vector<Tensor<1,spacedim> > &
3778 return this->mapping_output.normal_vectors;
3783 template <
int dim,
int spacedim>
3787 return (
sizeof(this->update_flags) +
3789 sizeof (cell_similarity) +
3803 template <
int dim,
int spacedim>
3815 flags |= mapping->requires_update_flags (flags);
3822 template <
int dim,
int spacedim>
3833 tria_listener_refinement.disconnect ();
3834 tria_listener_mesh_transform.disconnect ();
3835 present_cell.reset ();
3840 template <
int dim,
int spacedim>
3845 if (present_cell.get() !=
nullptr)
3847 if (&cell->get_triangulation() !=
3849 ->get_triangulation())
3856 invalidate_present_cell();
3857 tria_listener_refinement =
3858 cell->get_triangulation().signals.any_change.connect
3861 tria_listener_mesh_transform =
3862 cell->get_triangulation().signals.mesh_movement.connect
3872 tria_listener_refinement =
3873 cell->get_triangulation().signals.post_refinement.connect
3876 tria_listener_mesh_transform =
3877 cell->get_triangulation().signals.mesh_movement.connect
3885 template <
int dim,
int spacedim>
3913 if (this->present_cell.get() ==
nullptr)
3921 cell_similarity = (cell->is_translation_of
3931 (*this->present_cell)->direction_flag()
3932 != cell->direction_flag() )
3941 template <
int dim,
int spacedim>
3945 return cell_similarity;
3950 template <
int dim,
int spacedim>
3955 template <
int dim,
int spacedim>
3960 template <
int dim,
int spacedim>
3965 template <
int dim,
int spacedim>
3983 template <
int dim,
int spacedim>
4000 template <
int dim,
int spacedim>
4006 if (dim != spacedim-1)
4008 ExcMessage (
"You can only pass the 'update_normal_vectors' " 4009 "flag to FEFaceValues or FESubfaceValues objects, " 4010 "but not to an FEValues object unless the " 4011 "triangulation it refers to is embedded in a higher " 4012 "dimensional space."));
4014 const UpdateFlags flags = this->compute_update_flags (update_flags);
4018 this->mapping_output.initialize(this->n_quadrature_points, flags);
4019 this->finite_element_output.initialize(this->n_quadrature_points, *this->fe, flags);
4029 this->finite_element_output);
4038 this->update_flags = flags;
4043 this->mapping_data = std::move(mapping_get_data.
return_value());
4045 this->mapping_data = std_cxx14::make_unique<typename Mapping<dim,spacedim>::InternalDataBase> ();
4056 template <
typename Type,
typename Po
inter,
typename Iterator>
4058 reset_pointer_in_place_if_possible
4059 (std::unique_ptr<Pointer> &present_cell,
4060 const Iterator &new_cell)
4065 if (present_cell.get()
4067 (
typeid(*present_cell.get()) ==
typeid(Type)))
4070 static_cast<const Type *
>(present_cell.get())->~Type();
4073 new (
const_cast<void *
>(
static_cast<const void *
>(present_cell.get()))) Type(new_cell);
4077 present_cell = std_cxx14::make_unique<Type> (new_cell);
4083 template <
int dim,
int spacedim>
4088 this->maybe_invalidate_previous_present_cell (cell);
4089 this->check_cell_similarity(cell);
4091 reset_pointer_in_place_if_possible<typename FEValuesBase<dim,spacedim>::TriaCellIterator>
4092 (this->present_cell, cell);
4102 template <
int dim,
int spacedim>
4103 template <
template <
int,
int>
class DoFHandlerType,
bool lda>
4114 this->maybe_invalidate_previous_present_cell (cell);
4115 this->check_cell_similarity(cell);
4117 reset_pointer_in_place_if_possible<typename FEValuesBase<dim,spacedim>::template
4120 (this->present_cell, cell);
4130 template <
int dim,
int spacedim>
4139 this->cell_similarity
4140 = this->get_mapping().fill_fe_values(*this->present_cell,
4141 this->cell_similarity,
4143 *this->mapping_data,
4144 this->mapping_output);
4151 this->get_fe().fill_fe_values(*this->present_cell,
4152 this->cell_similarity,
4154 this->get_mapping(),
4155 *this->mapping_data,
4156 this->mapping_output,
4158 this->finite_element_output);
4163 template <
int dim,
int spacedim>
4175 template <
int dim,
int spacedim>
4177 const unsigned int dofs_per_cell,
4188 present_face_index (
numbers::invalid_unsigned_int),
4189 quadrature(quadrature)
4194 template <
int dim,
int spacedim>
4195 const std::vector<Tensor<1,spacedim> > &
4200 return this->mapping_output.boundary_forms;
4205 template <
int dim,
int spacedim>
4216 template <
int dim,
int spacedim>
4221 template <
int dim,
int spacedim>
4226 template <
int dim,
int spacedim>
4243 template <
int dim,
int spacedim>
4259 template <
int dim,
int spacedim>
4263 const UpdateFlags flags = this->compute_update_flags (update_flags);
4267 this->mapping_output.initialize(this->n_quadrature_points, flags);
4268 this->finite_element_output.initialize(this->n_quadrature_points, *this->fe, flags);
4278 this->finite_element_output);
4287 this->update_flags = flags;
4292 this->mapping_data = std::move(mapping_get_data.
return_value());
4294 this->mapping_data = std_cxx14::make_unique<typename Mapping<dim,spacedim>::InternalDataBase> ();
4299 template <
int dim,
int spacedim>
4300 template <
template <
int,
int>
class DoFHandlerType,
bool lda>
4304 const unsigned int face_no)
4310 cell->get_dof_handler().get_fe(cell->active_fe_index ())),
4316 this->maybe_invalidate_previous_present_cell (cell);
4317 reset_pointer_in_place_if_possible<typename FEValuesBase<dim,spacedim>::template
4320 (this->present_cell, cell);
4325 do_reinit (face_no);
4330 template <
int dim,
int spacedim>
4332 const unsigned int face_no)
4337 this->maybe_invalidate_previous_present_cell (cell);
4338 reset_pointer_in_place_if_possible<typename FEValuesBase<dim,spacedim>::TriaCellIterator>
4339 (this->present_cell, cell);
4344 do_reinit (face_no);
4349 template <
int dim,
int spacedim>
4354 this->present_face_index=cell->face_index(face_no);
4358 this->get_mapping().fill_fe_face_values(*this->present_cell,
4361 *this->mapping_data,
4362 this->mapping_output);
4365 this->get_fe().fill_fe_face_values(*this->present_cell,
4368 this->get_mapping(),
4369 *this->mapping_data,
4370 this->mapping_output,
4372 this->finite_element_output);
4379 template <
int dim,
int spacedim>
4384 template <
int dim,
int spacedim>
4389 template <
int dim,
int spacedim>
4406 template <
int dim,
int spacedim>
4422 template <
int dim,
int spacedim>
4426 const UpdateFlags flags = this->compute_update_flags (update_flags);
4430 this->mapping_output.initialize(this->n_quadrature_points, flags);
4431 this->finite_element_output.initialize(this->n_quadrature_points, *this->fe, flags);
4442 this->finite_element_output);
4451 this->update_flags = flags;
4456 this->mapping_data = std::move(mapping_get_data.
return_value());
4458 this->mapping_data = std_cxx14::make_unique<typename Mapping<dim,spacedim>::InternalDataBase> ();
4463 template <
int dim,
int spacedim>
4464 template <
template <
int,
int>
class DoFHandlerType,
bool lda>
4467 const unsigned int face_no,
4468 const unsigned int subface_no)
4474 cell->get_dof_handler().get_fe(cell->active_fe_index ())),
4482 Assert (cell->face(face_no)->has_children() ||
4483 subface_no < GeometryInfo<dim>::max_children_per_face,
4485 Assert (!cell->face(face_no)->has_children() ||
4486 subface_no < cell->face(face_no)->number_of_children(),
4487 ExcIndexRange (subface_no, 0, cell->face(face_no)->number_of_children()));
4488 Assert (cell->has_children() ==
false,
4489 ExcMessage (
"You can't use subface data for cells that are " 4490 "already refined. Iterate over their children " 4491 "instead in these cases."));
4493 this->maybe_invalidate_previous_present_cell (cell);
4494 reset_pointer_in_place_if_possible<typename FEValuesBase<dim,spacedim>::template
4497 (this->present_cell, cell);
4502 do_reinit (face_no, subface_no);
4507 template <
int dim,
int spacedim>
4509 const unsigned int face_no,
4510 const unsigned int subface_no)
4514 Assert (subface_no < cell->face(face_no)->n_children(),
4515 ExcIndexRange (subface_no, 0, cell->face(face_no)->n_children()));
4517 this->maybe_invalidate_previous_present_cell (cell);
4518 reset_pointer_in_place_if_possible<typename FEValuesBase<dim,spacedim>::TriaCellIterator>
4519 (this->present_cell, cell);
4524 do_reinit (face_no, subface_no);
4529 template <
int dim,
int spacedim>
4531 const unsigned int subface_no)
4536 if (!cell->face(face_no)->has_children())
4539 this->present_face_index=cell->face_index(face_no);
4541 this->present_face_index=cell->face(face_no)->child_index(subface_no);
4547 switch (cell->subface_case(face_no))
4552 subface_index=cell->face(face_no)->child_index(subface_no);
4556 subface_index=cell->face(face_no)->child(subface_no/2)->child_index(subface_no%2);
4564 subface_index=cell->face(face_no)->child(0)->child_index(subface_no);
4567 subface_index=cell->face(face_no)->child_index(1);
4578 subface_index=cell->face(face_no)->child_index(0);
4582 subface_index=cell->face(face_no)->child(1)->child_index(subface_no-1);
4594 this->present_face_index=subface_index;
4600 this->get_mapping().fill_fe_subface_values(*this->present_cell,
4604 *this->mapping_data,
4605 this->mapping_output);
4608 this->get_fe().fill_fe_subface_values(*this->present_cell,
4612 this->get_mapping(),
4613 *this->mapping_data,
4614 this->mapping_output,
4616 this->finite_element_output);
4621 #define SPLIT_INSTANTIATIONS_COUNT 6 4622 #ifndef SPLIT_INSTANTIATIONS_INDEX 4623 #define SPLIT_INSTANTIATIONS_INDEX 0 4625 #include "fe_values.inst" 4627 DEAL_II_NAMESPACE_CLOSE
void get_function_third_derivatives(const InputVector &fe_function, std::vector< typename ProductType< third_derivative_type, typename InputVector::value_type >::type > &third_derivatives) const
Transformed quadrature weights.
void get_function_gradients(const InputVector &fe_function, std::vector< Tensor< 1, spacedim, typename InputVector::value_type > > &gradients) const
ProductType< Number, typename Scalar< dim, spacedim >::third_derivative_type >::type third_derivative_type
virtual UpdateFlags requires_update_flags(const UpdateFlags update_flags) const =0
static const unsigned int invalid_unsigned_int
ProductType< Number, typename Vector< dim, spacedim >::third_derivative_type >::type third_derivative_type
CellSimilarity::Similarity cell_similarity
Cache(const FEValuesBase< dim, spacedim > &fe_values)
#define AssertDimension(dim1, dim2)
static unsigned int component_to_unrolled_index(const TableIndices< rank_ > &indices)
unsigned int n_nonzero_components(const unsigned int i) const
static ::ExceptionBase & ExcAccessToUninitializedField()
ProductType< Number, typename Tensor< 2, dim, spacedim >::gradient_type >::type gradient_type
Task< RT > new_task(const std::function< RT()> &function)
Point< spacedim > point(const gp_Pnt &p, const double &tolerance=1e-10)
static const unsigned int n_independent_components
const unsigned int dofs_per_cell
const unsigned int component
void get_function_symmetric_gradients_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::symmetric_gradient_type > &symmetric_gradients) const
void get_function_values(const InputVector &fe_function, std::vector< typename ProductType< value_type, typename InputVector::value_type >::type > &values) const
Number trace(const SymmetricTensor< 2, dim, Number > &d)
FEValuesBase(const unsigned int n_q_points, const unsigned int dofs_per_cell, const UpdateFlags update_flags, const Mapping< dim, spacedim > &mapping, const FiniteElement< dim, spacedim > &fe)
void get_function_third_derivatives(const InputVector &fe_function, std::vector< typename ProductType< third_derivative_type, typename InputVector::value_type >::type > &third_derivatives) const
void get_function_values(const InputVector &fe_function, std::vector< typename InputVector::value_type > &values) const
Outer normal vector, not normalized.
const FiniteElement< dim, spacedim > & get_fe() const
static ::ExceptionBase & ExcFEDontMatch()
Scalar & operator=(const Scalar< dim, spacedim > &)
void get_function_divergences(const InputVector &fe_function, std::vector< typename ProductType< divergence_type, typename InputVector::value_type >::type > &divergences) const
void get_function_laplacians(const InputVector &fe_function, std::vector< typename ProductType< value_type, typename InputVector::value_type >::type > &laplacians) const
TriaCellIterator(const typename Triangulation< dim, spacedim >::cell_iterator &cell)
Transformed quadrature points.
SymmetricTensor & operator=(const SymmetricTensor< rank_, dim, OtherNumber > &rhs)
void do_reinit(const unsigned int face_no)
virtual void get_interpolated_dof_values(const IndexSet &in, Vector< IndexSet::value_type > &out) const
ProductType< Number, typename SymmetricTensor< 2, dim, spacedim >::divergence_type >::type divergence_type
std::size_t memory_consumption() const
bool is_primitive() const
void check_cell_similarity(const typename Triangulation< dim, spacedim >::cell_iterator &cell)
::internal::FEValuesViews::Cache< dim, spacedim > fe_values_views_cache
static ::ExceptionBase & ExcIndexRange(int arg1, int arg2, int arg3)
Tensor & operator=(const Tensor< rank_, dim, OtherNumber > &rhs)
ProductType< Number, typename Vector< dim, spacedim >::hessian_type >::type hessian_type
void get_function_hessians(const InputVector &fe_function, std::vector< Tensor< 2, spacedim, typename InputVector::value_type > > &hessians) const
void do_reinit(const unsigned int face_no, const unsigned int subface_no)
static TableIndices< rank_ > unrolled_to_component_indices(const unsigned int i)
void reinit(const TriaIterator< DoFCellAccessor< DoFHandlerType< dim, spacedim >, level_dof_access > > &cell, const unsigned int face_no, const unsigned int subface_no)
ProductType< Number, typename Vector< dim, spacedim >::gradient_type >::type gradient_type
void get_function_divergences_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::divergence_type > &divergences) const
void get_function_curls_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::curl_type > &curls) const
void get_function_laplacians(const InputVector &fe_function, std::vector< typename ProductType< value_type, typename InputVector::value_type >::type > &laplacians) const
void get_function_hessians_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::hessian_type > &hessians) const
ArrayView< typename std::remove_reference< typename std::iterator_traits< Iterator >::reference >::type > make_array_view(const Iterator begin, const Iterator end)
ProductType< Number, typename Vector< dim, spacedim >::value_type >::type value_type
ProductType< Number, typename Scalar< dim, spacedim >::gradient_type >::type gradient_type
void get_function_gradients(const InputVector &fe_function, std::vector< typename ProductType< gradient_type, typename InputVector::value_type >::type > &gradients) const
void get_function_hessians(const InputVector &fe_function, std::vector< typename ProductType< hessian_type, typename InputVector::value_type >::type > &hessians) const
void get_function_laplacians(const InputVector &fe_function, std::vector< typename InputVector::value_type > &laplacians) const
const SmartPointer< const FiniteElement< dim, spacedim >, FEValuesBase< dim, spacedim > > fe
static ::ExceptionBase & ExcMessage(std::string arg1)
void get_function_gradients_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::gradient_type > &gradients) const
ProductType< Number, typename Scalar< dim, spacedim >::hessian_type >::type hessian_type
CellSimilarity::Similarity get_cell_similarity() const
TriaIterator< CellAccessor< dim, spacedim > > cell_iterator
unsigned int global_dof_index
Third derivatives of shape functions.
void get_function_third_derivatives(const InputVector &fe_function, std::vector< Tensor< 3, spacedim, typename InputVector::value_type > > &third_derivatives) const
UpdateFlags compute_update_flags(const UpdateFlags update_flags) const
void get_function_laplacians_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::laplacian_type > &laplacians) const
#define Assert(cond, exc)
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
void reinit(const TriaIterator< DoFCellAccessor< DoFHandlerType< dim, spacedim >, level_dof_access > > &cell, const unsigned int face_no)
Abstract base class for mapping classes.
const ComponentMask & get_nonzero_components(const unsigned int i) const
std::vector< ShapeFunctionData > shape_function_data
const unsigned int first_vector_component
const Triangulation< dim, spacedim >::cell_iterator cell
void invalidate_present_cell()
ProductType< Number, typename Scalar< dim, spacedim >::value_type >::type value_type
const SmartPointer< const Mapping< dim, spacedim >, FEValuesBase< dim, spacedim > > mapping
Vector & operator=(const Vector< dim, spacedim > &)
SymmetricTensor< 2, dim, Number > symmetrize(const Tensor< 2, dim, Number > &t)
static const char *const message_string
void get_function_hessians_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::hessian_type > &hessians) const
void get_function_symmetric_gradients(const InputVector &fe_function, std::vector< typename ProductType< symmetric_gradient_type, typename InputVector::value_type >::type > &symmetric_gradients) const
ProductType< Number, typename Vector< dim, spacedim >::divergence_type >::type divergence_type
Second derivatives of shape functions.
Gradient of volume element.
const std::vector< Tensor< 1, spacedim > > & get_all_normal_vectors() const
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
static TableIndices< rank_ > unrolled_to_component_indices(const unsigned int i)
std::size_t memory_consumption() const
ProductType< Number, typename Vector< dim, spacedim >::symmetric_gradient_type >::type symmetric_gradient_type
const unsigned int dofs_per_cell
void get_function_hessians(const InputVector &fe_function, std::vector< typename ProductType< hessian_type, typename InputVector::value_type >::type > &hessians) const
const unsigned int n_quadrature_points
ProductType< Number, typename Vector< dim, spacedim >::value_type >::type laplacian_type
void get_function_curls(const InputVector &fe_function, std::vector< typename ProductType< curl_type, typename InputVector::value_type >::type > &curls) const
internal::return_value< RT >::reference_type return_value()
size_type size(const unsigned int i) const
std::pair< unsigned int, unsigned int > system_to_component_index(const unsigned int index) const
void get_function_laplacians_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::laplacian_type > &laplacians) const
unsigned int n_components() const
FEFaceValuesBase(const unsigned int n_q_points, const unsigned int dofs_per_cell, const UpdateFlags update_flags, const Mapping< dim, spacedim > &mapping, const FiniteElement< dim, spacedim > &fe, const Quadrature< dim-1 > &quadrature)
ProductType< Number, typename SymmetricTensor< 2, dim, spacedim >::value_type >::type value_type
void initialize(const UpdateFlags update_flags)
Shape function gradients.
void get_function_third_derivatives_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::third_derivative_type > &third_derivatives) const
void maybe_invalidate_previous_present_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell)
value_type * data() const noexcept
void initialize(const UpdateFlags update_flags)
void get_function_gradients_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::gradient_type > &gradients) const
static ::ExceptionBase & ExcNotMultiple(int arg1, int arg2)
static ::ExceptionBase & ExcNotImplemented()
ProductType< Number, typename Vector< dim, spacedim >::curl_type >::type curl_type
static unsigned int n_threads()
const Triangulation< dim, spacedim >::cell_iterator get_cell() const
bool is_element(const size_type index) const
void get_function_values(const InputVector &fe_function, std::vector< typename ProductType< value_type, typename InputVector::value_type >::type > &values) const
const std::vector< Tensor< 1, spacedim > > & get_boundary_forms() const
void initialize(const UpdateFlags update_flags)
FEValues(const Mapping< dim, spacedim > &mapping, const FiniteElement< dim, spacedim > &fe, const Quadrature< dim > &quadrature, const UpdateFlags update_flags)
void get_function_gradients(const InputVector &fe_function, std::vector< typename ProductType< gradient_type, typename InputVector::value_type >::type > &gradients) const
void get_function_third_derivatives_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::third_derivative_type > &third_derivatives) const
const std::vector< Tensor< 1, spacedim > > & get_normal_vectors() const
void reinit(const TriaIterator< DoFCellAccessor< DoFHandlerType< dim, spacedim >, level_dof_access > > &cell)
ProductType< Number, typename Tensor< 2, dim, spacedim >::divergence_type >::type divergence_type
void get_function_values_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::value_type > &values) const
FESubfaceValues(const Mapping< dim, spacedim > &mapping, const FiniteElement< dim, spacedim > &fe, const Quadrature< dim-1 > &face_quadrature, const UpdateFlags update_flags)
ProductType< Number, typename Scalar< dim, spacedim >::value_type >::type laplacian_type
FEFaceValues(const Mapping< dim, spacedim > &mapping, const FiniteElement< dim, spacedim > &fe, const Quadrature< dim-1 > &quadrature, const UpdateFlags update_flags)
std::size_t memory_consumption() const
void get_function_values_from_local_dof_values(const InputVector &dof_values, std::vector< typename OutputType< typename InputVector::value_type >::value_type > &values) const
virtual types::global_dof_index n_dofs_for_dof_handler() const
std::vector< ShapeFunctionData > shape_function_data
std::enable_if< std::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)
static ::ExceptionBase & ExcInternalError()
ProductType< Number, typename Tensor< 2, dim, spacedim >::value_type >::type value_type