Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLU_PickSpecialFaces.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: Pick special faces.
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_PickSpecialFaces.F90,v 1.3 2008/12/06 08:45:04 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2004 by the University of Illinois
41 !
42 ! ******************************************************************************
43 
44 SUBROUTINE rflu_pickspecialfaces(pRegion)
45 
46  USE modglobal, ONLY: t_global
47  USE moddatatypes
48  USE modparameters
49  USE moderror
50  USE modbndpatch, ONLY: t_patch
51  USE modgrid, ONLY: t_grid
52  USE moddatastruct, ONLY: t_region
53  USE modsortsearch
54 
55  USE rflu_modgrid
56 
57  IMPLICIT NONE
58 
59 ! ******************************************************************************
60 ! Declarations and definitions
61 ! ******************************************************************************
62 
63 ! ==============================================================================
64 ! Arguments
65 ! ==============================================================================
66 
67  TYPE(t_region), POINTER :: pregion
68 
69 ! ==============================================================================
70 ! Locals
71 ! ==============================================================================
72 
73  CHARACTER :: infotype,stenciltype
74  CHARACTER(CHRLEN) :: rcsidentstring
75  INTEGER :: errorflag,faceindx,ifacesspecial,patchindx
76  TYPE(t_global), POINTER :: global
77  TYPE(t_grid), POINTER :: pgrid
78  TYPE(t_patch), POINTER :: ppatch
79 
80 ! ******************************************************************************
81 ! Start
82 ! ******************************************************************************
83 
84  rcsidentstring = '$RCSfile: RFLU_PickSpecialFaces.F90,v $ $Revision: 1.3 $'
85 
86  global => pregion%global
87 
88  CALL registerfunction(global,'RFLU_PickSpecialFaces', &
89  'RFLU_PickSpecialFaces.F90')
90 
91  IF ( global%verbLevel > verbose_none ) THEN
92  WRITE(stdout,'(A,1X,A)') solver_name,'Picking special faces...'
93  WRITE(stdout,'(A,3X,A,1X,I5.5)') solver_name,'Global region:', &
94  pregion%iRegionGlobal
95  END IF ! global%verbLevel
96 
97 ! ******************************************************************************
98 ! Set pointers and initialize
99 ! ******************************************************************************
100 
101  pgrid => pregion%grid
102 
103  ifacesspecial = 0
104  pgrid%facesSpecial(1:2,1:nfaces_special_max) = 0
105 
106 ! ******************************************************************************
107 ! Get information from user
108 ! ******************************************************************************
109 
110  WRITE(stdout,'(A,5X,A)') solver_name,'Enter information on special faces:'
111  WRITE(stdout,'(A,7X,A)') solver_name,'b - boundary face'
112  WRITE(stdout,'(A,7X,A)') solver_name,'i - interior face'
113  WRITE(stdout,'(A,7X,A)') solver_name,'q - quit'
114 
115 ! ******************************************************************************
116 ! Set up infinite loop
117 ! ******************************************************************************
118 
119  DO
120 
121 ! ==============================================================================
122 ! Enter information type
123 ! ==============================================================================
124 
125  WRITE(stdout,'(A,3X,A)') solver_name,'Enter information type:'
126  READ(stdin,'(A)') infotype
127 
128  SELECT CASE ( infotype )
129 
130 ! ------------------------------------------------------------------------------
131 ! Boundary face
132 ! ------------------------------------------------------------------------------
133 
134  CASE ( 'b' )
135  WRITE(stdout,'(A,5X,A)') solver_name,'Enter patch index:'
136  READ(stdin,*,iostat=errorflag) patchindx
137 
138  IF ( errorflag /= err_none ) THEN
139  global%warnCounter = global%warnCounter + 1
140 
141  WRITE(stdout,'(A,5X,A)') solver_name,'*** WARNING *** Invalid input.'
142  cycle
143  END IF ! errorFlag
144 
145  IF ( patchindx > 0 .AND. patchindx <= pgrid%nPatches ) THEN
146  ppatch => pregion%patches(patchindx)
147 
148  WRITE(stdout,'(A,5X,A)') solver_name,'Enter face index:'
149  READ(stdin,*,iostat=errorflag) faceindx
150 
151  IF ( errorflag /= err_none ) THEN
152  global%warnCounter = global%warnCounter + 1
153 
154  WRITE(stdout,'(A,5X,A)') solver_name, &
155  '*** WARNING *** Invalid input.'
156  cycle
157  END IF ! errorFlag
158 
159  IF ( faceindx > 0 .AND. faceindx <= ppatch%nBFacesTot ) THEN
160  IF ( ifacesspecial == nfaces_special_max ) THEN
161  CALL errorstop(global,err_nfaces_special_max,__line__)
162  END IF ! iFacesSpecial
163 
164  ifacesspecial = ifacesspecial + 1
165  pgrid%facesSpecial(1,ifacesspecial) = patchindx
166  pgrid%facesSpecial(2,ifacesspecial) = faceindx
167 
168  WRITE(stdout,'(A,5X,A,1X,I8)') solver_name,'Added face:',faceindx
169  ELSE
170  global%warnCounter = global%warnCounter + 1
171 
172  WRITE(stdout,'(A,5X,A)') solver_name, &
173  '*** WARNING *** Invalid input.'
174  cycle
175  END IF ! faceIndx
176  ELSE
177  global%warnCounter = global%warnCounter + 1
178 
179  WRITE(stdout,'(A,5X,A)') solver_name,'*** WARNING *** Invalid input.'
180  cycle
181  END IF ! patchIndx
182 
183 ! ------------------------------------------------------------------------------
184 ! Interior face
185 ! ------------------------------------------------------------------------------
186 
187  CASE ( 'i' )
188  WRITE(stdout,'(A,5X,A)') solver_name,'Enter interior face index:'
189  READ(stdin,*,iostat=errorflag) faceindx
190 
191  IF ( errorflag /= err_none ) THEN
192  global%warnCounter = global%warnCounter + 1
193 
194  WRITE(stdout,'(A,5X,A)') solver_name,'*** WARNING *** Invalid input.'
195  cycle
196  END IF ! errorFlag
197 
198  IF ( faceindx > 0 .AND. faceindx <= pgrid%nFacesTot ) THEN
199  IF ( ifacesspecial == nfaces_special_max ) THEN ! NOTE
200  CALL errorstop(global,err_nfaces_special_max,__line__)
201  END IF ! iFacesSpecial
202 
203  ifacesspecial = ifacesspecial + 1
204  pgrid%facesSpecial(1,ifacesspecial) = 0
205  pgrid%facesSpecial(2,ifacesspecial) = faceindx
206 
207  WRITE(stdout,'(A,5X,A,1X,I8)') solver_name,'Added face:',faceindx
208  ELSE
209  global%warnCounter = global%warnCounter + 1
210 
211  WRITE(stdout,'(A,5X,A)') solver_name,'*** WARNING *** Invalid input.'
212  cycle
213  END IF ! faceIndx
214 
215 ! ------------------------------------------------------------------------------
216 ! Quit
217 ! ------------------------------------------------------------------------------
218 
219  CASE ( 'q' )
220  EXIT
221 
222 ! ------------------------------------------------------------------------------
223 ! Default
224 ! ------------------------------------------------------------------------------
225 
226  CASE default
227  global%warnCounter = global%warnCounter + 1
228 
229  WRITE(stdout,'(A,5X,A)') solver_name,'*** WARNING *** Invalid input.'
230  cycle
231  END SELECT
232  END DO ! <empty>
233 
234 ! ******************************************************************************
235 ! Set number of special faces
236 ! ******************************************************************************
237 
238  pgrid%nFacesSpecial = ifacesspecial
239 
240 ! ******************************************************************************
241 ! End
242 ! ******************************************************************************
243 
244  IF ( global%verbLevel > verbose_none ) THEN
245  WRITE(stdout,'(A,1X,A)') solver_name,'Picking special faces done.'
246  END IF ! global%verbLevel
247 
248  CALL deregisterfunction(global)
249 
250 END SUBROUTINE rflu_pickspecialfaces
251 
252 ! ******************************************************************************
253 !
254 ! RCS Revision history:
255 !
256 ! $Log: RFLU_PickSpecialFaces.F90,v $
257 ! Revision 1.3 2008/12/06 08:45:04 mtcampbe
258 ! Updated license.
259 !
260 ! Revision 1.2 2008/11/19 22:18:15 mtcampbe
261 ! Added Illinois Open Source License/Copyright
262 !
263 ! Revision 1.1 2004/09/27 02:02:23 haselbac
264 ! Initial revision
265 !
266 ! ******************************************************************************
267 
268 
269 
270 
271 
272 
273 
subroutine rflu_pickspecialfaces(pRegion)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469