Documentation 6b54b78464
Loading...
Searching...
No Matches
CGaussVariable.hpp
Go to the documentation of this file.
1/*!
2 * \file CGaussVariable.hpp
3 * \brief Light-weight class to store Gaussian point information.
4 * \author R. 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 "../../containers/C2DContainer.hpp"
31
32/*!
33 * \class CGaussVariable
34 * \ingroup FemAlgos
35 * \brief Main class for defining the gaussian points.
36 * \version 8.5.0 "Harrier"
37 */
39 protected:
40 su2activematrix GradNi_Xj; /*!< \brief Gradient of the shape functions N[i] wrt the reference configuration. */
41 su2activematrix GradNi_xj; /*!< \brief Gradient of the shape functions N[i] wrt the current configuration. */
42 su2activevector Ni; /*!< \brief Shape functions N[i] at the gaussian point. */
43 su2double J_X = 0.0; /*!< \brief Element Jacobian evaluated at this Gauss Point wrt the reference configuration. */
44 su2double J_x = 0.0; /*!< \brief Element Jacobian evaluated at this Gauss Point wrt the current configuration. */
45 unsigned short iGaussPoint = 0; /*!< \brief Identifier of the Gauss point considered. */
46
47 public:
48 /*!
49 * \brief Deleted default constructor as this class does not allow resizing once created.
50 */
51 CGaussVariable() = delete;
52
53 /*!
54 * \brief Class constructor
55 * \param[in] val_iGauss - ID of the Gaussian Point
56 * \param[in] val_nDim - Number of dimensions of the problem.
57 * \param[in] config - Definition of the particular problem.
58 */
59 CGaussVariable(unsigned short val_iGauss, unsigned short val_nDim, unsigned short val_nNodes)
60 : J_X(0.0), J_x(0.0), iGaussPoint(val_iGauss) {
61 /* --- For the structural mechanics solver the dimensions (nNodes x nDim) are sufficient.
62 * For the Sobolev smoothing solver dimensions (nNodes x (nDim+1)) are necessary
63 * when working on a curved design surface embedded in 3D. ---*/
64 GradNi_Xj.resize(val_nNodes, val_nDim + 1) = su2double(0.0);
66
67 Ni.resize(val_nNodes) = su2double(0.0);
68 }
69
70 /*!
71 * \brief Destructor of the class.
72 */
73 ~CGaussVariable(void) = default;
74
75 inline void SetGradNi_Xj(su2double val_GradNi_Xj, unsigned short val_iDim, unsigned short val_Ni) {
76 GradNi_Xj(val_Ni, val_iDim) = val_GradNi_Xj;
77 }
78
79 inline void SetGradNi_xj(su2double val_GradNi_xj, unsigned short val_iDim, unsigned short val_Ni) {
80 GradNi_xj(val_Ni, val_iDim) = val_GradNi_xj;
81 }
82
83 inline void SetNi(su2double val_ShapeNi, unsigned short val_Ni) { Ni(val_Ni) = val_ShapeNi; }
84
85 inline void SetJ_X(su2double valJ_X) { J_X = valJ_X; }
86
87 inline void SetJ_x(su2double valJ_x) { J_x = valJ_x; }
88
89 inline su2double GetGradNi_Xj(unsigned short val_Ni, unsigned short val_iDim) const {
90 return GradNi_Xj(val_Ni, val_iDim);
91 }
92
93 inline su2double GetGradNi_xj(unsigned short val_Ni, unsigned short val_iDim) const {
94 return GradNi_xj(val_Ni, val_iDim);
95 }
96
97 inline su2double GetNi(unsigned short val_Ni) const { return Ni(val_Ni); }
98
99 inline su2double GetJ_X(void) const { return J_X; }
100
101 inline su2double GetJ_x(void) const { return J_x; }
102
103 inline unsigned short Get_iGauss(void) const { return iGaussPoint; }
104};
A templated matrix/vector-like object.
Definition C2DContainer.hpp:374
C2DContainer & resize(const Index_t size1, const Index_t size2=1) noexcept
Request a change of size.
Definition C2DContainer.hpp:541
Main class for defining the gaussian points.
Definition CGaussVariable.hpp:38
su2double J_X
Element Jacobian evaluated at this Gauss Point wrt the reference configuration.
Definition CGaussVariable.hpp:43
su2double GetGradNi_Xj(unsigned short val_Ni, unsigned short val_iDim) const
Definition CGaussVariable.hpp:89
su2double J_x
Element Jacobian evaluated at this Gauss Point wrt the current configuration.
Definition CGaussVariable.hpp:44
void SetGradNi_Xj(su2double val_GradNi_Xj, unsigned short val_iDim, unsigned short val_Ni)
Definition CGaussVariable.hpp:75
~CGaussVariable(void)=default
Destructor of the class.
su2activematrix GradNi_Xj
Gradient of the shape functions N[i] wrt the reference configuration.
Definition CGaussVariable.hpp:40
su2double GetJ_x(void) const
Definition CGaussVariable.hpp:101
su2activematrix GradNi_xj
Gradient of the shape functions N[i] wrt the current configuration.
Definition CGaussVariable.hpp:41
su2double GetJ_X(void) const
Definition CGaussVariable.hpp:99
void SetJ_X(su2double valJ_X)
Definition CGaussVariable.hpp:85
CGaussVariable(unsigned short val_iGauss, unsigned short val_nDim, unsigned short val_nNodes)
Class constructor.
Definition CGaussVariable.hpp:59
CGaussVariable()=delete
Deleted default constructor as this class does not allow resizing once created.
unsigned short Get_iGauss(void) const
Definition CGaussVariable.hpp:103
su2double GetNi(unsigned short val_Ni) const
Definition CGaussVariable.hpp:97
void SetGradNi_xj(su2double val_GradNi_xj, unsigned short val_iDim, unsigned short val_Ni)
Definition CGaussVariable.hpp:79
void SetJ_x(su2double valJ_x)
Definition CGaussVariable.hpp:87
su2double GetGradNi_xj(unsigned short val_Ni, unsigned short val_iDim) const
Definition CGaussVariable.hpp:93
unsigned short iGaussPoint
Identifier of the Gauss point considered.
Definition CGaussVariable.hpp:45
void SetNi(su2double val_ShapeNi, unsigned short val_Ni)
Definition CGaussVariable.hpp:83
su2activevector Ni
Shape functions N[i] at the gaussian point.
Definition CGaussVariable.hpp:42
passivedouble su2double
Definition code_config.hpp:181