68 CHARACTER(CHRLEN) :: RCSIdentString = &
69 '$RCSfile: RFLU_ModStencilsBFaces.F90,v $ $Revision: 1.10 $'
114 TYPE(t_patch),
POINTER :: ppatch
115 TYPE(t_region
),
POINTER :: pregion
122 INTEGER :: fndir,f2cs1dbeg,f2cs1dend,degr,errorflag,ifg,ilayer,iloc, &
123 ipatch,isl,nbfacemembs,nbfacemembsmax, &
124 ncellmembsinfomax,ncellmembsinfomaxloc,ncellmembsinfomin, &
125 ncellmembsinfominloc,
nfaces,nlayersinfomax,nlayersinfomaxloc, &
126 nlayersinfomin,nlayersinfominloc,nlayersmax,stencilsizemax, &
128 INTEGER,
DIMENSION(:),
ALLOCATABLE :: f2cs1d
129 INTEGER,
DIMENSION(:,:),
ALLOCATABLE :: layerinfo
130 REAL(RFREAL) :: nx,ny,nz,nm
132 TYPE(t_grid),
POINTER :: pgrid
138 global => pregion%global
141 'RFLU_ModStencilsBFaces.F90')
143 IF ( global%myProcid == masterproc )
THEN
144 IF ( global%verbLevel > verbose_none )
THEN
145 WRITE(stdout,
'(A,1X,A)') solver_name, &
146 'Building 1D boundary-face-to-cell stencil...'
148 IF ( global%verbLevel > verbose_low )
THEN
149 WRITE(stdout,
'(A,3X,A,1X,I4)') solver_name,
'Patch:', &
159 pgrid => pregion%grid
161 IF (
ASSOCIATED(pgrid%hex2f) .EQV. .false. )
THEN
162 CALL
errorstop(global,err_associated,__line__,
'pGrid%hex2f')
169 IF ( ppatch%bcType /= bc_virtual )
THEN
170 nlayersmax = ppatch%bf2cs1DInfo%nLayersMax
171 nbfacemembsmax = ppatch%bf2cs1DInfo%nBFaceMembsMax
172 stencilsizemax = ppatch%bf2cs1DInfo%nCellMembsMax
173 stencilsizemin = ppatch%bf2cs1DInfo%nCellMembsMin
175 ncellmembsinfomax = 0
176 ncellmembsinfomin = huge(1)
179 nlayersinfomin = huge(1)
181 IF ( ppatch%flatFlag .EQV. .false. )
THEN
182 CALL
errorstop(global,err_patch_not_flat,__line__)
186 IF ( fndirflag .EQV. .false. )
THEN
187 CALL
errorstop(global,err_patch_not_aligned,__line__)
191 IF ( ppatch%renumFlag .EQV. .false. )
THEN
192 CALL
errorstop(global,err_patch_renumflag,__line__)
199 ALLOCATE(f2cs1d(stencilsizemax),stat=errorflag)
200 global%error = errorflag
201 IF ( global%error /= err_none )
THEN
202 CALL
errorstop(global,err_allocate,__line__,
'f2cs')
205 ALLOCATE(layerinfo(x2cs_layer_beg:x2cs_layer_end,nlayersmax), &
207 global%error = errorflag
208 IF ( global%error /= err_none )
THEN
209 CALL
errorstop(global,err_allocate,__line__,
'layerInfo')
216 DO ifg = 1,ppatch%nBFaces
224 DO isl = 1,stencilsizemax
228 DO ilayer = 1,nlayersmax
229 layerinfo(x2cs_layer_beg,ilayer) = 0
230 layerinfo(x2cs_layer_end,ilayer) = 0
239 f2cs1d(1) = ppatch%bf2c(ifg)
241 ppatch%bf2cs1D(ifg)%nLayers = 1
243 layerinfo(x2cs_layer_beg,1) = 1
244 layerinfo(x2cs_layer_end,1) = degr
251 DO ilayer = 2,nlayersmax
252 IF ( degr < stencilsizemin )
THEN
253 f2cs1dbeg = layerinfo(x2cs_layer_beg,ilayer-1)
254 f2cs1dend = layerinfo(x2cs_layer_end,ilayer-1)
257 f2cs1dbeg,f2cs1dend,f2cs1d,fndir)
259 ppatch%bf2cs1D(ifg)%nLayers = ppatch%bf2cs1D(ifg)%nLayers + 1
261 layerinfo(x2cs_layer_beg,ilayer) = &
262 layerinfo(x2cs_layer_end,ilayer-1) + 1
263 layerinfo(x2cs_layer_end,ilayer) = degr
273 ppatch%bf2cs1D(ifg)%nCellMembs = degr
275 ALLOCATE(ppatch%bf2cs1D(ifg)%cellMembs(ppatch%bf2cs1D(ifg)%nCellMembs), &
277 global%error = errorflag
278 IF ( global%error /= err_none )
THEN
279 CALL
errorstop(global,err_allocate,__line__, &
280 'pPatch%bf2cs1D%cellMembs')
283 DO isl = 1,ppatch%bf2cs1D(ifg)%nCellMembs
284 ppatch%bf2cs1D(ifg)%cellMembs(isl) = f2cs1d(isl)
287 ALLOCATE(ppatch%bf2cs1D(ifg)%layerInfo(x2cs_layer_beg:x2cs_layer_end, &
288 ppatch%bf2cs1D(ifg)%nLayers),stat=errorflag)
289 global%error = errorflag
290 IF ( global%error /= err_none )
THEN
291 CALL
errorstop(global,err_allocate,__line__, &
292 'pPatch%bf2cs1D%layerInfo')
295 DO ilayer = 1,ppatch%bf2cs1D(ifg)%nLayers
296 ppatch%bf2cs1D(ifg)%layerInfo(x2cs_layer_beg,ilayer) = &
297 layerinfo(x2cs_layer_beg,ilayer)
298 ppatch%bf2cs1D(ifg)%layerInfo(x2cs_layer_end,ilayer) = &
299 layerinfo(x2cs_layer_end,ilayer)
312 IF ( ppatch%bf2cs1D(ifg)%nLayers < nlayersinfomin )
THEN
313 nlayersinfomin = ppatch%bf2cs1D(ifg)%nLayers
314 nlayersinfominloc = ifg
317 IF ( ppatch%bf2cs1D(ifg)%nLayers > nlayersinfomax )
THEN
318 nlayersinfomax = ppatch%bf2cs1D(ifg)%nLayers
319 nlayersinfomaxloc = ifg
322 IF ( ppatch%bf2cs1D(ifg)%nCellMembs < ncellmembsinfomin )
THEN
323 ncellmembsinfomin = ppatch%bf2cs1D(ifg)%nCellMembs
324 ncellmembsinfominloc = ifg
327 IF ( ppatch%bf2cs1D(ifg)%nCellMembs > ncellmembsinfomax )
THEN
328 ncellmembsinfomax = ppatch%bf2cs1D(ifg)%nCellMembs
329 ncellmembsinfomaxloc = ifg
337 IF ( global%myProcid == masterproc .AND. &
338 global%verbLevel > verbose_low )
THEN
339 WRITE(stdout,
'(A,5X,A)') solver_name,
'Statistics:'
340 WRITE(stdout,
'(A,7X,A,2(1X,I3),2(1X,I9))') solver_name, &
341 'Minimum/maximum number of cell layers: ',nlayersinfomin, &
342 nlayersinfomax,nlayersinfominloc,nlayersinfomaxloc
343 WRITE(stdout,
'(A,7X,A,2(1X,I3),2(1X,I9))') solver_name, &
344 'Minimum/maximum number of cell members:',ncellmembsinfomin, &
345 ncellmembsinfomax,ncellmembsinfominloc,ncellmembsinfomaxloc
352 DEALLOCATE(f2cs1d,stat=errorflag)
353 global%error = errorflag
354 IF ( global%error /= err_none )
THEN
355 CALL
errorstop(global,err_deallocate,__line__,
'f2cs1D')
358 DEALLOCATE(layerinfo,stat=errorflag)
359 global%error = errorflag
360 IF ( global%error /= err_none )
THEN
361 CALL
errorstop(global,err_deallocate,__line__,
'layerInfo')
364 #ifdef CHECK_DATASTRUCT
369 WRITE(stdout,
'(A)') solver_name
370 WRITE(stdout,
'(A,1X,A)') solver_name,
'### START CHECK OUTPUT ###'
371 WRITE(stdout,
'(A,1X,A)') solver_name,
'Boundary face-to-cell stencils'
372 WRITE(stdout,
'(A,1X,A,1X,I6)') solver_name,
'Maximum number of layers:', &
373 ppatch%bf2cs1DInfo%nLayersMax
374 WRITE(stdout,
'(A,1X,A,1X,I6)') solver_name,
'Minimum stencil size:', &
375 ppatch%bf2cs1DInfo%nCellMembsMin
377 DO ifg = 1,ppatch%nBFaces
378 WRITE(stdout,
'(A,1X,I6,2(1X,I3),3X,20(1X,I6))') solver_name,ifg, &
379 ppatch%bf2cs1D(ifg)%nLayers,ppatch%bf2cs1D(ifg)%nCellMembs, &
380 ppatch%bf2cs1D(ifg)%cellMembs(1:ppatch%bf2cs1D(ifg)%nCellMembs)
383 WRITE(stdout,
'(A,1X,A)') solver_name,
'### END CHECK OUTPUT ###'
384 WRITE(stdout,
'(A)') solver_name
392 IF ( global%myProcid == masterproc .AND. &
393 global%verbLevel > verbose_none )
THEN
394 WRITE(stdout,
'(A,1X,A)') solver_name, &
395 'Building 1D boundary-face-to-cell stencil done.'
438 TYPE(t_patch),
POINTER :: ppatch
439 TYPE(t_region
),
POINTER :: pregion
445 INTEGER :: degr,errorflag,f2csbeg,f2csend,icg,ifg,ifg2,ilayer,iloc, &
446 isl,ivl,iv2c,nbfacemembs,nbfacemembsmax,nbfacemembsmaxtemp, &
447 ncellmembsinfomax,ncellmembsinfomaxloc,ncellmembsinfomin, &
448 ncellmembsinfominloc,nlayersinfomax,nlayersinfomaxloc, &
449 nlayersinfomin,nlayersinfominloc,nlayersmax,nrows,
order, &
450 ordernominal,scount,stencilsizemax,stencilsizemin,ncols, &
453 INTEGER,
DIMENSION(:),
ALLOCATABLE :: f2cs
454 INTEGER,
DIMENSION(:,:),
ALLOCATABLE :: bfacemembs,layerinfo
456 REAL(RFREAL) :: colmax(4)
457 REAL(RFREAL),
DIMENSION(:,:),
ALLOCATABLE ::
a,
ainv
459 TYPE(t_grid),
POINTER :: pgrid
465 global => pregion%global
468 'RFLU_ModStencilsBFaces.F90')
470 IF ( global%myProcid == masterproc )
THEN
471 IF ( global%verbLevel > verbose_none )
THEN
472 WRITE(stdout,
'(A,1X,A)') solver_name, &
473 'Building boundary-face-to-cell stencil...'
475 IF ( global%verbLevel > verbose_low )
THEN
476 WRITE(stdout,
'(A,3X,A,1X,I4)') solver_name,
'Patch:', &
486 pgrid => pregion%grid
492 IF ( ppatch%bcType /= bc_virtual )
THEN
493 ordernominal = ppatch%bf2csInfo%orderNominal
494 nlayersmax = ppatch%bf2csInfo%nLayersMax
495 nbfacemembsmax = ppatch%bf2csInfo%nBFaceMembsMax
496 stencilsizemax = ppatch%bf2csInfo%nCellMembsMax
497 stencilsizemin = ppatch%bf2csInfo%nCellMembsMin
499 ncellmembsinfomax = 0
500 ncellmembsinfomin = huge(1)
503 nlayersinfomin = huge(1)
505 nbfacemembsmaxtemp = 2*nbfacemembsmax
507 IF ( ppatch%renumFlag .EQV. .false. )
THEN
508 CALL
errorstop(global,err_patch_renumflag,__line__)
515 ALLOCATE(f2cs(stencilsizemax),stat=errorflag)
516 global%error = errorflag
517 IF ( global%error /= err_none )
THEN
518 CALL
errorstop(global,err_allocate,__line__,
'f2cs')
521 ALLOCATE(bfacemembs(2,stencilsizemax),stat=errorflag)
522 global%error = errorflag
523 IF ( global%error /= err_none )
THEN
524 CALL
errorstop(global,err_allocate,__line__,
'bFaceMembs')
527 ALLOCATE(layerinfo(x2cs_layer_beg:x2cs_layer_end,nlayersmax), &
529 global%error = errorflag
530 IF ( global%error /= err_none )
THEN
531 CALL
errorstop(global,err_allocate,__line__,
'layerInfo')
538 DO ifg = 1,ppatch%nBFaces
544 DO isl = 1,stencilsizemax
548 DO ilayer = 1,nlayersmax
549 layerinfo(x2cs_layer_beg,ilayer) = 0
550 layerinfo(x2cs_layer_end,ilayer) = 0
559 IF ( ppatch%bcType == bc_symmetry )
THEN
571 IF ( ppatch%bf2v(ivl,ifg) /= vert_none )
THEN
572 bf2v(ivl) = ppatch%bv(ppatch%bf2v(ivl,ifg))
574 bf2v(ivl) = vert_none
581 ppatch%bf2cs(ifg)%nLayers = 1
583 layerinfo(x2cs_layer_beg,1) = 1
584 layerinfo(x2cs_layer_end,1) = degr
592 ppatch%bf2cs(ifg)%nLayers = 1
594 f2cs(1) = ppatch%bf2c(ifg)
596 layerinfo(x2cs_layer_beg,1) = 1
597 layerinfo(x2cs_layer_end,1) = degr
604 DO ilayer = 2,nlayersmax
610 IF ( degr >= stencilsizemin )
THEN
612 ncols = pregion%mixtInput%dimens + 1
614 ALLOCATE(
a(nrows,ncols),stat=errorflag)
615 global%error = errorflag
616 IF ( global%error /= err_none )
THEN
617 CALL
errorstop(global,err_allocate,__line__,
'a')
620 ALLOCATE(
ainv(nrows,ncols),stat=errorflag)
621 global%error = errorflag
622 IF ( global%error /= err_none )
THEN
623 CALL
errorstop(global,err_allocate,__line__,
'aInv')
626 SELECT CASE ( pregion%mixtInput%dimens )
631 dx = pgrid%cofg(xcoord,icg) - ppatch%fc(xcoord,ifg)
632 dy = pgrid%cofg(ycoord,icg) - ppatch%fc(ycoord,ifg)
644 dx = pgrid%cofg(xcoord,icg) - ppatch%fc(xcoord,ifg)
645 dy = pgrid%cofg(ycoord,icg) - ppatch%fc(ycoord,ifg)
646 dz = pgrid%cofg(zcoord,icg) - ppatch%fc(zcoord,ifg)
656 CALL
errorstop(global,err_reached_default,__line__)
660 colmax(icol) = -huge(1.0_rfreal)
663 colmax(icol) =
max(colmax(icol),abs(
a(irow,icol)))
667 a(irow,icol) =
a(irow,icol)/colmax(icol)
673 DEALLOCATE(
a,stat=errorflag)
674 global%error = errorflag
675 IF ( global%error /= err_none )
THEN
676 CALL
errorstop(global,err_deallocate,__line__,
'a')
679 DEALLOCATE(
ainv,stat=errorflag)
680 global%error = errorflag
681 IF ( global%error /= err_none )
THEN
682 CALL
errorstop(global,err_deallocate,__line__,
'aInv')
692 IF ( scount /= 0 .OR. degr < stencilsizemin )
THEN
693 f2csbeg = layerinfo(x2cs_layer_beg,ilayer-1)
694 f2csend = layerinfo(x2cs_layer_end,ilayer-1)
697 f2csbeg,f2csend,f2cs)
699 ppatch%bf2cs(ifg)%nLayers = ppatch%bf2cs(ifg)%nLayers + 1
701 layerinfo(x2cs_layer_beg,ilayer) = &
702 layerinfo(x2cs_layer_end,ilayer-1) + 1
703 layerinfo(x2cs_layer_end,ilayer) = degr
711 ppatch%bf2cs(ifg)%nCellMembs = degr
713 ALLOCATE(ppatch%bf2cs(ifg)%cellMembs(ppatch%bf2cs(ifg)%nCellMembs), &
715 global%error = errorflag
716 IF ( global%error /= err_none )
THEN
717 CALL
errorstop(global,err_allocate,__line__, &
718 'pPatch%bf2cs%cellMembs')
721 DO isl = 1,ppatch%bf2cs(ifg)%nCellMembs
722 ppatch%bf2cs(ifg)%cellMembs(isl) = f2cs(isl)
725 ALLOCATE(ppatch%bf2cs(ifg)%layerInfo(x2cs_layer_beg:x2cs_layer_end, &
726 ppatch%bf2cs(ifg)%nLayers),stat=errorflag)
727 global%error = errorflag
728 IF ( global%error /= err_none )
THEN
729 CALL
errorstop(global,err_allocate,__line__, &
730 'pPatch%bf2cs%layerInfo')
733 DO ilayer = 1,ppatch%bf2cs(ifg)%nLayers
734 ppatch%bf2cs(ifg)%layerInfo(x2cs_layer_beg,ilayer) = &
735 layerinfo(x2cs_layer_beg,ilayer)
736 ppatch%bf2cs(ifg)%layerInfo(x2cs_layer_end,ilayer) = &
737 layerinfo(x2cs_layer_end,ilayer)
744 IF ( (ppatch%bcType == bc_noslipwall_hflux) .OR. &
745 (ppatch%bcType == bc_noslipwall_temp ) .OR. &
746 (ppatch%bcType == bc_injection ) )
THEN
748 ppatch%bf2cs(ifg)%nCellMembs,&
749 ppatch%bf2cs(ifg)%cellMembs(1:ppatch%bf2cs(ifg)%nCellMembs), &
750 nbfacemembs,bfacemembs)
755 IF ( nbfacemembs > 0 )
THEN
760 nbfacemembs,bfacemembs(1:2,1:nbfacemembs))
764 IF ( bfacemembs(1,1) == ppatch%iPatchLocal .AND. &
765 bfacemembs(2,1) == ifg )
THEN
766 DO isl = 2,nbfacemembs
767 bfacemembs(1,isl-1) = bfacemembs(1,isl)
768 bfacemembs(2,isl-1) = bfacemembs(2,isl)
771 nbfacemembs = nbfacemembs - 1
774 ppatch%bf2cs(ifg)%nBFaceMembs =
min(nbfacemembs,nbfacemembsmax)
776 IF ( ppatch%bf2cs(ifg)%nBFaceMembs > 0 )
THEN
777 ALLOCATE(ppatch%bf2cs(ifg)%bFaceMembs(2, &
778 ppatch%bf2cs(ifg)%nBFaceMembs),stat=errorflag)
779 global%error = errorflag
780 IF ( global%error /= err_none )
THEN
781 CALL
errorstop(global,err_allocate,__line__, &
782 'pPatch%bf2cs%bFaceMembs')
785 nullify(ppatch%bf2cs(ifg)%bFaceMembs)
788 DO isl = 1,ppatch%bf2cs(ifg)%nBFaceMembs
789 ppatch%bf2cs(ifg)%bFaceMembs(1,isl) = bfacemembs(1,isl)
790 ppatch%bf2cs(ifg)%bFaceMembs(2,isl) = bfacemembs(2,isl)
793 ppatch%bf2cs(ifg)%nBFaceMembs = 0
795 nullify(ppatch%bf2cs(ifg)%bFaceMembs)
800 IF ( ppatch%bf2cs(ifg)%nLayers < nlayersinfomin )
THEN
801 nlayersinfomin = ppatch%bf2cs(ifg)%nLayers
802 nlayersinfominloc = ifg
805 IF ( ppatch%bf2cs(ifg)%nLayers > nlayersinfomax )
THEN
806 nlayersinfomax = ppatch%bf2cs(ifg)%nLayers
807 nlayersinfomaxloc = ifg
810 IF ( ppatch%bf2cs(ifg)%nCellMembs < ncellmembsinfomin )
THEN
811 ncellmembsinfomin = ppatch%bf2cs(ifg)%nCellMembs
812 ncellmembsinfominloc = ifg
815 IF ( ppatch%bf2cs(ifg)%nCellMembs > ncellmembsinfomax )
THEN
816 ncellmembsinfomax = ppatch%bf2cs(ifg)%nCellMembs
817 ncellmembsinfomaxloc = ifg
825 IF ( global%myProcid == masterproc .AND. &
826 global%verbLevel > verbose_low )
THEN
827 WRITE(stdout,
'(A,5X,A)') solver_name,
'Statistics:'
828 WRITE(stdout,
'(A,7X,A,2(1X,I3),2(1X,I9))') solver_name, &
829 'Minimum/maximum number of cell layers: ',nlayersinfomin, &
830 nlayersinfomax,nlayersinfominloc,nlayersinfomaxloc
831 WRITE(stdout,
'(A,7X,A,2(1X,I3),2(1X,I9))') solver_name, &
832 'Minimum/maximum number of cell members:',ncellmembsinfomin, &
833 ncellmembsinfomax,ncellmembsinfominloc,ncellmembsinfomaxloc
840 DEALLOCATE(f2cs,stat=errorflag)
841 global%error = errorflag
842 IF ( global%error /= err_none )
THEN
843 CALL
errorstop(global,err_deallocate,__line__,
'f2cs')
846 DEALLOCATE(bfacemembs,stat=errorflag)
847 global%error = errorflag
848 IF ( global%error /= err_none )
THEN
849 CALL
errorstop(global,err_deallocate,__line__,
'bFaceMembs')
852 DEALLOCATE(layerinfo,stat=errorflag)
853 global%error = errorflag
854 IF ( global%error /= err_none )
THEN
855 CALL
errorstop(global,err_deallocate,__line__,
'layerInfo')
858 #ifdef CHECK_DATASTRUCT
863 WRITE(stdout,
'(A)') solver_name
864 WRITE(stdout,
'(A,1X,A)') solver_name,
'### START CHECK OUTPUT ###'
865 WRITE(stdout,
'(A,1X,A)') solver_name,
'Boundary face-to-cell stencils'
866 WRITE(stdout,
'(A,1X,A,1X,I6)') solver_name,
'Maximum number of layers:', &
867 ppatch%bf2csInfo%nLayersMax
868 WRITE(stdout,
'(A,1X,A,1X,I6)') solver_name,
'Minimum stencil size:', &
869 ppatch%bf2csInfo%nCellMembsMin
871 DO ifg = 1,ppatch%nBFaces
872 WRITE(stdout,
'(A,1X,I6,2(1X,I3),3X,20(1X,I6))') solver_name,ifg, &
873 ppatch%bf2cs(ifg)%nLayers,ppatch%bf2cs(ifg)%nCellMembs, &
874 ppatch%bf2cs(ifg)%cellMembs(1:ppatch%bf2cs(ifg)%nCellMembs)
877 WRITE(stdout,
'(A,1X,A)') solver_name,
'### END CHECK OUTPUT ###'
878 WRITE(stdout,
'(A)') solver_name
886 IF ( global%myProcid == masterproc .AND. &
887 global%verbLevel > verbose_none )
THEN
888 WRITE(stdout,
'(A,1X,A)') solver_name, &
889 'Building boundary-face-to-cell stencil done.'
932 INTEGER,
INTENT(IN),
OPTIONAL :: constrinput
933 TYPE(t_patch),
POINTER :: ppatch
934 TYPE(t_region
),
POINTER :: pregion
941 TYPE(t_grid),
POINTER :: pgrid
948 global => pregion%global
951 'RFLU_ModStencilsBFaces.F90')
957 pgrid => pregion%grid
959 IF ( .NOT. present(constrinput) )
THEN
962 IF ( constrinput == constr_none )
THEN
973 SELECT CASE ( pregion%mixtInput%stencilDimensBFaces )
979 CALL
errorstop(global,err_reached_default,__line__)
1022 TYPE(t_patch),
POINTER :: ppatch
1023 TYPE(t_region
),
POINTER :: pregion
1029 INTEGER :: errorflag,ifl
1036 global => pregion%global
1039 'RFLU_ModStencilsBFaces.F90')
1041 IF ( global%myProcid == masterproc )
THEN
1042 IF ( global%verbLevel > verbose_none )
THEN
1043 WRITE(stdout,
'(A,1X,A)') solver_name, &
1044 'Creating 1D boundary-face-to-cell stencil...'
1046 IF ( global%verbLevel > verbose_low )
THEN
1047 WRITE(stdout,
'(A,3X,A,1X,I4)') solver_name,
'Patch:', &
1063 IF ( ppatch%bcType /= bc_virtual )
THEN
1064 ALLOCATE(ppatch%bf2cs1D(ppatch%nBFaces),stat=errorflag)
1065 global%error = errorflag
1066 IF ( global%error /= err_none )
THEN
1067 CALL
errorstop(global,err_allocate,__line__,
'pPatch%bf2cs1D')
1070 DO ifl = 1,ppatch%nBFaces
1071 ppatch%bf2cs1D(ifl)%nCellMembs = 0
1072 ppatch%bf2cs1D(ifl)%nBFaceMembs = 0
1080 IF ( global%myProcid == masterproc .AND. &
1081 global%verbLevel > verbose_none )
THEN
1082 WRITE(stdout,
'(A,1X,A)') solver_name, &
1083 'Creating 1D boundary-face-to-cell stencil done.'
1123 TYPE(t_patch),
POINTER :: ppatch
1124 TYPE(t_region
),
POINTER :: pregion
1130 INTEGER :: errorflag,ifl
1137 global => pregion%global
1140 'RFLU_ModStencilsBFaces.F90')
1142 IF ( global%myProcid == masterproc )
THEN
1143 IF ( global%verbLevel > verbose_none )
THEN
1144 WRITE(stdout,
'(A,1X,A)') solver_name, &
1145 'Creating boundary-face-to-cell stencil...'
1147 IF ( global%verbLevel > verbose_low )
THEN
1148 WRITE(stdout,
'(A,3X,A,1X,I4)') solver_name,
'Patch:', &
1164 IF ( ppatch%bcType /= bc_virtual )
THEN
1165 ALLOCATE(ppatch%bf2cs(ppatch%nBFaces),stat=errorflag)
1166 global%error = errorflag
1167 IF ( global%error /= err_none )
THEN
1168 CALL
errorstop(global,err_allocate,__line__,
'pPatch%bf2cs')
1171 DO ifl = 1,ppatch%nBFaces
1172 ppatch%bf2cs(ifl)%nCellMembs = 0
1173 ppatch%bf2cs(ifl)%nBFaceMembs = 0
1181 IF ( global%myProcid == masterproc .AND. &
1182 global%verbLevel > verbose_none )
THEN
1183 WRITE(stdout,
'(A,1X,A)') solver_name, &
1184 'Creating boundary-face-to-cell stencil done.'
1224 TYPE(t_patch),
POINTER :: ppatch
1225 TYPE(t_region
),
POINTER :: pregion
1237 global => pregion%global
1240 'RFLU_ModStencilsBFaces.F90')
1246 SELECT CASE ( pregion%mixtInput%stencilDimensBFaces )
1252 CALL
errorstop(global,err_reached_default,__line__)
1296 TYPE(t_patch),
POINTER :: ppatch
1297 TYPE(t_region
),
POINTER :: pregion
1303 INTEGER :: errorflag,ifg
1304 TYPE(t_grid),
POINTER :: pgrid
1311 global => pregion%global
1314 'RFLU_ModStencilsBFaces.F90')
1316 IF ( global%myProcid == masterproc )
THEN
1317 IF ( global%verbLevel > verbose_none )
THEN
1318 WRITE(stdout,
'(A,1X,A)') solver_name, &
1319 'Destroying 1D boundary-face-to-cell stencil...'
1321 IF ( global%verbLevel > verbose_low )
THEN
1322 WRITE(stdout,
'(A,3X,A,1X,I4)') solver_name,
'Patch:', &
1332 pgrid => pregion%grid
1338 IF ( ppatch%bcType /= bc_virtual )
THEN
1339 DO ifg = 1,ppatch%nBFaces
1340 DEALLOCATE(ppatch%bf2cs1D(ifg)%cellMembs,stat=errorflag)
1341 global%error = errorflag
1342 IF ( global%error /= err_none )
THEN
1343 CALL
errorstop(global,err_deallocate,__line__, &
1344 'pPatch%bf2cs1D%cellMembs')
1347 IF ( ppatch%bf2cs1D(ifg)%nBFaceMembs > 0 )
THEN
1348 DEALLOCATE(ppatch%bf2cs1D(ifg)%bFaceMembs,stat=errorflag)
1349 global%error = errorflag
1350 IF ( global%error /= err_none )
THEN
1351 CALL
errorstop(global,err_deallocate,__line__, &
1352 'pPatch%bf2cs1D%bFaceMembs')
1357 DEALLOCATE(ppatch%bf2cs1D,stat=errorflag)
1358 global%error = errorflag
1359 IF ( global%error /= err_none )
THEN
1360 CALL
errorstop(global,err_deallocate,__line__,
'pPatch%bf2cs1D')
1374 IF ( global%myProcid == masterproc .AND. &
1375 global%verbLevel > verbose_none )
THEN
1376 WRITE(stdout,
'(A,1X,A)') solver_name,
'Destroying 1D '// &
1377 'boundary-face-to-cell stencil done.'
1416 TYPE(t_patch),
POINTER :: ppatch
1417 TYPE(t_region
),
POINTER :: pregion
1423 INTEGER :: errorflag,ifg
1424 TYPE(t_grid),
POINTER :: pgrid
1431 global => pregion%global
1434 'RFLU_ModStencilsBFaces.F90')
1436 IF ( global%myProcid == masterproc )
THEN
1437 IF ( global%verbLevel > verbose_none )
THEN
1438 WRITE(stdout,
'(A,1X,A)') solver_name, &
1439 'Destroying boundary-face-to-cell stencil...'
1441 IF ( global%verbLevel > verbose_low )
THEN
1442 WRITE(stdout,
'(A,3X,A,1X,I4)') solver_name,
'Patch:', &
1452 pgrid => pregion%grid
1458 IF ( ppatch%bcType /= bc_virtual )
THEN
1459 DO ifg = 1,ppatch%nBFaces
1460 DEALLOCATE(ppatch%bf2cs(ifg)%cellMembs,stat=errorflag)
1461 global%error = errorflag
1462 IF ( global%error /= err_none )
THEN
1463 CALL
errorstop(global,err_deallocate,__line__, &
1464 'pPatch%bf2cs%cellMembs')
1467 IF ( ppatch%bf2cs(ifg)%nBFaceMembs > 0 )
THEN
1468 DEALLOCATE(ppatch%bf2cs(ifg)%bFaceMembs,stat=errorflag)
1469 global%error = errorflag
1470 IF ( global%error /= err_none )
THEN
1471 CALL
errorstop(global,err_deallocate,__line__, &
1472 'pPatch%bf2cs%bFaceMembs')
1477 DEALLOCATE(ppatch%bf2cs,stat=errorflag)
1478 global%error = errorflag
1479 IF ( global%error /= err_none )
THEN
1480 CALL
errorstop(global,err_deallocate,__line__,
'pPatch%bf2cs')
1494 IF ( global%myProcid == masterproc .AND. &
1495 global%verbLevel > verbose_none )
THEN
1496 WRITE(stdout,
'(A,1X,A)') solver_name, &
1497 'Destroying boundary-face-to-cell stencil done.'
1538 TYPE(t_patch),
POINTER :: ppatch
1539 TYPE(t_region
),
POINTER :: pregion
1551 global => pregion%global
1554 'RFLU_ModStencilsBFaces.F90')
1560 SELECT CASE ( pregion%mixtInput%stencilDimensBFaces )
1566 CALL
errorstop(global,err_reached_default,__line__)
1611 TYPE(t_patch),
POINTER :: ppatch
1612 TYPE(t_region
),
POINTER :: pregion
1624 global => pregion%global
1627 'RFLU_ModStencilsBFaces.F90')
1633 IF ( ppatch%bcType /= bc_virtual )
THEN
1634 nullify(ppatch%bf2cs1D)
1677 TYPE(t_patch),
POINTER :: ppatch
1678 TYPE(t_region
),
POINTER :: pregion
1690 global => pregion%global
1693 'RFLU_ModStencilsBFaces.F90')
1699 IF ( ppatch%bcType /= bc_virtual )
THEN
1700 nullify(ppatch%bf2cs)
1748 INTEGER,
INTENT(IN) :: ordernominalinput
1749 TYPE(t_patch),
POINTER :: ppatch
1750 TYPE(t_region
),
POINTER :: pregion
1756 INTEGER :: nbfacemembsmax,nlayersmax,ordernominal,stencilsizemax, &
1764 global => pregion%global
1767 'RFLU_ModStencilsBFaces.F90')
1769 IF ( global%myProcid == masterproc .AND. &
1770 global%verbLevel > verbose_none )
THEN
1771 WRITE(stdout,
'(A,1X,A)') solver_name, &
1772 'Setting 1D boundary-face-to-cell stencil information...'
1781 ordernominal =
max(ordernominalinput,2)
1783 nlayersmax = ordernominal
1785 stencilsizemin = ordernominal
1786 stencilsizemax = ordernominal
1788 ppatch%bf2cs1DInfo%orderNominal = ordernominal
1789 ppatch%bf2cs1DInfo%nLayersMax = nlayersmax
1790 ppatch%bf2cs1DInfo%nBFaceMembsMax = nbfacemembsmax
1791 ppatch%bf2cs1DInfo%nCellMembsMax = stencilsizemax
1792 ppatch%bf2cs1DInfo%nCellMembsMin = stencilsizemin
1798 IF ( global%myProcid == masterproc .AND. &
1799 global%verbLevel > verbose_low )
THEN
1800 WRITE(stdout,
'(A,3X,A,1X,I3)') solver_name, &
1801 'Maximum allowed number of cell layers: ',nlayersmax
1802 WRITE(stdout,
'(A,3X,A,1X,I3)') solver_name, &
1803 'Minimum required number of cell members:',stencilsizemin
1804 WRITE(stdout,
'(A,3X,A,1X,I3)') solver_name, &
1805 'Maximum allowed number of cell members: ',stencilsizemax
1812 IF ( global%myProcid == masterproc .AND. &
1813 global%verbLevel > verbose_none )
THEN
1814 WRITE(stdout,
'(A,1X,A)') solver_name, &
1815 'Setting 1D boundary-face-to-cell stencil information done.'
1859 INTEGER,
INTENT(IN) :: ordernominalinput
1860 TYPE(t_patch),
POINTER :: ppatch
1861 TYPE(t_region
),
POINTER :: pregion
1867 INTEGER :: nbfacemembsmax,nlayersmax,ordernominal,stencilsizemax, &
1875 global => pregion%global
1878 'RFLU_ModStencilsBFaces.F90')
1880 IF ( global%myProcid == masterproc .AND. &
1881 global%verbLevel > verbose_none )
THEN
1882 WRITE(stdout,
'(A,1X,A)') solver_name, &
1883 'Setting boundary-face-to-cell stencil information...'
1892 ordernominal =
max(ordernominalinput,1)
1898 stencilsizemax = 10*stencilsizemin
1900 ppatch%bf2csInfo%orderNominal = ordernominal
1901 ppatch%bf2csInfo%nLayersMax = nlayersmax
1902 ppatch%bf2csInfo%nBFaceMembsMax = nbfacemembsmax
1903 ppatch%bf2csInfo%nCellMembsMax = stencilsizemax
1904 ppatch%bf2csInfo%nCellMembsMin = stencilsizemin
1910 IF ( global%myProcid == masterproc .AND. &
1911 global%verbLevel > verbose_low )
THEN
1912 WRITE(stdout,
'(A,3X,A,1X,I3)') solver_name, &
1913 'Maximum allowed number of cell layers: ',nlayersmax
1914 WRITE(stdout,
'(A,3X,A,1X,I3)') solver_name, &
1915 'Minimum required number of cell members:',stencilsizemin
1916 WRITE(stdout,
'(A,3X,A,1X,I3)') solver_name, &
1917 'Maximum allowed number of cell members: ',stencilsizemax
1924 IF ( global%myProcid == masterproc .AND. &
1925 global%verbLevel > verbose_none )
THEN
1926 WRITE(stdout,
'(A,1X,A)') solver_name, &
1927 'Setting boundary-face-to-cell stencil information done.'
1970 INTEGER,
INTENT(IN) :: ordernominal
1971 TYPE(t_patch),
POINTER :: ppatch
1972 TYPE(t_region
),
POINTER :: pregion
1984 global => pregion%global
1987 'RFLU_ModStencilsBFaces.F90')
1993 SELECT CASE ( pregion%mixtInput%stencilDimensBFaces )
1999 CALL
errorstop(global,err_reached_default,__line__)
subroutine rflu_destroybf2cstencil_1d(pRegion, pPatch)
subroutine, public rflu_buildbf2cstencilwrapper(pRegion, pPatch, constrInput)
subroutine rflu_nullifybf2cstencil_1d(pRegion, pPatch)
subroutine rflu_nullifybf2cstencil(pRegion, pPatch)
subroutine rflu_createbf2cstencil(pRegion, pPatch)
subroutine, public rflu_addcelllayer(global, pGrid, stencilSizeMax, ixg, degr, x2csBeg, x2csEnd, x2cs)
subroutine rflu_setinfobf2cstencil(pRegion, pPatch, orderNominalInput)
subroutine, public rflu_createbf2cstencilwrapper(pRegion, pPatch)
subroutine, public rflu_addcelllayer_1d(global, pGrid, stencilSizeMax, ixg, degr, x2csBeg, x2csEnd, x2cs, fnDir)
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
subroutine ainv(ajac, ajacin, det, ndim)
Size order() const
Degree of the element. 1 for linear and 2 for quadratic.
subroutine rflu_invertmatrixsvd(global, nRows, nCols, a, aInv, sCount)
subroutine registerfunction(global, funName, fileName)
subroutine, public rflu_getpatchnormaldirection(global, pPatch, pnDir, pnDirFlag)
subroutine, public rflu_addfacevertneighbs(global, pGrid, stencilSizeMax, f2v, degr, x2cs)
subroutine, public rflu_destroybf2cstencilwrapper(pRegion, pPatch)
subroutine, public rflu_addbfaces(pRegion, nBFaceMembsMaxTemp, nCellMembs, cellMembs, nBFaceMembs, bFaceMembs)
INTEGER function rflu_computestencilsize(global, factor, order)
subroutine rflu_destroybf2cstencil(pRegion, pPatch)
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
subroutine, public rflu_sortbfaces(pRegion, xyz, nBFaceMembs, bFaceMembs)
subroutine rflu_createbf2cstencil_1d(pRegion, pPatch)
subroutine rflu_setinfobf2cstencil_1d(pRegion, pPatch, orderNominalInput)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine rflu_buildbf2cstencil(pRegion, pPatch)
subroutine rflu_buildbf2cstencil_1d(pRegion, pPatch)
subroutine deregisterfunction(global)
subroutine, public rflu_setinfobf2cstencilwrapper(pRegion, pPatch, orderNominal)