Skip to content

Commit 0d90411

Browse files
committed
fixes for actdisk stuff
1 parent 3fac3c2 commit 0d90411

1 file changed

Lines changed: 15 additions & 8 deletions

File tree

Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFVM.cpp

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ void CSU2ASCIIMeshReaderFVM::SplitActuatorDiskSurface() {
269269

270270
/*--- Actuator disk preprocesing ---*/
271271

272-
string Marker_Tag_Duplicate;
273272
bool InElem, Perimeter;
274273
unsigned long Counter = 0;
275274
Xloc = 0.0; Yloc = 0.0; Zloc = 0.0;
@@ -296,6 +295,11 @@ void CSU2ASCIIMeshReaderFVM::SplitActuatorDiskSurface() {
296295
CURRENT_FUNCTION);
297296
}
298297

298+
/*--- Open grid file ---*/
299+
300+
mesh_file.open(meshFilename);
301+
FastForwardToMyZone();
302+
299303
/*--- Read grid file with format SU2 ---*/
300304

301305
string text_line;
@@ -530,6 +534,7 @@ void CSU2ASCIIMeshReaderFVM::SplitActuatorDiskSurface() {
530534
/* Open the mesh file again to read the coordinates of the new points. */
531535

532536
mesh_file.open(meshFilename);
537+
FastForwardToMyZone();
533538

534539
while (getline (mesh_file, text_line)) {
535540

@@ -699,6 +704,8 @@ void CSU2ASCIIMeshReaderFVM::SplitActuatorDiskSurface() {
699704
points that touch the actuator disk ---*/
700705

701706
mesh_file.open(meshFilename);
707+
FastForwardToMyZone();
708+
702709
while (getline (mesh_file, text_line)) {
703710
position = text_line.find ("NPOIN=",0);
704711
if (position != string::npos) {
@@ -724,6 +731,7 @@ void CSU2ASCIIMeshReaderFVM::SplitActuatorDiskSurface() {
724731
}
725732
}
726733
}
734+
break;
727735
}
728736

729737
/* Lastly, increment the total number of points in order to add the
@@ -921,10 +929,9 @@ void CSU2ASCIIMeshReaderFVM::ReadSurfaceElementConnectivity(const bool single_pa
921929
position = text_line.find( "\n", 0 );
922930
if (position != string::npos) text_line.erase (position,1);
923931
}
924-
markerNames[iMarker] = text_line.c_str();
932+
markerNames[iMarker] = text_line;
925933

926934
bool duplicate = false;
927-
string Marker_Tag_Duplicate;
928935
if ((actuator_disk) &&
929936
(markerNames[iMarker] == config->GetMarker_ActDiskInlet_TagBound(0))) {
930937
duplicate = true;
@@ -972,20 +979,20 @@ void CSU2ASCIIMeshReaderFVM::ReadSurfaceElementConnectivity(const bool single_pa
972979
}
973980

974981
if (duplicate) {
975-
/*--- Increment our counter if we stored a duplicate. ---*/
976-
++iMarker;
977982
for (unsigned short i = 0; i < nPointsElem; i++) {
978983
if (ActDisk_Bool[connectivity[i]]) {
979984
connectivity[i] = ActDiskPoint_Back[connectivity[i]];
980985
}
981986
}
982-
surfaceElementConnectivity[iMarker].push_back(0);
983-
surfaceElementConnectivity[iMarker].push_back(VTK_Type);
987+
surfaceElementConnectivity[iMarker + 1].push_back(0);
988+
surfaceElementConnectivity[iMarker + 1].push_back(VTK_Type);
984989
for (unsigned short i = 0; i < N_POINTS_HEXAHEDRON; i++) {
985-
surfaceElementConnectivity[iMarker].push_back(connectivity[i]);
990+
surfaceElementConnectivity[iMarker + 1].push_back(connectivity[i]);
986991
}
987992
}
988993
}
994+
/*--- Increment the counter an extra time if we stored a duplicate. ---*/
995+
iMarker += duplicate;
989996
}
990997
break;
991998
}

0 commit comments

Comments
 (0)