Debian Codegraph @

include/deal.II/integrators/patches.h

raw
1 // ------------------------------------------------------------------------
2 //
3 // SPDX-License-Identifier: LGPL-2.1-or-later
4 // Copyright (C) 2011 - 2024 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
15 #ifndef dealii_integrators_patches_h
16 #define dealii_integrators_patches_h
17
18
19 #include <deal.II/base/config.h>
20
21 #include <deal.II/base/exceptions.h>
22 #include <deal.II/base/quadrature.h>
23
24 #include <deal.II/fe/fe_values.h>
25 #include <deal.II/fe/mapping.h>
26
27 #include <deal.II/meshworker/dof_info.h>
28
29 DEAL_II_NAMESPACE_OPEN
30
31 namespace LocalIntegrators
32 {
33 /**
34 * @brief Integrators writing patches with values in quadrature points
35 */
36 namespace Patches
37 {
38 template <int dim>
39 DEAL_II_DEPRECATED inline void
40 points_and_values(Table<2, double> &result,
41 const FEValuesBase<dim> &fe,
42 const ArrayView<const std::vector<double>> &input)
43 {
44 const unsigned int n_comp = fe.get_fe().n_components();
45 AssertVectorVectorDimension(input, n_comp, fe.n_quadrature_points);
46 AssertDimension(result.n_rows(), fe.n_quadrature_points);
47 AssertDimension(result.n_cols(), n_comp + dim);
48
49 for (unsigned int k = 0; k < fe.n_quadrature_points; ++k)
50 {
51 for (unsigned int d = 0; d < dim; ++d)
52 result(k, d) = fe.quadrature_point(k)[d];
53 for (unsigned int i = 0; i < n_comp; ++i)
54 result(k, dim + i) = input[i][k];
55 }
56 }
57 } // namespace Patches
58 } // namespace LocalIntegrators
59
60 DEAL_II_NAMESPACE_CLOSE
61
62 #endif