Documentation 6b54b78464
Loading...
Searching...
No Matches
CFEALinearElasticity.hpp
Go to the documentation of this file.
1/*!
2 * \file CFEALinearElasticity.hpp
3 * \brief Declaration and inlines of the linear elasticity FE numerics class.
4 * \author Ruben Sanchez
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
29
30#include "CFEAElasticity.hpp"
31
32
33/*!
34 * \class CFEALinearElasticity
35 * \brief Class for computing the stiffness matrix of a linear, elastic problem.
36 * \ingroup Elasticity_Equations
37 * \author R.Sanchez
38 * \version 8.5.0 "Harrier"
39 */
41protected:
42 su2activematrix nodalDisplacement; /*!< \brief Nodal displacements, used to compute nodal stresses. */
43
44 /*!
45 * \brief Default constructor, protected to avoid instantiation without arguments.
46 */
48
49public:
50 /*!
51 * \brief Constructor of the class.
52 * \param[in] val_nDim - Number of dimensions of the problem.
53 * \param[in] val_nVar - Number of variables of the problem.
54 * \param[in] config - Definition of the particular problem.
55 */
56 CFEALinearElasticity(unsigned short val_nDim, unsigned short val_nVar, const CConfig *config);
57
58 /*!
59 * \brief Build the tangent stiffness matrix of an element.
60 * \param[in,out] element_container - Element whose tangent matrix is being built.
61 * \param[in] config - Definition of the problem.
62 */
63 void Compute_Tangent_Matrix(CElement *element_container, const CConfig *config) final;
64
65 /*!
66 * \brief Compute averaged nodal stresses (for post processing).
67 * \param[in,out] element_container - The finite element.
68 * \param[in] config - Definition of the problem.
69 */
70 su2double Compute_Averaged_NodalStress(CElement *element_container, const CConfig *config) final;
71
72private:
73 /*!
74 * \brief Compute the constitutive matrix.
75 * \param[in,out] element_container - The finite element.
76 * \param[in] config - Definition of the problem.
77 */
78 void Compute_Constitutive_Matrix(CElement *element_container, const CConfig *config) final;
79
80};
81
82
83/*!
84 * \class CFEAMeshElasticity
85 * \brief Particular case of linear elasticity used for mesh deformation.
86 * \ingroup Elasticity_Equations
87 * \author R.Sanchez
88 * \version 8.5.0 "Harrier"
89 */
91
92 bool element_based;
93
94public:
95 /*!
96 * \brief Default constructor deleted as instantiation with no argument would not allocate fields.
97 */
99
100 /*!
101 * \brief Constructor of the class.
102 * \param[in] val_nDim - Number of dimensions of the problem.
103 * \param[in] val_nVar - Number of variables of the problem.
104 * \param[in] config - Definition of the particular problem.
105 */
106 CFEAMeshElasticity(unsigned short val_nDim, unsigned short val_nVar, unsigned long val_nElem, const CConfig *config);
107
108 /*!
109 * \brief Set the element-based local Young's modulus in mesh problems
110 * \param[in] iElem - Element index.
111 * \param[in] val_E - Value of elasticity modulus.
112 */
113 inline void SetMeshElasticProperties(unsigned long iElem, su2double val_E) override {
114 if (element_based) E_i[iElem] = val_E;
115 }
116
117private:
118 /*!
119 * \brief Set element material properties.
120 * \param[in] element_container - Element defining the properties.
121 * \param[in] config - Definition of the problem.
122 */
123 inline void SetElement_Properties(const CElement *element, const CConfig *config) override {
124 if (element_based) {
125 E = E_i[element->Get_iProp()];
127 }
128 }
129
130};
Declaration and inlines of the base class for elasticity problems.
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
Abstract class for defining finite elements.
Definition CElement.hpp:58
unsigned long Get_iProp(void) const
Return the value of the identifier for the Element Property.
Definition CElement.hpp:430
Abstract class for computing the tangent matrix and the residual for structural problems.
Definition CFEAElasticity.hpp:44
void Compute_Lame_Parameters(void)
Update the Lame parameters (required in AD to account for all dependencies).
Definition CFEAElasticity.hpp:216
std::unique_ptr< su2double[]> E_i
Young's modulus of elasticity.
Definition CFEAElasticity.hpp:65
su2double E
Aux. variable, Young's modulus of elasticity.
Definition CFEAElasticity.hpp:54
Class for computing the stiffness matrix of a linear, elastic problem.
Definition CFEALinearElasticity.hpp:40
su2activematrix nodalDisplacement
Nodal displacements, used to compute nodal stresses.
Definition CFEALinearElasticity.hpp:42
su2double Compute_Averaged_NodalStress(CElement *element_container, const CConfig *config) final
Compute averaged nodal stresses (for post processing).
Definition CFEALinearElasticity.cpp:183
void Compute_Tangent_Matrix(CElement *element_container, const CConfig *config) final
Build the tangent stiffness matrix of an element.
Definition CFEALinearElasticity.cpp:39
CFEALinearElasticity()
Default constructor, protected to avoid instantiation without arguments.
Definition CFEALinearElasticity.hpp:47
Particular case of linear elasticity used for mesh deformation.
Definition CFEALinearElasticity.hpp:90
CFEAMeshElasticity()=delete
Default constructor deleted as instantiation with no argument would not allocate fields.
void SetMeshElasticProperties(unsigned long iElem, su2double val_E) override
Set the element-based local Young's modulus in mesh problems.
Definition CFEALinearElasticity.hpp:113
passivedouble su2double
Definition code_config.hpp:181