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
evaluation_kernels_common.h
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) 2025 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
13
14#ifndef dealii_matrix_free_evaluation_kernels_common_h
15#define dealii_matrix_free_evaluation_kernels_common_h
16
17#include <deal.II/base/config.h>
18
20
22
23
25
26
27namespace internal
28{
29 template <int dim, int fe_degree, typename Number, bool is_face>
30 inline void
32 const unsigned int n_components,
33 Number *values_dofs,
34 const Number *values_dofs_actual,
36 {
37 const auto &shape_info = fe_eval.get_shape_info();
38 const auto &shape_data = shape_info.data.front();
39
40 const std::size_t dofs_per_comp =
41 Utilities::pow(shape_data.fe_degree + 1, dim);
42 const std::size_t n_dofs_per_comp = shape_info.dofs_per_component_on_cell;
43 const int degree = fe_degree != -1 ? fe_degree : shape_data.fe_degree;
44
45 for (unsigned int c = 0; c < n_components; ++c)
46 for (int i = 0, count_p = 0, count_q = 0; i < (dim > 2 ? degree + 1 : 1);
47 ++i)
48 {
49 for (int j = 0; j < (dim > 1 ? degree + 1 - i : 1); ++j)
50 {
51 for (int k = 0; k < degree + 1 - j - i; ++k, ++count_p, ++count_q)
52 values_dofs[c * dofs_per_comp + count_q] =
53 values_dofs_actual[c * n_dofs_per_comp + count_p];
54 for (int k = degree + 1 - j - i; k < degree + 1; ++k, ++count_q)
55 values_dofs[c * dofs_per_comp + count_q] = Number();
56 }
57 for (int j = degree + 1 - i; j < degree + 1; ++j)
58 for (int k = 0; k < degree + 1; ++k, ++count_q)
59 values_dofs[c * dofs_per_comp + count_q] = Number();
60 }
61 }
62
63
64
65 template <int dim, int fe_degree, typename Number, bool is_face>
66 inline void
68 const unsigned int n_components,
69 Number *values_dofs_actual,
70 const Number *values_dofs,
72 {
73 const auto &shape_info = fe_eval.get_shape_info();
74 const auto &shape_data = shape_info.data.front();
75
76 const unsigned int dofs_per_comp =
77 Utilities::fixed_power<dim>(shape_data.fe_degree + 1);
78 const std::size_t n_dofs_per_comp = shape_info.dofs_per_component_on_cell;
79 const int degree = fe_degree != -1 ? fe_degree : shape_data.fe_degree;
80 for (unsigned int c = 0; c < n_components; ++c)
81 for (int i = 0, count_p = 0, count_q = 0; i < (dim > 2 ? degree + 1 : 1);
82 ++i)
83 {
84 for (int j = 0; j < (dim > 1 ? degree + 1 - i : 1); ++j)
85 {
86 for (int k = 0; k < degree + 1 - j - i; ++k, ++count_p, ++count_q)
87 values_dofs_actual[c * n_dofs_per_comp + count_p] =
88 values_dofs[c * dofs_per_comp + count_q];
89 count_q += j + i;
90 }
91 count_q += i * (degree + 1);
92 }
93 }
94} // end of namespace internal
95
96
98
99#endif
const ShapeInfoType & get_shape_info() const
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:38
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:39
constexpr T pow(const T base, const int iexp)
Definition utilities.h:966
void embed_truncated_into_full_tensor_product(const unsigned int n_components, Number *values_dofs, const Number *values_dofs_actual, FEEvaluationData< dim, Number, is_face > &fe_eval)
void truncate_tensor_product_to_complete_degrees(const unsigned int n_components, Number *values_dofs_actual, const Number *values_dofs, FEEvaluationData< dim, Number, is_face > &fe_eval)
std::vector< UnivariateShapeData< Number > > data
Definition shape_info.h:490