Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
quadrature_points_data_out.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) 2026 The Lethe Authors
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
3
4#ifndef lethe_quadrature_points_data_out_h
5#define lethe_quadrature_points_data_out_h
6
7#include <deal.II/base/data_out_base.h>
8#include <deal.II/base/quadrature.h>
9
10#include <deal.II/dofs/dof_handler.h>
11
12#include <deal.II/fe/mapping.h>
13
14#include <functional>
15#include <string>
16#include <vector>
17
18
19/**
20 * @brief Build point patches located at quadrature points for visualization,
21 * for example to display the QCM filter spheres centered at each quadrature
22 * point. Each quadrature point stores its filter radius, filter diameter and
23 * the global active index of the cell it belongs to.
24 *
25 * @tparam dim An integer that denotes the number of spatial dimensions.
26 */
27template <int dim>
28class QuadraturePointsDataOut : public dealii::DataOutInterface<0, dim>
29{
30public:
31 /**
32 * @brief Build one point patch per quadrature point of every locally owned
33 * cell. Each patch stores the filter radius, the filter diameter and the
34 * global active index of the cell that owns the quadrature point.
35 *
36 * @param[in] dof_handler DoFHandler whose active cells are traversed.
37 * @param[in] mapping Mapping used to compute the quadrature point locations.
38 * @param[in] quadrature Quadrature rule defining the points in each cell.
39 * @param[in] filter_radius Function returning the filter radius of a cell.
40 */
41 void
43 const dealii::DoFHandler<dim> &dof_handler,
44 const dealii::Mapping<dim> &mapping,
45 const dealii::Quadrature<dim> &quadrature,
46 const std::function<
47 double(const typename dealii::DoFHandler<dim>::active_cell_iterator &)>
48 &filter_radius);
49
50private:
51 /**
52 * @brief Implementation of the corresponding function of the base class.
53 */
54 const std::vector<dealii::DataOutBase::Patch<0, dim>> &
55 get_patches() const override
56 {
57 return patches;
58 }
59
60 /**
61 * @brief Implementation of the corresponding function of the base class.
62 */
63 std::vector<std::string>
64 get_dataset_names() const override
65 {
66 return dataset_names;
67 }
68
69 /// Point patches filled by build_patches() and written by the base class.
70 std::vector<dealii::DataOutBase::Patch<0, dim>> patches;
71
72 /// Names of the data fields stored in each patch, in row order.
73 const std::vector<std::string> dataset_names = {"filter_radius",
74 "filter_diameter",
75 "cell_index"};
76};
77
78#endif
Build point patches located at quadrature points for visualization, for example to display the QCM fi...
std::vector< dealii::DataOutBase::Patch< 0, dim > > patches
Point patches filled by build_patches() and written by the base class.
void build_patches(const dealii::DoFHandler< dim > &dof_handler, const dealii::Mapping< dim > &mapping, const dealii::Quadrature< dim > &quadrature, const std::function< double(const typename dealii::DoFHandler< dim >::active_cell_iterator &)> &filter_radius)
Build one point patch per quadrature point of every locally owned cell. Each patch stores the filter ...
std::vector< std::string > get_dataset_names() const override
Implementation of the corresponding function of the base class.
const std::vector< std::string > dataset_names
Names of the data fields stored in each patch, in row order.
const std::vector< dealii::DataOutBase::Patch< 0, dim > > & get_patches() const override
Implementation of the corresponding function of the base class.