67 TYPE(t_region
),
POINTER :: pregion
73 CHARACTER :: infotype,stenciltype
74 CHARACTER(CHRLEN) :: rcsidentstring
75 INTEGER :: cellindx,errorflag,faceindx,fndir,fndirend,icellsspecial,icl, &
76 iloc,ipatch,nvertpercell,patchindx,vertindx
79 TYPE(t_grid),
POINTER :: pgrid
80 TYPE(t_patch),
POINTER :: ppatch
86 rcsidentstring =
'$RCSfile: RFLU_PickSpecialCells.F90,v $ $Revision: 1.11 $'
88 global => pregion%global
91 'RFLU_PickSpecialCells.F90')
93 IF ( global%verbLevel > verbose_none )
THEN
94 WRITE(stdout,
'(A,1X,A)') solver_name,
'Picking special cells...'
95 WRITE(stdout,
'(A,3X,A,1X,I5.5)') solver_name,
'Global region:', &
103 pgrid => pregion%grid
106 pgrid%cellsSpecial(1:ncells_special_max) = 0
112 WRITE(stdout,
'(A,5X,A)') solver_name,
'Enter information on special cells:'
113 WRITE(stdout,
'(A,7X,A)') solver_name,
'b - cell adjacent to boundary face'
114 WRITE(stdout,
'(A,7X,A)') solver_name,
'c - single cell'
115 WRITE(stdout,
'(A,7X,A)') solver_name,
'f - cells adjacent to interior face'
116 WRITE(stdout,
'(A,7X,A)') solver_name,
's - stencil members'
117 WRITE(stdout,
'(A,7X,A)') solver_name,
'v - cells meeting at vertex'
118 WRITE(stdout,
'(A,7X,A)') solver_name,
'q - quit'
130 WRITE(stdout,
'(A,3X,A)') solver_name,
'Enter information type:'
131 READ(stdin,
'(A)') infotype
133 SELECT CASE ( infotype )
140 WRITE(stdout,
'(A,5X,A)') solver_name,
'Enter patch index:'
141 READ(stdin,*,iostat=errorflag) patchindx
143 IF ( errorflag /= err_none )
THEN
144 global%warnCounter = global%warnCounter + 1
146 WRITE(stdout,
'(A,5X,A)') solver_name,
'*** WARNING *** Invalid input.'
150 IF ( patchindx > 0 .AND. patchindx <= pgrid%nPatches )
THEN
151 ppatch => pregion%patches(patchindx)
153 WRITE(stdout,
'(A,5X,A)') solver_name,
'Enter face index:'
154 READ(stdin,*,iostat=errorflag) faceindx
156 IF ( errorflag /= err_none )
THEN
157 global%warnCounter = global%warnCounter + 1
159 WRITE(stdout,
'(A,5X,A)') solver_name, &
160 '*** WARNING *** Invalid input.'
164 IF ( faceindx > 0 .AND. faceindx <= ppatch%nBFacesTot )
THEN
165 IF ( icellsspecial == ncells_special_max )
THEN
166 CALL
errorstop(global,err_ncells_special_max,__line__)
169 icellsspecial = icellsspecial + 1
170 pgrid%cellsSpecial(icellsspecial) = ppatch%bf2c(faceindx)
172 WRITE(stdout,
'(A,5X,A,1X,I8)') solver_name,
'Added cell:', &
173 ppatch%bf2c(faceindx)
175 global%warnCounter = global%warnCounter + 1
177 WRITE(stdout,
'(A,5X,A)') solver_name, &
178 '*** WARNING *** Invalid input.'
182 global%warnCounter = global%warnCounter + 1
184 WRITE(stdout,
'(A,5X,A)') solver_name,
'*** WARNING *** Invalid input.'
193 WRITE(stdout,
'(A,5X,A)') solver_name,
'Enter cell index:'
194 READ(stdin,*,iostat=errorflag) cellindx
196 IF ( errorflag /= err_none )
THEN
197 global%warnCounter = global%warnCounter + 1
199 WRITE(stdout,
'(A,5X,A)') solver_name,
'*** WARNING *** Invalid input.'
203 IF ( cellindx > 0 .AND. cellindx <= pgrid%nCellsTot )
THEN
204 IF ( icellsspecial == ncells_special_max )
THEN
205 CALL
errorstop(global,err_ncells_special_max,__line__)
208 icellsspecial = icellsspecial + 1
209 pgrid%cellsSpecial(icellsspecial) = cellindx
211 global%warnCounter = global%warnCounter + 1
213 WRITE(stdout,
'(A,5X,A)') solver_name,
'*** WARNING *** Invalid input.'
222 WRITE(stdout,
'(A,5X,A)') solver_name,
'Enter interior face index:'
223 READ(stdin,*,iostat=errorflag) faceindx
225 IF ( errorflag /= err_none )
THEN
226 global%warnCounter = global%warnCounter + 1
228 WRITE(stdout,
'(A,5X,A)') solver_name,
'*** WARNING *** Invalid input.'
232 IF ( faceindx > 0 .AND. faceindx <= pgrid%nFacesTot )
THEN
233 IF ( icellsspecial == ncells_special_max-1 )
THEN
234 CALL
errorstop(global,err_ncells_special_max,__line__)
237 icellsspecial = icellsspecial + 1
238 pgrid%cellsSpecial(icellsspecial) = pgrid%f2c(1,faceindx)
240 icellsspecial = icellsspecial + 1
241 pgrid%cellsSpecial(icellsspecial) = pgrid%f2c(2,faceindx)
243 WRITE(stdout,
'(A,5X,A,1X,I8,1X,A,1X,I8)') solver_name, &
244 'Added cells:',pgrid%f2c(1,faceindx),
'and', &
245 pgrid%f2c(2,faceindx)
247 global%warnCounter = global%warnCounter + 1
249 WRITE(stdout,
'(A,5X,A)') solver_name,
'*** WARNING *** Invalid input.'
258 WRITE(stdout,
'(A,7X,A)') solver_name,
'Enter type of stencil:'
259 WRITE(stdout,
'(A,9X,A)') solver_name,
'b - boundary-face stencil'
260 WRITE(stdout,
'(A,9X,A)') solver_name,
'c - cell stencil'
261 WRITE(stdout,
'(A,9X,A)') solver_name,
'f - face stencil'
262 WRITE(stdout,
'(A,9X,A)') solver_name,
'v - vertex stencil'
263 READ(stdin,
'(A)') stenciltype
265 SELECT CASE ( stenciltype )
270 WRITE(stdout,
'(A,7X,A)') solver_name,
'Enter patch index:'
271 READ(stdin,*,iostat=errorflag) ipatch
273 IF ( ipatch < 1 .OR. ipatch > pgrid%nPatches )
THEN
274 global%warnCounter = global%warnCounter + 1
276 WRITE(stdout,
'(A,5X,A)') solver_name, &
277 '*** WARNING *** Invalid input.'
281 ppatch => pregion%patches(ipatch)
283 WRITE(stdout,
'(A,7X,A)') solver_name,
'Enter face index:'
284 READ(stdin,*,iostat=errorflag) faceindx
286 IF ( faceindx > 0 .AND. faceindx <= ppatch%nBFaces )
THEN
287 WRITE(stdout,
'(A,9X,A,1X,I3)') solver_name, &
288 'Number of stencil members:',ppatch%bf2cs(faceindx)%nCellMembs
290 DO icl = 1,ppatch%bf2cs(faceindx)%nCellMembs
291 icellsspecial = icellsspecial + 1
293 IF ( icellsspecial == ncells_special_max )
THEN
294 CALL
errorstop(global,err_ncells_special_max,__line__)
297 pgrid%cellsSpecial(icellsspecial) = &
298 ppatch%bf2cs(faceindx)%cellMembs(icl)
301 global%warnCounter = global%warnCounter + 1
303 WRITE(stdout,
'(A,5X,A)') solver_name, &
304 '*** WARNING *** Invalid input.'
311 SELECT CASE ( pregion%mixtInput%stencilDimensCells )
313 IF (
ASSOCIATED(pgrid%c2cs1D) .EQV. .false. )
THEN
314 global%warnCounter = global%warnCounter + 1
316 WRITE(stdout,
'(A,7X,A)') solver_name, &
317 '*** WARNING *** Stencil not built.'
321 SELECT CASE ( pregion%mixtInput%dimens )
329 CALL
errorstop(global,err_reached_default,__line__)
332 WRITE(stdout,
'(A,7X,A)') solver_name,
'Enter cell index:'
333 READ(stdin,*,iostat=errorflag) cellindx
335 WRITE(stdout,
'(A,7X,A)') solver_name,
'Enter direction:'
336 READ(stdin,*,iostat=errorflag) fndir
338 IF ( fndir < 1 .OR. fndir > fndirend )
THEN
339 global%warnCounter = global%warnCounter + 1
341 WRITE(stdout,
'(A,5X,A)') solver_name, &
342 '*** WARNING *** Invalid input.'
346 IF ( cellindx > 0 .AND. cellindx <= pgrid%nCellsTot )
THEN
347 IF ( icellsspecial == ncells_special_max )
THEN
348 CALL
errorstop(global,err_ncells_special_max,__line__)
351 icellsspecial = icellsspecial + 1
352 pgrid%cellsSpecial(icellsspecial) = cellindx
354 WRITE(stdout,
'(A,9X,A,1X,I3)') solver_name, &
355 'Number of stencil members:', &
356 pgrid%c2cs1D(fndir,cellindx)%nCellMembs
358 DO icl = 1,pgrid%c2cs1D(fndir,cellindx)%nCellMembs
359 icellsspecial = icellsspecial + 1
361 IF ( icellsspecial == ncells_special_max )
THEN
362 CALL
errorstop(global,err_ncells_special_max,__line__)
365 pgrid%cellsSpecial(icellsspecial) = &
366 pgrid%c2cs1D(fndir,cellindx)%cellMembs(icl)
369 global%warnCounter = global%warnCounter + 1
371 WRITE(stdout,
'(A,5X,A)') solver_name, &
372 '*** WARNING *** Invalid input.'
376 IF (
ASSOCIATED(pgrid%c2cs) .EQV. .false. )
THEN
377 global%warnCounter = global%warnCounter + 1
379 WRITE(stdout,
'(A,7X,A)') solver_name, &
380 '*** WARNING *** Stencil not built.'
384 WRITE(stdout,
'(A,7X,A)') solver_name,
'Enter cell index:'
385 READ(stdin,*,iostat=errorflag) cellindx
387 IF ( cellindx > 0 .AND. cellindx <= pgrid%nCellsTot )
THEN
388 IF ( icellsspecial == ncells_special_max )
THEN
389 CALL
errorstop(global,err_ncells_special_max,__line__)
392 icellsspecial = icellsspecial + 1
393 pgrid%cellsSpecial(icellsspecial) = cellindx
395 WRITE(stdout,
'(A,9X,A,1X,I3)') solver_name, &
396 'Number of stencil members:',pgrid%c2cs(cellindx)%nCellMembs
398 DO icl = 1,pgrid%c2cs(cellindx)%nCellMembs
399 icellsspecial = icellsspecial + 1
401 IF ( icellsspecial == ncells_special_max )
THEN
402 CALL
errorstop(global,err_ncells_special_max,__line__)
405 pgrid%cellsSpecial(icellsspecial) = &
406 pgrid%c2cs(cellindx)%cellMembs(icl)
409 global%warnCounter = global%warnCounter + 1
411 WRITE(stdout,
'(A,5X,A)') solver_name, &
412 '*** WARNING *** Invalid input.'
416 CALL
errorstop(global,err_reached_default,__line__)
422 IF (
ASSOCIATED(pgrid%f2cs) .EQV. .false. )
THEN
423 global%warnCounter = global%warnCounter + 1
425 WRITE(stdout,
'(A,7X,A)') solver_name, &
426 '*** WARNING *** Stencil not built.'
430 WRITE(stdout,
'(A,7X,A)') solver_name,
'Enter face index:'
431 READ(stdin,*,iostat=errorflag) faceindx
433 IF ( faceindx > 0 .AND. faceindx <= pgrid%nFacesTot )
THEN
434 WRITE(stdout,
'(A,9X,A,1X,I3)') solver_name, &
435 'Number of stencil members:',pgrid%f2cs(faceindx)%nCellMembs
437 DO icl = 1,pgrid%f2cs(faceindx)%nCellMembs
438 icellsspecial = icellsspecial + 1
440 IF ( icellsspecial == ncells_special_max )
THEN
441 CALL
errorstop(global,err_ncells_special_max,__line__)
444 pgrid%cellsSpecial(icellsspecial) = &
445 pgrid%f2cs(faceindx)%cellMembs(icl)
448 global%warnCounter = global%warnCounter + 1
450 WRITE(stdout,
'(A,5X,A)') solver_name, &
451 '*** WARNING *** Invalid input.'
458 IF (
ASSOCIATED(pgrid%v2cs) .EQV. .false. )
THEN
459 global%warnCounter = global%warnCounter + 1
461 WRITE(stdout,
'(A,7X,A)') solver_name, &
462 '*** WARNING *** Stencil not built.'
466 WRITE(stdout,
'(A,7X,A)') solver_name,
'Enter vertex index:'
467 READ(stdin,*,iostat=errorflag) vertindx
469 IF ( vertindx > 0 .AND. vertindx <= pgrid%nVertTot )
THEN
470 WRITE(stdout,
'(A,9X,A,1X,I3)') solver_name, &
471 'Number of stencil members:',pgrid%v2cs(vertindx)%nCellMembs
473 DO icl = 1,pgrid%v2cs(vertindx)%nCellMembs
474 icellsspecial = icellsspecial + 1
476 IF ( icellsspecial == ncells_special_max )
THEN
477 CALL
errorstop(global,err_ncells_special_max,__line__)
480 pgrid%cellsSpecial(icellsspecial) = &
481 pgrid%v2cs(vertindx)%cellMembs(icl)
484 global%warnCounter = global%warnCounter + 1
486 WRITE(stdout,
'(A,5X,A)') solver_name, &
487 '*** WARNING *** Invalid input.'
494 global%warnCounter = global%warnCounter + 1
496 WRITE(stdout,
'(A,5X,A)') solver_name, &
497 '*** WARNING *** Invalid input.'
506 WRITE(stdout,
'(A,5X,A)') solver_name,
'Enter vertex index:'
507 READ(stdin,*,iostat=errorflag) vertindx
509 IF ( errorflag /= err_none )
THEN
510 global%warnCounter = global%warnCounter + 1
512 WRITE(stdout,
'(A,5X,A)') solver_name,
'*** WARNING *** Invalid input.'
516 IF ( vertindx > 0 .AND. vertindx <= pgrid%nVertTot )
THEN
520 IF ( pgrid%nTetsTot > 0 )
THEN
521 WRITE(stdout,
'(A,5X,A)') solver_name,
'Tetrahedra...'
525 DO icl = 1,pgrid%nTetsTot
526 v(1:nvertpercell) = pgrid%tet2v(1:nvertpercell,icl)
531 IF ( iloc /= element_not_found )
THEN
532 IF ( icellsspecial == ncells_special_max )
THEN
533 CALL
errorstop(global,err_ncells_special_max,__line__)
536 icellsspecial = icellsspecial + 1
537 pgrid%cellsSpecial(icellsspecial) = pgrid%tet2CellGlob(icl)
539 WRITE(stdout,
'(A,7X,A,1X,I8)') solver_name,
'Added cell:', &
540 pgrid%tet2CellGlob(icl)
547 IF ( pgrid%nHexsTot > 0 )
THEN
548 WRITE(stdout,
'(A,5X,A)') solver_name,
'Hexahedra...'
552 DO icl = 1,pgrid%nHexsTot
553 v(1:nvertpercell) = pgrid%hex2v(1:nvertpercell,icl)
558 IF ( iloc /= element_not_found )
THEN
559 IF ( icellsspecial == ncells_special_max )
THEN
560 CALL
errorstop(global,err_ncells_special_max,__line__)
563 icellsspecial = icellsspecial + 1
564 pgrid%cellsSpecial(icellsspecial) = pgrid%hex2CellGlob(icl)
566 WRITE(stdout,
'(A,7X,A,1X,I8)') solver_name,
'Added cell:', &
567 pgrid%hex2CellGlob(icl)
574 IF ( pgrid%nPrisTot > 0 )
THEN
575 WRITE(stdout,
'(A,5X,A)') solver_name,
'Prisms...'
579 DO icl = 1,pgrid%nPrisTot
580 v(1:nvertpercell) = pgrid%pri2v(1:nvertpercell,icl)
585 IF ( iloc /= element_not_found )
THEN
586 IF ( icellsspecial == ncells_special_max )
THEN
587 CALL
errorstop(global,err_ncells_special_max,__line__)
590 icellsspecial = icellsspecial + 1
591 pgrid%cellsSpecial(icellsspecial) = pgrid%pri2CellGlob(icl)
593 WRITE(stdout,
'(A,7X,A,1X,I8)') solver_name,
'Added cell:', &
594 pgrid%pri2CellGlob(icl)
601 IF ( pgrid%nPyrsTot > 0 )
THEN
602 WRITE(stdout,
'(A,5X,A)') solver_name,
'Pyramids...'
606 DO icl = 1,pgrid%nPyrsTot
607 v(1:nvertpercell) = pgrid%pyr2v(1:nvertpercell,icl)
612 IF ( iloc /= element_not_found )
THEN
613 IF ( icellsspecial == ncells_special_max )
THEN
614 CALL
errorstop(global,err_ncells_special_max,__line__)
617 icellsspecial = icellsspecial + 1
618 pgrid%cellsSpecial(icellsspecial) = pgrid%pyr2CellGlob(icl)
620 WRITE(stdout,
'(A,7X,A,1X,I8)') solver_name,
'Added cell:', &
621 pgrid%pyr2CellGlob(icl)
627 global%warnCounter = global%warnCounter + 1
629 WRITE(stdout,
'(A,5X,A)') solver_name,
'*** WARNING *** Invalid input.'
645 global%warnCounter = global%warnCounter + 1
647 WRITE(stdout,
'(A,5X,A)') solver_name,
'*** WARNING *** Invalid input.'
656 pgrid%nCellsSpecial = icellsspecial
662 IF ( global%verbLevel > verbose_none )
THEN
663 WRITE(stdout,
'(A,1X,A)') solver_name,
'Picking special cells done.'
subroutine registerfunction(global, funName, fileName)
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_pickspecialcells(pRegion)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine deregisterfunction(global)