Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLO_ExchangeGeometryLevels.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: coarsen dummy cells at patches associated with interblock
26 ! or periodic boundaries (where real geometry was copied to).
27 !
28 ! Description: none.
29 !
30 ! Input: region = current region
31 ! iPatch = current patch
32 !
33 ! Output: region%levels%grid%xyz = geometry in dummy cells at coarse levels.
34 !
35 ! Notes: none.
36 !
37 !******************************************************************************
38 !
39 ! $Id: RFLO_ExchangeGeometryLevels.F90,v 1.3 2008/12/06 08:44:26 mtcampbe Exp $
40 !
41 ! Copyright: (c) 2001 by the University of Illinois
42 !
43 !******************************************************************************
44 
45 SUBROUTINE rflo_exchangegeometrylevels( region,iPatch )
46 
47  USE moddatatypes
48  USE modbndpatch, ONLY : t_patch
49  USE moddatastruct, ONLY : t_region
52  USE moderror
53  USE modparameters
54  IMPLICIT NONE
55 
56 #include "Indexing.h"
57 
58 ! ... parameters
59  TYPE(t_region) :: region
60 
61  INTEGER :: ipatch
62 
63 ! ... loop variables
64  INTEGER :: idum, ilev, i, j, k, ii, jj, kk
65 
66 ! ... local variables
67  INTEGER :: ibegf, iendf, jbegf, jendf, kbegf, kendf, idir, jdir, kdir, &
68  inofffine, ijnofffine, ijkf
69  INTEGER :: ibegc, iendc, jbegc, jendc, kbegc, kendc, &
70  inoffcoarse, ijnoffcoarse, ijkc
71 
72  REAL(RFREAL), POINTER :: xyzfine(:,:), xyzcoarse(:,:)
73 
74  TYPE(t_patch), POINTER :: patchfine, patchcoarse
75 
76 !******************************************************************************
77 
78  CALL registerfunction( region%global,'RFLO_ExchangeGeometryLevels',&
79  'RFLO_ExchangeGeometryLevels.F90' )
80 
81 ! loop over dummy nodes of current patch
82 
83  DO ilev=2,region%nGridLevels
84 
85  xyzfine => region%levels(ilev-1)%grid%xyz
86  xyzcoarse => region%levels(ilev )%grid%xyz
87  patchfine => region%levels(ilev-1)%patches(ipatch)
88  patchcoarse => region%levels(ilev )%patches(ipatch)
89 
90  CALL rflo_getpatchindicesnodes( region,patchfine ,ilev-1,ibegf,iendf, &
91  jbegf,jendf,kbegf,kendf )
92  CALL rflo_getpatchindicesnodes( region,patchcoarse,ilev ,ibegc,iendc, &
93  jbegc,jendc,kbegc,kendc )
94  CALL rflo_getpatchdirection( patchfine,idir,jdir,kdir )
95  CALL rflo_getnodeoffset( region,ilev-1,inofffine ,ijnofffine )
96  CALL rflo_getnodeoffset( region,ilev ,inoffcoarse,ijnoffcoarse )
97 
98  DO idum=1,region%nDumCells
99  DO k=kbegc,kendc
100  kk = (k-kbegc)*(2-abs(kdir)) + kbegf
101  DO j=jbegc,jendc
102  jj = (j-jbegc)*(2-abs(jdir)) + jbegf
103  DO i=ibegc,iendc
104  ii = (i-ibegc)*(2-abs(idir)) + ibegf
105  ijkf = indijk(ii-idum*idir,jj-idum*jdir,kk-idum*kdir,inofffine ,ijnofffine )
106  ijkc = indijk( i-idum*idir, j-idum*jdir, k-idum*kdir,inoffcoarse,ijnoffcoarse)
107 
108  xyzcoarse(xcoord,ijkc) = xyzfine(xcoord,ijkf)
109  xyzcoarse(ycoord,ijkc) = xyzfine(ycoord,ijkf)
110  xyzcoarse(zcoord,ijkc) = xyzfine(zcoord,ijkf)
111  ENDDO ! i
112  ENDDO ! j
113  ENDDO ! k
114  ENDDO ! idum
115 
116  ENDDO ! iLev
117 
118 ! finalize
119 
120  CALL deregisterfunction( region%global )
121 
122 END SUBROUTINE rflo_exchangegeometrylevels
123 
124 !******************************************************************************
125 !
126 ! RCS Revision history:
127 !
128 ! $Log: RFLO_ExchangeGeometryLevels.F90,v $
129 ! Revision 1.3 2008/12/06 08:44:26 mtcampbe
130 ! Updated license.
131 !
132 ! Revision 1.2 2008/11/19 22:17:37 mtcampbe
133 ! Added Illinois Open Source License/Copyright
134 !
135 ! Revision 1.1 2004/11/29 20:51:39 wasistho
136 ! lower to upper case
137 !
138 ! Revision 1.9 2003/11/20 16:40:39 mdbrandy
139 ! Backing out RocfluidMP changes from 11-17-03
140 !
141 ! Revision 1.5 2003/05/15 02:57:04 jblazek
142 ! Inlined index function.
143 !
144 ! Revision 1.4 2002/09/27 00:57:10 jblazek
145 ! Changed makefiles - no makelinks needed.
146 !
147 ! Revision 1.3 2002/09/05 17:40:21 jblazek
148 ! Variable global moved into regions().
149 !
150 ! Revision 1.2 2002/06/22 01:13:38 jblazek
151 ! Modified interfaces to BC routines.
152 !
153 ! Revision 1.1 2002/03/18 23:11:33 jblazek
154 ! Finished multiblock and MPI.
155 !
156 !******************************************************************************
157 
158 
159 
160 
161 
162 
163 
subroutine rflo_getpatchdirection(patch, idir, jdir, kdir)
subroutine rflo_exchangegeometrylevels(region, iPatch)
j indices k indices k
Definition: Indexing.h:6
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
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
subroutine rflo_getpatchindicesnodes(region, patch, iLev, ibeg, iend, jbeg, jend, kbeg, kend)
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
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 kdir
subroutine deregisterfunction(global)
Definition: ModError.F90:469