62 CHARACTER(CHRLEN) :: &
63 RCSIdentString =
'$RCSfile: RFLU_ModPartitionRegionUtils.F90,v $ $Revision: 1.8 $'
98 ncellsvirtmax,ncellsvirt)
110 INTEGER,
INTENT(IN) :: ncellsvirtmax
111 INTEGER,
INTENT(OUT) :: ncellsvirt
112 INTEGER,
INTENT(INOUT) :: vc(ncellsvirtmax)
113 TYPE(t_region
),
POINTER :: pregion,pregionserial
119 INTEGER :: c1,c2,errorflag,icg,icl,ifg,ifl,iflbeg,iflend,iloc
120 TYPE(t_grid),
POINTER :: pgrid,pgridserial
127 global => pregionserial%global
130 'RFLU_ModPartitionRegionUtils.F90')
132 IF ( global%verbLevel > verbose_none )
THEN
133 WRITE(stdout,
'(A,1X,A)') solver_name, &
134 'Adding virtual cells for inviscid first-order stencil...'
141 pgrid => pregion%grid
142 pgridserial => pregionserial%grid
146 iflbeg = pgridserial%avfCSRInfo(pregion%iRegionGlobal)
148 IF ( pregion%iRegionGlobal /= global%nRegionsLocal )
THEN
149 iflend = pgridserial%avfCSRInfo(pregion%iRegionGlobal+1)-1
151 iflend = 2*pgridserial%nFacesCut
158 DO ifl = iflbeg,iflend
159 ifg = pgridserial%avfCSR(ifl)
162 icg = pgridserial%f2c(icl,ifg)
164 IF ( pgridserial%sc2r(icg) /= pregion%iRegionGlobal )
THEN
165 IF ( ncellsvirt > 0 )
THEN
168 iloc = element_not_found
171 IF ( iloc == element_not_found )
THEN
172 ncellsvirt = ncellsvirt + 1
174 IF ( ncellsvirt <= ncellsvirtmax )
THEN
177 CALL
errorstop(global,err_exceed_dimens,__line__,
'vc')
180 IF ( ncellsvirt > 1 )
THEN
192 IF ( global%myProcid == masterproc .AND. &
193 global%verbLevel > verbose_none )
THEN
194 WRITE(stdout,
'(A,1X,A)') solver_name, &
195 'Adding virtual cells for inviscid first-order stencil done.'
238 ncellsvirtmax,ncellsvirt)
254 INTEGER,
INTENT(IN) :: ncellsvirtmax
255 INTEGER,
INTENT(OUT) :: ncellsvirt
256 INTEGER,
INTENT(INOUT) :: vc(ncellsvirtmax)
257 TYPE(t_region
),
POINTER :: pregion,pregionserial
263 INTEGER,
PARAMETER :: loop_counter_limit = 5
264 INTEGER :: errorflag,
i,icg,icg2,idimens,
idir,iflbeg,iflend,ilayer,iloc,
j, &
265 loopcounter,nlayers,
nvert,nvertest,scdim,vcnewdim,vcnewdimmax, &
267 INTEGER,
DIMENSION(:),
ALLOCATABLE :: avv,sc,vcnew,vcold
268 TYPE(t_grid),
POINTER :: pgrid,pgridserial
275 global => pregionserial%global
278 'RFLU_ModPartitionRegionUtils.F90')
280 IF ( global%myProcid == masterproc .AND. &
281 global%verbLevel > verbose_none )
THEN
282 WRITE(stdout,
'(A,1X,A)') solver_name, &
283 'Adding virtual cells for inviscid higher-order stencil...'
290 pgrid => pregion%grid
291 pgridserial => pregionserial%grid
305 iflbeg = pgridserial%avfCSRInfo(pregion%iRegionGlobal)
307 IF ( pregion%iRegionGlobal /= global%nRegionsLocal )
THEN
308 iflend = pgridserial%avfCSRInfo(pregion%iRegionGlobal+1)-1
310 iflend = 2*pgridserial%nFacesCut
313 nvertest = 2*(iflend - iflbeg + 1)
315 IF ( nvertest < 100 )
THEN
316 nvertest = 100 + 4*nvertest
317 ELSE IF ( nvertest < 1000 )
THEN
318 nvertest = 2*nvertest
328 loopcounter = loopcounter + 1
330 ALLOCATE(avv(nvertest),stat=errorflag)
331 global%error = errorflag
332 IF ( global%error /= err_none )
THEN
333 CALL
errorstop(global,err_allocate,__line__,
'avv')
337 pgridserial%avfCSR(iflbeg:iflend), &
338 iflend-iflbeg+1,avv,nvertest,
nvert,errorflag)
340 IF ( errorflag /= err_none )
THEN
341 IF ( loopcounter <= loop_counter_limit )
THEN
342 DEALLOCATE(avv,stat=errorflag)
343 global%error = errorflag
344 IF ( global%error /= err_none )
THEN
345 CALL
errorstop(global,err_allocate,__line__,
'avv')
348 nvertest = 2*nvertest
350 global%warnCounter = global%warnCounter + 1
352 IF ( global%myProcid == masterproc .AND. &
353 global%verbLevel > verbose_low )
THEN
354 WRITE(stdout,
'(A,3X,A,1X,I2,1X,A)') solver_name, &
355 '*** WARNING *** Attempt ',loopcounter, &
356 'to build vertex list failed because array too small.'
357 WRITE(stdout,
'(A,19X,A,1X,I7)') solver_name, &
358 'Attempting again with array size:',nvertest
361 CALL
errorstop(global,err_allocate_adaptive,__line__)
375 ALLOCATE(sc(ncellsvirtmax),stat=errorflag)
376 global%error = errorflag
377 IF ( global%error /= err_none )
THEN
378 CALL
errorstop(global,err_allocate,__line__,
'sc')
384 pregion%iRegionGlobal,sc,ncellsvirtmax, &
387 DEALLOCATE(avv,stat=errorflag)
388 global%error = errorflag
389 IF ( global%error /= err_none )
THEN
390 CALL
errorstop(global,err_deallocate,__line__,
'avv')
399 pregionserial%mixtInput%spaceOrder-1)
407 SELECT CASE ( pregionserial%mixtInput%stencilDimensCells )
409 DO idimens = 1,pregionserial%mixtInput%dimens
410 idir = xcoord - 1 + idimens
412 DO j = 1,pgridserial%c2cs1D(
idir,icg)%nCellMembs
413 icg2 = pgridserial%c2cs1D(
idir,icg)%cellMembs(
j)
415 IF ( pgridserial%sc2r(icg2) /= pregion%iRegionGlobal )
THEN
416 IF ( ncellsvirt > 0 )
THEN
419 iloc = element_not_found
422 IF ( iloc == element_not_found )
THEN
423 ncellsvirt = ncellsvirt + 1
425 vc(ncellsvirt) = icg2
427 IF ( ncellsvirt > 1 )
THEN
435 DO j = 1,pgridserial%c2cs(icg)%nCellMembs
436 icg2 = pgridserial%c2cs(icg)%cellMembs(
j)
438 IF ( pgridserial%sc2r(icg2) /= pregion%iRegionGlobal )
THEN
439 IF ( ncellsvirt > 0 )
THEN
442 iloc = element_not_found
445 IF ( iloc == element_not_found )
THEN
446 ncellsvirt = ncellsvirt + 1
448 vc(ncellsvirt) = icg2
450 IF ( ncellsvirt > 1 )
THEN
457 CALL
errorstop(global,err_reached_default,__line__)
461 DEALLOCATE(sc,stat=errorflag)
462 global%error = errorflag
463 IF ( global%error /= err_none )
THEN
464 CALL
errorstop(global,err_deallocate,__line__,
'sc')
476 vcolddim = ncellsvirt
477 vcnewdimmax = ncellsvirtmax
479 ALLOCATE(vcold(vcolddim),stat=errorflag)
480 global%error = errorflag
481 IF ( global%error /= err_none )
THEN
482 CALL
errorstop(global,err_allocate,__line__,
'vcOld')
489 ALLOCATE(vcnew(vcnewdimmax),stat=errorflag)
490 global%error = errorflag
491 IF ( global%error /= err_none )
THEN
492 CALL
errorstop(global,err_allocate,__line__,
'vcNew')
501 DO ilayer = 1,nlayers
509 SELECT CASE ( pregionserial%mixtInput%stencilDimensCells )
511 DO idimens = 1,pregionserial%mixtInput%dimens
512 idir = xcoord - 1 + idimens
514 DO j = 1,pgridserial%c2cs1D(
idir,icg)%nCellMembs
515 icg2 = pgridserial%c2cs1D(
idir,icg)%cellMembs(
j)
517 IF ( pgridserial%sc2r(icg2) /= pregion%iRegionGlobal )
THEN
520 IF ( iloc == element_not_found )
THEN
521 IF ( ncellsvirt < ncellsvirtmax )
THEN
522 ncellsvirt = ncellsvirt + 1
523 vc(ncellsvirt) = icg2
525 CALL
errorstop(global,err_exceed_dimens,__line__,
'vc')
528 IF ( vcnewdim < vcnewdimmax )
THEN
529 vcnewdim = vcnewdim + 1
530 vcnew(vcnewdim) = icg2
532 CALL
errorstop(global,err_exceed_dimens,__line__,
'vcNew')
541 DO j = 1,pgridserial%c2cs(icg)%nCellMembs
542 icg2 = pgridserial%c2cs(icg)%cellMembs(
j)
544 IF ( pgridserial%sc2r(icg2) /= pregion%iRegionGlobal )
THEN
547 IF ( iloc == element_not_found )
THEN
548 IF ( ncellsvirt < ncellsvirtmax )
THEN
549 ncellsvirt = ncellsvirt + 1
550 vc(ncellsvirt) = icg2
552 CALL
errorstop(global,err_exceed_dimens,__line__,
'vc')
555 IF ( vcnewdim < vcnewdimmax )
THEN
556 vcnewdim = vcnewdim + 1
557 vcnew(vcnewdim) = icg2
559 CALL
errorstop(global,err_exceed_dimens,__line__,
'vcNew')
567 CALL
errorstop(global,err_reached_default,__line__)
571 DEALLOCATE(vcold,stat=errorflag)
572 global%error = errorflag
573 IF ( global%error /= err_none )
THEN
574 CALL
errorstop(global,err_deallocate,__line__,
'vcOld')
577 IF ( ilayer /= nlayers )
THEN
580 ALLOCATE(vcold(vcolddim),stat=errorflag)
581 global%error = errorflag
582 IF ( global%error /= err_none )
THEN
583 CALL
errorstop(global,err_allocate,__line__,
'vcOld')
596 DEALLOCATE(vcnew,stat=errorflag)
597 global%error = errorflag
598 IF ( global%error /= err_none )
THEN
599 CALL
errorstop(global,err_deallocate,__line__,
'vcNew')
608 IF ( global%myProcid == masterproc .AND. &
609 global%verbLevel > verbose_none )
THEN
610 WRITE(stdout,
'(A,1X,A)') solver_name, &
611 'Adding virtual cells for inviscid higher-order stencil done.'
subroutine, public rflu_createc2cstencilwrapper(pRegion)
subroutine, public rflu_part_addvirtualcellsinv2(pRegion, pRegionSerial, vc, nCellsVirtMax, nCellsVirt)
subroutine, public rflu_buildfacevertlist(global, pGrid, fList, fListDim, vList, vListDimMax, vListDim, errorFlag)
subroutine registerfunction(global, funName, fileName)
subroutine quicksortinteger(a, n)
subroutine binarysearchinteger(a, n, v, i, j)
subroutine, public rflu_part_addvirtualcellsinv1(pRegion, pRegionSerial, vc, nCellsVirtMax, nCellsVirt)
subroutine, public rflu_destroyc2cstencilwrapper(pRegion)
**********************************************************************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 idir
subroutine, public rflu_setinfoc2cstencilwrapper(pRegion, orderNominal)
subroutine, public rflu_buildc2cstencilwrapper(pRegion, icgInput, constrInput)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine, public rflu_buildvertcellnghblist(global, pGrid, vListOrig, vListOrigDim, nLayers, iReg, cList, cListDimMax, cListDim)
subroutine deregisterfunction(global)