2929
3030#include " ../../../Common/include/linear_algebra/CMatrixVectorProduct.hpp"
3131#include " ../../../Common/include/toolboxes/CSquareMatrixCM.hpp"
32- #include " ../../../SU2_CFD/include/solvers/CFEASolverBase.hpp"
32+ #include " ../variables/CSobolevSmoothingVariable.hpp"
33+ #include " CFEASolverBase.hpp"
3334
3435/* ! \class CGradientSmoothingSolver
3536 * \brief Main class for defining a gradient smoothing.
@@ -65,6 +66,17 @@ class CGradientSmoothingSolver final : public CFEASolverBase {
6566
6667 CSquareMatrixCM hessian; /* !< \brief The approximated Hessian with respect to the design variables. */
6768
69+ /* !
70+ * \brief The highest level in the variable hierarchy all derived solvers can safely use,
71+ * CVariable is the common denominator between the FEA and Mesh deformationd variables.
72+ */
73+ CSobolevSmoothingVariable* nodes = nullptr ;
74+
75+ /* !
76+ * \brief Return nodes to allow CSolver::base_nodes to be set.
77+ */
78+ inline CVariable* GetBaseClassPointerToNodes () override { return nodes; }
79+
6880 public:
6981 /* !
7082 * \brief Constructor of the class.
@@ -129,12 +141,12 @@ class CGradientSmoothingSolver final : public CFEASolverBase {
129141 /* !
130142 * \brief Set Dirichlet boundary conditions
131143 */
132- void BC_Dirichlet (CGeometry* geometry, const CConfig* config, unsigned int val_marker);
144+ void BC_Dirichlet (const CGeometry* geometry, const CConfig* config, unsigned int val_marker);
133145
134146 /* !
135147 * \brief Set Dirichlet boundary conditions for the surface solver
136148 */
137- void BC_Surface_Dirichlet (CGeometry* geometry, const CConfig* config, unsigned int val_marker);
149+ void BC_Surface_Dirichlet (const CGeometry* geometry, const CConfig* config, unsigned int val_marker);
138150
139151 /* !
140152 * \brief Call the linear systems solver
@@ -174,7 +186,7 @@ class CGradientSmoothingSolver final : public CFEASolverBase {
174186 /* !
175187 * \brief write the DV gradient into a file
176188 */
177- void OutputDVGradient (CConfig * config, string out_file= " delta_p.txt" );
189+ void OutputDVGradient (const CConfig* config, string out_file = " delta_p.txt" );
178190
179191 /* !
180192 * \brief Record a tape containing the parameter Jacobian.
@@ -211,18 +223,6 @@ class CGradientSmoothingSolver final : public CFEASolverBase {
211223 CSysVector<su2double> ®isteredCoord,
212224 CConfig *config);
213225
214- /* !
215- * \brief Extract and set the geometrical sensitivity.
216- * \param[in] geometry - Geometrical definition of the problem.
217- * \param[in] config - Definition of the particular problem.
218- */
219- void SetSensitivity (CGeometry *geometry, CConfig *config, CSolver*) override ;
220-
221- /* !
222- * \brief Write the solution of the linear solver into the sensitivities of the nodes
223- */
224- void WriteSensitivity (CGeometry* geometry, const CConfig* config, unsigned long val_marker = 0 );
225-
226226 /* !
227227 * \brief Write the content of sensitivity in the nodes to the sensitivity in the geometry
228228 * \param[in] geometry - Geometrical definition of the problem.
@@ -235,6 +235,12 @@ class CGradientSmoothingSolver final : public CFEASolverBase {
235235 */
236236 void ReadSensFromGeometry (const CGeometry *geometry) override ;
237237
238+ private:
239+ /* !
240+ * \brief Write the solution of the linear solver into the sensitivities of the nodes
241+ */
242+ void WriteSensitivity (CGeometry* geometry, const CConfig* config, unsigned long val_marker = 0 );
243+
238244 /* !
239245 * \brief Copy sensitivities from a vector into the geometry
240246 */
@@ -257,13 +263,6 @@ class CGradientSmoothingSolver final : public CFEASolverBase {
257263 return geometry->nodes ->GetCoord (indexNode, iDim);
258264 }
259265
260- /* !
261- * \brief Extract the Coordinates of the element from geometry
262- */
263- su2activematrix GetElementCoordinates (CGeometry *geometry,
264- std::vector<unsigned long >& indexNode,
265- int EL_KIND = 0 );
266-
267266 /* !
268267 * \brief Extra entries to eliminate in the linear system
269268 */
@@ -289,12 +288,17 @@ class CGradientSmoothingSolver final : public CFEASolverBase {
289288 }
290289 }
291290
292- private:
293-
291+ /* !
292+ * \brief Set the current working dimension, if the seperate dimension option is set.
293+ * \param[in] iDim - the dimension we are currently working in.
294+ */
294295 inline void SetCurrentDim (unsigned int iDim) {
295296 curDim=iDim;
296297 }
297298
299+ /* !
300+ * \brief Return the current working dimension.
301+ */
298302 inline const unsigned int & GetCurrentDim () const {
299303 return curDim;
300304 }
0 commit comments