Documentation 6b54b78464
Loading...
Searching...
No Matches
CRadialBasisFunctionInterpolation.hpp
Go to the documentation of this file.
1/*!
2 * \file CRadialBasisFunctionInterpolation.hpp
3 * \brief Headers of the CRadialBasisFunctionInterpolation class.
4 * \author F. van Steen
5 * \version 8.5.0 "Harrier"
6 *
7 * SU2 Project Website: https://su2code.github.io
8 *
9 * The SU2 Project is maintained by the SU2 Foundation
10 * (http://su2foundation.org)
11 *
12 * Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md)
13 *
14 * SU2 is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Lesser General Public
16 * License as published by the Free Software Foundation; either
17 * version 2.1 of the License, or (at your option) any later version.
18 *
19 * SU2 is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Lesser General Public License for more details.
23 *
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with SU2. If not, see <http://www.gnu.org/licenses/>.
26 */
27
28#pragma once
31
32/*!
33 * \class CRadialBasisFunctionInterpolation
34 * \brief Class for moving the volumetric numerical grid using Radial Basis Function interpolation.
35 * \author F. van Steen
36 */
38 protected:
39 vector<CRadialBasisFunctionNode*>* ControlNodes = nullptr; /*!< \brief Vector with control nodes*/
40 vector<CRadialBasisFunctionNode*> BoundNodes; /*!< \brief Vector with boundary nodes.*/
41 vector<CRadialBasisFunctionNode*>
42 ReducedControlNodes; /*!< \brief Vector with selected control nodes in data reduction algorithm. */
43
44 su2activematrix CtrlNodeDeformation; /*!< \brief Control Node Deformation.*/
45 su2activematrix InterpCoeff; /*!< \brief Control node interpolation coefficients.*/
46
47 unsigned long nCtrlNodesGlobal{0}; /*!< \brief Total number of control nodes.*/
48 su2activematrix CtrlCoords; /*!< \brief Coordinates of the control nodes.*/
49
50 su2double MaxErrorGlobal{0.0}; /*!< \brief Maximum error data reduction algorithm.*/
51
52 public:
53 /*!
54 * \brief Constructor of the class.
55 */
57
58 /*!
59 * \brief Destructor of the class.
60 */
62
63 /*!
64 * \brief Grid deformation using the spring analogy method.
65 * \param[in] geometry - Geometrical definition of the problem.
66 * \param[in] config - Definition of the particular problem.
67 * \param[in] UpdateGeo - Update geometry.
68 * \param[in] Derivative - Compute the derivative (disabled by default). Does not actually deform the grid if enabled.
69 */
70 void SetVolume_Deformation(CGeometry* geometry, CConfig* config, bool UpdateGeo, bool Derivative,
71 bool ForwardProjectionDerivative) override;
72
73 private:
74 /*!
75 * \brief Selecting unique set of boundary nodes based on marker information.
76 * \param[in] geometry - Geometrical definition of the problem.
77 * \param[in] config - Definition of the particular problem.
78 */
79 void SetBoundNodes(CGeometry* geometry, CConfig* config);
80
81 /*!
82 * \brief Selecting internal nodes for the volumetric deformation.
83 * \param[in] geometry - Geometrical definition of the problem.
84 * \param[in] config - Definition of the particular problem.
85 * \param[in] internalNode - Internal nodes.
86 */
87 void SetInternalNodes(CGeometry* geometry, CConfig* config, vector<unsigned long>& internalNodes);
88
89 /*!
90 * \brief Assigning the control nodes.
91 * \param[in] config -Definition of the particular problem.
92 */
93 void SetCtrlNodes(CConfig* config);
94
95 /*!
96 * \brief Solving the RBF system to obtain the interpolation coefficients.
97 * \param[in] geometry - Geometrical definition of the problem.
98 * \param[in] config - Definition of the particular problem.
99 * \param[in] type - Type of radial basis function.
100 * \param[in] radius - Support radius of the radial basis function.
101 */
102 void SolveRBFSystem(CGeometry* geometry, CConfig* config, const RADIAL_BASIS& type, su2double radius);
103
104 /*!
105 * \brief Obtaining the interpolation coefficients of the control nodes.
106 * \param[in] geometry - Geometrical definition of the problem.
107 * \param[in] config - Definition of the particular problem.
108 * \param[in] type - Type of radial basis function.
109 * \param[in] radius - Support radius of the radial basis function.
110 */
111 void GetInterpCoeffs(CGeometry* geometry, CConfig* config, const RADIAL_BASIS& type, su2double radius);
112
113 /*!
114 * \brief Gathering of all control node coordinates.
115 * \param[in] geometry - Geometrical definition of the problem.
116 */
117 void SetCtrlNodeCoords(CGeometry* geometry);
118
119 /*!
120 * \brief Build the deformation vector with surface displacements of the control nodes.
121 * \param[in] geometry - Geometrical definition of the problem.
122 * \param[in] config - Definition of the particular problem.
123 */
124 void SetDeformation(CGeometry* geometry, CConfig* config);
125
126 /*!
127 * \brief Computation of the interpolation matrix and inverting in.
128 * \param[in] geometry - Geometrical definition of the problem.
129 * \param[in] type - Type of radial basis function.
130 * \param[in] radius - Support radius of the radial basis function.
131 * \param[in] invInterpMat - Inverse of the interpolation matrix.
132 */
133 void ComputeInterpolationMatrix(CGeometry* geometry, const RADIAL_BASIS& type, su2double radius,
134 su2passivematrix& invInterpMat);
135
136 /*!
137 * \brief Computation of interpolation coefficients
138 * \param[in] invInterpMat - Inverse of interpolation matrix
139 */
140 void ComputeInterpCoeffs(su2passivematrix& invInterpMat);
141
142 /*!
143 * \brief Finding initial data reduction control nodes based on maximum deformation.
144 * \param[in] geometry - Geometrical definition of the problem.
145 * \param[in] config - Definition of the particular problem.
146 * \param[in] maxErrorNodeLocal - Local maximum error node.
147 * \param[in] maxErrorLocal - Local maximum error.
148 */
149 void GetInitMaxErrorNode(CGeometry* geometry, CConfig* config, unsigned long& maxErrorNodeLocal,
150 su2double& maxErrorLocal);
151
152 /*!
153 * \brief Addition of control node to the reduced set.
154 * \param[in] maxErrorNode - Node with maximum error to be added.
155 */
156 void AddControlNode(unsigned long maxErrorNode);
157
158 /*!
159 * \brief Compute global number of control nodes.
160 */
161 void ComputeNCtrlNodesGlobal();
162
163 /*!
164 * \brief Compute interpolation error.
165 * \param[in] geometry - Geometrical definition of the problem.
166 * \param[in] config - Definition of the particular problem.
167 * \param[in] type - Type of radial basis function.
168 * \param[in] radius - Support radius of the radial basis function.
169 * \param[in] maxErrorNodeLocal - Local maximum error node.
170 * \param[in] maxErrorLocal - Local maximum error.
171 */
172 void GetInterpError(CGeometry* geometry, CConfig* config, const RADIAL_BASIS& type, su2double radius,
173 unsigned long& maxErrorNodeLocal, su2double& maxErrorLocal);
174
175 /*!
176 * \brief Compute error of single node.
177 * \param[in] geometry - Geometrical definition of the problem.
178 * \param[in] config - Definition of the particular problem.
179 * \param[in] type - Type of radial basis function.
180 * \param[in] radius - Support radius of the radial basis function.
181 * \param[in] iNode - Local node in consideration.
182 * \param[in] localError - Local error.
183 */
184 void GetNodalError(CGeometry* geometry, CConfig* config, const RADIAL_BASIS& type, su2double radius,
185 unsigned long iNode, su2double* localError);
186
187 /*!
188 * \brief Updating the grid coordinates.
189 * \param[in] geometry - Geometrical definition of the problem.
190 * \param[in] config - Definition of the particular problem.
191 * \param[in] type - Type of radial basis function.
192 * \param[in] radius - Support radius of the radial basis function.
193 * \param[in] internalNodes - Internal nodes.
194 */
195 void UpdateGridCoord(CGeometry* geometry, CConfig* config, const RADIAL_BASIS& type, su2double radius,
196 const vector<unsigned long>& internalNodes);
197
198 /*!
199 * \brief Updating the internal node coordinates.
200 * \param[in] geometry - Geometrical definition of the problem.
201 * \param[in] type - Type of radial basis function.
202 * \param[in] radius - Support radius of the radial basis function.
203 * \param[in] internalNodes - Internal nodes.
204 */
205 void UpdateInternalCoords(CGeometry* geometry, const RADIAL_BASIS& type, su2double radius,
206 const vector<unsigned long>& internalNodes);
207
208 /*!
209 * \brief Updating the internal node coordinates.
210 * \param[in] geometry - Geometrical definition of the problem.
211 * \param[in] config - Definition of the particular problem.
212 * \param[in] type - Type of radial basis function.
213 * \param[in] radius - Support radius of the radial basis function.
214 */
215 void UpdateBoundCoords(CGeometry* geometry, CConfig* config, const RADIAL_BASIS& type, su2double radius);
216};
Declaration of the RBF node class that stores nodal information for the RBF interpolation.
Headers of the CVolumetricMovement class.
A templated matrix/vector-like object.
Definition C2DContainer.hpp:374
Main class for defining the problem; basically this class reads the configuration file,...
Definition CConfig.hpp:64
Parent class for defining the geometry of the problem (complete geometry, multigrid agglomerated geom...
Definition CGeometry.hpp:75
Class for moving the volumetric numerical grid using Radial Basis Function interpolation.
Definition CRadialBasisFunctionInterpolation.hpp:37
su2activematrix InterpCoeff
Control node interpolation coefficients.
Definition CRadialBasisFunctionInterpolation.hpp:45
vector< CRadialBasisFunctionNode * > BoundNodes
Vector with boundary nodes.
Definition CRadialBasisFunctionInterpolation.hpp:40
su2double MaxErrorGlobal
Maximum error data reduction algorithm.
Definition CRadialBasisFunctionInterpolation.hpp:50
su2activematrix CtrlCoords
Coordinates of the control nodes.
Definition CRadialBasisFunctionInterpolation.hpp:48
unsigned long nCtrlNodesGlobal
Total number of control nodes.
Definition CRadialBasisFunctionInterpolation.hpp:47
~CRadialBasisFunctionInterpolation() override
Destructor of the class.
Definition CRadialBasisFunctionInterpolation.cpp:37
void SetVolume_Deformation(CGeometry *geometry, CConfig *config, bool UpdateGeo, bool Derivative, bool ForwardProjectionDerivative) override
Grid deformation using the spring analogy method.
Definition CRadialBasisFunctionInterpolation.cpp:44
vector< CRadialBasisFunctionNode * > * ControlNodes
Vector with control nodes.
Definition CRadialBasisFunctionInterpolation.hpp:39
vector< CRadialBasisFunctionNode * > ReducedControlNodes
Vector with selected control nodes in data reduction algorithm.
Definition CRadialBasisFunctionInterpolation.hpp:42
su2activematrix CtrlNodeDeformation
Control Node Deformation.
Definition CRadialBasisFunctionInterpolation.hpp:44
Class for moving the volumetric numerical grid.
Definition CVolumetricMovement.hpp:37
passivedouble su2double
Definition code_config.hpp:181
RADIAL_BASIS
Types of radial basis functions.
Definition option_structure.hpp:452