Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLU_PostProcessRegionsCommon1.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: Wrapper for postprocessing results without merging the regions.
26 !
27 ! Description: None.
28 !
29 ! Input:
30 ! pRegion Pointer to region data
31 !
32 ! Output: None.
33 !
34 ! Notes: None.
35 !
36 ! ******************************************************************************
37 !
38 ! $Id: RFLU_PostProcessRegionsCommon1.F90,v 1.12 2008/12/06 08:45:06 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2005 by the University of Illinois
41 !
42 ! ******************************************************************************
43 
44 SUBROUTINE rflu_postprocessregionscommon1(pRegion,postInfoFileExists)
45 
46  USE moddatatypes
47  USE modglobal, ONLY: t_global
48  USE moderror
49  USE moddatastruct, ONLY: t_region
50  USE modparameters
51 
63  USE rflu_modprobes
70  USE rflu_modweights
71 
72 #ifdef PLAG
74 #endif
75 
81  rflu_creategrid, &
96 
97  IMPLICIT NONE
98 
99 ! ******************************************************************************
100 ! Declarations and definitions
101 ! ******************************************************************************
102 
103 ! ==============================================================================
104 ! Arguments
105 ! ==============================================================================
106 
107  LOGICAL, INTENT(IN) :: postinfofileexists
108  TYPE(t_region), POINTER :: pregion
109 
110 ! ==============================================================================
111 ! Local variables
112 ! ==============================================================================
113 
114  CHARACTER(CHRLEN) :: rcsidentstring
115  INTEGER :: errorflag,ipatch,ireg
116  TYPE(t_global), POINTER :: global
117  TYPE(t_patch), POINTER :: ppatch
118 
119 ! ******************************************************************************
120 ! Start
121 ! ******************************************************************************
122 
123  rcsidentstring = '$RCSfile: RFLU_PostProcessRegionsCommon1.F90,v $ $Revision: 1.12 $'
124 
125  global => pregion%global
126 
127  CALL registerfunction(global,'RFLU_PostProcessRegionsCommon1',&
128  'RFLU_PostProcessRegionsCommon1.F90')
129 
130 ! ******************************************************************************
131 ! Read dimensions file, create grid, and read bc file
132 ! ******************************************************************************
133 
134  CALL rflu_readdimensionswrapper(pregion)
135  CALL rflu_creategrid(pregion)
136 
137  IF ( pregion%grid%nPatches > 0 ) THEN
138  CALL rflu_readbcinputfilewrapper(pregion)
139  END IF ! pRegion%grid%nPatches
140 
141 ! ******************************************************************************
142 ! Read grid, build data structures
143 ! ******************************************************************************
144 
145  CALL rflu_readgridwrapper(pregion)
146 
147  IF ( global%verbLevel > verbose_none ) THEN
148  CALL rflu_printgridinfo(pregion)
149  END IF ! global%verbLevel
150 
151  CALL rflu_createcellmapping(pregion)
152  CALL rflu_readloc2globcellmapping(pregion)
153  CALL rflu_buildglob2loccellmapping(pregion)
154 
155  CALL rflu_createbvertexlists(pregion)
156  CALL rflu_buildbvertexlists(pregion)
157 
158  CALL rflu_createfacelist(pregion)
159  CALL rflu_buildfacelist(pregion)
160  CALL rflu_renumberbfacelists(pregion)
161 
162  IF ( rflu_decidebuildgeometry(global) .EQV. .true. ) THEN
163  CALL rflu_creategeometry(pregion)
164  CALL rflu_buildgeometry(pregion)
165  END IF ! RFLU_DecideBuildGeometry
166 
167 ! ******************************************************************************
168 ! Read flow solution, define properties of mixture
169 ! ******************************************************************************
170 
171  CALL rflu_allocmemsolwrapper(pregion)
172  CALL rflu_setvarinfowrapper(pregion)
173  CALL rflu_allocatememorygspeeds(pregion)
174 
175  IF ( global%patchCoeffFlag .EQV. .true. ) THEN
176  CALL rflu_createpatchcoeffs(pregion)
177  END IF ! global%patchCoeffFlag
178 
179 #ifdef PLAG
180  IF ( global%plagUsed .EQV. .true. ) THEN
181  CALL plag_createsurfstats(pregion)
182  END IF ! global%plagUsed
183 #endif
184 
185  IF ( global%postPlotType == plot_grid_flow ) THEN
186  CALL rflu_readflowwrapper(pregion)
187  CALL rflu_setvarswrapper(pregion,1,pregion%grid%nCellsTot)
188 
189  IF ( global%verbLevel > verbose_none ) THEN
190  CALL rflu_printflowinfowrapper(pregion)
191  END IF ! global%verbLevel
192 
193  IF ( global%patchCoeffFlag .EQV. .true. ) THEN
194  CALL rflu_readpatchcoeffswrapper(pregion)
195  END IF ! global%patchCoeffFlag
196 
197 #ifdef PLAG
198  IF ( global%plagUsed .EQV. .true. ) THEN
199  CALL plag_readsurfstatswrapper(pregion)
200  END IF ! global%plagUsed
201 #endif
202  END IF ! global%postPlotType
203 
204 ! ******************************************************************************
205 ! Compute plotting variables and errors. NOTE need to be done together because
206 ! need gradients and weights for both and would be wasteful to do twice.
207 ! NOTE always use order 1 for cell gradients.
208 ! ******************************************************************************
209 
210  IF ( global%postPlotType == plot_grid_flow ) THEN
211 
212 ! ==============================================================================
213 ! Build stencils and compute weights
214 ! ==============================================================================
215 
216  IF ( rflu_decidebuildstencilsweights(global) .EQV. .true. ) THEN
217  CALL rflu_createvert2celllist(pregion)
218  CALL rflu_buildvert2celllist(pregion)
219 
220  IF ( pregion%mixtInput%stencilDimensCells == 1 ) THEN
221  CALL rflu_createcell2facelist(pregion)
222  CALL rflu_buildcell2facelist(pregion)
223  END IF ! pRegion%mixtInput%stencilDimensCells
224 
225  CALL rflu_setinfoc2cstencilwrapper(pregion,1)
226  CALL rflu_createc2cstencilwrapper(pregion)
227  CALL rflu_buildc2cstencilwrapper(pregion,constrinput=constr_none)
228 
229  IF ( pregion%mixtInput%stencilDimensCells == 1 ) THEN
230  CALL rflu_destroycell2facelist(pregion)
231  END IF ! pRegion%mixtInput%stencilDimensCells
232 
233  CALL rflu_destroyvert2celllist(pregion)
234 
235  CALL rflu_createwtsc2cwrapper(pregion,1)
236  CALL rflu_computewtsc2cwrapper(pregion,1)
237  END IF ! RFLU_DecideBuildStencilsWeights
238 
239 ! ==============================================================================
240 ! Compute plotting variables
241 ! ==============================================================================
242 
243  IF ( rflu_decidecomputeplottingvars(pregion) .EQV. .true. ) THEN
244  CALL rflu_countplottingvars(pregion)
245  CALL rflu_createplottingvarmaps(pregion)
246  CALL rflu_buildplottingvarmaps(pregion)
247  CALL rflu_printplottingvarsinfo(pregion)
248  CALL rflu_createplottingvars(pregion)
249  CALL rflu_computeplottingvarswrapper(pregion)
250  END IF ! RFLU_DecideComputePlottingVars
251 
252 ! ==============================================================================
253 ! Compute errors
254 ! ==============================================================================
255 
256  IF ( global%initFlowFlag == initflow_fromhardcode ) THEN
257  CALL rflu_computeexactflowerror(pregion)
258  END IF ! global%initFlowFlag
259 
260 ! ==============================================================================
261 ! Destroy stencils and weights
262 ! ==============================================================================
263 
264  IF ( rflu_decidebuildstencilsweights(global) .EQV. .true. ) THEN
265  CALL rflu_destroywtsc2cwrapper(pregion)
266  CALL rflu_destroyc2cstencilwrapper(pregion)
267  END IF ! RFLU_DecideBuildStencilsWeights
268  END IF ! global%postPlotType
269 
270 ! ******************************************************************************
271 ! Compute errors at probe locations
272 ! ******************************************************************************
273 
274  IF ( (global%nProbes > 0) .AND. &
275  (global%postCompErrFlag .EQV. .true.) .AND. &
276  (global%flowType == flow_unsteady) .AND. &
277  (global%initFlowFlag == initflow_fromhardcode) ) THEN
278  CALL rflu_createcell2facelist(pregion)
279  CALL rflu_buildcell2facelist(pregion)
280  CALL rflu_findprobecells(pregion)
281  CALL rflu_destroycell2facelist(pregion)
282  CALL rflu_openprobefiles(pregion)
283  CALL rflu_computeexactflowprobeerror(pregion)
284  CALL rflu_closeprobefiles(pregion)
285  END IF ! global%nProbes
286 
287 ! ******************************************************************************
288 ! Extract data from solution
289 ! ******************************************************************************
290 
291  IF ( global%postExtractFlag .EQV. .true. ) THEN
292  CALL rflu_extractflowdata(pregion)
293  END IF ! global%postExtractFlag
294 
295 ! ******************************************************************************
296 ! Interpolate data from cell centers to vertices
297 ! ******************************************************************************
298 
299  IF ( (global%postPlotType == plot_grid_flow) .AND. &
300  (global%postInterpType /= interp_type_none) ) THEN
301  CALL rflu_createvert2celllist(pregion)
302  CALL rflu_buildvert2celllist(pregion)
303 
304  IF ( global%postInterpType == interp_type_proper ) THEN
305  CALL rflu_setinfostencilvert2cell(pregion,global%postInterpOrder)
306  CALL rflu_createstencilvert2cell(pregion)
307  CALL rflu_buildstencilvert2cell(pregion)
308  END IF ! global%postInterpType
309 
310  CALL rflu_allocmemvertwrapper(pregion)
311  CALL rflu_interpolatewrapper(pregion)
312 
313  IF ( global%postInterpType == interp_type_proper ) THEN
314  CALL rflu_destroystencilvert2cell(pregion)
315  END IF ! global%postInterpType
316 
317  CALL rflu_destroyvert2celllist(pregion)
318  END IF ! global%postPlotType
319 
320 ! ******************************************************************************
321 ! Read information on special cells and faces
322 ! ******************************************************************************
323 
324  IF ( postinfofileexists .EQV. .true. ) THEN
325  CALL rflu_readpostinfo(pregion,infofile_readmode_data)
326  END IF ! postInfoFileExists
327 
328 ! ******************************************************************************
329 ! End
330 ! ******************************************************************************
331 
332  CALL deregisterfunction(global)
333 
334 END SUBROUTINE rflu_postprocessregionscommon1
335 
336 ! ******************************************************************************
337 !
338 ! RCS Revision history:
339 !
340 ! $Log: RFLU_PostProcessRegionsCommon1.F90,v $
341 ! Revision 1.12 2008/12/06 08:45:06 mtcampbe
342 ! Updated license.
343 !
344 ! Revision 1.11 2008/11/19 22:18:17 mtcampbe
345 ! Added Illinois Open Source License/Copyright
346 !
347 ! Revision 1.10 2007/03/19 21:45:19 haselbac
348 ! Adapted to changes related to plotting variables
349 !
350 ! Revision 1.9 2006/04/07 15:19:26 haselbac
351 ! Removed tabs
352 !
353 ! Revision 1.8 2006/04/07 14:57:43 haselbac
354 ! Adapted to new stencilDimens param
355 !
356 ! Revision 1.7 2006/01/06 22:20:51 haselbac
357 ! Rewrote so can compute errors of gradients
358 !
359 ! Revision 1.6 2005/12/10 16:57:30 haselbac
360 ! Added use of RFLU_DecideComputePlottingVars
361 !
362 ! Revision 1.5 2005/12/10 13:57:17 haselbac
363 ! Bug fix: Only need to build geometry when necessary
364 !
365 ! Revision 1.4 2005/11/10 16:51:29 fnajjar
366 ! Added plagUsed IF statement around PLAG routines
367 !
368 ! Revision 1.3 2005/10/27 19:22:30 haselbac
369 ! Adapted to changes in stencil routine names
370 !
371 ! Revision 1.2 2005/10/05 20:53:00 haselbac
372 ! Fixed missing module bugs
373 !
374 ! Revision 1.1 2005/10/05 20:23:34 haselbac
375 ! Initial revision
376 !
377 ! ******************************************************************************
378 
379 
380 
381 
382 
383 
384 
subroutine, public rflu_buildcell2facelist(pRegion)
subroutine, public rflu_destroycell2facelist(pRegion)
subroutine rflu_creategrid(pRegion)
subroutine rflu_computeexactflowerror(pRegion)
subroutine, public rflu_buildbvertexlists(pRegion)
subroutine, public rflu_createc2cstencilwrapper(pRegion)
subroutine, public rflu_extractflowdata(pRegion)
subroutine, public rflu_createwtsc2cwrapper(pRegion, order)
subroutine rflu_deallocmemvertwrapper(pRegion)
subroutine rflu_destroygrid(pRegion)
subroutine rflu_setvarswrapper(pRegion, icgBeg, icgEnd)
subroutine, public rflu_readdimensionswrapper(pRegion)
subroutine, public rflu_readpatchcoeffswrapper(pRegion)
subroutine, public rflu_createcell2facelist(pRegion)
subroutine, public rflu_setinfostencilvert2cell(pRegion, orderNominal)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
LOGICAL function rflu_decidebuildstencilsweights(global)
subroutine, public rflu_readgridwrapper(pRegion)
subroutine rflu_printheader(global)
subroutine, public rflu_createvert2celllist(pRegion)
subroutine, public rflu_buildgeometry(pRegion, sypeFaceFlag)
subroutine, public rflu_readbcinputfilewrapper(pRegion)
subroutine, public rflu_printplottingvarsinfo(pRegion)
subroutine, public rflu_findprobecells(pRegion)
subroutine rflu_setvarinfowrapper(pRegion)
subroutine, public rflu_createstencilvert2cell(pRegion)
subroutine, public rflu_readloc2globcellmapping(pRegion)
subroutine, public rflu_openprobefiles(pRegion)
subroutine, public rflu_buildstencilvert2cell(pRegion)
subroutine rflu_postprocessregionscommon1(pRegion, postInfoFileExists)
subroutine, public rflu_createfacelist(pRegion)
subroutine, public rflu_countplottingvars(pRegion)
subroutine rflu_setpatchplotflags(pRegion)
subroutine, public rflu_buildglob2loccellmapping(pRegion)
subroutine, public rflu_destroyc2cstencilwrapper(pRegion)
subroutine, public plag_readsurfstatswrapper(pRegion)
subroutine rflu_allocmemvertwrapper(pRegion)
subroutine, public plag_createsurfstats(pRegion)
subroutine rflu_deallocmemsolwrapper(pRegion)
subroutine rflu_computeexactflowprobeerror(pRegion)
subroutine, public rflu_buildfacelist(pRegion)
subroutine, public rflu_renumberbfacelists(pRegion)
subroutine, public rflu_destroystencilvert2cell(pRegion)
subroutine rflu_openpostinfo(global, fileStatus, fileExists)
subroutine rflu_closepostinfo(global)
subroutine, public rflu_readflowwrapper(pRegion)
LOGICAL function, public rflu_decidecomputeplottingvars(pRegion)
subroutine rflu_allocmemsolwrapper(pRegion)
subroutine, public rflu_destroyvert2celllist(pRegion)
subroutine, public rflu_createpatchcoeffs(pRegion)
subroutine, public rflu_computewtsc2cwrapper(pRegion, order)
subroutine, public rflu_createbvertexlists(pRegion)
subroutine, public rflu_setinfoc2cstencilwrapper(pRegion, orderNominal)
LOGICAL function rflu_decidebuildgeometry(global)
subroutine, public rflu_buildc2cstencilwrapper(pRegion, icgInput, constrInput)
subroutine rflu_printgridinfo(pRegion)
subroutine, public rflu_destroywtsc2cwrapper(pRegion)
subroutine, public rflu_buildplottingvarmaps(pRegion)
subroutine, public rflu_computeplottingvarswrapper(pRegion)
subroutine, public rflu_createplottingvars(pRegion)
subroutine rflu_readpostinfo(pRegion, readMode)
subroutine, public rflu_createcellmapping(pRegion)
subroutine, public rflu_allocatememorygspeeds(pRegion)
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine, public rflu_creategeometry(pRegion)
subroutine rflu_interpolatewrapper(pRegion)
subroutine, public rflu_closeprobefiles(pRegion)
subroutine, public rflu_buildvert2celllist(pRegion)
subroutine, public rflu_createplottingvarmaps(pRegion)
subroutine rflu_printflowinfowrapper(pRegion)