Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLU_ModBFaceGradAccessList.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: Suite of routines to build boundary-face gradient access list.
26 !
27 ! Description: None.
28 !
29 ! Notes:
30 ! 1. The routine which builds the access lists MUST be called after the face
31 ! lists have been built.
32 !
33 !*******************************************************************************
34 !
35 ! $Id: RFLU_ModBFaceGradAccessList.F90,v 1.7 2008/12/06 08:44:20 mtcampbe Exp $
36 !
37 ! Copyright: (c) 2003-2004 by the University of Illinois
38 !
39 !*******************************************************************************
40 
42 
43  USE modglobal, ONLY: t_global
44  USE moddatatypes
45  USE modparameters
46  USE moderror
47  USE modbndpatch, ONLY: t_patch
48  USE moddatastruct, ONLY: t_region
49  USE modgrid, ONLY: t_grid
50  USE modmpi
51 
52  IMPLICIT NONE
53 
54  PRIVATE
59 
60 ! ******************************************************************************
61 ! Declarations and definitions
62 ! ******************************************************************************
63 
64  CHARACTER(CHRLEN) :: &
65  RCSIdentString = '$RCSfile: RFLU_ModBFaceGradAccessList.F90,v $ $Revision: 1.7 $'
66 
67 ! *****************************************************************************
68 ! Routines
69 ! *****************************************************************************
70 
71  CONTAINS
72 
73 
74 
75 ! ******************************************************************************
76 ! Nullify boundary-face gradient access list
77 ! ******************************************************************************
78 
79  SUBROUTINE rflu_nullifybfacegradaccesslist(pRegion)
80 
81  IMPLICIT NONE
82 
83 ! ******************************************************************************
84 ! Declarations and definitions
85 ! ******************************************************************************
86 
87 ! ==============================================================================
88 ! Arguments
89 ! ==============================================================================
90 
91  TYPE(t_region), POINTER :: pregion
92 
93 ! ==============================================================================
94 ! Locals
95 ! ==============================================================================
96 
97  INTEGER :: errorflag,ipatch
98  TYPE(t_grid), POINTER :: pgrid
99  TYPE(t_patch), POINTER :: ppatch
100  TYPE(t_global), POINTER :: global
101 
102 ! ******************************************************************************
103 ! Start
104 ! ******************************************************************************
105 
106  global => pregion%global
107 
108  CALL registerfunction(global,'RFLU_NullifyBFaceGradAccessList',&
109  'RFLU_ModBFaceGradAccessList.F90')
110 
111  IF ( global%myProcid == masterproc .AND. &
112  global%verbLevel > verbose_none ) THEN
113  WRITE(stdout,'(A,1X,A)') solver_name, &
114  'Nullifying boundary-face gradient access list...'
115  END IF ! global%verbLevel
116 
117 ! ******************************************************************************
118 ! Set grid pointer
119 ! ******************************************************************************
120 
121  pgrid => pregion%grid
122 
123 ! ******************************************************************************
124 ! Loop over patches
125 ! ******************************************************************************
126 
127  DO ipatch = 1,pgrid%nPatches
128  ppatch => pregion%patches(ipatch)
129 
130 ! TEMPORARY : removing usage of bf2bg from everywhere
131 ! NULLIFY(pPatch%bf2bg)
132 ! NULLIFY(pPatch%bf2bgTot)
133  END DO ! iPatch
134 
135 ! ******************************************************************************
136 ! End
137 ! ******************************************************************************
138 
139  IF ( global%myProcid == masterproc .AND. &
140  global%verbLevel > verbose_none ) THEN
141  WRITE(stdout,'(A,1X,A)') solver_name, &
142  'Nullifying boundary-face gradient access list done.'
143  END IF ! global%verbLevel
144 
145  CALL deregisterfunction(global)
146 
147  END SUBROUTINE rflu_nullifybfacegradaccesslist
148 
149 
150 
151 
152 ! ******************************************************************************
153 ! Create boundary-face gradient access list
154 ! ******************************************************************************
155 
156  SUBROUTINE rflu_createbfacegradaccesslist(pRegion)
157 
158  IMPLICIT NONE
159 
160 ! ******************************************************************************
161 ! Declarations and definitions
162 ! ******************************************************************************
163 
164 ! ==============================================================================
165 ! Arguments
166 ! ==============================================================================
167 
168  TYPE(t_region), POINTER :: pregion
169 
170 ! ==============================================================================
171 ! Locals
172 ! ==============================================================================
173 
174  INTEGER :: errorflag,ipatch
175  TYPE(t_grid), POINTER :: pgrid
176  TYPE(t_patch), POINTER :: ppatch
177  TYPE(t_global), POINTER :: global
178 
179 ! ******************************************************************************
180 ! Start
181 ! ******************************************************************************
182 
183  global => pregion%global
184 
185  CALL registerfunction(global,'RFLU_CreateBFaceGradAccessList',&
186  'RFLU_ModBFaceGradAccessList.F90')
187 
188  IF ( global%myProcid == masterproc .AND. &
189  global%verbLevel > verbose_none ) THEN
190  WRITE(stdout,'(A,1X,A)') solver_name, &
191  'Creating boundary-face gradient access list...'
192  END IF ! global%verbLevel
193 
194 ! ******************************************************************************
195 ! Set grid pointer
196 ! ******************************************************************************
197 
198  pgrid => pregion%grid
199 
200 ! ******************************************************************************
201 ! Loop over patches
202 ! ******************************************************************************
203 
204  DO ipatch = 1,pgrid%nPatches
205  ppatch => pregion%patches(ipatch)
206 
207 ! TEMPORARY : removing usage of bf2bg from everywhere
208 ! ALLOCATE(pPatch%bf2bg(BF2BG_BEG:BF2BG_END),STAT=errorFlag)
209 ! global%error = errorFlag
210 ! IF ( global%error /= ERR_NONE ) THEN
211 ! CALL ErrorStop(global,ERR_ALLOCATE,__LINE__,'pPatch%bf2bg')
212 ! END IF ! global%error
213 
214 ! TEMPORARY : removing usage of bf2bg from everywhere
215 ! ALLOCATE(pPatch%bf2bgTot(BF2BG_BEG:BF2BG_END),STAT=errorFlag)
216 ! global%error = errorFlag
217 ! IF ( global%error /= ERR_NONE ) THEN
218 ! CALL ErrorStop(global,ERR_ALLOCATE,__LINE__,'pPatch%bf2bgTot')
219 ! END IF ! global%error
220  END DO ! iPatch
221 
222 ! ******************************************************************************
223 ! End
224 ! ******************************************************************************
225 
226  IF ( global%myProcid == masterproc .AND. &
227  global%verbLevel > verbose_none ) THEN
228  WRITE(stdout,'(A,1X,A)') solver_name, &
229  'Creating boundary-face gradient access list done.'
230  END IF ! global%verbLevel
231 
232  CALL deregisterfunction(global)
233 
234  END SUBROUTINE rflu_createbfacegradaccesslist
235 
236 
237 
238 
239 
240 ! ******************************************************************************
241 ! Build boundary-face gradient access list
242 ! ******************************************************************************
243 
244  SUBROUTINE rflu_buildbfacegradaccesslist(pRegion)
245 
246  IMPLICIT NONE
247 
248 ! ******************************************************************************
249 ! Declarations and definitions
250 ! ******************************************************************************
251 
252 ! ==============================================================================
253 ! Arguments
254 ! ==============================================================================
255 
256  TYPE(t_region), POINTER :: pregion
257 
258 ! ==============================================================================
259 ! Locals
260 ! ==============================================================================
261 
262  INTEGER :: bf2bglast,bf2bgtotlast,ipatch
263  TYPE(t_global), POINTER :: global
264  TYPE(t_grid), POINTER :: pgrid
265  TYPE(t_patch), POINTER :: ppatch
266 
267 ! ******************************************************************************
268 ! Start
269 ! ******************************************************************************
270 
271  global => pregion%global
272 
273  CALL registerfunction(global,'RFLU_BuildBFaceGradAccessList',&
274  'RFLU_ModBFaceGradAccessList.F90')
275 
276  IF ( global%myProcid == masterproc .AND. &
277  global%verbLevel > verbose_none ) THEN
278  WRITE(stdout,'(A,1X,A)') solver_name, &
279  'Building boundary-face gradient access lists...'
280  END IF ! global%verbLevel
281 
282 ! ******************************************************************************
283 ! Set grid pointer
284 ! ******************************************************************************
285 
286  pgrid => pregion%grid
287 
288 ! ==============================================================================
289 ! Loop over patches
290 ! ==============================================================================
291 
292  DO ipatch = 1,pgrid%nPatches
293  ppatch => pregion%patches(ipatch)
294 
295  IF ( ipatch /= 1 ) THEN
296 ! TEMPORARY : removing usage of bf2bg from everywhere
297 ! pPatch%bf2bg(BF2BG_BEG) = bf2bgLast + 1
298 ! pPatch%bf2bg(BF2BG_END) = pPatch%bf2bg(BF2BG_BEG) &
299 ! + pPatch%nBFaces - 1
300 
301 ! TEMPORARY : removing usage of bf2bg from everywhere
302 ! pPatch%bf2bgTot(BF2BG_BEG) = bf2bgTotLast + 1
303 ! pPatch%bf2bgTot(BF2BG_END) = pPatch%bf2bgTot(BF2BG_BEG) &
304 ! + pPatch%nBFacesTot - 1
305  ELSE
306 ! TEMPORARY : removing usage of bf2bg from everywhere
307 ! pPatch%bf2bg(BF2BG_BEG) = 1
308 ! pPatch%bf2bg(BF2BG_END) = pPatch%nBFaces
309 
310 ! TEMPORARY : removing usage of bf2bg from everywhere
311 ! pPatch%bf2bgTot(BF2BG_BEG) = 1
312 ! pPatch%bf2bgTot(BF2BG_END) = pPatch%nBFacesTot
313  END IF ! iPatch
314 
315 ! TEMPORARY : removing usage of bf2bg from everywhere
316 ! bf2bgLast = pPatch%bf2bg(BF2BG_END)
317 ! bf2bgTotLast = pPatch%bf2bgTot(BF2BG_END)
318  END DO ! iPatch
319 
320 ! ******************************************************************************
321 ! End
322 ! ******************************************************************************
323 
324  IF ( global%myProcid == masterproc .AND. &
325  global%verbLevel > verbose_none ) THEN
326  WRITE(stdout,'(A,1X,A)') solver_name, &
327  'Building boundary-face gradient access lists done.'
328  END IF ! global%verbLevel
329 
330  CALL deregisterfunction(global)
331 
332  END SUBROUTINE rflu_buildbfacegradaccesslist
333 
334 
335 
336 
337 
338 
339 
340 ! ******************************************************************************
341 ! Destroy boundary-face gradient access list
342 ! ******************************************************************************
343 
345 
346  IMPLICIT NONE
347 
348 ! ******************************************************************************
349 ! Declarations and definitions
350 ! ******************************************************************************
351 
352 ! ==============================================================================
353 ! Arguments
354 ! ==============================================================================
355 
356  TYPE(t_region), POINTER :: pregion
357 
358 ! ==============================================================================
359 ! Locals
360 ! ==============================================================================
361 
362  INTEGER :: errorflag,ipatch
363  TYPE(t_grid), POINTER :: pgrid
364  TYPE(t_patch), POINTER :: ppatch
365  TYPE(t_global), POINTER :: global
366 
367 ! ******************************************************************************
368 ! Start
369 ! ******************************************************************************
370 
371  global => pregion%global
372 
373  CALL registerfunction(global,'RFLU_DestroyBFaceGradAccessList',&
374  'RFLU_ModBFaceGradAccessList.F90')
375 
376  IF ( global%myProcid == masterproc .AND. &
377  global%verbLevel > verbose_none ) THEN
378  WRITE(stdout,'(A,1X,A)') solver_name, &
379  'Destroying boundary-face gradient access list...'
380  END IF ! global%verbLevel
381 
382 ! ******************************************************************************
383 ! Set grid pointer
384 ! ******************************************************************************
385 
386  pgrid => pregion%grid
387 
388 ! ******************************************************************************
389 ! Loop over patches
390 ! ******************************************************************************
391 
392  DO ipatch = 1,pgrid%nPatches
393  ppatch => pregion%patches(ipatch)
394 
395 ! TEMPORARY : removing usage of bf2bg from everywhere
396 ! DEALLOCATE(pPatch%bf2bg,STAT=errorFlag)
397 ! global%error = errorFlag
398 ! IF ( global%error /= ERR_NONE ) THEN
399 ! CALL ErrorStop(global,ERR_DEALLOCATE,__LINE__,'pPatch%bf2bg')
400 ! END IF ! global%error
401 
402 ! TEMPORARY : removing usage of bf2bg from everywhere
403 ! DEALLOCATE(pPatch%bf2bgTot,STAT=errorFlag)
404 ! global%error = errorFlag
405 ! IF ( global%error /= ERR_NONE ) THEN
406 ! CALL ErrorStop(global,ERR_DEALLOCATE,__LINE__,'pPatch%bf2bgTot')
407 ! END IF ! global%error
408  END DO ! iPatch
409 
410 ! ******************************************************************************
411 ! Nullify memory
412 ! ******************************************************************************
413 
414  CALL rflu_nullifybfacegradaccesslist(pregion)
415 
416 ! ******************************************************************************
417 ! End
418 ! ******************************************************************************
419 
420  IF ( global%myProcid == masterproc .AND. &
421  global%verbLevel > verbose_none ) THEN
422  WRITE(stdout,'(A,1X,A)') solver_name, &
423  'Destroying boundary-face gradient access list done.'
424  END IF ! global%verbLevel
425 
426  CALL deregisterfunction(global)
427 
428  END SUBROUTINE rflu_destroybfacegradaccesslist
429 
430 
431 
432 
433 
434 ! ******************************************************************************
435 ! End
436 ! ******************************************************************************
437 
439 
440 
441 ! ******************************************************************************
442 !
443 ! RCS Revision history:
444 !
445 ! $Log: RFLU_ModBFaceGradAccessList.F90,v $
446 ! Revision 1.7 2008/12/06 08:44:20 mtcampbe
447 ! Updated license.
448 !
449 ! Revision 1.6 2008/11/19 22:17:31 mtcampbe
450 ! Added Illinois Open Source License/Copyright
451 !
452 ! Revision 1.5 2006/08/19 15:39:21 mparmar
453 ! Removed bf2bg,bf2bgTot
454 !
455 ! Revision 1.4 2004/05/25 01:34:16 haselbac
456 ! Added code for bf2bgTot array; needed for Rocturb Sij access
457 !
458 ! Revision 1.3 2004/01/22 16:03:58 haselbac
459 ! Made contents of modules PRIVATE, only procs PUBLIC, to avoid errors on ALC and titan
460 !
461 ! Revision 1.2 2003/12/09 03:58:01 haselbac
462 ! Bug fix for building of bf2bg list (no virtual faces)
463 !
464 ! Revision 1.1 2003/11/03 03:51:54 haselbac
465 ! Initial revision
466 !
467 ! ******************************************************************************
468 
469 
470 
471 
472 
473 
474 
475 
476 
477 
subroutine, public rflu_nullifybfacegradaccesslist(pRegion)
subroutine, public rflu_createbfacegradaccesslist(pRegion)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine, public rflu_buildbfacegradaccesslist(pRegion)
subroutine, public rflu_destroybfacegradaccesslist(pRegion)
subroutine deregisterfunction(global)
Definition: ModError.F90:469