Skip to content

Commit 75b26c1

Browse files
committed
Increased max_bounds to 1000 to accommodate meshes with large number of edges
Added bounds check on assigning boundary type to edges when using dmg model
1 parent eaab21d commit 75b26c1

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

unstructured/scorec_mesh.f90

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ module scorec_mesh_mod
4949
integer, parameter :: BOUND_FIRSTWALL = 1
5050
integer, parameter :: BOUND_DOMAIN = 2
5151

52-
integer, parameter :: max_bounds = 200
52+
integer, parameter :: max_bounds = 1000
5353
integer, parameter :: max_zones = 100
5454
integer :: boundary_type(max_bounds)
5555
integer :: zone_type(max_zones)
@@ -223,9 +223,11 @@ subroutine load_mesh
223223

224224
call m3dc1_model_getmodeltype(model_type)
225225

226-
! For *.dmg model (model_type == 1),
226+
! For *.dmg model (model_type == 2),
227227
! find edges associated with first wall and computational domain boundary
228228
if(model_type.eq.2) then
229+
boundary_type(:) = BOUND_UNKNOWN
230+
229231
! Find edges associated with first wall
230232
call m3dc1_model_getgeometricloop(edges, nedges, 0)
231233
if(myrank.eq.0) &
@@ -236,6 +238,11 @@ subroutine load_mesh
236238
call safestop(184)
237239
end if
238240
do i=1, nedges
241+
if(edges(i).gt.max_bounds) then
242+
if(myrank.eq.0) &
243+
print *, 'Firstwall edge greater than max_bounds', edges(i)
244+
call safestop(185)
245+
end if
239246
boundary_type(edges(i)) = BOUND_FIRSTWALL
240247
end do
241248

@@ -246,9 +253,14 @@ subroutine load_mesh
246253
if(nedges.gt.max_bounds) then
247254
if(myrank.eq.0) &
248255
print *, 'Error: nedges > max_bounds for domain boundary'
249-
call safestop(185)
256+
call safestop(186)
250257
end if
251258
do i=1, nedges
259+
if(edges(i).gt.max_bounds) then
260+
if(myrank.eq.0) &
261+
print *, 'Domain edge greater than max_bounds', edges(i)
262+
call safestop(187)
263+
end if
252264
boundary_type(edges(i)) = BOUND_DOMAIN
253265
end do
254266
end if

0 commit comments

Comments
 (0)