16 #include <deal.II/base/memory_consumption.h> 17 #include <deal.II/base/multithread_info.h> 18 #include <deal.II/base/quadrature.h> 19 #include <deal.II/base/signaling_nan.h> 20 #include <deal.II/base/std_cxx11/unique_ptr.h> 21 #include <deal.II/lac/vector.h> 22 #include <deal.II/lac/block_vector.h> 23 #include <deal.II/lac/parallel_vector.h> 24 #include <deal.II/lac/parallel_block_vector.h> 25 #include <deal.II/lac/petsc_vector.h> 26 #include <deal.II/lac/petsc_block_vector.h> 27 #include <deal.II/lac/trilinos_vector.h> 28 #include <deal.II/lac/trilinos_block_vector.h> 29 #include <deal.II/grid/tria_iterator.h> 30 #include <deal.II/grid/tria_accessor.h> 31 #include <deal.II/grid/tria_boundary.h> 32 #include <deal.II/dofs/dof_accessor.h> 33 #include <deal.II/fe/mapping_q1.h> 34 #include <deal.II/fe/fe_values.h> 35 #include <deal.II/fe/fe.h> 39 DEAL_II_NAMESPACE_OPEN
44 template <
class VectorType>
45 typename VectorType::value_type
46 get_vector_element (
const VectorType &vector,
49 return vector[cell_number];
54 get_vector_element (
const IndexSet &is,
64 template <
int dim,
int spacedim>
66 std::vector<unsigned int>
78 unsigned int nth_nonzero_component = 0;
82 shape_function_to_row_table[i*fe.
n_components()+c] = row + nth_nonzero_component;
83 ++nth_nonzero_component;
88 return shape_function_to_row_table;
96 template <
int dim,
int spacedim>
98 const unsigned int component)
100 fe_values (fe_values),
101 component (component),
102 shape_function_data (fe_values.fe->dofs_per_cell)
104 Assert (component < fe_values.fe->n_components(),
105 ExcIndexRange(component, 0, fe_values.
fe->n_components()));
110 const std::vector<unsigned int> shape_function_to_row_table
111 = make_shape_function_to_row_table (*fe_values.
fe);
113 for (
unsigned int i=0; i<fe_values.
fe->dofs_per_cell; ++i)
115 const bool is_primitive = (fe_values.
fe->is_primitive() ||
116 fe_values.
fe->is_primitive(i));
118 if (is_primitive ==
true)
121 fe_values.
fe->system_to_component_index(i).first);
124 = (fe_values.
fe->get_nonzero_components(i)[
component]
129 = shape_function_to_row_table[i*fe_values.
fe->n_components()+
component];
137 template <
int dim,
int spacedim>
145 template <
int dim,
int spacedim>
150 Assert (
false, ExcInternalError());
156 template <
int dim,
int spacedim>
158 const unsigned int first_vector_component)
160 fe_values (fe_values),
161 first_vector_component (first_vector_component),
164 Assert (first_vector_component+spacedim-1 < fe_values.
fe->n_components(),
165 ExcIndexRange(first_vector_component+spacedim-1, 0,
166 fe_values.
fe->n_components()));
171 const std::vector<unsigned int> shape_function_to_row_table
172 = make_shape_function_to_row_table (*fe_values.
fe);
174 for (
unsigned int d=0; d<spacedim; ++d)
176 const unsigned int component = first_vector_component + d;
178 for (
unsigned int i=0; i<fe_values.
fe->dofs_per_cell; ++i)
180 const bool is_primitive = (fe_values.
fe->is_primitive() ||
181 fe_values.
fe->is_primitive(i));
183 if (is_primitive ==
true)
186 fe_values.
fe->system_to_component_index(i).first);
189 = (fe_values.
fe->get_nonzero_components(i)[component]
195 = shape_function_to_row_table[i*fe_values.
fe->n_components()+component];
202 for (
unsigned int i=0; i<fe_values.
fe->dofs_per_cell; ++i)
204 unsigned int n_nonzero_components = 0;
205 for (
unsigned int d=0; d<spacedim; ++d)
208 ++n_nonzero_components;
210 if (n_nonzero_components == 0)
212 else if (n_nonzero_components > 1)
216 for (
unsigned int d=0; d<spacedim; ++d)
231 template <
int dim,
int spacedim>
240 template <
int dim,
int spacedim>
245 Assert (
false, ExcInternalError());
250 template <
int dim,
int spacedim>
253 const unsigned int first_tensor_component)
255 fe_values(fe_values),
256 first_tensor_component(first_tensor_component),
259 Assert(first_tensor_component + (dim*dim+dim)/2 - 1
261 fe_values.
fe->n_components(),
262 ExcIndexRange(first_tensor_component +
265 fe_values.
fe->n_components()));
269 const std::vector<unsigned int> shape_function_to_row_table
270 = make_shape_function_to_row_table (*fe_values.
fe);
272 for (
unsigned int d = 0; d < ::SymmetricTensor<2,dim>::n_independent_components; ++d)
274 const unsigned int component = first_tensor_component + d;
276 for (
unsigned int i = 0; i < fe_values.
fe->dofs_per_cell; ++i)
278 const bool is_primitive = (fe_values.
fe->is_primitive() ||
279 fe_values.
fe->is_primitive(i));
281 if (is_primitive ==
true)
282 shape_function_data[i].is_nonzero_shape_function_component[d]
284 fe_values.
fe->system_to_component_index(i).first);
286 shape_function_data[i].is_nonzero_shape_function_component[d]
287 = (fe_values.
fe->get_nonzero_components(i)[component]
290 if (shape_function_data[i].is_nonzero_shape_function_component[d]
292 shape_function_data[i].row_index[d]
293 = shape_function_to_row_table[i*fe_values.
fe->n_components()+component];
295 shape_function_data[i].row_index[d]
300 for (
unsigned int i = 0; i < fe_values.
fe->dofs_per_cell; ++i)
302 unsigned int n_nonzero_components = 0;
303 for (
unsigned int d = 0; d < ::SymmetricTensor<2,dim>::n_independent_components; ++d)
304 if (shape_function_data[i].is_nonzero_shape_function_component[d]
306 ++n_nonzero_components;
308 if (n_nonzero_components == 0)
309 shape_function_data[i].single_nonzero_component = -2;
310 else if (n_nonzero_components > 1)
311 shape_function_data[i].single_nonzero_component = -1;
314 for (
unsigned int d = 0; d < ::SymmetricTensor<2,dim>::n_independent_components; ++d)
315 if (shape_function_data[i].is_nonzero_shape_function_component[d]
318 shape_function_data[i].single_nonzero_component
319 = shape_function_data[i].row_index[d];
320 shape_function_data[i].single_nonzero_component_index
330 template <
int dim,
int spacedim>
333 fe_values(*static_cast<::
FEValuesBase<dim, spacedim>*> (0)),
334 first_tensor_component(
numbers::invalid_unsigned_int)
339 template <
int dim,
int spacedim>
344 Assert(
false, ExcInternalError());
349 template <
int dim,
int spacedim>
352 const unsigned int first_tensor_component)
354 fe_values(fe_values),
355 first_tensor_component(first_tensor_component),
356 shape_function_data(fe_values.fe->dofs_per_cell)
358 Assert(first_tensor_component + dim*dim - 1
360 fe_values.
fe->n_components(),
361 ExcIndexRange(first_tensor_component +
364 fe_values.
fe->n_components()));
368 const std::vector<unsigned int> shape_function_to_row_table
369 = make_shape_function_to_row_table (*fe_values.
fe);
371 for (
unsigned int d = 0; d < dim*dim; ++d)
373 const unsigned int component = first_tensor_component + d;
375 for (
unsigned int i = 0; i < fe_values.
fe->dofs_per_cell; ++i)
377 const bool is_primitive = (fe_values.
fe->is_primitive() ||
378 fe_values.
fe->is_primitive(i));
380 if (is_primitive ==
true)
381 shape_function_data[i].is_nonzero_shape_function_component[d]
383 fe_values.
fe->system_to_component_index(i).first);
385 shape_function_data[i].is_nonzero_shape_function_component[d]
386 = (fe_values.
fe->get_nonzero_components(i)[component]
389 if (shape_function_data[i].is_nonzero_shape_function_component[d]
391 shape_function_data[i].row_index[d]
392 = shape_function_to_row_table[i*fe_values.
fe->n_components()+component];
394 shape_function_data[i].row_index[d]
399 for (
unsigned int i = 0; i < fe_values.
fe->dofs_per_cell; ++i)
401 unsigned int n_nonzero_components = 0;
402 for (
unsigned int d = 0; d < dim*dim; ++d)
403 if (shape_function_data[i].is_nonzero_shape_function_component[d]
405 ++n_nonzero_components;
407 if (n_nonzero_components == 0)
408 shape_function_data[i].single_nonzero_component = -2;
409 else if (n_nonzero_components > 1)
410 shape_function_data[i].single_nonzero_component = -1;
413 for (
unsigned int d = 0; d < dim*dim; ++d)
414 if (shape_function_data[i].is_nonzero_shape_function_component[d]
417 shape_function_data[i].single_nonzero_component
418 = shape_function_data[i].row_index[d];
419 shape_function_data[i].single_nonzero_component_index
429 template <
int dim,
int spacedim>
432 fe_values(*static_cast<::
FEValuesBase<dim, spacedim>*> (0)),
433 first_tensor_component(
numbers::invalid_unsigned_int)
438 template <
int dim,
int spacedim>
443 Assert(
false, ExcInternalError());
454 template <
int dim,
int spacedim,
typename Number>
456 do_function_values (const ::Vector<Number> &dof_values,
461 const unsigned int dofs_per_cell = dof_values.size();
462 const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
463 shape_values.n_cols() : values.
size();
466 std::fill (values.begin(), values.end(), Number());
468 for (
unsigned int shape_function=0;
469 shape_function<dofs_per_cell; ++shape_function)
470 if (shape_function_data[shape_function].is_nonzero_shape_function_component)
472 const Number value = dof_values(shape_function);
473 if (value == Number() )
476 const double *shape_value_ptr =
477 &shape_values(shape_function_data[shape_function].row_index, 0);
478 for (
unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
479 values[q_point] += value **shape_value_ptr++;
487 template <
int order,
int dim,
int spacedim,
typename Number>
489 do_function_derivatives (const ::Vector<Number> &dof_values,
490 const Table<2,::Tensor<order,spacedim> > &shape_derivatives,
492 std::vector<
typename ProductType<Number,::Tensor<order,spacedim> >::type> &derivatives)
494 const unsigned int dofs_per_cell = dof_values.size();
495 const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
496 shape_derivatives[0].size() : derivatives.size();
499 std::fill (derivatives.begin(), derivatives.end(),
502 for (
unsigned int shape_function=0;
503 shape_function<dofs_per_cell; ++shape_function)
504 if (shape_function_data[shape_function].is_nonzero_shape_function_component)
506 const Number value = dof_values(shape_function);
507 if (value == Number() )
510 const ::Tensor<order,spacedim> *shape_derivative_ptr =
511 &shape_derivatives[shape_function_data[shape_function].row_index][0];
512 for (
unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
513 derivatives[q_point] += value *
514 typename ProductType<Number,::Tensor<order,spacedim> >::type(*shape_derivative_ptr++);
520 template <
int dim,
int spacedim,
typename Number>
522 do_function_laplacians (const ::Vector<Number> &dof_values,
527 const unsigned int dofs_per_cell = dof_values.size();
528 const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
529 shape_hessians[0].size() : laplacians.size();
534 for (
unsigned int shape_function=0;
535 shape_function<dofs_per_cell; ++shape_function)
536 if (shape_function_data[shape_function].is_nonzero_shape_function_component)
538 const Number value = dof_values(shape_function);
539 if (value == Number())
542 const ::Tensor<2,spacedim> *shape_hessian_ptr =
543 &shape_hessians[shape_function_data[shape_function].row_index][0];
544 for (
unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
545 laplacians[q_point] += value * trace(*shape_hessian_ptr++);
553 template <
int dim,
int spacedim,
typename Number>
554 void do_function_values (const ::Vector<Number> &dof_values,
559 const unsigned int dofs_per_cell = dof_values.size();
560 const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
561 shape_values.n_cols() : values.
size();
566 for (
unsigned int shape_function=0;
567 shape_function<dofs_per_cell; ++shape_function)
569 const int snc = shape_function_data[shape_function].single_nonzero_component;
575 const Number value = dof_values(shape_function);
576 if (value == Number())
581 const unsigned int comp =
582 shape_function_data[shape_function].single_nonzero_component_index;
583 const double *shape_value_ptr = &shape_values(snc,0);
584 for (
unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
585 values[q_point][comp] += value **shape_value_ptr++;
588 for (
unsigned int d=0; d<spacedim; ++d)
589 if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
591 const double *shape_value_ptr =
592 &shape_values(shape_function_data[shape_function].row_index[d],0);
593 for (
unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
594 values[q_point][d] += value **shape_value_ptr++;
601 template <
int order,
int dim,
int spacedim,
typename Number>
603 do_function_derivatives (const ::Vector<Number> &dof_values,
604 const Table<2,::Tensor<order,spacedim> > &shape_derivatives,
606 std::vector<
typename ProductType<Number,::Tensor<order+1,spacedim> >::type> &derivatives)
608 const unsigned int dofs_per_cell = dof_values.size();
609 const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
610 shape_derivatives[0].size() : derivatives.size();
613 std::fill (derivatives.begin(), derivatives.end(),
616 for (
unsigned int shape_function=0;
617 shape_function<dofs_per_cell; ++shape_function)
619 const int snc = shape_function_data[shape_function].single_nonzero_component;
625 const Number value = dof_values(shape_function);
626 if (value == Number())
631 const unsigned int comp =
632 shape_function_data[shape_function].single_nonzero_component_index;
633 const ::Tensor<order,spacedim> *shape_derivative_ptr =
634 &shape_derivatives[snc][0];
635 for (
unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
636 derivatives[q_point][comp] += value *
637 typename ProductType<Number,::Tensor<order,spacedim> >::type(*shape_derivative_ptr++);
640 for (
unsigned int d=0; d<spacedim; ++d)
641 if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
643 const ::Tensor<order,spacedim> *shape_derivative_ptr =
644 &shape_derivatives[shape_function_data[shape_function].
646 for (
unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
647 derivatives[q_point][d] += value *
648 typename ProductType<Number,::Tensor<order,spacedim> >::type(*shape_derivative_ptr++);
655 template <
int dim,
int spacedim,
typename Number>
657 do_function_symmetric_gradients (const ::Vector<Number> &dof_values,
660 std::vector<
typename ProductType<Number,::SymmetricTensor<2,spacedim> >::type> &symmetric_gradients)
662 const unsigned int dofs_per_cell = dof_values.size();
663 const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
664 shape_gradients[0].size() : symmetric_gradients.size();
667 std::fill (symmetric_gradients.begin(), symmetric_gradients.end(),
670 for (
unsigned int shape_function=0;
671 shape_function<dofs_per_cell; ++shape_function)
673 const int snc = shape_function_data[shape_function].single_nonzero_component;
679 const Number value = dof_values(shape_function);
680 if (value == Number())
685 const unsigned int comp =
686 shape_function_data[shape_function].single_nonzero_component_index;
687 const ::Tensor<1,spacedim> *shape_gradient_ptr =
688 &shape_gradients[snc][0];
689 for (
unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
690 symmetric_gradients[q_point] += value *
691 typename ProductType<Number,::SymmetricTensor<2,spacedim> >::type (symmetrize_single_row(comp, *shape_gradient_ptr++));
694 for (
unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
697 for (
unsigned int d=0; d<spacedim; ++d)
698 if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
700 shape_gradients[shape_function_data[shape_function].row_index[d]][q_point];
701 symmetric_gradients[q_point] += symmetrize(grad);
708 template <
int dim,
int spacedim,
typename Number>
710 do_function_divergences (const ::Vector<Number> &dof_values,
715 const unsigned int dofs_per_cell = dof_values.size();
716 const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
717 shape_gradients[0].size() : divergences.size();
722 for (
unsigned int shape_function=0;
723 shape_function<dofs_per_cell; ++shape_function)
725 const int snc = shape_function_data[shape_function].single_nonzero_component;
731 const Number value = dof_values(shape_function);
732 if (value == Number())
737 const unsigned int comp =
738 shape_function_data[shape_function].single_nonzero_component_index;
739 const ::Tensor<1,spacedim> *shape_gradient_ptr = &shape_gradients[snc][0];
740 for (
unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
741 divergences[q_point] += value * (*shape_gradient_ptr++)[comp];
744 for (
unsigned int d=0; d<spacedim; ++d)
745 if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
747 const ::Tensor<1,spacedim> *shape_gradient_ptr =
748 &shape_gradients[shape_function_data[shape_function].
750 for (
unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
751 divergences[q_point] += value * (*shape_gradient_ptr++)[d];
758 template <
int dim,
int spacedim,
typename Number>
760 do_function_curls (const ::Vector<Number> &dof_values,
763 std::vector<
typename ProductType<Number,typename ::internal::CurlType<spacedim>::type>::type> &curls)
765 const unsigned int dofs_per_cell = dof_values.size();
766 const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
767 shape_gradients[0].size() : curls.size();
776 Assert (
false,
ExcMessage(
"Computing the curl in 1d is not a useful operation"));
782 for (
unsigned int shape_function = 0;
783 shape_function < dofs_per_cell; ++shape_function)
785 const int snc = shape_function_data[shape_function].single_nonzero_component;
791 const Number value = dof_values (shape_function);
793 if (value == Number())
798 const ::Tensor<1, spacedim> *shape_gradient_ptr =
799 &shape_gradients[snc][0];
801 Assert (shape_function_data[shape_function].single_nonzero_component >= 0,
804 if (shape_function_data[shape_function].single_nonzero_component_index == 0)
805 for (
unsigned int q_point = 0;
806 q_point < n_quadrature_points; ++q_point)
807 curls[q_point][0] -= value * (*shape_gradient_ptr++)[1];
809 for (
unsigned int q_point = 0;
810 q_point < n_quadrature_points; ++q_point)
811 curls[q_point][0] += value * (*shape_gradient_ptr++)[0];
818 if (shape_function_data[shape_function].is_nonzero_shape_function_component[0])
820 const ::Tensor<1,spacedim> *shape_gradient_ptr =
821 &shape_gradients[shape_function_data[shape_function].row_index[0]][0];
823 for (
unsigned int q_point = 0; q_point < n_quadrature_points; ++q_point)
824 curls[q_point][0] -= value * (*shape_gradient_ptr++)[1];
827 if (shape_function_data[shape_function].is_nonzero_shape_function_component[1])
829 const ::Tensor<1,spacedim> *shape_gradient_ptr =
830 &shape_gradients[shape_function_data[shape_function].row_index[1]][0];
832 for (
unsigned int q_point = 0; q_point < n_quadrature_points; ++q_point)
833 curls[q_point][0] += value * (*shape_gradient_ptr++)[0];
842 for (
unsigned int shape_function = 0;
843 shape_function < dofs_per_cell; ++shape_function)
845 const int snc = shape_function_data[shape_function].single_nonzero_component;
851 const Number value = dof_values (shape_function);
853 if (value == Number())
858 const ::Tensor<1, spacedim> *shape_gradient_ptr = &shape_gradients[snc][0];
860 switch (shape_function_data[shape_function].single_nonzero_component_index)
864 for (
unsigned int q_point = 0;
865 q_point < n_quadrature_points; ++q_point)
867 curls[q_point][1] += value * (*shape_gradient_ptr)[2];
868 curls[q_point][2] -= value * (*shape_gradient_ptr++)[1];
876 for (
unsigned int q_point = 0;
877 q_point < n_quadrature_points; ++q_point)
879 curls[q_point][0] -= value * (*shape_gradient_ptr)[2];
880 curls[q_point][2] += value * (*shape_gradient_ptr++)[0];
888 for (
unsigned int q_point = 0;
889 q_point < n_quadrature_points; ++q_point)
891 curls[q_point][0] += value * (*shape_gradient_ptr)[1];
892 curls[q_point][1] -= value * (*shape_gradient_ptr++)[0];
898 Assert (
false, ExcInternalError());
907 if (shape_function_data[shape_function].is_nonzero_shape_function_component[0])
909 const ::Tensor<1,spacedim> *shape_gradient_ptr =
910 &shape_gradients[shape_function_data[shape_function].row_index[0]][0];
912 for (
unsigned int q_point = 0; q_point < n_quadrature_points; ++q_point)
914 curls[q_point][1] += value * (*shape_gradient_ptr)[2];
915 curls[q_point][2] -= value * (*shape_gradient_ptr++)[1];
919 if (shape_function_data[shape_function].is_nonzero_shape_function_component[1])
921 const ::Tensor<1,spacedim> *shape_gradient_ptr =
922 &shape_gradients[shape_function_data[shape_function].row_index[1]][0];
924 for (
unsigned int q_point = 0; q_point < n_quadrature_points; ++q_point)
926 curls[q_point][0] -= value * (*shape_gradient_ptr)[2];
927 curls[q_point][2] += value * (*shape_gradient_ptr++)[0];
931 if (shape_function_data[shape_function].is_nonzero_shape_function_component[2])
933 const ::Tensor<1,spacedim> *shape_gradient_ptr =
934 &shape_gradients[shape_function_data[shape_function].row_index[2]][0];
936 for (
unsigned int q_point = 0; q_point < n_quadrature_points; ++q_point)
938 curls[q_point][0] += value * (*shape_gradient_ptr)[1];
939 curls[q_point][1] -= value * (*shape_gradient_ptr++)[0];
950 template <
int dim,
int spacedim,
typename Number>
952 do_function_laplacians (const ::Vector<Number> &dof_values,
957 const unsigned int dofs_per_cell = dof_values.size();
958 const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
959 shape_hessians[0].size() : laplacians.size();
962 std::fill (laplacians.begin(), laplacians.end(),
965 for (
unsigned int shape_function=0;
966 shape_function<dofs_per_cell; ++shape_function)
968 const int snc = shape_function_data[shape_function].single_nonzero_component;
974 const Number value = dof_values(shape_function);
975 if (value == Number())
980 const unsigned int comp =
981 shape_function_data[shape_function].single_nonzero_component_index;
982 const ::Tensor<2,spacedim> *shape_hessian_ptr =
983 &shape_hessians[snc][0];
984 for (
unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
985 laplacians[q_point][comp] += value * trace(*shape_hessian_ptr++);
988 for (
unsigned int d=0; d<spacedim; ++d)
989 if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
991 const ::Tensor<2,spacedim> *shape_hessian_ptr =
992 &shape_hessians[shape_function_data[shape_function].
994 for (
unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
995 laplacians[q_point][d] += value * trace(*shape_hessian_ptr++);
1004 template <
int dim,
int spacedim,
typename Number>
1006 do_function_values (const ::Vector<Number> &dof_values,
1007 const ::Table<2,double> &shape_values,
1008 const std::vector<
typename SymmetricTensor<2,dim,spacedim>::ShapeFunctionData> &shape_function_data,
1009 std::vector<
typename ProductType<Number,::SymmetricTensor<2,spacedim> >::type> &values)
1011 const unsigned int dofs_per_cell = dof_values.size();
1012 const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
1013 shape_values.n_cols() : values.size();
1016 std::fill (values.begin(), values.end(),
1019 for (
unsigned int shape_function=0;
1020 shape_function<dofs_per_cell; ++shape_function)
1022 const int snc = shape_function_data[shape_function].single_nonzero_component;
1028 const Number value = dof_values(shape_function);
1029 if (value == Number())
1036 (shape_function_data[shape_function].single_nonzero_component_index);
1037 const double *shape_value_ptr = &shape_values(snc,0);
1038 for (
unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
1039 values[q_point][comp] += value **shape_value_ptr++;
1042 for (
unsigned int d=0;
1043 d<::SymmetricTensor<2,spacedim>::n_independent_components; ++d)
1044 if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
1048 const double *shape_value_ptr =
1049 &shape_values(shape_function_data[shape_function].row_index[d],0);
1050 for (
unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
1051 values[q_point][comp] += value **shape_value_ptr++;
1058 template <
int dim,
int spacedim,
typename Number>
1060 do_function_divergences (const ::Vector<Number> &dof_values,
1062 const std::vector<
typename SymmetricTensor<2,dim,spacedim>::ShapeFunctionData> &shape_function_data,
1065 const unsigned int dofs_per_cell = dof_values.size();
1066 const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
1067 shape_gradients[0].size() : divergences.size();
1070 std::fill (divergences.begin(), divergences.end(),
1073 for (
unsigned int shape_function=0;
1074 shape_function<dofs_per_cell; ++shape_function)
1076 const int snc = shape_function_data[shape_function].single_nonzero_component;
1082 const Number value = dof_values(shape_function);
1083 if (value == Number())
1088 const unsigned int comp =
1089 shape_function_data[shape_function].single_nonzero_component_index;
1091 const ::Tensor < 1, spacedim> *shape_gradient_ptr =
1092 &shape_gradients[snc][0];
1099 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1100 ++q_point, ++shape_gradient_ptr)
1102 divergences[q_point][ii] += value * (*shape_gradient_ptr)[jj];
1105 divergences[q_point][jj] += value * (*shape_gradient_ptr)[ii];
1110 for (
unsigned int d = 0;
1111 d < ::SymmetricTensor<2,spacedim>::n_independent_components; ++d)
1112 if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
1114 Assert (
false, ExcNotImplemented());
1124 const unsigned int comp =
1125 shape_function_data[shape_function].single_nonzero_component_index;
1127 const ::Tensor < 1, spacedim> *shape_gradient_ptr =
1128 &shape_gradients[shape_function_data[shape_function].
1130 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1131 ++q_point, ++shape_gradient_ptr)
1133 for (
unsigned int j = 0; j < spacedim; ++j)
1136 divergences[q_point][vector_component] += value * (*shape_gradient_ptr++)[j];
1146 template <
int dim,
int spacedim,
typename Number>
1148 do_function_values (const ::Vector<Number> &dof_values,
1149 const ::Table<2,double> &shape_values,
1150 const std::vector<
typename Tensor<2,dim,spacedim>::ShapeFunctionData> &shape_function_data,
1153 const unsigned int dofs_per_cell = dof_values.size();
1154 const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
1155 shape_values.n_cols() : values.size();
1158 std::fill (values.begin(), values.end(),
1161 for (
unsigned int shape_function=0;
1162 shape_function<dofs_per_cell; ++shape_function)
1164 const int snc = shape_function_data[shape_function].single_nonzero_component;
1170 const Number value = dof_values(shape_function);
1171 if (value == Number())
1176 const unsigned int comp =
1177 shape_function_data[shape_function].single_nonzero_component_index;
1181 const double *shape_value_ptr = &shape_values(snc,0);
1182 for (
unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
1183 values[q_point][indices] += value **shape_value_ptr++;
1186 for (
unsigned int d=0;
1188 if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
1192 const double *shape_value_ptr =
1193 &shape_values(shape_function_data[shape_function].row_index[d],0);
1194 for (
unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
1195 values[q_point][indices] += value **shape_value_ptr++;
1202 template <
int dim,
int spacedim,
typename Number>
1204 do_function_divergences (const ::Vector<Number> &dof_values,
1206 const std::vector<
typename Tensor<2,dim,spacedim>::ShapeFunctionData> &shape_function_data,
1209 const unsigned int dofs_per_cell = dof_values.size();
1210 const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
1211 shape_gradients[0].size() : divergences.size();
1214 std::fill (divergences.begin(), divergences.end(),
1217 for (
unsigned int shape_function=0;
1218 shape_function<dofs_per_cell; ++shape_function)
1220 const int snc = shape_function_data[shape_function].single_nonzero_component;
1226 const Number value = dof_values(shape_function);
1227 if (value == Number())
1232 const unsigned int comp =
1233 shape_function_data[shape_function].single_nonzero_component_index;
1235 const ::Tensor < 1, spacedim> *shape_gradient_ptr =
1236 &shape_gradients[snc][0];
1239 const unsigned int ii = indices[0];
1240 const unsigned int jj = indices[1];
1242 for (
unsigned int q_point = 0; q_point < n_quadrature_points;
1243 ++q_point, ++shape_gradient_ptr)
1245 divergences[q_point][jj] += value * (*shape_gradient_ptr)[ii];
1250 for (
unsigned int d = 0;
1252 if (shape_function_data[shape_function].is_nonzero_shape_function_component[d])
1254 Assert (
false, ExcNotImplemented());
1264 template <
int dim,
int spacedim>
1265 template <
class InputVector>
1273 typename FVB::ExcAccessToUninitializedField(
"update_values"));
1274 Assert (fe_values.present_cell.get() != 0,
1275 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
1277 fe_values.present_cell->n_dofs_for_dof_handler());
1281 fe_values.present_cell->get_interpolated_dof_values(fe_function, dof_values);
1282 internal::do_function_values<dim,spacedim>
1283 (dof_values, fe_values.finite_element_output.shape_values, shape_function_data, values);
1288 template <
int dim,
int spacedim>
1289 template <
class InputVector>
1297 typename FVB::ExcAccessToUninitializedField(
"update_gradients"));
1298 Assert (fe_values.present_cell.get() != 0,
1299 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
1301 fe_values.present_cell->n_dofs_for_dof_handler());
1305 fe_values.present_cell->get_interpolated_dof_values(fe_function, dof_values);
1306 internal::do_function_derivatives<1,dim,spacedim>
1307 (dof_values, fe_values.finite_element_output.shape_gradients, shape_function_data, gradients);
1312 template <
int dim,
int spacedim>
1313 template <
class InputVector>
1321 typename FVB::ExcAccessToUninitializedField(
"update_hessians"));
1322 Assert (fe_values.present_cell.get() != 0,
1323 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
1325 fe_values.present_cell->n_dofs_for_dof_handler());
1329 fe_values.present_cell->get_interpolated_dof_values(fe_function, dof_values);
1330 internal::do_function_derivatives<2,dim,spacedim>
1331 (dof_values, fe_values.finite_element_output.shape_hessians, shape_function_data, hessians);
1336 template <
int dim,
int spacedim>
1337 template <
class InputVector>
1345 typename FVB::ExcAccessToUninitializedField(
"update_hessians"));
1346 Assert (fe_values.present_cell.get() != 0,
1347 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
1349 fe_values.present_cell->n_dofs_for_dof_handler());
1353 fe_values.present_cell->get_interpolated_dof_values(fe_function, dof_values);
1354 internal::do_function_laplacians<dim,spacedim>
1355 (dof_values, fe_values.finite_element_output.shape_hessians, shape_function_data, laplacians);
1360 template <
int dim,
int spacedim>
1361 template <
class InputVector>
1369 typename FVB::ExcAccessToUninitializedField(
"update_3rd_derivatives"));
1370 Assert (fe_values.present_cell.get() != 0,
1371 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
1373 fe_values.present_cell->n_dofs_for_dof_handler());
1377 fe_values.present_cell->get_interpolated_dof_values(fe_function, dof_values);
1378 internal::do_function_derivatives<3,dim,spacedim>
1379 (dof_values, fe_values.finite_element_output.shape_3rd_derivatives, shape_function_data, third_derivatives);
1384 template <
int dim,
int spacedim>
1385 template <
class InputVector>
1393 typename FVB::ExcAccessToUninitializedField(
"update_values"));
1394 Assert (fe_values.present_cell.get() != 0,
1395 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
1397 fe_values.present_cell->n_dofs_for_dof_handler());
1401 fe_values.present_cell->get_interpolated_dof_values(fe_function, dof_values);
1402 internal::do_function_values<dim,spacedim>
1403 (dof_values, fe_values.finite_element_output.shape_values, shape_function_data, values);
1409 template <
int dim,
int spacedim>
1410 template <
class InputVector>
1418 typename FVB::ExcAccessToUninitializedField(
"update_gradients"));
1419 Assert (fe_values.present_cell.get() != 0,
1420 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
1422 fe_values.present_cell->n_dofs_for_dof_handler());
1426 fe_values.present_cell->get_interpolated_dof_values(fe_function, dof_values);
1427 internal::do_function_derivatives<1,dim,spacedim>
1428 (dof_values, fe_values.finite_element_output.shape_gradients, shape_function_data, gradients);
1433 template <
int dim,
int spacedim>
1434 template <
class InputVector>
1442 typename FVB::ExcAccessToUninitializedField(
"update_gradients"));
1443 Assert (fe_values.present_cell.get() != 0,
1444 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
1446 fe_values.present_cell->n_dofs_for_dof_handler());
1450 fe_values.present_cell->get_interpolated_dof_values(fe_function, dof_values);
1451 internal::do_function_symmetric_gradients<dim,spacedim>
1452 (dof_values, fe_values.finite_element_output.shape_gradients, shape_function_data,
1453 symmetric_gradients);
1458 template <
int dim,
int spacedim>
1459 template <
class InputVector>
1467 typename FVB::ExcAccessToUninitializedField(
"update_gradients"));
1468 Assert (fe_values.present_cell.get() != 0,
1469 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
1471 fe_values.present_cell->n_dofs_for_dof_handler());
1476 fe_values.present_cell->get_interpolated_dof_values(fe_function, dof_values);
1477 internal::do_function_divergences<dim,spacedim>
1478 (dof_values, fe_values.finite_element_output.shape_gradients, shape_function_data, divergences);
1481 template <
int dim,
int spacedim>
1482 template <
class InputVector>
1491 typename FVB::ExcAccessToUninitializedField(
"update_gradients"));
1492 Assert (fe_values.present_cell.get () != 0,
1493 ExcMessage (
"FEValues object is not reinited to any cell"));
1495 fe_values.present_cell->n_dofs_for_dof_handler ());
1499 fe_values.present_cell->get_interpolated_dof_values (fe_function, dof_values);
1500 internal::do_function_curls<dim,spacedim>
1501 (dof_values, fe_values.finite_element_output.shape_gradients, shape_function_data, curls);
1505 template <
int dim,
int spacedim>
1506 template <
class InputVector>
1514 typename FVB::ExcAccessToUninitializedField(
"update_hessians"));
1515 Assert (fe_values.present_cell.get() != 0,
1516 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
1518 fe_values.present_cell->n_dofs_for_dof_handler());
1522 fe_values.present_cell->get_interpolated_dof_values(fe_function, dof_values);
1523 internal::do_function_derivatives<2,dim,spacedim>
1524 (dof_values, fe_values.finite_element_output.shape_hessians, shape_function_data, hessians);
1529 template <
int dim,
int spacedim>
1530 template <
class InputVector>
1538 typename FVB::ExcAccessToUninitializedField(
"update_hessians"));
1539 Assert (laplacians.size() == fe_values.n_quadrature_points,
1540 ExcDimensionMismatch(laplacians.size(), fe_values.n_quadrature_points));
1541 Assert (fe_values.present_cell.get() != 0,
1542 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
1543 Assert (fe_function.size() == fe_values.present_cell->n_dofs_for_dof_handler(),
1544 ExcDimensionMismatch(fe_function.size(),
1545 fe_values.present_cell->n_dofs_for_dof_handler()));
1549 fe_values.present_cell->get_interpolated_dof_values(fe_function, dof_values);
1550 internal::do_function_laplacians<dim,spacedim>
1551 (dof_values, fe_values.finite_element_output.shape_hessians, shape_function_data, laplacians);
1555 template <
int dim,
int spacedim>
1556 template <
class InputVector>
1564 typename FVB::ExcAccessToUninitializedField(
"update_3rd_derivatives"));
1565 Assert (fe_values.present_cell.get() != 0,
1566 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
1568 fe_values.present_cell->n_dofs_for_dof_handler());
1572 fe_values.present_cell->get_interpolated_dof_values(fe_function, dof_values);
1573 internal::do_function_derivatives<3,dim,spacedim>
1574 (dof_values, fe_values.finite_element_output.shape_3rd_derivatives, shape_function_data, third_derivatives);
1579 template <
int dim,
int spacedim>
1580 template <
class InputVector>
1582 SymmetricTensor<2, dim, spacedim>::
1583 get_function_values(
const InputVector &fe_function,
1588 typename FVB::ExcAccessToUninitializedField(
"update_values"));
1589 Assert(fe_values.present_cell.get() != 0,
1590 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1592 fe_values.present_cell->n_dofs_for_dof_handler());
1596 fe_values.present_cell->get_interpolated_dof_values(fe_function, dof_values);
1597 internal::do_function_values<dim,spacedim>
1598 (dof_values, fe_values.finite_element_output.shape_values, shape_function_data, values);
1603 template <
int dim,
int spacedim>
1604 template <
class InputVector>
1606 SymmetricTensor<2, dim, spacedim>::
1607 get_function_divergences(
const InputVector &fe_function,
1612 typename FVB::ExcAccessToUninitializedField(
"update_gradients"));
1613 Assert(fe_values.present_cell.get() != 0,
1614 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1616 fe_values.present_cell->n_dofs_for_dof_handler());
1621 fe_values.present_cell->get_interpolated_dof_values(fe_function, dof_values);
1622 internal::do_function_divergences<dim,spacedim>
1623 (dof_values, fe_values.finite_element_output.shape_gradients, shape_function_data, divergences);
1626 template <
int dim,
int spacedim>
1627 template <
class InputVector>
1629 Tensor<2, dim, spacedim>::
1630 get_function_values(
const InputVector &fe_function,
1635 typename FVB::ExcAccessToUninitializedField(
"update_values"));
1636 Assert(fe_values.present_cell.get() != 0,
1637 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1639 fe_values.present_cell->n_dofs_for_dof_handler());
1643 fe_values.present_cell->get_interpolated_dof_values(fe_function, dof_values);
1644 internal::do_function_values<dim,spacedim>
1645 (dof_values, fe_values.finite_element_output.shape_values, shape_function_data, values);
1650 template <
int dim,
int spacedim>
1651 template <
class InputVector>
1653 Tensor<2, dim, spacedim>::
1654 get_function_divergences(
const InputVector &fe_function,
1659 typename FVB::ExcAccessToUninitializedField(
"update_gradients"));
1660 Assert(fe_values.present_cell.get() != 0,
1661 ExcMessage(
"FEValues object is not reinit'ed to any cell"));
1663 fe_values.present_cell->n_dofs_for_dof_handler());
1668 fe_values.present_cell->get_interpolated_dof_values(fe_function, dof_values);
1669 internal::do_function_divergences<dim,spacedim>
1670 (dof_values, fe_values.finite_element_output.shape_gradients, shape_function_data, divergences);
1679 template <
int dim,
int spacedim>
1693 scalars.resize (n_scalars);
1694 for (
unsigned int component=0; component<n_scalars; ++component)
1697 typedef ::FEValuesViews::Scalar<dim,spacedim> ScalarView;
1698 scalars[component].ScalarView::~ScalarView ();
1700 new (&scalars[component])
1712 const unsigned int n_vectors = (fe.
n_components() >= spacedim ?
1715 vectors.resize (n_vectors);
1716 for (
unsigned int component=0; component<n_vectors; ++component)
1719 typedef ::FEValuesViews::Vector<dim,spacedim>
VectorView;
1720 vectors[component].VectorView::~VectorView ();
1722 new (&vectors[component])
1729 const unsigned int n_symmetric_second_order_tensors
1733 symmetric_second_order_tensors.resize(n_symmetric_second_order_tensors);
1734 for (
unsigned int component = 0; component < n_symmetric_second_order_tensors; ++component)
1737 typedef ::FEValuesViews::SymmetricTensor<2, dim, spacedim> SymmetricTensorView;
1738 symmetric_second_order_tensors[component].SymmetricTensorView::~SymmetricTensorView();
1740 new (&symmetric_second_order_tensors[component])
1748 const unsigned int n_second_order_tensors
1752 second_order_tensors.resize(n_second_order_tensors);
1753 for (
unsigned int component = 0; component < n_second_order_tensors; ++component)
1756 typedef ::FEValuesViews::Tensor<2, dim, spacedim> TensorView;
1757 second_order_tensors[component].TensorView::~TensorView();
1759 new (&second_order_tensors[component])
1770 template <
int dim,
int spacedim>
1780 virtual ~CellIteratorBase ();
1807 n_dofs_for_dof_handler ()
const = 0;
1809 #include "fe_values.decl.1.inst" 1817 get_interpolated_dof_values (
const IndexSet &in,
1822 template <
int dim,
int spacedim>
1839 template <
int dim,
int spacedim>
1840 template <
typename CI>
1849 CellIterator (
const CI &cell);
1876 n_dofs_for_dof_handler ()
const;
1878 #include "fe_values.decl.2.inst" 1886 get_interpolated_dof_values (
const IndexSet &in,
1941 template <
int dim,
int spacedim>
1979 n_dofs_for_dof_handler ()
const;
1981 #include "fe_values.decl.2.inst" 1989 get_interpolated_dof_values (
const IndexSet &in,
2017 template <
int dim,
int spacedim>
2018 template <
typename CI>
2026 template <
int dim,
int spacedim>
2027 template <
typename CI>
2036 template <
int dim,
int spacedim>
2037 template <
typename CI>
2041 return cell->get_dof_handler().n_dofs();
2046 #include "fe_values.impl.1.inst" 2049 template <
int dim,
int spacedim>
2050 template <
typename CI>
2056 Assert (
cell->has_children() ==
false, ExcNotImplemented());
2058 std::vector<types::global_dof_index> dof_indices (
cell->get_fe().dofs_per_cell);
2059 cell->get_dof_indices (dof_indices);
2061 for (
unsigned int i=0; i<
cell->get_fe().dofs_per_cell; ++i)
2062 out[i] = (in.
is_element (dof_indices[i]) ? 1 : 0);
2068 template <
int dim,
int spacedim>
2071 = (
"You have previously called the FEValues::reinit function with a\n" 2072 "cell iterator of type Triangulation<dim,spacedim>::cell_iterator. However,\n" 2073 "when you do this, you cannot call some functions in the FEValues\n" 2074 "class, such as the get_function_values/gradients/hessians/third_derivatives\n" 2075 "functions. If you need these functions, then you need to call\n" 2076 "FEValues::reinit with an iterator type that allows to extract\n" 2077 "degrees of freedom, such as DoFHandler<dim,spacedim>::cell_iterator.");
2080 template <
int dim,
int spacedim>
2089 template <
int dim,
int spacedim>
2098 template <
int dim,
int spacedim>
2107 #include "fe_values.impl.2.inst" 2110 template <
int dim,
int spacedim>
2125 template <
int dim,
int spacedim>
2131 this->quadrature_points.resize(n_quadrature_points,
2135 this->JxW_values.resize(n_quadrature_points,
2136 numbers::signaling_nan<double>());
2139 this->jacobians.resize(n_quadrature_points,
2143 this->jacobian_grads.resize(n_quadrature_points,
2147 this->jacobian_pushed_forward_grads.resize(n_quadrature_points,
2151 this->jacobian_2nd_derivatives.resize(n_quadrature_points,
2155 this->jacobian_pushed_forward_2nd_derivatives.resize(n_quadrature_points,
2159 this->jacobian_3rd_derivatives.resize(n_quadrature_points);
2162 this->jacobian_pushed_forward_3rd_derivatives.resize(n_quadrature_points,
2166 this->inverse_jacobians.resize(n_quadrature_points,
2170 this->boundary_forms.resize(n_quadrature_points,
2174 this->normal_vectors.resize(n_quadrature_points,
2180 template <
int dim,
int spacedim>
2201 template <
int dim,
int spacedim>
2210 this->shape_function_to_row_table
2211 = make_shape_function_to_row_table (fe);
2215 unsigned int n_nonzero_shape_components = 0;
2219 ExcInternalError());
2227 this->shape_values.reinit(n_nonzero_shape_components,
2228 n_quadrature_points);
2229 this->shape_values.fill(numbers::signaling_nan<double>());
2234 this->shape_gradients.reinit(n_nonzero_shape_components,
2235 n_quadrature_points);
2241 this->shape_hessians.reinit(n_nonzero_shape_components,
2242 n_quadrature_points);
2248 this->shape_3rd_derivatives.reinit(n_nonzero_shape_components,
2249 n_quadrature_points);
2257 template <
int dim,
int spacedim>
2275 template <
int dim,
int spacedim>
2283 dofs_per_cell (dofs_per_cell),
2284 mapping(&mapping, typeid(*this).name()),
2285 fe(&fe, typeid(*this).name()),
2289 ExcMessage (
"There is nothing useful you can do with an FEValues " 2290 "object when using a quadrature formula with zero " 2291 "quadrature points!"));
2297 template <
int dim,
int spacedim>
2314 template <
typename Number,
typename Number2>
2316 do_function_values (
const Number2 *dof_values_ptr,
2317 const ::Table<2,double> &shape_values,
2318 std::vector<Number> &values)
2323 shape_values.n_cols() : values.size();
2336 for (
unsigned int shape_func=0; shape_func<
dofs_per_cell; ++shape_func)
2338 const Number2 value = dof_values_ptr[shape_func];
2339 if (value == Number2())
2342 const double *shape_value_ptr = &shape_values(shape_func, 0);
2344 values[point] += value **shape_value_ptr++;
2348 template <
int dim,
int spacedim,
typename VectorType,
typename Number>
2350 do_function_values (
const Number *dof_values_ptr,
2351 const ::Table<2,double> &shape_values,
2353 const std::vector<unsigned int> &shape_function_to_row_table,
2355 const bool quadrature_points_fastest =
false,
2356 const unsigned int component_multiple = 1)
2359 for (
unsigned int i=0; i<values.size(); ++i)
2360 std::fill_n (values[i].begin(), values[i].size(),
2361 typename VectorType::value_type());
2366 if (dofs_per_cell == 0)
2373 const unsigned result_components = n_components * component_multiple;
2374 (void)result_components;
2375 if (quadrature_points_fastest)
2378 for (
unsigned int i=0; i<values.size(); ++i)
2384 for (
unsigned int i=0; i<values.size(); ++i)
2391 for (
unsigned int mc = 0; mc < component_multiple; ++mc)
2392 for (
unsigned int shape_func=0; shape_func<
dofs_per_cell; ++shape_func)
2394 const Number value = dof_values_ptr[shape_func+mc*
dofs_per_cell];
2395 if (value == Number())
2400 const unsigned int comp =
2402 + mc * n_components;
2404 row = shape_function_to_row_table[shape_func*n_components+comp];
2406 const double *shape_value_ptr = &shape_values(row, 0);
2408 if (quadrature_points_fastest)
2410 VectorType &values_comp = values[comp];
2412 values_comp[point] += value **shape_value_ptr++;
2416 values[point][comp] += value **shape_value_ptr++;
2419 for (
unsigned int c=0; c<n_components; ++c)
2425 row = shape_function_to_row_table[shape_func*n_components+c];
2427 const double *shape_value_ptr = &shape_values(row, 0);
2428 const unsigned int comp = c + mc * n_components;
2430 if (quadrature_points_fastest)
2432 VectorType &values_comp = values[comp];
2435 values_comp[point] += value **shape_value_ptr++;
2439 values[point][comp] += value **shape_value_ptr++;
2446 template <
int order,
int spacedim,
typename Number>
2448 do_function_derivatives (
const Number *dof_values_ptr,
2452 const unsigned int dofs_per_cell = shape_derivatives.size()[0];
2454 shape_derivatives[0].size() : derivatives.size();
2467 for (
unsigned int shape_func=0; shape_func<
dofs_per_cell; ++shape_func)
2469 const Number value = dof_values_ptr[shape_func];
2470 if (value == Number())
2474 = &shape_derivatives[shape_func][0];
2476 derivatives[point] += value *
2481 template <
int order,
int dim,
int spacedim,
typename Number>
2483 do_function_derivatives (
const Number *dof_values_ptr,
2486 const std::vector<unsigned int> &shape_function_to_row_table,
2488 const bool quadrature_points_fastest =
false,
2489 const unsigned int component_multiple = 1)
2492 for (
unsigned int i=0; i<derivatives.size(); ++i)
2493 std::fill_n (derivatives[i].begin(), derivatives[i].size(),
2499 if (dofs_per_cell == 0)
2507 const unsigned result_components = n_components * component_multiple;
2508 (void)result_components;
2509 if (quadrature_points_fastest)
2512 for (
unsigned int i=0; i<derivatives.size(); ++i)
2518 for (
unsigned int i=0; i<derivatives.size(); ++i)
2525 for (
unsigned int mc = 0; mc < component_multiple; ++mc)
2526 for (
unsigned int shape_func=0; shape_func<
dofs_per_cell; ++shape_func)
2528 const Number value = dof_values_ptr[shape_func+mc*
dofs_per_cell];
2529 if (value == Number())
2534 const unsigned int comp =
2536 + mc * n_components;
2538 row = shape_function_to_row_table[shape_func*n_components+comp];
2541 &shape_derivatives[row][0];
2543 if (quadrature_points_fastest)
2545 derivatives[comp][point] += value *
2549 derivatives[point][comp] += value *
2553 for (
unsigned int c=0; c<n_components; ++c)
2559 row = shape_function_to_row_table[shape_func*n_components+c];
2562 &shape_derivatives[row][0];
2563 const unsigned int comp = c + mc * n_components;
2565 if (quadrature_points_fastest)
2567 derivatives[comp][point] += value *
2571 derivatives[point][comp] += value *
2577 template <
int spacedim,
typename Number,
typename Number2>
2579 do_function_laplacians (
const Number2 *dof_values_ptr,
2581 std::vector<Number> &laplacians)
2583 const unsigned int dofs_per_cell = shape_hessians.size()[0];
2585 shape_hessians[0].size() : laplacians.size();
2594 for (
unsigned int shape_func=0; shape_func<
dofs_per_cell; ++shape_func)
2596 const Number2 value = dof_values_ptr[shape_func];
2597 if (value == Number2())
2601 = &shape_hessians[shape_func][0];
2603 laplacians[point] += value * trace(*shape_hessian_ptr++);
2607 template <
int dim,
int spacedim,
typename VectorType,
typename Number>
2609 do_function_laplacians (
const Number *dof_values_ptr,
2612 const std::vector<unsigned int> &shape_function_to_row_table,
2613 std::vector<VectorType> &laplacians,
2614 const bool quadrature_points_fastest =
false,
2615 const unsigned int component_multiple = 1)
2618 for (
unsigned int i=0; i<laplacians.size(); ++i)
2619 std::fill_n (laplacians[i].begin(), laplacians[i].size(),
2620 typename VectorType::value_type());
2625 if (dofs_per_cell == 0)
2633 const unsigned result_components = n_components * component_multiple;
2634 (void)result_components;
2635 if (quadrature_points_fastest)
2638 for (
unsigned int i=0; i<laplacians.size(); ++i)
2644 for (
unsigned int i=0; i<laplacians.size(); ++i)
2651 for (
unsigned int mc = 0; mc < component_multiple; ++mc)
2652 for (
unsigned int shape_func=0; shape_func<
dofs_per_cell; ++shape_func)
2654 const Number value = dof_values_ptr[shape_func+mc*
dofs_per_cell];
2655 if (value == Number())
2660 const unsigned int comp =
2662 + mc * n_components;
2664 row = shape_function_to_row_table[shape_func*n_components+comp];
2667 &shape_hessians[row][0];
2668 if (quadrature_points_fastest)
2670 VectorType &laplacians_comp = laplacians[comp];
2672 laplacians_comp[point] += value * trace(*shape_hessian_ptr++);
2676 laplacians[point][comp] += value * trace(*shape_hessian_ptr++);
2679 for (
unsigned int c=0; c<n_components; ++c)
2685 row = shape_function_to_row_table[shape_func*n_components+c];
2688 &shape_hessians[row][0];
2689 const unsigned int comp = c + mc * n_components;
2691 if (quadrature_points_fastest)
2693 VectorType &laplacians_comp = laplacians[comp];
2696 laplacians_comp[point] += value * trace(*shape_hessian_ptr++);
2700 laplacians[point][comp] += value * trace(*shape_hessian_ptr++);
2708 template <
int dim,
int spacedim>
2709 template <
class InputVector>
2711 const InputVector &fe_function,
2712 std::vector<typename InputVector::value_type> &values)
const 2714 typedef typename InputVector::value_type Number;
2716 ExcAccessToUninitializedField(
"update_values"));
2719 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
2725 present_cell->get_interpolated_dof_values(fe_function, dof_values);
2732 template <
int dim,
int spacedim>
2733 template <
class InputVector>
2735 const InputVector &fe_function,
2736 const VectorSlice<
const std::vector<types::global_dof_index> > &indices,
2737 std::vector<typename InputVector::value_type> &values)
const 2739 typedef typename InputVector::value_type Number;
2741 ExcAccessToUninitializedField(
"update_values"));
2748 Number dof_values[100];
2750 dof_values[i] = get_vector_element (fe_function, indices[i]);
2757 dof_values[i] = get_vector_element (fe_function, indices[i]);
2765 template <
int dim,
int spacedim>
2766 template <
class InputVector>
2768 const InputVector &fe_function,
2771 typedef typename InputVector::value_type Number;
2773 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
2776 ExcAccessToUninitializedField(
"update_values"));
2781 present_cell->get_interpolated_dof_values(fe_function, dof_values);
2789 template <
int dim,
int spacedim>
2790 template <
class InputVector>
2792 const InputVector &fe_function,
2793 const VectorSlice<
const std::vector<types::global_dof_index> > &indices,
2796 typedef typename InputVector::value_type Number;
2802 ExcAccessToUninitializedField(
"update_values"));
2805 if (indices.size() <= 100)
2807 Number dof_values[100];
2809 dof_values[i] = get_vector_element (fe_function, indices[i]);
2811 this->finite_element_output.shape_function_to_row_table, val,
2818 dof_values[i] = get_vector_element (fe_function, indices[i]);
2827 template <
int dim,
int spacedim>
2828 template <
class InputVector>
2830 const InputVector &fe_function,
2831 const VectorSlice<
const std::vector<types::global_dof_index> > &indices,
2832 VectorSlice<std::vector<std::vector<typename InputVector::value_type> > > values,
2833 bool quadrature_points_fastest)
const 2835 typedef typename InputVector::value_type Number;
2837 ExcAccessToUninitializedField(
"update_values"));
2844 if (indices.size() <= 100)
2846 Number dof_values[100];
2847 for (
unsigned int i=0; i<indices.size(); ++i)
2848 dof_values[i] = get_vector_element (fe_function, indices[i]);
2850 this->finite_element_output.shape_function_to_row_table, values,
2851 quadrature_points_fastest,
2857 for (
unsigned int i=0; i<indices.size(); ++i)
2858 dof_values[i] = get_vector_element (fe_function, indices[i]);
2861 quadrature_points_fastest,
2868 template <
int dim,
int spacedim>
2869 template <
class InputVector>
2872 const InputVector &fe_function,
2875 typedef typename InputVector::value_type Number;
2877 ExcAccessToUninitializedField(
"update_gradients"));
2880 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
2885 present_cell->get_interpolated_dof_values(fe_function, dof_values);
2892 template <
int dim,
int spacedim>
2893 template <
class InputVector>
2895 const InputVector &fe_function,
2896 const VectorSlice<
const std::vector<types::global_dof_index> > &indices,
2899 typedef typename InputVector::value_type Number;
2901 ExcAccessToUninitializedField(
"update_gradients"));
2906 Number dof_values[100];
2908 dof_values[i] = get_vector_element (fe_function, indices[i]);
2916 dof_values[i] = get_vector_element (fe_function, indices[i]);
2925 template <
int dim,
int spacedim>
2926 template <
class InputVector>
2929 const InputVector &fe_function,
2932 typedef typename InputVector::value_type Number;
2934 ExcAccessToUninitializedField(
"update_gradients"));
2936 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
2941 present_cell->get_interpolated_dof_values(fe_function, dof_values);
2950 template <
int dim,
int spacedim>
2951 template <
class InputVector>
2953 const InputVector &fe_function,
2954 const VectorSlice<
const std::vector<types::global_dof_index> > &indices,
2956 bool quadrature_points_fastest)
const 2958 typedef typename InputVector::value_type Number;
2964 ExcAccessToUninitializedField(
"update_gradients"));
2966 if (indices.size() <= 100)
2968 Number dof_values[100];
2969 for (
unsigned int i=0; i<indices.size(); ++i)
2970 dof_values[i] = get_vector_element (fe_function, indices[i]);
2972 *fe, this->finite_element_output.shape_function_to_row_table,
2973 gradients, quadrature_points_fastest,
2979 for (
unsigned int i=0; i<indices.size(); ++i)
2980 dof_values[i] = get_vector_element (fe_function, indices[i]);
2983 gradients, quadrature_points_fastest,
2990 template <
int dim,
int spacedim>
2991 template <
class InputVector>
2997 typedef typename InputVector::value_type Number;
3000 ExcAccessToUninitializedField(
"update_hessians"));
3002 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
3007 present_cell->get_interpolated_dof_values(fe_function, dof_values);
3014 template <
int dim,
int spacedim>
3015 template <
class InputVector>
3017 const InputVector &fe_function,
3018 const VectorSlice<
const std::vector<types::global_dof_index> > &indices,
3021 typedef typename InputVector::value_type Number;
3023 ExcAccessToUninitializedField(
"update_hessians"));
3028 Number dof_values[100];
3030 dof_values[i] = get_vector_element (fe_function, indices[i]);
3038 dof_values[i] = get_vector_element (fe_function, indices[i]);
3047 template <
int dim,
int spacedim>
3048 template <
class InputVector>
3053 bool quadrature_points_fastest)
const 3055 typedef typename InputVector::value_type Number;
3057 ExcAccessToUninitializedField(
"update_hessians"));
3059 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
3064 present_cell->get_interpolated_dof_values(fe_function, dof_values);
3068 hes, quadrature_points_fastest);
3073 template <
int dim,
int spacedim>
3074 template <
class InputVector>
3076 const InputVector &fe_function,
3077 const VectorSlice<
const std::vector<types::global_dof_index> > &indices,
3079 bool quadrature_points_fastest)
const 3081 typedef typename InputVector::value_type Number;
3083 ExcAccessToUninitializedField(
"update_hessians"));
3086 if (indices.size() <= 100)
3088 Number dof_values[100];
3089 for (
unsigned int i=0; i<indices.size(); ++i)
3090 dof_values[i] = get_vector_element (fe_function, indices[i]);
3092 *fe, this->finite_element_output.shape_function_to_row_table,
3093 hessians, quadrature_points_fastest,
3099 for (
unsigned int i=0; i<indices.size(); ++i)
3100 dof_values[i] = get_vector_element (fe_function, indices[i]);
3103 hessians, quadrature_points_fastest,
3110 template <
int dim,
int spacedim>
3111 template <
class InputVector>
3113 const InputVector &fe_function,
3114 std::vector<typename InputVector::value_type> &laplacians)
const 3116 typedef typename InputVector::value_type Number;
3118 ExcAccessToUninitializedField(
"update_hessians"));
3121 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
3126 present_cell->get_interpolated_dof_values(fe_function, dof_values);
3133 template <
int dim,
int spacedim>
3134 template <
class InputVector>
3136 const InputVector &fe_function,
3137 const VectorSlice<
const std::vector<types::global_dof_index> > &indices,
3138 std::vector<typename InputVector::value_type> &laplacians)
const 3140 typedef typename InputVector::value_type Number;
3142 ExcAccessToUninitializedField(
"update_hessians"));
3147 Number dof_values[100];
3149 dof_values[i] = get_vector_element (fe_function, indices[i]);
3157 dof_values[i] = get_vector_element (fe_function, indices[i]);
3165 template <
int dim,
int spacedim>
3166 template <
class InputVector>
3168 const InputVector &fe_function,
3171 typedef typename InputVector::value_type Number;
3173 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
3175 ExcAccessToUninitializedField(
"update_hessians"));
3180 present_cell->get_interpolated_dof_values(fe_function, dof_values);
3188 template <
int dim,
int spacedim>
3189 template <
class InputVector>
3191 const InputVector &fe_function,
3192 const VectorSlice<
const std::vector<types::global_dof_index> > &indices,
3195 typedef typename InputVector::value_type Number;
3201 ExcAccessToUninitializedField(
"update_hessians"));
3202 if (indices.size() <= 100)
3204 Number dof_values[100];
3205 for (
unsigned int i=0; i<indices.size(); ++i)
3206 dof_values[i] = get_vector_element (fe_function, indices[i]);
3208 *fe, this->finite_element_output.shape_function_to_row_table,
3215 for (
unsigned int i=0; i<indices.size(); ++i)
3216 dof_values[i] = get_vector_element (fe_function, indices[i]);
3226 template <
int dim,
int spacedim>
3227 template <
class InputVector>
3229 const InputVector &fe_function,
3230 const VectorSlice<
const std::vector<types::global_dof_index> > &indices,
3231 std::vector<std::vector<typename InputVector::value_type> > &laplacians,
3232 bool quadrature_points_fastest)
const 3234 typedef typename InputVector::value_type Number;
3238 ExcAccessToUninitializedField(
"update_hessians"));
3239 if (indices.size() <= 100)
3241 Number dof_values[100];
3242 for (
unsigned int i=0; i<indices.size(); ++i)
3243 dof_values[i] = get_vector_element (fe_function, indices[i]);
3245 *fe, this->finite_element_output.shape_function_to_row_table,
3246 laplacians, quadrature_points_fastest,
3252 for (
unsigned int i=0; i<indices.size(); ++i)
3253 dof_values[i] = get_vector_element (fe_function, indices[i]);
3256 laplacians, quadrature_points_fastest,
3263 template <
int dim,
int spacedim>
3264 template <
class InputVector>
3270 typedef typename InputVector::value_type Number;
3273 ExcAccessToUninitializedField(
"update_3rd_derivatives"));
3275 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
3280 present_cell->get_interpolated_dof_values(fe_function, dof_values);
3281 internal::do_function_derivatives(dof_values.begin(), this->
finite_element_output.shape_3rd_derivatives,
3287 template <
int dim,
int spacedim>
3288 template <
class InputVector>
3290 const InputVector &fe_function,
3291 const VectorSlice<
const std::vector<types::global_dof_index> > &indices,
3294 typedef typename InputVector::value_type Number;
3296 ExcAccessToUninitializedField(
"update_3rd_derivatives"));
3301 Number dof_values[100];
3303 dof_values[i] = get_vector_element (fe_function, indices[i]);
3304 internal::do_function_derivatives(&dof_values[0], this->
finite_element_output.shape_3rd_derivatives,
3311 dof_values[i] = get_vector_element (fe_function, indices[i]);
3320 template <
int dim,
int spacedim>
3321 template <
class InputVector>
3326 bool quadrature_points_fastest)
const 3328 typedef typename InputVector::value_type Number;
3330 ExcAccessToUninitializedField(
"update_3rd_derivatives"));
3332 ExcMessage (
"FEValues object is not reinit'ed to any cell"));
3337 present_cell->get_interpolated_dof_values(fe_function, dof_values);
3339 internal::do_function_derivatives(dof_values.begin(), this->
finite_element_output.shape_3rd_derivatives,
3341 third, quadrature_points_fastest);
3346 template <
int dim,
int spacedim>
3347 template <
class InputVector>
3349 const InputVector &fe_function,
3350 const VectorSlice<
const std::vector<types::global_dof_index> > &indices,
3352 bool quadrature_points_fastest)
const 3354 typedef typename InputVector::value_type Number;
3356 ExcAccessToUninitializedField(
"update_3rd_derivatives"));
3359 if (indices.size() <= 100)
3361 Number dof_values[100];
3362 for (
unsigned int i=0; i<indices.size(); ++i)
3363 dof_values[i] = get_vector_element (fe_function, indices[i]);
3364 internal::do_function_derivatives(&dof_values[0], this->
finite_element_output.shape_3rd_derivatives,
3365 *fe, this->finite_element_output.shape_function_to_row_table,
3366 third_derivatives, quadrature_points_fastest,
3372 for (
unsigned int i=0; i<indices.size(); ++i)
3373 dof_values[i] = get_vector_element (fe_function, indices[i]);
3374 internal::do_function_derivatives(dof_values.begin(),this->
finite_element_output.shape_3rd_derivatives,
3376 third_derivatives, quadrature_points_fastest,
3383 template <
int dim,
int spacedim>
3392 template <
int dim,
int spacedim>
3393 const std::vector<Tensor<1,spacedim> > &
3398 typename FEVB::ExcAccessToUninitializedField(
"update_normal_vectors"));
3404 template <
int dim,
int spacedim>
3405 std::vector<Point<spacedim> >
3410 typename FEVB::ExcAccessToUninitializedField(
"update_normal_vectors"));
3413 std::vector<Point<spacedim> > tmp (this->
mapping_output.normal_vectors.size());
3414 for (
unsigned int q=0; q<this->
mapping_output.normal_vectors.size(); ++q)
3422 template <
int dim,
int spacedim>
3429 mapping->transform(make_array_view(original),
3432 make_array_view(transformed));
3436 template <
int dim,
int spacedim>
3456 template <
int dim,
int spacedim>
3468 flags |=
mapping->requires_update_flags (flags);
3474 template <
int dim,
int spacedim>
3490 template <
int dim,
int spacedim>
3497 if (&cell->get_triangulation() !=
3499 ->get_triangulation())
3509 cell->get_triangulation().signals.any_change.connect
3520 cell->get_triangulation().signals.post_refinement.connect
3527 template <
int dim,
int spacedim>
3566 CellSimilarity::translation
3568 CellSimilarity::none);
3570 if ( (dim<spacedim) && (
cell_similarity == CellSimilarity::translation) )
3574 != cell->direction_flag() )
3583 template <
int dim,
int spacedim>
3584 CellSimilarity::Similarity
3591 template <
int dim,
int spacedim>
3595 template <
int dim,
int spacedim>
3600 template <
int dim,
int spacedim>
3606 template <
int dim,
int spacedim>
3624 template <
int dim,
int spacedim>
3641 template <
int dim,
int spacedim>
3649 if (dim != spacedim-1)
3651 typename FEVB::ExcInvalidUpdateFlag());
3674 this->update_flags = flags;
3688 template <
typename Type,
typename Po
inter,
typename Iterator>
3690 reset_pointer_in_place_if_possible
3692 const Iterator &new_cell)
3697 if (present_cell.get()
3699 (
typeid(*present_cell.get()) ==
typeid(Type)))
3702 static_cast<const Type *
>(present_cell.get())->~Type();
3705 new(
const_cast<void *
>(
static_cast<const void *
>(present_cell.get()))) Type(new_cell);
3709 present_cell.reset (
new Type(new_cell));
3714 template <
int dim,
int spacedim>
3722 reset_pointer_in_place_if_possible<typename FEValuesBase<dim,spacedim>::TriaCellIterator>
3735 template <
int dim,
int spacedim>
3736 template <
template <
int,
int>
class DoFHandlerType,
bool lda>
3748 typename FEVB::ExcFEDontMatch());
3753 reset_pointer_in_place_if_possible<typename FEValuesBase<dim,spacedim>::template
3768 template <
int dim,
int spacedim>
3798 template <
int dim,
int spacedim>
3810 template <
int dim,
int spacedim>
3823 quadrature(quadrature)
3828 template <
int dim,
int spacedim>
3829 const std::vector<Tensor<1,spacedim> > &
3834 typename FEVB::ExcAccessToUninitializedField(
"update_boundary_forms"));
3840 template <
int dim,
int spacedim>
3851 template <
int dim,
int spacedim>
3854 template <
int dim,
int spacedim>
3858 template <
int dim,
int spacedim>
3875 template <
int dim,
int spacedim>
3891 template <
int dim,
int spacedim>
3916 this->update_flags = flags;
3925 template <
int dim,
int spacedim>
3926 template <
template <
int,
int>
class DoFHandlerType,
bool lda>
3930 const unsigned int face_no)
3939 cell->get_dof_handler().get_fe()[cell->active_fe_index ()]),
3940 typename FEVB::ExcFEDontMatch());
3946 reset_pointer_in_place_if_possible<typename FEValuesBase<dim,spacedim>::template
3961 template <
int dim,
int spacedim>
3963 const unsigned int face_no)
3969 reset_pointer_in_place_if_possible<typename FEValuesBase<dim,spacedim>::TriaCellIterator>
3982 template <
int dim,
int spacedim>
4009 template <
int dim,
int spacedim>
4012 template <
int dim,
int spacedim>
4017 template <
int dim,
int spacedim>
4034 template <
int dim,
int spacedim>
4050 template <
int dim,
int spacedim>
4076 this->update_flags = flags;
4084 template <
int dim,
int spacedim>
4085 template <
template <
int,
int>
class DoFHandlerType,
bool lda>
4088 const unsigned int face_no,
4089 const unsigned int subface_no)
4098 cell->get_dof_handler().get_fe()[cell->active_fe_index ()]),
4099 typename FEVB::ExcFEDontMatch());
4110 Assert (cell->face(face_no)->has_children() ||
4111 subface_no < GeometryInfo<dim>::max_children_per_face,
4113 Assert (!cell->face(face_no)->has_children() ||
4114 subface_no < cell->face(face_no)->number_of_children(),
4115 ExcIndexRange (subface_no, 0, cell->face(face_no)->number_of_children()));
4116 Assert (cell->has_children() ==
false,
4117 ExcMessage (
"You can't use subface data for cells that are " 4118 "already refined. Iterate over their children " 4119 "instead in these cases."));
4122 reset_pointer_in_place_if_possible<typename FEValuesBase<dim,spacedim>::template
4136 template <
int dim,
int spacedim>
4138 const unsigned int face_no,
4139 const unsigned int subface_no)
4143 Assert (subface_no < cell->face(face_no)->n_children(),
4144 ExcIndexRange (subface_no, 0, cell->face(face_no)->n_children()));
4147 reset_pointer_in_place_if_possible<typename FEValuesBase<dim,spacedim>::TriaCellIterator>
4160 template <
int dim,
int spacedim>
4162 const unsigned int subface_no)
4168 if (!cell->face(face_no)->has_children())
4182 switch (cell->subface_case(face_no))
4187 subface_index=cell->face(face_no)->child_index(subface_no);
4191 subface_index=cell->face(face_no)->child(subface_no/2)->child_index(subface_no%2);
4199 subface_index=cell->face(face_no)->child(0)->child_index(subface_no);
4202 subface_index=cell->face(face_no)->child_index(1);
4205 Assert(
false, ExcInternalError());
4213 subface_index=cell->face(face_no)->child_index(0);
4217 subface_index=cell->face(face_no)->child(1)->child_index(subface_no-1);
4220 Assert(
false, ExcInternalError());
4224 Assert(
false, ExcInternalError());
4228 ExcInternalError());
4253 #define SPLIT_INSTANTIATIONS_COUNT 2 4254 #ifndef SPLIT_INSTANTIATIONS_INDEX 4255 #define SPLIT_INSTANTIATIONS_INDEX 0 4257 #include "fe_values.inst" 4259 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
std_cxx11::unique_ptr< typename FiniteElement< dim, spacedim >::InternalDataBase > fe_data
virtual UpdateFlags requires_update_flags(const UpdateFlags update_flags) const =0
static const unsigned int invalid_unsigned_int
CellSimilarity::Similarity cell_similarity
#define AssertDimension(dim1, dim2)
unsigned int present_face_index
unsigned int n_nonzero_components(const unsigned int i) const
static const unsigned int n_independent_components
const unsigned int dofs_per_cell
const unsigned int component
void get_function_values(const InputVector &fe_function, std::vector< typename ProductType< value_type, typename InputVector::value_type >::type > &values) const
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)
const Quadrature< dim-1 > quadrature
void get_function_third_derivatives(const InputVector &fe_function, std::vector< typename ProductType< third_derivative_type, typename InputVector::value_type >::type > &third_derivatives) const
::ExceptionBase & ExcMessage(std::string arg1)
static TableIndices< rank > unrolled_to_component_indices(const unsigned int i)
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
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.
void do_reinit(const unsigned int face_no)
virtual void get_interpolated_dof_values(const IndexSet &in, Vector< IndexSet::value_type > &out) const
std::size_t memory_consumption() const
void check_cell_similarity(const typename Triangulation< dim, spacedim >::cell_iterator &cell)
::internal::FEValuesViews::Cache< dim, spacedim > fe_values_views_cache
void get_function_hessians(const InputVector &fe_function, std::vector< Tensor< 2, spacedim, typename InputVector::value_type > > &hessians) const
const Mapping< dim, spacedim > & get_mapping() const
void do_reinit(const unsigned int face_no, const unsigned int subface_no)
void reinit(const TriaIterator< DoFCellAccessor< DoFHandlerType< dim, spacedim >, level_dof_access > > &cell, const unsigned int face_no, const unsigned int subface_no)
unsigned int size() const
void get_function_laplacians(const InputVector &fe_function, std::vector< typename ProductType< value_type, typename InputVector::value_type >::type > &laplacians) const
static unsigned int component_to_unrolled_index(const TableIndices< rank > &indices)
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
std_cxx11::unique_ptr< const CellIteratorBase > present_cell
CellSimilarity::Similarity get_cell_similarity() const
TriaIterator< CellAccessor< dim, spacedim > > cell_iterator
boost::signals2::connection tria_listener
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
#define Assert(cond, exc)
void reinit(const TriaIterator< DoFCellAccessor< DoFHandlerType< dim, spacedim >, level_dof_access > > &cell, const unsigned int face_no)
bool is_primitive(const unsigned int i) const
Abstract base class for mapping classes.
const ComponentMask & get_nonzero_components(const unsigned int i) const
std::vector< ShapeFunctionData > shape_function_data
const Quadrature< dim > quadrature
const unsigned int first_vector_component
const Triangulation< dim, spacedim >::cell_iterator cell
::internal::FEValues::FiniteElementRelatedData< dim, spacedim > finite_element_output
void invalidate_present_cell()
const SmartPointer< const Mapping< dim, spacedim >, FEValuesBase< dim, spacedim > > mapping
Vector & operator=(const Vector< dim, spacedim > &)
static const char *const message_string
void get_function_symmetric_gradients(const InputVector &fe_function, std::vector< typename ProductType< symmetric_gradient_type, typename InputVector::value_type >::type > &symmetric_gradients) const
Second derivatives of shape functions.
Gradient of volume element.
const std::vector< Tensor< 1, spacedim > > & get_all_normal_vectors() const
static TableIndices< rank_ > unrolled_to_component_indices(const unsigned int i)
std::size_t memory_consumption() const
void transform(std::vector< Tensor< 1, spacedim > > &transformed, const std::vector< Tensor< 1, dim > > &original, MappingType mapping) const DEAL_II_DEPRECATED
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
std_cxx11::enable_if< std_cxx11::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)
void get_function_curls(const InputVector &fe_function, std::vector< typename ProductType< curl_type, typename InputVector::value_type >::type > &curls) const
const FEValuesBase< dim, spacedim > & fe_values
std::pair< unsigned int, unsigned int > system_to_component_index(const unsigned int index) 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)
void initialize(const UpdateFlags update_flags)
Shape function gradients.
void maybe_invalidate_previous_present_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell)
std_cxx11::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > mapping_data
::ExceptionBase & ExcNotMultiple(int arg1, int arg2)
const FEValuesBase< dim, spacedim > & fe_values
void initialize(const UpdateFlags update_flags)
static unsigned int n_threads()
const Triangulation< dim, spacedim >::cell_iterator get_cell() const
unsigned int size(const unsigned int i) 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
::internal::FEValues::MappingRelatedData< dim, spacedim > mapping_output
Tensor & operator=(const Tensor< rank_, dim, Number > &rhs)
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 reinit(const TriaIterator< DoFCellAccessor< DoFHandlerType< dim, spacedim >, level_dof_access > > &cell)
FESubfaceValues(const Mapping< dim, spacedim > &mapping, const FiniteElement< dim, spacedim > &fe, const Quadrature< dim-1 > &face_quadrature, const UpdateFlags update_flags)
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
virtual types::global_dof_index n_dofs_for_dof_handler() const
std::vector< ShapeFunctionData > shape_function_data
Task< RT > new_task(const std_cxx11::function< RT()> &function)
SymmetricTensor & operator=(const SymmetricTensor &)
std::vector< Point< spacedim > > get_normal_vectors() const DEAL_II_DEPRECATED