deal.II version GIT relicensing-6834-g5b78e6bcdf 2026-10-01 11:20:01+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
fe_values_base.cc
Go to the documentation of this file.
1// -----------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
4// Copyright (C) 2023 - 2026 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Detailed license information governing the source code and contributions
9// can be found in LICENSE.md and CONTRIBUTING.md at the top level directory.
10//
11// -----------------------------------------------------------------------------
12
20
22
24
25#include <deal.II/fe/fe.h>
27#include <deal.II/fe/mapping.h>
28
31
32#include <deal.II/lac/vector.h>
33
34#include <boost/container/small_vector.hpp>
35
36#include <complex>
37#include <iomanip>
38#include <memory>
39#include <type_traits>
40
42
43
44namespace internal
45{
46 template <int dim, int spacedim>
47 std::vector<unsigned int>
49 {
50 std::vector<unsigned int> shape_function_to_row_table(
52 unsigned int row = 0;
53 for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i)
54 {
55 // loop over all components that are nonzero for this particular
56 // shape function. if a component is zero then we leave the
57 // value in the table unchanged (at the invalid value)
58 // otherwise it is mapped to the next free entry
59 unsigned int nth_nonzero_component = 0;
60 for (unsigned int c = 0; c < fe.n_components(); ++c)
61 if (fe.get_nonzero_components(i)[c] == true)
62 {
63 shape_function_to_row_table[i * fe.n_components() + c] =
64 row + nth_nonzero_component;
65 ++nth_nonzero_component;
66 }
67 row += fe.n_nonzero_components(i);
68 }
69
70 return shape_function_to_row_table;
71 }
72
73 namespace
74 {
75 // Check to see if a DoF value is zero, implying that subsequent operations
76 // with the value have no effect.
77 template <typename Number, typename T = void>
78 struct CheckForZero
79 {
80 static bool
81 value(const Number &value)
82 {
84 }
85 };
86
87 // For auto-differentiable numbers, the fact that a DoF value is zero
88 // does not imply that its derivatives are zero as well. So we
89 // can't filter by value for these number types.
90 // Note that we also want to avoid actually checking the value itself,
91 // since some AD numbers are not contextually convertible to booleans.
92 template <typename Number>
93 struct CheckForZero<
94 Number,
95 std::enable_if_t<Differentiation::AD::is_ad_number<Number>::value>>
96 {
97 static bool
98 value(const Number & /*value*/)
99 {
100 return false;
101 }
102 };
103 } // namespace
104} // namespace internal
105
106/* ------------ FEValuesBase<dim,spacedim>::CellIteratorWrapper ----------- */
107
108
109template <int dim, int spacedim>
114
115
116
117template <int dim, int spacedim>
122
123
124
125template <int dim, int spacedim>
130
131
132
133template <int dim, int spacedim>
134bool
136{
137 return cell.has_value();
138}
139
140
141
142template <int dim, int spacedim>
144operator typename Triangulation<dim, spacedim>::cell_iterator() const
145{
146 Assert(is_initialized(), ExcNotReinited());
147
148 auto convert = [](const auto &cell) {
150 };
151
152 switch (cell.value().index())
153 {
154 case 0:
155 return convert(std::get<0>(cell.value()));
156 case 1:
157 return convert(std::get<1>(cell.value()));
158 case 2:
159 return convert(std::get<2>(cell.value()));
160 default:
162 return {};
163 }
164}
165
166
167
168template <int dim, int spacedim>
171{
172 Assert(is_initialized(), ExcNotReinited());
173
174 switch (cell.value().index())
175 {
176 case 1:
177 return std::get<1>(cell.value())->get_dof_handler().n_dofs();
178 case 2:
179 return std::get<2>(cell.value())->get_dof_handler().n_dofs();
180 default:
181 Assert(false, ExcNeedsDoFHandler());
183 }
184}
185
186
187
188template <int dim, int spacedim>
189template <typename Number>
190void
192 const ReadVector<Number> &in,
193 ArrayView<Number> out) const
194{
195 Assert(is_initialized(), ExcNotReinited());
196
197 switch (cell.value().index())
198 {
199 case 1:
200 std::get<1>(cell.value())->get_interpolated_dof_values(in, out);
201 break;
203 case 2:
204 std::get<2>(cell.value())->get_interpolated_dof_values(in, out);
205 break;
206
207 default:
208 Assert(false, ExcNeedsDoFHandler());
209 break;
210 }
211}
212
213
214
215/*------------------------------- FEValuesBase ---------------------------*/
216
217
218template <int dim, int spacedim>
220 const unsigned int n_q_points,
221 const unsigned int dofs_per_cell,
222 const UpdateFlags flags,
225 : n_quadrature_points(n_q_points)
226 , max_n_quadrature_points(n_q_points)
228 , mapping(&mapping, typeid(*this).name())
229 , fe(&fe, typeid(*this).name())
230 , cell_similarity(CellSimilarity::Similarity::none)
231 , fe_values_views_cache(*this)
233{
234 Assert(n_q_points > 0,
235 ExcMessage("There is nothing useful you can do with an FEValues "
236 "object when using a quadrature formula with zero "
237 "quadrature points!"));
238 this->update_flags = flags;
239}
240
241
242
243template <int dim, int spacedim>
245{
246 tria_listener_any_change.disconnect();
248
249
250
251template <int dim, int spacedim>
252void
254 const bool allow)
255{
256 check_for_cell_similarity_allowed = allow;
257}
258
259
260
261namespace internal
262{
263 // put shape function part of get_function_xxx methods into separate
264 // internal functions. this allows us to reuse the same code for several
265 // functions (e.g. both the versions with and without indices) as well as
266 // the same code for gradients and Hessians. Moreover, this speeds up
267 // compilation and reduces the size of the final file since all the
268 // different global vectors get channeled through the same code.
269
270 template <typename Number, typename Number2>
271 void
273 const ::Table<2, double> &shape_values,
274 std::vector<Number> &values)
275 {
276 // scalar finite elements, so shape_values.size() == dofs_per_cell
277 const unsigned int dofs_per_cell = shape_values.n_rows();
278 const unsigned int n_quadrature_points = values.size();
279
280 // initialize with zero
281 std::fill_n(values.begin(),
282 n_quadrature_points,
284
285 // add up contributions of trial functions. note that here we deal with
286 // scalar finite elements, so no need to check for non-primitivity of
287 // shape functions. in order to increase the speed of this function, we
288 // directly access the data in the shape_values array, and increment
289 // pointers for accessing the data. this saves some lookup time and
290 // indexing. moreover, the order of the loops is such that we can access
291 // the shape_values data stored contiguously
292 for (unsigned int shape_func = 0; shape_func < dofs_per_cell; ++shape_func)
293 {
294 const Number2 value = dof_values[shape_func];
295 // For auto-differentiable numbers, the fact that a DoF value is zero
296 // does not imply that its derivatives are zero as well. So we
297 // can't filter by value for these number types.
300 continue;
301
302 const double *shape_value_ptr = &shape_values(shape_func, 0);
303 for (unsigned int point = 0; point < n_quadrature_points; ++point)
304 values[point] += value * (*shape_value_ptr++);
305 }
306 }
307
308
309
310 template <int dim, int spacedim, typename VectorType>
311 void
314 const ::Table<2, double> &shape_values,
316 const std::vector<unsigned int> &shape_function_to_row_table,
317 const ArrayView<VectorType> &values,
318 const bool quadrature_points_fastest = false,
319 const unsigned int component_multiple = 1)
320 {
321 using Number = typename VectorType::value_type;
322 // initialize with zero
323 for (unsigned int i = 0; i < values.size(); ++i)
324 std::fill_n(values[i].begin(),
325 values[i].size(),
326 typename VectorType::value_type());
327
328 // see if there the current cell has DoFs at all, and if not
329 // then there is nothing else to do.
330 const unsigned int dofs_per_cell = fe.n_dofs_per_cell();
331 if (dofs_per_cell == 0)
332 return;
333
334 const unsigned int n_quadrature_points =
335 quadrature_points_fastest ? values[0].size() : values.size();
336 const unsigned int n_components = fe.n_components();
337
338 // Assert that we can write all components into the result vectors
339 const unsigned result_components = n_components * component_multiple;
340 (void)result_components;
341 if (quadrature_points_fastest)
342 {
343 AssertDimension(values.size(), result_components);
344 for (unsigned int i = 0; i < values.size(); ++i)
345 AssertDimension(values[i].size(), n_quadrature_points);
346 }
347 else
348 {
349 AssertDimension(values.size(), n_quadrature_points);
350 for (unsigned int i = 0; i < values.size(); ++i)
351 AssertDimension(values[i].size(), result_components);
352 }
353
354 // add up contributions of trial functions. now check whether the shape
355 // function is primitive or not. if it is, then set its only non-zero
356 // component, otherwise loop over components
357 for (unsigned int mc = 0; mc < component_multiple; ++mc)
358 for (unsigned int shape_func = 0; shape_func < dofs_per_cell;
359 ++shape_func)
360 {
361 const Number &value = dof_values[shape_func + mc * dofs_per_cell];
362 // For auto-differentiable numbers, the fact that a DoF value is zero
363 // does not imply that its derivatives are zero as well. So we
364 // can't filter by value for these number types.
365 if (::internal::CheckForZero<Number>::value(value) == true)
366 continue;
367
368 if (fe.is_primitive(shape_func))
369 {
370 const unsigned int comp =
371 fe.system_to_component_index(shape_func).first +
372 mc * n_components;
373 const unsigned int row =
374 shape_function_to_row_table[shape_func * n_components + comp];
375
376 const double *shape_value_ptr = &shape_values(row, 0);
377
378 if (quadrature_points_fastest)
379 {
380 VectorType &values_comp = values[comp];
381 for (unsigned int point = 0; point < n_quadrature_points;
382 ++point)
383 values_comp[point] += value * (*shape_value_ptr++);
384 }
385 else
386 for (unsigned int point = 0; point < n_quadrature_points;
387 ++point)
388 values[point][comp] += value * (*shape_value_ptr++);
389 }
390 else
391 for (unsigned int c = 0; c < n_components; ++c)
392 {
393 if (fe.get_nonzero_components(shape_func)[c] == false)
394 continue;
395
396 const unsigned int row =
397 shape_function_to_row_table[shape_func * n_components + c];
398
399 const double *shape_value_ptr = &shape_values(row, 0);
400 const unsigned int comp = c + mc * n_components;
401
402 if (quadrature_points_fastest)
403 {
404 VectorType &values_comp = values[comp];
405 for (unsigned int point = 0; point < n_quadrature_points;
406 ++point)
407 values_comp[point] += value * (*shape_value_ptr++);
408 }
409 else
410 for (unsigned int point = 0; point < n_quadrature_points;
411 ++point)
412 values[point][comp] += value * (*shape_value_ptr++);
413 }
414 }
415 }
416
417
418
419 // use the same implementation for gradients and Hessians, distinguish them
420 // by the rank of the tensors
421 template <int order, int spacedim, typename Number>
422 void
424 const ArrayView<Number> &dof_values,
425 const ::Table<2, Tensor<order, spacedim>> &shape_derivatives,
426 std::vector<Tensor<order, spacedim, Number>> &derivatives)
427 {
428 const unsigned int dofs_per_cell = shape_derivatives.size()[0];
429 const unsigned int n_quadrature_points = derivatives.size();
430
431 // initialize with zero
432 std::fill_n(derivatives.begin(),
433 n_quadrature_points,
435
436 // add up contributions of trial functions. note that here we deal with
437 // scalar finite elements, so no need to check for non-primitivity of
438 // shape functions. in order to increase the speed of this function, we
439 // directly access the data in the shape_gradients/hessians array, and
440 // increment pointers for accessing the data. this saves some lookup time
441 // and indexing. moreover, the order of the loops is such that we can
442 // access the shape_gradients/hessians data stored contiguously
443 for (unsigned int shape_func = 0; shape_func < dofs_per_cell; ++shape_func)
444 {
445 const Number &value = dof_values[shape_func];
446 // For auto-differentiable numbers, the fact that a DoF value is zero
447 // does not imply that its derivatives are zero as well. So we
448 // can't filter by value for these number types.
449 if (::internal::CheckForZero<Number>::value(value) == true)
450 continue;
451
452 const Tensor<order, spacedim> *shape_derivative_ptr =
453 &shape_derivatives[shape_func][0];
454 for (unsigned int point = 0; point < n_quadrature_points; ++point)
455 derivatives[point] += value * (*shape_derivative_ptr++);
456 }
457 }
458
459
460
461 template <int order, int dim, int spacedim, typename Number>
462 void
464 const ArrayView<Number> &dof_values,
465 const ::Table<2, Tensor<order, spacedim>> &shape_derivatives,
467 const std::vector<unsigned int> &shape_function_to_row_table,
468 const ArrayView<std::vector<Tensor<order, spacedim, Number>>> &derivatives,
469 const bool quadrature_points_fastest = false,
470 const unsigned int component_multiple = 1)
471 {
472 // initialize with zero
473 for (unsigned int i = 0; i < derivatives.size(); ++i)
474 std::fill_n(derivatives[i].begin(),
475 derivatives[i].size(),
477
478 // see if there the current cell has DoFs at all, and if not
479 // then there is nothing else to do.
480 const unsigned int dofs_per_cell = fe.n_dofs_per_cell();
481 if (dofs_per_cell == 0)
482 return;
483
484
485 const unsigned int n_quadrature_points =
486 quadrature_points_fastest ? derivatives[0].size() : derivatives.size();
487 const unsigned int n_components = fe.n_components();
488
489 // Assert that we can write all components into the result vectors
490 const unsigned result_components = n_components * component_multiple;
491 (void)result_components;
492 if (quadrature_points_fastest)
493 {
494 AssertDimension(derivatives.size(), result_components);
495 for (unsigned int i = 0; i < derivatives.size(); ++i)
496 AssertDimension(derivatives[i].size(), n_quadrature_points);
497 }
498 else
499 {
500 AssertDimension(derivatives.size(), n_quadrature_points);
501 for (unsigned int i = 0; i < derivatives.size(); ++i)
502 AssertDimension(derivatives[i].size(), result_components);
503 }
504
505 // add up contributions of trial functions. now check whether the shape
506 // function is primitive or not. if it is, then set its only non-zero
507 // component, otherwise loop over components
508 for (unsigned int mc = 0; mc < component_multiple; ++mc)
509 for (unsigned int shape_func = 0; shape_func < dofs_per_cell;
510 ++shape_func)
511 {
512 const Number &value = dof_values[shape_func + mc * dofs_per_cell];
513 // For auto-differentiable numbers, the fact that a DoF value is zero
514 // does not imply that its derivatives are zero as well. So we
515 // can't filter by value for these number types.
516 if (::internal::CheckForZero<Number>::value(value) == true)
517 continue;
518
519 if (fe.is_primitive(shape_func))
520 {
521 const unsigned int comp =
522 fe.system_to_component_index(shape_func).first +
523 mc * n_components;
524 const unsigned int row =
525 shape_function_to_row_table[shape_func * n_components + comp];
526
527 const Tensor<order, spacedim> *shape_derivative_ptr =
528 &shape_derivatives[row][0];
529
530 if (quadrature_points_fastest)
531 for (unsigned int point = 0; point < n_quadrature_points;
532 ++point)
533 derivatives[comp][point] += value * (*shape_derivative_ptr++);
534 else
535 for (unsigned int point = 0; point < n_quadrature_points;
536 ++point)
537 derivatives[point][comp] += value * (*shape_derivative_ptr++);
538 }
539 else
540 for (unsigned int c = 0; c < n_components; ++c)
541 {
542 if (fe.get_nonzero_components(shape_func)[c] == false)
543 continue;
544
545 const unsigned int row =
546 shape_function_to_row_table[shape_func * n_components + c];
547
548 const Tensor<order, spacedim> *shape_derivative_ptr =
549 &shape_derivatives[row][0];
550 const unsigned int comp = c + mc * n_components;
551
552 if (quadrature_points_fastest)
553 for (unsigned int point = 0; point < n_quadrature_points;
554 ++point)
555 derivatives[comp][point] +=
556 value * (*shape_derivative_ptr++);
557 else
558 for (unsigned int point = 0; point < n_quadrature_points;
559 ++point)
560 derivatives[point][comp] +=
561 value * (*shape_derivative_ptr++);
562 }
563 }
564 }
565
567
568 template <int spacedim, typename Number, typename Number2>
569 void
571 const ArrayView<Number2> &dof_values,
572 const ::Table<2, Tensor<2, spacedim>> &shape_hessians,
573 std::vector<Number> &laplacians)
574 {
575 const unsigned int dofs_per_cell = shape_hessians.size()[0];
576 const unsigned int n_quadrature_points = laplacians.size();
577
578 // initialize with zero
579 std::fill_n(laplacians.begin(),
580 n_quadrature_points,
582
583 // add up contributions of trial functions. note that here we deal with
584 // scalar finite elements and also note that the Laplacian is
585 // the trace of the Hessian.
586 for (unsigned int shape_func = 0; shape_func < dofs_per_cell; ++shape_func)
587 {
588 const Number2 value = dof_values[shape_func];
589 // For auto-differentiable numbers, the fact that a DoF value is zero
590 // does not imply that its derivatives are zero as well. So we
591 // can't filter by value for these number types.
594 continue;
595
596 const Tensor<2, spacedim> *shape_hessian_ptr =
597 &shape_hessians[shape_func][0];
598 for (unsigned int point = 0; point < n_quadrature_points; ++point)
599 laplacians[point] += value * trace(*shape_hessian_ptr++);
600 }
601 }
602
603
604
605 template <int dim, int spacedim, typename VectorType, typename Number>
606 void
608 const ArrayView<Number> &dof_values,
609 const ::Table<2, Tensor<2, spacedim>> &shape_hessians,
611 const std::vector<unsigned int> &shape_function_to_row_table,
612 std::vector<VectorType> &laplacians,
613 const bool quadrature_points_fastest = false,
614 const unsigned int component_multiple = 1)
615 {
616 // initialize with zero
617 for (unsigned int i = 0; i < laplacians.size(); ++i)
618 std::fill_n(laplacians[i].begin(),
619 laplacians[i].size(),
620 typename VectorType::value_type());
621
622 // see if there the current cell has DoFs at all, and if not
623 // then there is nothing else to do.
624 const unsigned int dofs_per_cell = fe.n_dofs_per_cell();
625 if (dofs_per_cell == 0)
626 return;
627
628
629 const unsigned int n_quadrature_points = laplacians.size();
630 const unsigned int n_components = fe.n_components();
631
632 // Assert that we can write all components into the result vectors
633 const unsigned result_components = n_components * component_multiple;
634 (void)result_components;
635 if (quadrature_points_fastest)
636 {
637 AssertDimension(laplacians.size(), result_components);
638 for (unsigned int i = 0; i < laplacians.size(); ++i)
639 AssertDimension(laplacians[i].size(), n_quadrature_points);
640 }
641 else
642 {
643 AssertDimension(laplacians.size(), n_quadrature_points);
644 for (unsigned int i = 0; i < laplacians.size(); ++i)
645 AssertDimension(laplacians[i].size(), result_components);
646 }
647
648 // add up contributions of trial functions. now check whether the shape
649 // function is primitive or not. if it is, then set its only non-zero
650 // component, otherwise loop over components
651 for (unsigned int mc = 0; mc < component_multiple; ++mc)
652 for (unsigned int shape_func = 0; shape_func < dofs_per_cell;
653 ++shape_func)
654 {
655 const Number &value = dof_values[shape_func + mc * dofs_per_cell];
656 // For auto-differentiable numbers, the fact that a DoF value is zero
657 // does not imply that its derivatives are zero as well. So we
658 // can't filter by value for these number types.
659 if (::internal::CheckForZero<Number>::value(value) == true)
660 continue;
662 if (fe.is_primitive(shape_func))
663 {
664 const unsigned int comp =
665 fe.system_to_component_index(shape_func).first +
666 mc * n_components;
667 const unsigned int row =
668 shape_function_to_row_table[shape_func * n_components + comp];
669
670 const Tensor<2, spacedim> *shape_hessian_ptr =
671 &shape_hessians[row][0];
672 if (quadrature_points_fastest)
673 {
674 VectorType &laplacians_comp = laplacians[comp];
675 for (unsigned int point = 0; point < n_quadrature_points;
676 ++point)
677 laplacians_comp[point] +=
678 value * trace(*shape_hessian_ptr++);
679 }
680 else
681 for (unsigned int point = 0; point < n_quadrature_points;
682 ++point)
683 laplacians[point][comp] +=
684 value * trace(*shape_hessian_ptr++);
685 }
686 else
687 for (unsigned int c = 0; c < n_components; ++c)
688 {
689 if (fe.get_nonzero_components(shape_func)[c] == false)
690 continue;
691
692 const unsigned int row =
693 shape_function_to_row_table[shape_func * n_components + c];
694
695 const Tensor<2, spacedim> *shape_hessian_ptr =
696 &shape_hessians[row][0];
697 const unsigned int comp = c + mc * n_components;
698
699 if (quadrature_points_fastest)
700 {
701 VectorType &laplacians_comp = laplacians[comp];
702 for (unsigned int point = 0; point < n_quadrature_points;
703 ++point)
704 laplacians_comp[point] +=
705 value * trace(*shape_hessian_ptr++);
706 }
707 else
708 for (unsigned int point = 0; point < n_quadrature_points;
709 ++point)
710 laplacians[point][comp] +=
711 value * trace(*shape_hessian_ptr++);
713 }
714 }
715} // namespace internal
716
717
718
719template <int dim, int spacedim>
720template <typename Number>
721void
723 const ReadVector<Number> &fe_function,
724 std::vector<Number> &values) const
725{
726 Assert(this->update_flags & update_values,
727 ExcAccessToUninitializedField("update_values"));
729 Assert(present_cell.is_initialized(), ExcNotReinited());
730 AssertDimension(fe_function.size(), present_cell.n_dofs_for_dof_handler());
731
732 // get function values of dofs on this cell
733 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
734 auto view = make_array_view(dof_values.begin(), dof_values.end());
735 present_cell.get_interpolated_dof_values(fe_function, view);
737 this->finite_element_output.shape_values,
738 values);
739}
740
741
742
743template <int dim, int spacedim>
744template <typename Number>
745void
747 const ReadVector<Number> &fe_function,
749 std::vector<Number> &values) const
750{
751 Assert(this->update_flags & update_values,
752 ExcAccessToUninitializedField("update_values"));
754 AssertDimension(indices.size(), dofs_per_cell);
755
756 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
757 auto view = make_array_view(dof_values.begin(), dof_values.end());
758 fe_function.extract_subvector_to(indices, view);
760 this->finite_element_output.shape_values,
761 values);
762}
764
765
766template <int dim, int spacedim>
767template <typename Number>
768void
770 const ReadVector<Number> &fe_function,
771 std::vector<Vector<Number>> &values) const
772{
773 Assert(present_cell.is_initialized(), ExcNotReinited());
774
775 Assert(this->update_flags & update_values,
776 ExcAccessToUninitializedField("update_values"));
777 AssertDimension(fe_function.size(), present_cell.n_dofs_for_dof_handler());
778
779 // get function values of dofs on this cell
780 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
781 auto view = make_array_view(dof_values.begin(), dof_values.end());
782 present_cell.get_interpolated_dof_values(fe_function, view);
784 view,
785 this->finite_element_output.shape_values,
786 *fe,
787 this->finite_element_output.shape_function_to_row_table,
788 make_array_view(values.begin(), values.end()));
789}
790
791
792
793template <int dim, int spacedim>
794template <typename Number>
795void
797 const ReadVector<Number> &fe_function,
799 std::vector<Vector<Number>> &values) const
800{
801 // Size of indices must be a multiple of dofs_per_cell such that an integer
802 // number of function values is generated in each point.
803 Assert(indices.size() % dofs_per_cell == 0,
804 ExcNotMultiple(indices.size(), dofs_per_cell));
805 Assert(this->update_flags & update_values,
806 ExcAccessToUninitializedField("update_values"));
807
808 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
809 auto view = make_array_view(dof_values.begin(), dof_values.end());
810 fe_function.extract_subvector_to(indices, view);
812 view,
813 this->finite_element_output.shape_values,
814 *fe,
815 this->finite_element_output.shape_function_to_row_table,
816 make_array_view(values.begin(), values.end()),
817 false,
818 indices.size() / dofs_per_cell);
819}
820
821
822
823template <int dim, int spacedim>
824template <typename Number>
825void
827 const ReadVector<Number> &fe_function,
829 ArrayView<std::vector<Number>> values,
830 const bool quadrature_points_fastest) const
831{
832 Assert(this->update_flags & update_values,
833 ExcAccessToUninitializedField("update_values"));
834
835 // Size of indices must be a multiple of dofs_per_cell such that an integer
836 // number of function values is generated in each point.
837 Assert(indices.size() % dofs_per_cell == 0,
838 ExcNotMultiple(indices.size(), dofs_per_cell));
839
840 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
841 auto view = make_array_view(dof_values.begin(), dof_values.end());
842 fe_function.extract_subvector_to(indices, view);
844 view,
845 this->finite_element_output.shape_values,
846 *fe,
847 this->finite_element_output.shape_function_to_row_table,
848 make_array_view(values.begin(), values.end()),
849 quadrature_points_fastest,
850 indices.size() / dofs_per_cell);
851}
852
853
854
855template <int dim, int spacedim>
856template <typename Number>
857void
859 const ReadVector<Number> &fe_function,
860 std::vector<Tensor<1, spacedim, Number>> &gradients) const
861{
862 Assert(this->update_flags & update_gradients,
863 ExcAccessToUninitializedField("update_gradients"));
865 Assert(present_cell.is_initialized(), ExcNotReinited());
866 AssertDimension(fe_function.size(), present_cell.n_dofs_for_dof_handler());
867
868 // get function values of dofs on this cell
869 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
870 auto view = make_array_view(dof_values.begin(), dof_values.end());
871 present_cell.get_interpolated_dof_values(fe_function, view);
873 this->finite_element_output.shape_gradients,
874 gradients);
875}
876
877
878
879template <int dim, int spacedim>
880template <typename Number>
881void
883 const ReadVector<Number> &fe_function,
885 std::vector<Tensor<1, spacedim, Number>> &gradients) const
886{
887 Assert(this->update_flags & update_gradients,
888 ExcAccessToUninitializedField("update_gradients"));
890 AssertDimension(indices.size(), dofs_per_cell);
891
892 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
893 auto view = make_array_view(dof_values.begin(), dof_values.end());
894 fe_function.extract_subvector_to(indices, view);
896 this->finite_element_output.shape_gradients,
897 gradients);
898}
899
900
902template <int dim, int spacedim>
903template <typename Number>
904void
906 const ReadVector<Number> &fe_function,
907 std::vector<std::vector<Tensor<1, spacedim, Number>>> &gradients) const
908{
909 Assert(this->update_flags & update_gradients,
910 ExcAccessToUninitializedField("update_gradients"));
911 Assert(present_cell.is_initialized(), ExcNotReinited());
912 AssertDimension(fe_function.size(), present_cell.n_dofs_for_dof_handler());
913
914 // get function values of dofs on this cell
915 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
916 auto view = make_array_view(dof_values.begin(), dof_values.end());
917 present_cell.get_interpolated_dof_values(fe_function, view);
919 view,
920 this->finite_element_output.shape_gradients,
921 *fe,
922 this->finite_element_output.shape_function_to_row_table,
923 make_array_view(gradients.begin(), gradients.end()));
924}
925
926
927
928template <int dim, int spacedim>
929template <typename Number>
930void
932 const ReadVector<Number> &fe_function,
934 ArrayView<std::vector<Tensor<1, spacedim, Number>>> gradients,
935 const bool quadrature_points_fastest) const
936{
937 // Size of indices must be a multiple of dofs_per_cell such that an integer
938 // number of function values is generated in each point.
939 Assert(indices.size() % dofs_per_cell == 0,
940 ExcNotMultiple(indices.size(), dofs_per_cell));
941 Assert(this->update_flags & update_gradients,
942 ExcAccessToUninitializedField("update_gradients"));
943
944 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
945 auto view = make_array_view(dof_values.begin(), dof_values.end());
946 fe_function.extract_subvector_to(indices, view);
948 view,
949 this->finite_element_output.shape_gradients,
950 *fe,
951 this->finite_element_output.shape_function_to_row_table,
952 make_array_view(gradients.begin(), gradients.end()),
953 quadrature_points_fastest,
954 indices.size() / dofs_per_cell);
955}
956
957
958
959template <int dim, int spacedim>
960template <typename Number>
961void
963 const ReadVector<Number> &fe_function,
964 std::vector<Tensor<2, spacedim, Number>> &hessians) const
965{
967 Assert(this->update_flags & update_hessians,
968 ExcAccessToUninitializedField("update_hessians"));
969 Assert(present_cell.is_initialized(), ExcNotReinited());
970 AssertDimension(fe_function.size(), present_cell.n_dofs_for_dof_handler());
971
972 // get function values of dofs on this cell
973 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
974 auto view = make_array_view(dof_values.begin(), dof_values.end());
975 present_cell.get_interpolated_dof_values(fe_function, view);
977 this->finite_element_output.shape_hessians,
978 hessians);
979}
980
982
983template <int dim, int spacedim>
984template <typename Number>
985void
987 const ReadVector<Number> &fe_function,
989 std::vector<Tensor<2, spacedim, Number>> &hessians) const
990{
991 Assert(this->update_flags & update_hessians,
992 ExcAccessToUninitializedField("update_hessians"));
993 AssertDimension(fe_function.size(), present_cell.n_dofs_for_dof_handler());
994 AssertDimension(indices.size(), dofs_per_cell);
995
996 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
997 auto view = make_array_view(dof_values.begin(), dof_values.end());
998 fe_function.extract_subvector_to(indices, view);
1000 this->finite_element_output.shape_hessians,
1001 hessians);
1002}
1003
1004
1005
1006template <int dim, int spacedim>
1007template <typename Number>
1008void
1010 const ReadVector<Number> &fe_function,
1011 std::vector<std::vector<Tensor<2, spacedim, Number>>> &hessians,
1012 const bool quadrature_points_fastest) const
1013{
1014 Assert(this->update_flags & update_hessians,
1015 ExcAccessToUninitializedField("update_hessians"));
1016 Assert(present_cell.is_initialized(), ExcNotReinited());
1017 AssertDimension(fe_function.size(), present_cell.n_dofs_for_dof_handler());
1018
1019 // get function values of dofs on this cell
1020 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
1021 auto view = make_array_view(dof_values.begin(), dof_values.end());
1022 present_cell.get_interpolated_dof_values(fe_function, view);
1024 view,
1025 this->finite_element_output.shape_hessians,
1026 *fe,
1027 this->finite_element_output.shape_function_to_row_table,
1028 make_array_view(hessians.begin(), hessians.end()),
1029 quadrature_points_fastest);
1030}
1031
1032
1033
1034template <int dim, int spacedim>
1035template <typename Number>
1036void
1038 const ReadVector<Number> &fe_function,
1040 ArrayView<std::vector<Tensor<2, spacedim, Number>>> hessians,
1041 const bool quadrature_points_fastest) const
1042{
1043 Assert(this->update_flags & update_hessians,
1044 ExcAccessToUninitializedField("update_hessians"));
1045 Assert(indices.size() % dofs_per_cell == 0,
1046 ExcNotMultiple(indices.size(), dofs_per_cell));
1047
1048 boost::container::small_vector<Number, 200> dof_values(indices.size());
1049 auto view = make_array_view(dof_values.begin(), dof_values.end());
1050 fe_function.extract_subvector_to(indices, view);
1052 view,
1053 this->finite_element_output.shape_hessians,
1054 *fe,
1055 this->finite_element_output.shape_function_to_row_table,
1056 make_array_view(hessians.begin(), hessians.end()),
1057 quadrature_points_fastest,
1058 indices.size() / dofs_per_cell);
1059}
1060
1061
1062
1063template <int dim, int spacedim>
1064template <typename Number>
1065void
1067 const ReadVector<Number> &fe_function,
1068 std::vector<Number> &laplacians) const
1069{
1070 Assert(this->update_flags & update_hessians,
1071 ExcAccessToUninitializedField("update_hessians"));
1072 AssertDimension(fe->n_components(), 1);
1073 Assert(present_cell.is_initialized(), ExcNotReinited());
1074 AssertDimension(fe_function.size(), present_cell.n_dofs_for_dof_handler());
1075
1076 // get function values of dofs on this cell
1077 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
1078 auto view = make_array_view(dof_values.begin(), dof_values.end());
1079 present_cell.get_interpolated_dof_values(fe_function, view);
1081 this->finite_element_output.shape_hessians,
1082 laplacians);
1083}
1084
1085
1086
1087template <int dim, int spacedim>
1088template <typename Number>
1089void
1091 const ReadVector<Number> &fe_function,
1093 std::vector<Number> &laplacians) const
1094{
1095 Assert(this->update_flags & update_hessians,
1096 ExcAccessToUninitializedField("update_hessians"));
1097 AssertDimension(fe->n_components(), 1);
1098 AssertDimension(indices.size(), dofs_per_cell);
1099
1100 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
1101 auto view = make_array_view(dof_values.begin(), dof_values.end());
1102 fe_function.extract_subvector_to(indices, view);
1104 this->finite_element_output.shape_hessians,
1105 laplacians);
1106}
1107
1108
1109
1110template <int dim, int spacedim>
1111template <typename Number>
1112void
1114 const ReadVector<Number> &fe_function,
1115 std::vector<Vector<Number>> &laplacians) const
1116{
1117 Assert(present_cell.is_initialized(), ExcNotReinited());
1118 Assert(this->update_flags & update_hessians,
1119 ExcAccessToUninitializedField("update_hessians"));
1120 AssertDimension(fe_function.size(), present_cell.n_dofs_for_dof_handler());
1121
1122 // get function values of dofs on this cell
1123 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
1124 auto view = make_array_view(dof_values.begin(), dof_values.end());
1125 present_cell.get_interpolated_dof_values(fe_function, view);
1127 view,
1128 this->finite_element_output.shape_hessians,
1129 *fe,
1130 this->finite_element_output.shape_function_to_row_table,
1131 laplacians);
1132}
1133
1134
1135
1136template <int dim, int spacedim>
1137template <typename Number>
1138void
1140 const ReadVector<Number> &fe_function,
1142 std::vector<Vector<Number>> &laplacians) const
1143{
1144 // Size of indices must be a multiple of dofs_per_cell such that an integer
1145 // number of function values is generated in each point.
1146 Assert(indices.size() % dofs_per_cell == 0,
1147 ExcNotMultiple(indices.size(), dofs_per_cell));
1148 Assert(this->update_flags & update_hessians,
1149 ExcAccessToUninitializedField("update_hessians"));
1150
1151 boost::container::small_vector<Number, 200> dof_values(indices.size());
1152 auto view = make_array_view(dof_values.begin(), dof_values.end());
1153 fe_function.extract_subvector_to(indices, view);
1155 view,
1156 this->finite_element_output.shape_hessians,
1157 *fe,
1158 this->finite_element_output.shape_function_to_row_table,
1159 laplacians,
1160 false,
1161 indices.size() / dofs_per_cell);
1162}
1163
1164
1165
1166template <int dim, int spacedim>
1167template <typename Number>
1168void
1170 const ReadVector<Number> &fe_function,
1172 std::vector<std::vector<Number>> &laplacians,
1173 const bool quadrature_points_fastest) const
1174{
1175 Assert(indices.size() % dofs_per_cell == 0,
1176 ExcNotMultiple(indices.size(), dofs_per_cell));
1177 Assert(this->update_flags & update_hessians,
1178 ExcAccessToUninitializedField("update_hessians"));
1179
1180 boost::container::small_vector<Number, 200> dof_values(indices.size());
1181 auto view = make_array_view(dof_values.begin(), dof_values.end());
1182 fe_function.extract_subvector_to(indices, view);
1184 view,
1185 this->finite_element_output.shape_hessians,
1186 *fe,
1187 this->finite_element_output.shape_function_to_row_table,
1188 laplacians,
1189 quadrature_points_fastest,
1190 indices.size() / dofs_per_cell);
1191}
1192
1193
1194
1195template <int dim, int spacedim>
1196template <typename Number>
1197void
1199 const ReadVector<Number> &fe_function,
1200 std::vector<Tensor<3, spacedim, Number>> &third_derivatives) const
1201{
1202 AssertDimension(fe->n_components(), 1);
1203 Assert(this->update_flags & update_3rd_derivatives,
1204 ExcAccessToUninitializedField("update_3rd_derivatives"));
1205 Assert(present_cell.is_initialized(), ExcNotReinited());
1206 AssertDimension(fe_function.size(), present_cell.n_dofs_for_dof_handler());
1207
1208 // get function values of dofs on this cell
1209 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
1210 auto view = make_array_view(dof_values.begin(), dof_values.end());
1211 present_cell.get_interpolated_dof_values(fe_function, view);
1213 view, this->finite_element_output.shape_3rd_derivatives, third_derivatives);
1214}
1215
1216
1217
1218template <int dim, int spacedim>
1219template <typename Number>
1220void
1222 const ReadVector<Number> &fe_function,
1224 std::vector<Tensor<3, spacedim, Number>> &third_derivatives) const
1225{
1226 Assert(this->update_flags & update_3rd_derivatives,
1227 ExcAccessToUninitializedField("update_3rd_derivatives"));
1228 AssertDimension(fe_function.size(), present_cell.n_dofs_for_dof_handler());
1229 AssertDimension(indices.size(), dofs_per_cell);
1230
1231 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
1232 auto view = make_array_view(dof_values.begin(), dof_values.end());
1233 fe_function.extract_subvector_to(indices, view);
1235 view, this->finite_element_output.shape_3rd_derivatives, third_derivatives);
1236}
1237
1238
1239
1240template <int dim, int spacedim>
1241template <typename Number>
1242void
1244 const ReadVector<Number> &fe_function,
1245 std::vector<std::vector<Tensor<3, spacedim, Number>>> &third_derivatives,
1246 const bool quadrature_points_fastest) const
1247{
1248 Assert(this->update_flags & update_3rd_derivatives,
1249 ExcAccessToUninitializedField("update_3rd_derivatives"));
1250 Assert(present_cell.is_initialized(), ExcNotReinited());
1251 AssertDimension(fe_function.size(), present_cell.n_dofs_for_dof_handler());
1252
1253 // get function values of dofs on this cell
1254 boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
1255 auto view = make_array_view(dof_values.begin(), dof_values.end());
1256 present_cell.get_interpolated_dof_values(fe_function, view);
1258 view,
1259 this->finite_element_output.shape_3rd_derivatives,
1260 *fe,
1261 this->finite_element_output.shape_function_to_row_table,
1262 make_array_view(third_derivatives.begin(), third_derivatives.end()),
1263 quadrature_points_fastest);
1264}
1265
1266
1267
1268template <int dim, int spacedim>
1269template <typename Number>
1270void
1272 const ReadVector<Number> &fe_function,
1274 ArrayView<std::vector<Tensor<3, spacedim, Number>>> third_derivatives,
1275 const bool quadrature_points_fastest) const
1276{
1277 Assert(this->update_flags & update_3rd_derivatives,
1278 ExcAccessToUninitializedField("update_3rd_derivatives"));
1279 Assert(indices.size() % dofs_per_cell == 0,
1280 ExcNotMultiple(indices.size(), dofs_per_cell));
1281
1282 boost::container::small_vector<Number, 200> dof_values(indices.size());
1283 auto view = make_array_view(dof_values.begin(), dof_values.end());
1284 fe_function.extract_subvector_to(indices, view);
1286 view,
1287 this->finite_element_output.shape_3rd_derivatives,
1288 *fe,
1289 this->finite_element_output.shape_function_to_row_table,
1290 make_array_view(third_derivatives.begin(), third_derivatives.end()),
1291 quadrature_points_fastest,
1292 indices.size() / dofs_per_cell);
1293}
1294
1295
1296
1297template <int dim, int spacedim>
1300{
1301 return present_cell;
1302}
1303
1304
1305
1306template <int dim, int spacedim>
1307const std::vector<Tensor<1, spacedim>> &
1309{
1310 Assert(this->update_flags & update_normal_vectors,
1312 "update_normal_vectors")));
1313
1314 return this->mapping_output.normal_vectors;
1315}
1316
1317
1318
1319template <int dim, int spacedim>
1320std::size_t
1322{
1323 return (sizeof(this->update_flags) +
1324 MemoryConsumption::memory_consumption(n_quadrature_points) +
1325 MemoryConsumption::memory_consumption(max_n_quadrature_points) +
1326 sizeof(cell_similarity) +
1335 MemoryConsumption::memory_consumption(finite_element_output));
1336}
1337
1338
1339
1340template <int dim, int spacedim>
1343 const UpdateFlags update_flags) const
1344{
1345 // first find out which objects need to be recomputed on each
1346 // cell we visit. this we have to ask the finite element and mapping.
1347 // elements are first since they might require update in mapping
1348 //
1349 // there is no need to iterate since mappings will never require
1350 // the finite element to compute something for them
1351 UpdateFlags flags = update_flags | fe->requires_update_flags(update_flags);
1352 flags |= mapping->requires_update_flags(flags);
1353
1354 return flags;
1355}
1356
1357
1358
1359template <int dim, int spacedim>
1360void
1362{
1363 // We cannot get here unless there is a cell to invalidate
1364 Assert(present_cell.is_initialized(), ExcInternalError());
1365
1366 present_cell = {};
1367 tria_listener_any_change.disconnect();
1368}
1369
1370
1371
1372template <int dim, int spacedim>
1373void
1376{
1377 if (present_cell.is_initialized())
1378 {
1379 const auto stored_cell =
1380 present_cell.
1382
1383 // There's no good way to check that the corresponding Triangulation
1384 // objects are still alive. approximate that by checking that the
1385 // partitioner isn't expired. If the Triangulation doesn't exist any more
1386 // this call may crash or the assertion may correctly fail (since there is
1387 // no more partitioner).
1388 Assert(!cell->get_triangulation()
1389 .global_active_cell_index_partitioner()
1390 .expired(),
1392 Assert(!stored_cell->get_triangulation()
1393 .global_active_cell_index_partitioner()
1394 .expired(),
1396 if (&cell->get_triangulation() != &stored_cell->get_triangulation())
1397 {
1398 // the triangulations for the previous cell and the current cell
1399 // do not match. disconnect from the previous triangulation and
1400 // connect to the current one; also invalidate the previous
1401 // cell because we shouldn't be comparing cells from different
1402 // triangulations
1403 invalidate_present_cell();
1404 tria_listener_any_change =
1405 cell->get_triangulation().signals.any_change.connect(
1406 [this]() { this->invalidate_present_cell(); });
1407 }
1408 }
1409 else
1410 {
1411 tria_listener_any_change =
1412 cell->get_triangulation().signals.any_change.connect(
1413 [this]() { this->invalidate_present_cell(); });
1414 }
1415}
1416
1417
1418
1419template <int dim, int spacedim>
1420void
1423{
1424 if (check_for_cell_similarity_allowed == false)
1425 {
1426 cell_similarity = CellSimilarity::none;
1427 return;
1428 }
1429
1430 // case that there has not been any cell before
1431 if (this->present_cell.is_initialized() == false)
1432 cell_similarity = CellSimilarity::none;
1433 else
1434 // in MappingQ, data can have been modified during the last call. Then, we
1435 // can't use that data on the new cell.
1436 if (cell_similarity == CellSimilarity::invalid_next_cell)
1437 cell_similarity = CellSimilarity::none;
1438 else
1439 cell_similarity =
1440 (cell->is_translation_of(
1441 static_cast<
1443 this->present_cell)) ?
1446
1447 if ((dim == spacedim - 1) && (cell_similarity == CellSimilarity::translation))
1448 {
1449 if (static_cast<const typename Triangulation<dim, spacedim>::cell_iterator
1450 &>(this->present_cell)
1451 ->direction_flag() != cell->direction_flag())
1452 cell_similarity = CellSimilarity::inverted_translation;
1453 }
1454 // TODO: here, one could implement other checks for similarity, e.g. for
1455 // children of a parallelogram.
1456}
1457
1458
1459
1460template <int dim, int spacedim>
1463{
1464 return cell_similarity;
1465}
1466
1467
1468
1469template <int dim, int spacedim>
1471
1472
1473
1474template <int dim, int spacedim>
1477/*-------------------------- Explicit Instantiations -------------------------*/
1478
1479
1480#include "fe/fe_values_base.inst"
1481
*  *  iterator begin()
ArrayView< std::remove_reference_t< typename std::iterator_traits< Iterator >::reference >, MemorySpaceType > make_array_view(const Iterator begin, const Iterator end)
iterator begin() const
Definition array_view.h:755
iterator end() const
Definition array_view.h:764
std::size_t size() const
Definition array_view.h:737
typename LevelSelector::cell_iterator level_cell_iterator
types::global_dof_index n_dofs_for_dof_handler() const
void get_interpolated_dof_values(const ReadVector< Number > &in, ArrayView< Number > out) const
CellSimilarity::Similarity cell_similarity
::internal::FEValuesViews::Cache< dim, spacedim > fe_values_views_cache
Triangulation< dim, spacedim >::cell_iterator get_cell() const
void get_function_values(const ReadVector< Number > &fe_function, std::vector< Number > &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)
virtual ~FEValuesBase() override
const unsigned int dofs_per_cell
void check_cell_similarity(const typename Triangulation< dim, spacedim >::cell_iterator &cell)
UpdateFlags update_flags
void get_function_hessians(const ReadVector< Number > &fe_function, std::vector< Tensor< 2, spacedim, Number > > &hessians) const
void always_allow_check_for_cell_similarity(const bool allow)
void get_function_laplacians(const ReadVector< Number > &fe_function, std::vector< Number > &laplacians) const
const unsigned int n_quadrature_points
CellSimilarity::Similarity get_cell_similarity() const
const std::vector< Tensor< 1, spacedim > > & get_normal_vectors() const
std::size_t memory_consumption() const
void get_function_third_derivatives(const ReadVector< Number > &fe_function, std::vector< Tensor< 3, spacedim, Number > > &third_derivatives) const
UpdateFlags compute_update_flags(const UpdateFlags update_flags) const
void get_function_gradients(const ReadVector< Number > &fe_function, std::vector< Tensor< 1, spacedim, Number > > &gradients) const
void invalidate_present_cell()
const ObserverPointer< const Mapping< dim, spacedim >, FEValuesBase< dim, spacedim > > mapping
bool check_for_cell_similarity_allowed
const ObserverPointer< const FiniteElement< dim, spacedim >, FEValuesBase< dim, spacedim > > fe
void maybe_invalidate_previous_present_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell)
const unsigned int max_n_quadrature_points
unsigned int n_dofs_per_cell() const
unsigned int n_components() const
const ComponentMask & get_nonzero_components(const unsigned int i) const
bool is_primitive() const
virtual UpdateFlags requires_update_flags(const UpdateFlags update_flags) const =0
std::pair< unsigned int, unsigned int > system_to_component_index(const unsigned int index) const
unsigned int n_nonzero_components(const unsigned int i) const
Abstract base class for mapping classes.
Definition mapping.h:318
virtual void extract_subvector_to(const ArrayView< const types::global_dof_index > &indices, const ArrayView< Number > &elements) const =0
virtual size_type size() const =0
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:38
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:39
#define DEAL_II_ASSERT_UNREACHABLE()
static ::ExceptionBase & ExcNotMultiple(int arg1, int arg2)
#define Assert(cond, exc)
static ::ExceptionBase & ExcNotReinited()
#define AssertDimension(dim1, dim2)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcMessage(std::string arg1)
typename ActiveSelector::cell_iterator cell_iterator
TriaIterator< CellAccessor< dim, spacedim > > cell_iterator
Definition tria.h:1621
UpdateFlags
@ update_hessians
Second derivatives of shape functions.
@ update_values
Shape function values.
@ update_normal_vectors
Normal vectors.
@ update_3rd_derivatives
Third derivatives of shape functions.
@ update_gradients
Shape function gradients.
std::size_t size
Definition mpi.cc:733
std::enable_if_t< std::is_fundamental_v< T >, std::size_t > memory_consumption(const T &t)
*  *  *  RotationFunction< dim, Number >::RotationFunction Number(dim)
void do_function_laplacians(const ArrayView< Number2 > &dof_values, const ::Table< 2, Tensor< 2, spacedim > > &shape_hessians, std::vector< Number > &laplacians)
void do_function_derivatives(const ArrayView< Number > &dof_values, const ::Table< 2, Tensor< order, spacedim > > &shape_derivatives, std::vector< Tensor< order, spacedim, Number > > &derivatives)
std::vector< unsigned int > make_shape_function_to_row_table(const FiniteElement< dim, spacedim > &fe)
void do_function_values(const ArrayView< Number2 > &dof_values, const ::Table< 2, double > &shape_values, std::vector< Number > &values)
constexpr types::global_dof_index invalid_dof_index
Definition types.h:259
constexpr unsigned int invalid_unsigned_int
Definition types.h:228
STL namespace.
static constexpr const T & value(const T &t)
Definition numbers.h:662
constexpr Number trace(const SymmetricTensor< 2, dim2, Number > &)