Skip to content

Commit 6f692ee

Browse files
authored
Merge pull request #1077 from su2code/fix_memory_issues
Fix memory issues
2 parents 3808ca5 + b513aab commit 6f692ee

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

Common/include/CConfig.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,6 +1077,8 @@ class CConfig {
10771077
default_jst_adj_coeff[2], /*!< \brief Default artificial dissipation (adjoint) array for the COption class. */
10781078
default_ad_coeff_heat[2], /*!< \brief Default artificial dissipation (heat) array for the COption class. */
10791079
default_obj_coeff[5], /*!< \brief Default objective array for the COption class. */
1080+
default_mesh_box_length[3], /*!< \brief Default mesh box length for the COption class. */
1081+
default_mesh_box_offset[3], /*!< \brief Default mesh box offset for the COption class. */
10801082
default_geo_loc[2], /*!< \brief Default SU2_GEO section locations array for the COption class. */
10811083
default_distortion[2], /*!< \brief Default SU2_GEO section locations array for the COption class. */
10821084
default_ea_lim[3], /*!< \brief Default equivalent area limit array for the COption class. */

Common/src/CConfig.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1944,12 +1944,12 @@ void CConfig::SetConfig_Options() {
19441944
addShortListOption("MESH_BOX_SIZE", nMesh_Box_Size, Mesh_Box_Size);
19451945

19461946
/* DESCRIPTION: List of the length of the RECTANGLE or BOX grid in the x,y,z directions. (default: (1.0,1.0,1.0) ). */
1947-
array<su2double, 3> default_mesh_box_length = {{1.0, 1.0, 1.0}};
1948-
addDoubleArrayOption("MESH_BOX_LENGTH", 3, Mesh_Box_Length, default_mesh_box_length.data());
1947+
default_mesh_box_length[0] = 1.0; default_mesh_box_length[1] = 1.0; default_mesh_box_length[2] = 1.0;
1948+
addDoubleArrayOption("MESH_BOX_LENGTH", 3, Mesh_Box_Length, default_mesh_box_length);
19491949

19501950
/* DESCRIPTION: List of the offset from 0.0 of the RECTANGLE or BOX grid in the x,y,z directions. (default: (0.0,0.0,0.0) ). */
1951-
array<su2double, 3> default_mesh_box_offset = {{0.0, 0.0, 0.0}};
1952-
addDoubleArrayOption("MESH_BOX_OFFSET", 3, Mesh_Box_Offset, default_mesh_box_offset.data());
1951+
default_mesh_box_offset[0] = 0.0; default_mesh_box_offset[1] = 0.0; default_mesh_box_offset[2] = 0.0;
1952+
addDoubleArrayOption("MESH_BOX_OFFSET", 3, Mesh_Box_Offset, default_mesh_box_offset);
19531953

19541954
/* DESCRIPTION: Determine if the mesh file supports multizone. \n DEFAULT: true (temporarily) */
19551955
addBoolOption("MULTIZONE_MESH", Multizone_Mesh, true);

SU2_CFD/src/output/filewriter/CParallelDataSorter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ void CParallelDataSorter::PrepareSendBuffers(std::vector<unsigned long>& globalI
324324
/*--- Allocate the data buffer to hold the sorted data. We have to make it large enough
325325
* to hold passivedoubles and su2doubles ---*/
326326
unsigned short maxSize = max(sizeof(passivedouble), sizeof(su2double));
327-
dataBuffer = new char[VARS_PER_POINT*nPoint_Recv[size]*maxSize];
327+
dataBuffer = new char[VARS_PER_POINT*nPoint_Recv[size]*maxSize] {};
328328

329329
/*--- doubleBuffer and passiveDouble buffer use the same memory allocated above using the dataBuffer. ---*/
330330

0 commit comments

Comments
 (0)