70 CHARACTER(CHRLEN) :: RCSIdentString = &
71 '$RCSfile: RFLU_ModStencilsFaces.F90,v $ $Revision: 1.11 $'
116 TYPE(t_region
),
POINTER :: pregion
122 INTEGER :: fndir,f2cs1dbeg,f2cs1dend,degr,errorflag,ifg,ilayer,iloc,ipatch,isl, &
123 ncellmembsinfomax,ncellmembsinfomaxloc,ncellmembsinfomin, &
124 ncellmembsinfominloc,
nfaces,nlayersinfomax,nlayersinfomaxloc, &
125 nlayersinfomin,nlayersinfominloc,nlayersmax,stencilsizemax, &
127 INTEGER,
DIMENSION(:),
ALLOCATABLE :: f2cs1d
128 INTEGER,
DIMENSION(:,:),
ALLOCATABLE :: layerinfo
129 REAL(RFREAL) :: nx,ny,nz,nm
130 TYPE(t_grid),
POINTER :: pgrid
131 TYPE(t_patch),
POINTER :: ppatch
138 global => pregion%global
141 'RFLU_ModStencilsFaces.F90')
143 IF ( (global%myProcid == masterproc) .AND. &
144 (global%verbLevel > verbose_none) )
THEN
145 WRITE(stdout,
'(A,1X,A)') solver_name,
'Building 1D face-to-cell stencil...'
152 pgrid => pregion%grid
154 IF (
ASSOCIATED(pgrid%hex2f) .EQV. .false. )
THEN
155 CALL
errorstop(global,err_associated,__line__,
'pGrid%hex2f')
162 nlayersmax = pgrid%f2csInfo%nLayersMax
163 stencilsizemax = pgrid%f2csInfo%nCellMembsMax
164 stencilsizemin = pgrid%f2csInfo%nCellMembsMin
166 ncellmembsinfomax = 0
167 ncellmembsinfomin = huge(1)
170 nlayersinfomin = huge(1)
176 ALLOCATE(f2cs1d(stencilsizemax),stat=errorflag)
177 global%error = errorflag
178 IF ( global%error /= err_none )
THEN
179 CALL
errorstop(global,err_allocate,__line__,
'f2cs1D')
182 ALLOCATE(layerinfo(x2cs_layer_beg:x2cs_layer_end,nlayersmax), &
184 global%error = errorflag
185 IF ( global%error /= err_none )
THEN
186 CALL
errorstop(global,err_allocate,__line__,
'layerInfo')
193 DO ifg = 1,pgrid%nFaces
199 nx = abs(pgrid%fn(xcoord,ifg))
200 ny = abs(pgrid%fn(ycoord,ifg))
201 nz = abs(pgrid%fn(zcoord,ifg))
205 IF (
floatequal(nm,1.0_rfreal,1.0e-6_rfreal) .EQV. .true. )
THEN
206 IF ( nx > ny .AND. nx > nz )
THEN
208 ELSE IF ( ny > nx .AND. ny > nz )
THEN
210 ELSE IF ( nz > nx .AND. nz > ny )
THEN
215 WRITE(*,*)
'ERROR - Face not aligned with coordinate axes!'
222 DO isl = 1,stencilsizemax
226 DO ilayer = 1,nlayersmax
227 layerinfo(x2cs_layer_beg,ilayer) = 0
228 layerinfo(x2cs_layer_end,ilayer) = 0
237 f2cs1d(1) = pgrid%f2c(1,ifg)
238 f2cs1d(2) = pgrid%f2c(2,ifg)
240 pgrid%f2cs1D(ifg)%nLayers = 1
242 layerinfo(x2cs_layer_beg,1) = 1
243 layerinfo(x2cs_layer_end,1) = degr
250 DO ilayer = 2,nlayersmax
251 IF ( degr < stencilsizemin )
THEN
252 f2cs1dbeg = layerinfo(x2cs_layer_beg,ilayer-1)
253 f2cs1dend = layerinfo(x2cs_layer_end,ilayer-1)
256 f2cs1dbeg,f2cs1dend,f2cs1d,fndir)
258 pgrid%f2cs1D(ifg)%nLayers = pgrid%f2cs1D(ifg)%nLayers + 1
260 layerinfo(x2cs_layer_beg,ilayer) = &
261 layerinfo(x2cs_layer_end,ilayer-1) + 1
262 layerinfo(x2cs_layer_end,ilayer) = degr
272 pgrid%f2cs1D(ifg)%nCellMembs = degr
274 ALLOCATE(pgrid%f2cs1D(ifg)%cellMembs(degr),stat=errorflag)
275 global%error = errorflag
276 IF ( global%error /= err_none )
THEN
277 CALL
errorstop(global,err_allocate,__line__,
'pGrid%f2cs1D%cellMembs')
281 pgrid%f2cs1D(ifg)%cellMembs(isl) = f2cs1d(isl)
284 ALLOCATE(pgrid%f2cs1D(ifg)%layerInfo(x2cs_layer_beg:x2cs_layer_end, &
285 pgrid%f2cs1D(ifg)%nLayers),stat=errorflag)
286 global%error = errorflag
287 IF ( global%error /= err_none )
THEN
288 CALL
errorstop(global,err_allocate,__line__,
'pGrid%f2cs1D%layerInfo')
291 DO ilayer = 1,pgrid%f2cs1D(ifg)%nLayers
292 pgrid%f2cs1D(ifg)%layerInfo(x2cs_layer_beg,ilayer) = &
293 layerinfo(x2cs_layer_beg,ilayer)
294 pgrid%f2cs1D(ifg)%layerInfo(x2cs_layer_end,ilayer) = &
295 layerinfo(x2cs_layer_end,ilayer)
302 IF ( pgrid%f2cs1D(ifg)%nLayers < nlayersinfomin )
THEN
303 nlayersinfomin = pgrid%f2cs1D(ifg)%nLayers
304 nlayersinfominloc = ifg
307 IF ( pgrid%f2cs1D(ifg)%nLayers > nlayersinfomax )
THEN
308 nlayersinfomax = pgrid%f2cs1D(ifg)%nLayers
309 nlayersinfomaxloc = ifg
312 IF ( pgrid%f2cs1D(ifg)%nCellMembs < ncellmembsinfomin )
THEN
313 ncellmembsinfomin = pgrid%f2cs1D(ifg)%nCellMembs
314 ncellmembsinfominloc = ifg
317 IF ( pgrid%f2cs1D(ifg)%nCellMembs > ncellmembsinfomax )
THEN
318 ncellmembsinfomax = pgrid%f2cs1D(ifg)%nCellMembs
319 ncellmembsinfomaxloc = ifg
327 IF ( global%myProcid == masterproc .AND. &
328 global%verbLevel > verbose_low )
THEN
329 WRITE(stdout,
'(A,3X,A)') solver_name,
'Statistics:'
330 WRITE(stdout,
'(A,5X,A,2(1X,I3),2(1X,I9))') solver_name, &
331 'Minimum/maximum number of cell layers: ',nlayersinfomin, &
332 nlayersinfomax,nlayersinfominloc,nlayersinfomaxloc
333 WRITE(stdout,
'(A,5X,A,2(1X,I3),2(1X,I9))') solver_name, &
334 'Minimum/maximum number of cell members:',ncellmembsinfomin, &
335 ncellmembsinfomax,ncellmembsinfominloc,ncellmembsinfomaxloc
342 DEALLOCATE(f2cs1d,stat=errorflag)
343 global%error = errorflag
344 IF ( global%error /= err_none )
THEN
345 CALL
errorstop(global,err_deallocate,__line__,
'c2cs1D')
348 DEALLOCATE(layerinfo,stat=errorflag)
349 global%error = errorflag
350 IF ( global%error /= err_none )
THEN
351 CALL
errorstop(global,err_deallocate,__line__,
'layerInfo')
358 IF ( (global%myProcid == masterproc) .AND. &
359 (global%verbLevel > verbose_none) )
THEN
360 WRITE(stdout,
'(A,1X,A)') solver_name, &
361 'Building 1D face-to-cell stencil done.'
406 LOGICAL,
INTENT(IN) :: addbfaces
407 TYPE(t_region
),
POINTER :: pregion
413 INTEGER :: degr,errorflag,f2csbeg,f2csend,icg,ifg,ifg2,ifl,ilayer,iloc, &
414 ipatch,isl,ivl,iv2c,nbfacemembs,nbfacemembsmax, &
415 nbfacemembsmaxtemp,ncellmembsinfomax,ncellmembsinfomaxloc, &
416 ncellmembsinfomin,ncellmembsinfominloc,nfacesopp, &
417 nlayersinfomax,nlayersinfomaxloc,nlayersinfomin, &
418 nlayersinfominloc,nlayersmax,nrows,
order,ordernominal,scount, &
419 stencilsizemax,stencilsizemin,ncols,irow,icol
421 INTEGER :: faceoppinfo(2,2)
422 INTEGER,
DIMENSION(:),
ALLOCATABLE :: f2cs
423 INTEGER,
DIMENSION(:,:),
ALLOCATABLE :: bfacemembs,layerinfo
425 REAL(RFREAL) :: colmax(4)
426 REAL(RFREAL),
DIMENSION(:,:),
ALLOCATABLE ::
a,
ainv
427 TYPE(t_grid),
POINTER :: pgrid
428 TYPE(t_patch),
POINTER :: ppatch
435 global => pregion%global
438 'RFLU_ModStencilsFaces.F90')
440 IF ( global%myProcid == masterproc .AND. &
441 global%verbLevel > verbose_none )
THEN
442 WRITE(stdout,
'(A,1X,A)') solver_name,
'Building face-to-cell stencil...'
449 pgrid => pregion%grid
455 ordernominal = pgrid%f2csInfo%orderNominal
456 nlayersmax = pgrid%f2csInfo%nLayersMax
457 nbfacemembsmax = pgrid%f2csInfo%nBFaceMembsMax
458 stencilsizemax = pgrid%f2csInfo%nCellMembsMax
459 stencilsizemin = pgrid%f2csInfo%nCellMembsMin
461 ncellmembsinfomax = 0
462 ncellmembsinfomin = huge(1)
465 nlayersinfomin = huge(1)
467 nbfacemembsmaxtemp = 2*nbfacemembsmax
469 IF ( (global%myProcid == masterproc) .AND. &
470 (global%verbLevel > verbose_low) )
THEN
471 WRITE(stdout,
'(A,3X,A,1X,L1)') solver_name,
'Adding boundary faces:', &
479 ALLOCATE(f2cs(stencilsizemax),stat=errorflag)
480 global%error = errorflag
481 IF ( global%error /= err_none )
THEN
482 CALL
errorstop(global,err_allocate,__line__,
'f2cs')
485 ALLOCATE(bfacemembs(2,nbfacemembsmaxtemp),stat=errorflag)
486 global%error = errorflag
487 IF ( global%error /= err_none )
THEN
488 CALL
errorstop(global,err_allocate,__line__,
'bFaceMembs')
491 ALLOCATE(layerinfo(x2cs_layer_beg:x2cs_layer_end,nlayersmax), &
493 global%error = errorflag
494 IF ( global%error /= err_none )
THEN
495 CALL
errorstop(global,err_allocate,__line__,
'layerInfo')
502 DO ifg = 1,pgrid%nFaces
508 DO isl = 1,stencilsizemax
512 DO ilayer = 1,nlayersmax
513 layerinfo(x2cs_layer_beg,ilayer) = 0
514 layerinfo(x2cs_layer_end,ilayer) = 0
524 pgrid%f2v(1:4,ifg),degr,f2cs)
526 pgrid%f2cs(ifg)%nLayers = 1
528 layerinfo(x2cs_layer_beg,1) = 1
529 layerinfo(x2cs_layer_end,1) = degr
535 DO ilayer = 2,nlayersmax
543 IF ( degr >= stencilsizemin )
THEN
545 ncols = pregion%mixtInput%dimens + 1
547 ALLOCATE(
a(nrows,ncols),stat=errorflag)
548 global%error = errorflag
549 IF ( global%error /= err_none )
THEN
550 CALL
errorstop(global,err_allocate,__line__,
'a')
553 ALLOCATE(
ainv(nrows,ncols),stat=errorflag)
554 global%error = errorflag
555 IF ( global%error /= err_none )
THEN
556 CALL
errorstop(global,err_allocate,__line__,
'aInv')
559 SELECT CASE ( pregion%mixtInput%dimens )
564 dx = pgrid%cofg(xcoord,icg) - pgrid%fc(xcoord,ifg)
565 dy = pgrid%cofg(ycoord,icg) - pgrid%fc(ycoord,ifg)
577 dx = pgrid%cofg(xcoord,icg) - pgrid%fc(xcoord,ifg)
578 dy = pgrid%cofg(ycoord,icg) - pgrid%fc(ycoord,ifg)
579 dz = pgrid%cofg(zcoord,icg) - pgrid%fc(zcoord,ifg)
589 CALL
errorstop(global,err_reached_default,__line__)
593 colmax(icol) = -huge(1.0_rfreal)
596 colmax(icol) =
max(colmax(icol),abs(
a(irow,icol)))
600 a(irow,icol) =
a(irow,icol)/colmax(icol)
606 DEALLOCATE(
a,stat=errorflag)
607 global%error = errorflag
608 IF ( global%error /= err_none )
THEN
609 CALL
errorstop(global,err_deallocate,__line__,
'a')
612 DEALLOCATE(
ainv,stat=errorflag)
613 global%error = errorflag
614 IF ( global%error /= err_none )
THEN
615 CALL
errorstop(global,err_deallocate,__line__,
'aInv')
627 IF ( scount /= 0 .OR. degr < stencilsizemin )
THEN
628 f2csbeg = layerinfo(x2cs_layer_beg,ilayer-1)
629 f2csend = layerinfo(x2cs_layer_end,ilayer-1)
632 f2csbeg,f2csend,f2cs)
634 pgrid%f2cs(ifg)%nLayers = pgrid%f2cs(ifg)%nLayers + 1
636 layerinfo(x2cs_layer_beg,ilayer) = &
637 layerinfo(x2cs_layer_end,ilayer-1) + 1
638 layerinfo(x2cs_layer_end,ilayer) = degr
648 pgrid%f2cs(ifg)%nCellMembs = degr
650 ALLOCATE(pgrid%f2cs(ifg)%cellMembs(degr),stat=errorflag)
651 global%error = errorflag
652 IF ( global%error /= err_none )
THEN
653 CALL
errorstop(global,err_allocate,__line__,
'pGrid%f2cs%cellMembs')
657 pgrid%f2cs(ifg)%cellMembs(isl) = f2cs(isl)
660 ALLOCATE(pgrid%f2cs(ifg)%layerInfo(x2cs_layer_beg:x2cs_layer_end, &
661 pgrid%f2cs(ifg)%nLayers),stat=errorflag)
662 global%error = errorflag
663 IF ( global%error /= err_none )
THEN
664 CALL
errorstop(global,err_allocate,__line__,
'pGrid%f2cs%layerInfo')
667 DO ilayer = 1,pgrid%f2cs(ifg)%nLayers
668 pgrid%f2cs(ifg)%layerInfo(x2cs_layer_beg,ilayer) = &
669 layerinfo(x2cs_layer_beg,ilayer)
670 pgrid%f2cs(ifg)%layerInfo(x2cs_layer_end,ilayer) = &
671 layerinfo(x2cs_layer_end,ilayer)
681 IF ( addbfaces .EQV. .true. )
THEN
683 pgrid%f2cs(ifg)%nCellMembs, &
684 pgrid%f2cs(ifg)%cellMembs(1:pgrid%f2cs(ifg)%nCellMembs), &
685 nbfacemembs,bfacemembs)
688 IF ( nbfacemembs > 0 )
THEN
690 nbfacemembs,bfacemembs(1:2,1:nbfacemembs))
692 pgrid%f2cs(ifg)%nBFaceMembs =
min(nbfacemembs,nbfacemembsmax)
694 ALLOCATE(pgrid%f2cs(ifg)%bFaceMembs(2,pgrid%f2cs(ifg)%nBFaceMembs), &
696 global%error = errorflag
697 IF ( global%error /= err_none )
THEN
698 CALL
errorstop(global,err_allocate,__line__,
'pGrid%f2cs%bFaceMembs')
701 DO isl = 1,pgrid%f2cs(ifg)%nBFaceMembs
702 pgrid%f2cs(ifg)%bFaceMembs(1,isl) = bfacemembs(1,isl)
703 pgrid%f2cs(ifg)%bFaceMembs(2,isl) = bfacemembs(2,isl)
706 pgrid%f2cs(ifg)%nBFaceMembs = 0
708 nullify(pgrid%f2cs(ifg)%bFaceMembs)
715 IF ( pgrid%f2cs(ifg)%nLayers < nlayersinfomin )
THEN
716 nlayersinfomin = pgrid%f2cs(ifg)%nLayers
717 nlayersinfominloc = ifg
720 IF ( pgrid%f2cs(ifg)%nLayers > nlayersinfomax )
THEN
721 nlayersinfomax = pgrid%f2cs(ifg)%nLayers
722 nlayersinfomaxloc = ifg
725 IF ( pgrid%f2cs(ifg)%nCellMembs < ncellmembsinfomin )
THEN
726 ncellmembsinfomin = pgrid%f2cs(ifg)%nCellMembs
727 ncellmembsinfominloc = ifg
730 IF ( pgrid%f2cs(ifg)%nCellMembs > ncellmembsinfomax )
THEN
731 ncellmembsinfomax = pgrid%f2cs(ifg)%nCellMembs
732 ncellmembsinfomaxloc = ifg
740 IF ( global%myProcid == masterproc .AND. &
741 global%verbLevel > verbose_low )
THEN
742 WRITE(stdout,
'(A,3X,A)') solver_name,
'Statistics:'
743 WRITE(stdout,
'(A,5X,A,2(1X,I3),2(1X,I9))') solver_name, &
744 'Minimum/maximum number of cell layers: ',nlayersinfomin, &
745 nlayersinfomax,nlayersinfominloc,nlayersinfomaxloc
746 WRITE(stdout,
'(A,5X,A,2(1X,I3),2(1X,I9))') solver_name, &
747 'Minimum/maximum number of cell members:',ncellmembsinfomin, &
748 ncellmembsinfomax,ncellmembsinfominloc,ncellmembsinfomaxloc
751 #ifdef CHECK_DATASTRUCT
756 WRITE(stdout,
'(A)') solver_name
757 WRITE(stdout,
'(A,1X,A)') solver_name,
'### START CHECK OUTPUT ###'
758 WRITE(stdout,
'(A,1X,A)') solver_name,
'Face-to-cell stencils'
759 WRITE(stdout,
'(A,1X,A,1X,I6)') solver_name,
'Maximum number of layers:', &
760 pgrid%f2csInfo%nLayersMax
761 WRITE(stdout,
'(A,1X,A,1X,I6)') solver_name,
'Minimum stencil size:', &
762 pgrid%f2csInfo%nCellMembsMin
763 DO ifg = 1,pgrid%nFaces
764 WRITE(stdout,
'(A,1X,I6,2(1X,I3),3X,20(1X,I6))') solver_name,ifg, &
765 pgrid%f2cs(ifg)%nLayers,pgrid%f2cs(ifg)%nCellMembs, &
766 pgrid%f2cs(ifg)%cellMembs(1:pgrid%f2cs(ifg)%nCellMembs)
769 WRITE(stdout,
'(A,1X,A)') solver_name,
'### END CHECK OUTPUT ###'
770 WRITE(stdout,
'(A)') solver_name
777 DEALLOCATE(f2cs,stat=errorflag)
778 global%error = errorflag
779 IF ( global%error /= err_none )
THEN
780 CALL
errorstop(global,err_deallocate,__line__,
'f2cs')
783 DEALLOCATE(bfacemembs,stat=errorflag)
784 global%error = errorflag
785 IF ( global%error /= err_none )
THEN
786 CALL
errorstop(global,err_deallocate,__line__,
'bFaceMembs')
789 DEALLOCATE(layerinfo,stat=errorflag)
790 global%error = errorflag
791 IF ( global%error /= err_none )
THEN
792 CALL
errorstop(global,err_deallocate,__line__,
'layerInfo')
799 IF ( global%myProcid == masterproc .AND. &
800 global%verbLevel > verbose_none )
THEN
801 WRITE(stdout,
'(A,1X,A)') solver_name,
'Building face-to-cell stencil done.'
841 INTEGER,
INTENT(IN),
OPTIONAL :: constrinput
842 TYPE(t_region
),
POINTER :: pregion
849 TYPE(t_grid),
POINTER :: pgrid
856 global => pregion%global
859 'RFLU_ModStencilsFaces.F90')
865 pgrid => pregion%grid
867 IF ( .NOT. present(constrinput) )
THEN
870 IF ( constrinput == constr_none )
THEN
881 SELECT CASE ( pregion%mixtInput%stencilDimensFaces )
887 CALL
errorstop(global,err_reached_default,__line__)
931 TYPE(t_region
),
POINTER :: pregion
937 INTEGER :: errorflag,ifg
938 TYPE(t_grid),
POINTER :: pgrid
945 global => pregion%global
948 'RFLU_ModStencilsFaces.F90')
950 IF ( global%myProcid == masterproc .AND. &
951 global%verbLevel > verbose_none )
THEN
952 WRITE(stdout,
'(A,1X,A,A)') solver_name,
'Building list of constrained ', &
953 'face-to-cell stencil...'
960 pgrid => pregion%grid
966 pgrid%nFacesConstr = 0
968 IF ( pregion%mixtInput%cReconstFaces > constr_none )
THEN
969 DO ifg = 1,pgrid%nFaces
970 IF ( pgrid%f2cs(ifg)%nBFaceMembs > 0 )
THEN
971 pgrid%nFacesConstr = pgrid%nFacesConstr + 1
975 IF ( pgrid%nFacesConstr > 0 )
THEN
976 ALLOCATE(pgrid%ifgConstr(pgrid%nFacesConstr),stat=errorflag)
977 global%error = errorflag
978 IF ( global%error /= err_none )
THEN
979 CALL
errorstop(global,err_allocate,__line__,
'pGrid%ifgConstr')
982 pgrid%nFacesConstr = 0
984 DO ifg = 1,pgrid%nFaces
985 IF ( pgrid%f2cs(ifg)%nBFaceMembs > 0 )
THEN
986 pgrid%nFacesConstr = pgrid%nFacesConstr + 1
988 pgrid%ifgConstr(pgrid%nFacesConstr) = ifg
992 nullify(pgrid%ifgConstr)
995 nullify(pgrid%ifgConstr)
1002 IF ( global%myProcid == masterproc .AND. &
1003 global%verbLevel > verbose_low )
THEN
1004 WRITE(stdout,
'(A,3X,A,A,1X,I5)') solver_name,
'Number of constrained ', &
1005 'face-to-cell stencils:', &
1013 IF ( global%myProcid == masterproc .AND. &
1014 global%verbLevel > verbose_none )
THEN
1015 WRITE(stdout,
'(A,1X,A,A)') solver_name,
'Building list of constrained ', &
1016 'face-to-cell stencil done.'
1055 TYPE(t_region
),
POINTER :: pregion
1061 INTEGER :: errorflag,ifg
1062 TYPE(t_grid),
POINTER :: pgrid
1069 global => pregion%global
1072 'RFLU_ModStencilsFaces.F90')
1074 IF ( global%myProcid == masterproc .AND. &
1075 global%verbLevel > verbose_none )
THEN
1076 WRITE(stdout,
'(A,1X,A)') solver_name,
'Creating 1D face-to-cell stencil...'
1089 pgrid => pregion%grid
1095 ALLOCATE(pgrid%f2cs1D(pgrid%nFaces),stat=errorflag)
1096 global%error = errorflag
1097 IF ( global%error /= err_none )
THEN
1098 CALL
errorstop(global,err_allocate,__line__,
'pGrid%f2cs1D')
1101 DO ifg = 1,pgrid%nFaces
1102 pgrid%f2cs1D(ifg)%nCellMembs = 0
1103 pgrid%f2cs1D(ifg)%nBFaceMembs = 0
1110 IF ( global%myProcid == masterproc .AND. &
1111 global%verbLevel > verbose_none )
THEN
1112 WRITE(stdout,
'(A,1X,A)') solver_name, &
1113 'Creating 1D face-to-cell stencil done.'
1154 TYPE(t_region
),
POINTER :: pregion
1160 INTEGER :: errorflag,ifg
1161 TYPE(t_grid),
POINTER :: pgrid
1168 global => pregion%global
1171 'RFLU_ModStencilsFaces.F90')
1173 IF ( global%myProcid == masterproc .AND. &
1174 global%verbLevel > verbose_none )
THEN
1175 WRITE(stdout,
'(A,1X,A)') solver_name,
'Creating face-to-cell stencil...'
1188 pgrid => pregion%grid
1194 ALLOCATE(pgrid%f2cs(pgrid%nFaces),stat=errorflag)
1195 global%error = errorflag
1196 IF ( global%error /= err_none )
THEN
1197 CALL
errorstop(global,err_allocate,__line__,
'pGrid%f2cs')
1200 DO ifg = 1,pgrid%nFaces
1201 pgrid%f2cs(ifg)%nCellMembs = 0
1202 pgrid%f2cs(ifg)%nBFaceMembs = 0
1209 IF ( global%myProcid == masterproc .AND. &
1210 global%verbLevel > verbose_none )
THEN
1211 WRITE(stdout,
'(A,1X,A)') solver_name, &
1212 'Creating face-to-cell stencil done.'
1252 TYPE(t_region
),
POINTER :: pregion
1264 global => pregion%global
1267 'RFLU_ModStencilsFaces.F90')
1273 SELECT CASE ( pregion%mixtInput%stencilDimensFaces )
1279 CALL
errorstop(global,err_reached_default,__line__)
1324 TYPE(t_region
),
POINTER :: pregion
1330 INTEGER :: errorflag,ifg
1331 TYPE(t_grid),
POINTER :: pgrid
1338 global => pregion%global
1341 'RFLU_ModStencilsFaces.F90')
1343 IF ( global%myProcid == masterproc .AND. &
1344 global%verbLevel > verbose_none )
THEN
1345 WRITE(stdout,
'(A,1X,A)') solver_name, &
1346 'Destroying 1D face-to-cell stencil...'
1353 pgrid => pregion%grid
1359 DO ifg = 1,pgrid%nFaces
1360 DEALLOCATE(pgrid%f2cs1D(ifg)%cellMembs,stat=errorflag)
1361 global%error = errorflag
1362 IF ( global%error /= err_none )
THEN
1363 CALL
errorstop(global,err_deallocate,__line__,
'pGrid%f2cs1D%cellMembs')
1366 IF ( pgrid%f2cs1D(ifg)%nBFaceMembs > 0 )
THEN
1367 DEALLOCATE(pgrid%f2cs1D(ifg)%bFaceMembs,stat=errorflag)
1368 global%error = errorflag
1369 IF ( global%error /= err_none )
THEN
1370 CALL
errorstop(global,err_deallocate,__line__, &
1371 'pGrid%f2cs1D%bFaceMembs')
1376 DEALLOCATE(pgrid%f2cs1D,stat=errorflag)
1377 global%error = errorflag
1378 IF ( global%error /= err_none )
THEN
1379 CALL
errorstop(global,err_deallocate,__line__,
'pGrid%f2cs1D')
1392 IF ( global%myProcid == masterproc .AND. &
1393 global%verbLevel > verbose_none )
THEN
1394 WRITE(stdout,
'(A,1X,A)') solver_name, &
1395 'Destroying 1D face-to-cell stencil done.'
1434 TYPE(t_region
),
POINTER :: pregion
1440 INTEGER :: errorflag,ifg
1441 TYPE(t_grid),
POINTER :: pgrid
1448 global => pregion%global
1451 'RFLU_ModStencilsFaces.F90')
1453 IF ( global%myProcid == masterproc .AND. &
1454 global%verbLevel > verbose_none )
THEN
1455 WRITE(stdout,
'(A,1X,A)') solver_name, &
1456 'Destroying face-to-cell stencil...'
1463 pgrid => pregion%grid
1469 DO ifg = 1,pgrid%nFaces
1470 DEALLOCATE(pgrid%f2cs(ifg)%cellMembs,stat=errorflag)
1471 global%error = errorflag
1472 IF ( global%error /= err_none )
THEN
1473 CALL
errorstop(global,err_deallocate,__line__,
'pGrid%f2cs%cellMembs')
1476 IF ( pgrid%f2cs(ifg)%nBFaceMembs > 0 )
THEN
1477 DEALLOCATE(pgrid%f2cs(ifg)%bFaceMembs,stat=errorflag)
1478 global%error = errorflag
1479 IF ( global%error /= err_none )
THEN
1480 CALL
errorstop(global,err_deallocate,__line__, &
1481 'pGrid%f2cs%bFaceMembs')
1486 DEALLOCATE(pgrid%f2cs,stat=errorflag)
1487 global%error = errorflag
1488 IF ( global%error /= err_none )
THEN
1489 CALL
errorstop(global,err_deallocate,__line__,
'pGrid%f2cs')
1502 IF ( global%myProcid == masterproc .AND. &
1503 global%verbLevel > verbose_none )
THEN
1504 WRITE(stdout,
'(A,1X,A)') solver_name, &
1505 'Destroying face-to-cell stencil done.'
1545 TYPE(t_region
),
POINTER :: pregion
1557 global => pregion%global
1560 'RFLU_ModStencilsFaces.F90')
1566 SELECT CASE ( pregion%mixtInput%stencilDimensFaces )
1572 CALL
errorstop(global,err_reached_default,__line__)
1615 TYPE(t_region
),
POINTER :: pregion
1621 INTEGER :: errorflag
1622 TYPE(t_grid),
POINTER :: pgrid
1629 global => pregion%global
1632 'RFLU_ModStencilsFaces.F90')
1634 IF ( global%myProcid == masterproc .AND. &
1635 global%verbLevel > verbose_none )
THEN
1636 WRITE(stdout,
'(A,1X,A,A)') solver_name,
'Destroying list of ', &
1637 'constrained face-to-cell stencil...'
1644 pgrid => pregion%grid
1650 IF ( pregion%mixtInput%cReconstFaces > constr_none )
THEN
1651 IF ( pgrid%nFacesConstr > 0 )
THEN
1652 DEALLOCATE(pgrid%ifgConstr,stat=errorflag)
1653 global%error = errorflag
1654 IF ( global%error /= err_none )
THEN
1655 CALL
errorstop(global,err_deallocate,__line__,
'pGrid%ifgConstr')
1658 pgrid%nFacesConstr = 0
1666 IF ( global%myProcid == masterproc .AND. &
1667 global%verbLevel > verbose_none )
THEN
1668 WRITE(stdout,
'(A,1X,A,A)') solver_name,
'Destroying list of ', &
1669 'constrained face-to-cell stencil done.'
1707 TYPE(t_region
),
POINTER :: pregion
1714 TYPE(t_grid),
POINTER :: pgrid
1715 TYPE(t_patch),
POINTER :: ppatch
1722 global => pregion%global
1725 'RFLU_ModStencilsFaces.F90')
1727 IF ( global%myProcid == masterproc .AND. &
1728 global%verbLevel > verbose_none )
THEN
1729 WRITE(stdout,
'(A,1X,A)') solver_name, &
1730 'Nullifying 1D face-to-cell stencil...'
1737 pgrid => pregion%grid
1743 nullify(pgrid%f2cs1D)
1749 IF ( global%myProcid == masterproc .AND. &
1750 global%verbLevel > verbose_none )
THEN
1751 WRITE(stdout,
'(A,1X,A)') solver_name, &
1752 'Nullifying 1D face-to-cell stencil done.'
1790 TYPE(t_region
),
POINTER :: pregion
1797 TYPE(t_grid),
POINTER :: pgrid
1798 TYPE(t_patch),
POINTER :: ppatch
1805 global => pregion%global
1808 'RFLU_ModStencilsFaces.F90')
1810 IF ( global%myProcid == masterproc .AND. &
1811 global%verbLevel > verbose_none )
THEN
1812 WRITE(stdout,
'(A,1X,A)') solver_name, &
1813 'Nullifying face-to-cell stencil...'
1820 pgrid => pregion%grid
1832 IF ( global%myProcid == masterproc .AND. &
1833 global%verbLevel > verbose_none )
THEN
1834 WRITE(stdout,
'(A,1X,A)') solver_name, &
1835 'Nullifying face-to-cell stencil done.'
1878 INTEGER,
INTENT(IN) :: ordernominalinput
1879 TYPE(t_region
),
POINTER :: pregion
1885 INTEGER :: nbfacemembsmax,nlayersmax,ordernominal,stencilsizemax, &
1887 TYPE(t_grid),
POINTER :: pgrid
1894 global => pregion%global
1897 'RFLU_ModStencilsFaces.F90')
1899 IF ( global%myProcid == masterproc .AND. &
1900 global%verbLevel > verbose_none )
THEN
1901 WRITE(stdout,
'(A,1X,A)') solver_name, &
1902 'Setting 1D face-to-cell stencil information...'
1909 pgrid => pregion%grid
1917 ordernominal =
max(ordernominalinput,2)
1919 nlayersmax = ordernominal
1921 stencilsizemin = ordernominal
1922 stencilsizemax = ordernominal
1924 pgrid%f2csInfo%orderNominal = ordernominal
1925 pgrid%f2csInfo%nLayersMax = nlayersmax
1926 pgrid%f2csInfo%nBFaceMembsMax = nbfacemembsmax
1927 pgrid%f2csInfo%nCellMembsMax = stencilsizemax
1928 pgrid%f2csInfo%nCellMembsMin = stencilsizemin
1934 IF ( global%myProcid == masterproc .AND. &
1935 global%verbLevel > verbose_low )
THEN
1936 WRITE(stdout,
'(A,3X,A,1X,I3)') solver_name, &
1937 'Maximum allowed number of cell layers: ',nlayersmax
1938 WRITE(stdout,
'(A,3X,A,1X,I3)') solver_name, &
1939 'Minimum required number of cell members:',stencilsizemin
1940 WRITE(stdout,
'(A,3X,A,1X,I3)') solver_name, &
1941 'Maximum allowed number of cell members: ',stencilsizemax
1948 IF ( global%myProcid == masterproc .AND. &
1949 global%verbLevel > verbose_none )
THEN
1950 WRITE(stdout,
'(A,1X,A)') solver_name, &
1951 'Setting 1D face-to-cell stencil information done.'
1993 INTEGER,
INTENT(IN) :: ordernominalinput
1994 TYPE(t_region
),
POINTER :: pregion
2000 INTEGER :: nbfacemembsmax,nlayersmax,ordernominal,stencilsizemax, &
2002 TYPE(t_grid),
POINTER :: pgrid
2009 global => pregion%global
2012 'RFLU_ModStencilsFaces.F90')
2014 IF ( global%myProcid == masterproc .AND. &
2015 global%verbLevel > verbose_none )
THEN
2016 WRITE(stdout,
'(A,1X,A)') solver_name, &
2017 'Setting face-to-cell stencil information...'
2024 pgrid => pregion%grid
2032 ordernominal =
max(ordernominalinput,1)
2040 stencilsizemax = 10*stencilsizemin
2042 pgrid%f2csInfo%orderNominal = ordernominal
2043 pgrid%f2csInfo%nLayersMax = nlayersmax
2044 pgrid%f2csInfo%nBFaceMembsMax = nbfacemembsmax
2045 pgrid%f2csInfo%nCellMembsMax = stencilsizemax
2046 pgrid%f2csInfo%nCellMembsMin = stencilsizemin
2052 IF ( global%myProcid == masterproc .AND. &
2053 global%verbLevel > verbose_low )
THEN
2054 WRITE(stdout,
'(A,3X,A,1X,I3)') solver_name, &
2055 'Maximum allowed number of cell layers: ',nlayersmax
2056 WRITE(stdout,
'(A,3X,A,1X,I3)') solver_name, &
2057 'Minimum required number of cell members:',stencilsizemin
2058 WRITE(stdout,
'(A,3X,A,1X,I3)') solver_name, &
2059 'Maximum allowed number of cell members: ',stencilsizemax
2066 IF ( global%myProcid == masterproc .AND. &
2067 global%verbLevel > verbose_none )
THEN
2068 WRITE(stdout,
'(A,1X,A)') solver_name, &
2069 'Setting face-to-cell stencil information done.'
2110 INTEGER,
INTENT(IN) :: ordernominal
2111 TYPE(t_region
),
POINTER :: pregion
2123 global => pregion%global
2126 'RFLU_ModStencilsFaces.F90')
2132 SELECT CASE ( pregion%mixtInput%stencilDimensFaces )
2138 CALL
errorstop(global,err_reached_default,__line__)
subroutine, public rflu_addcelllayer(global, pGrid, stencilSizeMax, ixg, degr, x2csBeg, x2csEnd, x2cs)
subroutine rflu_buildf2cstencil_1d(pRegion)
subroutine, public rflu_buildf2cstencilwrapper(pRegion, constrInput)
subroutine, public rflu_setinfof2cstencilwrapper(pRegion, orderNominal)
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 rflu_setinfof2cstencil(pRegion, orderNominalInput)
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_destroylistcf2cstencil(pRegion)
subroutine rflu_destroyf2cstencil(pRegion)
subroutine rflu_buildf2cstencil(pRegion, addBFaces)
subroutine rflu_createf2cstencil_1d(pRegion)
subroutine, public rflu_addfacevertneighbs(global, pGrid, stencilSizeMax, f2v, degr, x2cs)
subroutine, public rflu_destroyf2cstencilwrapper(pRegion)
subroutine, public rflu_addbfaces(pRegion, nBFaceMembsMaxTemp, nCellMembs, cellMembs, nBFaceMembs, bFaceMembs)
INTEGER function rflu_computestencilsize(global, factor, order)
subroutine rflu_createf2cstencil(pRegion)
subroutine, public rflu_buildlistcf2cstencil(pRegion)
subroutine rflu_destroyf2cstencil_1d(pRegion)
subroutine rflu_nullifyf2cstencil(pRegion)
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
subroutine, public rflu_sortbfaces(pRegion, xyz, nBFaceMembs, bFaceMembs)
subroutine, public rflu_getopposingfaces(pRegion, iPatch, ifg, nFacesOpp, faceOppInfo)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine deregisterfunction(global)
subroutine rflu_nullifyf2cstencil_1d(pRegion)
subroutine, public rflu_createf2cstencilwrapper(pRegion)
subroutine rflu_setinfof2cstencil_1d(pRegion, orderNominalInput)