Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mesh check error printout #81

Merged
merged 18 commits into from
Aug 20, 2024
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 27 additions & 7 deletions src/3D/setup3d.F90
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,17 @@ subroutine setup(fileName, fileType)
integer(kind=intType) :: i, j, k, ii, jj, iii, jjj, ierr, iStart, iEnd
integer(kind=intType) :: isize, ind, icell, idim, BCToSet, il, jl, iEdge, iBCToSet
logical :: found
logical :: bcTopoError
logical :: bcError
character(5) :: faceStr
integer(kind=intType), dimension(:), pointer :: lPtr1, lPtr2
real(kind=realType), dimension(:, :), pointer :: xPtr, xPtrRowInward
real(kind=realType) :: xSum(3), vals(2, 3)
integer(kind=intType) :: mask(2, 3), nn(2), mm(2), f(3), iFace, jp2

! error flag for issues with BCs or topology
bcTopoError = .False.
hajdik marked this conversation as resolved.
Show resolved Hide resolved

! Only the root processor reads the mesh and does the initial processing:
rootProc: if (myid == 0) then

Expand Down Expand Up @@ -591,6 +596,9 @@ subroutine setup(fileName, fileType)
end do patchLoop0

nAverage = 0
bcError = .False.
bcTopoError = .False.

patchLoop: do ii = 1, nPatch
il = patches(ii)%il
jl = patches(ii)%jl
Expand Down Expand Up @@ -631,10 +639,11 @@ subroutine setup(fileName, fileType)
! it means someone explictly specifid it which is an
! error since this isn't *actually* a boundary condition
if (BCs(iEdge, ii) /= BCDefault) then
bcError = .True.

101 format(a, a, a, I3, a)
print 101, 'ERROR: A boundary condition was specifed for ', &
trim(faceStr), ' patch on Block', ii, ' but it is not a physical boundary.'
stop
end if

else if (fullTopoType(iNode) == topoEdge) then
Expand Down Expand Up @@ -689,7 +698,7 @@ subroutine setup(fileName, fileType)
! Do a sanity check: This should only occur if i==1 or i==iSize
if (i /= 1 .and. i /= iSize) then
print *, 'ERROR: Unknown corner topology error detected.', i, isize
stop
bcTopoError = .True.
end if

! By definition , corner topology nodes must have 2 neighbours
Expand Down Expand Up @@ -721,6 +730,11 @@ subroutine setup(fileName, fileType)
end do edgeNodeLoop
end do edgeLoop

! if there was an error in the BC setup stop
if (bcError) then
stop
end if
hajdik marked this conversation as resolved.
Show resolved Hide resolved

! We now do a special check to see if corners have boundary
! conditions that would require the averaging procedure. This
! will happen if the two neighbour nodes are constrained to
Expand Down Expand Up @@ -891,12 +905,13 @@ subroutine setup(fileName, fileType)
print *, 'Corner averaging activated for ', nAverage, ' nodes.'
end if


! Do a sanity check to make sure that all nodes have their
! fullnPtr populated.
do i = 1, nUnique
if (fullNPtr(1, i) == 0) then
print *, 'There was a general error with topology computation for node:', uniquePts(:, i)
stop
bcTopoError = .True.
end if
end do

Expand All @@ -906,16 +921,21 @@ subroutine setup(fileName, fileType)
do i = 1, nUnique
if (fullTopoType(i) == topoEdge .and. fullBCType(1, i) == BCDefault) then
print *, 'There was a missing boundary condition for edge node:', uniquePts(:, i)
eirikurj marked this conversation as resolved.
Show resolved Hide resolved
stop

bcTopoError = .True.
else if (fullTopoType(i) == topoCorner .and. (fullBCType(1, i) == BCDefault .or. &
fullBCType(2, i) == BCDefault)) then
print *, 'There was a missing boundary condition for corner node:', uniquePts(:, i)
stop
bcTopoError = .True.
end if

end do

! if we ran into topology or BC errors, stop
if (bcTopoError) then
print *, 'pyHyp exited. See above errors.'
eirikurj marked this conversation as resolved.
Show resolved Hide resolved
stop
end if
eirikurj marked this conversation as resolved.
Show resolved Hide resolved

! Free up some more memory
deallocate (nte, ntePtr, directedNodeConn, nodeConn, nEdge, nDirectedEdge)

Expand Down
Loading