Line data Source code
1 0 : // Distributed under the MIT License.
2 : // See LICENSE.txt for details.
3 :
4 : #pragma once
5 :
6 : #include <optional>
7 : #include <vector>
8 :
9 : #include "DataStructures/DataVector.hpp"
10 : #include "DataStructures/Tensor/Tensor.hpp"
11 : #include "NumericalAlgorithms/Spectral/Mesh.hpp"
12 :
13 : /// \ingroup SurfacesGroup
14 : /// Contains functions that are used to find contour levels.
15 1 : namespace SurfaceFinder {
16 : /*!
17 : * \ingroup SurfacesGroup
18 :
19 : * \brief Function that interpolates data onto radial rays in the direction
20 : * of the logical coordinates \f$\xi\f$ and \f$\eta\f$ and tries to perform a
21 : * root find of \f$\text{data}-\text{target}\f$. Returns the logical coordinates
22 : * of the roots found.
23 : *
24 : * \details We assume the element is part of a wedge block, so that the
25 : * \f$\zeta\f$ logical coordinate points in the radial direction. Will fail if
26 : * multiple roots are along a ray. This could be generalized to domains other
27 : * than a wedge if necessary by passing in which logical direction points
28 : * radially.
29 : *
30 : * \param data data to find the contour in.
31 : * \param target target value for the contour level in the data.
32 : * \param mesh mesh for the element.
33 : * \param angular_coords tensor containing the \f$\xi\f$ and \f$\eta\f$
34 : * values of the rays extending into \f$\zeta\f$ direction.
35 : * \param relative_tolerance relative tolerance for toms748 rootfind.
36 : * \param absolute_tolerance relative tolerance for toms748 rootfind.
37 : */
38 1 : std::vector<std::optional<double>> find_radial_surface(
39 : const Scalar<DataVector>& data, const double target, const Mesh<3>& mesh,
40 : const tnsr::I<DataVector, 2, Frame::ElementLogical>& angular_coords,
41 : const double relative_tolerance = 1e-10,
42 : const double absolute_tolerance = 1e-10);
43 :
44 : } // namespace SurfaceFinder
|