64 CHARACTER(CHRLEN) :: &
65 RCSIdentString =
'$RCSfile: RFLU_ModCellMapping.F90,v $ $Revision: 1.16 $'
105 TYPE(t_region
),
POINTER :: pregion
111 TYPE(t_grid),
POINTER :: pgrid
118 global => pregion%global
121 'RFLU_ModCellMapping.F90')
123 IF ( global%myProcid == masterproc .AND. &
124 global%verbLevel >= verbose_high )
THEN
125 WRITE(stdout,
'(A,1X,A)') solver_name,
'Nullifying cell mapping...'
132 pgrid => pregion%grid
138 nullify(pgrid%cellGlob2Loc)
140 nullify(pgrid%tet2CellGlob)
141 nullify(pgrid%hex2CellGlob)
142 nullify(pgrid%pri2CellGlob)
143 nullify(pgrid%pyr2CellGlob)
149 IF ( global%myProcid == masterproc .AND. &
150 global%verbLevel >= verbose_high )
THEN
151 WRITE(stdout,
'(A,1X,A)') solver_name,
'Nullifying cell mapping done.'
193 TYPE(t_region
),
POINTER :: pregion
200 TYPE(t_grid),
POINTER :: pgrid
207 global => pregion%global
210 'RFLU_ModCellMapping.F90')
212 IF ( global%myProcid == masterproc .AND. &
213 global%verbLevel >= verbose_high )
THEN
214 WRITE(stdout,
'(A,1X,A)') solver_name,
'Creating cell mapping...'
227 pgrid => pregion%grid
233 ALLOCATE(pgrid%cellGlob2Loc(2,pgrid%nCellsMax),stat=errorflag)
234 global%error = errorflag
235 IF ( global%error /= err_none )
THEN
236 CALL
errorstop(global,err_allocate,__line__,
'pGrid%cellGlob2Loc')
239 IF ( pgrid%nTetsMax > 0 )
THEN
240 ALLOCATE(pgrid%tet2CellGlob(pgrid%nTetsMax),stat=errorflag)
241 global%error = errorflag
242 IF ( global%error /= err_none )
THEN
243 CALL
errorstop(global,err_allocate,__line__,
'pGrid%tet2CellGlob')
247 IF ( pgrid%nHexsMax > 0 )
THEN
248 ALLOCATE(pgrid%hex2CellGlob(pgrid%nHexsMax),stat=errorflag)
249 global%error = errorflag
250 IF ( global%error /= err_none )
THEN
251 CALL
errorstop(global,err_allocate,__line__,
'pGrid%hex2CellGlob')
255 IF ( pgrid%nPrisMax > 0 )
THEN
256 ALLOCATE(pgrid%pri2CellGlob(pgrid%nPrisMax),stat=errorflag)
257 global%error = errorflag
258 IF ( global%error /= err_none )
THEN
259 CALL
errorstop(global,err_allocate,__line__,
'pGrid%pri2CellGlob')
263 IF ( pgrid%nPyrsMax > 0 )
THEN
264 ALLOCATE(pgrid%pyr2CellGlob(pgrid%nPyrsMax),stat=errorflag)
265 global%error = errorflag
266 IF ( global%error /= err_none )
THEN
267 CALL
errorstop(global,err_allocate,__line__,
'pGrid%pyr2CellGlob')
275 IF ( global%myProcid == masterproc .AND. &
276 global%verbLevel >= verbose_high )
THEN
277 WRITE(stdout,
'(A,1X,A)') solver_name,
'Creating cell mappings done.'
319 TYPE(t_region
),
POINTER :: pregion
325 CHARACTER(CHRLEN) :: errorstring
327 TYPE(t_grid),
POINTER :: pgrid
334 global => pregion%global
337 'RFLU_ModCellMapping.F90')
339 IF ( global%myProcid == masterproc .AND. &
340 global%verbLevel >= verbose_high )
THEN
341 WRITE(stdout,
'(A,1X,A)') solver_name, &
342 'Building global-to-local cell mapping...'
349 pgrid => pregion%grid
359 IF ( pgrid%nTetsTot > 0 )
THEN
360 IF ( global%myProcid == masterproc .AND. &
361 global%verbLevel >= verbose_high )
THEN
362 WRITE(stdout,
'(A,3X,A)') solver_name,
'Tetrahedra...'
366 DO icl = 1,pgrid%nTetsTot
367 icg = pgrid%tet2CellGlob(icl)
369 pgrid%cellGlob2Loc(1,icg) = cell_type_tet
370 pgrid%cellGlob2Loc(2,icg) = icl
377 IF ( pgrid%nHexsTot > 0 )
THEN
378 IF ( global%myProcid == masterproc .AND. &
379 global%verbLevel >= verbose_high )
THEN
380 WRITE(stdout,
'(A,3X,A)') solver_name,
'Hexahedra...'
384 DO icl = 1,pgrid%nHexsTot
385 icg = pgrid%hex2CellGlob(icl)
387 pgrid%cellGlob2Loc(1,icg) = cell_type_hex
388 pgrid%cellGlob2Loc(2,icg) = icl
395 IF ( pgrid%nPrisTot > 0 )
THEN
396 IF ( global%myProcid == masterproc .AND. &
397 global%verbLevel >= verbose_high )
THEN
398 WRITE(stdout,
'(A,3X,A)') solver_name,
'Prisms...'
402 DO icl = 1,pgrid%nPrisTot
403 icg = pgrid%pri2CellGlob(icl)
405 pgrid%cellGlob2Loc(1,icg) = cell_type_pri
406 pgrid%cellGlob2Loc(2,icg) = icl
413 IF ( pgrid%nPyrsTot > 0 )
THEN
414 IF ( global%myProcid == masterproc .AND. &
415 global%verbLevel >= verbose_high )
THEN
416 WRITE(stdout,
'(A,3X,A)') solver_name,
'Pyramids...'
420 DO icl = 1,pgrid%nPyrsTot
421 icg = pgrid%pyr2CellGlob(icl)
423 pgrid%cellGlob2Loc(1,icg) = cell_type_pyr
424 pgrid%cellGlob2Loc(2,icg) = icl
431 IF ( global%myProcid == masterproc .AND. &
432 global%verbLevel >= verbose_high )
THEN
433 WRITE(stdout,
'(A,1X,A)') solver_name, &
434 'Building global-to-local cell mapping done.'
475 TYPE(t_region
),
POINTER :: pregion
481 CHARACTER(CHRLEN) :: errorstring
482 INTEGER :: icl,iclsumactual,iclsumvirtual,icg
483 TYPE(t_grid),
POINTER :: pgrid
490 global => pregion%global
493 'RFLU_ModCellMapping.F90')
495 IF ( global%myProcid == masterproc .AND. &
496 global%verbLevel >= verbose_high )
THEN
497 WRITE(stdout,
'(A,1X,A)') solver_name, &
498 'Building local-to-global cell mapping...'
505 pgrid => pregion%grid
512 iclsumvirtual = pgrid%nCells
518 IF ( pgrid%nTetsTot > 0 )
THEN
519 IF ( global%myProcid == masterproc .AND. &
520 global%verbLevel >= verbose_high )
THEN
521 WRITE(stdout,
'(A,3X,A)') solver_name,
'Tetrahedra...'
525 DO icl = 1,pgrid%nTets
526 iclsumactual = iclsumactual + 1
529 pgrid%tet2CellGlob(icl) = icg
532 DO icl = pgrid%nTets+1,pgrid%nTetsTot
533 iclsumvirtual = iclsumvirtual + 1
536 pgrid%tet2CellGlob(icl) = icg
543 IF ( pgrid%nHexsTot > 0 )
THEN
544 IF ( global%myProcid == masterproc .AND. &
545 global%verbLevel >= verbose_high )
THEN
546 WRITE(stdout,
'(A,3X,A)') solver_name,
'Hexahedra...'
550 DO icl = 1,pgrid%nHexs
551 iclsumactual = iclsumactual + 1
554 pgrid%hex2CellGlob(icl) = icg
557 DO icl = pgrid%nHexs+1,pgrid%nHexsTot
558 iclsumvirtual = iclsumvirtual + 1
561 pgrid%hex2CellGlob(icl) = icg
568 IF ( pgrid%nPrisTot > 0 )
THEN
569 IF ( global%myProcid == masterproc .AND. &
570 global%verbLevel >= verbose_high )
THEN
571 WRITE(stdout,
'(A,3X,A)') solver_name,
'Prisms...'
575 DO icl = 1,pgrid%nPris
576 iclsumactual = iclsumactual + 1
579 pgrid%pri2CellGlob(icl) = icg
582 DO icl = pgrid%nPris+1,pgrid%nPrisTot
583 iclsumvirtual = iclsumvirtual + 1
586 pgrid%pri2CellGlob(icl) = icg
593 IF ( pgrid%nPyrsTot > 0 )
THEN
594 IF ( global%myProcid == masterproc .AND. &
595 global%verbLevel >= verbose_high )
THEN
596 WRITE(stdout,
'(A,3X,A)') solver_name,
'Pyramids...'
600 DO icl = 1,pgrid%nPyrs
601 iclsumactual = iclsumactual + 1
604 pgrid%pyr2CellGlob(icl) = icg
607 DO icl = pgrid%nPyrs+1,pgrid%nPyrsTot
608 iclsumvirtual = iclsumvirtual + 1
611 pgrid%pyr2CellGlob(icl) = icg
618 IF ( global%myProcid == masterproc .AND. &
619 global%verbLevel >= verbose_high )
THEN
620 WRITE(stdout,
'(A,1X,A)') solver_name, &
621 'Building local-to-global cell mapping done.'
660 TYPE(t_region
),
POINTER :: pregion
667 TYPE(t_grid),
POINTER :: pgrid
674 global => pregion%global
677 'RFLU_ModCellMapping.F90')
679 IF ( global%myProcid == masterproc .AND. &
680 global%verbLevel >= verbose_high )
THEN
681 WRITE(stdout,
'(A,1X,A)') solver_name,
'Destroying cell mapping...'
688 pgrid => pregion%grid
694 DEALLOCATE(pgrid%cellGlob2Loc,stat=errorflag)
695 global%error = errorflag
696 IF ( global%error /= err_none )
THEN
697 CALL
errorstop(global,err_deallocate,__line__,
'pGrid%cellGlob2Loc')
700 IF ( pgrid%nTetsMax > 0 )
THEN
701 DEALLOCATE(pgrid%tet2CellGlob,stat=errorflag)
702 IF ( global%error /= err_none )
THEN
703 CALL
errorstop(global,err_deallocate,__line__,
'pGrid%tet2CellGlob')
707 IF ( pgrid%nHexsMax > 0 )
THEN
708 DEALLOCATE(pgrid%hex2CellGlob,stat=errorflag)
709 global%error = errorflag
710 IF ( global%error /= err_none )
THEN
711 CALL
errorstop(global,err_deallocate,__line__,
'pGrid%hex2CellGlob')
715 IF ( pgrid%nPrisMax > 0 )
THEN
716 DEALLOCATE(pgrid%pri2CellGlob,stat=errorflag)
717 global%error = errorflag
718 IF ( global%error /= err_none )
THEN
719 CALL
errorstop(global,err_deallocate,__line__,
'pGrid%pri2CellGlob')
723 IF ( pgrid%nPyrsMax > 0 )
THEN
724 DEALLOCATE(pgrid%pyr2CellGlob,stat=errorflag)
725 global%error = errorflag
726 IF ( global%error /= err_none )
THEN
727 CALL
errorstop(global,err_deallocate,__line__,
'pGrid%pyr2CellGlob')
741 IF ( global%myProcid == masterproc .AND. &
742 global%verbLevel >= verbose_high )
THEN
743 WRITE(stdout,
'(A,1X,A)') solver_name,
'Destroying cell mapping done.'
788 TYPE(t_region
),
POINTER :: pregion
794 INTEGER :: errorflag,icg,ifile,loopcounter,nhexstot,npristot,npyrstot, &
796 CHARACTER(CHRLEN) :: ifilename,sectionstring
797 TYPE(t_grid),
POINTER :: pgrid
804 global => pregion%global
807 'RFLU_ModCellMapping.F90')
809 IF ( global%myProcid == masterproc .AND. &
810 global%verbLevel >= verbose_high )
THEN
811 WRITE(stdout,
'(A,1X,A)') solver_name, &
812 'Reading local-to-global cell mapping...'
813 WRITE(stdout,
'(A,3X,A,1X,I5.5)') solver_name,
'Global region:', &
814 pregion%iRegionGlobal
820 pregion%iRegionGlobal,ifilename)
822 OPEN(ifile,file=ifilename,
form=
"FORMATTED",
status=
"OLD",iostat=errorflag)
823 global%error = errorflag
824 IF ( global%error /= err_none )
THEN
825 CALL
errorstop(global,err_file_open,__line__,ifilename)
832 IF ( global%myProcid == masterproc .AND. &
833 global%verbLevel >= verbose_high)
THEN
834 WRITE(stdout,
'(A,3X,A)') solver_name,
'Header information...'
837 READ(ifile,
'(A)') sectionstring
838 IF ( trim(sectionstring) /=
'# ROCFLU cell mapping file' )
THEN
839 CALL
errorstop(global,err_invalid_marker,__line__,sectionstring)
846 pgrid => pregion%grid
848 READ(ifile,
'(A)') sectionstring
849 IF ( trim(sectionstring) /=
'# Dimensions' )
THEN
850 CALL
errorstop(global,err_invalid_marker,__line__,sectionstring)
853 READ(ifile,
'(4(I8))') ntetstot,nhexstot,npristot,npyrstot
859 IF ( ntetstot /= pgrid%nTetsTot )
THEN
860 CALL
errorstop(global,err_dimens_invalid,__line__)
863 IF ( nhexstot /= pgrid%nHexsTot )
THEN
864 CALL
errorstop(global,err_dimens_invalid,__line__)
867 IF ( npristot /= pgrid%nPrisTot )
THEN
868 CALL
errorstop(global,err_dimens_invalid,__line__)
871 IF ( npyrstot /= pgrid%nPyrsTot )
THEN
872 CALL
errorstop(global,err_dimens_invalid,__line__)
882 loopcounter = loopcounter + 1
884 READ(ifile,
'(A)') sectionstring
886 SELECT CASE ( trim(sectionstring) )
892 CASE (
'# Tetrahedra' )
893 IF ( global%myProcid == masterproc .AND. &
894 global%verbLevel >= verbose_high)
THEN
895 WRITE(stdout,
'(A,3X,A)') solver_name,
'Tetrahedra...'
898 READ(ifile,
'(10(I8))') (pgrid%tet2CellGlob(icg),icg=1,pgrid%nTetsTot)
904 CASE (
'# Hexahedra' )
905 IF ( global%myProcid == masterproc .AND. &
906 global%verbLevel >= verbose_high)
THEN
907 WRITE(stdout,
'(A,3X,A)') solver_name,
'Hexahedra...'
910 READ(ifile,
'(10(I8))') (pgrid%hex2CellGlob(icg),icg=1,pgrid%nHexsTot)
917 IF ( global%myProcid == masterproc .AND. &
918 global%verbLevel >= verbose_high)
THEN
919 WRITE(stdout,
'(A,3X,A)') solver_name,
'Prisms...'
922 READ(ifile,
'(10(I8))') (pgrid%pri2CellGlob(icg),icg=1,pgrid%nPrisTot)
928 CASE (
'# Pyramids' )
929 IF ( global%myProcid == masterproc .AND. &
930 global%verbLevel >= verbose_high)
THEN
931 WRITE(stdout,
'(A,3X,A)') solver_name,
'Pyramids...'
934 READ(ifile,
'(10(I8))') (pgrid%pyr2CellGlob(icg),icg=1,pgrid%nPyrsTot)
941 IF ( global%myProcid == masterproc .AND. &
942 global%verbLevel >= verbose_high)
THEN
943 WRITE(stdout,
'(A,3X,A)') solver_name,
'End marker...'
953 IF ( global%myProcid == masterproc .AND. &
954 global%verbLevel >= verbose_high)
THEN
955 WRITE(stdout,
'(3X,A)') sectionstring
958 CALL
errorstop(global,err_invalid_marker,__line__,sectionstring)
965 IF ( loopcounter >= limit_infinite_loop )
THEN
966 CALL
errorstop(global,err_infinite_loop,__line__)
974 CLOSE(ifile,iostat=errorflag)
975 global%error = errorflag
976 IF ( global%error /= err_none )
THEN
977 CALL
errorstop(global,err_file_close,__line__,ifilename)
984 IF ( global%myProcid == masterproc .AND. &
985 global%verbLevel >= verbose_high )
THEN
986 WRITE(stdout,
'(A,1X,A)') solver_name, &
987 'Reading local-to-global cell mapping done.'
1029 TYPE(t_region
),
POINTER :: pregion
1035 INTEGER :: errorflag,icg,ifile
1036 CHARACTER(CHRLEN) :: ifilename,sectionstring
1037 TYPE(t_grid),
POINTER :: pgrid
1043 global => pregion%global
1046 'RFLU_ModCellMapping.F90')
1048 IF ( global%myProcid == masterproc .AND. &
1049 global%verbLevel >= verbose_med )
THEN
1050 WRITE(stdout,
'(A,1X,A)') solver_name, &
1051 'Writing local-to-global cell mapping...'
1052 WRITE(stdout,
'(A,3X,A,1X,I5.5)') solver_name,
'Global region:', &
1053 pregion%iRegionGlobal
1056 ifile = if_cell_maps
1059 pregion%iRegionGlobal,ifilename)
1061 OPEN(ifile,file=ifilename,
form=
"FORMATTED",
status=
"UNKNOWN", &
1063 global%error = errorflag
1064 IF ( global%error /= err_none )
THEN
1065 CALL
errorstop(global,err_file_open,__line__,ifilename)
1072 IF ( global%myProcid == masterproc .AND. &
1073 global%verbLevel >= verbose_high)
THEN
1074 WRITE(stdout,
'(A,3X,A)') solver_name,
'Header information...'
1077 sectionstring =
'# ROCFLU cell mapping file'
1078 WRITE(ifile,
'(A)') trim(sectionstring)
1084 pgrid => pregion%grid
1086 sectionstring =
'# Dimensions'
1087 WRITE(ifile,
'(A)') trim(sectionstring)
1088 WRITE(ifile,
'(4(I8))') pgrid%nTetsTot,pgrid%nHexsTot,pgrid%nPrisTot, &
1095 IF ( pgrid%nTetsTot > 0 )
THEN
1096 IF ( global%myProcid == masterproc .AND. &
1097 global%verbLevel >= verbose_high)
THEN
1098 WRITE(stdout,
'(A,3X,A)') solver_name,
'Tetrahedra...'
1101 sectionstring =
'# Tetrahedra'
1102 WRITE(ifile,
'(A)') trim(sectionstring)
1103 WRITE(ifile,
'(10(I8))') (pgrid%tet2CellGlob(icg),icg=1,pgrid%nTetsTot)
1110 IF ( pgrid%nHexsTot > 0 )
THEN
1111 IF ( global%myProcid == masterproc .AND. &
1112 global%verbLevel >= verbose_high)
THEN
1113 WRITE(stdout,
'(A,3X,A)') solver_name,
'Hexahedra...'
1116 sectionstring =
'# Hexahedra'
1117 WRITE(ifile,
'(A)') trim(sectionstring)
1118 WRITE(ifile,
'(10(I8))') (pgrid%hex2CellGlob(icg),icg=1,pgrid%nHexsTot)
1125 IF ( pgrid%nPrisTot > 0 )
THEN
1126 IF ( global%myProcid == masterproc .AND. &
1127 global%verbLevel >= verbose_high)
THEN
1128 WRITE(stdout,
'(A,3X,A)') solver_name,
'Prisms...'
1131 sectionstring =
'# Prisms'
1132 WRITE(ifile,
'(A)') trim(sectionstring)
1133 WRITE(ifile,
'(10(I8))') (pgrid%pri2CellGlob(icg),icg=1,pgrid%nPrisTot)
1140 IF ( pgrid%nPyrsTot > 0 )
THEN
1141 IF ( global%myProcid == masterproc .AND. &
1142 global%verbLevel >= verbose_high)
THEN
1143 WRITE(stdout,
'(A,3X,A)') solver_name,
'Pyramids...'
1146 sectionstring =
'# Pyramids'
1147 WRITE(ifile,
'(A)') trim(sectionstring)
1148 WRITE(ifile,
'(10(I8))') (pgrid%pyr2CellGlob(icg),icg=1,pgrid%nPyrsTot)
1155 IF ( global%myProcid == masterproc .AND. &
1156 global%verbLevel >= verbose_high)
THEN
1157 WRITE(stdout,
'(A,3X,A)') solver_name,
'End marker...'
1160 sectionstring =
'# End'
1161 WRITE(ifile,
'(A)') trim(sectionstring)
1167 CLOSE(ifile,iostat=errorflag)
1168 global%error = errorflag
1169 IF ( global%error /= err_none )
THEN
1170 CALL
errorstop(global,err_file_close,__line__,ifilename)
1177 IF ( global%myProcid == masterproc .AND. &
1178 global%verbLevel >= verbose_high )
THEN
1179 WRITE(stdout,
'(A,1X,A)') solver_name, &
1180 'Writing local-to-global cell mapping done.'
subroutine buildfilenamebasic(global, dest, ext, id, fileName)
subroutine registerfunction(global, funName, fileName)
int status() const
Obtain the status of the attribute.
subroutine, public rflu_writeloc2globcellmapping(pRegion)
subroutine, public rflu_nullifycellmapping(pRegion)
subroutine, public rflu_readloc2globcellmapping(pRegion)
subroutine, public rflu_buildglob2loccellmapping(pRegion)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE form
subroutine, public rflu_destroycellmapping(pRegion)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine, public rflu_createcellmapping(pRegion)
subroutine deregisterfunction(global)
subroutine, public rflu_buildloc2globcellmapping(pRegion)