Documentation 6b54b78464
Loading...
Searching...
No Matches
CBezierBlending.hpp
Go to the documentation of this file.
1/*!
2 * \file CBezierBlending.hpp
3 * \brief Headers of the CBezierBlending class.
4 * Defines blending using Bernsteinpolynomials (Bezier Curves)
5 * \author T. Albring
6 * \version 8.5.0 "Harrier"
7 *
8 * SU2 Project Website: https://su2code.github.io
9 *
10 * The SU2 Project is maintained by the SU2 Foundation
11 * (http://su2foundation.org)
12 *
13 * Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md)
14 *
15 * SU2 is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU Lesser General Public
17 * License as published by the Free Software Foundation; either
18 * version 2.1 of the License, or (at your option) any later version.
19 *
20 * SU2 is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * Lesser General Public License for more details.
24 *
25 * You should have received a copy of the GNU Lesser General Public
26 * License along with SU2. If not, see <http://www.gnu.org/licenses/>.
27 */
28
29#pragma once
30
31#include "CFreeFormBlending.hpp"
32#include <vector>
33
34using namespace std;
35
36/*!
37 * \class CBezierBlending
38 * \brief Class that defines the blending using Bernsteinpolynomials (Bezier Curves).
39 * \author F. Palacios, T. Albring
40 */
42 private:
43 vector<su2double> binomial; /*!< \brief Temporary vector for the Bernstein evaluation. */
44
45 /*!
46 * \brief Returns the value of the i-th Bernstein polynomial of order n.
47 * \param[in] val_n - Order of the Bernstein polynomial.
48 * \param[in] val_i - index of the basis function.
49 * \param[in] val_t - Point at which we want to evaluate the i-th basis.
50 */
51 su2double GetBernstein(short val_n, short val_i, su2double val_t);
52
53 /*!
54 * \brief Returns the value of the derivative of the i-th Bernstein polynomial of order n.
55 * \param[in] val_n - Order of the Bernstein polynomial.
56 * \param[in] val_i - index of the basis function.
57 * \param[in] val_t - Point at which we want to evaluate the i-th basis.
58 * \param[in] val_order - Order of the derivative.
59 */
60 su2double GetBernsteinDerivative(short val_n, short val_i, su2double val_t, short val_order_der);
61
62 /*!
63 * \brief Get the binomial coefficient n over i, defined as n!/(m!(n-m)!)
64 * \note If the denominator is 0, the value is 1.
65 * \param[in] n - Upper coefficient.
66 * \param[in] m - Lower coefficient.
67 * \return Value of the binomial coefficient n over m.
68 */
69 su2double Binomial(unsigned short n, unsigned short m);
70
71 public:
72 /*!
73 * \brief Constructor of the class.
74 * \param[in] val_order - Max. order of the basis functions.
75 * \param[in] n_controlpoints - Not used here.
76 */
77 CBezierBlending(short val_order, short n_controlpoints);
78
79 /*!
80 * \brief Destructor of the class.
81 */
82 ~CBezierBlending() override;
83
84 /*!
85 * \brief Returns the value of the i-th basis function and stores the values of the i+p basis functions in the matrix
86 * N. \param[in] val_i - index of the basis function. \param[in] val_t - Point at which we want to evaluate the i-th
87 * basis.
88 */
89 su2double GetBasis(short val_i, su2double val_t) override;
90
91 /*!
92 * \brief Returns the value of the derivative of the i-th basis function.
93 * \param[in] val_i - index of the basis function.
94 * \param[in] val_t - Point at which we want to evaluate the derivative of the i-th basis.
95 * \param[in] val_order - Order of the derivative.
96 */
97 su2double GetDerivative(short val_i, su2double val_t, short val_order_der) override;
98
99 /*!
100 * \brief Set the order and number of control points.
101 * \param[in] val_order - The new order of the function.
102 * \param[in] n_controlpoints - the new number of control points.
103 */
104 void SetOrder(short val_order, short n_controlpoints) override;
105};
Headers of the CFreeFormBlending class. It is the parent class for the FFD blending function.
Class that defines the blending using Bernsteinpolynomials (Bezier Curves).
Definition CBezierBlending.hpp:41
~CBezierBlending() override
Destructor of the class.
su2double GetDerivative(short val_i, su2double val_t, short val_order_der) override
Returns the value of the derivative of the i-th basis function.
Definition CBezierBlending.cpp:73
su2double GetBasis(short val_i, su2double val_t) override
Returns the value of the i-th basis function and stores the values of the i+p basis functions in the ...
Definition CBezierBlending.cpp:41
void SetOrder(short val_order, short n_controlpoints) override
Set the order and number of control points.
Definition CBezierBlending.cpp:35
Class that defines the particular kind of blending function for the free form deformation.
Definition CFreeFormBlending.hpp:39
passivedouble su2double
Definition code_config.hpp:181