Skip to content

Commit

Permalink
FDS Source: Issue #12372. Avoid seg fault even if only one PERIODIC b…
Browse files Browse the repository at this point in the history
…oundary specified
  • Loading branch information
mcgratta committed Feb 8, 2024
1 parent a9c599c commit 824c357
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions Source/main.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1962,11 +1962,11 @@ SUBROUTINE INITIALIZE_MESH_EXCHANGE_1(NM)

ENDIF

! For PERIODIC boundaries with 1 or 2 meshes, we must revert to allocating whole copies of OMESH
! For a single mesh with PERIODIC boundaries, allocate the entire OMESH array

IF (IMIN>IMAX) THEN; IMIN=0; IMAX=M2%IBP1; ENDIF
IF (JMIN>JMAX) THEN; JMIN=0; JMAX=M2%JBP1; ENDIF
IF (KMIN>KMAX) THEN; KMIN=0; KMAX=M2%KBP1; ENDIF
IF (IMIN>IMAX .OR. NM==NOM) THEN ; IMIN=0 ; IMAX=M2%IBP1 ; ENDIF
IF (JMIN>JMAX .OR. NM==NOM) THEN ; JMIN=0 ; JMAX=M2%JBP1 ; ENDIF
IF (KMIN>KMAX .OR. NM==NOM) THEN ; KMIN=0 ; KMAX=M2%KBP1 ; ENDIF

! Embedded meshes. This is the case where mesh NOM is completely inside mesh NM. Mesh NM cannot "see" mesh NOM because mesh NOM
! is not connected at the external boundary of mesh NM. The variable CONNECTED_MESH is needed to save this information.
Expand Down
12 changes: 6 additions & 6 deletions Source/read.f90
Original file line number Diff line number Diff line change
Expand Up @@ -11085,7 +11085,7 @@ SUBROUTINE READ_VENT

IF (PBX>-1.E5_EB .OR. PBY>-1.E5_EB .OR. PBZ>-1.E5_EB) THEN
IF (MULT_ID/='null') THEN
WRITE(MESSAGE,'(A,I0,A)') 'ERROR: MULT_ID cannot be applied to VENT',N_EXPLICIT,' because it uses PBX, PBY or PBZ.'
WRITE(MESSAGE,'(A,I0,A)') 'ERROR: MULT_ID cannot be applied to VENT ',N_EXPLICIT,' because it uses PBX, PBY or PBZ.'
CALL SHUTDOWN(MESSAGE,PROCESS_0_ONLY=.FALSE.) ; RETURN
ENDIF
XB = (/XS,XF,YS,YF,ZS,ZF/)
Expand All @@ -11094,11 +11094,11 @@ SUBROUTINE READ_VENT
IF (PBZ>-1.E5_EB) XB(5:6) = PBZ
ELSEIF (MB/='null') THEN
IF (NMESHES>1 .AND. SURF_ID=='PERIODIC') THEN
WRITE(MESSAGE,'(A,I0,A)') 'ERROR: Use PBX,PBY,PBZ or XB for VENT',N_EXPLICIT,' multi-mesh PERIODIC boundary'
WRITE(MESSAGE,'(A,I0,A)') 'ERROR: Use PBX,PBY,PBZ or XB for VENT ',N_EXPLICIT,' multi-mesh PERIODIC boundary'
CALL SHUTDOWN(MESSAGE,PROCESS_0_ONLY=.FALSE.) ; RETURN
ENDIF
IF (MULT_ID/='null') THEN
WRITE(MESSAGE,'(A,I0,A)') 'ERROR: MULT_ID cannot be applied to VENT',N_EXPLICIT,' because it uses MB.'
WRITE(MESSAGE,'(A,I0,A)') 'ERROR: MULT_ID cannot be applied to VENT ',N_EXPLICIT,' because it uses MB.'
CALL SHUTDOWN(MESSAGE,PROCESS_0_ONLY=.FALSE.) ; RETURN
ENDIF
XB = (/XS,XF,YS,YF,ZS,ZF/)
Expand All @@ -11110,12 +11110,12 @@ SUBROUTINE READ_VENT
CASE('ZMIN') ; XB(6) = ZS
CASE('ZMAX') ; XB(5) = ZF
CASE DEFAULT
WRITE(MESSAGE,'(A,I0,A)') 'ERROR: MB specified for VENT',N_EXPLICIT,' is not XMIN, XMAX, YMIN, YMAX, ZMIN, or ZMAX'
WRITE(MESSAGE,'(A,I0,A)') 'ERROR: MB specified for VENT ',N_EXPLICIT,' is not XMIN, XMAX, YMIN, YMAX, ZMIN, or ZMAX'
CALL SHUTDOWN(MESSAGE,PROCESS_0_ONLY=.FALSE.) ; RETURN
END SELECT
ELSEIF (DB/='null') THEN
IF (MULT_ID/='null') THEN
WRITE(MESSAGE,'(A,I0,A)') 'ERROR: MULT_ID cannot be applied to VENT',N_EXPLICIT,' because it uses DB.'
WRITE(MESSAGE,'(A,I0,A)') 'ERROR: MULT_ID cannot be applied to VENT ',N_EXPLICIT,' because it uses DB.'
CALL SHUTDOWN(MESSAGE,PROCESS_0_ONLY=.FALSE.) ; RETURN
ENDIF
XB = (/XS,XF,YS,YF,ZS,ZF/)
Expand All @@ -11127,7 +11127,7 @@ SUBROUTINE READ_VENT
CASE('ZMIN') ; XB(5:6) = ZS_MIN+TWO_EPSILON_EB
CASE('ZMAX') ; XB(5:6) = ZF_MAX-TWO_EPSILON_EB
CASE DEFAULT
WRITE(MESSAGE,'(A,I0,A)') 'ERROR: DB specified for VENT',N_EXPLICIT,' is not XMIN, XMAX, YMIN, YMAX, ZMIN, or ZMAX'
WRITE(MESSAGE,'(A,I0,A)') 'ERROR: DB specified for VENT ',N_EXPLICIT,' is not XMIN, XMAX, YMIN, YMAX, ZMIN, or ZMAX'
CALL SHUTDOWN(MESSAGE,PROCESS_0_ONLY=.FALSE.) ; RETURN
END SELECT
ENDIF
Expand Down

0 comments on commit 824c357

Please sign in to comment.