76 INTEGER,
PARAMETER,
PUBLIC :: DESTROY_FACE_INT = 1, &
77 DESTROY_FACE_EXT = 2, &
80 CHARACTER(CHRLEN) :: &
81 RCSIdentString =
'$RCSfile: RFLU_ModFaceList.F90,v $ $Revision: 1.43 $'
124 TYPE(t_region
),
POINTER :: pregion
130 INTEGER :: c1,c2,errorflag,iborder,icg,icgmax,icl,ifg,ifl,iloc, &
132 INTEGER,
DIMENSION(:,:),
ALLOCATABLE :: vc,vc2b
135 TYPE(t_grid),
POINTER :: pgrid
136 TYPE(t_patch),
POINTER :: ppatch
142 global => pregion%global
145 'RFLU_ModFaceList.F90')
147 IF ( global%myProcid == masterproc .AND. &
148 global%verbLevel >= verbose_high )
THEN
149 WRITE(stdout,
'(A,1X,A)') solver_name, &
150 'Building av-face-to-border list...'
157 pgrid => pregion%grid
169 DO ifg = pgrid%nFaces-pgrid%nFacesAV+1,pgrid%nFaces
170 c1 = pgrid%f2c(1,ifg)
171 c2 = pgrid%f2c(2,ifg)
173 IF ( c1 > pgrid%nCells )
THEN
174 icgmax =
max(c1,icgmax)
175 ELSE IF ( c2 > pgrid%nCells )
THEN
176 icgmax =
max(c2,icgmax)
179 WRITE(*,*)
'ERROR 1!'
192 DO iborder = 1,pgrid%nBorders
193 pborder => pgrid%borders(iborder)
195 DO icl = 1,pborder%nCellsRecv
196 IF ( pborder%icgRecv(icl) <= icgmax )
THEN
197 ncellsrecvtot = ncellsrecvtot + 1
202 ALLOCATE(vc(2,ncellsrecvtot),stat=errorflag)
203 global%error = errorflag
204 IF ( global%error /= err_none )
THEN
205 CALL
errorstop(global,err_allocate,__line__,
'vc')
208 ALLOCATE(vc2b(2,ncellsrecvtot),stat=errorflag)
209 global%error = errorflag
210 IF ( global%error /= err_none )
THEN
211 CALL
errorstop(global,err_allocate,__line__,
'vc2b')
220 DO iborder = 1,pgrid%nBorders
221 pborder => pgrid%borders(iborder)
223 DO icl = 1,pborder%nCellsRecv
224 IF ( pborder%icgRecv(icl) <= icgmax )
THEN
225 ncellsrecvtot = ncellsrecvtot + 1
227 vc(1,ncellsrecvtot) = pborder%icgRecv(icl)
228 vc(2,ncellsrecvtot) = ncellsrecvtot
230 vc2b(1,ncellsrecvtot) = iborder
231 vc2b(2,ncellsrecvtot) = icl
237 vc(2:2,1:ncellsrecvtot), &
244 DO ifg = pgrid%nFaces-pgrid%nFacesAV+1,pgrid%nFaces
245 c1 = pgrid%f2c(1,ifg)
246 c2 = pgrid%f2c(2,ifg)
248 IF ( c1 > pgrid%nCells )
THEN
250 ELSE IF ( c2 > pgrid%nCells )
THEN
254 WRITE(*,*)
'ERROR 2!'
261 IF ( iloc /= element_not_found )
THEN
264 ifl = ifg - (pgrid%nFaces-pgrid%nFacesAV)
266 pgrid%avf2b(1,ifl) = vc2b(1,icl)
267 pgrid%avf2b(2,ifl) = vc2b(2,icl)
271 WRITE(*,*)
'ERROR 3!'
281 DEALLOCATE(vc,stat=errorflag)
282 global%error = errorflag
283 IF ( global%error /= err_none )
THEN
284 CALL
errorstop(global,err_deallocate,__line__,
'vc')
287 DEALLOCATE(vc2b,stat=errorflag)
288 global%error = errorflag
289 IF ( global%error /= err_none )
THEN
290 CALL
errorstop(global,err_deallocate,__line__,
'vc2b')
297 IF ( global%myProcid == masterproc .AND. &
298 global%verbLevel >= verbose_high )
THEN
299 WRITE(stdout,
'(A,1X,A)') solver_name, &
300 'Building av-face-to-border list done.'
344 TYPE(t_region
),
POINTER :: pregion
350 INTEGER :: errorflag,iborder,icg,icl,ifg,ifl,iloc,ipatch
353 TYPE(t_grid),
POINTER :: pgrid
354 TYPE(t_patch),
POINTER :: ppatch
360 global => pregion%global
363 'RFLU_ModFaceList.F90')
365 IF ( global%myProcid == masterproc .AND. &
366 global%verbLevel >= verbose_high )
THEN
367 WRITE(stdout,
'(A,1X,A)') solver_name, &
368 'Building av-face-to-patch list...'
375 pgrid => pregion%grid
381 DO ipatch = 1,pgrid%nPatches
382 ppatch => pregion%patches(ipatch)
384 IF ( ppatch%nBCellsVirt > 0 )
THEN
385 ALLOCATE(ppatch%bvcSorted(ppatch%nBCellsVirt),stat=errorflag)
386 global%error = errorflag
387 IF ( global%error /= err_none )
THEN
388 CALL
errorstop(global,err_allocate,__line__,
'pPatch%bvcSorted')
391 DO icl = 1,ppatch%nBCellsVirt
392 ppatch%bvcSorted(icl) = ppatch%bvc(icl)
397 nullify(ppatch%bvcSorted)
405 DO ifl = 1,pgrid%nFacesAV
406 iborder = pgrid%avf2b(1,ifl)
407 pborder => pgrid%borders(iborder)
409 icl = pgrid%avf2b(2,ifl)
411 IF ( icl <= pborder%nCellsRecv )
THEN
412 icg = pborder%icgRecv(icl)
415 WRITE(*,*)
'ERROR! Exceeding dims of pBorder%icgRecv'
420 pgrid%avf2p(ifl) = crazy_value_int
422 patchloop:
DO ipatch = 1,pgrid%nPatches
423 ppatch => pregion%patches(ipatch)
425 IF ( ppatch%nBCellsVirt > 0 )
THEN
429 IF ( iloc /= element_not_found )
THEN
430 pgrid%avf2p(ifl) = ipatch
442 DO ipatch = 1,pgrid%nPatches
443 ppatch => pregion%patches(ipatch)
445 IF ( ppatch%nBCellsVirt > 0 )
THEN
446 DEALLOCATE(ppatch%bvcSorted,stat=errorflag)
447 global%error = errorflag
448 IF ( global%error /= err_none )
THEN
449 CALL
errorstop(global,err_allocate,__line__,
'pPatch%bvcSorted')
458 IF ( global%myProcid == masterproc .AND. &
459 global%verbLevel >= verbose_high )
THEN
460 WRITE(stdout,
'(A,1X,A)') solver_name, &
461 'Building av-face-to-patch list done.'
504 TYPE(t_region
),
POINTER :: pregion
510 INTEGER :: errorflag,icl,icg,ick,ifg,ifl,ipatch
512 TYPE(t_grid),
POINTER :: pgrid
513 TYPE(t_patch),
POINTER :: ppatch
519 global => pregion%global
522 'RFLU_ModFaceList.F90')
524 IF ( global%myProcid == masterproc .AND. &
525 global%verbLevel >= verbose_high )
THEN
526 WRITE(stdout,
'(A,1X,A)') solver_name,
'Building cell-to-face list...'
533 pgrid => pregion%grid
539 IF ( pgrid%nTetsTot > 0 )
THEN
540 DO icl = 1,pgrid%nTetsTot
542 pgrid%tet2f(1,ifl,icl) = c2f_init
543 pgrid%tet2f(2,ifl,icl) = c2f_init
548 IF ( pgrid%nHexsTot > 0 )
THEN
549 DO icl = 1,pgrid%nHexsTot
551 pgrid%hex2f(1,ifl,icl) = c2f_init
552 pgrid%hex2f(2,ifl,icl) = c2f_init
557 IF ( pgrid%nPrisTot > 0 )
THEN
558 DO icl = 1,pgrid%nPrisTot
560 pgrid%pri2f(1,ifl,icl) = c2f_init
561 pgrid%pri2f(2,ifl,icl) = c2f_init
566 IF ( pgrid%nPyrsTot > 0 )
THEN
567 DO icl = 1,pgrid%nPyrsTot
569 pgrid%pyr2f(1,ifl,icl) = c2f_init
570 pgrid%pyr2f(2,ifl,icl) = c2f_init
585 DO ifg = 1,pgrid%nFacesTot
587 icg = pgrid%f2c(icl,ifg)
590 IF ( ick /= cell_kind_ext .AND. ick /= cell_kind_bnd )
THEN
602 DO ipatch = 1,pgrid%nPatches
603 ppatch => pregion%patches(ipatch)
605 IF ( ppatch%bcType /= bc_periodic .AND. &
606 ppatch%bcType /= bc_symmetry )
THEN
607 DO ifl = 1,ppatch%nBFacesTot
608 icg = ppatch%bf2c(ifl)
620 IF ( global%checkLevel > check_none )
THEN
621 IF ( pgrid%nTetsTot > 0 )
THEN
622 DO icl = 1,pgrid%nTetsTot
624 IF ( pgrid%tet2f(1,ifl,icl) == c2f_init .OR. &
625 pgrid%tet2f(2,ifl,icl) == c2f_init )
THEN
626 CALL
errorstop(global,err_c2flist_invalid,__line__)
632 IF ( pgrid%nHexsTot > 0 )
THEN
633 DO icl = 1,pgrid%nHexsTot
635 IF ( pgrid%hex2f(1,ifl,icl) == c2f_init .OR. &
636 pgrid%hex2f(2,ifl,icl) == c2f_init )
THEN
637 CALL
errorstop(global,err_c2flist_invalid,__line__)
643 IF ( pgrid%nPrisTot > 0 )
THEN
644 DO icl = 1,pgrid%nPrisTot
646 IF ( pgrid%pri2f(1,ifl,icl) == c2f_init .OR. &
647 pgrid%pri2f(2,ifl,icl) == c2f_init )
THEN
648 CALL
errorstop(global,err_c2flist_invalid,__line__)
654 IF ( pgrid%nPyrsTot > 0 )
THEN
655 DO icl = 1,pgrid%nPyrsTot
657 IF ( pgrid%pyr2f(1,ifl,icl) == c2f_init .OR. &
658 pgrid%pyr2f(2,ifl,icl) == c2f_init )
THEN
659 CALL
errorstop(global,err_c2flist_invalid,__line__)
666 #ifdef CHECK_DATASTRUCT
671 WRITE(stdout,
'(A)') solver_name
672 WRITE(stdout,
'(A,1X,A)') solver_name,
'### START CHECK OUTPUT ###'
673 WRITE(stdout,
'(A,1X,A)') solver_name,
'Face-to-cell list'
675 IF ( pgrid%nTetsTot > 0 )
THEN
676 WRITE(stdout,
'(A,1X,A)') solver_name,
'Tetrahedra:'
677 DO icl = 1,pgrid%nTetsTot
679 WRITE(stdout,
'(A,4(1X,I6))') solver_name,icl,ifl, &
680 pgrid%tet2f(1:2,ifl,icl)
685 IF ( pgrid%nHexsTot > 0 )
THEN
686 WRITE(stdout,
'(A,1X,A)') solver_name,
'Hexahedra:'
687 DO icl = 1,pgrid%nHexsTot
689 WRITE(stdout,
'(A,4(1X,I6))') solver_name,icl,ifl, &
690 pgrid%hex2f(1:2,ifl,icl)
695 IF ( pgrid%nPrisTot > 0 )
THEN
696 WRITE(stdout,
'(A,1X,A)') solver_name,
'Prisms:'
697 DO icl = 1,pgrid%nPrisTot
699 WRITE(stdout,
'(A,4(1X,I6))') solver_name,icl,ifl, &
700 pgrid%pri2f(1:2,ifl,icl)
705 IF ( pgrid%nPyrsTot > 0 )
THEN
706 WRITE(stdout,
'(A,1X,A)') solver_name,
'Pyramids:'
707 DO icl = 1,pgrid%nPyrsTot
709 WRITE(stdout,
'(A,4(1X,I6))') solver_name,icl,ifl, &
710 pgrid%pyr2f(1:2,ifl,icl)
715 WRITE(stdout,
'(A,1X,A)') solver_name,
'### END CHECK OUTPUT ###'
716 WRITE(stdout,
'(A)') solver_name
723 IF ( global%myProcid == masterproc .AND. &
724 global%verbLevel >= verbose_high )
THEN
725 WRITE(stdout,
'(A,1X,A)') solver_name,
'Building cell-to-face list done.'
772 TYPE(t_region
),
POINTER :: pregion
778 INTEGER :: c1,c1k,c1t,c2,c2k,c2t,errorflag,fcntr,ftype,facetype,fksum, &
779 fvsize,icg,icl,ict,ifc,ifg,ifk,ifl,ipatch,iq,it,
key, &
780 nbfacesquad,nbfacestri,nfacesint,nfacesquad,nfacestri, &
781 nhexslow,nhexsupp,nprislow,nprisupp,npyrslow,npyrsupp, &
782 ntetslow,ntetsupp,v1g,v2g,v3g,v4g
784 INTEGER :: fkcntr(face_kind_aa:face_kind_ab,face_type_tri:face_type_quad), &
785 fkoffs(face_kind_aa:face_kind_ab)
786 INTEGER,
DIMENSION(:),
ALLOCATABLE :: fkind
787 TYPE(t_grid),
POINTER :: pgrid
788 TYPE(t_patch),
POINTER :: ppatch
799 global => pregion%global
802 'RFLU_ModFaceList.F90')
804 IF ( global%myProcid == masterproc .AND. &
805 global%verbLevel >= verbose_high )
THEN
806 WRITE(stdout,
'(A,1X,A)') solver_name,
'Building face list...'
807 WRITE(stdout,
'(A,3X,A,1X,I5.5)') solver_name,
'Global region:', &
808 pregion%iRegionGlobal
809 WRITE(stdout,
'(A,3X,A)') solver_name,
'Building hash table...'
816 pgrid => pregion%grid
831 IF ( global%myProcid == masterproc .AND. &
832 global%verbLevel >= verbose_high )
THEN
833 WRITE(stdout,
'(A,5X,A,12X,I9)') solver_name,
'Hash table size:', &
841 IF ( global%myProcid == masterproc .AND. &
842 global%verbLevel >= verbose_high )
THEN
843 WRITE(stdout,
'(A,5X,A)') solver_name,
'Looping over cell types...'
850 IF ( pgrid%nTetsTot /= 0 )
THEN
851 IF ( global%myProcid == masterproc .AND. &
852 global%verbLevel >= verbose_high )
THEN
853 WRITE(stdout,
'(A,7X,A)') solver_name,
'Tetrahedra...'
859 DO icl = 1,pgrid%nTetsTot
860 icg = pgrid%tet2CellGlob(icl)
863 fv(1) = pgrid%tet2v(f2vtet(1,ifl),icl)
864 fv(2) = pgrid%tet2v(f2vtet(2,ifl),icl)
865 fv(3) = pgrid%tet2v(f2vtet(3,ifl),icl)
871 IF ( facetype == face_type_new )
THEN
872 nfacestri = nfacestri + 1
881 IF ( pgrid%nHexsTot /= 0 )
THEN
882 IF ( global%myProcid == masterproc .AND. &
883 global%verbLevel >= verbose_high )
THEN
884 WRITE(stdout,
'(A,7X,A)') solver_name,
'Hexahedra...'
890 DO icl = 1,pgrid%nHexsTot
891 icg = pgrid%hex2CellGlob(icl)
894 fv(1) = pgrid%hex2v(f2vhex(1,ifl),icl)
895 fv(2) = pgrid%hex2v(f2vhex(2,ifl),icl)
896 fv(3) = pgrid%hex2v(f2vhex(3,ifl),icl)
897 fv(4) = pgrid%hex2v(f2vhex(4,ifl),icl)
903 IF ( facetype == face_type_new )
THEN
904 nfacesquad = nfacesquad + 1
913 IF ( pgrid%nPrisTot /= 0 )
THEN
914 IF ( global%myProcid == masterproc .AND. &
915 global%verbLevel >= verbose_high )
THEN
916 WRITE(stdout,
'(A,7X,A)') solver_name,
'Prisms...'
920 DO icl = 1,pgrid%nPrisTot
921 icg = pgrid%pri2CellGlob(icl)
925 fv(1) = pgrid%pri2v(f2vpri(1,ifl),icl)
926 fv(2) = pgrid%pri2v(f2vpri(2,ifl),icl)
927 fv(3) = pgrid%pri2v(f2vpri(3,ifl),icl)
929 IF ( f2vpri(4,ifl) /= vert_none )
THEN
931 fv(4) = pgrid%pri2v(f2vpri(4,ifl),icl)
938 IF ( facetype == face_type_new )
THEN
939 IF ( fvsize == 4 )
THEN
940 nfacesquad = nfacesquad + 1
942 nfacestri = nfacestri + 1
952 IF ( pgrid%nPyrsTot /= 0 )
THEN
953 IF ( global%myProcid == masterproc .AND. &
954 global%verbLevel >= verbose_high )
THEN
955 WRITE(stdout,
'(A,7X,A)') solver_name,
'Pyramids...'
959 DO icl = 1,pgrid%nPyrsTot
960 icg = pgrid%pyr2CellGlob(icl)
964 fv(1) = pgrid%pyr2v(f2vpyr(1,ifl),icl)
965 fv(2) = pgrid%pyr2v(f2vpyr(2,ifl),icl)
966 fv(3) = pgrid%pyr2v(f2vpyr(3,ifl),icl)
968 IF ( f2vpyr(4,ifl) /= vert_none )
THEN
970 fv(4) = pgrid%pyr2v(f2vpyr(4,ifl),icl)
977 IF ( facetype == face_type_new )
THEN
978 IF ( fvsize == 3 )
THEN
979 nfacestri = nfacestri + 1
981 nfacesquad = nfacesquad + 1
987 IF ( global%myProcid == masterproc .AND. &
988 global%verbLevel >= verbose_high )
THEN
989 WRITE(stdout,
'(A,5X,A,5X,I9)') solver_name,
'Hash table collisions: ', &
1000 nfacesint = pgrid%nFacesTot - pgrid%nBFacesTot
1012 IF ( global%myProcid == masterproc .AND. &
1013 global%verbLevel >= verbose_high )
THEN
1014 WRITE(stdout,
'(A,3X,A)') solver_name,
'Building boundary face lists...'
1017 DO ipatch = 1,pgrid%nPatches
1018 ppatch => pregion%patches(ipatch)
1020 nbfacestri = nbfacestri + ppatch%nBTrisTot
1021 nbfacesquad = nbfacesquad + ppatch%nBQuadsTot
1023 IF ( global%myProcid == masterproc .AND. &
1024 global%verbLevel >= verbose_high )
THEN
1025 WRITE(stdout,
'(A,5X,A,I4,1X,A,1X,I4,A)') solver_name,
'Patch: ',ipatch, &
1026 '(Global patch:',ppatch%iPatchGlobal,
')'
1028 WRITE(stdout,
'(A,7X,A,8X,2(1X,I9))') solver_name, &
1029 'Triangular faces:', &
1031 ppatch%nBTrisTot-ppatch%nBTris
1032 WRITE(stdout,
'(A,7X,A,5X,2(1X,I9))') solver_name, &
1033 'Quadrilateral faces:', &
1035 ppatch%nBQuadsTot-ppatch%nBQuads
1036 WRITE(stdout,
'(A,7X,A,3X,2(1X,I9))') solver_name, &
1037 'Total number of faces:', &
1039 ppatch%nBFacesTot-ppatch%nBFaces
1048 DO it = 1,ppatch%nBTrisTot
1049 fv(1) = ppatch%bTri2v(1,it)
1050 fv(2) = ppatch%bTri2v(2,it)
1051 fv(3) = ppatch%bTri2v(3,it)
1060 IF ( it > ppatch%nBTris )
THEN
1061 fcntr = it + ppatch%nBQuads
1064 ppatch%bf2c( fcntr) = icg
1065 ppatch%bf2v(1,fcntr) = ppatch%bTri2v(1,it)
1066 ppatch%bf2v(2,fcntr) = ppatch%bTri2v(2,it)
1067 ppatch%bf2v(3,fcntr) = ppatch%bTri2v(3,it)
1076 DO iq = 1,ppatch%nBQuadsTot
1077 fv(1) = ppatch%bQuad2v(1,iq)
1078 fv(2) = ppatch%bQuad2v(2,iq)
1079 fv(3) = ppatch%bQuad2v(3,iq)
1080 fv(4) = ppatch%bQuad2v(4,iq)
1087 IF ( iq <= ppatch%nBQuads )
THEN
1088 fcntr = iq + ppatch%nBTris
1090 fcntr = iq + ppatch%nBTrisTot
1093 ppatch%bf2c( fcntr) = icg
1094 ppatch%bf2v(1,fcntr) = ppatch%bQuad2v(1,iq)
1095 ppatch%bf2v(2,fcntr) = ppatch%bQuad2v(2,iq)
1096 ppatch%bf2v(3,fcntr) = ppatch%bQuad2v(3,iq)
1097 ppatch%bf2v(4,fcntr) = ppatch%bQuad2v(4,iq)
1111 DEALLOCATE(pgrid%f2v,stat=errorflag)
1112 global%error = errorflag
1113 IF ( global%error /= err_none )
THEN
1114 CALL
errorstop(global,err_deallocate,__line__,
'pGrid%f2v')
1126 IF ( global%myProcid == masterproc .AND. &
1127 global%verbLevel >= verbose_high )
THEN
1128 WRITE(stdout,
'(A,3X,A)') solver_name,
'Determining face statistics...'
1131 fkcntr(face_kind_aa,face_type_tri:face_type_quad) = 0
1132 fkcntr(face_kind_av,face_type_tri:face_type_quad) = 0
1133 fkcntr(face_kind_vv,face_type_tri:face_type_quad) = 0
1134 fkcntr(face_kind_vb,face_type_tri:face_type_quad) = 0
1135 fkcntr(face_kind_vx,face_type_tri:face_type_quad) = 0
1136 fkcntr(face_kind_ab,face_type_tri:face_type_quad) = 0
1138 DO ifc = 1,pgrid%nFacesTot
1139 c1 = pgrid%f2c(1,ifc)
1140 c2 = pgrid%f2c(2,ifc)
1142 ifl = pgrid%f2c(3,ifc)
1146 CASE ( cell_type_tet )
1147 ftype = face_type_tri
1148 CASE ( cell_type_hex )
1149 ftype = face_type_quad
1150 CASE ( cell_type_pri )
1151 IF ( f2vpri(4,ifl) /= vert_none )
THEN
1152 ftype = face_type_quad
1154 ftype = face_type_tri
1156 CASE ( cell_type_pyr )
1157 IF ( f2vpyr(4,ifl) == vert_none )
THEN
1158 ftype = face_type_tri
1160 ftype = face_type_quad
1163 CALL
errorstop(global,err_reached_default,__line__)
1170 CASE ( face_kind_aa )
1171 fkcntr(face_kind_aa,ftype) = fkcntr(face_kind_aa,ftype) + 1
1172 CASE ( face_kind_av )
1173 fkcntr(face_kind_av,ftype) = fkcntr(face_kind_av,ftype) + 1
1174 CASE ( face_kind_vv )
1175 fkcntr(face_kind_vv,ftype) = fkcntr(face_kind_vv,ftype) + 1
1176 CASE ( face_kind_vb )
1177 fkcntr(face_kind_vb,ftype) = fkcntr(face_kind_vb,ftype) + 1
1178 CASE ( face_kind_ab )
1179 fkcntr(face_kind_ab,ftype) = fkcntr(face_kind_ab,ftype) + 1
1180 CASE ( face_kind_vx )
1181 fkcntr(face_kind_vx,ftype) = fkcntr(face_kind_vx,ftype) + 1
1183 CALL
errorstop(global,err_reached_default,__line__)
1191 IF ( global%myProcid == masterproc .AND. &
1192 global%verbLevel >= verbose_high )
THEN
1193 WRITE(stdout,
'(A,5X,A)') solver_name,
'Face-type statistics:'
1194 WRITE(stdout,
'(A,7X,A,5X,I9)') solver_name,
'Total faces: ', &
1196 WRITE(stdout,
'(A,9X,A,3X,I9)') solver_name,
'Triangular faces: ', &
1198 WRITE(stdout,
'(A,9X,A,3X,I9)') solver_name,
'Quadrilateral faces: ', &
1200 WRITE(stdout,
'(A,7X,A,5X,I9)') solver_name,
'Total boundary faces: ', &
1202 WRITE(stdout,
'(A,9X,A,3X,I9)') solver_name,
'Triangular faces: ', &
1204 WRITE(stdout,
'(A,9X,A,3X,I9)') solver_name,
'Quadrilateral faces: ', &
1206 WRITE(stdout,
'(A,7X,A,5X,I9)') solver_name,
'Non-boundary faces: ', &
1208 WRITE(stdout,
'(A,9X,A,3X,I9)') solver_name,
'Triangular faces: ', &
1209 nfacestri - nbfacestri
1210 WRITE(stdout,
'(A,9X,A,3X,I9)') solver_name,
'Quadrilateral faces: ', &
1211 nfacesquad - nbfacesquad
1212 WRITE(stdout,
'(A,5X,A)') solver_name,
'Face-kind statistics:'
1213 WRITE(stdout,
'(A,7X,A,5X,I9)') solver_name,
'Actual-actual faces: ', &
1214 fkcntr(face_kind_aa,face_type_tri ) + &
1215 fkcntr(face_kind_aa,face_type_quad)
1216 WRITE(stdout,
'(A,9X,A,3X,I9)') solver_name,
'Triangular faces: ', &
1217 fkcntr(face_kind_aa,face_type_tri)
1218 WRITE(stdout,
'(A,9X,A,3X,I9)') solver_name,
'Quadrilateral faces: ', &
1219 fkcntr(face_kind_aa,face_type_quad)
1220 WRITE(stdout,
'(A,7X,A,5X,I9)') solver_name,
'Actual-virtual faces: ', &
1221 fkcntr(face_kind_av,face_type_tri ) + &
1222 fkcntr(face_kind_av,face_type_quad)
1223 WRITE(stdout,
'(A,9X,A,3X,I9)') solver_name,
'Triangular faces: ', &
1224 fkcntr(face_kind_av,face_type_tri)
1225 WRITE(stdout,
'(A,9X,A,3X,I9)') solver_name,
'Quadrilateral faces: ', &
1226 fkcntr(face_kind_av,face_type_quad)
1227 WRITE(stdout,
'(A,7X,A,5X,I9)') solver_name,
'Virtual-virtual faces: ', &
1228 fkcntr(face_kind_vv,face_type_tri ) + &
1229 fkcntr(face_kind_vv,face_type_quad)
1230 WRITE(stdout,
'(A,9X,A,3X,I9)') solver_name,
'Triangular faces: ', &
1231 fkcntr(face_kind_vv,face_type_tri)
1232 WRITE(stdout,
'(A,9X,A,3X,I9)') solver_name,
'Quadrilateral faces: ', &
1233 fkcntr(face_kind_vv,face_type_quad)
1234 WRITE(stdout,
'(A,7X,A,5X,I9)') solver_name,
'Virtual-boundary faces:', &
1235 fkcntr(face_kind_vb,face_type_tri ) + &
1236 fkcntr(face_kind_vb,face_type_quad)
1237 WRITE(stdout,
'(A,9X,A,3X,I9)') solver_name,
'Triangular faces: ', &
1238 fkcntr(face_kind_vb,face_type_tri)
1239 WRITE(stdout,
'(A,9X,A,3X,I9)') solver_name,
'Quadrilateral faces: ', &
1240 fkcntr(face_kind_vb,face_type_quad)
1241 WRITE(stdout,
'(A,7X,A,5X,I9)') solver_name,
'Actual-boundary faces: ', &
1242 fkcntr(face_kind_ab,face_type_tri ) + &
1243 fkcntr(face_kind_ab,face_type_quad)
1244 WRITE(stdout,
'(A,9X,A,3X,I9)') solver_name,
'Triangular faces: ', &
1245 fkcntr(face_kind_ab,face_type_tri)
1246 WRITE(stdout,
'(A,9X,A,3X,I9)') solver_name,
'Quadrilateral faces: ', &
1247 fkcntr(face_kind_ab,face_type_quad)
1248 WRITE(stdout,
'(A,7X,A,5X,I9)') solver_name,
'Virtual-external faces:', &
1249 fkcntr(face_kind_vx,face_type_tri ) + &
1250 fkcntr(face_kind_vx,face_type_quad)
1251 WRITE(stdout,
'(A,9X,A,3X,I9)') solver_name,
'Triangular faces: ', &
1252 fkcntr(face_kind_vx,face_type_tri)
1253 WRITE(stdout,
'(A,9X,A,3X,I9)') solver_name,
'Quadrilateral faces: ', &
1254 fkcntr(face_kind_vx,face_type_quad)
1257 IF ( global%myProcid == masterproc .AND. &
1258 global%verbLevel >= verbose_high )
THEN
1259 WRITE(stdout,
'(A,3X,A)') solver_name,
'Determining face statistics done.'
1266 IF ( global%myProcid == masterproc .AND. &
1267 global%verbLevel >= verbose_high )
THEN
1268 WRITE(stdout,
'(A,3X,A)') solver_name,
'Building non-boundary face '// &
1276 fkoffs(face_kind_aa) = 0
1277 fkoffs(face_kind_av) = fkcntr(face_kind_aa,face_type_tri ) &
1278 + fkcntr(face_kind_aa,face_type_quad)
1279 fkoffs(face_kind_vv) = fkoffs(face_kind_av) &
1280 + fkcntr(face_kind_av,face_type_tri ) &
1281 + fkcntr(face_kind_av,face_type_quad)
1282 fkoffs(face_kind_vx) = fkoffs(face_kind_vv) &
1283 + fkcntr(face_kind_vv,face_type_tri ) &
1284 + fkcntr(face_kind_vv,face_type_quad)
1293 pgrid%nFaces = fkcntr(face_kind_aa,face_type_tri ) &
1294 + fkcntr(face_kind_aa,face_type_quad) &
1295 + fkcntr(face_kind_av,face_type_tri ) &
1296 + fkcntr(face_kind_av,face_type_quad)
1298 pgrid%nFacesAV = fkcntr(face_kind_av,face_type_tri ) &
1299 + fkcntr(face_kind_av,face_type_quad)
1300 pgrid%nFacesVV = fkcntr(face_kind_vv,face_type_tri ) &
1301 + fkcntr(face_kind_vv,face_type_quad)
1303 nfacesint = fkcntr(face_kind_aa,face_type_tri ) &
1304 + fkcntr(face_kind_aa,face_type_quad) &
1305 + fkcntr(face_kind_av,face_type_tri ) &
1306 + fkcntr(face_kind_av,face_type_quad) &
1307 + fkcntr(face_kind_vv,face_type_tri ) &
1308 + fkcntr(face_kind_vv,face_type_quad) &
1309 + fkcntr(face_kind_vx,face_type_tri ) &
1310 + fkcntr(face_kind_vx,face_type_quad)
1312 pgrid%nBFaces = fkcntr(face_kind_ab,face_type_tri ) &
1313 + fkcntr(face_kind_ab,face_type_quad)
1315 pgrid%nBFacesTot = fkcntr(face_kind_ab,face_type_tri ) &
1316 + fkcntr(face_kind_ab,face_type_quad) &
1317 + fkcntr(face_kind_vb,face_type_tri ) &
1318 + fkcntr(face_kind_vb,face_type_quad)
1326 ALLOCATE(pgrid%f2cTemp(2,nfacesint),stat=errorflag)
1327 IF ( global%error /= err_none )
THEN
1328 CALL
errorstop(global,err_allocate,__line__,
'pGrid%f2cTemp')
1331 DO ifc = 1,nfacesint
1332 pgrid%f2cTemp(1,ifc) = 0
1333 pgrid%f2cTemp(2,ifc) = 0
1336 ALLOCATE(pgrid%f2vTemp(4,nfacesint),stat=errorflag)
1337 global%error = errorflag
1338 IF ( global%error /= err_none )
THEN
1339 CALL
errorstop(global,err_allocate,__line__,
'pGrid%f2vTemp')
1342 DO ifc = 1,nfacesint
1343 pgrid%f2vTemp(1,ifc) = 0
1344 pgrid%f2vTemp(2,ifc) = 0
1345 pgrid%f2vTemp(3,ifc) = 0
1346 pgrid%f2vTemp(4,ifc) = 0
1351 fkcntr(face_kind_aa,face_type_tri:face_type_quad) = 0
1352 fkcntr(face_kind_av,face_type_tri:face_type_quad) = 0
1353 fkcntr(face_kind_vv,face_type_tri:face_type_quad) = 0
1354 fkcntr(face_kind_vx,face_type_tri:face_type_quad) = 0
1360 DO ifg = 1,pgrid%nFacesTot
1366 c1 = pgrid%f2c(1,ifg)
1367 c2 = pgrid%f2c(2,ifg)
1377 IF ( (ifk /= face_kind_ab) .AND. (ifk /= face_kind_vb) )
THEN
1378 ict = pgrid%cellGlob2Loc(1,c1)
1379 icl = pgrid%cellGlob2Loc(2,c1)
1380 ifl = pgrid%f2c(3,ifg)
1383 CASE ( cell_type_tet )
1384 v1g = pgrid%tet2v(f2vtet(1,ifl),icl)
1385 v2g = pgrid%tet2v(f2vtet(2,ifl),icl)
1386 v3g = pgrid%tet2v(f2vtet(3,ifl),icl)
1388 CASE ( cell_type_hex )
1389 v1g = pgrid%hex2v(f2vhex(1,ifl),icl)
1390 v2g = pgrid%hex2v(f2vhex(2,ifl),icl)
1391 v3g = pgrid%hex2v(f2vhex(3,ifl),icl)
1392 v4g = pgrid%hex2v(f2vhex(4,ifl),icl)
1393 CASE ( cell_type_pri )
1394 v1g = pgrid%pri2v(f2vpri(1,ifl),icl)
1395 v2g = pgrid%pri2v(f2vpri(2,ifl),icl)
1396 v3g = pgrid%pri2v(f2vpri(3,ifl),icl)
1399 IF ( f2vpri(4,ifl) /= vert_none )
THEN
1400 v4g = pgrid%pri2v(f2vpri(4,ifl),icl)
1402 CASE ( cell_type_pyr )
1403 v1g = pgrid%pyr2v(f2vpyr(1,ifl),icl)
1404 v2g = pgrid%pyr2v(f2vpyr(2,ifl),icl)
1405 v3g = pgrid%pyr2v(f2vpyr(3,ifl),icl)
1408 IF ( f2vpyr(4,ifl) /= vert_none )
THEN
1409 v4g = pgrid%pyr2v(f2vpyr(4,ifl),icl)
1412 CALL
errorstop(global,err_reached_default,__line__)
1419 fkcntr(ifk,face_type_tri) = fkcntr(ifk,face_type_tri) + 1
1420 fcntr = fkcntr(ifk,face_type_tri) + fkoffs(ifk)
1422 pgrid%f2cTemp(1,fcntr) = pgrid%f2c(1,ifg)
1423 pgrid%f2cTemp(2,fcntr) = pgrid%f2c(2,ifg)
1425 pgrid%f2vTemp(1,fcntr) = v1g
1426 pgrid%f2vTemp(2,fcntr) = v2g
1427 pgrid%f2vTemp(3,fcntr) = v3g
1428 pgrid%f2vTemp(4,fcntr) = v4g
1436 fksum = fkcntr(face_kind_aa,face_type_tri) &
1437 + fkcntr(face_kind_av,face_type_tri) &
1438 + fkcntr(face_kind_vv,face_type_tri) &
1439 + fkcntr(face_kind_vx,face_type_tri)
1441 IF ( fksum /= nfacesint )
THEN
1442 CALL
errorstop(global,err_nfaces_wrong,__line__)
1445 pgrid%nFacesTot = nfacesint
1451 DEALLOCATE(pgrid%f2c,stat=errorflag)
1452 global%error = errorflag
1453 IF ( global%error /= err_none )
THEN
1454 CALL
errorstop(global,err_deallocate,__line__,
'pGrid%f2c')
1461 ALLOCATE(pgrid%f2c(2,pgrid%nFacesTot),stat=errorflag)
1462 IF ( global%error /= err_none )
THEN
1463 CALL
errorstop(global,err_allocate,__line__,
'pGrid%f2c')
1466 DO ifc = 1,pgrid%nFacesTot
1467 pgrid%f2c(1,ifc) = pgrid%f2cTemp(1,ifc)
1468 pgrid%f2c(2,ifc) = pgrid%f2cTemp(2,ifc)
1471 DEALLOCATE(pgrid%f2cTemp,stat=errorflag)
1472 global%error = errorflag
1473 IF ( global%error /= err_none )
THEN
1474 CALL
errorstop(global,err_deallocate,__line__,
'pGrid%f2cTemp')
1477 ALLOCATE(pgrid%f2v(4,pgrid%nFacesTot),stat=errorflag)
1478 global%error = errorflag
1479 IF ( global%error /= err_none )
THEN
1480 CALL
errorstop(global,err_allocate,__line__,
'pGrid%f2v')
1483 DO ifc = 1,pgrid%nFacesTot
1484 pgrid%f2v(1,ifc) = pgrid%f2vTemp(1,ifc)
1485 pgrid%f2v(2,ifc) = pgrid%f2vTemp(2,ifc)
1486 pgrid%f2v(3,ifc) = pgrid%f2vTemp(3,ifc)
1487 pgrid%f2v(4,ifc) = pgrid%f2vTemp(4,ifc)
1490 DEALLOCATE(pgrid%f2vTemp,stat=errorflag)
1491 global%error = errorflag
1492 IF ( global%error /= err_none )
THEN
1493 CALL
errorstop(global,err_deallocate,__line__,
'pGrid%f2vTemp')
1496 #ifdef CHECK_DATASTRUCT
1501 WRITE(stdout,
'(A)') solver_name
1502 WRITE(stdout,
'(A,1X,A)') solver_name,
'### START CHECK OUTPUT ###'
1504 WRITE(stdout,
'(A,1X,A)') solver_name,
'Face neighbours and vertices:'
1506 DO ifc = 1,pgrid%nFacesTot
1507 WRITE(stdout,
'(A,7(1X,I6))') solver_name,ifc,pgrid%f2c(1:2,ifc), &
1511 WRITE(stdout,
'(A,1X,A)') solver_name,
'### END CHECK OUTPUT ###'
1512 WRITE(stdout,
'(A)') solver_name
1514 IF ( pgrid%nPatches > 0 )
THEN
1515 WRITE(stdout,
'(A,1X,A)') solver_name,
'### START CHECK OUTPUT ###'
1517 DO ipatch = 1,pgrid%nPatches
1518 ppatch => pregion%patches(ipatch)
1519 WRITE(stdout,
'(A,1X,A,1X,I6)') solver_name,
'Patch:',ipatch
1521 WRITE(stdout,
'(A,3X,A)') solver_name,
'Face neighbour and vertices:'
1523 DO ifc = 1,ppatch%nBFacesTot
1524 WRITE(stdout,
'(A,6(1X,I6))') solver_name,ifc,ppatch%bf2c(ifc), &
1525 ppatch%bf2v(1:4,ifc)
1529 WRITE(stdout,
'(A,1X,A)') solver_name,
'### END CHECK OUTPUT ###'
1530 WRITE(stdout,
'(A)') solver_name
1538 IF ( global%myProcid == masterproc .AND. &
1539 global%verbLevel >= verbose_high )
THEN
1540 WRITE(stdout,
'(A,1X,A)') solver_name,
'Building face list done.'
1581 TYPE(t_region
),
POINTER :: pregion
1587 INTEGER :: errorflag
1588 TYPE(t_grid),
POINTER :: pgrid
1595 global => pregion%global
1598 'RFLU_ModFaceList.F90')
1600 IF ( global%myProcid == masterproc .AND. &
1601 global%verbLevel >= verbose_high )
THEN
1602 WRITE(stdout,
'(A,1X,A)') solver_name,
'Creating av-face-to-border list...'
1615 pgrid => pregion%grid
1621 ALLOCATE(pgrid%avf2b(2,pgrid%nFacesAV),stat=errorflag)
1622 global%error = errorflag
1623 IF ( global%error /= err_none )
THEN
1624 CALL
errorstop(global,err_allocate,__line__,
'pGrid%avf2b')
1631 IF ( global%myProcid == masterproc .AND. &
1632 global%verbLevel >= verbose_high )
THEN
1633 WRITE(stdout,
'(A,1X,A)') solver_name, &
1634 'Creating av-face-to-border list done.'
1674 TYPE(t_region
),
POINTER :: pregion
1680 INTEGER :: errorflag
1681 TYPE(t_grid),
POINTER :: pgrid
1688 global => pregion%global
1691 'RFLU_ModFaceList.F90')
1693 IF ( global%myProcid == masterproc .AND. &
1694 global%verbLevel >= verbose_high )
THEN
1695 WRITE(stdout,
'(A,1X,A)') solver_name,
'Creating av-face-to-patch list...'
1708 pgrid => pregion%grid
1714 ALLOCATE(pgrid%avf2p(pgrid%nFacesAV),stat=errorflag)
1715 global%error = errorflag
1716 IF ( global%error /= err_none )
THEN
1717 CALL
errorstop(global,err_allocate,__line__,
'pGrid%avf2p')
1724 IF ( global%myProcid == masterproc .AND. &
1725 global%verbLevel >= verbose_high )
THEN
1726 WRITE(stdout,
'(A,1X,A)') solver_name, &
1727 'Creating av-face-to-patch list done.'
1767 TYPE(t_region
),
POINTER :: pregion
1773 INTEGER :: errorflag
1774 TYPE(t_grid),
POINTER :: pgrid
1781 global => pregion%global
1784 'RFLU_ModFaceList.F90')
1786 IF ( global%myProcid == masterproc .AND. &
1787 global%verbLevel >= verbose_high )
THEN
1788 WRITE(stdout,
'(A,1X,A)') solver_name,
'Creating cell-to-face list...'
1801 pgrid => pregion%grid
1807 IF ( pgrid%nTetsTot > 0 )
THEN
1808 ALLOCATE(pgrid%tet2f(2,4,pgrid%nTetsTot),stat=errorflag)
1809 global%error = errorflag
1810 IF ( global%error /= err_none )
THEN
1811 CALL
errorstop(global,err_allocate,__line__,
'pGrid%tet2f')
1815 IF ( pgrid%nHexsTot > 0 )
THEN
1816 ALLOCATE(pgrid%hex2f(2,6,pgrid%nHexsTot),stat=errorflag)
1817 global%error = errorflag
1818 IF ( global%error /= err_none )
THEN
1819 CALL
errorstop(global,err_allocate,__line__,
'pGrid%hex2f')
1823 IF ( pgrid%nPrisTot > 0 )
THEN
1824 ALLOCATE(pgrid%pri2f(2,5,pgrid%nPrisTot),stat=errorflag)
1825 global%error = errorflag
1826 IF ( global%error /= err_none )
THEN
1827 CALL
errorstop(global,err_allocate,__line__,
'pGrid%pri2f')
1831 IF ( pgrid%nPyrsTot > 0 )
THEN
1832 ALLOCATE(pgrid%pyr2f(2,5,pgrid%nPyrsTot),stat=errorflag)
1833 global%error = errorflag
1834 IF ( global%error /= err_none )
THEN
1835 CALL
errorstop(global,err_allocate,__line__,
'pGrid%pyr2f')
1843 IF ( global%myProcid == masterproc .AND. &
1844 global%verbLevel >= verbose_high )
THEN
1845 WRITE(stdout,
'(A,1X,A)') solver_name,
'Creating cell-to-face list done.'
1890 TYPE(t_region
),
POINTER :: pregion
1896 INTEGER :: errorflag,ifc,ipatch,nbfaces
1897 TYPE(t_grid),
POINTER :: pgrid
1899 TYPE(t_patch),
POINTER :: ppatch
1905 global => pregion%global
1908 'RFLU_ModFaceList.F90')
1910 IF ( global%myProcid == masterproc .AND. &
1911 global%verbLevel >= verbose_high )
THEN
1912 WRITE(stdout,
'(A,1X,A)') solver_name,
'Creating face list...'
1925 pgrid => pregion%grid
1939 DO ipatch = 1,pgrid%nPatches
1940 ppatch => pregion%patches(ipatch)
1942 nbfaces = nbfaces + ppatch%nBTrisTot + ppatch%nBQuadsTot
1949 pgrid%nFacesEst = nbfaces + 2*pgrid%nTetsTot + 3*pgrid%nHexsTot &
1950 + 5*pgrid%nPrisTot/2
1952 IF ( nbfaces/
REAL(pGrid%nFacesEst,KIND=RFREAL) > 0.8_rfreal .OR. &
1953 nbfaces/
REAL(pGrid%nFacesEst,KIND=RFREAL) < 0.3_rfreal ) then
1954 pgrid%nFacesEst = 2*pgrid%nFacesEst
1956 IF ( global%myProcid == masterproc .AND. &
1957 global%verbLevel >= verbose_high )
THEN
1958 WRITE(stdout,
'(A,3X,A,1X,A)') solver_name,
'Corrected estimate', &
1959 'of number of faces.'
1963 IF ( global%myProcid == masterproc .AND. &
1964 global%verbLevel >= verbose_high )
THEN
1965 WRITE(stdout,
'(A,3X,A,3X,I9)') solver_name,
'Estimated number of '// &
1966 'faces: ',pgrid%nFacesEst
1973 ALLOCATE(pgrid%f2c(4,pgrid%nFacesEst),stat=errorflag)
1974 global%error = errorflag
1975 IF ( global%error /= err_none )
THEN
1976 CALL
errorstop(global,err_allocate,__line__,
'pGrid%f2c')
1979 DO ifc = 1,pgrid%nFacesEst
1980 pgrid%f2c(1,ifc) = cell_type_ext
1981 pgrid%f2c(2,ifc) = cell_type_ext
1982 pgrid%f2c(3,ifc) = 0
1983 pgrid%f2c(4,ifc) = 0
1986 ALLOCATE(pgrid%f2v(3,pgrid%nFacesEst),stat=errorflag)
1987 global%error = errorflag
1988 IF ( global%error /= err_none )
THEN
1989 CALL
errorstop(global,err_allocate,__line__,
'pGrid%f2v')
1992 DO ifc = 1,pgrid%nFacesEst
1993 pgrid%f2v(1,ifc) = vert_none
1994 pgrid%f2v(2,ifc) = vert_none
1995 pgrid%f2v(3,ifc) = vert_none
2002 DO ipatch = 1,pgrid%nPatches
2003 ppatch => pregion%patches(ipatch)
2005 ALLOCATE(ppatch%bf2c(ppatch%nBFacesTot),stat=errorflag)
2006 global%error = errorflag
2007 IF ( global%error /= err_none )
THEN
2008 CALL
errorstop(global,err_allocate,__line__,
'pPatch%bf2c')
2011 ALLOCATE(ppatch%bf2v(4,ppatch%nBFacesTot),stat=errorflag)
2012 global%error = errorflag
2013 IF ( global%error /= err_none )
THEN
2014 CALL
errorstop(global,err_allocate,__line__,
'pPatch%bf2v')
2017 DO ifc = 1,ppatch%nBFacesTot
2018 ppatch%bf2c(ifc) = 0
2019 ppatch%bf2v(1,ifc) = vert_none
2020 ppatch%bf2v(2,ifc) = vert_none
2021 ppatch%bf2v(3,ifc) = vert_none
2022 ppatch%bf2v(4,ifc) = vert_none
2030 IF ( global%myProcid == masterproc .AND. &
2031 global%verbLevel >= verbose_high )
THEN
2032 WRITE(stdout,
'(A,1X,A)') solver_name,
'Creating face list done.'
2069 TYPE(t_region
),
POINTER :: pregion
2075 INTEGER :: errorflag
2076 TYPE(t_grid),
POINTER :: pgrid
2083 global => pregion%global
2086 'RFLU_ModFaceList.F90')
2088 IF ( global%myProcid == masterproc .AND. &
2089 global%verbLevel >= verbose_high )
THEN
2090 WRITE(stdout,
'(A,1X,A)') solver_name, &
2091 'Destroying av-face-to-border list...'
2094 pgrid => pregion%grid
2100 DEALLOCATE(pgrid%avf2b,stat=errorflag)
2101 global%error = errorflag
2102 IF ( global%error /= err_none )
THEN
2103 CALL
errorstop(global,err_deallocate,__line__,
'pGrid%avf2b')
2116 IF ( global%myProcid == masterproc .AND. &
2117 global%verbLevel >= verbose_high )
THEN
2118 WRITE(stdout,
'(A,1X,A)') solver_name, &
2119 'Destroying av-face-to-border list done.'
2157 TYPE(t_region
),
POINTER :: pregion
2163 INTEGER :: errorflag
2164 TYPE(t_grid),
POINTER :: pgrid
2171 global => pregion%global
2174 'RFLU_ModFaceList.F90')
2176 IF ( global%myProcid == masterproc .AND. &
2177 global%verbLevel >= verbose_high )
THEN
2178 WRITE(stdout,
'(A,1X,A)') solver_name, &
2179 'Destroying av-face-to-patch list...'
2182 pgrid => pregion%grid
2188 DEALLOCATE(pgrid%avf2p,stat=errorflag)
2189 global%error = errorflag
2190 IF ( global%error /= err_none )
THEN
2191 CALL
errorstop(global,err_deallocate,__line__,
'pGrid%avf2p')
2204 IF ( global%myProcid == masterproc .AND. &
2205 global%verbLevel >= verbose_high )
THEN
2206 WRITE(stdout,
'(A,1X,A)') solver_name, &
2207 'Destroying av-face-to-patch list done.'
2243 TYPE(t_region
),
POINTER :: pregion
2249 INTEGER :: errorflag
2250 TYPE(t_grid),
POINTER :: pgrid
2257 global => pregion%global
2260 'RFLU_ModFaceList.F90')
2262 IF ( global%myProcid == masterproc .AND. &
2263 global%verbLevel >= verbose_high )
THEN
2264 WRITE(stdout,
'(A,1X,A)') solver_name,
'Destroying cell-to-face list...'
2267 pgrid => pregion%grid
2273 IF ( pgrid%nTetsTot > 0 )
THEN
2274 DEALLOCATE(pgrid%tet2f,stat=errorflag)
2275 global%error = errorflag
2276 IF ( global%error /= err_none )
THEN
2277 CALL
errorstop(global,err_deallocate,__line__,
'pGrid%tet2f')
2281 IF ( pgrid%nHexsTot > 0 )
THEN
2282 DEALLOCATE(pgrid%hex2f,stat=errorflag)
2283 global%error = errorflag
2284 IF ( global%error /= err_none )
THEN
2285 CALL
errorstop(global,err_deallocate,__line__,
'pGrid%hex2f')
2289 IF ( pgrid%nPrisTot > 0 )
THEN
2290 DEALLOCATE(pgrid%pri2f,stat=errorflag)
2291 global%error = errorflag
2292 IF ( global%error /= err_none )
THEN
2293 CALL
errorstop(global,err_deallocate,__line__,
'pGrid%pri2f')
2297 IF ( pgrid%nPyrsTot > 0 )
THEN
2298 DEALLOCATE(pgrid%pyr2f,stat=errorflag)
2299 global%error = errorflag
2300 IF ( global%error /= err_none )
THEN
2301 CALL
errorstop(global,err_deallocate,__line__,
'pGrid%pyr2f')
2315 IF ( global%myProcid == masterproc .AND. &
2316 global%verbLevel >= verbose_high )
THEN
2317 WRITE(stdout,
'(A,1X,A)') solver_name, &
2318 'Destroying cell-to-face list done.'
2362 TYPE(t_region
),
POINTER :: pregion
2368 INTEGER :: errorflag,ipatch
2369 TYPE(t_grid),
POINTER :: pgrid
2370 TYPE(t_patch),
POINTER :: ppatch
2377 global => pregion%global
2380 'RFLU_ModFaceList.F90')
2382 IF ( global%myProcid == masterproc .AND. &
2383 global%verbLevel >= verbose_high )
THEN
2384 WRITE(stdout,
'(A,1X,A)') solver_name,
'Destroying face lists...'
2391 pgrid => pregion%grid
2397 DEALLOCATE(pgrid%f2c,stat=errorflag)
2398 global%error = errorflag
2399 IF ( global%error /= err_none )
THEN
2400 CALL
errorstop(global,err_deallocate,__line__,
'pGrid%f2c')
2403 DEALLOCATE(pgrid%f2v,stat=errorflag)
2404 global%error = errorflag
2405 IF ( global%error /= err_none )
THEN
2406 CALL
errorstop(global,err_deallocate,__line__,
'pGrid%f2v')
2418 DO ipatch = 1,pgrid%nPatches
2419 ppatch => pregion%patches(ipatch)
2421 DEALLOCATE(ppatch%bf2c,stat=errorflag)
2422 global%error = errorflag
2423 IF ( global%error /= err_none )
THEN
2424 CALL
errorstop(global,err_deallocate,__line__,
'pPatch%bf2c')
2427 DEALLOCATE(ppatch%bf2v,stat=errorflag)
2428 global%error = errorflag
2429 IF ( global%error /= err_none )
THEN
2430 CALL
errorstop(global,err_deallocate,__line__,
'pPatch%bf2v')
2433 ppatch%renumFlag = .false.
2446 IF ( global%myProcid == masterproc .AND. &
2447 global%verbLevel >= verbose_high )
THEN
2448 WRITE(stdout,
'(A,1X,A)') solver_name,
'Destroying face lists done.'
2513 INTEGER,
INTENT(IN) :: ifg,ipatch
2514 INTEGER,
INTENT(OUT) :: nfacesopp
2515 INTEGER,
INTENT(OUT) :: faceoppinfo(2,2)
2516 TYPE(t_region
),
POINTER :: pregion
2522 INTEGER ::
ic,icg,icl,ict,ifgopp,ifl,iflopp,ipatchopp,ivl,ncells,
term
2523 INTEGER ::
c(2),f2vsort(4),f2vsort2(4)
2525 TYPE(t_grid),
POINTER :: pgrid
2526 TYPE(t_patch),
POINTER :: ppatch
2532 global => pregion%global
2535 'RFLU_ModFaceList.F90')
2537 pgrid => pregion%grid
2543 IF ( ipatch > 0 )
THEN
2544 ppatch => pregion%patches(ipatch)
2545 ELSE IF ( ipatch == 0 )
THEN
2548 CALL
errorstop(global,err_reached_default,__line__)
2555 IF ( ipatch == 0 )
THEN
2558 c(1) = pgrid%f2c(1,ifg)
2559 c(2) = pgrid%f2c(2,ifg)
2562 f2vsort(ivl) = pgrid%f2v(ivl,ifg)
2564 ELSE IF ( ipatch > 0 )
THEN
2567 c(1) = ppatch%bf2c(ifg)
2570 IF ( ppatch%bf2v(ivl,ifg) /= vert_none )
THEN
2571 f2vsort(ivl) = ppatch%bv(ppatch%bf2v(ivl,ifg))
2573 f2vsort(ivl) = vert_none
2589 ict = pgrid%cellGlob2Loc(1,icg)
2590 icl = pgrid%cellGlob2Loc(2,icg)
2592 ipatchopp = opp_face_none
2593 ifgopp = opp_face_none
2605 CASE ( cell_type_tet, cell_type_pyr )
2611 CASE ( cell_type_hex )
2612 hexfaceloop:
DO ifl = 1,6
2614 f2vsort2(ivl) = pgrid%hex2v(f2vhex(ivl,ifl),icl)
2622 term =
term + abs(f2vsort(ivl) - f2vsort2(ivl))
2624 IF (
term /= 0 )
THEN
2629 IF (
term == 0 )
THEN
2630 iflopp = f2fopphex(ifl)
2632 nfacesopp = nfacesopp + 1
2634 faceoppinfo(1,nfacesopp) = pgrid%hex2f(1,iflopp,icl)
2635 faceoppinfo(2,nfacesopp) = pgrid%hex2f(2,iflopp,icl)
2645 CASE ( cell_type_pri )
2646 prifaceloop:
DO ifl = 1,5
2648 IF ( f2vpri(ivl,ifl) /= vert_none )
THEN
2649 f2vsort2(ivl) = pgrid%pri2v(f2vpri(ivl,ifl),icl)
2651 f2vsort2(ivl) = vert_none
2660 term =
term + abs(f2vsort(ivl) - f2vsort2(ivl))
2662 IF (
term /= 0 )
THEN
2667 IF (
term == 0 )
THEN
2668 iflopp = f2fopppri(ifl)
2670 nfacesopp = nfacesopp + 1
2672 faceoppinfo(1,nfacesopp) = pgrid%pri2f(1,iflopp,icl)
2673 faceoppinfo(2,nfacesopp) = pgrid%pri2f(2,iflopp,icl)
2684 CALL
errorstop(global,err_reached_default,__line__)
2739 INTEGER,
INTENT(IN) :: icg,ifg,ipatch
2740 TYPE(t_region
),
POINTER :: pregion
2747 INTEGER,
DIMENSION(4) :: f2vsort,f2vsort2
2749 TYPE(t_grid),
POINTER :: pgrid
2750 TYPE(t_patch),
POINTER :: ppatch
2756 global => pregion%global
2759 'RFLU_ModFaceList.F90')
2761 pgrid => pregion%grid
2767 ict = pgrid%cellGlob2Loc(1,icg)
2768 icl = pgrid%cellGlob2Loc(2,icg)
2774 IF ( ipatch == 0 )
THEN
2778 f2vsort(ivl) = pgrid%f2v(ivl,ifg)
2780 ELSE IF ( ipatch > 0 )
THEN
2781 ppatch => pregion%patches(ipatch)
2784 IF ( ppatch%bf2v(ivl,ifg) /= vert_none )
THEN
2785 f2vsort(ivl) = ppatch%bv(ppatch%bf2v(ivl,ifg))
2787 f2vsort(ivl) = vert_none
2791 CALL
errorstop(global,err_reached_default,__line__)
2806 CASE ( cell_type_tet )
2809 tetfaceloop:
DO ifl = 1,
nfaces
2811 IF ( f2vtet(ivl,ifl) /= vert_none )
THEN
2812 f2vsort2(ivl) = pgrid%tet2v(f2vtet(ivl,ifl),icl)
2814 f2vsort2(ivl) = vert_none
2822 tetfacevertloop:
DO ivl = 4,1,-1
2823 term =
term + abs(f2vsort(ivl) - f2vsort2(ivl))
2825 IF (
term /= 0 )
THEN
2826 EXIT tetfacevertloop
2828 END DO tetfacevertloop
2830 IF (
term == 0 )
THEN
2831 IF ( pgrid%tet2f(1,ifl,icl) == c2f_init .OR. &
2832 pgrid%tet2f(2,ifl,icl) == c2f_init )
THEN
2833 pgrid%tet2f(1,ifl,icl) = ipatch
2834 pgrid%tet2f(2,ifl,icl) = ifg
2838 CALL
errorstop(global,err_reached_default,__line__)
2841 IF ( ifl ==
nfaces )
THEN
2842 CALL
errorstop(global,err_reached_default,__line__)
2851 CASE ( cell_type_hex )
2854 hexfaceloop:
DO ifl = 1,
nfaces
2856 f2vsort2(ivl) = pgrid%hex2v(f2vhex(ivl,ifl),icl)
2863 hexfacevertloop:
DO ivl = 4,1,-1
2864 term =
term + abs(f2vsort(ivl) - f2vsort2(ivl))
2866 IF (
term /= 0 )
THEN
2867 EXIT hexfacevertloop
2869 END DO hexfacevertloop
2871 IF (
term == 0 )
THEN
2872 IF ( pgrid%hex2f(1,ifl,icl) == c2f_init .OR. &
2873 pgrid%hex2f(2,ifl,icl) == c2f_init )
THEN
2874 pgrid%hex2f(1,ifl,icl) = ipatch
2875 pgrid%hex2f(2,ifl,icl) = ifg
2879 CALL
errorstop(global,err_reached_default,__line__)
2882 IF ( ifl ==
nfaces )
THEN
2883 CALL
errorstop(global,err_reached_default,__line__)
2892 CASE ( cell_type_pri )
2895 prifaceloop:
DO ifl = 1,
nfaces
2897 IF ( f2vpri(ivl,ifl) /= vert_none )
THEN
2898 f2vsort2(ivl) = pgrid%pri2v(f2vpri(ivl,ifl),icl)
2900 f2vsort2(ivl) = vert_none
2908 prifacevertloop:
DO ivl = 4,1,-1
2909 term =
term + abs(f2vsort(ivl) - f2vsort2(ivl))
2911 IF (
term /= 0 )
THEN
2912 EXIT prifacevertloop
2914 END DO prifacevertloop
2916 IF (
term == 0 )
THEN
2917 IF ( pgrid%pri2f(1,ifl,icl) == c2f_init .OR. &
2918 pgrid%pri2f(2,ifl,icl) == c2f_init )
THEN
2919 pgrid%pri2f(1,ifl,icl) = ipatch
2920 pgrid%pri2f(2,ifl,icl) = ifg
2924 CALL
errorstop(global,err_reached_default,__line__)
2927 IF ( ifl ==
nfaces )
THEN
2928 CALL
errorstop(global,err_reached_default,__line__)
2937 CASE ( cell_type_pyr )
2940 pyrfaceloop:
DO ifl = 1,
nfaces
2942 IF ( f2vpyr(ivl,ifl) /= vert_none )
THEN
2943 f2vsort2(ivl) = pgrid%pyr2v(f2vpyr(ivl,ifl),icl)
2945 f2vsort2(ivl) = vert_none
2953 pyrfacevertloop:
DO ivl = 4,1,-1
2954 term =
term + abs(f2vsort(ivl) - f2vsort2(ivl))
2956 IF (
term /= 0 )
THEN
2957 EXIT pyrfacevertloop
2959 END DO pyrfacevertloop
2961 IF (
term == 0 )
THEN
2962 IF ( pgrid%pyr2f(1,ifl,icl) == c2f_init .OR. &
2963 pgrid%pyr2f(2,ifl,icl) == c2f_init )
THEN
2964 pgrid%pyr2f(1,ifl,icl) = ipatch
2965 pgrid%pyr2f(2,ifl,icl) = ifg
2969 CALL
errorstop(global,err_reached_default,__line__)
2972 IF ( ifl ==
nfaces )
THEN
2973 CALL
errorstop(global,err_reached_default,__line__)
2983 CALL
errorstop(global,err_reached_default,__line__)
3027 TYPE(t_region
),
POINTER :: pregion
3033 INTEGER :: errorflag
3034 TYPE(t_grid),
POINTER :: pgrid
3041 global => pregion%global
3044 'RFLU_ModFaceList.F90')
3046 pgrid => pregion%grid
3052 nullify(pgrid%avf2b)
3094 TYPE(t_region
),
POINTER :: pregion
3100 INTEGER :: errorflag
3101 TYPE(t_grid),
POINTER :: pgrid
3108 global => pregion%global
3111 'RFLU_ModFaceList.F90')
3113 pgrid => pregion%grid
3119 nullify(pgrid%avf2p)
3161 TYPE(t_region
),
POINTER :: pregion
3167 INTEGER :: errorflag
3168 TYPE(t_grid),
POINTER :: pgrid
3175 global => pregion%global
3178 'RFLU_ModFaceList.F90')
3180 pgrid => pregion%grid
3186 nullify(pgrid%tet2f)
3187 nullify(pgrid%hex2f)
3188 nullify(pgrid%pri2f)
3189 nullify(pgrid%pyr2f)
3234 TYPE(t_region
),
POINTER :: pregion
3240 INTEGER :: errorflag,ipatch
3241 TYPE(t_grid),
POINTER :: pgrid
3243 TYPE(t_patch),
POINTER :: ppatch
3249 global => pregion%global
3252 'RFLU_ModFaceList.F90')
3258 pgrid => pregion%grid
3327 TYPE(t_region
),
POINTER :: pregion
3333 INTEGER :: cntr,c1,c1s,c2,c2s,ifg,v1g,v2g,v3g,v4g
3334 TYPE(t_grid),
POINTER :: pgrid
3341 global => pregion%global
3344 'RFLU_ModFaceList.F90')
3346 IF ( global%myProcid == masterproc .AND. &
3347 global%verbLevel >= verbose_high )
THEN
3348 WRITE(stdout,
'(A,1X,A)') solver_name, &
3349 'Reorienting faces...'
3356 pgrid => pregion%grid
3364 DO ifg = 1,pgrid%nFaces
3365 c1 = pgrid%f2c(1,ifg)
3366 c2 = pgrid%f2c(2,ifg)
3368 c1s = pgrid%pc2sc(c1)
3369 c2s = pgrid%pc2sc(c2)
3371 IF ( c1s > c2s )
THEN
3372 pgrid%f2c(1,ifg) = c2
3373 pgrid%f2c(2,ifg) = c1
3375 v1g = pgrid%f2v(1,ifg)
3376 v2g = pgrid%f2v(2,ifg)
3377 v3g = pgrid%f2v(3,ifg)
3378 v4g = pgrid%f2v(4,ifg)
3380 pgrid%f2v(1,ifg) = v3g
3381 pgrid%f2v(2,ifg) = v2g
3382 pgrid%f2v(3,ifg) = v1g
3383 pgrid%f2v(4,ifg) = v4g
3393 IF ( global%myProcid == masterproc .AND. &
3394 global%verbLevel >= verbose_high )
THEN
3395 WRITE(stdout,
'(A,3X,A,1X,I6)') solver_name, &
3396 'Number of reoriented faces:',cntr
3403 IF ( global%myProcid == masterproc .AND. &
3404 global%verbLevel >= verbose_high )
THEN
3405 WRITE(stdout,
'(A,1X,A)') solver_name, &
3406 'Reorienting faces done.'
subroutine, public rflu_buildcell2facelist(pRegion)
subroutine, public rflu_destroycell2facelist(pRegion)
subroutine rflu_nullifyfacelist(pRegion)
subroutine, public rflu_createhashtable(global, size)
subroutine, public rflu_destroyfacelist(pRegion)
INTEGER function, public rflu_getglobalcellkind(global, pGrid, icg)
subroutine, public rflu_buildavface2borderlist(pRegion)
subroutine, public rflu_destroyhashtable(global)
subroutine, public rflu_destroyavface2patchlist(pRegion)
subroutine, public rflu_createcell2facelist(pRegion)
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
subroutine, public rflu_createavface2borderlist(pRegion)
subroutine registerfunction(global, funName, fileName)
subroutine, public rflu_hashbuildkey(a, aSize, key)
**********************************************************************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, public rflu_unhashbface(global, key, pGrid, fv, nVert, bcType, icg, ifg)
subroutine quicksortinteger(a, n)
subroutine binarysearchinteger(a, n, v, i, j)
subroutine, public rflu_createfacelist(pRegion)
subroutine rflu_nullifyavface2borderlist(pRegion)
subroutine quicksortintegerinteger(a, b, n)
subroutine, public rflu_buildfacelist(pRegion)
INTEGER function, public rflu_getfacekind(global, c1k, c2k)
subroutine, public rflu_destroyavface2borderlist(pRegion)
subroutine, public rflu_buildavface2patchlist(pRegion)
subroutine, public rflu_getopposingfaces(pRegion, iPatch, ifg, nFacesOpp, faceOppInfo)
subroutine rflu_nullifyavface2patchlist(pRegion)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine rflu_nullifycell2facelist(pRegion)
subroutine, public rflu_createavface2patchlist(pRegion)
subroutine deregisterfunction(global)
subroutine, public rflu_hashface(global, key, pGrid, icg, ifl, fv, nVert, faceType)
subroutine, public rflu_reorientfaces(pRegion)
INTEGER function, public rflu_getglobalcelltype(global, pGrid, icg)
subroutine, public rflu_insertintocell2facelist(pRegion, iPatch, icg, ifg)