Skip to content

Commit e2cd123

Browse files
committed
Fix bug in the HOM CGNS reader
1 parent 8a591aa commit e2cd123

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

Common/src/geometry/meshreader/CCGNSMeshReaderBase.cpp

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,27 @@ void CCGNSMeshReaderBase::ReadCGNSSectionMetadata() {
320320
/* Check for 1D elements in 2D problems, or for 2D elements in
321321
3D problems. If found, mark the section as a boundary section. */
322322

323-
if ((dimension == 2) && (elemType == BAR_2 || elemType == BAR_3)) isInterior[s] = false;
324-
if ((dimension == 3) && (elemType == TRI_3 || elemType == QUAD_4)) isInterior[s] = false;
323+
if(dimension == 2) {
324+
switch( elemType ) {
325+
case BAR_2: case BAR_3: case BAR_4: case BAR_5:
326+
isInterior[s] = false;
327+
break;
328+
default: // To avoid a compiler warning.
329+
break;
330+
}
331+
}
332+
else {
333+
switch( elemType ) {
334+
case TRI_3: case TRI_6: case TRI_9: case TRI_10:
335+
case TRI_12: case TRI_15:
336+
case QUAD_4: case QUAD_8: case QUAD_9: case QUAD_12:
337+
case QUAD_16: case QUAD_P4_16: case QUAD_25:
338+
isInterior[s] = false;
339+
break;
340+
default: // To avoid a compiler warning.
341+
break;
342+
}
343+
}
325344

326345
/*--- Increment the global element offset for each section
327346
based on whether or not this is a surface or volume section.

Common/src/geometry/meshreader/CCGNSMeshReaderFEM.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ CCGNSMeshReaderFEM::CCGNSMeshReaderFEM(const CConfig* val_config, unsigned short
3939
ReadCGNSDatabaseMetadata();
4040
ReadCGNSZoneMetadata();
4141

42+
/*--- Read the basic information about the sections. ---*/
43+
ReadCGNSSectionMetadata();
44+
4245
/*--- Read the volume connectivity and distribute it
4346
linearly over the MPI ranks. ---*/
4447
ReadCGNSVolumeElementConnectivity();

0 commit comments

Comments
 (0)