Reference documentation for deal.II version GIT relicensing-422-gb369f187d8 2024-04-17 18:10:02+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
mapping_q_cache.cc
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 2019 - 2023 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Part of the source code is dual licensed under Apache-2.0 WITH
9// LLVM-exception OR LGPL-2.1-or-later. Detailed license information
10// governing the source code and code contributions can be found in
11// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
12//
13// ------------------------------------------------------------------------
14
18
20
21#include <deal.II/fe/fe_dgq.h>
23#include <deal.II/fe/fe_q.h>
24#include <deal.II/fe/fe_tools.h>
27
31
32#include <functional>
33
35
36template <int dim, int spacedim>
38 const unsigned int polynomial_degree)
39 : MappingQ<dim, spacedim>(polynomial_degree)
40 , uses_level_info(false)
41{}
42
43
44
45template <int dim, int spacedim>
47 const MappingQCache<dim, spacedim> &mapping)
48 : MappingQ<dim, spacedim>(mapping)
49 , support_point_cache(mapping.support_point_cache)
50 , uses_level_info(mapping.uses_level_info)
51{}
52
53
54
55template <int dim, int spacedim>
57{
58 // When this object goes out of scope, we want the cache to get cleared and
59 // free its memory before the signal is disconnected in order to not work on
60 // invalid memory that has been left back by freeing an object of this
61 // class.
62 support_point_cache.reset();
63 clear_signal.disconnect();
64}
65
66
67
68template <int dim, int spacedim>
69std::unique_ptr<Mapping<dim, spacedim>>
71{
72 return std::make_unique<MappingQCache<dim, spacedim>>(*this);
73}
74
75
76
77template <int dim, int spacedim>
78bool
83
84
85
86template <int dim, int spacedim>
87void
89 const Mapping<dim, spacedim> &mapping,
91{
92 // FE and FEValues in the case they are needed
95 fe_values_all;
96
97 this->initialize(
99 [&](const typename Triangulation<dim, spacedim>::cell_iterator &cell) {
100 const auto mapping_q =
101 dynamic_cast<const MappingQ<dim, spacedim> *>(&mapping);
102 if (mapping_q != nullptr && this->get_degree() == mapping_q->get_degree())
103 {
104 return mapping_q->compute_mapping_support_points(cell);
105 }
106 else
107 {
108 // get FEValues (thread-safe); in the case that this thread has not
109 // created a an FEValues object yet, this helper-function also
110 // creates one with the right quadrature rule
111 auto &fe_values = fe_values_all.get();
112 if (fe_values.get() == nullptr)
113 {
114 QGaussLobatto<dim> quadrature_gl(this->polynomial_degree + 1);
115
116 std::vector<Point<dim>> quadrature_points;
117 for (const auto i :
118 FETools::hierarchic_to_lexicographic_numbering<dim>(
119 this->polynomial_degree))
120 quadrature_points.push_back(quadrature_gl.point(i));
121 Quadrature<dim> quadrature(quadrature_points);
122
123 fe_values = std::make_unique<FEValues<dim, spacedim>>(
124 mapping, fe, quadrature, update_quadrature_points);
125 }
126
127 fe_values->reinit(cell);
128 return fe_values->get_quadrature_points();
129 }
130 });
131}
132
133
134
135template <int dim, int spacedim>
136void
139 const std::function<std::vector<Point<spacedim>>(
141 &compute_points_on_cell)
142{
143 clear_signal.disconnect();
144 clear_signal = triangulation.signals.any_change.connect(
145 [&]() -> void { this->support_point_cache.reset(); });
146
147 support_point_cache =
148 std::make_shared<std::vector<std::vector<std::vector<Point<spacedim>>>>>(
149 triangulation.n_levels());
150 for (unsigned int l = 0; l < triangulation.n_levels(); ++l)
151 (*support_point_cache)[l].resize(triangulation.n_raw_cells(l));
152
154 triangulation.begin(),
155 triangulation.end(),
156 [&](const typename Triangulation<dim, spacedim>::cell_iterator &cell,
157 void *,
158 void *) {
159 (*support_point_cache)[cell->level()][cell->index()] =
160 compute_points_on_cell(cell);
161 AssertDimension(
162 (*support_point_cache)[cell->level()][cell->index()].size(),
163 Utilities::pow(this->get_degree() + 1, dim));
164 },
165 /* copier */ std::function<void(void *)>(),
166 /* scratch_data */ nullptr,
167 /* copy_data */ nullptr,
169 /* chunk_size = */ 1);
170
171 uses_level_info = true;
172}
173
174
175
176template <int dim, int spacedim>
177void
179 const Mapping<dim, spacedim> &mapping,
181 const std::function<Point<spacedim>(
183 const Point<spacedim> &)> &transformation_function,
184 const bool function_describes_relative_displacement)
185{
186 // FE and FEValues in the case they are needed
189 fe_values_all;
190
191 this->initialize(
192 tria,
193 [&](const typename Triangulation<dim, spacedim>::cell_iterator &cell) {
194 std::vector<Point<spacedim>> points;
195
196 const auto mapping_q =
197 dynamic_cast<const MappingQ<dim, spacedim> *>(&mapping);
198
199 if (mapping_q != nullptr && this->get_degree() == mapping_q->get_degree())
200 {
201 points = mapping_q->compute_mapping_support_points(cell);
202 }
203 else
204 {
205 // get FEValues (thread-safe); in the case that this thread has not
206 // created a an FEValues object yet, this helper-function also
207 // creates one with the right quadrature rule
208 auto &fe_values = fe_values_all.get();
209 if (fe_values.get() == nullptr)
210 {
211 QGaussLobatto<dim> quadrature_gl(this->polynomial_degree + 1);
212
213 std::vector<Point<dim>> quadrature_points;
214 for (const auto i :
215 FETools::hierarchic_to_lexicographic_numbering<dim>(
216 this->polynomial_degree))
217 quadrature_points.push_back(quadrature_gl.point(i));
218 Quadrature<dim> quadrature(quadrature_points);
219
220 fe_values = std::make_unique<FEValues<dim, spacedim>>(
221 mapping, fe, quadrature, update_quadrature_points);
222 }
223
224 fe_values->reinit(cell);
225 points = fe_values->get_quadrature_points();
226 }
227
228 for (auto &p : points)
229 if (function_describes_relative_displacement)
230 p += transformation_function(cell, p);
231 else
232 p = transformation_function(cell, p);
233
234 return points;
235 });
236
237 uses_level_info = true;
238}
239
240
241
242template <int dim, int spacedim>
243void
245 const Mapping<dim, spacedim> &mapping,
247 const Function<spacedim> &transformation_function,
248 const bool function_describes_relative_displacement)
249{
250 AssertDimension(transformation_function.n_components, spacedim);
251
252 this->initialize(
253 mapping,
254 tria,
255 [&](const auto &, const auto &point) {
256 Point<spacedim> new_point;
257 for (unsigned int c = 0; c < spacedim; ++c)
258 new_point[c] = transformation_function.value(point, c);
259 return new_point;
260 },
261 function_describes_relative_displacement);
262
263 uses_level_info = true;
264}
265
266
267
268namespace
269{
270 template <typename VectorType>
271 void
272 copy_locally_owned_data_from(
273 const VectorType &vector,
275 &vector_ghosted)
276 {
278 temp.reinit(vector.locally_owned_elements());
280 vector_ghosted.import_elements(temp, VectorOperation::insert);
281 }
282} // namespace
283
284
285
286template <int dim, int spacedim>
287template <typename VectorType>
288void
290 const Mapping<dim, spacedim> &mapping,
291 const DoFHandler<dim, spacedim> &dof_handler,
292 const VectorType &vector,
293 const bool vector_describes_relative_displacement)
294{
295 AssertDimension(dof_handler.get_fe_collection().size(), 1);
296 const FiniteElement<dim, spacedim> &fe = dof_handler.get_fe();
298 AssertDimension(fe.element_multiplicity(0), spacedim);
299
300 const unsigned int is_fe_q =
301 dynamic_cast<const FE_Q<dim, spacedim> *>(&fe.base_element(0)) != nullptr;
302 const unsigned int is_fe_dgq =
303 dynamic_cast<const FE_DGQ<dim, spacedim> *>(&fe.base_element(0)) != nullptr;
304
305 const auto lexicographic_to_hierarchic_numbering =
307 FETools::hierarchic_to_lexicographic_numbering<spacedim>(
308 this->get_degree()));
309
310 // Step 1: copy global vector so that the ghost values are such that the
311 // cache can be set up for all ghost cells
313 vector_ghosted;
314 const IndexSet locally_relevant_dofs =
316 vector_ghosted.reinit(dof_handler.locally_owned_dofs(),
317 locally_relevant_dofs,
318 dof_handler.get_communicator());
319 copy_locally_owned_data_from(vector, vector_ghosted);
320 vector_ghosted.update_ghost_values();
321
322 // FE and FEValues in the case they are needed
323 FE_Nothing<dim, spacedim> fe_nothing;
325 fe_values_all;
326
327 // Interpolation of values is needed if we cannot just read off locations
328 // from the solution vectors (as in the case of FE_Q and FE_DGQ with the
329 // same polynomial degree as this class has).
330 const bool interpolation_of_values_is_needed =
331 ((is_fe_q || is_fe_dgq) && fe.degree == this->get_degree()) == false;
332
333 // Step 2: loop over all cells
334 this->initialize(
335 dof_handler.get_triangulation(),
336 [&](const typename Triangulation<dim, spacedim>::cell_iterator &cell_tria)
337 -> std::vector<Point<spacedim>> {
338 const bool is_active_non_artificial_cell =
339 (cell_tria->is_active() == true) &&
340 (cell_tria->is_artificial() == false);
341
342 const typename DoFHandler<dim, spacedim>::cell_iterator cell_dofs(
343 &cell_tria->get_triangulation(),
344 cell_tria->level(),
345 cell_tria->index(),
346 &dof_handler);
347
348 const auto mapping_q =
349 dynamic_cast<const MappingQ<dim, spacedim> *>(&mapping);
350
351 // Step 2a) set up and reinit FEValues (if needed)
352 if (
353 ((vector_describes_relative_displacement ||
354 (is_active_non_artificial_cell == false)) &&
355 ((mapping_q != nullptr &&
356 this->get_degree() == mapping_q->get_degree()) ==
357 false)) /*condition 1: points need to be computed via FEValues*/
358 ||
359 (is_active_non_artificial_cell && interpolation_of_values_is_needed) /*condition 2: interpolation of values is needed*/)
360 {
361 // get FEValues (thread-safe); in the case that this thread has
362 // not created a an FEValues object yet, this helper-function also
363 // creates one with the right quadrature rule
364 auto &fe_values = fe_values_all.get();
365 if (fe_values.get() == nullptr)
366 {
367 QGaussLobatto<dim> quadrature_gl(this->polynomial_degree + 1);
368
369 std::vector<Point<dim>> quadrature_points;
370 for (const auto i :
371 FETools::hierarchic_to_lexicographic_numbering<dim>(
372 this->polynomial_degree))
373 quadrature_points.push_back(quadrature_gl.point(i));
374 Quadrature<dim> quadrature(quadrature_points);
375
376 fe_values = std::make_unique<FEValues<dim, spacedim>>(
377 mapping,
378 interpolation_of_values_is_needed ?
379 fe :
380 static_cast<const FiniteElement<dim, spacedim> &>(fe_nothing),
381 quadrature,
382 update_quadrature_points | update_values);
383 }
384
385 if (interpolation_of_values_is_needed)
386 fe_values->reinit(cell_dofs);
387 else
388 fe_values->reinit(cell_tria);
389 }
390
391 std::vector<Point<spacedim>> result;
392
393 // Step 2b) read of quadrature points in the relative displacement case
394 // note: we also take this path for non-active or artificial cells so that
395 // these cells are filled with some useful data
396 if (vector_describes_relative_displacement ||
397 is_active_non_artificial_cell == false)
398 {
399 if (mapping_q != nullptr &&
400 this->get_degree() == mapping_q->get_degree())
401 result = mapping_q->compute_mapping_support_points(cell_tria);
402 else
403 result = fe_values_all.get()->get_quadrature_points();
404
405 // for non-active or artificial cells we are done here and return
406 // the absolute positions, since the provided vector cannot contain
407 // any useful information for these cells
408 if (is_active_non_artificial_cell == false)
409 return result;
410 }
411 else
412 {
413 result.resize(
414 Utilities::pow<unsigned int>(this->get_degree() + 1, dim));
415 }
416
417 // Step 2c) read global vector and adjust points accordingly
418 if (interpolation_of_values_is_needed == false)
419 {
420 // case 1: FE_Q or FE_DGQ with same degree as this class has; this
421 // is the simple case since no interpolation is needed
422 std::vector<types::global_dof_index> dof_indices(
423 fe.n_dofs_per_cell());
424 cell_dofs->get_dof_indices(dof_indices);
425
426 for (unsigned int i = 0; i < dof_indices.size(); ++i)
427 {
428 const auto id = fe.system_to_component_index(i);
429
430 if (is_fe_q)
431 {
432 // case 1a: FE_Q
433 if (vector_describes_relative_displacement)
434 result[id.second][id.first] +=
435 vector_ghosted(dof_indices[i]);
436 else
437 result[id.second][id.first] =
438 vector_ghosted(dof_indices[i]);
439 }
440 else
441 {
442 // case 1b: FE_DGQ
443 if (vector_describes_relative_displacement)
444 result[lexicographic_to_hierarchic_numbering[id.second]]
445 [id.first] += vector_ghosted(dof_indices[i]);
446 else
447 result[lexicographic_to_hierarchic_numbering[id.second]]
448 [id.first] = vector_ghosted(dof_indices[i]);
449 }
450 }
451 }
452 else
453 {
454 // case 2: general case; interpolation is needed
455 // note: the following code could be optimized for tensor-product
456 // elements via application of sum factorization as is done on
457 // MatrixFree/FEEvaluation
458 auto &fe_values = fe_values_all.get();
459
460 std::vector<Vector<typename VectorType::value_type>> values(
461 fe_values->n_quadrature_points,
463
464 fe_values->get_function_values(vector_ghosted, values);
465
466 for (unsigned int q = 0; q < fe_values->n_quadrature_points; ++q)
467 for (unsigned int c = 0; c < spacedim; ++c)
468 if (vector_describes_relative_displacement)
469 result[q][c] += values[q][c];
470 else
471 result[q][c] = values[q][c];
472 }
473
474 return result;
475 });
476
477 uses_level_info = false;
478}
479
480
481
482template <int dim, int spacedim>
483template <typename VectorType>
484void
486 const Mapping<dim, spacedim> &mapping,
487 const DoFHandler<dim, spacedim> &dof_handler,
488 const MGLevelObject<VectorType> &vectors,
489 const bool vector_describes_relative_displacement)
490{
491 AssertDimension(dof_handler.get_fe_collection().size(), 1);
492 const FiniteElement<dim, spacedim> &fe = dof_handler.get_fe();
494 AssertDimension(fe.element_multiplicity(0), spacedim);
495 AssertDimension(0, vectors.min_level());
497 vectors.max_level());
498
499 const unsigned int is_fe_q =
500 dynamic_cast<const FE_Q<dim, spacedim> *>(&fe.base_element(0)) != nullptr;
501 const unsigned int is_fe_dgq =
502 dynamic_cast<const FE_DGQ<dim, spacedim> *>(&fe.base_element(0)) != nullptr;
503
504 const auto lexicographic_to_hierarchic_numbering =
506 FETools::hierarchic_to_lexicographic_numbering<spacedim>(
507 this->get_degree()));
508
509 // Step 1: copy global vector so that the ghost values are such that the
510 // cache can be set up for all ghost cells
513 vectors_ghosted(vectors.min_level(), vectors.max_level());
514
515 for (unsigned int l = vectors.min_level(); l <= vectors.max_level(); ++l)
516 {
517 const IndexSet locally_relevant_dofs =
519 vectors_ghosted[l].reinit(dof_handler.locally_owned_mg_dofs(l),
520 locally_relevant_dofs,
521 dof_handler.get_communicator());
522 copy_locally_owned_data_from(vectors[l], vectors_ghosted[l]);
523 vectors_ghosted[l].update_ghost_values();
524 }
525
526 // FE and FEValues in the case they are needed
527 FE_Nothing<dim, spacedim> fe_nothing;
529 fe_values_all;
530
531 // Interpolation of values is needed if we cannot just read off locations
532 // from the solution vectors (as in the case of FE_Q and FE_DGQ with the
533 // same polynomial degree as this class has).
534 const bool interpolation_of_values_is_needed =
535 ((is_fe_q || is_fe_dgq) && fe.degree == this->get_degree()) == false;
536
537 // Step 2: loop over all cells
538 this->initialize(
539 dof_handler.get_triangulation(),
540 [&](const typename Triangulation<dim, spacedim>::cell_iterator &cell_tria)
541 -> std::vector<Point<spacedim>> {
542 const bool is_non_artificial_cell =
543 cell_tria->level_subdomain_id() != numbers::artificial_subdomain_id;
544
545 const typename DoFHandler<dim, spacedim>::level_cell_iterator cell_dofs(
546 &cell_tria->get_triangulation(),
547 cell_tria->level(),
548 cell_tria->index(),
549 &dof_handler);
550
551 const auto mapping_q =
552 dynamic_cast<const MappingQ<dim, spacedim> *>(&mapping);
553
554 // Step 2a) set up and reinit FEValues (if needed)
555 if (
556 ((vector_describes_relative_displacement ||
557 (is_non_artificial_cell == false)) &&
558 ((mapping_q != nullptr &&
559 this->get_degree() == mapping_q->get_degree()) ==
560 false)) /*condition 1: points need to be computed via FEValues*/
561 ||
562 (is_non_artificial_cell == true && interpolation_of_values_is_needed) /*condition 2: interpolation of values is needed*/)
563 {
564 // get FEValues (thread-safe); in the case that this thread has
565 // not created a an FEValues object yet, this helper-function also
566 // creates one with the right quadrature rule
567 auto &fe_values = fe_values_all.get();
568 if (fe_values.get() == nullptr)
569 {
570 QGaussLobatto<dim> quadrature_gl(this->polynomial_degree + 1);
571
572 std::vector<Point<dim>> quadrature_points;
573 for (const auto i :
574 FETools::hierarchic_to_lexicographic_numbering<dim>(
575 this->polynomial_degree))
576 quadrature_points.push_back(quadrature_gl.point(i));
577 Quadrature<dim> quadrature(quadrature_points);
578
579 fe_values = std::make_unique<FEValues<dim, spacedim>>(
580 mapping,
581 interpolation_of_values_is_needed ?
582 fe :
583 static_cast<const FiniteElement<dim, spacedim> &>(fe_nothing),
584 quadrature,
585 update_quadrature_points | update_values);
586 }
587
588 if (interpolation_of_values_is_needed)
589 fe_values->reinit(cell_dofs);
590 else
591 fe_values->reinit(cell_tria);
592 }
593
594 std::vector<Point<spacedim>> result;
595
596 // Step 2b) read of quadrature points in the relative displacement case
597 // note: we also take this path for non-active or artificial cells so that
598 // these cells are filled with some useful data
599 if (vector_describes_relative_displacement ||
600 (is_non_artificial_cell == false))
601 {
602 if (mapping_q != nullptr &&
603 this->get_degree() == mapping_q->get_degree())
604 result = mapping_q->compute_mapping_support_points(cell_tria);
605 else
606 result = fe_values_all.get()->get_quadrature_points();
607
608 // for non-active or artificial cells we are done here and return
609 // the absolute positions, since the provided vector cannot contain
610 // any useful information for these cells
611 if (is_non_artificial_cell == false)
612 return result;
613 }
614 else
615 {
616 result.resize(
617 Utilities::pow<unsigned int>(this->get_degree() + 1, dim));
618 }
619
620 // Step 2c) read global vector and adjust points accordingly
621 if (interpolation_of_values_is_needed == false)
622 {
623 // case 1: FE_Q or FE_DGQ with same degree as this class has; this
624 // is the simple case since no interpolation is needed
625 std::vector<types::global_dof_index> dof_indices(
626 fe.n_dofs_per_cell());
627 cell_dofs->get_mg_dof_indices(dof_indices);
628
629 for (unsigned int i = 0; i < dof_indices.size(); ++i)
630 {
631 const auto id = fe.system_to_component_index(i);
632
633 if (is_fe_q)
634 {
635 // case 1a: FE_Q
636 if (vector_describes_relative_displacement)
637 result[id.second][id.first] +=
638 vectors_ghosted[cell_tria->level()](dof_indices[i]);
639 else
640 result[id.second][id.first] =
641 vectors_ghosted[cell_tria->level()](dof_indices[i]);
642 }
643 else
644 {
645 // case 1b: FE_DGQ
646 if (vector_describes_relative_displacement)
647 result[lexicographic_to_hierarchic_numbering[id.second]]
648 [id.first] +=
649 vectors_ghosted[cell_tria->level()](dof_indices[i]);
650 else
651 result[lexicographic_to_hierarchic_numbering[id.second]]
652 [id.first] =
653 vectors_ghosted[cell_tria->level()](dof_indices[i]);
654 }
655 }
656 }
657 else
658 {
659 // case 2: general case; interpolation is needed
660 // note: the following code could be optimized for tensor-product
661 // elements via application of sum factorization as is done on
662 // MatrixFree/FEEvaluation
663 auto &fe_values = fe_values_all.get();
664
665 std::vector<types::global_dof_index> dof_indices(
666 fe.n_dofs_per_cell());
667 cell_dofs->get_mg_dof_indices(dof_indices);
668
669 std::vector<typename VectorType::value_type> dof_values(
670 fe.n_dofs_per_cell());
671
672 for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i)
673 dof_values[i] = vectors_ghosted[cell_tria->level()](dof_indices[i]);
674
675 for (unsigned int c = 0; c < spacedim; ++c)
676 for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i)
677 for (unsigned int q = 0; q < fe_values->n_quadrature_points; ++q)
678 if (vector_describes_relative_displacement == false && i == 0)
679 result[q][c] =
680 dof_values[i] * fe_values->shape_value_component(i, q, c);
681 else
682 result[q][c] +=
683 dof_values[i] * fe_values->shape_value_component(i, q, c);
684 }
685
686 return result;
687 });
688
689 uses_level_info = true;
690}
691
692
693
694template <int dim, int spacedim>
695std::size_t
697{
698 if (support_point_cache.get() != nullptr)
699 return sizeof(*this) +
700 MemoryConsumption::memory_consumption(*support_point_cache);
701 else
702 return sizeof(*this);
703}
704
705
706
707template <int dim, int spacedim>
708std::vector<Point<spacedim>>
710 const typename Triangulation<dim, spacedim>::cell_iterator &cell) const
711{
712 Assert(support_point_cache.get() != nullptr,
713 ExcMessage("Must call MappingQCache::initialize() before "
714 "using it or after mesh has changed!"));
715
716 Assert(uses_level_info || cell->is_active(), ExcInternalError());
717
718 AssertIndexRange(cell->level(), support_point_cache->size());
719 AssertIndexRange(cell->index(), (*support_point_cache)[cell->level()].size());
720 return (*support_point_cache)[cell->level()][cell->index()];
721}
722
723
724
725template <int dim, int spacedim>
726boost::container::small_vector<Point<spacedim>,
729 const typename Triangulation<dim, spacedim>::cell_iterator &cell) const
730{
731 Assert(support_point_cache.get() != nullptr,
732 ExcMessage("Must call MappingQCache::initialize() before "
733 "using it or after mesh has changed!"));
734
735 Assert(uses_level_info || cell->is_active(), ExcInternalError());
736
737 AssertIndexRange(cell->level(), support_point_cache->size());
738 AssertIndexRange(cell->index(), (*support_point_cache)[cell->level()].size());
739 const auto ptr = (*support_point_cache)[cell->level()][cell->index()].begin();
740 return boost::container::small_vector<Point<spacedim>,
742 ptr, ptr + cell->n_vertices());
743}
744
745
746
747//--------------------------- Explicit instantiations -----------------------
748#include "mapping_q_cache.inst"
749
750
const hp::FECollection< dim, spacedim > & get_fe_collection() const
const FiniteElement< dim, spacedim > & get_fe(const types::fe_index index=0) const
const IndexSet & locally_owned_mg_dofs(const unsigned int level) const
const Triangulation< dim, spacedim > & get_triangulation() const
const IndexSet & locally_owned_dofs() const
MPI_Comm get_communicator() const
Definition fe_q.h:550
const unsigned int degree
Definition fe_data.h:452
unsigned int n_dofs_per_cell() const
virtual const FiniteElement< dim, spacedim > & base_element(const unsigned int index) const
std::pair< unsigned int, unsigned int > system_to_component_index(const unsigned int index) const
unsigned int element_multiplicity(const unsigned int index) const
unsigned int n_base_elements() const
const unsigned int n_components
Definition function.h:163
virtual RangeNumberType value(const Point< dim > &p, const unsigned int component=0) const
void import_elements(const ::Vector< Number > &vec, VectorOperation::values operation, const std::shared_ptr< const Utilities::MPI::CommunicationPatternBase > &communication_pattern={})
virtual void reinit(const size_type size, const bool omit_zeroing_entries=false)
void import_elements(const Vector< Number, MemorySpace2 > &src, VectorOperation::values operation)
void reinit(const size_type size, const bool omit_zeroing_entries=false)
unsigned int max_level() const
unsigned int min_level() const
std::size_t memory_consumption() const
virtual boost::container::small_vector< Point< spacedim >, GeometryInfo< dim >::vertices_per_cell > get_vertices(const typename Triangulation< dim, spacedim >::cell_iterator &cell) const override
virtual bool preserves_vertex_locations() const override
virtual std::vector< Point< spacedim > > compute_mapping_support_points(const typename Triangulation< dim, spacedim >::cell_iterator &cell) const override
virtual std::unique_ptr< Mapping< dim, spacedim > > clone() const override
void initialize(const Mapping< dim, spacedim > &mapping, const Triangulation< dim, spacedim > &triangulation)
virtual std::vector< Point< spacedim > > compute_mapping_support_points(const typename Triangulation< dim, spacedim >::cell_iterator &cell) const
friend class MappingQCache
Definition mapping_q.h:681
Abstract base class for mapping classes.
Definition mapping.h:318
static unsigned int n_threads()
Definition point.h:111
A class that provides a separate storage location on each thread that accesses the object.
virtual unsigned int n_global_levels() const
unsigned int size() const
Definition collection.h:264
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:502
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:503
#define Assert(cond, exc)
#define AssertDimension(dim1, dim2)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcMessage(std::string arg1)
@ update_quadrature_points
Transformed quadrature points.
IndexSet extract_locally_relevant_dofs(const DoFHandler< dim, spacedim > &dof_handler)
IndexSet extract_locally_relevant_level_dofs(const DoFHandler< dim, spacedim > &dof_handler, const unsigned int level)
std::enable_if_t< std::is_fundamental_v< T >, std::size_t > memory_consumption(const T &t)
std::vector< Integer > invert_permutation(const std::vector< Integer > &permutation)
Definition utilities.h:1699
void run(const std::vector< std::vector< Iterator > > &colored_iterators, Worker worker, Copier copier, const ScratchData &sample_scratch_data, const CopyData &sample_copy_data, const unsigned int queue_length=2 *MultithreadInfo::n_threads(), const unsigned int chunk_size=8)
const ::parallel::distributed::Triangulation< dim, spacedim > * triangulation