Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLO_GetGeometry.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: read grid from file, define geometry for dummy cells.
26 !
27 ! Description: none.
28 !
29 ! Input: regions = grid dimensions
30 ! input from file.
31 !
32 ! Output: regions%grid%xyz = grid coordinates.
33 !
34 ! Notes: none.
35 !
36 !******************************************************************************
37 !
38 ! $Id: RFLO_GetGeometry.F90,v 1.22 2008/12/06 08:44:27 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2001 by the University of Illinois
41 !
42 !******************************************************************************
43 
44 SUBROUTINE rflo_getgeometry( regions,iread )
45 
46  USE moddatatypes
47  USE moddatastruct, ONLY : t_region
48  USE modglobal, ONLY : t_global
49  USE modbndpatch, ONLY : t_patch
53 
65  USE moderror
66  USE modparameters
67  IMPLICIT NONE
68 
69 ! ... parameters
70  TYPE (t_region), POINTER :: regions(:)
71  INTEGER :: iread
72 
73 ! ... loop variables
74  INTEGER :: ireg, ipatch
75 
76 ! ... local variables
77  LOGICAL :: movegrid
78  REAL(RFREAL), POINTER :: xyzref(:,:)
79 
80  TYPE(t_global), POINTER :: global
81  TYPE(t_patch), POINTER :: patch
82 
83 !******************************************************************************
84 
85  global => regions(1)%global
86 
87  CALL registerfunction( global,'RFLO_GetGeometry',&
88  'RFLO_GetGeometry.F90' )
89 
90 ! read/receive grid data for all regions if grid motion active
91 
92  movegrid = .false.
93  DO ireg=1,global%nRegions
94  IF (regions(ireg)%mixtInput%moveGrid) movegrid = .true.
95  ENDDO
96 
97  IF (iread==1) THEN
98 #ifdef GENX
99  IF (movegrid) CALL rflo_readgrid( regions )
100 #else
101  CALL rflo_readgrid( regions )
102 #endif
103  CALL rflo_findfunkyblocks( regions )
104  ENDIF
105 
106 ! loop over all regions, generate coordinates of dummy nodes
107 
108  DO ireg=1,global%nRegions
109  IF (regions(ireg)%procid==global%myProcid .AND. & ! region active and
110  regions(ireg)%active==active) THEN ! on my processor
111  CALL rflo_generatecoarsegrids( regions(ireg) ) ! coarsen finest grid
112  CALL rflo_copygeometrydummy( regions(ireg) ) ! copy to dummy nodes
113  CALL rflo_extrapolategeometry( regions(ireg) ) ! extrapolate
114  ENDIF ! region on this processor and active
115  ENDDO ! iReg
116 
117 ! exchange geometry between regions
118 
119  CALL rflo_exchangegeometry( regions )
120 
121 ! store initial grid in separate arrays
122 
123  IF (iread==1 .AND. movegrid) THEN
124  DO ireg=1,global%nRegions
125  IF (regions(ireg)%procid==global%myProcid .AND. & ! region active and
126  regions(ireg)%active==active) THEN ! on my processor
127  IF (regions(ireg)%mixtInput%moveGrid) THEN
128 
129  xyzref => regions(ireg)%levels(1)%gridOld%xyzOld
130  xyzref = regions(ireg)%levels(1)%grid%xyz
131 
132  regions(ireg)%levels(1)%grid%boundFlat(:) = .true.
133  regions(ireg)%levels(1)%grid%edgeStraight(:) = .true.
134 
135  DO ipatch=1,regions(ireg)%nPatches
136  patch => regions(ireg)%levels(1)%patches(ipatch)
137  CALL rflo_gridflatpatch( regions(ireg),patch )
138  CALL rflo_arclengthpatch( regions(ireg),patch,xyzref )
139  ENDDO ! iPatch
140 
141  IF (global%moveGridScheme==movegrid_elglobal .OR. &
142  global%moveGridScheme==movegrid_elframe) THEN
143 
144  CALL rflo_gridcontrolmap3d( regions(ireg) )
145  CALL rflo_gridcontrolgrad3d( regions(ireg) )
146  CALL rflo_gridcontrolfunc3d( regions(ireg) )
147 
148  DO ipatch=1,regions(ireg)%nPatches
149  patch => regions(ireg)%levels(1)%patches(ipatch)
150  IF (patch%bndFlat) THEN
151  CALL rflo_gridcontrolmap2d( regions(ireg),patch,ipatch )
152  CALL rflo_gridcontrolgrad2d( regions(ireg),patch,ipatch )
153  CALL rflo_gridcontrolfunc2d( regions(ireg),patch,ipatch )
154  ENDIF ! flatPatch
155  ENDDO ! iPatch
156  ENDIF ! elliptic PDE
157 
158  ENDIF ! moveGrid
159  ENDIF ! region on this processor and active
160  ENDDO ! iReg
161  ENDIF ! iread
162 
163 ! identify regions and patches contributing to global aero coeffs.
164 ! based on original geometry and write to file
165 
166  IF (iread==1 .AND. global%aeroCoeffs==active) THEN
167  CALL rflo_findpatchcoeffsglo( regions )
168  CALL rflo_writepatchcoeffsinfo( regions )
169  ENDIF
170 
171 ! finalize
172 
173  CALL deregisterfunction( global )
174 
175 END SUBROUTINE rflo_getgeometry
176 
177 !******************************************************************************
178 !
179 ! RCS Revision history:
180 !
181 ! $Log: RFLO_GetGeometry.F90,v $
182 ! Revision 1.22 2008/12/06 08:44:27 mtcampbe
183 ! Updated license.
184 !
185 ! Revision 1.21 2008/11/19 22:17:38 mtcampbe
186 ! Added Illinois Open Source License/Copyright
187 !
188 ! Revision 1.20 2006/05/03 08:32:02 wasistho
189 ! added if (patch%bndFlat) condition for 2D grid control
190 !
191 ! Revision 1.19 2006/03/24 23:30:13 wasistho
192 ! added FindPatchCoeffs and WritePatchCoeffs..
193 !
194 ! Revision 1.18 2006/03/18 11:07:14 wasistho
195 ! moved gridFlatPatch and findFunky.. to ModGridRegionShape
196 !
197 ! Revision 1.17 2006/03/18 08:20:22 wasistho
198 ! called ArcLengthPatch
199 !
200 ! Revision 1.16 2006/03/14 04:34:04 wasistho
201 ! initialized edgeStraight
202 !
203 ! Revision 1.15 2006/03/12 22:07:02 wasistho
204 ! changed RFLO_ElliptFlatPatch to RFLO_GridFlatPatch
205 !
206 ! Revision 1.14 2006/03/12 10:29:54 wasistho
207 ! initialized boundFlat
208 !
209 ! Revision 1.13 2006/03/08 23:16:33 wasistho
210 ! made gridOld%xyzOld available for all type gm
211 !
212 ! Revision 1.12 2006/03/04 04:30:01 wasistho
213 ! added RFLO_FindFunkyBlocks
214 !
215 ! Revision 1.11 2006/03/02 01:27:32 wasistho
216 ! split movegrid_epde to elglobal and elframe
217 !
218 ! Revision 1.10 2006/03/02 00:23:22 wasistho
219 ! prepared elliptic pde grid motion
220 !
221 ! Revision 1.9 2006/02/11 03:35:55 wasistho
222 ! added calls controlGrad/Func 3D and 2D
223 !
224 ! Revision 1.8 2006/02/08 07:52:15 wasistho
225 ! added iPatch in controlMap2 argument
226 !
227 ! Revision 1.7 2006/01/20 08:45:40 wasistho
228 ! read .grda in Genx only for moving grid
229 !
230 ! Revision 1.6 2005/12/07 08:47:14 wasistho
231 ! added calls for surface mesh motion EPDE
232 !
233 ! Revision 1.5 2005/12/05 10:48:07 wasistho
234 ! added call RFLO_ElliptFlatPatch
235 !
236 ! Revision 1.4 2005/12/03 09:34:11 wasistho
237 ! compute control functions for movegrid EPDE
238 !
239 ! Revision 1.3 2005/11/28 20:04:48 wasistho
240 ! assigned gridOld%xyzOld
241 !
242 ! Revision 1.2 2005/05/27 08:08:27 wasistho
243 ! allow genx read initial grid
244 !
245 ! Revision 1.1 2004/11/29 20:51:39 wasistho
246 ! lower to upper case
247 !
248 ! Revision 1.10 2004/07/18 21:54:28 jiao
249 ! Updated not to call RFLO_ReadGrid in GENX.
250 !
251 ! Revision 1.9 2003/11/20 16:40:39 mdbrandy
252 ! Backing out RocfluidMP changes from 11-17-03
253 !
254 ! Revision 1.5 2003/05/15 02:57:04 jblazek
255 ! Inlined index function.
256 !
257 ! Revision 1.4 2002/09/20 22:22:36 jblazek
258 ! Finalized integration into GenX.
259 !
260 ! Revision 1.3 2002/09/05 17:40:21 jblazek
261 ! Variable global moved into regions().
262 !
263 ! Revision 1.2 2002/06/07 16:40:37 jblazek
264 ! Grid & solution for all regions in one file.
265 !
266 ! Revision 1.1 2002/02/25 22:36:52 jblazek
267 ! Simplified solver initialization routine.
268 !
269 !******************************************************************************
270 
271 
272 
273 
274 
275 
276 
subroutine rflo_copygeometrydummy(region)
subroutine, public rflo_gridcontrolfunc3d(region)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine, public rflo_findfunkyblocks(regions)
subroutine rflo_extrapolategeometry(region)
Definition: patch.h:74
subroutine rflo_exchangegeometry(regions)
subroutine rflo_generatecoarsegrids(region)
subroutine, public rflo_gridcontrolmap2d(region, patch, iPatch)
subroutine, public rflo_writepatchcoeffsinfo(regions)
subroutine, public rflo_gridcontrolmap3d(region)
subroutine, public rflo_gridcontrolgrad3d(region)
subroutine, public rflo_arclengthpatch(region, patch, xyzRef)
subroutine, public rflo_gridcontrolfunc2d(region, patch, iPatch)
subroutine rflo_readgrid(regions)
subroutine rflo_getgeometry(regions, iread)
subroutine, public rflo_gridflatpatch(region, patch)
subroutine, public rflo_gridcontrolgrad2d(region, patch, iPatch)
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine, public rflo_findpatchcoeffsglo(regions)