Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PLAG_RFLO_FindGridMapping.F90
Go to the documentation of this file.
1 ! *********************************************************************
2 ! * Rocstar Simulation Suite *
3 ! * Copyright@2015, Illinois Rocstar LLC. All rights reserved. *
4 ! * *
5 ! * Illinois Rocstar LLC *
6 ! * Champaign, IL *
7 ! * www.illinoisrocstar.com *
8 ! * sales@illinoisrocstar.com *
9 ! * *
10 ! * License: See LICENSE file in top level of distribution package or *
11 ! * http://opensource.org/licenses/NCSA *
12 ! *********************************************************************
13 ! *********************************************************************
14 ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
15 ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
16 ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *
17 ! * NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR *
18 ! * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
19 ! * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
20 ! * Arising FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
21 ! * USE OR OTHER DEALINGS WITH THE SOFTWARE. *
22 ! *********************************************************************
23 !******************************************************************************
24 !
25 ! Purpose: find the grid transformation between regions connecting at
26 ! corner-edge cells for proper metrics.
27 !
28 ! Description: none.
29 !
30 ! Input: regions = data of all regions,
31 ! iReg = current region number.
32 !
33 ! Output: indexMapMat = index mapping matrix.
34 !
35 ! Notes: None.
36 !
37 !******************************************************************************
38 !
39 ! $Id: PLAG_RFLO_FindGridMapping.F90,v 1.4 2008/12/06 08:44:34 mtcampbe Exp $
40 !
41 ! Copyright: (c) 2004 by the University of Illinois
42 !
43 !******************************************************************************
44 
45 SUBROUTINE plag_rflo_findgridmapping( regions )
46 
47  USE moddatatypes
48  USE moddatastruct, ONLY : t_region, t_level, t_dcell
49  USE modglobal, ONLY : t_global
50  USE modpartlag, ONLY : t_plag
51  USE modindexing, ONLY : getijk
52  USE modinterfaces, ONLY : rflo_getcelloffset, &
55  USE moderror
56  USE modparameters
60  IMPLICIT NONE
61 
62 #include "Indexing.h"
63 
64 ! ... parameters
65  TYPE(t_region), POINTER :: regions(:)
66 
67 
68 ! ... loop variables
69  INTEGER :: i, icorner, iedge, ireg, ijk, j, k, nt
70 
71 ! ... local variables
72  CHARACTER(CHRLEN) :: rcsidentstring
73 
74  INTEGER :: ilev, ncorners, nedges, ntedge, ntcorn
75  INTEGER :: iregsrc, ijkn, ic, jc, kc
76  INTEGER :: ibeg, iend, jbeg, jend, kbeg, kend
77  INTEGER :: inoff, ijnoff
78 
79  INTEGER :: ndumcellssrc
80  INTEGER :: iregtemp, iregsrctemp, igridmapmat
81  INTEGER :: srcdir(3),srcface(6)
82  INTEGER :: srcindexmapmat(3,4)
83 
84  LOGICAL :: found
85 
86  TYPE(t_region), POINTER :: pregion
87  TYPE(t_level), POINTER :: plevel
88  TYPE(t_global), POINTER :: global
89 
90 !******************************************************************************
91 
92  rcsidentstring = &
93  '$RCSfile: PLAG_RFLO_FindGridMapping.F90,v $ $Revision: 1.4 $'
94 
95  global => regions(1)%global
96 
97  CALL registerfunction( global, 'PLAG_RFLO_FindGridMapping',&
98  'PLAG_RFLO_FindGridMapping.F90' )
99 
100 ! Get dimensions --------------------------------------------------------------
101 
102  ncorners = 8
103  nedges = 12
104  ntedge = 2
105  ntcorn = 3
106 
107 ! Search for source regions ===================================================
108 
109  DO ireg=1,global%nRegions
110  ilev=1
111 
112 ! - Set pointers --------------------------------------------------------------
113 
114  plevel => regions(ireg)%levels(ilev)
115 
116  pregion => regions(ireg)
117 
118 ! - Get node offset -----------------------------------------------------------
119 
120  CALL rflo_getnodeoffset( pregion,ilev,inoff,ijnoff )
121 
122 ! - Loop over edges -----------------------------------------------------------
123 
124  DO iedge=1,nedges
125 
126 ! -- Bypass for noninteracting regions ----------------------------------------
127 
128  IF( .NOT. plevel%edgeCells(iedge)%interact ) goto 1999
129 
130 ! -- Loop over edge cell indices ----------------------------------------------
131 
132  CALL rflo_getedgecellsindices( pregion,ilev,iedge, &
133  ibeg,iend,jbeg,jend,kbeg,kend )
134  ijk = 0
135  DO k=kbeg,kend
136  DO j=jbeg,jend
137  DO i=ibeg,iend
138  ijk = ijk + 1
139 
140 ! --- Source region infrastructure --------------------------------------------
141 
142  iregsrc = plevel%edgeCells(iedge)%cells(ijk)%srcRegion
143 
144  ic = i; jc = j; kc =k;
145  iregtemp=ireg
146  DO nt=1,ntedge
147  CALL plag_rflo_findsourcecell( regions,iregtemp,ilev,ic,jc,kc, &
148  found,iregsrctemp,srcindexmapmat )
149  IF(found) EXIT
150  iregtemp = iregsrctemp
151  END DO ! nt
152 
153 ! --- Extract mapping between regions sharing an edge -------------------------
154 
155  plevel%edgeCells(iedge)%cells(ijk)%srcIndexMapMat = srcindexmapmat
156  ENDDO ! i
157  ENDDO ! j
158  ENDDO ! k
159 
160 1999 CONTINUE
161 
162  ENDDO ! iEdge
163 
164 ! - Loop over corners ---------------------------------------------------------
165 
166  DO icorner=1,ncorners
167 
168 ! -- Bypass for noninteracting regions ----------------------------------------
169 
170  IF( .NOT. plevel%cornerCells(icorner)%interact ) goto 2999
171 
172 ! -- Loop over corner cell indices --------------------------------------------
173 
174  CALL rflo_getcornercellsindices( pregion,ilev,icorner, &
175  ibeg,iend,jbeg,jend,kbeg,kend )
176 
177  ijk = 0
178  DO k=kbeg,kend
179  DO j=jbeg,jend
180  DO i=ibeg,iend
181  ijk = ijk + 1
182 
183 ! -- Source region infrastructure ---------------------------------------------
184 
185  iregsrc = plevel%cornerCells(icorner)%cells(ijk)%srcRegion
186 
187  ic = i; jc = j; kc =k;
188  iregtemp=ireg
189  DO nt=1,ntcorn
190  CALL plag_rflo_findsourcecell( regions,iregtemp,ilev,ic,jc,kc, &
191  found,iregsrctemp,srcindexmapmat )
192  IF(found) EXIT
193  iregtemp = iregsrctemp
194  END DO ! nt
195 
196 ! -- Extract mapping between regions sharing a corner -------------------------
197 
198  plevel%cornerCells(icorner)%cells(ijk)%srcIndexMapMat = srcindexmapmat
199  ENDDO ! i
200  ENDDO ! j
201  ENDDO ! k
202 
203 2999 CONTINUE
204 
205  ENDDO ! iCorner
206  ENDDO ! iReg
207 
208 ! finalize --------------------------------------------------------------------
209 
210  CALL deregisterfunction( global )
211 
212 END SUBROUTINE plag_rflo_findgridmapping
213 
214 !******************************************************************************
215 SUBROUTINE plag_rflo_findsourcecell( regions,iReg,iLev,ic,jc,kc, &
216  found,iregsrc,indexmapmat )
217 
218  USE moddatatypes
219  USE modbndpatch, ONLY : t_patch
220  USE moddatastruct, ONLY : t_region, t_level
221  USE modglobal, ONLY : t_global
223  USE moderror
224  USE modparameters
226  IMPLICIT NONE
227 
228 ! ... parameters
229  INTEGER, INTENT(IN) :: ireg, ilev
230  INTEGER, INTENT(INOUT) :: ic, jc, kc
231  INTEGER, INTENT(OUT) :: iregsrc
232  INTEGER, INTENT(OUT) :: indexmapmat(3,4)
233 
234  LOGICAL, INTENT(OUT) :: found
235 
236  TYPE(t_region), POINTER :: regions(:)
237 
238 ! ... loop variables
239  INTEGER :: ilb, ipatch
240 
241 ! ... local variables
242  LOGICAL :: hit, debug
243 
244  INTEGER :: ipcbeg, ipcend, jpcbeg, jpcend, kpcbeg, kpcend, ipatchsrc
245  INTEGER :: bctype, lbound, ibeg, iend, jbeg, jend, kbeg, kend
246 
247  TYPE(t_global), POINTER :: global
248  TYPE(t_patch), POINTER :: patch, patchsrc
249 
250 !******************************************************************************
251 
252  global => regions(1)%global
253 
254  CALL registerfunction( global,'PLAG_RFLO_FindSourceCell',&
255  'PLAG_RFLO_FindGridMapping.F90' )
256 
257  found = .false.
258 
259 ! Get dimensions --------------------------------------------------------------
260 
261  CALL rflo_getdimensphys( regions(ireg),ilev,ipcbeg,ipcend, &
262  jpcbeg,jpcend,kpcbeg,kpcend )
263 
264 ! Find a suitable patch to start from -----------------------------------------
265 
266  hit = .false. ! no patch found yet
267 
268 ! Check if cell is within the patch -------------------------------------------
269 
270  DO ipatch=1,regions(ireg)%nPatches
271  patch => regions(ireg)%levels(ilev)%patches(ipatch)
272  bctype = patch%bcType
273  lbound = patch%lbound
274  IF ((bctype>=bc_regionconf .AND. bctype<=bc_regionconf+bc_range) .OR. &
275  (bctype>=bc_tra_peri .AND. bctype<=bc_tra_peri +bc_range) .OR. &
276  (bctype>=bc_rot_peri .AND. bctype<=bc_rot_peri +bc_range)) THEN
277  CALL rflo_getpatchindices( regions(ireg),patch,ilev, &
278  ibeg,iend,jbeg,jend,kbeg,kend )
279  IF ((lbound==1 .AND. ic<ipcbeg) .OR. &
280  (lbound==2 .AND. ic>ipcend)) THEN
281  IF ((jc>=jbeg .AND. jc<=jend) .AND. &
282  (kc>=kbeg .AND. kc<=kend)) THEN
283  hit = .true.
284  EXIT
285  ENDIF
286  ELSE IF ((lbound==3 .AND. jc<jpcbeg) .OR. &
287  (lbound==4 .AND. jc>jpcend)) THEN
288  IF ((ic>=ibeg .AND. ic<=iend) .AND. &
289  (kc>=kbeg .AND. kc<=kend)) THEN
290  hit = .true.
291  EXIT
292  ENDIF
293  ELSE IF ((lbound==5 .AND. kc<kpcbeg) .OR. &
294  (lbound==6 .AND. kc>kpcend)) THEN
295  IF ((jc>=jbeg .AND. jc<=jend) .AND. &
296  (ic>=ibeg .AND. ic<=iend)) THEN
297  hit = .true.
298  EXIT
299  ENDIF
300  ENDIF
301  ENDIF ! bcType
302  ENDDO ! iPatch
303 
304 ! cell just outside the patch? ------------------------------------------------
305 
306  IF (.NOT. hit) THEN
307  DO ipatch=1,regions(ireg)%nPatches
308  patch => regions(ireg)%levels(ilev)%patches(ipatch)
309  bctype = patch%bcType
310  lbound = patch%lbound
311  IF ((bctype>=bc_regionconf .AND. bctype<=bc_regionconf+bc_range) .OR. &
312  (bctype>=bc_tra_peri .AND. bctype<=bc_tra_peri +bc_range) .OR. &
313  (bctype>=bc_rot_peri .AND. bctype<=bc_rot_peri +bc_range)) THEN
314  CALL rflo_getpatchindices( regions(ireg),patch,ilev, &
315  ibeg,iend,jbeg,jend,kbeg,kend )
316  IF ((lbound==1 .AND. ic<ipcbeg) .OR. &
317  (lbound==2 .AND. ic>ipcend)) THEN ! face 1, 2
318  IF (kc<kpcbeg .AND. kbeg==kpcbeg .AND. &
319  (jc>=jbeg .AND. jc<=jend)) THEN
320  hit = .true.
321  EXIT
322  ENDIF
323  IF (kc>kpcend .AND. kend==kpcend .AND. &
324  (jc>=jbeg .AND. jc<=jend)) THEN
325  hit = .true.
326  EXIT
327  ENDIF
328  IF (jc<jpcbeg .AND. jbeg==jpcbeg .AND. &
329  (kc>=kbeg .AND. kc<=kend)) THEN
330  hit = .true.
331  EXIT
332  ENDIF
333  IF (jc>jpcend .AND. jend==jpcend .AND. &
334  (kc>=kbeg .AND. kc<=kend)) THEN
335  hit = .true.
336  EXIT
337  ENDIF
338  ELSE IF ((lbound==3 .AND. jc<jpcbeg) .OR. &
339  (lbound==4 .AND. jc>jpcend)) THEN ! face 3, 4
340  IF (kc<kpcbeg .AND. kbeg==kpcbeg .AND. &
341  (ic>=ibeg .AND. ic<=iend)) THEN
342  hit = .true.
343  EXIT
344  ENDIF
345  IF (kc>kpcend .AND. kend==kpcend .AND. &
346  (ic>=ibeg .AND. ic<=iend)) THEN
347  hit = .true.
348  EXIT
349  ENDIF
350  IF (ic<ipcbeg .AND. ibeg==ipcbeg .AND. &
351  (kc>=kbeg .AND. kc<=kend)) THEN
352  hit = .true.
353  EXIT
354  ENDIF
355  IF (ic>ipcend .AND. iend==ipcend .AND. &
356  (kc>=kbeg .AND. kc<=kend)) THEN
357  hit = .true.
358  EXIT
359  ENDIF
360  ELSE IF ((lbound==5 .AND. kc<kpcbeg) .OR. &
361  (lbound==6 .AND. kc>kpcend)) THEN ! face 5, 6
362  IF (jc<jpcbeg .AND. jbeg==jpcbeg .AND. &
363  (ic>=ibeg .AND. ic<=iend)) THEN
364  hit = .true.
365  EXIT
366  ENDIF
367  IF (jc>jpcend .AND. jend==jpcend .AND. &
368  (ic>=ibeg .AND. ic<=iend)) THEN
369  hit = .true.
370  EXIT
371  ENDIF
372  IF (ic<ipcbeg .AND. ibeg==ipcbeg .AND. &
373  (jc>=jbeg .AND. jc<=jend)) THEN
374  hit = .true.
375  EXIT
376  ENDIF
377  IF (ic>ipcend .AND. iend==ipcend .AND. &
378  (jc>=jbeg .AND. jc<=jend)) THEN
379  hit = .true.
380  EXIT
381  ENDIF
382  ENDIF
383  ENDIF ! bcType
384  ENDDO ! iPatch
385  ENDIF ! .NOT. hit
386 
387 ! cell at some corner? --------------------------------------------------------
388 
389  IF (.NOT. hit) THEN
390  DO ipatch=1,regions(ireg)%nPatches
391  patch => regions(ireg)%levels(ilev)%patches(ipatch)
392  bctype = patch%bcType
393  lbound = patch%lbound
394  IF ((bctype>=bc_regionconf .AND. bctype<=bc_regionconf+bc_range) .OR. &
395  (bctype>=bc_tra_peri .AND. bctype<=bc_tra_peri +bc_range) .OR. &
396  (bctype>=bc_rot_peri .AND. bctype<=bc_rot_peri +bc_range)) THEN
397  CALL rflo_getpatchindices( regions(ireg),patch,ilev, &
398  ibeg,iend,jbeg,jend,kbeg,kend )
399  IF (ic<ipcbeg .AND. jc<jpcbeg .AND. kc<kpcbeg) THEN ! corner 1
400  IF ((lbound==1 .AND. jbeg==jpcbeg .AND. kbeg==kpcbeg) .OR. &
401  (lbound==3 .AND. ibeg==ipcbeg .AND. kbeg==kpcbeg) .OR. &
402  (lbound==5 .AND. ibeg==ipcbeg .AND. jbeg==jpcbeg)) THEN
403  hit = .true.
404  EXIT
405  ENDIF
406  ELSE IF (ic<ipcbeg .AND. jc<jpcbeg .AND. kc>kpcend) THEN ! corner 2
407  IF ((lbound==1 .AND. jbeg==jpcbeg .AND. kend==kpcend) .OR. &
408  (lbound==3 .AND. ibeg==ipcbeg .AND. kend==kpcend) .OR. &
409  (lbound==6 .AND. ibeg==ipcbeg .AND. jbeg==jpcbeg)) THEN
410  hit = .true.
411  EXIT
412  ENDIF
413  ELSE IF (ic<ipcbeg .AND. jc>jpcend .AND. kc>kpcend) THEN ! corner 3
414  IF ((lbound==1 .AND. jend==jpcend .AND. kend==kpcend) .OR. &
415  (lbound==4 .AND. ibeg==ipcbeg .AND. kend==kpcend) .OR. &
416  (lbound==6 .AND. ibeg==ipcbeg .AND. jend==jpcend)) THEN
417  hit = .true.
418  EXIT
419  ENDIF
420  ELSE IF (ic<ipcbeg .AND. jc>jpcend .AND. kc<kpcbeg) THEN ! corner 4
421  IF ((lbound==1 .AND. jend==jpcend .AND. kbeg==kpcbeg) .OR. &
422  (lbound==4 .AND. ibeg==ipcbeg .AND. kbeg==kpcbeg) .OR. &
423  (lbound==5 .AND. ibeg==ipcbeg .AND. jend==jpcend)) THEN
424  hit = .true.
425  EXIT
426  ENDIF
427  ELSE IF (ic>ipcend .AND. jc<jpcbeg .AND. kc<kpcbeg) THEN ! corner 5
428  IF ((lbound==2 .AND. jbeg==jpcbeg .AND. kbeg==kpcbeg) .OR. &
429  (lbound==3 .AND. iend==ipcend .AND. kbeg==kpcbeg) .OR. &
430  (lbound==5 .AND. iend==ipcend .AND. jbeg==jpcbeg)) THEN
431  hit = .true.
432  EXIT
433  ENDIF
434  ELSE IF (ic>ipcend .AND. jc<jpcbeg .AND. kc>kpcend) THEN ! corner 6
435  IF ((lbound==2 .AND. jbeg==jpcbeg .AND. kend==kpcend) .OR. &
436  (lbound==3 .AND. iend==ipcend .AND. kend==kpcend) .OR. &
437  (lbound==6 .AND. iend==ipcend .AND. jbeg==jpcbeg)) THEN
438  hit = .true.
439  EXIT
440  ENDIF
441  ELSE IF (ic>ipcend .AND. jc>jpcend .AND. kc>kpcend) THEN ! corner 7
442  IF ((lbound==2 .AND. jend==jpcend .AND. kend==kpcend) .OR. &
443  (lbound==4 .AND. iend==ipcend .AND. kend==kpcend) .OR. &
444  (lbound==6 .AND. iend==ipcend .AND. jend==jpcend)) THEN
445  hit = .true.
446  EXIT
447  ENDIF
448  ELSE IF (ic>ipcend .AND. jc>jpcend .AND. kc<kpcbeg) THEN ! corner 8
449  IF ((lbound==2 .AND. jend==jpcend .AND. kbeg==kpcbeg) .OR. &
450  (lbound==4 .AND. iend==ipcend .AND. kbeg==kpcbeg) .OR. &
451  (lbound==5 .AND. iend==ipcend .AND. jend==jpcend)) THEN
452  hit = .true.
453  EXIT
454  ENDIF
455  ENDIF
456  ENDIF ! bcType
457  ENDDO ! iPatch
458  ENDIF ! .NOT. hit
459 
460 ! if patch was found, do the transformation -----------------------------------
461 
462  IF (hit) THEN
463  bctype = patch%bcType
464  iregsrc = patch%srcRegion
465  ipatchsrc = patch%srcPatch
466  patchsrc => regions(iregsrc)%levels(ilev)%patches(ipatchsrc)
467  CALL plag_rflo_sourcecell( regions(ireg),regions(iregsrc),patch,patchsrc, &
468  ilev,ic,jc,kc,found,indexmapmat )
469  ELSE
470  iregsrc = ireg
471  ENDIF
472 
473 ! finalize --------------------------------------------------------------------
474 
475  CALL deregisterfunction( global )
476 
477 END SUBROUTINE plag_rflo_findsourcecell
478 
479 ! #############################################################################
480 ! #############################################################################
481 
482 SUBROUTINE plag_rflo_sourcecell( region,regionSrc,patch,patchSrc, &
483  ilev,ic,jc,kc,found,indexmapmat )
484 
485  USE moddatatypes
486  USE modbndpatch, ONLY : t_patch
487  USE moddatastruct, ONLY : t_region
488  USE modglobal, ONLY : t_global
489  USE modindexing, ONLY : indijkmap, getijk
492  USE moderror
493  USE modparameters
494  IMPLICIT NONE
495 
496 ! ... parameters
497  INTEGER, INTENT(IN) :: ilev
498  INTEGER, INTENT(INOUT) :: ic,jc,kc
499  INTEGER, INTENT(OUT) :: indexmapmat(3,4)
500 
501  LOGICAL, INTENT(INOUT) :: found
502 
503  TYPE(t_region) :: region, regionsrc
504  TYPE(t_patch), POINTER :: patch, patchsrc
505 
506 ! ... local variables
507  INTEGER :: ibeg, iend, jbeg, jend, kbeg, kend, idir, jdir, kdir
508  INTEGER :: ibegsrc, iendsrc, jbegsrc, jendsrc, kbegsrc, kendsrc, &
509  idirsrc, jdirsrc, kdirsrc, icoffsrc, ijcoffsrc, ijkcsrc
510  INTEGER :: lb, lbs, l1srcdir, l2srcdir, mapmat(3,4)
511  INTEGER :: ipcbeg, ipcend, jpcbeg, jpcend, kpcbeg, kpcend
512  INTEGER :: icell
513  INTEGER :: icsrc, jcsrc, kcsrc
514 
515  LOGICAL :: align
516 
517  TYPE(t_global), POINTER :: global
518 
519 !******************************************************************************
520 
521  global => region%global
522 
523  CALL registerfunction( global,'RFLO_SourceCell',&
524  'PLAG_RFLO_FindGridMapping.F90' )
525 
526 ! Get dimensions --------------------------------------------------------------
527 
528  CALL rflo_getpatchindices( region,patch,ilev,ibeg,iend, &
529  jbeg,jend,kbeg,kend )
530  CALL rflo_getpatchindices( regionsrc,patchsrc,ilev,ibegsrc,iendsrc, &
531  jbegsrc,jendsrc,kbegsrc,kendsrc )
533  CALL rflo_getpatchdirection( patchsrc,idirsrc,jdirsrc,kdirsrc )
534  CALL rflo_getcelloffset( regionsrc,ilev,icoffsrc,ijcoffsrc )
535 
536 ! Determine mapping between patches -------------------------------------------
537 
538  l1srcdir = 1
539  IF (patch%srcL1beg > patch%srcL1end) l1srcdir = -1
540  l2srcdir = 1
541  IF (patch%srcL2beg > patch%srcL2end) l2srcdir = -1
542 
543  lb = patch%lbound
544  lbs = patch%srcLbound
545  align = patch%align
546 
547  CALL rflo_getpatchmapping( lb,lbs,l1srcdir,l2srcdir,align, &
548  idir,jdir,kdir,idirsrc,jdirsrc,kdirsrc, &
549  ibeg,iend,jbeg,jend,kbeg,kend, &
550  ibegsrc,iendsrc,jbegsrc,jendsrc,kbegsrc,kendsrc, &
551  mapmat )
552 
553 ! Get cell indices on source patch --------------------------------------------
554 
555  icell = indijkmap( ic,jc,kc,mapmat,icoffsrc,ijcoffsrc )
556  CALL getijk( icell,icoffsrc,ijcoffsrc,regionsrc%nDumCells,ic,jc,kc )
557 
558 ! Check if ic,jc,kc within physical domain ------------------------------------
559 
560  CALL rflo_getdimensphys( regionsrc,ilev,ipcbeg,ipcend, &
561  jpcbeg,jpcend,kpcbeg,kpcend )
562 
563  IF ((ic>=ipcbeg .AND. ic<=ipcend) .AND. &
564  (jc>=jpcbeg .AND. jc<=jpcend) .AND. &
565  (kc>=kpcbeg .AND. kc<=kpcend)) THEN
566  found = .true.
567  indexmapmat = mapmat
568  ELSE
569  found = .false.
570  indexmapmat = -999999
571  ENDIF
572 
573 ! finalize
574 
575  CALL deregisterfunction( global )
576 
577 END SUBROUTINE plag_rflo_sourcecell
578 
579 ! #############################################################################
580 ! #############################################################################
581 
582 SUBROUTINE plag_rflo_getfacemapping( mapMat,srcDir,srcFace )
583 
584  USE moddatatypes
585  USE moderror
586  IMPLICIT NONE
587 
588 ! ... parameters
589  INTEGER, INTENT(IN) :: mapmat(3,4)
590  INTEGER, INTENT(OUT) :: srcdir(3)
591  INTEGER, INTENT(OUT) :: srcface(6)
592 
593 ! ... local variables
594  INTEGER :: idir, jdir, kdir
595  INTEGER :: idirsrc, jdirsrc,kdirsrc
596  INTEGER :: iface,jface,kface
597  INTEGER :: ifacesrc,jfacesrc,kfacesrc
598  INTEGER :: ifacesrcflip,jfacesrcflip,kfacesrcflip
599  INTEGER :: ifacepsrcflip,jfacepsrcflip,kfacepsrcflip
600 
601 !******************************************************************************
602 
603 ! Set dimensions --------------------------------------------------------------
604 
605  idir=1;jdir=2;kdir=3;
606  iface =1; jface=3; kface=5;
607 
608 ! Determine grid mapping of source region -------------------------------------
609 ! use absolute value since negative value is meaningless ---------------------
610 
611  idirsrc = abs( idir*mapmat(1,1) + jdir*mapmat(1,2) + kdir*mapmat(1,3) )
612  jdirsrc = abs( idir*mapmat(2,1) + jdir*mapmat(2,2) + kdir*mapmat(2,3) )
613  kdirsrc = abs( idir*mapmat(3,1) + jdir*mapmat(3,2) + kdir*mapmat(3,3) )
614 
615 ! determine face mapping of source region -------------------------------------
616 
617  ifacesrc = iface*mapmat(1,1) + jface*mapmat(1,2) + kface*mapmat(1,3)
618  jfacesrc = iface*mapmat(2,1) + jface*mapmat(2,2) + kface*mapmat(2,3)
619  kfacesrc = iface*mapmat(3,1) + jface*mapmat(3,2) + kface*mapmat(3,3)
620 
621 ! Swap face indices for negative values ---------------------------------------
622 
623  ifacesrcflip = ifacesrc
624  ifacepsrcflip = ifacesrc+1
625 
626  jfacesrcflip = jfacesrc
627  jfacepsrcflip = jfacesrc+1
628 
629  kfacesrcflip = kfacesrc
630  kfacepsrcflip = kfacesrc+1
631 
632  IF ( ifacesrc < 0 ) THEN
633  ifacesrcflip = abs(ifacesrc)+1
634  ifacepsrcflip = abs(ifacesrc)
635  ENDIF
636 
637  IF ( jfacesrc < 0 ) THEN
638  jfacesrcflip = abs(jfacesrc)+1
639  jfacepsrcflip = abs(jfacesrc)
640  ENDIF
641 
642  IF ( kfacesrc < 0 ) THEN
643  kfacesrcflip = abs(kfacesrc)+1
644  kfacepsrcflip = abs(kfacesrc)
645  ENDIF
646 
647 ! Load face indices of source region ------------------------------------------
648 
649  srcdir(1:3) = (/idirsrc,jdirsrc,kdirsrc/)
650 
651  srcface(1:6)=(/ifacesrcflip,ifacepsrcflip,jfacesrcflip,jfacepsrcflip, &
652  kfacesrcflip,kfacepsrcflip/)
653 
654 END SUBROUTINE plag_rflo_getfacemapping
655 
656 !******************************************************************************
657 !
658 ! RCS Revision history:
659 !
660 ! $Log: PLAG_RFLO_FindGridMapping.F90,v $
661 ! Revision 1.4 2008/12/06 08:44:34 mtcampbe
662 ! Updated license.
663 !
664 ! Revision 1.3 2008/11/19 22:17:47 mtcampbe
665 ! Added Illinois Open Source License/Copyright
666 !
667 ! Revision 1.2 2006/04/07 15:19:24 haselbac
668 ! Removed tabs
669 !
670 ! Revision 1.1 2004/12/01 20:58:10 fnajjar
671 ! Initial revision after changing case
672 !
673 ! Revision 1.1 2004/02/10 21:24:06 fnajjar
674 ! Initial import of index mapping capability for corner-edge regions
675 !
676 !******************************************************************************
677 
678 
679 
680 
681 
682 
683 
684 
685 
subroutine plag_rflo_getfacemapping(mapMat, srcDir, srcFace)
subroutine rflo_getedgecellsindices(region, iLev, iedge, iebeg, ieend, jebeg, jeend, kebeg, keend)
**********************************************************************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 ibeg
**********************************************************************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 kc
subroutine rflo_getpatchdirection(patch, idir, jdir, kdir)
j indices k indices k
Definition: Indexing.h:6
INTEGER function indijkmap(i, j, k, mapMat, iOffset, ijOffset)
Definition: ModIndexing.F90:67
**********************************************************************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 kpcbeg
subroutine plag_rflo_sourcecell(region, regionSrc, patch, patchSrc, iLev, ic, jc, kc, found, indexMapMat)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
**********************************************************************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 rflo_getpatchindices(region, patch, iLev, ibeg, iend, jbeg, jend, kbeg, kend)
subroutine plag_rflo_findgridmapping(regions)
subroutine plag_rflo_findsourcecell(regions, iReg, iLev, ic, jc, kc, found, iRegSrc, indexMapMat)
IndexType nedges() const
Definition: Mesh.H:564
**********************************************************************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 jpcbeg
**********************************************************************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 ipcend
subroutine rflo_getnodeoffset(region, iLev, iNodeOffset, ijNodeOffset)
**********************************************************************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 jdir
Definition: patch.h:74
**********************************************************************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 knode iend
**********************************************************************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 ipcbeg
blockLoc i
Definition: read.cpp:79
**********************************************************************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 idir
subroutine rflo_getcelloffset(region, iLev, iCellOffset, ijCellOffset)
**********************************************************************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 icorner
subroutine rflo_getcornercellsindices(region, iLev, icorner, icbeg, icend, jcbeg, jcend, kcbeg, kcend)
**********************************************************************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 icell
j indices j
Definition: Indexing.h:6
**********************************************************************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 jpcend
**********************************************************************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 knode jend
**********************************************************************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 kdir
bool debug(bool s=true)
Definition: GEM.H:193
**********************************************************************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 knode jbeg
subroutine rflo_getpatchmapping(lb, lbs, l1SrcDir, l2SrcDir, align, idir, jdir, kdir, idirSrc, jdirSrc, kdirSrc, ibeg, iend, jbeg, jend, kbeg, kend, ibegSrc, iendSrc, jbegSrc, jendSrc, kbegSrc, kendSrc, mapMat)
**********************************************************************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 knode kbeg
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine getijk(ijk, iOffset, ijOffset, nDumCells, i, j, k)
Definition: ModIndexing.F90:54
subroutine rflo_getdimensphys(region, iLev, ipcbeg, ipcend, jpcbeg, jpcend, kpcbeg, kpcend)
**********************************************************************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 jc