Documentation a537f1bdf2
Loading...
Searching...
No Matches
CDiscAdjDeformationDriver.hpp
Go to the documentation of this file.
1/*!
2 * \file CDiscAdjDeformationDriver.hpp
3 * \brief Headers of the main subroutines for driving the projection of sensitivities.
4 * \author T. Economon, H. Kline, R. Sanchez, A. Gastaldi, H. Patel
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 "../../../Common/include/fem/fem_geometry_structure.hpp"
31#include "../../../Common/include/parallelization/mpi_structure.hpp"
32#include "../../../Common/include/parallelization/omp_structure.hpp"
33#include "../../../SU2_CFD/include/drivers/CDriverBase.hpp"
34
36 protected:
38
39 public:
40 /*!
41 * \brief Constructor of the class.
42 * \param[in] confFile - Configuration file name.
43 * \param[in] MPICommunicator - MPI communicator for SU2.
44 */
45 CDiscAdjDeformationDriver(char* confFile, SU2_Comm MPICommunicator);
46
47 /*!
48 * \brief Preprocess the driver data (includes solution allocation and initialization).
49 */
50 void Preprocess();
51
52 /*!
53 * \brief Launch the driver computation.
54 */
55 void Run() override;
56
57 /*!
58 * \brief Deallocation routine.
59 */
60 void Finalize() override;
61
62 protected:
63 /*!
64 * \brief Read in the config and mesh files.
65 */
67
68 /*!
69 * \brief Construction of the edge-based data structure.
70 */
72
73 /*!
74 * \brief Preprocess the output container.
75 */
77
78 /*!
79 * \brief Projection of the surface sensitivity using finite differences (FD).
80 * \param[in] geometry - Geometrical definition of the problem.
81 * \param[in] config - Definition of the particular problem.
82 * \param[in] surface_movement - Surface movement class of the problem.
83 * \param[in] Gradient_file - Output file to store the gradient data.
84 */
86
87 /*!
88 * \brief Projection of the surface sensitivity using algorithmic differentiation (AD).
89 * \param[in] geometry - Geometrical definition of the problem.
90 * \param[in] config - Definition of the particular problem.
91 * \param[in] surface_movement - Surface movement class of the problem.
92 * \param[in] Gradient_file - Output file to store the gradient data.
93 */
95
96 /*!
97 * \brief Prints the gradient information to a file.
98 * \param[in] Gradient - The gradient data.
99 * \param[in] config - Definition of the particular problem.
100 * \param[in] Gradient_file - Output file to store the gradient data.
101 */
102 void OutputGradient(su2double** Gradient, CConfig* config, ofstream& Gradient_file);
103
104 /*!
105 * \brief Write the sensitivity (including mesh sensitivity) computed with the discrete adjoint method
106 * on the surface and in the volume to a file.
107 * \param[in] geometry - Geometrical definition of the problem.
108 * \param[in] config - Definition of the particular problem.
109 * \param[in] val_nZone - Number of Zones.
110 */
111 void SetSensitivity_Files(CGeometry**** geometry, CConfig** config, unsigned short val_nZone);
112
113 /*!
114 * \brief Treatment of derivatives with the Sobolev smoothing solver.
115 * \param[in] geometry - Geometrical definition of the problem.
116 * \param[in] config - Definition of the particular problem.
117 * \param[in] grid_movement - Volumetric movement class of the problem.
118 */
120
121 /*!
122 * \brief Treatment of derivatives with the Sobolev smoothing solver.
123 * \param[in] geometry - Geometrical definition of the problem.
124 * \param[in] config - Definition of the particular problem.
125 * \param[in] grid_movement - Volumetric movement class of the problem.
126 * \param[in] surface_movement - Surface movement class of the problem.
127 * \param[in] Gradient - Output array to store the gradient data.
128 */
131};
Main class for defining the problem; basically this class reads the configuration file,...
Definition CConfig.hpp:64
Definition CDiscAdjDeformationDriver.hpp:35
void OutputGradient(su2double **Gradient, CConfig *config, ofstream &Gradient_file)
Prints the gradient information to a file.
Definition CDiscAdjDeformationDriver.cpp:755
void Finalize() override
Deallocation routine.
Definition CDiscAdjDeformationDriver.cpp:369
void Input_Preprocessing()
Read in the config and mesh files.
Definition CDiscAdjDeformationDriver.cpp:84
void Preprocess()
Preprocess the driver data (includes solution allocation and initialization).
Definition CDiscAdjDeformationDriver.cpp:277
void SetProjection_AD(CGeometry *geometry, CConfig *config, CSurfaceMovement *surface_movement, su2double **Gradient)
Projection of the surface sensitivity using algorithmic differentiation (AD).
Definition CDiscAdjDeformationDriver.cpp:651
void DerivativeTreatment_Gradient(CGeometry *geometry, CConfig *config, CVolumetricMovement *grid_movement, CSurfaceMovement *surface_movement, su2double **Gradient)
Treatment of derivatives with the Sobolev smoothing solver.
Definition CDiscAdjDeformationDriver.cpp:970
void SetProjection_FD(CGeometry *geometry, CConfig *config, CSurfaceMovement *surface_movement, su2double **Gradient)
Projection of the surface sensitivity using finite differences (FD).
Definition CDiscAdjDeformationDriver.cpp:385
void Output_Preprocessing()
Preprocess the output container.
Definition CDiscAdjDeformationDriver.cpp:275
void SetSensitivity_Files(CGeometry ****geometry, CConfig **config, unsigned short val_nZone)
Write the sensitivity (including mesh sensitivity) computed with the discrete adjoint method on the s...
Definition CDiscAdjDeformationDriver.cpp:800
void Geometrical_Preprocessing()
Construction of the edge-based data structure.
Definition CDiscAdjDeformationDriver.cpp:139
void Run() override
Launch the driver computation.
Definition CDiscAdjDeformationDriver.cpp:301
su2double ** Gradient
Definition CDiscAdjDeformationDriver.hpp:37
void DerivativeTreatment_MeshSensitivity(CGeometry *geometry, CConfig *config, CVolumetricMovement *grid_movement)
Treatment of derivatives with the Sobolev smoothing solver.
Definition CDiscAdjDeformationDriver.cpp:909
Base class for all drivers.
Definition CDriverBase.hpp:43
CVolumetricMovement *** grid_movement
Volume grid movement classes of the problem.
Definition CDriverBase.hpp:75
CSurfaceMovement ** surface_movement
Surface movement classes of the problem.
Definition CDriverBase.hpp:74
Parent class for defining the geometry of the problem (complete geometry, multigrid agglomerated geom...
Definition CGeometry.hpp:75
Class for moving the surface numerical grid.
Definition CSurfaceMovement.hpp:38
Class for moving the volumetric numerical grid.
Definition CVolumetricMovement.hpp:37
passivedouble su2double
Definition code_config.hpp:181
int SU2_Comm
Definition mpi_structure.hpp:619