@@ -11279,12 +11279,12 @@ void CPhysicalGeometry::SetGlobalMarkerRoughness(const CConfig* config) {
1127911279 unsigned short iMarker;
1128011280 unsigned short nMarker_All = config->GetnMarker_All ();
1128111281
11282- vector< int > displs ( size) ;
11283- vector< int > recvCounts ( size) ;
11282+ int * displs = new int [ size] ;
11283+ int * recvCounts = new int [ size] ;
1128411284 int sizeLocal = (int ) nMarker_All; // number of local markers
1128511285
1128611286 // Communicate size of local marker array and make an array large enough to hold all data
11287- SU2_MPI::Allgather (&sizeLocal, 1 , MPI_INT, recvCounts. data () , 1 ,
11287+ SU2_MPI::Allgather (&sizeLocal, 1 , MPI_INT, recvCounts, 1 ,
1128811288 MPI_INT, MPI_COMM_WORLD);
1128911289
1129011290 // displacements based on size on each rank
@@ -11301,22 +11301,27 @@ void CPhysicalGeometry::SetGlobalMarkerRoughness(const CConfig* config) {
1130111301 int sizeGlobal = displs[size-1 ] + recvCounts[size-1 ];
1130211302
1130311303 /* --- Allocate local and global arrays to hold roughness. ---*/
11304- vector< su2double> localRough (nMarker_All); // local number of markers
11305- vector< su2double> globalRough ( sizeGlobal); // all markers including send recieve
11304+ su2double * localRough = new su2double [nMarker_All]; // local number of markers
11305+ su2double * globalRough = new su2double[ sizeGlobal]; // all markers including send recieve
1130611306 pair<unsigned short , su2double> wallprop;
1130711307
1130811308 for (iMarker = 0 ; iMarker < nMarker_All; iMarker++) {
1130911309 wallprop = config->GetWallRoughnessProperties (config->GetMarker_All_TagBound (iMarker));
1131011310 localRough[iMarker] = wallprop.second ;
1131111311 }
1131211312
11313- SU2_MPI::Allgatherv ( localRough. data () , sizeLocal, MPI_DOUBLE, globalRough. data () ,
11314- recvCounts. data () , displs. data () , MPI_DOUBLE,
11313+ SU2_MPI::Allgatherv ( localRough, sizeLocal, MPI_DOUBLE, globalRough ,
11314+ recvCounts, displs, MPI_DOUBLE,
1131511315 MPI_COMM_WORLD);
1131611316
1131711317 /* --- Set the global array of roughness per marker. ---*/
1131811318 if (GlobalRoughness_Height == nullptr ) GlobalRoughness_Height = new su2double [sizeGlobal];
1131911319 for (int iMarker = 0 ; iMarker < sizeGlobal; iMarker++)
1132011320 GlobalRoughness_Height[iMarker] = globalRough[iMarker];
1132111321
11322+ /* --- Deallocate local variables. ---*/
11323+ delete [] displs;
11324+ delete [] recvCounts;
11325+ delete [] localRough;
11326+ delete [] globalRough;
1132211327}
0 commit comments