Skip to content

Commit a46aff3

Browse files
committed
Change travis, config template and add delete statements for free variables.
1 parent 97c687d commit a46aff3

3 files changed

Lines changed: 16 additions & 17 deletions

File tree

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ compiler:
1818
notifications:
1919
email:
2020
recipients:
21-
- koodlyakshay@gmail.com
21+
- su2code-dev@lists.stanford.edu
2222

2323
branches:
2424
only:

Common/src/geometry/CPhysicalGeometry.cpp

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

config_template.cfg

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -809,16 +809,10 @@ GILES_EXTRA_RELAXFACTOR= ( 0.05, 0.05)
809809
% YES Non reflectivity activated, NO the Giles BC behaves as a normal 1D characteristic-based BC
810810
SPATIAL_FOURIER= NO
811811
% ------------------------ WALL ROUGHNESS DEFINITION --------------------------%
812-
% Type of wall (SMOOTH or ROUGH). By default all walls are assumed to be smooth.
813-
% If multiple walls are present, list type for each of them (ex- SMOOTH, ROUGH,..)
814-
% in the order they are listed in MARKER_HEATFLUX followed by the MARKER_ISOTHERMAL
815-
% definition. If all walls are smooth this option can be removed.
816-
%WALL_TYPE= SMOOTH
817-
818812
% The equivalent sand grain roughness height (k_s) on each of the wall. This must be in m.
819-
% This is a list of doubles each element corresponding to the MARKER defined in WALL_TYPE.
820-
% For SMOOTH walls, set it to 0.0.
821-
%WALL_ROUGHNESS = 0.0
813+
% This is a list of (string, double) each element corresponding to the MARKER defined in WALL_TYPE.
814+
%WALL_ROUGHNESS = (wall1, ks1, wall2, ks2)
815+
%WALL_ROUGHNESS = (wall1, ks1, wall2, 0.0) is also allowed
822816
% ------------------------ SURFACES IDENTIFICATION ----------------------------%
823817
%
824818
% Marker(s) of the surface in the surface flow solution file

0 commit comments

Comments
 (0)