Documentation a537f1bdf2
Loading...
Searching...
No Matches
CDiscAdjFEAIteration.hpp
Go to the documentation of this file.
1/*!
2 * \file CFEAIteration.hpp
3 * \brief Headers of the iteration classes used by SU2_CFD.
4 * Each CIteration class represents an available physics package.
5 * \author F. Palacios, T. Economon
6 * \version 8.5.0 "Harrier"
7 *
8 * SU2 Project Website: https://su2code.github.io
9 *
10 * The SU2 Project is maintained by the SU2 Foundation
11 * (http://su2foundation.org)
12 *
13 * Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md)
14 *
15 * SU2 is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU Lesser General Public
17 * License as published by the Free Software Foundation; either
18 * version 2.1 of the License, or (at your option) any later version.
19 *
20 * SU2 is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * Lesser General Public License for more details.
24 *
25 * You should have received a copy of the GNU Lesser General Public
26 * License along with SU2. If not, see <http://www.gnu.org/licenses/>.
27 */
28
29#pragma once
30
31#include "CIteration.hpp"
32
33class CFEAIteration;
34
35/*!
36 * \class CDiscAdjFEAIteration
37 * \ingroup DiscAdj
38 * \brief Class for driving an iteration of the discrete adjoint FEM system.
39 * \author R. Sanchez
40 */
41class CDiscAdjFEAIteration final : public CIteration {
42 private:
43 unsigned short CurrentRecording; /*!< \brief Stores the current status of the recording. */
44
45 /*!< \brief Used for thermo elastic problems to avoid duplicating code. */
46 CIteration* DiscAdjHeatIteration = nullptr;
47
48 /*!
49 * \brief load solution for dynamic problems
50 * \param[in] geometry - Geometrical definition of the problem.
51 * \param[in] solver - Container vector with all the solutions.
52 * \param[in] config - Definition of the particular problem.
53 * \param[in] val_iZone - Index of the zone.
54 * \param[in] val_iInst - Index of the instance.
55 * \param[in] val_DirectIter - Direct iteration to load.
56 */
57 void LoadDynamic_Solution(CGeometry**** geometry, CSolver***** solver, CConfig** config, unsigned short val_iZone,
58 unsigned short val_iInst, int val_DirectIter);
59
60 public:
61 /*!
62 * \brief Constructor of the class.
63 * \param[in] config - Definition of the particular problem.
64 */
65 explicit CDiscAdjFEAIteration(const CConfig* config);
66
67 /*!
68 * \brief Destructor of the class.
69 */
70 ~CDiscAdjFEAIteration() override;
71
72 /*!
73 * \brief Preprocessing to prepare for an iteration of the physics.
74 * \param[in] output - Pointer to the COutput class.
75 * \param[in] integration - Container vector with all the integration methods.
76 * \param[in] geometry - Geometrical definition of the problem.
77 * \param[in] solver - Container vector with all the solutions.
78 * \param[in] numerics - Description of the numerical method (the way in which the equations are solved).
79 * \param[in] config - Definition of the particular problem.
80 * \param[in] surface_movement - Surface movement classes of the problem.
81 * \param[in] grid_movement - Volume grid movement classes of the problem.
82 * \param[in] FFDBox - FFD FFDBoxes of the problem.
83 * \param[in] val_iZone - Index of the zone.
84 * \param[in] val_iInst - Index of the instance.
85 */
86 void Preprocess(COutput* output, CIntegration**** integration, CGeometry**** geometry, CSolver***** solver,
87 CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement,
88 CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone,
89 unsigned short val_iInst) override;
90
91 /*!
92 * \brief Perform a single iteration of the adjoint FEA problem.
93 * \param[in] geometry - Geometrical definition of the problem.
94 * \param[in] solver - Container vector with all the solutions.
95 * \param[in] config - Definition of the particular problem.
96 * \param[in] val_iZone - Index of the zone.
97 * \param[in] val_iInst - Index of the instance.
98 * \param[in] CrossTerm - Boolean for CrossTerm.
99 */
100 void IterateDiscAdj(CGeometry**** geometry, CSolver***** solver, CConfig** config,
101 unsigned short val_iZone, unsigned short val_iInst, bool CrossTerm) override;
102
103 /*!
104 * \brief Monitors the convergence and other metrics for the discrete adjoint FEA problem.
105 * \param[in] output - Pointer to the COutput class.
106 * \param[in] integration - Container vector with all the integration methods.
107 * \param[in] geometry - Geometrical definition of the problem.
108 * \param[in] solver - Container vector with all the solutions.
109 * \param[in] numerics - Description of the numerical method (the way in which the equations are solved).
110 * \param[in] config - Definition of the particular problem.
111 * \param[in] surface_movement - Surface movement classes of the problem.
112 * \param[in] grid_movement - Volume grid movement classes of the problem.
113 * \param[in] FFDBox - FFD FFDBoxes of the problem.
114 * \param[in] val_iZone - Index of the zone.
115 * \param[in] val_iInst - Index of the instance.
116 */
117 bool Monitor(COutput* output, CIntegration**** integration, CGeometry**** geometry, CSolver***** solver,
118 CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement,
119 CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone,
120 unsigned short val_iInst) override;
121
122 /*!
123 * \brief Postprocesses the discrete adjoint FEA problem before heading to another physics system or the next
124 * iteration.
125 * \param[in] output - Pointer to the COutput class.
126 * \param[in] integration - Container vector with all the integration methods.
127 * \param[in] geometry - Geometrical definition of the problem.
128 * \param[in] solver - Container vector with all the solutions.
129 * \param[in] numerics - Description of the numerical method (the way in which the equations are solved).
130 * \param[in] config - Definition of the particular problem.
131 * \param[in] surface_movement - Surface movement classes of the problem.
132 * \param[in] grid_movement - Volume grid movement classes of the problem.
133 * \param[in] FFDBox - FFD FFDBoxes of the problem.
134 * \param[in] val_iZone - Index of the zone.
135 * \param[in] val_iInst - Index of the instance.
136 */
137 void Postprocess(COutput* output, CIntegration**** integration, CGeometry**** geometry, CSolver***** solver,
138 CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement,
139 CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone,
140 unsigned short val_iInst) override;
141
142 /*!
143 * \brief Registers all input variables of the FEM iteration.
144 * \param[in] solver - Container vector with all the solutions.
145 * \param[in] geometry - Geometrical definition of the problem.
146 * \param[in] config - Definition of the particular problem.
147 * \param[in] iZone - Index of the zone.
148 * \param[in] kind_recording - Kind of recording, either FEM_VARIABLES or MESH_COORDS
149 */
150 void RegisterInput(CSolver***** solver, CGeometry**** geometry, CConfig** config, unsigned short iZone,
151 unsigned short iInst, RECORDING kind_recording) override;
152
153 /*!
154 * \brief Registers all output variables of the FEM iteration.
155 * \param[in] solver - Container vector with all the solutions.
156 * \param[in] geometry - Geometrical definition of the problem.
157 * \param[in] config - Definition of the particular problem.
158 * \param[in] iZone - Index of the zone.
159 * \param[in] iInst - Index of the zone.
160 */
161 void RegisterOutput(CSolver***** solver, CGeometry**** geometry, CConfig** config,
162 unsigned short iZone, unsigned short iInst) override;
163
164 /*!
165 * \brief Initializes the adjoints of the output variables of the FEM iteration.
166 * \param[in] solver - Container vector with all the solutions.
167 * \param[in] geometry - Geometrical definition of the problem.
168 * \param[in] config - Definition of the particular problem.
169 * \param[in] iZone - Index of the zone.
170 * \param[in] iInst - Index of the zone.
171 */
172 void InitializeAdjoint(CSolver***** solver, CGeometry**** geometry, CConfig** config, unsigned short iZone,
173 unsigned short iInst) override;
174
175 /*!
176 * \brief Compute necessary variables that depend on the variables in the numerics (E, Nu...)
177 * \param[in] solver - Container vector with all the solutions.
178 * \param[in] geometry - Geometrical definition of the problem.
179 * \param[in] numerics - Description of the numerical method (the way in which the equations are solved).
180 * \param[in] config - Definition of the particular problem.
181 * \param[in] iZone - Index of the zone.
182 * \param[in] iInst - Index of the zone.
183 * \param[in] kind_recording - The kind of recording (geometry or flow).
184 */
185 void SetDependencies(CSolver***** solver, CGeometry**** geometry, CNumerics****** numerics, CConfig** config,
186 unsigned short iZone, unsigned short iInst, RECORDING kind_recording) override;
187
188};
Headers of the iteration classes used by SU2_CFD. Each CIteration class represents an available physi...
Main class for defining the problem; basically this class reads the configuration file,...
Definition CConfig.hpp:64
Class for driving an iteration of the discrete adjoint FEM system.
Definition CDiscAdjFEAIteration.hpp:41
void SetDependencies(CSolver *****solver, CGeometry ****geometry, CNumerics ******numerics, CConfig **config, unsigned short iZone, unsigned short iInst, RECORDING kind_recording) override
Compute necessary variables that depend on the variables in the numerics (E, Nu......
Definition CDiscAdjFEAIteration.cpp:163
void Postprocess(COutput *output, CIntegration ****integration, CGeometry ****geometry, CSolver *****solver, CNumerics ******numerics, CConfig **config, CSurfaceMovement **surface_movement, CVolumetricMovement ***grid_movement, CFreeFormDefBox ***FFDBox, unsigned short val_iZone, unsigned short val_iInst) override
Postprocesses the discrete adjoint FEA problem before heading to another physics system or the next i...
Definition CDiscAdjFEAIteration.cpp:326
void RegisterOutput(CSolver *****solver, CGeometry ****geometry, CConfig **config, unsigned short iZone, unsigned short iInst) override
Registers all output variables of the FEM iteration.
Definition CDiscAdjFEAIteration.cpp:286
void IterateDiscAdj(CGeometry ****geometry, CSolver *****solver, CConfig **config, unsigned short val_iZone, unsigned short val_iInst, bool CrossTerm) override
Perform a single iteration of the adjoint FEA problem.
Definition CDiscAdjFEAIteration.cpp:129
void RegisterInput(CSolver *****solver, CGeometry ****geometry, CConfig **config, unsigned short iZone, unsigned short iInst, RECORDING kind_recording) override
Registers all input variables of the FEM iteration.
Definition CDiscAdjFEAIteration.cpp:142
void InitializeAdjoint(CSolver *****solver, CGeometry ****geometry, CConfig **config, unsigned short iZone, unsigned short iInst) override
Initializes the adjoints of the output variables of the FEM iteration.
Definition CDiscAdjFEAIteration.cpp:297
bool Monitor(COutput *output, CIntegration ****integration, CGeometry ****geometry, CSolver *****solver, CNumerics ******numerics, CConfig **config, CSurfaceMovement **surface_movement, CVolumetricMovement ***grid_movement, CFreeFormDefBox ***FFDBox, unsigned short val_iZone, unsigned short val_iInst) override
Monitors the convergence and other metrics for the discrete adjoint FEA problem.
Definition CDiscAdjFEAIteration.cpp:312
~CDiscAdjFEAIteration() override
Destructor of the class.
Definition CDiscAdjFEAIteration.cpp:41
void Preprocess(COutput *output, CIntegration ****integration, CGeometry ****geometry, CSolver *****solver, CNumerics ******numerics, CConfig **config, CSurfaceMovement **surface_movement, CVolumetricMovement ***grid_movement, CFreeFormDefBox ***FFDBox, unsigned short val_iZone, unsigned short val_iInst) override
Preprocessing to prepare for an iteration of the physics.
Definition CDiscAdjFEAIteration.cpp:46
Class for driving an iteration of structural analysis.
Definition CFEAIteration.hpp:40
Class for defining the free form FFDBox structure.
Definition CFreeFormDefBox.hpp:38
Parent class for defining the geometry of the problem (complete geometry, multigrid agglomerated geom...
Definition CGeometry.hpp:75
Main class for doing the space integration, time integration, and monitoring of a system of Partial D...
Definition CIntegration.hpp:47
Parent class for defining a single iteration of a physics problem.
Definition CIteration.hpp:50
Class for defining the numerical methods.
Definition CNumerics.hpp:48
Class for writing the convergence history and to write solution data to file.
Definition COutput.hpp:68
Definition CSolver.hpp:71
Class for moving the surface numerical grid.
Definition CSurfaceMovement.hpp:38
Class for moving the volumetric numerical grid.
Definition CVolumetricMovement.hpp:37
RECORDING
Definition option_structure.hpp:2820