Documentation a537f1bdf2
Loading...
Searching...
No Matches
CLinearElasticity.hpp
Go to the documentation of this file.
1/*!
2 * \file CLinearElasticity.hpp
3 * \brief Headers of the CLinearElasticity class.
4 * \author F. Palacios, A. Bueno, T. Economon, S. Padron.
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
30#include "../linear_algebra/CSysMatrix.hpp"
31#include "../linear_algebra/CSysVector.hpp"
32#include "../linear_algebra/CSysSolve.hpp"
33
34/*!
35 * \class CLinearElasticity
36 * \brief Class for moving the volumetric numerical grid using the linear elasticity analogy.
37 * \author F. Palacios, A. Bueno, T. Economon, S. Padron.
38 */
40 protected:
41 unsigned short nVar; /*!< \brief Number of variables. */
42
43 unsigned long nPoint; /*!< \brief Number of points. */
44 unsigned long nPointDomain; /*!< \brief Number of points in the domain. */
45
46 unsigned long nIterMesh; /*!< \brief Number of iterations in the mesh update. +*/
47
48 CSysMatrix<su2mixedfloat> StiffMatrix; /*!< \brief Stiffness matrix of the elasticity problem. */
49 CSysSolve<su2mixedfloat> System; /*!< \brief Linear solver/smoother. */
52
53 public:
54 /*!
55 * \brief Constructor of the class.
56 */
57 CLinearElasticity(CGeometry* geometry, CConfig* config);
58
59 /*!
60 * \brief Destructor of the class.
61 */
63
64 /*!
65 * \brief Grid deformation using the spring analogy method.
66 * \param[in] geometry - Geometrical definition of the problem.
67 * \param[in] config - Definition of the particular problem.
68 * \param[in] UpdateGeo - Update geometry.
69 * \param[in] Derivative - Compute the derivative (disabled by default). Does not actually deform the grid if enabled.
70 */
71 void SetVolume_Deformation(CGeometry* geometry, CConfig* config, bool UpdateGeo, bool Derivative,
72 bool ForwardProjectionDerivative) override;
73
74 private:
75 /*!
76 * \brief Update the value of the coordinates after the grid movement.
77 * \param[in] geometry - Geometrical definition of the problem.
78 * \param[in] config - Definition of the particular problem.
79 */
80 void UpdateGridCoord(CGeometry* geometry, CConfig* config);
81
82 /*!
83 * \brief Update the derivatives of the coordinates after the grid movement.
84 * \param[in] geometry - Geometrical definition of the problem.
85 * \param[in] config - Definition of the particular problem.
86 */
87 void UpdateGridCoord_Derivatives(CGeometry* geometry, CConfig* config, bool ForwardProjectionDerivative);
88
89 /*!
90 * \brief Compute the minimum distance to the nearest solid surface.
91 * \param[in] geometry - Geometrical definition of the problem.
92 * \param[in] config - Definition of the particular problem.
93 */
94 void ComputeSolid_Wall_Distance(CGeometry* geometry, CConfig* config, su2double& MinDistance,
95 su2double& MaxDistance) const;
96
97 /*!
98 * \brief Compute the stiffness matrix for grid deformation using spring analogy.
99 * \param[in] geometry - Geometrical definition of the problem.
100 * \param[in] config - Definition of the particular problem.
101 * \return Value of the length of the smallest edge of the grid.
102 */
103 su2double SetFEAMethodContributions_Elem(CGeometry* geometry, CConfig* config);
104
105 /*!
106 * \brief Build the stiffness matrix for a 3-D hexahedron element. The result will be placed in StiffMatrix_Elem.
107 * \param[in] geometry - Geometrical definition of the problem.
108 * \param[in] config - Definition of the particular problem.
109 * \param[in] StiffMatrix_Elem - Element stiffness matrix to be filled.
110 * \param[in] CoordCorners - Index value for Node 1 of the current hexahedron.
111 * \param[in] PointCorners - Index values for element corners
112 * \param[in] nNodes - Number of nodes defining the element.
113 * \param[in] scale
114 */
115 void SetFEA_StiffMatrix2D(CGeometry* geometry, CConfig* config, su2double** StiffMatrix_Elem,
116 unsigned long PointCorners[8], su2double CoordCorners[8][3], unsigned short nNodes,
117 su2double ElemVolume, su2double ElemDistance);
118
119 /*!
120 * \brief Build the stiffness matrix for a 3-D hexahedron element. The result will be placed in StiffMatrix_Elem.
121 * \param[in] geometry - Geometrical definition of the problem.
122 * \param[in] config - Definition of the particular problem.
123 * \param[in] StiffMatrix_Elem - Element stiffness matrix to be filled.
124 * \param[in] CoordCorners - Index value for Node 1 of the current hexahedron.
125 * \param[in] PointCorners - Index values for element corners
126 * \param[in] nNodes - Number of nodes defining the element.
127 * \param[in] scale
128 */
129 void SetFEA_StiffMatrix3D(CGeometry* geometry, CConfig* config, su2double** StiffMatrix_Elem,
130 unsigned long PointCorners[8], su2double CoordCorners[8][3], unsigned short nNodes,
131 su2double ElemVolume, su2double ElemDistance);
132
133 /*!
134 * \brief Add the stiffness matrix for a 2-D triangular element to the global stiffness matrix for the entire mesh
135 * (node-based). \param[in] geometry - Geometrical definition of the problem. \param[in] StiffMatrix_Elem - Element
136 * stiffness matrix to be filled. \param[in] PointCorners - Index values for element corners \param[in] nNodes -
137 * Number of nodes defining the element.
138 */
139 void AddFEA_StiffMatrix(CGeometry* geometry, su2double** StiffMatrix_Elem, unsigned long PointCorners[8],
140 unsigned short nNodes);
141
142 /*!
143 * \brief Shape functions and derivative of the shape functions
144 * \param[in] Xi - Local coordinates.
145 * \param[in] Eta - Local coordinates.
146 * \param[in] Zeta - Local coordinates.
147 * \param[in] CoordCorners - Coordiantes of the corners.
148 * \param[in] DShapeFunction - Shape function information
149 */
150 su2double ShapeFunc_Hexa(su2double Xi, su2double Eta, su2double Zeta, su2double CoordCorners[8][3],
151 su2double DShapeFunction[8][4]);
152
153 /*!
154 * \brief Shape functions and derivative of the shape functions
155 * \param[in] Xi - Local coordinates.
156 * \param[in] Eta - Local coordinates.
157 * \param[in] Zeta - Local coordinates.
158 * \param[in] CoordCorners - Coordiantes of the corners.
159 * \param[in] DShapeFunction - Shape function information
160 */
161 su2double ShapeFunc_Tetra(su2double Xi, su2double Eta, su2double Zeta, su2double CoordCorners[8][3],
162 su2double DShapeFunction[8][4]);
163
164 /*!
165 * \brief Shape functions and derivative of the shape functions
166 * \param[in] Xi - Local coordinates.
167 * \param[in] Eta - Local coordinates.
168 * \param[in] Zeta - Local coordinates.
169 * \param[in] CoordCorners - Coordiantes of the corners.
170 * \param[in] DShapeFunction - Shape function information
171 */
172 su2double ShapeFunc_Pyram(su2double Xi, su2double Eta, su2double Zeta, su2double CoordCorners[8][3],
173 su2double DShapeFunction[8][4]);
174
175 /*!
176 * \brief Shape functions and derivative of the shape functions
177 * \param[in] Xi - Local coordinates.
178 * \param[in] Eta - Local coordinates.
179 * \param[in] Zeta - Local coordinates.
180 * \param[in] CoordCorners - Coordiantes of the corners.
181 * \param[in] DShapeFunction - Shape function information
182 */
183 su2double ShapeFunc_Prism(su2double Xi, su2double Eta, su2double Zeta, su2double CoordCorners[8][3],
184 su2double DShapeFunction[8][4]);
185
186 /*!
187 * \brief Shape functions and derivative of the shape functions
188 * \param[in] Xi - Local coordinates.
189 * \param[in] Eta - Local coordinates.
190 * \param[in] CoordCorners - Coordiantes of the corners.
191 * \param[in] DShapeFunction - Shape function information
192 */
193 su2double ShapeFunc_Triangle(su2double Xi, su2double Eta, su2double CoordCorners[8][3],
194 su2double DShapeFunction[8][4]);
195
196 /*!
197 * \brief Shape functions and derivative of the shape functions
198 * \param[in] Xi - Local coordinates.
199 * \param[in] Eta - Local coordinates.
200 * \param[in] CoordCorners - Coordiantes of the corners.
201 * \param[in] DShapeFunction - Shape function information
202 */
203 su2double ShapeFunc_Quadrilateral(su2double Xi, su2double Eta, su2double CoordCorners[8][3],
204 su2double DShapeFunction[8][4]);
205
206 /*!
207 * \brief Check the domain points vertex that are going to be moved.
208 * \param[in] geometry - Geometrical definition of the problem.
209 * \param[in] config - Definition of the particular problem.
210 */
211 void SetDomainDisplacements(CGeometry* geometry, CConfig* config);
212
213 /*!
214 * \brief Check the boundary vertex that are going to be moved.
215 * \param[in] geometry - Geometrical definition of the problem.
216 * \param[in] config - Definition of the particular problem.
217 */
218 void SetBoundaryDisplacements(CGeometry* geometry, CConfig* config);
219
220 /*!
221 * \brief Set the derivatives of the boundary nodes.
222 * \param[in] geometry - Geometrical definition of the problem.
223 * \param[in] config - Definition of the particular problem.
224 */
225 void SetBoundaryDerivatives(CGeometry* geometry, CConfig* config, bool ForwardProjectionDerivative);
226};
Headers of the CVolumetricMovement class.
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 the linear elasticity analogy.
Definition CLinearElasticity.hpp:39
CSysMatrix< su2mixedfloat > StiffMatrix
Stiffness matrix of the elasticity problem.
Definition CLinearElasticity.hpp:48
CSysVector< su2double > LinSysRes
Definition CLinearElasticity.hpp:51
unsigned long nPoint
Number of points.
Definition CLinearElasticity.hpp:43
void SetVolume_Deformation(CGeometry *geometry, CConfig *config, bool UpdateGeo, bool Derivative, bool ForwardProjectionDerivative) override
Grid deformation using the spring analogy method.
Definition CLinearElasticity.cpp:52
CSysVector< su2double > LinSysSol
Definition CLinearElasticity.hpp:50
unsigned short nVar
Number of variables.
Definition CLinearElasticity.hpp:41
unsigned long nPointDomain
Number of points in the domain.
Definition CLinearElasticity.hpp:44
~CLinearElasticity() override
Destructor of the class.
CSysSolve< su2mixedfloat > System
Linear solver/smoother.
Definition CLinearElasticity.hpp:49
unsigned long nIterMesh
Number of iterations in the mesh update. +.
Definition CLinearElasticity.hpp:46
Main class for defining block-compressed-row-storage sparse matrices.
Definition CSysMatrix.hpp:256
Class for solving linear systems using classical and Krylov-subspace iterative methods.
Definition CSysSolve.hpp:86
Class for holding and manipulating vectors needed by linear solvers.
Definition CSysVector.hpp:195
Class for moving the volumetric numerical grid.
Definition CVolumetricMovement.hpp:37
passivedouble su2double
Definition code_config.hpp:181