deal.II version GIT relicensing-6842-g793a97d2aa 2026-10-02 14:00: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
point_value_history.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) 2009 - 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
14
22#include <deal.II/lac/vector.h>
24
27
28#include <algorithm>
29
30
32
33
34namespace internal
35{
36 namespace PointValueHistoryImplementation
37 {
38 template <int dim>
40 const Point<dim> &new_requested_location,
41 const std::vector<Point<dim>> &new_locations,
42 const std::vector<types::global_dof_index> &new_sol_indices)
43 {
44 requested_location = new_requested_location;
45 support_point_locations = new_locations;
46 solution_indices = new_sol_indices;
47 }
48 } // namespace PointValueHistoryImplementation
49} // namespace internal
50
51
52
53template <int dim>
55 const unsigned int n_independent_variables)
56 : n_indep(n_independent_variables)
57{
58 closed = false;
59 cleared = false;
61 have_dof_handler = false;
62
63 // make a vector for keys
64 dataset_key = std::vector<double>(); // initialize the std::vector
65
66 // make a vector of independent values
68 std::vector<std::vector<double>>(n_indep, std::vector<double>(0));
69 indep_names = std::vector<std::string>();
70}
71
72
73
74template <int dim>
76 const DoFHandler<dim> &dof_handler,
77 const unsigned int n_independent_variables)
78 : dof_handler(&dof_handler)
79 , n_indep(n_independent_variables)
80{
81 closed = false;
82 cleared = false;
84 have_dof_handler = true;
85
86 // make a vector to store keys
87 dataset_key = std::vector<double>(); // initialize the std::vector
88
89 // make a vector for the independent values
91 std::vector<std::vector<double>>(n_indep, std::vector<double>(0));
92 indep_names = std::vector<std::string>();
93
94 tria_listener = dof_handler.get_triangulation().signals.any_change.connect(
95 [this]() { this->tria_change_listener(); });
96}
97
98
99
100template <int dim>
102 const PointValueHistory &point_value_history)
103{
104 dataset_key = point_value_history.dataset_key;
105 independent_values = point_value_history.independent_values;
106 indep_names = point_value_history.indep_names;
107 data_store = point_value_history.data_store;
108 component_mask = point_value_history.component_mask;
109 component_names_map = point_value_history.component_names_map;
110 point_geometry_data = point_value_history.point_geometry_data;
111
112 closed = point_value_history.closed;
113 cleared = point_value_history.cleared;
114
115 dof_handler = point_value_history.dof_handler;
116
117 triangulation_changed = point_value_history.triangulation_changed;
118 have_dof_handler = point_value_history.have_dof_handler;
119 n_indep = point_value_history.n_indep;
120
121 // What to do with tria_listener?
122 // Presume subscribe new instance?
123 if (have_dof_handler)
124 {
125 tria_listener =
126 dof_handler->get_triangulation().signals.any_change.connect(
127 [this]() { this->tria_change_listener(); });
128 }
129}
130
131
132
133template <int dim>
136{
137 dataset_key = point_value_history.dataset_key;
138 independent_values = point_value_history.independent_values;
139 indep_names = point_value_history.indep_names;
140 data_store = point_value_history.data_store;
141 component_mask = point_value_history.component_mask;
142 component_names_map = point_value_history.component_names_map;
143 point_geometry_data = point_value_history.point_geometry_data;
144
145 closed = point_value_history.closed;
146 cleared = point_value_history.cleared;
147
148 dof_handler = point_value_history.dof_handler;
149
150 triangulation_changed = point_value_history.triangulation_changed;
151 have_dof_handler = point_value_history.have_dof_handler;
152 n_indep = point_value_history.n_indep;
153
154 // What to do with tria_listener?
155 // Presume subscribe new instance?
156 if (have_dof_handler)
157 {
158 tria_listener =
159 dof_handler->get_triangulation().signals.any_change.connect(
160 [this]() { this->tria_change_listener(); });
161 }
162
163 return *this;
164}
165
166
167
168template <int dim>
170{
171 if (have_dof_handler)
172 {
173 tria_listener.disconnect();
174 }
175}
176
177
178
179template <int dim>
180void
182{
183 // can't be closed to add additional points
184 // or vectors
185 AssertThrow(!closed, ExcInvalidState());
186 AssertThrow(!cleared, ExcInvalidState());
187 AssertThrow(have_dof_handler, ExcDoFHandlerRequired());
188 AssertThrow(!triangulation_changed, ExcDoFHandlerChanged());
189
190 // Implementation assumes that support
191 // points locations are dofs locations
192 AssertThrow(dof_handler->get_fe().has_support_points(), ExcNotImplemented());
193
194 // While in general quadrature points seems
195 // to refer to Gauss quadrature points, in
196 // this case the quadrature points are
197 // forced to be the support points of the
198 // FE.
199 Quadrature<dim> support_point_quadrature(
200 dof_handler->get_fe().get_unit_support_points());
201 FEValues<dim> fe_values(dof_handler->get_fe(),
202 support_point_quadrature,
204 unsigned int n_support_points =
205 dof_handler->get_fe().get_unit_support_points().size();
206 unsigned int n_components = dof_handler->get_fe(0).n_components();
207
208 // set up a loop over all the cells in the
209 // DoFHandler
211 dof_handler->begin_active();
212 typename DoFHandler<dim>::active_cell_iterator endc = dof_handler->end();
213
214 // default values to be replaced as closer
215 // points are found however they need to be
216 // consistent in case they are actually
217 // chosen
218 typename DoFHandler<dim>::active_cell_iterator current_cell = cell;
219 std::vector<unsigned int> current_fe_index(n_components,
220 0); // need one index per component
221 fe_values.reinit(cell);
222 std::vector<Point<dim>> current_points(n_components, Point<dim>());
223 for (unsigned int support_point = 0; support_point < n_support_points;
224 support_point++)
225 {
226 // set up valid data in the empty vectors
227 unsigned int component =
228 dof_handler->get_fe().system_to_component_index(support_point).first;
229 current_points[component] = fe_values.quadrature_point(support_point);
230 current_fe_index[component] = support_point;
231 }
232
233 // check each cell to find a suitable
234 // support points
235 // GridTools::find_active_cell_around_point
236 // is an alternative. That method is not
237 // used here mostly because of the history
238 // of the class. The algorithm used in
239 // add_points below may be slightly more
240 // efficient than find_active_cell_around_point
241 // because it operates on a set of points.
242
243 for (; cell != endc; ++cell)
244 {
245 fe_values.reinit(cell);
246
247 for (unsigned int support_point = 0; support_point < n_support_points;
248 support_point++)
249 {
250 unsigned int component = dof_handler->get_fe()
251 .system_to_component_index(support_point)
252 .first;
253 const Point<dim> &test_point =
254 fe_values.quadrature_point(support_point);
255
256 if (location.distance(test_point) <
257 location.distance(current_points[component]))
258 {
259 // save the data
260 current_points[component] = test_point;
261 current_cell = cell;
262 current_fe_index[component] = support_point;
263 }
264 }
265 }
266
267
268 std::vector<types::global_dof_index> local_dof_indices(
269 dof_handler->get_fe().n_dofs_per_cell());
270 std::vector<types::global_dof_index> new_solution_indices;
271 current_cell->get_dof_indices(local_dof_indices);
272 // there is an implicit assumption here
273 // that all the closest support point to
274 // the requested point for all finite
275 // element components lie in the same cell.
276 // this could possibly be violated if
277 // components use different FE orders,
278 // requested points are on the edge or
279 // vertex of a cell and we are unlucky with
280 // floating point rounding. Worst case
281 // scenario however is that the point
282 // selected isn't the closest possible, it
283 // will still lie within one cell distance.
284 // calling
285 // GridTools::find_active_cell_around_point
286 // to obtain a cell to search is an
287 // option for these methods, but currently
288 // the GridTools function does not cater for
289 // a vector of points, and does not seem to
290 // be intrinsicly faster than this method.
291 new_solution_indices.reserve(dof_handler->get_fe(0).n_components());
292 for (unsigned int component = 0;
293 component < dof_handler->get_fe(0).n_components();
294 component++)
295 {
296 new_solution_indices.push_back(
297 local_dof_indices[current_fe_index[component]]);
298 }
299
301 new_point_geometry_data(location, current_points, new_solution_indices);
302 point_geometry_data.push_back(new_point_geometry_data);
303
304 for (auto &data_entry : data_store)
305 {
306 // add an extra row to each vector entry
307 const ComponentMask &current_mask =
308 (component_mask.find(data_entry.first))->second;
309 unsigned int n_stored = current_mask.n_selected_components();
310 data_entry.second.resize(data_entry.second.size() + n_stored);
311 }
312}
313
314
315
316template <int dim>
317void
318PointValueHistory<dim>::add_points(const std::vector<Point<dim>> &locations)
319{
320 // This algorithm adds points in the same
321 // order as they appear in the vector
322 // locations and users may depend on this
323 // so do not change order added!
324
325 // can't be closed to add additional points or vectors
326 AssertThrow(!closed, ExcInvalidState());
327 AssertThrow(!cleared, ExcInvalidState());
328 AssertThrow(have_dof_handler, ExcDoFHandlerRequired());
329 AssertThrow(!triangulation_changed, ExcDoFHandlerChanged());
330
331
332 // Implementation assumes that support
333 // points locations are dofs locations
334 AssertThrow(dof_handler->get_fe().has_support_points(), ExcNotImplemented());
335
336 // While in general quadrature points seems
337 // to refer to Gauss quadrature points, in
338 // this case the quadrature points are
339 // forced to be the support points of the
340 // FE.
341 Quadrature<dim> support_point_quadrature(
342 dof_handler->get_fe().get_unit_support_points());
343 FEValues<dim> fe_values(dof_handler->get_fe(),
344 support_point_quadrature,
346 unsigned int n_support_points =
347 dof_handler->get_fe().get_unit_support_points().size();
348 unsigned int n_components = dof_handler->get_fe(0).n_components();
349
350 // set up a loop over all the cells in the
351 // DoFHandler
353 dof_handler->begin_active();
354 typename DoFHandler<dim>::active_cell_iterator endc = dof_handler->end();
355
356 // default values to be replaced as closer
357 // points are found however they need to be
358 // consistent in case they are actually
359 // chosen vector <vector>s defined where
360 // previously single vectors were used
361
362 // need to store one value per point per component
363 std::vector<typename DoFHandler<dim>::active_cell_iterator> current_cell(
364 locations.size(), cell);
365
366 fe_values.reinit(cell);
367 std::vector<Point<dim>> temp_points(n_components, Point<dim>());
368 std::vector<unsigned int> temp_fe_index(n_components, 0);
369 for (unsigned int support_point = 0; support_point < n_support_points;
370 support_point++)
371 {
372 // set up valid data in the empty vectors
373 unsigned int component =
374 dof_handler->get_fe().system_to_component_index(support_point).first;
375 temp_points[component] = fe_values.quadrature_point(support_point);
376 temp_fe_index[component] = support_point;
377 }
378 std::vector<std::vector<Point<dim>>> current_points(
379 locations.size(), temp_points); // give a valid start point
380 std::vector<std::vector<unsigned int>> current_fe_index(locations.size(),
381 temp_fe_index);
382
383 // check each cell to find suitable support
384 // points
385 // GridTools::find_active_cell_around_point
386 // is an alternative. That method is not
387 // used here mostly because of the history
388 // of the class. The algorithm used here
389 // may be slightly more
390 // efficient than find_active_cell_around_point
391 // because it operates on a set of points.
392 for (; cell != endc; ++cell)
393 {
394 fe_values.reinit(cell);
395 for (unsigned int support_point = 0; support_point < n_support_points;
396 support_point++)
397 {
398 unsigned int component = dof_handler->get_fe()
399 .system_to_component_index(support_point)
400 .first;
401 const Point<dim> &test_point =
402 fe_values.quadrature_point(support_point);
403
404 for (unsigned int point = 0; point < locations.size(); ++point)
405 {
406 if (locations[point].distance(test_point) <
407 locations[point].distance(current_points[point][component]))
408 {
409 // save the data
410 current_points[point][component] = test_point;
411 current_cell[point] = cell;
412 current_fe_index[point][component] = support_point;
413 }
414 }
415 }
416 }
417
418 std::vector<types::global_dof_index> local_dof_indices(
419 dof_handler->get_fe().n_dofs_per_cell());
420 for (unsigned int point = 0; point < locations.size(); ++point)
421 {
422 current_cell[point]->get_dof_indices(local_dof_indices);
423 std::vector<types::global_dof_index> new_solution_indices;
424
425 new_solution_indices.reserve(dof_handler->get_fe(0).n_components());
426 for (unsigned int component = 0;
427 component < dof_handler->get_fe(0).n_components();
428 component++)
429 {
430 new_solution_indices.push_back(
431 local_dof_indices[current_fe_index[point][component]]);
432 }
433
435 new_point_geometry_data(locations[point],
436 current_points[point],
437 new_solution_indices);
438
439 point_geometry_data.push_back(new_point_geometry_data);
440
441 for (auto &data_entry : data_store)
442 {
443 // add an extra row to each vector entry
444 const ComponentMask current_mask =
445 (component_mask.find(data_entry.first))->second;
446 unsigned int n_stored = current_mask.n_selected_components();
447 data_entry.second.resize(data_entry.second.size() + n_stored);
448 }
449 }
450}
451
452
453
454template <int dim>
455void
456PointValueHistory<dim>::add_field_name(const std::string &vector_name,
457 const ComponentMask &mask)
458{
459 // can't be closed to add additional points
460 // or vectors
461 AssertThrow(!closed, ExcInvalidState());
462 AssertThrow(!cleared, ExcInvalidState());
463 AssertThrow(have_dof_handler, ExcDoFHandlerRequired());
464 AssertThrow(!triangulation_changed, ExcDoFHandlerChanged());
465
466 // insert a component mask that is always of the right size
467 if (mask.represents_the_all_selected_mask() == false)
468 component_mask.insert(std::make_pair(vector_name, mask));
469 else
470 component_mask.insert(
471 std::make_pair(vector_name,
472 ComponentMask(std::vector<bool>(
473 dof_handler->get_fe(0).n_components(), true))));
474
475 // insert an empty vector of strings
476 // to ensure each field has an entry
477 // in the map
478 std::pair<std::string, std::vector<std::string>> empty_names(
479 vector_name, std::vector<std::string>());
480 component_names_map.insert(empty_names);
481
482 // make and add a new vector
483 // point_geometry_data.size() long
484 std::pair<std::string, std::vector<std::vector<double>>> pair_data;
485 pair_data.first = vector_name;
486 const unsigned int n_stored =
487 (mask.represents_the_all_selected_mask() == false ?
488 mask.n_selected_components() :
489 dof_handler->get_fe(0).n_components());
490
491 int n_datastreams =
492 point_geometry_data.size() * n_stored; // each point has n_stored sub parts
493 std::vector<std::vector<double>> vector_size(n_datastreams,
494 std::vector<double>(0));
495 pair_data.second = std::move(vector_size);
496 data_store.insert(pair_data);
497}
498
499
500template <int dim>
501void
502PointValueHistory<dim>::add_field_name(const std::string &vector_name,
503 const unsigned int n_components)
504{
505 ComponentMask temp_mask(std::vector<bool>(n_components, true));
506 add_field_name(vector_name, temp_mask);
507}
508
509
510template <int dim>
511void
513 const std::string &vector_name,
514 const std::vector<std::string> &component_names)
515{
516 typename std::map<std::string, std::vector<std::string>>::iterator names =
517 component_names_map.find(vector_name);
518 Assert(names != component_names_map.end(),
519 ExcMessage("vector_name not in class"));
520
521 typename std::map<std::string, ComponentMask>::iterator mask =
522 component_mask.find(vector_name);
523 Assert(mask != component_mask.end(), ExcMessage("vector_name not in class"));
524 unsigned int n_stored = mask->second.n_selected_components();
525 Assert(component_names.size() == n_stored,
526 ExcDimensionMismatch(component_names.size(), n_stored));
527
528 names->second = component_names;
529}
530
531
532template <int dim>
533void
535 const std::vector<std::string> &independent_names)
536{
537 Assert(independent_names.size() == n_indep,
538 ExcDimensionMismatch(independent_names.size(), n_indep));
539
540 indep_names = independent_names;
541}
542
543
544template <int dim>
545void
547{
548 closed = true;
549}
550
551
552
553template <int dim>
554void
556{
557 cleared = true;
558 dof_handler = nullptr;
559 have_dof_handler = false;
560}
561
562// Need to test that the internal data has a full and complete dataset for
563// each key. That is that the data has not got 'out of sync'. Testing that
564// dataset_key is within 1 of independent_values is cheap and is done in all
565// three methods. Evaluate_field will check that its vector_name is within 1
566// of dataset_key. However this leaves the possibility that the user has
567// neglected to call evaluate_field on one vector_name consistently. To catch
568// this case start_new_dataset will call bool deap_check () which will test
569// all vector_names and return a bool. This can be called from an Assert
570// statement.
571
572
573
574template <int dim>
575template <typename VectorType>
576void
577PointValueHistory<dim>::evaluate_field(const std::string &vector_name,
578 const VectorType &solution)
579{
580 // must be closed to add data to internal
581 // members.
582 Assert(closed, ExcInvalidState());
583 Assert(!cleared, ExcInvalidState());
584 AssertThrow(have_dof_handler, ExcDoFHandlerRequired());
585 AssertThrow(!triangulation_changed, ExcDoFHandlerChanged());
586
587 if (n_indep != 0) // hopefully this will get optimized, can't test
588 // independent_values[0] unless n_indep > 0
589 {
590 Assert(std::abs(static_cast<int>(dataset_key.size()) -
591 static_cast<int>(independent_values[0].size())) < 2,
592 ExcDataLostSync());
593 }
594 // Look up the field name and get an
595 // iterator for the map. Doing this
596 // up front means that it only needs
597 // to be done once and also allows us
598 // to check vector_name is in the map.
599 typename std::map<std::string, std::vector<std::vector<double>>>::iterator
600 data_store_field = data_store.find(vector_name);
601 Assert(data_store_field != data_store.end(),
602 ExcMessage("vector_name not in class"));
603 // Repeat for component_mask
604 typename std::map<std::string, ComponentMask>::iterator mask =
605 component_mask.find(vector_name);
606 Assert(mask != component_mask.end(), ExcMessage("vector_name not in class"));
607
608 unsigned int n_stored =
609 mask->second.n_selected_components(dof_handler->get_fe(0).n_components());
610
611 typename std::vector<
613 point = point_geometry_data.begin();
614 for (unsigned int data_store_index = 0; point != point_geometry_data.end();
615 ++point, ++data_store_index)
616 {
617 // Look up the components to add
618 // in the component_mask, and
619 // access the data associated with
620 // those components
621
622 for (unsigned int store_index = 0, comp = 0;
623 comp < dof_handler->get_fe(0).n_components();
624 comp++)
625 {
626 if (mask->second[comp])
627 {
628 unsigned int solution_index = point->solution_indices[comp];
629 data_store_field
630 ->second[data_store_index * n_stored + store_index]
631 .push_back(
633 solution_index));
634 ++store_index;
635 }
636 }
637 }
638}
639
640
641
642template <int dim>
643template <typename VectorType>
644void
646 const std::vector<std::string> &vector_names,
647 const VectorType &solution,
648 const DataPostprocessor<dim> &data_postprocessor,
649 const Quadrature<dim> &quadrature)
650{
651 // must be closed to add data to internal
652 // members.
653 Assert(closed, ExcInvalidState());
654 Assert(!cleared, ExcInvalidState());
655 AssertThrow(have_dof_handler, ExcDoFHandlerRequired());
656 if (n_indep != 0) // hopefully this will get optimized, can't test
657 // independent_values[0] unless n_indep > 0
658 {
659 Assert(std::abs(static_cast<int>(dataset_key.size()) -
660 static_cast<int>(independent_values[0].size())) < 2,
661 ExcDataLostSync());
662 }
663
664 // Make an FEValues object
665 const UpdateFlags update_flags =
667 Assert(
668 !(update_flags & update_normal_vectors),
670 "The update of normal vectors may not be requested for evaluation of "
671 "data on cells via DataPostprocessor."));
672 FEValues<dim> fe_values(dof_handler->get_fe(), quadrature, update_flags);
673 unsigned int n_components = dof_handler->get_fe(0).n_components();
674 unsigned int n_quadrature_points = quadrature.size();
675
676 unsigned int n_output_variables = data_postprocessor.get_names().size();
677
678 // declare some temp objects for evaluating the solution at quadrature
679 // points. we will either need the scalar or vector version in the code
680 // below
681 std::vector<typename VectorType::value_type> scalar_solution_values(
682 n_quadrature_points);
683 std::vector<Tensor<1, dim, typename VectorType::value_type>>
684 scalar_solution_gradients(n_quadrature_points);
685 std::vector<Tensor<2, dim, typename VectorType::value_type>>
686 scalar_solution_hessians(n_quadrature_points);
687
688 std::vector<Vector<typename VectorType::value_type>> vector_solution_values(
689 n_quadrature_points, Vector<typename VectorType::value_type>(n_components));
690
691 std::vector<std::vector<Tensor<1, dim, typename VectorType::value_type>>>
692 vector_solution_gradients(
693 n_quadrature_points,
696
697 std::vector<std::vector<Tensor<2, dim, typename VectorType::value_type>>>
698 vector_solution_hessians(
699 n_quadrature_points,
702
703 // Loop over points and find correct cell
704 typename std::vector<
706 point = point_geometry_data.begin();
707 Assert(!dof_handler->get_triangulation().is_mixed_mesh(),
709 const auto reference_cell =
710 dof_handler->get_triangulation().get_reference_cells()[0];
711 for (unsigned int data_store_index = 0; point != point_geometry_data.end();
712 ++point, ++data_store_index)
713 {
714 // we now have a point to query, need to know what cell it is in
715 const Point<dim> requested_location = point->requested_location;
716 const typename DoFHandler<dim>::active_cell_iterator cell =
718 reference_cell.template get_default_linear_mapping<dim>(),
719 *dof_handler,
720 requested_location)
721 .first;
722
723
724 fe_values.reinit(cell);
725 std::vector<Vector<double>> computed_quantities(
726 1, Vector<double>(n_output_variables)); // just one point needed
727
728 // find the closest quadrature point
729 std::vector<Point<dim>> quadrature_points =
730 fe_values.get_quadrature_points();
731 double distance = cell->diameter();
732 unsigned int selected_point = 0;
733 for (unsigned int q_point = 0; q_point < n_quadrature_points; ++q_point)
734 {
735 if (requested_location.distance(quadrature_points[q_point]) <
736 distance)
737 {
738 selected_point = q_point;
739 distance =
740 requested_location.distance(quadrature_points[q_point]);
741 }
742 }
743
744
745 // The case of a scalar FE
746 if (n_components == 1)
747 {
748 // Extract data for the DataPostprocessor object
749 DataPostprocessorInputs::Scalar<dim> postprocessor_input;
750
751 // for each quantity that is requested (values, gradients, hessians),
752 // first get them at all quadrature points, then restrict to the
753 // one value on the quadrature point closest to the evaluation
754 // point in question
755 //
756 // we need temporary objects because the underlying scalar
757 // type of the solution vector may be different from 'double',
758 // but the DataPostprocessorInputs only allow for 'double'
759 // data types
760 if (update_flags & update_values)
761 {
762 fe_values.get_function_values(solution, scalar_solution_values);
763 postprocessor_input.solution_values =
764 std::vector<double>(1, scalar_solution_values[selected_point]);
765 }
766 if (update_flags & update_gradients)
767 {
768 fe_values.get_function_gradients(solution,
769 scalar_solution_gradients);
770 postprocessor_input.solution_gradients =
771 std::vector<Tensor<1, dim>>(
772 1, scalar_solution_gradients[selected_point]);
773 }
774 if (update_flags & update_hessians)
775 {
776 fe_values.get_function_hessians(solution,
777 scalar_solution_hessians);
778 postprocessor_input.solution_hessians =
779 std::vector<Tensor<2, dim>>(
780 1, scalar_solution_hessians[selected_point]);
781 }
782
783 // then also set the single evaluation point
784 postprocessor_input.evaluation_points =
785 std::vector<Point<dim>>(1, quadrature_points[selected_point]);
786
787 // and finally do the postprocessing
788 data_postprocessor.evaluate_scalar_field(postprocessor_input,
789 computed_quantities);
790 }
791 else // The case of a vector FE
792 {
793 // exact same idea as above
794 DataPostprocessorInputs::Vector<dim> postprocessor_input;
795
796 if (update_flags & update_values)
797 {
798 fe_values.get_function_values(solution, vector_solution_values);
799 postprocessor_input.solution_values.resize(
800 1, Vector<double>(n_components));
801 std::copy(vector_solution_values[selected_point].begin(),
802 vector_solution_values[selected_point].end(),
803 postprocessor_input.solution_values[0].begin());
804 }
805 if (update_flags & update_gradients)
806 {
807 fe_values.get_function_gradients(solution,
808 vector_solution_gradients);
809 postprocessor_input.solution_gradients.resize(
810 1, std::vector<Tensor<1, dim>>(n_components));
811 std::copy(vector_solution_gradients[selected_point].begin(),
812 vector_solution_gradients[selected_point].end(),
813 postprocessor_input.solution_gradients[0].begin());
814 }
815 if (update_flags & update_hessians)
816 {
817 fe_values.get_function_hessians(solution,
818 vector_solution_hessians);
819 postprocessor_input.solution_hessians.resize(
820 1, std::vector<Tensor<2, dim>>(n_components));
821 std::copy(vector_solution_hessians[selected_point].begin(),
822 vector_solution_hessians[selected_point].end(),
823 postprocessor_input.solution_hessians[0].begin());
824 }
825
826 postprocessor_input.evaluation_points =
827 std::vector<Point<dim>>(1, quadrature_points[selected_point]);
828
829 data_postprocessor.evaluate_vector_field(postprocessor_input,
830 computed_quantities);
831 }
832
833
834 // we now have the data and need to save it
835 // loop over data names
836 typename std::vector<std::string>::const_iterator name =
837 vector_names.begin();
838 for (; name != vector_names.end(); ++name)
839 {
840 typename std::map<std::string,
841 std::vector<std::vector<double>>>::iterator
842 data_store_field = data_store.find(*name);
843 Assert(data_store_field != data_store.end(),
844 ExcMessage("vector_name not in class"));
845 // Repeat for component_mask
846 typename std::map<std::string, ComponentMask>::iterator mask =
847 component_mask.find(*name);
848 Assert(mask != component_mask.end(),
849 ExcMessage("vector_name not in class"));
850
851 unsigned int n_stored =
852 mask->second.n_selected_components(n_output_variables);
853
854 // Push back computed quantities according
855 // to the component_mask.
856 for (unsigned int store_index = 0, comp = 0;
857 comp < n_output_variables;
858 comp++)
859 {
860 if (mask->second[comp])
861 {
862 data_store_field
863 ->second[data_store_index * n_stored + store_index]
864 .push_back(computed_quantities[0](comp));
865 ++store_index;
866 }
867 }
868 }
869 } // end of loop over points
870}
871
872
873
874template <int dim>
875template <typename VectorType>
876void
878 const std::string &vector_name,
879 const VectorType &solution,
880 const DataPostprocessor<dim> &data_postprocessor,
881 const Quadrature<dim> &quadrature)
882{
883 std::vector<std::string> vector_names;
884 vector_names.push_back(vector_name);
885 evaluate_field(vector_names, solution, data_postprocessor, quadrature);
886}
887
888
889
890template <int dim>
891template <typename VectorType>
892void
894 const std::string &vector_name,
895 const VectorType &solution)
896{
897 using number = typename VectorType::value_type;
898 // must be closed to add data to internal
899 // members.
900 Assert(closed, ExcInvalidState());
901 Assert(!cleared, ExcInvalidState());
902 AssertThrow(have_dof_handler, ExcDoFHandlerRequired());
903
904 if (n_indep != 0) // hopefully this will get optimized, can't test
905 // independent_values[0] unless n_indep > 0
906 {
907 Assert(std::abs(static_cast<int>(dataset_key.size()) -
908 static_cast<int>(independent_values[0].size())) < 2,
909 ExcDataLostSync());
910 }
911 // Look up the field name and get an
912 // iterator for the map. Doing this
913 // up front means that it only needs
914 // to be done once and also allows us
915 // to check vector_name is in the map.
916 typename std::map<std::string, std::vector<std::vector<double>>>::iterator
917 data_store_field = data_store.find(vector_name);
918 Assert(data_store_field != data_store.end(),
919 ExcMessage("vector_name not in class"));
920 // Repeat for component_mask
921 typename std::map<std::string, ComponentMask>::iterator mask =
922 component_mask.find(vector_name);
923 Assert(mask != component_mask.end(), ExcMessage("vector_name not in class"));
924
925 unsigned int n_stored =
926 mask->second.n_selected_components(dof_handler->get_fe(0).n_components());
927
928 typename std::vector<
930 point = point_geometry_data.begin();
931 Vector<number> value(dof_handler->get_fe(0).n_components());
932 for (unsigned int data_store_index = 0; point != point_geometry_data.end();
933 ++point, ++data_store_index)
934 {
935 // Make a Vector <double> for the value
936 // at the point. It will have as many
937 // components as there are in the fe.
938 VectorTools::point_value(*dof_handler,
939 solution,
940 point->requested_location,
941 value);
942
943 // Look up the component_mask and add
944 // in components according to that mask
945 for (unsigned int store_index = 0, comp = 0; comp < mask->second.size();
946 comp++)
947 {
948 if (mask->second[comp])
949 {
950 data_store_field
951 ->second[data_store_index * n_stored + store_index]
952 .push_back(value(comp));
953 ++store_index;
954 }
955 }
956 }
957}
958
959
960template <int dim>
961void
963{
964 // must be closed to add data to internal
965 // members.
966 Assert(closed, ExcInvalidState());
967 Assert(!cleared, ExcInvalidState());
968 Assert(deep_check(false), ExcDataLostSync());
969
970 dataset_key.push_back(key);
971}
972
973
974
975template <int dim>
976void
978 const std::vector<double> &indep_values)
979{
980 // must be closed to add data to internal
981 // members.
982 Assert(closed, ExcInvalidState());
983 Assert(!cleared, ExcInvalidState());
984 Assert(indep_values.size() == n_indep,
985 ExcDimensionMismatch(indep_values.size(), n_indep));
986 Assert(n_indep != 0, ExcNoIndependent());
987 Assert(std::abs(static_cast<int>(dataset_key.size()) -
988 static_cast<int>(independent_values[0].size())) < 2,
989 ExcDataLostSync());
990
991 for (unsigned int component = 0; component < n_indep; ++component)
992 independent_values[component].push_back(indep_values[component]);
993}
994
995
996
997template <int dim>
998void
1000 const std::string &base_name,
1001 const std::vector<Point<dim>> &postprocessor_locations)
1002{
1003 AssertThrow(closed, ExcInvalidState());
1004 AssertThrow(!cleared, ExcInvalidState());
1005 AssertThrow(deep_check(true), ExcDataLostSync());
1006
1007 // write inputs to a file
1008 if (n_indep != 0)
1009 {
1010 std::string filename = base_name + "_indep.gpl";
1011 std::ofstream to_gnuplot(filename);
1012
1013 to_gnuplot << "# Data independent of mesh location\n";
1014
1015 // write column headings
1016 to_gnuplot << "# <Key> ";
1017
1018 if (indep_names.size() > 0)
1019 {
1020 for (const auto &indep_name : indep_names)
1021 {
1022 to_gnuplot << "<" << indep_name << "> ";
1023 }
1024 to_gnuplot << '\n';
1025 }
1026 else
1027 {
1028 for (unsigned int component = 0; component < n_indep; ++component)
1029 {
1030 to_gnuplot << "<Indep_" << component << "> ";
1031 }
1032 to_gnuplot << '\n';
1033 }
1034 // write general data stored
1035 for (unsigned int key = 0; key < dataset_key.size(); ++key)
1036 {
1037 to_gnuplot << dataset_key[key];
1038
1039 for (unsigned int component = 0; component < n_indep; ++component)
1040 {
1041 to_gnuplot << " " << independent_values[component][key];
1042 }
1043 to_gnuplot << '\n';
1044 }
1045
1046 to_gnuplot.close();
1047 }
1048
1049
1050
1051 // write points to a file
1052 if (have_dof_handler)
1053 {
1054 AssertThrow(have_dof_handler, ExcDoFHandlerRequired());
1055 AssertThrow(postprocessor_locations.empty() ||
1056 postprocessor_locations.size() ==
1057 point_geometry_data.size(),
1058 ExcDimensionMismatch(postprocessor_locations.size(),
1059 point_geometry_data.size()));
1060 // We previously required the
1061 // number of dofs to remain the
1062 // same to provide some sort of
1063 // test on the relevance of the
1064 // support point indices stored.
1065 // We now relax that to allow
1066 // adaptive refinement strategies
1067 // to make use of the
1068 // evaluate_field_requested_locations
1069 // method. Note that the support point
1070 // information is not meaningful if
1071 // the number of dofs has changed.
1072 // AssertThrow (!triangulation_changed, ExcDoFHandlerChanged ());
1073
1074 typename std::vector<internal::PointValueHistoryImplementation::
1075 PointGeometryData<dim>>::iterator point =
1076 point_geometry_data.begin();
1077 for (unsigned int data_store_index = 0;
1078 point != point_geometry_data.end();
1079 ++point, ++data_store_index)
1080 {
1081 // for each point, open a file to
1082 // be written to
1083 std::string filename = base_name + "_" +
1084 Utilities::int_to_string(data_store_index, 2) +
1085 ".gpl"; // store by order pushed back
1086 // due to
1087 // Utilities::int_to_string(data_store_index,
1088 // 2) call, can handle up to 100
1089 // points
1090 std::ofstream to_gnuplot(filename);
1091
1092 // put helpful info about the
1093 // support point into the file as
1094 // comments
1095 to_gnuplot << "# Requested location: " << point->requested_location
1096 << '\n';
1097 to_gnuplot << "# DoF_index : Support location (for each component)\n";
1098 for (unsigned int component = 0;
1099 component < dof_handler->get_fe(0).n_components();
1100 component++)
1101 {
1102 to_gnuplot << "# " << point->solution_indices[component] << " : "
1103 << point->support_point_locations[component] << '\n';
1104 }
1105 if (triangulation_changed)
1106 to_gnuplot
1107 << "# (Original components and locations, may be invalidated by mesh change.)\n";
1108
1109 if (postprocessor_locations.size() != 0)
1110 {
1111 to_gnuplot << "# Postprocessor location: "
1112 << postprocessor_locations[data_store_index];
1113 if (triangulation_changed)
1114 to_gnuplot << " (may be approximate)\n";
1115 }
1116 to_gnuplot << "#\n";
1117
1118
1119 // write column headings
1120 to_gnuplot << "# <Key> ";
1121
1122 if (indep_names.size() > 0)
1123 {
1124 for (const auto &indep_name : indep_names)
1125 {
1126 to_gnuplot << "<" << indep_name << "> ";
1127 }
1128 }
1129 else
1130 {
1131 for (unsigned int component = 0; component < n_indep; ++component)
1132 {
1133 to_gnuplot << "<Indep_" << component << "> ";
1134 }
1135 }
1136
1137 for (const auto &data_entry : data_store)
1138 {
1139 typename std::map<std::string, ComponentMask>::iterator mask =
1140 component_mask.find(data_entry.first);
1141 unsigned int n_stored = mask->second.n_selected_components();
1142 std::vector<std::string> names =
1143 (component_names_map.find(data_entry.first))->second;
1144
1145 if (names.size() > 0)
1146 {
1147 AssertThrow(names.size() == n_stored,
1148 ExcDimensionMismatch(names.size(), n_stored));
1149 for (const auto &name : names)
1150 {
1151 to_gnuplot << "<" << name << "> ";
1152 }
1153 }
1154 else
1155 {
1156 for (unsigned int component = 0; component < n_stored;
1157 component++)
1158 {
1159 to_gnuplot << "<" << data_entry.first << "_" << component
1160 << "> ";
1161 }
1162 }
1163 }
1164 to_gnuplot << '\n';
1165
1166 // write data stored for the point
1167 for (unsigned int key = 0; key < dataset_key.size(); ++key)
1168 {
1169 to_gnuplot << dataset_key[key];
1170
1171 for (unsigned int component = 0; component < n_indep; ++component)
1172 {
1173 to_gnuplot << " " << independent_values[component][key];
1174 }
1175
1176 for (const auto &data_entry : data_store)
1177 {
1178 typename std::map<std::string, ComponentMask>::iterator mask =
1179 component_mask.find(data_entry.first);
1180 unsigned int n_stored = mask->second.n_selected_components();
1181
1182 for (unsigned int component = 0; component < n_stored;
1183 component++)
1184 {
1185 to_gnuplot
1186 << " "
1187 << (data_entry.second)[data_store_index * n_stored +
1188 component][key];
1189 }
1190 }
1191 to_gnuplot << '\n';
1192 }
1193
1194 to_gnuplot.close();
1195 }
1196 }
1197}
1198
1199
1200
1201template <int dim>
1204{
1205 // a method to put a one at each point on
1206 // the grid where a location is defined
1207 AssertThrow(!cleared, ExcInvalidState());
1208 AssertThrow(have_dof_handler, ExcDoFHandlerRequired());
1209 AssertThrow(!triangulation_changed, ExcDoFHandlerChanged());
1210
1211 Vector<double> dof_vector(dof_handler->n_dofs());
1212
1213 typename std::vector<
1215 point = point_geometry_data.begin();
1216 for (; point != point_geometry_data.end(); ++point)
1217 {
1218 for (unsigned int component = 0;
1219 component < dof_handler->get_fe(0).n_components();
1220 component++)
1221 {
1222 dof_vector(point->solution_indices[component]) = 1;
1223 }
1224 }
1225 return dof_vector;
1226}
1227
1228
1229template <int dim>
1230void
1232 std::vector<std::vector<Point<dim>>> &locations)
1233{
1234 AssertThrow(!cleared, ExcInvalidState());
1235 AssertThrow(have_dof_handler, ExcDoFHandlerRequired());
1236 AssertThrow(!triangulation_changed, ExcDoFHandlerChanged());
1237
1238 std::vector<std::vector<Point<dim>>> actual_points;
1239 typename std::vector<
1241 point = point_geometry_data.begin();
1242
1243 for (; point != point_geometry_data.end(); ++point)
1244 {
1245 actual_points.push_back(point->support_point_locations);
1246 }
1247 locations = std::move(actual_points);
1248}
1249
1250
1251
1252template <int dim>
1253void
1255 const Quadrature<dim> &quadrature,
1256 std::vector<Point<dim>> &locations)
1257{
1258 Assert(!cleared, ExcInvalidState());
1259 AssertThrow(have_dof_handler, ExcDoFHandlerRequired());
1260
1261 locations = std::vector<Point<dim>>();
1262
1263 FEValues<dim> fe_values(dof_handler->get_fe(),
1264 quadrature,
1266 unsigned int n_quadrature_points = quadrature.size();
1267 std::vector<Point<dim>> evaluation_points;
1268
1269 // Loop over points and find correct cell
1270 Assert(!dof_handler->get_triangulation().is_mixed_mesh(),
1272 const auto reference_cell =
1273 dof_handler->get_triangulation().get_reference_cells()[0];
1274 for (const auto &point : point_geometry_data)
1275 {
1276 // we now have a point to query,
1277 // need to know what cell it is in
1278 Point<dim> requested_location = point.requested_location;
1279 const auto cell =
1281 reference_cell.template get_default_linear_mapping<dim>(),
1282 *dof_handler,
1283 requested_location)
1284 .first;
1285 fe_values.reinit(cell);
1286
1287 evaluation_points = fe_values.get_quadrature_points();
1288 double distance = cell->diameter();
1289 unsigned int selected_point = 0;
1290
1291 for (unsigned int q_point = 0; q_point < n_quadrature_points; ++q_point)
1292 {
1293 if (requested_location.distance(evaluation_points[q_point]) <
1294 distance)
1295 {
1296 selected_point = q_point;
1297 distance =
1298 requested_location.distance(evaluation_points[q_point]);
1299 }
1300 }
1301
1302 locations.push_back(evaluation_points[selected_point]);
1303 }
1304}
1305
1306
1307template <int dim>
1308void
1310{
1311 out << "***PointValueHistory status output***\n\n";
1312 out << "Closed: " << closed << '\n';
1313 out << "Cleared: " << cleared << '\n';
1314 out << "Triangulation_changed: " << triangulation_changed << '\n';
1315 out << "Have_dof_handler: " << have_dof_handler << '\n';
1316 out << "Geometric Data" << '\n';
1317
1318 typename std::vector<
1320 point = point_geometry_data.begin();
1321 if (point == point_geometry_data.end())
1322 {
1323 out << "No points stored currently\n";
1324 }
1325 else
1326 {
1327 if (!cleared)
1328 {
1329 for (; point != point_geometry_data.end(); ++point)
1330 {
1331 out << "# Requested location: " << point->requested_location
1332 << '\n';
1333 out << "# DoF_index : Support location (for each component)\n";
1334 for (unsigned int component = 0;
1335 component < dof_handler->get_fe(0).n_components();
1336 component++)
1337 {
1338 out << point->solution_indices[component] << " : "
1339 << point->support_point_locations[component] << '\n';
1340 }
1341 out << '\n';
1342 }
1343 }
1344 else
1345 {
1346 out << "#Cannot access DoF_indices once cleared\n";
1347 }
1348 }
1349 out << '\n';
1350
1351 if (independent_values.size() != 0)
1352 {
1353 out << "Independent value(s): " << independent_values.size() << " : "
1354 << independent_values[0].size() << '\n';
1355 if (indep_names.size() > 0)
1356 {
1357 out << "Names: ";
1358 for (const auto &indep_name : indep_names)
1359 {
1360 out << "<" << indep_name << "> ";
1361 }
1362 out << '\n';
1363 }
1364 }
1365 else
1366 {
1367 out << "No independent values stored\n";
1368 }
1369
1370 if (data_store.begin() != data_store.end())
1371 {
1372 out
1373 << "Mnemonic: data set size (mask size, n true components) : n data sets\n";
1374 }
1375 for (const auto &data_entry : data_store)
1376 {
1377 // Find field mnemonic
1378 std::string vector_name = data_entry.first;
1379 typename std::map<std::string, ComponentMask>::iterator mask =
1380 component_mask.find(vector_name);
1381 Assert(mask != component_mask.end(),
1382 ExcMessage("vector_name not in class"));
1383 typename std::map<std::string, std::vector<std::string>>::iterator
1384 component_names = component_names_map.find(vector_name);
1385 Assert(component_names != component_names_map.end(),
1386 ExcMessage("vector_name not in class"));
1387
1388 if (data_entry.second.size() != 0)
1389 {
1390 out << data_entry.first << ": " << data_entry.second.size() << " (";
1391 out << mask->second.size() << ", "
1392 << mask->second.n_selected_components() << ") : ";
1393 out << (data_entry.second)[0].size() << '\n';
1394 }
1395 else
1396 {
1397 out << data_entry.first << ": " << data_entry.second.size() << " (";
1398 out << mask->second.size() << ", "
1399 << mask->second.n_selected_components() << ") : ";
1400 out << "No points added" << '\n';
1401 }
1402 // add names, if available
1403 if (component_names->second.size() > 0)
1404 {
1405 for (const auto &name : component_names->second)
1406 {
1407 out << "<" << name << "> ";
1408 }
1409 out << '\n';
1410 }
1411 }
1412 out << '\n';
1413 out << "***end of status output***\n\n";
1414}
1415
1416
1417
1418template <int dim>
1419bool
1421{
1422 // test ways that it can fail, if control
1423 // reaches last statement return true
1424 if (strict)
1425 {
1426 if (n_indep != 0)
1427 {
1428 if (dataset_key.size() != independent_values[0].size())
1429 {
1430 return false;
1431 }
1432 }
1433 if (have_dof_handler)
1434 {
1435 for (const auto &data_entry : data_store)
1436 {
1437 Assert(data_entry.second.size() > 0, ExcInternalError());
1438 if ((data_entry.second)[0].size() != dataset_key.size())
1439 return false;
1440 // this loop only tests one
1441 // member for each name,
1442 // i.e. checks the user it will
1443 // not catch internal errors
1444 // which do not update all
1445 // fields for a name.
1446 }
1447 }
1448 return true;
1449 }
1450 if (n_indep != 0)
1451 {
1452 if (std::abs(static_cast<int>(dataset_key.size()) -
1453 static_cast<int>(independent_values[0].size())) >= 2)
1454 {
1455 return false;
1456 }
1457 }
1458
1459 if (have_dof_handler)
1460 {
1461 for (const auto &data_entry : data_store)
1462 {
1463 Assert(data_entry.second.size() > 0, ExcInternalError());
1464
1465 if (std::abs(static_cast<int>((data_entry.second)[0].size()) -
1466 static_cast<int>(dataset_key.size())) >= 2)
1467 return false;
1468 // this loop only tests one member
1469 // for each name, i.e. checks the
1470 // user it will not catch internal
1471 // errors which do not update all
1472 // fields for a name.
1473 }
1474 }
1475 return true;
1476}
1477
1478
1479
1480template <int dim>
1481void
1483{
1484 // this function is called by the
1485 // Triangulation whenever something
1486 // changes, by virtue of having
1487 // attached the function to the
1488 // signal handler in the
1489 // triangulation object
1490
1491 // we record the fact that the mesh
1492 // has changed. we need to take
1493 // this into account next time we
1494 // evaluate the solution
1495 triangulation_changed = true;
1496}
1497
1498
1499// explicit instantiations
1500#include "numerics/point_value_history.inst"
1501
1502
*  iterator end()
*  *  iterator begin()
***mech_lbc_system increment_interpolation_handlers push_back(scale_z_handler)
unsigned int n_selected_components(const unsigned int overall_number_of_components=numbers::invalid_unsigned_int) const
virtual UpdateFlags get_needed_update_flags() const =0
virtual void evaluate_vector_field(const DataPostprocessorInputs::Vector< dim > &input_data, std::vector< Vector< double > > &computed_quantities) const
virtual void evaluate_scalar_field(const DataPostprocessorInputs::Scalar< dim > &input_data, std::vector< Vector< double > > &computed_quantities) const
virtual std::vector< std::string > get_names() const =0
void get_function_values(const ReadVector< Number > &fe_function, std::vector< Number > &values) const
const std::vector< Point< spacedim > > & get_quadrature_points() const
void get_function_hessians(const ReadVector< Number > &fe_function, std::vector< Tensor< 2, spacedim, Number > > &hessians) const
const Point< spacedim > & quadrature_point(const unsigned int q_point) const
void get_function_gradients(const ReadVector< Number > &fe_function, std::vector< Tensor< 1, spacedim, Number > > &gradients) const
void reinit(const TriaIterator< DoFCellAccessor< dim, spacedim, level_dof_access > > &cell)
void evaluate_field_at_requested_location(const std::string &name, const VectorType &solution)
void add_field_name(const std::string &vector_name, const ComponentMask &component_mask={})
boost::signals2::connection tria_listener
void add_point(const Point< dim > &location)
std::map< std::string, ComponentMask > component_mask
std::vector< internal::PointValueHistoryImplementation::PointGeometryData< dim > > point_geometry_data
std::map< std::string, std::vector< std::string > > component_names_map
PointValueHistory & operator=(const PointValueHistory &point_value_history)
ObserverPointer< const DoFHandler< dim >, PointValueHistory< dim > > dof_handler
void evaluate_field(const std::string &name, const VectorType &solution)
Vector< double > mark_support_locations()
std::vector< std::string > indep_names
std::vector< double > dataset_key
void write_gnuplot(const std::string &base_name, const std::vector< Point< dim > > &postprocessor_locations=std::vector< Point< dim > >())
void status(std::ostream &out)
void add_independent_names(const std::vector< std::string > &independent_names)
PointValueHistory(const unsigned int n_independent_variables=0)
void get_support_locations(std::vector< std::vector< Point< dim > > > &locations)
std::map< std::string, std::vector< std::vector< double > > > data_store
void add_component_names(const std::string &vector_name, const std::vector< std::string > &component_names)
void start_new_dataset(const double key)
void add_points(const std::vector< Point< dim > > &locations)
std::vector< std::vector< double > > independent_values
void push_back_independent(const std::vector< double > &independent_values)
void get_postprocessor_locations(const Quadrature< dim > &quadrature, std::vector< Point< dim > > &locations)
bool deep_check(const bool strict)
Definition point.h:111
numbers::NumberTraits< Number >::real_type distance(const Point< dim, Number > &p) const
unsigned int size() const
PointGeometryData(const Point< dim > &new_requested_location, const std::vector< Point< dim > > &new_locations, const std::vector< types::global_dof_index > &new_sol_indices)
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:38
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:39
Point< 2 > second
Definition grid_out.cc:4640
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
static ::ExceptionBase & ExcInvalidState()
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
typename ActiveSelector::active_cell_iterator active_cell_iterator
UpdateFlags
@ update_hessians
Second derivatives of shape functions.
@ update_values
Shape function values.
@ update_normal_vectors
Normal vectors.
@ update_gradients
Shape function gradients.
@ update_quadrature_points
Transformed quadrature points.
std::size_t size
Definition mpi.cc:733
std::pair< typename MeshType< dim, spacedim >::active_cell_iterator, Point< dim > > find_active_cell_around_point(const Mapping< dim, spacedim > &mapping, const MeshType< dim, spacedim > &mesh, const Point< spacedim > &p, const std::vector< bool > &marked_vertices={}, const double tolerance=1.e-10)
std::string int_to_string(const unsigned int value, const unsigned int digits=numbers::invalid_unsigned_int)
Definition utilities.cc:464
void point_value(const DoFHandler< dim, spacedim > &dof, const VectorType &fe_function, const Point< spacedim, double > &point, Vector< typename VectorType::value_type > &value)
::VectorizedArray< Number, width > abs(const ::VectorizedArray< Number, width > &)
std::vector< Point< spacedim > > evaluation_points
std::vector< double > solution_values
std::vector< Tensor< 2, spacedim > > solution_hessians
std::vector< Tensor< 1, spacedim > > solution_gradients
std::vector< std::vector< Tensor< 2, spacedim > > > solution_hessians
std::vector<::Vector< double > > solution_values
std::vector< std::vector< Tensor< 1, spacedim > > > solution_gradients