Line data Source code
1 0 : // Distributed under the MIT License.
2 : // See LICENSE.txt for details.
3 :
4 : #pragma once
5 :
6 : #include <cstddef>
7 :
8 : /// \cond
9 : class DataVector;
10 : template <size_t Dim>
11 : class Mesh;
12 : /// \endcond
13 :
14 : namespace domain {
15 : /*!
16 : * \brief Estimate of how much a function can exceed its extrema over the
17 : * grid points of an element anywhere inside the element, given its
18 : * `grid_point_values`.
19 : *
20 : * The extrema of a coordinate (or of the distance from a point) over the grid
21 : * points of a curved element can be smaller than over the whole element, e.g.
22 : * because the center of a curved face is not a grid point. Between
23 : * neighboring grid points, a function exceeds the linear interpolant between
24 : * them by at most \f$h^2 \max|f''|/8\f$, where \f$h\f$ is the spacing in the
25 : * logical coordinate and \f$f''\f$ is the second derivative with respect to
26 : * it. The padding is the sum of this bound over the logical dimensions, with
27 : * the second derivatives estimated by divided differences, so it vanishes for
28 : * functions that are linear in the logical coordinates (e.g. the coordinates of
29 : * elements with straight edges). For quadratures whose grid points don't
30 : * include the element boundaries (e.g. Gauss), a term for the parts of the
31 : * element beyond the outermost grid points is included. It should be used as a
32 : * cheap test whether a point can be in the element.
33 : *
34 : * \param mesh the mesh of the element, at whose grid points
35 : * `grid_point_values` are given
36 : * \param grid_point_values the values at the grid points of `mesh` of a
37 : * function that is smooth in the element, e.g. a coordinate or the distance
38 : * from a point
39 : */
40 1 : double extrema_padding(const Mesh<3>& mesh,
41 : const DataVector& grid_point_values);
42 : } // namespace domain
|