66 CHARACTER(CHRLEN) :: &
67 RCSIdentString =
'$RCSfile: RFLU_ModMESH3D.F90,v $ $Revision: 1.5 $'
70 INTEGER :: nBQuads,nBTris,nMappings,nPatches
71 INTEGER,
DIMENSION(:),
POINTER :: bTri2p
72 INTEGER,
DIMENSION(:,:),
POINTER :: bTri2v,patch2bc
123 TYPE(t_region
),
POINTER :: pregion
129 CHARACTER(CHRLEN) :: ifilename
130 INTEGER :: errorflag,
i,ibegmax,ibegmin,ibeg1,ibeg2,
ic,iendmax,iendmin, &
131 iend1,iend2,ifile,ifl,imap,imap2,ipatch,it,nbtris,
term
132 INTEGER,
DIMENSION(:),
ALLOCATABLE :: cntr
133 TYPE(t_grid),
POINTER :: pgrid
134 TYPE(t_patch),
POINTER :: ppatch
141 global => pregion%global
144 'RFLU_ModMESH3D.F90')
146 IF ( global%verbLevel > verbose_none )
THEN
147 WRITE(stdout,
'(A,1X,A)') solver_name, &
148 'Converting from MESH3D to ROCFLU format...'
155 pgrid => pregion%grid
167 IF ( global%verbLevel > verbose_none )
THEN
168 WRITE(stdout,
'(A,3X,A)') solver_name, &
169 'Reading MESH3D information file...'
176 OPEN(ifile,file=ifilename,
form=
"FORMATTED",
status=
"OLD",iostat=errorflag)
177 global%error = errorflag
178 IF ( global%error /= err_none )
THEN
179 CALL
errorstop(global,err_file_open,__line__,ifilename)
186 READ(ifile,*) gridmesh3d%nPatches
188 pgrid => pregion%grid
190 READ(ifile,*) pgrid%nPatches
192 ALLOCATE(pregion%patches(pgrid%nPatches),stat=errorflag)
193 global%error = errorflag
194 IF ( global%error /= err_none )
THEN
195 CALL
errorstop(global,err_allocate,__line__,
'pRegion%patches')
198 READ(ifile,*) gridmesh3d%nMappings
200 ALLOCATE(gridmesh3d%patch2bc(3,gridmesh3d%nMappings),stat=errorflag)
201 global%error = errorflag
202 IF ( global%error /= err_none )
THEN
203 CALL
errorstop(global,err_allocate,__line__,
'gridMESH3D%patch2bc')
206 DO imap = 1,gridmesh3d%nMappings
207 READ(ifile,*) (gridmesh3d%patch2bc(
i,imap),
i=1,3)
210 CLOSE(ifile,iostat=errorflag)
211 global%error = errorflag
212 IF ( global%error /= err_none )
THEN
213 CALL
errorstop(global,err_file_close,__line__,ifilename)
220 IF ( global%checkLevel > check_none )
THEN
221 IF ( global%verbLevel > verbose_none )
THEN
222 WRITE(stdout,
'(A,5X,A)') solver_name,
'Checking patch mapping entries...'
225 DO imap = 1,gridmesh3d%nMappings
226 IF ( gridmesh3d%patch2bc(2,imap) < gridmesh3d%patch2bc(1,imap) )
THEN
227 IF ( global%verbLevel > verbose_none )
THEN
228 WRITE(stdout,
'(A,7X,A)') solver_name,
'Check failed.'
230 CALL
errorstop(global,err_patch_numbering,__line__)
234 DO imap = 1,gridmesh3d%nMappings
235 IF ( minval(gridmesh3d%patch2bc(3,:)) /= 1 .OR. &
236 maxval(gridmesh3d%patch2bc(3,:)) /= pgrid%nPatches )
THEN
237 IF ( global%verbLevel > verbose_none )
THEN
238 WRITE(stdout,
'(A,7X,A)') solver_name,
'Check failed.'
240 CALL
errorstop(global,err_patch_numbering,__line__)
244 DO imap = 1,gridmesh3d%nMappings
245 DO imap2 = 1,gridmesh3d%nMappings
247 IF ( imap /= imap2 )
THEN
248 ibeg1 = gridmesh3d%patch2bc(1,imap)
249 iend1 = gridmesh3d%patch2bc(2,imap)
251 ibeg2 = gridmesh3d%patch2bc(1,imap2)
252 iend2 = gridmesh3d%patch2bc(2,imap2)
254 IF ( ibeg1 < ibeg2 )
THEN
259 ELSE IF ( ibeg1 > ibeg2 )
THEN
265 IF ( global%verbLevel > verbose_none )
THEN
266 WRITE(stdout,
'(A,7X,A)') solver_name,
'Check failed.'
268 CALL
errorstop(global,err_patch_numbering,__line__)
271 IF ( iendmax <= iendmin .OR. iendmin >= ibegmax )
THEN
272 IF ( global%verbLevel > verbose_none )
THEN
273 WRITE(stdout,
'(A,7X,A)') solver_name,
'Check failed.'
275 CALL
errorstop(global,err_patch_numbering,__line__)
282 IF ( global%verbLevel > verbose_none )
THEN
283 WRITE(stdout,
'(A,5X,A)') solver_name, &
284 'Checking patch mapping entries done.'
288 IF ( global%verbLevel > verbose_none )
THEN
289 WRITE(stdout,
'(A,3X,A)') solver_name, &
290 'Information file read successfully...'
297 global%nPatches = pgrid%nPatches
303 IF ( global%verbLevel > verbose_none )
THEN
304 WRITE(stdout,
'(A,3X,A)') solver_name, &
305 'Generating boundary triangle lists...'
312 ALLOCATE(cntr(pgrid%nPatches),stat=errorflag)
313 global%error = errorflag
314 IF ( global%error /= err_none )
THEN
315 CALL
errorstop(global,err_allocate,__line__,
'cntr')
320 DO it = 1,gridmesh3d%nBTris
321 DO imap = 1,gridmesh3d%nMappings
322 IF ( gridmesh3d%bTri2p(it) >= gridmesh3d%patch2bc(1,imap) .AND. &
323 gridmesh3d%bTri2p(it) <= gridmesh3d%patch2bc(2,imap) )
THEN
324 ipatch = gridmesh3d%patch2bc(3,imap)
326 cntr(ipatch) = cntr(ipatch) + 1
332 DO ipatch = 1,pgrid%nPatches
333 ppatch => pregion%patches(ipatch)
335 ppatch%nBTris = cntr(ipatch)
339 ppatch%iPatchGlobal = ipatch
340 ppatch%iBorder = patch_iborder_default
341 ppatch%renumFlag = .false.
343 IF ( ipatch > 1 )
THEN
344 cntr(ipatch) = cntr(ipatch) + cntr(ipatch-1)
348 IF ( cntr(pgrid%nPatches) /= gridmesh3d%nBTris )
THEN
349 CALL
errorstop(global,err_nbfaces_wrong,__line__)
358 DO ipatch = 1,pgrid%nPatches
359 ppatch => pregion%patches(ipatch)
361 ppatch%nBFaces = ppatch%nBTris + ppatch%nBQuads
362 pgrid%nBFaces = pgrid%nBFaces + ppatch%nBFaces
364 ppatch%nBFacesTot = ppatch%nBFaces
365 ppatch%nBQuadsTot = ppatch%nBQuads
366 ppatch%nBTrisTot = ppatch%nBTris
367 ppatch%nBVertTot = ppatch%nBVert
374 ppatch%nBCellsVirt = 0
377 pgrid%nBFacesTot = pgrid%nBFaces
383 DO ipatch = 1,pgrid%nPatches
384 ppatch => pregion%patches(ipatch)
386 ALLOCATE(ppatch%bTri2v(3,ppatch%nBTrisMax),stat=errorflag)
387 global%error = errorflag
388 IF ( global%error /= err_none )
THEN
389 CALL
errorstop(global,err_allocate,__line__,
'pPatch%bTri2v')
395 DO it = 1,gridmesh3d%nBTris
396 DO imap = 1,gridmesh3d%nMappings
397 IF ( gridmesh3d%bTri2p(it) >= gridmesh3d%patch2bc(1,imap) .AND. &
398 gridmesh3d%bTri2p(it) <= gridmesh3d%patch2bc(2,imap) )
THEN
399 ipatch = gridmesh3d%patch2bc(3,imap)
400 ppatch => pregion%patches(ipatch)
402 cntr(ipatch) = cntr(ipatch) + 1
404 ppatch%bTri2v(1,cntr(ipatch)) = gridmesh3d%bTri2v(1,it)
405 ppatch%bTri2v(2,cntr(ipatch)) = gridmesh3d%bTri2v(3,it)
406 ppatch%bTri2v(3,cntr(ipatch)) = gridmesh3d%bTri2v(2,it)
412 DEALLOCATE(cntr,stat=errorflag)
413 global%error = errorflag
414 IF ( global%error /= err_none )
THEN
415 CALL
errorstop(global,err_deallocate,__line__,
'cntr')
418 IF ( global%verbLevel > verbose_none )
THEN
419 WRITE(stdout,
'(A,3X,A)') solver_name, &
420 'Generating boundary triangle lists done.'
427 IF ( global%verbLevel > verbose_none )
THEN
428 WRITE(stdout,
'(A,3X,A)') solver_name,
'Renumbering tetrahedra...'
431 DO ic = 1,pgrid%nTetsTot
433 pgrid%tet2v(2,
ic) = pgrid%tet2v(3,
ic)
437 IF ( global%verbLevel > verbose_none )
THEN
438 WRITE(stdout,
'(A,3X,A)') solver_name,
'Renumbering tetrahedra done.'
449 pgrid%nHexs = pgrid%nHexsTot
450 pgrid%nPris = pgrid%nPrisTot
451 pgrid%nPyrs = pgrid%nPyrsTot
457 DEALLOCATE(gridmesh3d%patch2bc,stat=errorflag)
458 global%error = errorflag
459 IF ( global%error /= err_none )
THEN
460 CALL
errorstop(global,err_deallocate,__line__,
'gridMESH3D%patch2bc')
463 DEALLOCATE(gridmesh3d%bTri2v,stat=errorflag)
464 global%error = errorflag
465 IF ( global%error /= err_none )
THEN
466 CALL
errorstop(global,err_deallocate,__line__,
'gridMESH3D%bTri2v')
469 DEALLOCATE(gridmesh3d%bTri2p,stat=errorflag)
470 global%error = errorflag
471 IF ( global%error /= err_none )
THEN
472 CALL
errorstop(global,err_deallocate,__line__,
'gridMESH3D%bTri2p')
479 DO ipatch = 1,pgrid%nPatches
480 ppatch => pregion%patches(ipatch)
482 ALLOCATE(ppatch%bf2c(ppatch%nBFacesMax),stat=errorflag)
483 global%error = errorflag
484 IF ( global%error /= err_none )
THEN
485 CALL
errorstop(global,err_allocate,__line__,
'pPatch%bf2c')
488 ALLOCATE(ppatch%bf2v(4,ppatch%nBFacesMax),stat=errorflag)
489 global%error = errorflag
490 IF ( global%error /= err_none )
THEN
491 CALL
errorstop(global,err_allocate,__line__,
'pPatch%bf2v')
494 DO ifl = 1,ppatch%nBFacesMax
495 ppatch%bf2v(1,ifl) = vert_none
496 ppatch%bf2v(2,ifl) = vert_none
497 ppatch%bf2v(3,ifl) = vert_none
498 ppatch%bf2v(4,ifl) = vert_none
506 IF ( global%verbLevel > verbose_none )
THEN
507 WRITE(stdout,
'(A,1X,A)') solver_name, &
508 'Converting from MESH3D to ROCFLU format done.'
550 TYPE(t_region
),
POINTER :: pregion
556 CHARACTER(CHRLEN) :: dummystring,ifilename
557 INTEGER :: cvmax,cvmin,dummyinteger,errorflag,
i,
ic,ifile,it,iv
558 TYPE(t_grid),
POINTER :: pgrid
565 gridmesh3d%nBTris = 0
566 gridmesh3d%nBQuads = 0
572 global => pregion%global
575 'RFLU_ModMESH3D.F90')
577 IF ( global%verbLevel > verbose_none )
THEN
578 WRITE(stdout,
'(A,1X,A)') solver_name,
'Reading MESH3D grid file...'
585 OPEN(ifile,file=ifilename,
form=
"FORMATTED",
status=
"OLD",iostat=errorflag )
586 global%error = errorflag
587 IF ( global%error /= err_none )
THEN
588 CALL
errorstop(global,err_file_open,__line__,ifilename)
595 pgrid => pregion%grid
597 IF ( global%verbLevel > verbose_none )
THEN
598 WRITE(stdout,
'(A,3X,A)') solver_name,
'Coordinates...'
601 READ(ifile,
'(A)') dummystring
602 READ(ifile,*) pgrid%nVertTot
603 READ(ifile,
'(A)') dummystring
605 pgrid%nVert = pgrid%nVertTot
608 ALLOCATE(pgrid%xyz(3,pgrid%nVertMax),stat=errorflag)
609 global%error = errorflag
610 IF ( global%error /= err_none )
THEN
611 CALL
errorstop(global,err_allocate,__line__,
'pGrid%xyz')
614 DO iv = 1,pgrid%nVertTot
615 READ(ifile,*) (pgrid%xyz(
i,iv),
i=1,3)
622 IF ( global%verbLevel > verbose_none )
THEN
623 WRITE(stdout,
'(A,3X,A)') solver_name,
'Boundary faces...'
626 READ(ifile,
'(A)') dummystring
627 READ(ifile,*) gridmesh3d%nBTris
628 READ(ifile,
'(A)') dummystring
630 ALLOCATE(gridmesh3d%bTri2p(gridmesh3d%nBTris),stat=errorflag)
631 global%error = errorflag
632 IF ( global%error /= err_none )
THEN
633 CALL
errorstop(global,err_allocate,__line__,
'gridMESH3D%bTri2p')
636 ALLOCATE(gridmesh3d%bTri2v(3,gridmesh3d%nBTris),stat=errorflag)
637 global%error = errorflag
638 IF ( global%error /= err_none )
THEN
639 CALL
errorstop(global,err_allocate,__line__,
'gridMESH3D%bTri2v')
642 DO it = 1,gridmesh3d%nBTris
643 READ(ifile,*) (gridmesh3d%bTri2v(iv,it),iv=1,3),gridmesh3d%bTri2p(it)
650 IF ( global%verbLevel > verbose_none )
THEN
651 WRITE(stdout,
'(A,3X,A)') solver_name,
'Connectivity...'
654 READ(ifile,
'(A)') dummystring
655 READ(ifile,*) pgrid%nTetsTot
656 READ(ifile,
'(A)') dummystring
658 pgrid%nTets = pgrid%nTetsTot
661 pgrid%nCells = pgrid%nTets
662 pgrid%nCellsTot = pgrid%nTetsTot
663 pgrid%nCellsMax = pgrid%nTetsMax
665 ALLOCATE(pgrid%tet2v(4,pgrid%nTetsMax),stat=errorflag)
666 global%error = errorflag
667 IF ( global%error /= err_none )
THEN
668 CALL
errorstop(global,err_allocate,__line__,
'pGrid%tet2v')
671 DO ic = 1,pgrid%nTetsTot
672 READ(ifile,*) (pgrid%tet2v(iv,
ic),iv=1,4)
679 IF ( global%checkLevel > check_none )
THEN
680 IF ( global%verbLevel > verbose_none )
THEN
681 WRITE(stdout,
'(A,3X,A)') solver_name, &
682 'Checking face connectivity array entries...'
685 cvmin = minval(gridmesh3d%bTri2v(1:3,1:gridmesh3d%nBTris))
686 cvmax = maxval(gridmesh3d%bTri2v(1:3,1:gridmesh3d%nBTris))
688 IF ( cvmin < 1 .OR. cvmax > pgrid%nVertTot )
THEN
689 IF ( global%verbLevel > verbose_none )
THEN
690 WRITE(stdout,
'(A,5X,A)') solver_name,
'Check failed.'
692 CALL
errorstop(global,err_vertex_number,__line__)
695 IF ( global%verbLevel > verbose_none )
THEN
696 WRITE(stdout,
'(A,3X,A)') solver_name, &
697 'Checking face connectivity array entries done.'
701 IF ( global%verbLevel > verbose_none )
THEN
702 WRITE(stdout,
'(A,3X,A)') solver_name, &
703 'Checking cell connectivity array entries...'
706 cvmin = minval(pgrid%tet2v(1:4,1:pgrid%nTetsTot))
707 cvmax = maxval(pgrid%tet2v(1:4,1:pgrid%nTetsTot))
709 IF ( cvmin /= 1 .OR. cvmax /= pgrid%nVertTot )
THEN
710 IF ( global%verbLevel > verbose_none )
THEN
711 WRITE(stdout,
'(A,5X,A)') solver_name,
'Check failed.'
713 CALL
errorstop(global,err_vertex_number,__line__)
716 IF ( global%verbLevel > verbose_none )
THEN
717 WRITE(stdout,
'(A,3X,A)') solver_name, &
718 'Checking cell connectivity array entries done.'
722 CLOSE(ifile,iostat=errorflag)
723 global%error = errorflag
724 IF ( global%error /= err_none )
THEN
725 CALL
errorstop(global,err_file_close,__line__,ifilename)
732 IF ( global%verbLevel > verbose_none )
THEN
733 WRITE(stdout,
'(A,3X,A)') solver_name,
'Grid Statistics:'
734 WRITE(stdout,
'(A,5X,A,2X,I9)') solver_name,
'Vertices: ', &
736 WRITE(stdout,
'(A,5X,A,2X,I9)') solver_name,
'Tetrahedra: ', &
738 WRITE(stdout,
'(A,5X,A,2X,I9)') solver_name,
'Boundary triangles:', &
746 IF ( global%verbLevel > verbose_none )
THEN
747 WRITE(stdout,
'(A,1X,A)') solver_name,
'Reading MESH3D grid file done.'
subroutine, public rflu_readgridmesh3d(pRegion)
subroutine registerfunction(global, funName, fileName)
int status() const
Obtain the status of the attribute.
**********************************************************************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 buildfilenameplain(global, dest, ext, fileName)
**********************************************************************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
INTEGER function, public rflu_setmaxdimension(global, nXyzTot)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine, public rflu_convmesh3d2rocflu(pRegion)
subroutine deregisterfunction(global)