@@ -43,6 +43,8 @@ subroutine setup(fileName, fileType)
43
43
integer (kind= intType) :: i, j, k, ii, jj, iii, jjj, ierr, iStart, iEnd
44
44
integer (kind= intType) :: isize, ind, icell, idim, BCToSet, il, jl, iEdge, iBCToSet
45
45
logical :: found
46
+ logical :: bcTopoError
47
+ logical :: bcError
46
48
character (5 ) :: faceStr
47
49
integer (kind= intType), dimension (:), pointer :: lPtr1, lPtr2
48
50
real (kind= realType), dimension (:, :), pointer :: xPtr, xPtrRowInward
@@ -591,6 +593,11 @@ subroutine setup(fileName, fileType)
591
593
end do patchLoop0
592
594
593
595
nAverage = 0
596
+
597
+ ! error flag for issues with BCs or topology
598
+ bcError = .False.
599
+ bcTopoError = .False.
600
+
594
601
patchLoop: do ii = 1 , nPatch
595
602
il = patches(ii)% il
596
603
jl = patches(ii)% jl
@@ -631,10 +638,11 @@ subroutine setup(fileName, fileType)
631
638
! it means someone explictly specifid it which is an
632
639
! error since this isn't *actually* a boundary condition
633
640
if (BCs(iEdge, ii) /= BCDefault) then
641
+ bcError = .True.
642
+
634
643
101 format (a, a, a, I3, a)
635
644
print 101 , ' ERROR: A boundary condition was specifed for ' , &
636
645
trim (faceStr), ' patch on Block' , ii, ' but it is not a physical boundary.'
637
- stop
638
646
end if
639
647
640
648
else if (fullTopoType(iNode) == topoEdge) then
@@ -689,7 +697,7 @@ subroutine setup(fileName, fileType)
689
697
! Do a sanity check: This should only occur if i==1 or i==iSize
690
698
if (i /= 1 .and. i /= iSize) then
691
699
print * , ' ERROR: Unknown corner topology error detected.' , i, isize
692
- stop
700
+ bcTopoError = .True.
693
701
end if
694
702
695
703
! By definition , corner topology nodes must have 2 neighbours
@@ -799,6 +807,13 @@ subroutine setup(fileName, fileType)
799
807
end do
800
808
end do patchLoop
801
809
810
+ ! if there was an error in the BC setup stop
811
+ if (bcError) then
812
+ print * , ' ERROR: pyHyp exited due to one or more issues with mesh boundary conditions. &
813
+ &See above error printouts.'
814
+ stop
815
+ end if
816
+
802
817
do i = 1 , nUnique
803
818
! Special loop for the LCorners
804
819
if (fullTopoType(i) == topoLCorner) then
@@ -895,8 +910,8 @@ subroutine setup(fileName, fileType)
895
910
! fullnPtr populated.
896
911
do i = 1 , nUnique
897
912
if (fullNPtr(1 , i) == 0 ) then
898
- print * , ' There was a general error with topology computation for node:' , uniquePts(:, i)
899
- stop
913
+ print * , ' ERROR: There was a general error with topology computation for node:' , uniquePts(:, i)
914
+ bcTopoError = .True.
900
915
end if
901
916
end do
902
917
@@ -905,17 +920,21 @@ subroutine setup(fileName, fileType)
905
920
! their fullnPtr populated.
906
921
do i = 1 , nUnique
907
922
if (fullTopoType(i) == topoEdge .and. fullBCType(1 , i) == BCDefault) then
908
- print * , ' There was a missing boundary condition for edge node:' , uniquePts(:, i)
909
- stop
910
-
923
+ print * , ' ERROR: There was a missing boundary condition for edge node:' , uniquePts(:, i)
924
+ bcTopoError = .True.
911
925
else if (fullTopoType(i) == topoCorner .and. (fullBCType(1 , i) == BCDefault .or. &
912
926
fullBCType(2 , i) == BCDefault)) then
913
- print * , ' There was a missing boundary condition for corner node:' , uniquePts(:, i)
914
- stop
927
+ print * , ' ERROR: There was a missing boundary condition for corner node:' , uniquePts(:, i)
928
+ bcTopoError = .True.
915
929
end if
916
-
917
930
end do
918
931
932
+ ! if we ran into topology or BC errors, stop
933
+ if (bcTopoError) then
934
+ print * , ' ERROR: pyHyp exited due to one or more issues with mesh topology. See above error printouts.'
935
+ stop
936
+ end if
937
+
919
938
! Free up some more memory
920
939
deallocate (nte, ntePtr, directedNodeConn, nodeConn, nEdge, nDirectedEdge)
921
940
0 commit comments