Skip to content

Commit 5f60110

Browse files
committed
Merge branch 'nemo_updates' of https://github.com/su2code/SU2 into nemo_updates
2 parents 24ca5f8 + 76692cf commit 5f60110

15 files changed

Lines changed: 240 additions & 400 deletions

File tree

Docs/docmain.hpp

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
* License along with SU2. If not, see <http://www.gnu.org/licenses/>.
2626
*/
2727

28-
/*!
28+
/*!
2929
* \mainpage SU2 version 7.5.1 "Blackbird"
3030
* SU2 suite is an open-source collection of C++ based software tools
31-
* to perform PDE analysis and PDE constrained optimization. The toolset is designed with
31+
* to perform PDE analysis and PDE constrained optimization. The toolset is designed with
3232
* computational fluid dynamics and aerodynamic shape optimization in mind, but is extensible to
3333
* include other families of governing equations such as potential flow, electrodynamics, chemically reacting
3434
* flows, and many others. SU2 is released under an open-source license.
@@ -66,43 +66,43 @@
6666

6767
/*!
6868
* \defgroup ConvDiscr Discretization of the convective terms
69-
* \brief Group of classes which define the numerical methods for
70-
* discretizing the convective terms of a Partial Differential Equation.
71-
* There are methods for solving the direct, adjoint and linearized
69+
* \brief Group of classes which define the numerical methods for
70+
* discretizing the convective terms of a Partial Differential Equation.
71+
* There are methods for solving the direct, adjoint and linearized
7272
* systems of equations.
7373
*/
7474

7575
/*!
7676
* \defgroup ViscDiscr Discretization of the viscous terms
77-
* \brief Group of classes which define the numerical methods for
78-
* discretizing the viscous terms of a Partial Differential Equation.
79-
* There are methods for solving the direct, adjoint and linearized
77+
* \brief Group of classes which define the numerical methods for
78+
* discretizing the viscous terms of a Partial Differential Equation.
79+
* There are methods for solving the direct, adjoint and linearized
8080
* systems of equations.
8181
*/
8282

8383
/*!
8484
* \defgroup SourceDiscr Discretization of the source terms
85-
* \brief Group of classes which define the numerical methods for
86-
* discretizing the source terms of a Partial Differential Equation.
87-
* There are methods for solving the direct, adjoint and linearized
85+
* \brief Group of classes which define the numerical methods for
86+
* discretizing the source terms of a Partial Differential Equation.
87+
* There are methods for solving the direct, adjoint and linearized
8888
* systems of equations.
8989
*/
9090

9191
/*!
9292
* \defgroup Euler_Equations Solving the Euler equations
93-
* \brief Group of classes which define the system of Euler equations in
93+
* \brief Group of classes which define the system of Euler equations in
9494
* three formulations: direct, adjoint, and linearized.
9595
*/
9696

9797
/*!
9898
* \defgroup Navier_Stokes_Equations Solving the Navier-Stokes equations
99-
* \brief Group of classes which define the system of Navier-Stokes equations in
99+
* \brief Group of classes which define the system of Navier-Stokes equations in
100100
* three formulations: direct, adjoint, and linearized.
101101
*/
102102

103103
/*!
104104
* \defgroup Turbulence_Model Solving the turbulence model equations
105-
* \brief Group of classes which define the turbulence model in
105+
* \brief Group of classes which define the turbulence model in
106106
* three formulations: direct, adjoint, and linearized.
107107
*/
108108

@@ -130,6 +130,13 @@
130130
* space and time integration. The latter use mostly the "Solvers".
131131
*/
132132

133+
/*!
134+
* \defgroup PySU2 Python Wrapper functions
135+
* \brief Functions of the driver classes (\ref Drivers) that can be used to customize SU2
136+
* via Python. For example, set custom temperature distributions at boundaries,
137+
* deform the mesh, etc.
138+
*/
139+
133140
/*!
134141
* \defgroup Variable Storing solution variables
135142
* \brief Classes used to store and access the solution variables of all types of problems.

SU2_CFD/include/drivers/CDriver.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ class CDriver : public CDriverBase {
7474
fsi, /*!< \brief FSI simulation flag.*/
7575
fem_solver; /*!< \brief FEM fluid solver simulation flag. */
7676

77+
CFreeFormDefBox*** FFDBox; /*!< \brief FFD FFDBoxes of the problem. */
78+
7779
CIteration*** iteration_container; /*!< \brief Container vector with all the iteration methods. */
7880
CIntegration**** integration_container; /*!< \brief Container vector with all the integration methods. */
7981
vector<vector<unique_ptr<CInterpolator>>>
@@ -401,6 +403,9 @@ class CDriver : public CDriverBase {
401403
*/
402404
virtual void SetInitialMesh() {}
403405

406+
/// \addtogroup PySU2
407+
/// \{
408+
404409
/*!
405410
* \brief Process the boundary conditions and update the multi-grid structure.
406411
*/
@@ -642,6 +647,8 @@ class CDriver : public CDriverBase {
642647
*/
643648
void SetInlet_Angle(unsigned short iMarker, passivedouble alpha);
644649

650+
/// \}
651+
645652
/*!
646653
* \brief Sum the number of primal or adjoint variables for all solvers in a given zone.
647654
* \param[in] iZone - Index of the zone.

SU2_CFD/include/drivers/CDriverBase.hpp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ class CDriverBase {
6262
*nInst, /*!< \brief Total number of instances in the problem (per zone). */
6363
**interface_types; /*!< \brief Type of coupling between the distinct (physical) zones. */
6464

65-
CConfig* driver_config; /*!< \brief Definition of the driver configuration. */
66-
COutput* driver_output; /*!< \brief Definition of the driver output. */
65+
CConfig* driver_config = nullptr; /*!< \brief Definition of the driver configuration. */
66+
COutput* driver_output = nullptr; /*!< \brief Definition of the driver output. */
6767

6868
CConfig** config_container; /*!< \brief Definition of the particular problem. */
6969
COutput** output_container; /*!< \brief Pointer to the COutput class. */
@@ -73,10 +73,9 @@ class CDriverBase {
7373
are solved). */
7474
CSurfaceMovement** surface_movement; /*!< \brief Surface movement classes of the problem. */
7575
CVolumetricMovement*** grid_movement; /*!< \brief Volume grid movement classes of the problem. */
76-
CFreeFormDefBox*** FFDBox; /*!< \brief FFD FFDBoxes of the problem. */
7776

78-
CConfig* main_config; /*!< \brief Reference to base (i.e. ZONE 0) configuration (used in driver API). */
79-
CGeometry* main_geometry; /*!< \brief Reference to base (i.e. ZONE, INST, MESH 0) geometry (used in driver API). */
77+
CConfig* main_config = nullptr; /*!< \brief Reference to base (i.e. ZONE 0) configuration (used in driver API). */
78+
CGeometry* main_geometry = nullptr; /*!< \brief Reference to base (i.e. ZONE, INST, MESH 0) geometry (used in driver API). */
8079

8180
public:
8281
/*!
@@ -122,6 +121,9 @@ class CDriverBase {
122121
*/
123122
virtual void Postprocessing(){}
124123

124+
/// \addtogroup PySU2
125+
/// @{
126+
125127
/*!
126128
* \brief Get the number of design variables.
127129
* \return Number of design variables.
@@ -321,13 +323,19 @@ class CDriverBase {
321323
* \brief Communicate the boundary mesh displacements.
322324
*/
323325
void CommunicateMeshDisplacements(void);
326+
/// \}
324327

325328
protected:
326329
/*!
327330
* \brief Initialize containers.
328331
*/
329332
void SetContainers_Null();
330333

334+
/*!
335+
* \brief Delete containers.
336+
*/
337+
void CommonPostprocessing();
338+
331339
/*!
332340
* \brief Read in the config and mesh files.
333341
* \param[in] config - Definition of the particular problem.

SU2_CFD/src/drivers/CDriverBase.cpp

Lines changed: 71 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,36 +42,92 @@ void CDriverBase::SetContainers_Null() {
4242
* down a hierarchy over all zones, multi-grid levels, equation sets, and equation terms as described in the comments
4343
* below. ---*/
4444

45-
config_container = nullptr;
46-
output_container = nullptr;
47-
geometry_container = nullptr;
48-
solver_container = nullptr;
49-
numerics_container = nullptr;
50-
51-
surface_movement = nullptr;
52-
grid_movement = nullptr;
53-
FFDBox = nullptr;
54-
5545
config_container = new CConfig*[nZone]();
5646
output_container = new COutput*[nZone]();
5747
geometry_container = new CGeometry***[nZone]();
5848
solver_container = new CSolver****[nZone]();
5949
numerics_container = new CNumerics*****[nZone]();
6050
surface_movement = new CSurfaceMovement*[nZone]();
6151
grid_movement = new CVolumetricMovement**[nZone]();
62-
FFDBox = new CFreeFormDefBox**[nZone]();
6352

6453
nInst = new unsigned short[nZone];
6554

6655
for (iZone = 0; iZone < nZone; iZone++) {
6756
nInst[iZone] = 1;
6857
}
58+
}
59+
60+
void CDriverBase::CommonPostprocessing() {
61+
62+
if (numerics_container != nullptr) {
63+
for (iZone = 0; iZone < nZone; iZone++) {
64+
delete[] numerics_container[iZone];
65+
}
66+
delete[] numerics_container;
67+
}
68+
if (rank == MASTER_NODE) cout << "Deleted CNumerics container." << endl;
69+
70+
if (solver_container != nullptr) {
71+
for (iZone = 0; iZone < nZone; iZone++) {
72+
delete[] solver_container[iZone];
73+
}
74+
delete[] solver_container;
75+
}
76+
if (rank == MASTER_NODE) cout << "Deleted CSolver container." << endl;
77+
78+
if (geometry_container != nullptr) {
79+
for (iZone = 0; iZone < nZone; iZone++) {
80+
if (geometry_container[iZone] != nullptr) {
81+
for (iInst = 0; iInst < nInst[iZone]; iInst++) {
82+
delete geometry_container[iZone][iInst][MESH_0];
83+
delete[] geometry_container[iZone][iInst];
84+
}
85+
delete[] geometry_container[iZone];
86+
}
87+
}
88+
delete[] geometry_container;
89+
}
90+
if (rank == MASTER_NODE) cout << "Deleted CGeometry container." << endl;
91+
92+
if (surface_movement != nullptr) {
93+
for (iZone = 0; iZone < nZone; iZone++) {
94+
delete surface_movement[iZone];
95+
}
96+
delete[] surface_movement;
97+
}
98+
if (rank == MASTER_NODE) cout << "Deleted CSurfaceMovement class." << endl;
99+
100+
if (grid_movement != nullptr) {
101+
for (iZone = 0; iZone < nZone; iZone++) {
102+
if (grid_movement[iZone] != nullptr) {
103+
for (iInst = 0; iInst < nInst[iZone]; iInst++) {
104+
delete grid_movement[iZone][iInst];
105+
}
106+
delete[] grid_movement[iZone];
107+
}
108+
}
109+
delete[] grid_movement;
110+
}
111+
if (rank == MASTER_NODE) cout << "Deleted CVolumetricMovement class." << endl;
69112

70-
driver_config = nullptr;
71-
driver_output = nullptr;
113+
if (config_container != nullptr) {
114+
for (iZone = 0; iZone < nZone; iZone++) {
115+
delete config_container[iZone];
116+
}
117+
delete[] config_container;
118+
}
119+
delete driver_config;
120+
if (rank == MASTER_NODE) cout << "Deleted CConfig container." << endl;
121+
122+
if (output_container != nullptr) {
123+
for (iZone = 0; iZone < nZone; iZone++) {
124+
delete output_container[iZone];
125+
}
126+
delete[] output_container;
127+
}
128+
if (rank == MASTER_NODE) cout << "Deleted COutput class." << endl;
72129

73-
main_config = nullptr;
74-
main_geometry = nullptr;
130+
delete[] nInst;
75131
}
76132

77133
unsigned short CDriverBase::GetNumberDesignVariables() const { return main_config->GetnDV(); }

SU2_DEF/include/SU2_DEF.hpp

Lines changed: 0 additions & 40 deletions
This file was deleted.

SU2_DEF/include/drivers/CDeformationDriver.hpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,6 @@ class CDeformationDriver : public CDriverBase {
4848
*/
4949
CDeformationDriver(char* confFile, SU2_Comm MPICommunicator);
5050

51-
/*!
52-
* \brief Destructor of the class.
53-
*/
54-
~CDeformationDriver(void);
55-
5651
/*!
5752
* \brief Preprocess the driver data.
5853
*/

0 commit comments

Comments
 (0)