81 INTEGER,
INTENT(IN) :: locinfomode,nlocunsorted,outputmode
82 INTEGER,
INTENT(INOUT) :: locunsorted(1:nlocunsorted,min_val:max_val)
83 TYPE(t_region
),
POINTER :: pregion
90 CHARACTER(CHRLEN) :: celltypestring,locstring,rcsidentstring,tempstring
91 INTEGER :: errorflag,il,ib,
ic,iccntr,icflag,icl,ict,
id,ipatch,iv,ivcntr, &
92 ivflag,ivg,jl,nlocsorted,nlocsortedest,nvertsimplified, &
95 INTEGER,
DIMENSION(:),
ALLOCATABLE :: bf2csorted,locsorted,locbound, &
96 vertsorted,vertunsorted
97 TYPE(t_patch),
POINTER :: ppatch
99 TYPE(t_grid),
POINTER :: pgrid
101 rcsidentstring =
'$RCSfile: RFLU_PrintLocInfo.F90,v $ $Revision: 1.18 $'
107 global => pregion%global
110 'RFLU_PrintLocInfo.F90')
112 IF ( outputmode == output_mode_master_only )
THEN
113 outputflag = (global%myProcid == masterproc)
114 ELSE IF ( outputmode == output_mode_anybody )
THEN
117 CALL
errorstop(global,err_reached_default,__line__)
120 IF ( (outputflag .EQV. .true.) .AND. &
121 global%verbLevel >= verbose_high )
THEN
122 WRITE(stdout,
'(A,1X,A)') solver_name,
'Printing location information...'
123 WRITE(stdout,
'(A,3X,A,1X,I5.5)') solver_name,
'Global region:', &
124 pregion%iRegionGlobal
131 pgrid => pregion%grid
137 IF (
ASSOCIATED(pgrid%cofg) .EQV. .false. )
THEN
138 global%warnCounter = global%warnCounter + 1
140 IF ( (outputflag .EQV. .true.) .AND. &
141 global%verbLevel >= verbose_none )
THEN
142 WRITE(stdout,
'(A,3X,A,1X,A,1X,A)') solver_name, &
143 '*** WARNING *** Array cofg not allocated.', &
144 'Returning to calling procedure.'
150 IF ( (minval(pgrid%cofg) == 0.0_rfreal) .AND. &
151 (maxval(pgrid%cofg) == 0.0_rfreal) )
THEN
152 global%warnCounter = global%warnCounter + 1
154 IF ( (outputflag .EQV. .true.) .AND. &
155 global%verbLevel >= verbose_none )
THEN
156 WRITE(stdout,
'(A,3X,A,1X,A,1X,A)') solver_name,
'*** WARNING ***', &
157 'Geometry apparently not computed yet.', &
158 'Returning to calling procedure.'
168 DO ipatch = 1,pgrid%nPatches
169 ppatch => pregion%patches(ipatch)
171 IF (
ASSOCIATED(ppatch%bf2c) .EQV. .false. )
THEN
172 global%warnCounter = global%warnCounter + 1
174 IF ( (outputflag .EQV. .true.) .AND. &
175 global%verbLevel >= verbose_none )
THEN
176 WRITE(stdout,
'(A,3X,A,1X,A)') solver_name, &
177 '*** WARNING *** Array bf2c not allocated.', &
178 'Returning to calling procedure.'
184 IF ( (minval(ppatch%bf2c) == 0) .AND. (maxval(ppatch%bf2c) == 0) )
THEN
185 global%warnCounter = global%warnCounter + 1
187 IF ( (outputflag .EQV. .true.) .AND. &
188 global%verbLevel >= verbose_none )
THEN
189 WRITE(stdout,
'(A,3X,A,1X,A)') solver_name, &
190 '*** WARNING *** Array bf2c apparently not yet filled.', &
191 'Returning to calling procedure.'
205 nlocsortedest = 2*nlocunsorted
207 ALLOCATE(locsorted(nlocsortedest),stat=errorflag)
208 global%error = errorflag
209 IF ( global%error /= err_none )
THEN
210 CALL
errorstop(global,err_allocate,__line__,
'locSorted')
216 locunsorted(1:nlocunsorted,min_val), &
217 locunsorted(1:nlocunsorted,max_val), &
218 nlocsortedest,nlocsorted,locsorted)
220 IF ( (outputflag .EQV. .true.) .AND. &
221 global%verbLevel >= verbose_high )
THEN
222 WRITE(stdout,
'(A,3X,A)') solver_name,
'Cell location information:'
223 WRITE(stdout,
'(A,6X,A,6X,A,3X,A,2(4X,A),3X,A)') solver_name,
'#',
'Cell', &
224 'x-coordinate',
'y-coordinate',
'z-coordinate',
'Location'
231 ALLOCATE(locbound(pgrid%nPatches),stat=errorflag)
232 global%error = errorflag
233 IF ( global%error /= err_none )
THEN
234 CALL
errorstop(global,err_allocate,__line__,
'locBound')
247 DO ipatch = 1,pgrid%nPatches
248 ppatch => pregion%patches(ipatch)
250 IF ( ppatch%nBFaces > 0 )
THEN
251 ALLOCATE(bf2csorted(ppatch%nBFaces),stat=errorflag)
252 global%error = errorflag
253 IF ( global%error /= err_none )
THEN
254 CALL
errorstop(global,err_allocate,__line__,
'bf2cSorted')
257 bf2csorted(1:ppatch%nBFaces) = ppatch%bf2c(1:ppatch%nBFaces)
262 IF ( icflag /= element_not_found )
THEN
264 locbound(iccntr) = ppatch%iPatchGlobal
267 DEALLOCATE(bf2csorted,stat=errorflag)
268 global%error = errorflag
269 IF ( global%error /= err_none )
THEN
270 CALL
errorstop(global,err_deallocate,__line__,
'bf2cSorted')
279 IF ( iccntr == 0 )
THEN
280 WRITE(locstring,
'(A)')
'Interior'
282 IF ( iccntr == 1 )
THEN
283 WRITE(locstring,
'(A,1X,I3)')
'Global patch:',locbound(iccntr)
285 WRITE(locstring,
'(A)')
'Global patches: '
287 WRITE(tempstring,
'(1X,I3)') locbound(jl)
288 locstring = trim(locstring)//trim(tempstring)
293 IF ( (outputflag .EQV. .true.) .AND. &
294 global%verbLevel >= verbose_high )
THEN
295 WRITE(stdout,
'(A,4X,I3,1X,I9,3(1X,E15.8),2X,A)') solver_name,il,
ic, &
296 pgrid%cofg(xcoord:zcoord,
ic),trim(locstring)
304 IF ( locinfomode == locinfo_mode_verbose )
THEN
310 IF ( (outputflag .EQV. .true.) .AND. &
311 global%verbLevel >= verbose_high )
THEN
312 WRITE(stdout,
'(A,3X,A,2(1X,A))') solver_name,
'Cell connectivity', &
314 WRITE(stdout,
'(A,6X,A,6X,A,2X,A,24X,A)') solver_name,
'#',
'Cell', &
318 ALLOCATE(vertunsorted(8*nlocsorted),stat=errorflag)
319 global%error = errorflag
320 IF ( global%error /= err_none )
THEN
321 CALL
errorstop(global,err_allocate,__line__,
'vertUnsorted')
329 ict = pgrid%cellGlob2Loc(1,
ic)
330 icl = pgrid%cellGlob2Loc(2,
ic)
333 CASE ( cell_type_tet )
334 celltypestring =
'Tetrahedron'
336 v(1:vlen) = pgrid%tet2v(1:vlen,icl)
338 IF ( (outputflag .EQV. .true.) .AND. &
339 global%verbLevel >= verbose_high )
THEN
340 WRITE(stdout,
'(A,4X,I3,1X,I9,2X,A11,4(1X,I9))') solver_name,il, &
341 ic,celltypestring,
v(1:vlen)
344 vertunsorted(nvertunsorted+1:nvertunsorted + vlen) =
v(1:vlen)
345 nvertunsorted = nvertunsorted + vlen
346 CASE ( cell_type_hex )
347 celltypestring =
'Hexahedron'
349 v(1:vlen) = pgrid%hex2v(1:vlen,icl)
351 IF ( (outputflag .EQV. .true.) .AND. &
352 global%verbLevel >= verbose_high )
THEN
353 WRITE(stdout,
'(A,4X,I3,1X,I9,2X,A11,8(1X,I9))') solver_name,il, &
354 ic,celltypestring,
v(1:vlen)
357 vertunsorted(nvertunsorted+1:nvertunsorted + vlen) =
v(1:vlen)
358 nvertunsorted = nvertunsorted + vlen
359 CASE ( cell_type_pri )
360 celltypestring =
'Prism'
363 v(1:vlen) = pgrid%pri2v(1:vlen,icl)
365 IF ( (outputflag .EQV. .true.) .AND. &
366 global%verbLevel >= verbose_high )
THEN
367 WRITE(stdout,
'(A,4X,I3,1X,I9,2X,A11,6(1X,I9))') solver_name,il, &
368 ic,celltypestring,
v(1:vlen)
371 vertunsorted(nvertunsorted+1:nvertunsorted + vlen) =
v(1:vlen)
372 nvertunsorted = nvertunsorted + vlen
373 CASE ( cell_type_pyr )
374 celltypestring =
'Pyramid'
377 v(1:vlen) = pgrid%pyr2v(1:vlen,icl)
379 IF ( (outputflag .EQV. .true.) .AND. &
380 global%verbLevel >= verbose_high )
THEN
381 WRITE(stdout,
'(A,4X,I3,1X,I9,2X,A11,5(1X,I9))') solver_name,il, &
382 ic,celltypestring,
v(1:vlen)
385 vertunsorted(nvertunsorted+1:nvertunsorted + vlen) =
v(1:vlen)
386 nvertunsorted = nvertunsorted + vlen
388 CALL
errorstop(global,err_reached_default,__line__)
396 IF ( (outputflag .EQV. .true.) .AND. &
397 global%verbLevel >= verbose_high )
THEN
398 WRITE(stdout,
'(A,3X,A,2(1X,A))') solver_name,
'Vertex location', &
400 WRITE(stdout,
'(A,6X,A,4X,A,3X,A,2(4X,A),3X,A)') solver_name,
'#', &
401 'Vertex',
'x-coordinate',
'y-coordinate',
'z-coordinate',
'Location'
407 DO iv = 1,nvertsimplified
408 ivg = vertunsorted(iv)
416 DO ipatch = 1,pgrid%nPatches
417 ppatch => pregion%patches(ipatch)
419 IF ( ppatch%nBVert > 0 )
THEN
422 ivflag = element_not_found
425 IF ( ivflag /= element_not_found )
THEN
427 locbound(ivcntr) = ipatch
435 IF ( ivcntr == 0 )
THEN
436 WRITE(locstring,
'(A)')
'Interior'
438 IF ( ivcntr == 1 )
THEN
439 WRITE(locstring,
'(A,1X,I3)')
'Boundary:',locbound(ivcntr)
441 WRITE(locstring,
'(A)')
'Boundaries: '
443 WRITE(tempstring,
'(1X,I3)') locbound(jl)
444 locstring = trim(locstring)//trim(tempstring)
449 IF ( (outputflag .EQV. .true.) .AND. &
450 global%verbLevel >= verbose_high )
THEN
451 WRITE(stdout,
'(A,4X,I3,1X,I9,3(1X,E15.8),2X,A)') solver_name,iv, &
452 ivg,pgrid%xyz(xcoord:zcoord,ivg),trim(locstring)
456 DEALLOCATE(vertunsorted,stat=errorflag)
457 global%error = errorflag
458 IF ( global%error /= err_none )
THEN
459 CALL
errorstop(global,err_deallocate,__line__,
'vertUnsorted')
463 DEALLOCATE(locbound,stat=errorflag)
464 global%error = errorflag
465 IF ( global%error /= err_none )
THEN
466 CALL
errorstop(global,err_deallocate,__line__,
'locBound')
469 DEALLOCATE(locsorted,stat=errorflag)
470 global%error = errorflag
471 IF ( global%error /= err_none )
THEN
472 CALL
errorstop(global,err_deallocate,__line__,
'locSorted')
481 IF ( (outputflag .EQV. .true.) .AND. &
482 global%verbLevel >= verbose_high )
THEN
483 WRITE(stdout,
'(A,1X,A)') solver_name,
'Printing location information done.'
subroutine registerfunction(global, funName, fileName)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE ic
subroutine simplifysortedintegers(a, na, nb)
subroutine quicksortinteger(a, n)
subroutine binarysearchinteger(a, n, v, i, j)
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
subroutine rflu_printlocinfo(pRegion, locUnsorted, nLocUnsorted, locInfoMode, outputMode)
unsigned long id(const Leda_like_handle &x)
subroutine mergesortedintegers(global, na, nb, a, b, nm, im, m)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine deregisterfunction(global)