Linearize.hpp
Go to the documentation of this file.
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 /// \file
5 /// Defines function linearize.
6 
7 #pragma once
8 
9 #include <cstddef>
10 
11 /// \cond
12 class DataVector;
13 template <size_t>
14 class Mesh;
15 namespace gsl {
16 template <class>
17 class not_null;
18 } // namespace gsl
19 /// \endcond
20 
21 // @{
22 /*!
23  * \ingroup NumericalAlgorithmsGroup
24  * \brief Truncate u to a linear function in each dimension.
25  *
26  * Ex in 2D: \f$u^{Lin} = U_0 + U_x x + U_y y + U_{xy} xy\f$
27  *
28  * \warning the `gsl::not_null` variant assumes `*result` is of the correct
29  * size.
30  */
31 template <size_t Dim>
32 void linearize(gsl::not_null<DataVector*> result, const DataVector& u,
33  const Mesh<Dim>& mesh) noexcept;
34 template <size_t Dim>
35 DataVector linearize(const DataVector& u, const Mesh<Dim>& mesh) noexcept;
36 // @}
37 
38 // @{
39 /*!
40  * \ingroup NumericalAlgorithmsGroup
41  * \brief Truncate u to a linear function in the given dimension.
42  *
43  * **Parameters**
44  * - `u` the function to linearize.
45  * - `mesh` the Mesh of the grid on the manifold on which `u` is
46  * located.
47  * - `d` the dimension that is to be linearized.
48  *
49  * \warning the `gsl::not_null` variant assumes `*result` is of the correct
50  * size.
51  */
52 template <size_t Dim>
53 void linearize(gsl::not_null<DataVector*> result, const DataVector& u,
54  const Mesh<Dim>& mesh, size_t d) noexcept;
55 template <size_t Dim>
56 DataVector linearize(const DataVector& u, const Mesh<Dim>& mesh,
57  size_t d) noexcept;
58 // @}
Implementations from the Guideline Support Library.
Definition: ConservativeFromPrimitive.hpp:10
Holds the number of grid points, basis, and quadrature in each direction of the computational grid...
Definition: Mesh.hpp:49
void linearize(gsl::not_null< DataVector *> result, const DataVector &u, const Mesh< Dim > &mesh) noexcept
Truncate u to a linear function in each dimension.
Stores a collection of function values.
Definition: DataVector.hpp:46
Require a pointer to not be a nullptr
Definition: ConservativeFromPrimitive.hpp:12