Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLO_ExchangeGeometry.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: exchange grid coordinates between regions or between periodic
26 ! boundaries.
27 !
28 ! Description: none.
29 !
30 ! Input: regions%levels%grid = coordinates (physical cells) and dimensions
31 !
32 ! Output: regions%levels%grid%xyz = coordinates (dummy cells)
33 !
34 ! Notes: only region interfaces with continuous grid are treated here.
35 !
36 !******************************************************************************
37 !
38 ! $Id: RFLO_ExchangeGeometry.F90,v 1.3 2008/12/06 08:44:26 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2001 by the University of Illinois
41 !
42 !******************************************************************************
43 
44 SUBROUTINE rflo_exchangegeometry( regions )
45 
46  USE moddatatypes
47  USE modbndpatch, ONLY : t_patch
48  USE moddatastruct, ONLY : t_region
49  USE modglobal, ONLY : t_global
54  USE moderror
55  USE modparameters
56  IMPLICIT NONE
57 
58 ! ... parameters
59  TYPE(t_region), POINTER :: regions(:)
60 
61 ! ... loop variables
62  INTEGER :: ireg, ipatch
63 
64 ! ... local variables
65  INTEGER :: bctype, iregsrc, ipatchsrc
66 
67  TYPE(t_patch), POINTER :: patch, patchsrc
68  TYPE(t_global), POINTER :: global
69 
70 !******************************************************************************
71 
72  global => regions(1)%global
73 
74  CALL registerfunction( global,'RFLO_ExchangeGeometry',&
75  'RFLO_ExchangeGeometry.F90' )
76 
77 ! exchange orientation of l1/2-directions -------------------------------------
78 
79  CALL rflo_exchangegeometryprepare( regions )
80 
81 ! exchange/send geometry between/to patches -----------------------------------
82 
83  DO ireg=1,global%nRegions
84  IF (regions(ireg)%procid==global%myProcid .AND. & ! region active and
85  regions(ireg)%active==active) THEN ! on my processor
86 
87 ! --- loop over patches (finest grid level)
88 
89  DO ipatch=1,regions(ireg)%nPatches
90  patch => regions(ireg)%levels(1)%patches(ipatch)
91  bctype = patch%bcType
92 
93 ! ----- conforming inter-region boundary, translational
94 ! and rotational periodicity
95 
96  IF ((bctype>=bc_regionconf .AND. bctype<=bc_regionconf+bc_range) .OR. &
97  (bctype>=bc_tra_peri .AND. bctype<=bc_tra_peri +bc_range) .OR. &
98  (bctype>=bc_rot_peri .AND. bctype<=bc_rot_peri +bc_range)) THEN
99  iregsrc = patch%srcRegion
100  ipatchsrc = patch%srcPatch
101  patchsrc => regions(iregsrc)%levels(1)%patches(ipatchsrc)
102 
103  IF (regions(iregsrc)%procid == global%myProcid) THEN
104  CALL rflo_exchangegeometrycopy( regions(ireg),regions(iregsrc), &
105  patch,patchsrc )
106  CALL rflo_exchangegeometrylevels( regions(ireg),ipatch )
107  ELSE
108  CALL rflo_exchangegeometrysend( regions(ireg),regions(iregsrc), &
109  patch )
110  ENDIF
111  ENDIF ! bcType
112  ENDDO ! iPatch
113 
114  ENDIF ! region on this processor and active
115  ENDDO ! iReg
116 
117 ! receive geometry ------------------------------------------------------------
118 
119  DO ireg=1,global%nRegions
120  IF (regions(ireg)%procid==global%myProcid .AND. & ! region active and
121  regions(ireg)%active==active) THEN ! on my processor
122 
123 ! --- loop over patches (finest grid level)
124 
125  DO ipatch=1,regions(ireg)%nPatches
126  patch => regions(ireg)%levels(1)%patches(ipatch)
127  bctype = patch%bcType
128 
129 ! ----- conforming inter-region boundary, translational
130 ! or rotational periodicity
131 
132  IF ((bctype>=bc_regionconf .AND. bctype<=bc_regionconf+bc_range) .OR. &
133  (bctype>=bc_tra_peri .AND. bctype<=bc_tra_peri +bc_range) .OR. &
134  (bctype>=bc_rot_peri .AND. bctype<=bc_rot_peri +bc_range)) THEN
135  iregsrc = patch%srcRegion
136  ipatchsrc = patch%srcPatch
137  patchsrc => regions(iregsrc)%levels(1)%patches(ipatchsrc)
138 
139  IF (regions(iregsrc)%procid /= global%myProcid) THEN
140  CALL rflo_exchangegeometryrecv( regions(ireg),regions(iregsrc), &
141  patch,patchsrc )
142  CALL rflo_exchangegeometrylevels( regions(ireg),ipatch )
143  ENDIF
144  ENDIF ! bcType
145  ENDDO ! iPatch
146 
147  ENDIF ! region on this processor and active
148  ENDDO ! iReg
149 
150 ! clear send requests ---------------------------------------------------------
151 
152  DO ireg=1,global%nRegions
153  IF (regions(ireg)%procid==global%myProcid .AND. & ! region active and
154  regions(ireg)%active==active) THEN ! on my processor
155  CALL rflo_clearsendrequests( regions,ireg,.true. )
156  ENDIF
157  ENDDO
158 
159 ! finalize --------------------------------------------------------------------
160 
161  CALL deregisterfunction( global )
162 
163 END SUBROUTINE rflo_exchangegeometry
164 
165 !******************************************************************************
166 !
167 ! RCS Revision history:
168 !
169 ! $Log: RFLO_ExchangeGeometry.F90,v $
170 ! Revision 1.3 2008/12/06 08:44:26 mtcampbe
171 ! Updated license.
172 !
173 ! Revision 1.2 2008/11/19 22:17:37 mtcampbe
174 ! Added Illinois Open Source License/Copyright
175 !
176 ! Revision 1.1 2004/11/29 20:51:39 wasistho
177 ! lower to upper case
178 !
179 ! Revision 1.17 2003/11/20 16:40:39 mdbrandy
180 ! Backing out RocfluidMP changes from 11-17-03
181 !
182 ! Revision 1.13 2003/05/15 02:57:04 jblazek
183 ! Inlined index function.
184 !
185 ! Revision 1.12 2003/03/14 22:05:11 jblazek
186 ! Improved mesh motion algorithm - node movement exchaged between blocks.
187 !
188 ! Revision 1.11 2002/12/06 22:29:26 jblazek
189 ! Corrected bug for geometry exchange between minimal patches.
190 !
191 ! Revision 1.10 2002/09/27 00:57:10 jblazek
192 ! Changed makefiles - no makelinks needed.
193 !
194 ! Revision 1.9 2002/09/05 17:40:21 jblazek
195 ! Variable global moved into regions().
196 !
197 ! Revision 1.8 2002/06/22 01:13:38 jblazek
198 ! Modified interfaces to BC routines.
199 !
200 ! Revision 1.7 2002/04/01 19:36:08 jblazek
201 ! Added routine to clear send requests.
202 !
203 ! Revision 1.6 2002/03/18 23:11:33 jblazek
204 ! Finished multiblock and MPI.
205 !
206 ! Revision 1.5 2002/02/21 23:25:06 jblazek
207 ! Blocks renamed as regions.
208 !
209 ! Revision 1.4 2002/02/09 01:47:01 jblazek
210 ! Added multi-probe option, residual smoothing, physical time step.
211 !
212 ! Revision 1.3 2002/01/08 22:09:17 jblazek
213 ! Added calculation of face vectors and volumes.
214 !
215 ! Revision 1.2 2002/01/02 16:04:20 jblazek
216 ! Added routines to generate geometry for dummy cells.
217 !
218 ! Revision 1.1 2001/12/19 23:09:22 jblazek
219 ! Added routines to read grid and solution.
220 !
221 !******************************************************************************
222 
223 
224 
225 
226 
227 
228 
subroutine rflo_exchangegeometrycopy(region, regionSrc, patch, patchSrc)
subroutine rflo_exchangegeometryrecv(region, regionSrc, patch, patchSrc)
subroutine rflo_exchangegeometrylevels(region, iPatch)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine rflo_exchangegeometrysend(region, regionSrc, patch)
Definition: patch.h:74
subroutine rflo_exchangegeometry(regions)
subroutine rflo_clearsendrequests(regions, iReg, geometry)
subroutine rflo_exchangegeometryprepare(regions)
subroutine deregisterfunction(global)
Definition: ModError.F90:469