Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLU_PrintGridInfo.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: Display information on grid.
26 !
27 ! Description: None.
28 !
29 ! Input:
30 ! pRegion Pointer to region
31 !
32 ! Output: N/A.
33 !
34 ! Notes: None.
35 !
36 ! ******************************************************************************
37 !
38 ! $Id: RFLU_PrintGridInfo.F90,v 1.15 2008/12/06 08:44:12 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2000-2004 by the University of Illinois
41 !
42 ! ******************************************************************************
43 
44 SUBROUTINE rflu_printgridinfo(pRegion)
45 
46  USE modglobal, ONLY: t_global
47  USE moddatatypes
48  USE modparameters
49  USE moderror
50 
51  USE modgrid, ONLY: t_grid
52  USE modbndpatch, ONLY: t_patch
53  USE moddatastruct, ONLY: t_region
54 
55  IMPLICIT NONE
56 
57 ! ******************************************************************************
58 ! Declarations and definitions
59 ! ******************************************************************************
60 
61 ! ==============================================================================
62 ! Parameters
63 ! ==============================================================================
64 
65  TYPE(t_region), POINTER :: pregion
66 
67 ! ==============================================================================
68 ! Local variables
69 ! ==============================================================================
70 
71  CHARACTER(CHRLEN) :: rcsidentstring
72  INTEGER :: ipatch,nbquads,nbquadstot,nbtris,nbtristot
73  INTEGER :: dummy(1)
74  INTEGER :: loc(xcoord:zcoord,min_val:max_val)
75  TYPE(t_grid), POINTER :: pgrid
76  TYPE(t_patch), POINTER :: ppatch
77  TYPE(t_global), POINTER :: global
78 
79  rcsidentstring = '$RCSfile: RFLU_PrintGridInfo.F90,v $ $Revision: 1.15 $'
80 
81 ! ******************************************************************************
82 ! Start
83 ! ******************************************************************************
84 
85  global => pregion%global
86 
87  CALL registerfunction(global,'RFLU_PrintGridInfo',&
88  'RFLU_PrintGridInfo.F90')
89 
90  IF ( global%verbLevel >= verbose_med ) THEN
91  WRITE(stdout,'(A,1X,A)') solver_name
92  WRITE(stdout,'(A,1X,A)') solver_name,'Printing grid information...'
93  WRITE(stdout,'(A,3X,A,1X,I5.5)') solver_name,'Global region:', &
94  pregion%iRegionGlobal
95  IF ( global%flowType == flow_unsteady ) THEN
96  WRITE(stdout,'(A,3X,A,1X,1PE11.5)') solver_name,'Current time:', &
97  global%currentTime
98  END IF ! global%flowType
99  END IF ! global%verbLevel
100 
101 ! ==============================================================================
102 ! Set pointers
103 ! ==============================================================================
104 
105  pgrid => pregion%grid
106 
107 ! ==============================================================================
108 ! Compute patch dimensions here to be independent
109 ! ==============================================================================
110 
111  nbtris = 0
112  nbtristot = 0
113  nbquads = 0
114  nbquadstot = 0
115 
116  DO ipatch = 1,pgrid%nPatches
117  ppatch => pregion%patches(ipatch)
118 
119  nbtris = nbtris + ppatch%nBTris
120  nbtristot = nbtristot + ppatch%nBTrisTot
121  nbquads = nbquads + ppatch%nBQuads
122  nbquadstot = nbquadstot + ppatch%nBQuadsTot
123  END DO ! iPatch
124 
125 ! ==============================================================================
126 ! Grid dimensions
127 ! ==============================================================================
128 
129  IF ( global%verbLevel >= verbose_med ) THEN
130  WRITE(stdout,'(A,3X,A)') solver_name,'Grid statistics:'
131  WRITE(stdout,'(A,5X,A,3X,2(1X,I9))') solver_name,'Vertices: ', &
132  pgrid%nVert,pgrid%nVertTot-pgrid%nVert
133  WRITE(stdout,'(A,5X,A,3X,2(1X,I9))') solver_name,'Cells: ', &
134  pgrid%nCells,pgrid%nCellsTot-pgrid%nCells
135  WRITE(stdout,'(A,7X,A,1X,2(1X,I9))') solver_name,'Tetrahedra: ', &
136  pgrid%nTets,pgrid%nTetsTot-pgrid%nTets
137  WRITE(stdout,'(A,7X,A,1X,2(1X,I9))') solver_name,'Hexahedra: ', &
138  pgrid%nHexs,pgrid%nHexsTot-pgrid%nHexs
139  WRITE(stdout,'(A,7X,A,1X,2(1X,I9))') solver_name,'Prisms: ', &
140  pgrid%nPris,pgrid%nPrisTot-pgrid%nPris
141  WRITE(stdout,'(A,7X,A,1X,2(1X,I9))') solver_name,'Pyramids: ', &
142  pgrid%nPyrs,pgrid%nPyrsTot-pgrid%nPyrs
143  WRITE(stdout,'(A,5X,A,4X,I9)') solver_name,'Patches: ', &
144  pgrid%nPatches
145  WRITE(stdout,'(A,5X,A,3X,2(1X,I9))') solver_name,'Patch faces: ', &
146  nbtris+nbquads,nbtristot+nbquadstot-nbtris-nbquads
147  WRITE(stdout,'(A,7X,A,1X,2(1X,I9))') solver_name,'Triangles: ', &
148  nbtris,nbtristot-nbtris
149  WRITE(stdout,'(A,7X,A,1X,2(1X,I9))') solver_name,'Quadrilaterals:', &
150  nbquads,nbquadstot-nbquads
151  END IF ! global%verbLevel
152 
153 ! ==============================================================================
154 ! Patch dimensions
155 ! ==============================================================================
156 
157  IF ( global%verbLevel >= verbose_med ) THEN
158  IF ( pgrid%nPatches > 0 ) THEN
159  WRITE(stdout,'(A,3X,A)') solver_name,'Patch statistics:'
160 
161  DO ipatch = 1,pgrid%nPatches
162  ppatch => pregion%patches(ipatch)
163 
164  WRITE(stdout,'(A,5X,A,2X,I4)') solver_name,'Patch:',ipatch
165  WRITE(stdout,'(A,7X,A,6X,2(1X,I9))') solver_name,'Triangles:', &
166  ppatch%nBTris,ppatch%nBTrisTot-ppatch%nBTris
167  WRITE(stdout,'(A,7X,A,1X,2(1X,I9))') solver_name,'Quadrilaterals:', &
168  ppatch%nBQuads,ppatch%nBQuadsTot-ppatch%nBQuads
169  END DO ! iPatch
170  END IF ! pGrid%nPatches
171  END IF ! global%verbLevel
172 
173 ! ==============================================================================
174 ! Find locations of extrema and print information on extrema: NOTE Asinine
175 ! coding needed because of poor FORTRAN interface for MINLOC and MAXLOC
176 ! functions...
177 ! ==============================================================================
178 
179  dummy = minloc(pgrid%xyz(xcoord,1:pgrid%nVert))
180  loc(xcoord,min_val) = dummy(1)
181 
182  dummy = minloc(pgrid%xyz(ycoord,1:pgrid%nVert))
183  loc(ycoord,min_val) = dummy(1)
184 
185  dummy = minloc(pgrid%xyz(zcoord,1:pgrid%nVert))
186  loc(zcoord,min_val) = dummy(1)
187 
188 
189  dummy = maxloc(pgrid%xyz(xcoord,1:pgrid%nVert))
190  loc(xcoord,max_val) = dummy(1)
191 
192  dummy = maxloc(pgrid%xyz(ycoord,1:pgrid%nVert))
193  loc(ycoord,max_val) = dummy(1)
194 
195  dummy = maxloc(pgrid%xyz(zcoord,1:pgrid%nVert))
196  loc(zcoord,max_val) = dummy(1)
197 
198 
199  IF ( global%verbLevel >= verbose_med ) THEN
200  WRITE(stdout,'(A,3X,A)') solver_name,'Coordinate extrema:'
201  WRITE(stdout,'(A,5X,A,2(1X,E23.16),2(1X,I9))') &
202  solver_name,'X-coordinate:', &
203  minval(pgrid%xyz(xcoord,1:pgrid%nVert)), &
204  maxval(pgrid%xyz(xcoord,1:pgrid%nVert)), &
205  loc(xcoord,min_val),loc(xcoord,max_val)
206  WRITE(stdout,'(A,5X,A,2(1X,E23.16),2(1X,I9))') &
207  solver_name,'Y-coordinate:', &
208  minval(pgrid%xyz(ycoord,1:pgrid%nVert)), &
209  maxval(pgrid%xyz(ycoord,1:pgrid%nVert)), &
210  loc(ycoord,min_val),loc(ycoord,max_val)
211  WRITE(stdout,'(A,5X,A,2(1X,E23.16),2(1X,I9))') &
212  solver_name,'Z-coordinate:', &
213  minval(pgrid%xyz(zcoord,1:pgrid%nVert)), &
214  maxval(pgrid%xyz(zcoord,1:pgrid%nVert)), &
215  loc(zcoord,min_val),loc(zcoord,max_val)
216  END IF ! global%verbLevel
217 
218 ! ******************************************************************************
219 ! End
220 ! ******************************************************************************
221 
222  IF ( global%verbLevel >= verbose_med ) THEN
223  WRITE(stdout,'(A,1X,A)') solver_name,'Printing grid information done.'
224  WRITE(stdout,'(A,1X,A)') solver_name
225  END IF ! global%verbLevel
226 
227  CALL deregisterfunction(global)
228 
229 END SUBROUTINE rflu_printgridinfo
230 
231 ! ******************************************************************************
232 !
233 ! RCS Revision history:
234 !
235 ! $Log: RFLU_PrintGridInfo.F90,v $
236 ! Revision 1.15 2008/12/06 08:44:12 mtcampbe
237 ! Updated license.
238 !
239 ! Revision 1.14 2008/11/19 22:17:25 mtcampbe
240 ! Added Illinois Open Source License/Copyright
241 !
242 ! Revision 1.13 2004/10/19 19:24:45 haselbac
243 ! Removed printing of derived dims, cosmetics
244 !
245 ! Revision 1.12 2004/01/22 16:04:48 haselbac
246 ! Changed declaration to eliminate warning on ALC
247 !
248 ! Revision 1.11 2003/03/15 17:03:38 haselbac
249 ! Made changes for parallel calcs, added bVert info
250 !
251 ! Revision 1.10 2003/02/01 00:27:44 haselbac
252 ! Increased precision for printing coordinate extrema
253 !
254 ! Revision 1.9 2003/01/28 15:39:16 haselbac
255 ! Compute total no of boundary faces (deleted from pGrid), cosmetics
256 !
257 ! Revision 1.8 2002/10/27 18:52:56 haselbac
258 ! Cosmetic changes, added iRegionGlobal
259 !
260 ! Revision 1.7 2002/10/17 19:57:52 haselbac
261 ! Cosmetic changes to output
262 !
263 ! Revision 1.6 2002/09/09 14:15:01 haselbac
264 ! global now under regions
265 !
266 ! Revision 1.5 2002/06/27 15:38:21 haselbac
267 ! Added dummy cells and vertex output
268 !
269 ! Revision 1.4 2002/06/17 13:31:22 haselbac
270 ! Prefixed SOLVER_NAME to all screen output
271 !
272 ! Revision 1.3 2002/06/14 20:09:28 haselbac
273 ! Added writing out of iPatchGlobal
274 !
275 ! Revision 1.2 2002/06/11 22:27:43 haselbac
276 ! Added writing of patch statistics
277 !
278 ! Revision 1.1 2002/06/05 18:34:12 haselbac
279 ! Initial revision
280 !
281 ! ******************************************************************************
282 
283 
284 
285 
286 
287 
288 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine rflu_printgridinfo(pRegion)
subroutine deregisterfunction(global)
Definition: ModError.F90:469