Skip to content

Commit f0d8b0a

Browse files
committed
fix multizone memory errors
1 parent 9127cfa commit f0d8b0a

5 files changed

Lines changed: 13 additions & 19 deletions

File tree

SU2_CFD/include/drivers/CDriverBase.hpp

Lines changed: 4 additions & 4 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. */
@@ -74,8 +74,8 @@ class CDriverBase {
7474
CSurfaceMovement** surface_movement; /*!< \brief Surface movement classes of the problem. */
7575
CVolumetricMovement*** grid_movement; /*!< \brief Volume grid movement classes of the problem. */
7676

77-
CConfig* main_config; /*!< \brief Reference to base (i.e. ZONE 0) configuration (used in driver API). */
78-
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). */
7979

8080
public:
8181
/*!

SU2_CFD/src/drivers/CDriverBase.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,6 @@ void CDriverBase::SetContainers_Null() {
5555
for (iZone = 0; iZone < nZone; iZone++) {
5656
nInst[iZone] = 1;
5757
}
58-
59-
driver_config = nullptr;
60-
driver_output = nullptr;
61-
62-
main_config = nullptr;
63-
main_geometry = nullptr;
6458
}
6559

6660
void CDriverBase::CommonPostprocessing() {

SU2_DEF/src/drivers/CDeformationDriver.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ CDeformationDriver::CDeformationDriver(char* confFile, SU2_Comm MPICommunicator)
4949
rank = SU2_MPI::GetRank();
5050
size = SU2_MPI::GetSize();
5151

52-
/*--- Initialize containers. --- */
53-
54-
SetContainers_Null();
55-
5652
/*--- Preprocessing of the config files. ---*/
5753

5854
Input_Preprocessing();
@@ -102,6 +98,10 @@ void CDeformationDriver::Input_Preprocessing() {
10298

10399
nZone = driver_config->GetnZone();
104100

101+
/*--- Initialize containers. --- */
102+
103+
SetContainers_Null();
104+
105105
/*--- Loop over all zones to initialize the various classes. In most
106106
cases, nZone is equal to one. This represents the solution of a partial
107107
differential equation on a single block, unstructured mesh. ---*/

SU2_DEF/src/drivers/CDiscAdjDeformationDriver.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ CDiscAdjDeformationDriver::CDiscAdjDeformationDriver(char* confFile, SU2_Comm MP
5555
rank = SU2_MPI::GetRank();
5656
size = SU2_MPI::GetSize();
5757

58-
/*--- Initialize containers. --- */
59-
60-
SetContainers_Null();
61-
6258
/*--- Preprocessing of the config files. ---*/
6359

6460
Input_Preprocessing();
@@ -109,6 +105,10 @@ void CDiscAdjDeformationDriver::Input_Preprocessing() {
109105

110106
nZone = driver_config->GetnZone();
111107

108+
/*--- Initialize containers. --- */
109+
110+
SetContainers_Null();
111+
112112
/*--- Loop over all zones to initialize the various classes. In most
113113
* cases, nZone is equal to one. This represents the solution of a partial
114114
* differential equation on a single block, unstructured mesh. ---*/

TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configMaster.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ DEFORM_LINEAR_SOLVER_PREC= ILU
6969
DEFORM_LINEAR_SOLVER_ERROR= 1E-14
7070
%
7171
DEFORM_NONLINEAR_ITER= 1
72-
DEFORM_LINEAR_SOLVER_ITER= 1000
72+
DEFORM_LINEAR_SOLVER_ITER= 10
7373
%
7474
DEFORM_CONSOLE_OUTPUT= YES
7575
DEFORM_STIFFNESS_TYPE= WALL_DISTANCE

0 commit comments

Comments
 (0)