66 CHARACTER(CHRLEN) :: &
67 RCSIdentString =
'$RCSfile: RFLU_ModVGRIDns.F90,v $ $Revision: 1.5 $'
70 INTEGER :: nBQuads,nBTris,nMappings,nPatches
71 INTEGER,
DIMENSION(:),
POINTER :: bTri2p
72 INTEGER,
DIMENSION(:,:),
POINTER :: bTri2v,patch2bc
123 CHARACTER(CHRLEN) :: ifilename
124 INTEGER :: errorflag,
i,ibegmax,ibegmin,ibeg1,ibeg2,
ic,iendmax, &
125 iendmin,iend1,iend2,ifile,ifl,imap,imap2,ipatch,it,
term
126 INTEGER,
DIMENSION(:),
ALLOCATABLE :: cntr
127 TYPE(t_grid),
POINTER :: pgrid
128 TYPE(t_patch),
POINTER :: ppatch
135 TYPE(t_region
),
POINTER :: pregion
141 global => pregion%global
144 'RFLU_ModVGRIDns.F90')
146 IF ( global%verbLevel > verbose_none )
THEN
147 WRITE(stdout,
'(A,1X,A)') solver_name, &
148 'Converting from VGRIDns to ROCFLU format...'
155 pgrid => pregion%grid
167 IF ( global%verbLevel > verbose_none )
THEN
168 WRITE(stdout,
'(A,3X,A)') solver_name,
'Reading VGRIDns information file...'
175 OPEN(ifile,file=ifilename,
form=
"FORMATTED",
status=
"OLD",iostat=errorflag )
176 global%error = errorflag
177 IF ( global%error /= err_none )
THEN
178 CALL
errorstop(global,err_file_open,__line__,ifilename)
181 READ(ifile,*) pgrid%nPatches
183 ALLOCATE(pregion%patches(pgrid%nPatches),stat=errorflag)
184 global%error = errorflag
185 IF ( global%error /= err_none )
THEN
186 CALL
errorstop(global,err_allocate,__line__,
'pRegion%patches')
189 READ(ifile,*) gridvgridns%nMappings
191 ALLOCATE(gridvgridns%patch2bc(3,gridvgridns%nMappings), stat=errorflag )
192 global%error = errorflag
193 IF ( global%error /= err_none )
THEN
194 CALL
errorstop(global,err_allocate,__line__,
'gridVGRIDns%patch2bc')
197 DO imap = 1,gridvgridns%nMappings
198 READ(ifile,*) (gridvgridns%patch2bc(
i,imap),
i=1,3)
205 IF ( global%checkLevel > check_none )
THEN
206 IF ( global%verbLevel > verbose_none )
THEN
207 WRITE(stdout,
'(A,3X,A)') solver_name,
'Checking patch mapping entries...'
210 IF ( minval(gridvgridns%patch2bc(1,:)) /= 1 .OR. &
211 maxval(gridvgridns%patch2bc(2,:)) /= gridvgridns%nPatches )
THEN
212 IF ( global%verbLevel > verbose_none )
THEN
213 WRITE(stdout,
'(A,5X,A)') solver_name,
'Check failed.'
215 CALL
errorstop(global,err_patch_numbering,__line__)
218 DO imap = 1,gridvgridns%nMappings
219 IF ( gridvgridns%patch2bc(2,imap) < gridvgridns%patch2bc(1,imap) )
THEN
220 IF ( global%verbLevel > verbose_none )
THEN
221 WRITE(stdout,
'(A,5X,A)') solver_name,
'Check failed.'
223 CALL
errorstop(global,err_patch_numbering,__line__)
227 DO imap = 1,gridvgridns%nMappings
228 IF ( minval(gridvgridns%patch2bc(3,:)) /= 1 .OR. &
229 maxval(gridvgridns%patch2bc(3,:)) /= pgrid%nPatches )
THEN
230 IF ( global%verbLevel > verbose_none )
THEN
231 WRITE(stdout,
'(A,5X,A)') solver_name,
'Check failed.'
233 CALL
errorstop(global,err_patch_numbering,__line__)
237 DO imap = 1,gridvgridns%nMappings
238 DO imap2 = 1,gridvgridns%nMappings
240 IF ( imap /= imap2 )
THEN
241 ibeg1 = gridvgridns%patch2bc(1,imap)
242 iend1 = gridvgridns%patch2bc(2,imap)
244 ibeg2 = gridvgridns%patch2bc(1,imap2)
245 iend2 = gridvgridns%patch2bc(2,imap2)
247 IF ( ibeg1 < ibeg2 )
THEN
252 ELSE IF ( ibeg1 > ibeg2 )
THEN
258 IF ( global%verbLevel > verbose_none )
THEN
259 WRITE(stdout,
'(A,5X,A)') solver_name,
'Check failed.'
261 CALL
errorstop(global,err_patch_numbering,__line__)
264 IF ( iendmax <= iendmin .OR. iendmin >= ibegmax )
THEN
265 IF ( global%verbLevel > verbose_none )
THEN
266 WRITE(stdout,
'(A,5X,A)') solver_name,
'Check failed.'
268 CALL
errorstop(global,err_patch_numbering,__line__)
275 IF ( global%verbLevel > verbose_none )
THEN
276 WRITE(stdout,
'(A,3X,A)') solver_name, &
277 'Checking patch mapping entries done.'
281 CLOSE(ifile,iostat=errorflag)
282 global%error = errorflag
283 IF ( global%error /= err_none )
THEN
284 CALL
errorstop(global,err_file_close,__line__,ifilename)
287 IF ( global%verbLevel > verbose_none )
THEN
288 WRITE(stdout,
'(A,3X,A)') solver_name, &
289 'Reading VGRIDns information file done.'
296 global%nPatches = pgrid%nPatches
302 IF ( global%verbLevel > verbose_none )
THEN
303 WRITE(stdout,
'(A,3X,A)') solver_name, &
304 'Generating boundary triangle lists...'
311 ALLOCATE(cntr(pgrid%nPatches),stat=errorflag)
312 global%error = errorflag
313 IF ( global%error /= err_none )
THEN
314 CALL
errorstop(global,err_allocate,__line__,
'cntr')
319 DO it = 1,gridvgridns%nBTris
320 DO imap = 1,gridvgridns%nMappings
321 IF ( gridvgridns%bTri2p(it) >= gridvgridns%patch2bc(1,imap) .AND. &
322 gridvgridns%bTri2p(it) <= gridvgridns%patch2bc(2,imap) )
THEN
323 ipatch = gridvgridns%patch2bc(3,imap)
325 cntr(ipatch) = cntr(ipatch) + 1
331 DO ipatch = 1,pgrid%nPatches
332 ppatch => pregion%patches(ipatch)
334 ppatch%nBTris = cntr(ipatch)
338 ppatch%iPatchGlobal = ipatch
339 ppatch%iBorder = patch_iborder_default
340 ppatch%renumFlag = .false.
342 IF ( ipatch > 1 )
THEN
343 cntr(ipatch) = cntr(ipatch) + cntr(ipatch-1)
347 IF ( cntr(pgrid%nPatches) /= gridvgridns%nBTris )
THEN
348 CALL
errorstop(global,err_nbfaces_wrong,__line__)
357 DO ipatch = 1,pgrid%nPatches
358 ppatch => pregion%patches(ipatch)
360 ppatch%nBFaces = ppatch%nBTris + ppatch%nBQuads
361 pgrid%nBFaces = pgrid%nBFaces + ppatch%nBFaces
363 ppatch%nBFacesTot = ppatch%nBFaces
364 ppatch%nBQuadsTot = ppatch%nBQuads
365 ppatch%nBTrisTot = ppatch%nBTris
366 ppatch%nBVertTot = ppatch%nBVert
373 ppatch%nBCellsVirt = 0
376 pgrid%nBFacesTot = pgrid%nBFaces
382 DO ipatch = 1,pgrid%nPatches
383 ppatch => pregion%patches(ipatch)
385 ALLOCATE(ppatch%bTri2v(3,ppatch%nBTrisMax),stat=errorflag)
386 global%error = errorflag
387 IF ( global%error /= err_none )
THEN
388 CALL
errorstop(global,err_allocate,__line__,
'pPatch%bTri2v')
394 DO it = 1,gridvgridns%nBTris
395 DO imap = 1,gridvgridns%nMappings
396 IF ( gridvgridns%bTri2p(it) >= gridvgridns%patch2bc(1,imap) .AND. &
397 gridvgridns%bTri2p(it) <= gridvgridns%patch2bc(2,imap) )
THEN
398 ipatch = gridvgridns%patch2bc(3,imap)
399 ppatch => pregion%patches(ipatch)
401 cntr(ipatch) = cntr(ipatch) + 1
403 ppatch%bTri2v(1,cntr(ipatch)) = gridvgridns%bTri2v(1,it)
404 ppatch%bTri2v(2,cntr(ipatch)) = gridvgridns%bTri2v(3,it)
405 ppatch%bTri2v(3,cntr(ipatch)) = gridvgridns%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(gridvgridns%bTri2v,stat=errorflag)
458 global%error = errorflag
459 IF ( global%error /= err_none )
THEN
460 CALL
errorstop(global,err_deallocate,__line__,
'gridVGRIDns%bTri2v')
463 DEALLOCATE(gridvgridns%bTri2p,stat=errorflag)
464 global%error = errorflag
465 IF ( global%error /= err_none )
THEN
466 CALL
errorstop(global,err_deallocate,__line__,
'gridVGRIDns%bTri2p')
473 DO ipatch = 1,pgrid%nPatches
474 ppatch => pregion%patches(ipatch)
476 ALLOCATE(ppatch%bf2c(ppatch%nBFacesMax),stat=errorflag)
477 global%error = errorflag
478 IF ( global%error /= err_none )
THEN
479 CALL
errorstop(global,err_allocate,__line__,
'pPatch%bf2c')
482 ALLOCATE(ppatch%bf2v(4,ppatch%nBFacesMax),stat=errorflag)
483 global%error = errorflag
484 IF ( global%error /= err_none )
THEN
485 CALL
errorstop(global,err_allocate,__line__,
'pPatch%bf2v')
488 DO ifl = 1,ppatch%nBFacesMax
489 ppatch%bf2v(1,ifl) = vert_none
490 ppatch%bf2v(2,ifl) = vert_none
491 ppatch%bf2v(3,ifl) = vert_none
492 ppatch%bf2v(4,ifl) = vert_none
500 IF ( global%verbLevel > verbose_none )
THEN
501 WRITE(stdout,
'(A,1X,A)') solver_name, &
502 'Converting from VGRIDns to ROCFLU format done.'
549 TYPE(t_region
),
POINTER :: pregion
555 CHARACTER(CHRLEN) :: dummystring,ifilename
556 INTEGER :: cvmax,cvmin,dummyinteger,errorflag,
i,
ic,ifile,it,iv
557 INTEGER,
DIMENSION(:),
ALLOCATABLE :: cntr
558 REAL(RFREAL) :: dummyreal
559 TYPE(t_grid),
POINTER :: pgrid
566 gridvgridns%nBTris = 0
567 gridvgridns%nBQuads = 0
573 global => pregion%global
576 'RFLU_ModVGRIDns.F90')
578 IF ( global%verbLevel > verbose_none )
THEN
579 WRITE(stdout,
'(A,1X,A)') solver_name,
'Reading VGRIDns grid file...'
586 OPEN(ifile,file=ifilename,
form=
"FORMATTED",
status=
"OLD",iostat=errorflag)
587 global%error = errorflag
588 IF ( global%error /= err_none )
THEN
589 CALL
errorstop(global,err_file_open,__line__,ifilename)
596 IF ( global%verbLevel > verbose_none )
THEN
597 WRITE(stdout,
'(A,3X,A)') solver_name,
'General information...'
600 READ(ifile,*) gridvgridns%nBTris,dummystring,gridvgridns%nPatches, &
602 READ(ifile,
'(A)') dummystring
608 IF ( global%verbLevel > verbose_none )
THEN
609 WRITE(stdout,
'(A,3X,A)') solver_name,
'Boundary faces...'
612 ALLOCATE(gridvgridns%bTri2p(gridvgridns%nBTris),stat=errorflag)
613 global%error = errorflag
614 IF ( global%error /= err_none )
THEN
615 CALL
errorstop(global,err_allocate,__line__,
'gridVGRIDns%bTri2p')
618 ALLOCATE(gridvgridns%bTri2v(3,gridvgridns%nBTris),stat=errorflag)
619 global%error = errorflag
620 IF ( global%error /= err_none )
THEN
621 CALL
errorstop(global,err_allocate,__line__,
'gridVGRIDns%bTri2v')
624 DO it = 1,gridvgridns%nBTris
625 READ(ifile,*) dummyinteger,gridvgridns%bTri2p(it), &
626 (gridvgridns%bTri2v(iv,it),iv=1,3)
629 CLOSE(ifile,iostat=errorflag)
630 global%error = errorflag
631 IF ( global%error /= err_none )
THEN
632 CALL
errorstop(global,err_file_close,__line__,ifilename)
635 IF ( global%verbLevel > verbose_none )
THEN
636 WRITE(stdout,
'(A,1X,A)') solver_name,
'File read successfully.'
643 IF ( global%verbLevel > verbose_none )
THEN
644 WRITE(stdout,
'(A,1X,A)') solver_name,
'Reading VGRIDns .cogsg file...'
651 OPEN(ifile,file=ifilename,
form=
"UNFORMATTED",
status=
"OLD",iostat=errorflag)
652 global%error = errorflag
653 IF ( global%error /= err_none )
THEN
654 CALL
errorstop(global,err_file_open,__line__,ifilename)
661 pgrid => pregion%grid
663 IF ( global%verbLevel > verbose_none )
THEN
664 WRITE(stdout,
'(A,3X,A)') solver_name,
'Header...'
667 READ(ifile) dummyinteger,pgrid%nTetsTot,pgrid%nVertTot
677 IF ( global%verbLevel > verbose_none )
THEN
678 WRITE(stdout,
'(A,3X,A)') solver_name,
'Connectivity...'
681 ALLOCATE(pgrid%tet2v(4,pgrid%nTetsMax),stat=errorflag)
682 global%error = errorflag
683 IF ( global%error /= err_none )
THEN
684 CALL
errorstop(global,err_allocate,__line__,
'pGrid%tet2v')
687 READ(ifile) dummyinteger,dummyinteger,dummyinteger, &
688 dummyinteger,dummyinteger,dummyinteger, &
689 dummyreal,((pgrid%tet2v(iv,
ic),
ic=1,pgrid%nTetsTot),iv=1,4)
691 pgrid%nCellsTot = pgrid%nTetsTot
698 IF ( global%checkLevel > check_none )
THEN
699 IF ( global%verbLevel > verbose_none )
THEN
700 WRITE(stdout,
'(A,3X,A)') solver_name, &
701 'Checking face connectivity array entries...'
704 cvmin = minval(gridvgridns%bTri2v(1:3,1:gridvgridns%nBTris))
705 cvmax = maxval(gridvgridns%bTri2v(1:3,1:gridvgridns%nBTris))
707 IF ( cvmin < 1 .OR. cvmax > pgrid%nVertTot )
THEN
708 IF ( global%verbLevel > verbose_none )
THEN
709 WRITE(stdout,
'(A,5X,A)') solver_name,
'Check failed.'
711 CALL
errorstop(global,err_vertex_number,__line__)
714 IF ( global%verbLevel > verbose_none )
THEN
715 WRITE(stdout,
'(A,3X,A)') solver_name, &
716 'Checking face connectivity array entries done.'
719 IF ( global%verbLevel > verbose_none )
THEN
720 WRITE(stdout,
'(A,3X,A)') solver_name, &
721 'Checking cell connectivity array entries...'
724 cvmin = minval(pgrid%tet2v(1:4,1:pgrid%nTetsTot))
725 cvmax = maxval(pgrid%tet2v(1:4,1:pgrid%nTetsTot))
727 IF ( cvmin /= 1 .OR. cvmax /= pgrid%nVertTot )
THEN
728 IF ( global%verbLevel > verbose_none )
THEN
729 WRITE(stdout,
'(A,5X,A)') solver_name,
'CHECK failed.'
731 CALL
errorstop(global,err_vertex_number,__line__)
734 IF ( global%verbLevel > verbose_none )
THEN
735 WRITE(stdout,
'(A,3X,A)') solver_name, &
736 'Checking cell connectivity array entries done.'
744 IF ( global%verbLevel > verbose_none )
THEN
745 WRITE(stdout,
'(A,3X,A)') solver_name,
'Coordinates...'
748 ALLOCATE(pgrid%xyz(3,pgrid%nVertMax),stat=errorflag)
749 global%error = errorflag
750 IF ( global%error /= err_none )
THEN
751 CALL
errorstop(global,err_allocate,__line__,
'pGrid%xyz')
754 READ(ifile) ((pgrid%xyz(
i,iv),iv=1,pgrid%nVertTot),
i=1,3)
756 CLOSE(ifile,iostat=errorflag)
757 global%error = errorflag
758 IF ( global%error /= err_none )
THEN
759 CALL
errorstop(global,err_file_close,__line__,ifilename)
766 pgrid%nVert = pgrid%nVertTot
767 pgrid%nCells = pgrid%nCellsTot
768 pgrid%nTets = pgrid%nTetsTot
774 IF ( global%verbLevel > verbose_none )
THEN
775 WRITE(stdout,
'(A,3X,A)') solver_name,
'Grid Statistics:'
776 WRITE(stdout,
'(A,5X,A,2X,I9)') solver_name,
'Vertices: ', &
778 WRITE(stdout,
'(A,5X,A,2X,I9)') solver_name,
'Tetrahedra: ', &
780 WRITE(stdout,
'(A,5X,A,2X,I9)') solver_name,
'Boundary triangles: ', &
788 IF ( global%verbLevel > verbose_none )
THEN
789 WRITE(stdout,
'(A,1X,A)') solver_name,
'Reading VGRIDns grid file done.'
subroutine, public rflu_readgridvgridns(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, public rflu_convvgridns2rocflu(pRegion)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine deregisterfunction(global)