Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLU_ModRocstarUtils.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: Utility routines for Rocflu-GENX interface.
26 !
27 ! Description: None
28 !
29 ! Notes:
30 ! 1. This module must only be compiled when GENX=1.
31 !
32 ! ******************************************************************************
33 !
34 ! $Id: RFLU_ModGENXUtils.F90,v 1.5 2008/12/06 08:44:22 mtcampbe Exp $
35 !
36 ! Copyright: (c) 2004 by the University of Illinois
37 !
38 ! ******************************************************************************
39 
41 
42  USE moddatatypes
43  USE modparameters
44 
45  IMPLICIT NONE
46 
47  include 'roccomf90.h'
48 
49  PRIVATE
50  PUBLIC :: rflu_genx_buildpaneid, &
61 
62 ! ******************************************************************************
63 ! Declarations and definitions
64 ! ******************************************************************************
65 
66 ! ==============================================================================
67 ! Private
68 ! ==============================================================================
69 
70  CHARACTER(CHRLEN) :: &
71  RCSIdentString = '$RCSfile: RFLU_ModGENXUtils.F90,v $ $Revision: 1.5 $'
72 
73 ! ==============================================================================
74 ! Public
75 ! ==============================================================================
76 
77  INTEGER, PARAMETER, PUBLIC :: GENX_TIME_STRING_LEN = 9
78 
79 ! ******************************************************************************
80 ! Contained routines
81 ! ******************************************************************************
82 
83  CONTAINS
84 
85 
86 
87 
88 ! ******************************************************************************
89 !
90 ! Purpose: Build unique identifier for each pane.
91 !
92 ! Description: None.
93 !
94 ! Input:
95 ! iRegion Region index
96 ! iPatch Patch index
97 !
98 ! Output:
99 ! paneId Pane identifier
100 !
101 ! Notes:
102 ! 1. Pane id must not be zero, so add unit offset.
103 ! 2. If the mapping is changed, the inverse mapping in the routine
104 ! RFLU_GENX_GetPatchId must also be changed.
105 !
106 ! ******************************************************************************
107 
108  SUBROUTINE rflu_genx_buildpaneid(iRegion,iPatch,paneId)
109 
110  IMPLICIT NONE
111 
112 ! ******************************************************************************
113 ! Declarations and definitions
114 ! ******************************************************************************
115 
116 ! ==============================================================================
117 ! Arguments
118 ! ==============================================================================
119 
120  INTEGER, INTENT(IN) :: ipatch,iregion
121  INTEGER, INTENT(OUT) :: paneid
122 
123 ! ******************************************************************************
124 ! Start
125 ! ******************************************************************************
126 
127  paneid = 1 + iregion*region_index_offset + ipatch
128 
129 ! ******************************************************************************
130 ! End
131 ! ******************************************************************************
132 
133  END SUBROUTINE rflu_genx_buildpaneid
134 
135 
136 
137 
138 
139 
140 ! ******************************************************************************
141 !
142 ! Purpose: Build unique identifier for each pane.
143 !
144 ! Description: None.
145 !
146 ! Input:
147 ! iRegion Region index
148 ! iPatch Patch index
149 !
150 ! Output:
151 ! paneId Pane identifier
152 !
153 ! Notes: None.
154 !
155 ! ******************************************************************************
156 
157  SUBROUTINE rflu_genx_buildtimestring(time,timeString)
158 
159  IMPLICIT NONE
160 
161 ! ******************************************************************************
162 ! Declarations and definitions
163 ! ******************************************************************************
164 
165 ! ==============================================================================
166 ! Arguments
167 ! ==============================================================================
168 
169  REAL(RFREAL), INTENT(IN) :: time
170  CHARACTER(GENX_TIME_STRING_LEN), INTENT(OUT) :: timestring
171 
172 ! ==============================================================================
173 ! Locals
174 ! ==============================================================================
175 
176  CHARACTER(15) :: tempstring
177 
178 ! ******************************************************************************
179 ! Start
180 ! ******************************************************************************
181 
182  WRITE(tempstring,'(E12.6)') 1.0e9_rfreal*time
183 
184  timestring = tempstring(11:12)//'.'//tempstring(3:8)
185 
186 ! ******************************************************************************
187 ! End
188 ! ******************************************************************************
189 
190  END SUBROUTINE rflu_genx_buildtimestring
191 
192 
193 
194 
195 
196 ! ******************************************************************************
197 !
198 ! Purpose: Get file stem for surface files.
199 !
200 ! Description: None.
201 !
202 ! Input: None.
203 !
204 ! Output:
205 ! fileStem File stem
206 !
207 ! Notes: None.
208 !
209 ! ******************************************************************************
210 
211  SUBROUTINE rflu_genx_getfilestemsurf(fileStem)
212 
213  IMPLICIT NONE
214 
215 ! ******************************************************************************
216 ! Declarations and definitions
217 ! ******************************************************************************
218 
219 ! ==============================================================================
220 ! Arguments
221 ! ==============================================================================
222 
223  CHARACTER(*), INTENT(OUT) :: filestem
224 
225 ! ******************************************************************************
226 ! Start
227 ! ******************************************************************************
228 
229  filestem = 'ifluid'
230 
231 ! ******************************************************************************
232 ! End
233 ! ******************************************************************************
234 
235  END SUBROUTINE rflu_genx_getfilestemsurf
236 
237 
238 
239 
240 
241 
242 
243 ! ******************************************************************************
244 !
245 ! Purpose: Get file stem for volume files.
246 !
247 ! Description: None.
248 !
249 ! Input: None.
250 !
251 ! Output:
252 ! fileStem File stem
253 !
254 ! Notes: None.
255 !
256 ! ******************************************************************************
257 
258  SUBROUTINE rflu_genx_getfilestemvol(fileStem)
259 
260  IMPLICIT NONE
261 
262 ! ******************************************************************************
263 ! Declarations and definitions
264 ! ******************************************************************************
265 
266 ! ==============================================================================
267 ! Arguments
268 ! ==============================================================================
269 
270  CHARACTER(*), INTENT(OUT) :: filestem
271 
272 ! ******************************************************************************
273 ! Start
274 ! ******************************************************************************
275 
276  filestem = 'fluid'
277 
278 ! ******************************************************************************
279 ! End
280 ! ******************************************************************************
281 
282  END SUBROUTINE rflu_genx_getfilestemvol
283 
284 
285 
286 
287 
288 
289 
290 
291 
292 ! ******************************************************************************
293 !
294 ! Purpose: Get file stem for surface grid file.
295 !
296 ! Description: None.
297 !
298 ! Input: None.
299 !
300 ! Output:
301 ! fileStem File stem
302 !
303 ! Notes: None.
304 !
305 ! ******************************************************************************
306 
307  SUBROUTINE rflu_genx_getfilestemgridsurf(fileStem)
308 
309  IMPLICIT NONE
310 
311 ! ******************************************************************************
312 ! Declarations and definitions
313 ! ******************************************************************************
314 
315 ! ==============================================================================
316 ! Arguments
317 ! ==============================================================================
318 
319  CHARACTER(*), INTENT(OUT) :: filestem
320 
321 ! ******************************************************************************
322 ! Start
323 ! ******************************************************************************
324 
325  CALL rflu_genx_getfilestemsurf(filestem)
326 
327  filestem = trim(filestem)//'-grid'
328 
329 ! ******************************************************************************
330 ! End
331 ! ******************************************************************************
332 
333  END SUBROUTINE rflu_genx_getfilestemgridsurf
334 
335 
336 
337 
338 
339 
340 
341 
342 ! ******************************************************************************
343 !
344 ! Purpose: Get file stem for volume grid file.
345 !
346 ! Description: None.
347 !
348 ! Input: None.
349 !
350 ! Output:
351 ! fileStem File stem
352 !
353 ! Notes: None.
354 !
355 ! ******************************************************************************
356 
357  SUBROUTINE rflu_genx_getfilestemgridvol(fileStem)
358 
359  IMPLICIT NONE
360 
361 ! ******************************************************************************
362 ! Declarations and definitions
363 ! ******************************************************************************
364 
365 ! ==============================================================================
366 ! Arguments
367 ! ==============================================================================
368 
369  CHARACTER(*), INTENT(OUT) :: filestem
370 
371 ! ******************************************************************************
372 ! Start
373 ! ******************************************************************************
374 
375  CALL rflu_genx_getfilestemvol(filestem)
376 
377  filestem = trim(filestem)//'-grid'
378 
379 ! ******************************************************************************
380 ! End
381 ! ******************************************************************************
382 
383  END SUBROUTINE rflu_genx_getfilestemgridvol
384 
385 
386 
387 
388 
389 
390 
391 
392 
393 ! ******************************************************************************
394 !
395 ! Purpose: Get file stem for surface grid speed file.
396 !
397 ! Description: None.
398 !
399 ! Input: None.
400 !
401 ! Output:
402 ! fileStem File stem
403 !
404 ! Notes: None.
405 !
406 ! ******************************************************************************
407 
408  SUBROUTINE rflu_genx_getfilestemgspsurf(fileStem)
409 
410  IMPLICIT NONE
411 
412 ! ******************************************************************************
413 ! Declarations and definitions
414 ! ******************************************************************************
415 
416 ! ==============================================================================
417 ! Arguments
418 ! ==============================================================================
419 
420  CHARACTER(*), INTENT(OUT) :: filestem
421 
422 ! ******************************************************************************
423 ! Start
424 ! ******************************************************************************
425 
426  CALL rflu_genx_getfilestemsurf(filestem)
427 
428  filestem = trim(filestem)//'-gsp'
429 
430 ! ******************************************************************************
431 ! End
432 ! ******************************************************************************
433 
434  END SUBROUTINE rflu_genx_getfilestemgspsurf
435 
436 
437 
438 
439 
440 
441 
442 
443 ! ******************************************************************************
444 !
445 ! Purpose: Get file stem for volume grid speed file.
446 !
447 ! Description: None.
448 !
449 ! Input: None.
450 !
451 ! Output:
452 ! fileStem File stem
453 !
454 ! Notes: None.
455 !
456 ! ******************************************************************************
457 
458  SUBROUTINE rflu_genx_getfilestemgspvol(fileStem)
459 
460  IMPLICIT NONE
461 
462 ! ******************************************************************************
463 ! Declarations and definitions
464 ! ******************************************************************************
465 
466 ! ==============================================================================
467 ! Arguments
468 ! ==============================================================================
469 
470  CHARACTER(*), INTENT(OUT) :: filestem
471 
472 ! ******************************************************************************
473 ! Start
474 ! ******************************************************************************
475 
476  CALL rflu_genx_getfilestemvol(filestem)
477 
478  filestem = trim(filestem)//'-gsp'
479 
480 ! ******************************************************************************
481 ! End
482 ! ******************************************************************************
483 
484  END SUBROUTINE rflu_genx_getfilestemgspvol
485 
486 
487 
488 
489 
490 
491 
492 ! ******************************************************************************
493 !
494 ! Purpose: Get file stem for mixture solution file.
495 !
496 ! Description: None.
497 !
498 ! Input: None.
499 !
500 ! Output:
501 ! fileStem File stem
502 !
503 ! Notes: None.
504 !
505 ! ******************************************************************************
506 
507  SUBROUTINE rflu_genx_getfilestemmixtsurf(fileStem)
508 
509  IMPLICIT NONE
510 
511 ! ******************************************************************************
512 ! Declarations and definitions
513 ! ******************************************************************************
514 
515 ! ==============================================================================
516 ! Arguments
517 ! ==============================================================================
518 
519  CHARACTER(*), INTENT(OUT) :: filestem
520 
521 ! ******************************************************************************
522 ! Start
523 ! ******************************************************************************
524 
525  CALL rflu_genx_getfilestemsurf(filestem)
526 
527  filestem = trim(filestem)//'-mixt'
528 
529 ! ******************************************************************************
530 ! End
531 ! ******************************************************************************
532 
533  END SUBROUTINE rflu_genx_getfilestemmixtsurf
534 
535 
536 
537 
538 
539 
540 
541 
542 
543 ! ******************************************************************************
544 !
545 ! Purpose: Get file stem for mixture solution file.
546 !
547 ! Description: None.
548 !
549 ! Input: None.
550 !
551 ! Output:
552 ! fileStem File stem
553 !
554 ! Notes: None.
555 !
556 ! ******************************************************************************
557 
558  SUBROUTINE rflu_genx_getfilestemmixtvol(fileStem)
559 
560  IMPLICIT NONE
561 
562 ! ******************************************************************************
563 ! Declarations and definitions
564 ! ******************************************************************************
565 
566 ! ==============================================================================
567 ! Arguments
568 ! ==============================================================================
569 
570  CHARACTER(*), INTENT(OUT) :: filestem
571 
572 ! ******************************************************************************
573 ! Start
574 ! ******************************************************************************
575 
576  CALL rflu_genx_getfilestemvol(filestem)
577 
578  filestem = trim(filestem)//'-mixt'
579 
580 ! ******************************************************************************
581 ! End
582 ! ******************************************************************************
583 
584  END SUBROUTINE rflu_genx_getfilestemmixtvol
585 
586 
587 
588 
589 
590 
591 ! ******************************************************************************
592 !
593 ! Purpose: Set constraint type.
594 !
595 ! Description: None.
596 !
597 ! Input: None.
598 !
599 ! Output:
600 ! movePatchDir Direction in which patch is allowed to move.
601 !
602 ! Notes: None.
603 !
604 ! ******************************************************************************
605 
606  INTEGER FUNCTION rflu_genx_setcnstrtype(movePatchDir)
607 
608  IMPLICIT NONE
609 
610 ! ******************************************************************************
611 ! Declarations and definitions
612 ! ******************************************************************************
613 
614 ! ==============================================================================
615 ! Arguments
616 ! ==============================================================================
617 
618  INTEGER, INTENT(IN) :: movepatchdir
619 
620 ! ******************************************************************************
621 ! Start
622 ! ******************************************************************************
623 
624  SELECT CASE ( movepatchdir )
625  CASE ( movepatch_dir_none )
627  CASE ( movepatch_dir_x )
629  CASE ( movepatch_dir_y )
631  CASE ( movepatch_dir_z )
633  CASE ( movepatch_dir_xy )
635  CASE ( movepatch_dir_xz )
637  CASE ( movepatch_dir_yz )
639  CASE ( movepatch_dir_xyz )
641  CASE default
643  END SELECT ! movePatchDir
644 
645 ! ******************************************************************************
646 ! End
647 ! ******************************************************************************
648 
649  END FUNCTION rflu_genx_setcnstrtype
650 
651 
652 
653 
654 
655 
656 END MODULE rflu_modrocstarutils
657 
658 ! ******************************************************************************
659 !
660 ! RCS Revision history:
661 !
662 ! $Log: RFLU_ModGENXUtils.F90,v $
663 ! Revision 1.5 2008/12/06 08:44:22 mtcampbe
664 ! Updated license.
665 !
666 ! Revision 1.4 2008/11/19 22:17:33 mtcampbe
667 ! Added Illinois Open Source License/Copyright
668 !
669 ! Revision 1.3 2006/04/07 15:19:19 haselbac
670 ! Removed tabs
671 !
672 ! Revision 1.2 2005/06/09 20:21:17 haselbac
673 ! Added function to set constraint type
674 !
675 ! Revision 1.1 2004/10/19 19:27:04 haselbac
676 ! Initial revision
677 !
678 ! ******************************************************************************
679 
680 
681 
682 
683 
684 
subroutine, public rflu_genx_getfilestemgspsurf(fileStem)
subroutine, public rflu_genx_getfilestemsurf(fileStem)
subroutine, public rflu_genx_getfilestemgspvol(fileStem)
subroutine, public rflu_genx_buildtimestring(time, timeString)
subroutine, public rflu_genx_getfilestemmixtvol(fileStem)
subroutine, public rflu_genx_getfilestemvol(fileStem)
subroutine, public rflu_genx_getfilestemgridvol(fileStem)
subroutine, public rflu_genx_getfilestemgridsurf(fileStem)
INTEGER function, public rflu_genx_setcnstrtype(movePatchDir)
subroutine, public rflu_genx_buildpaneid(iRegion, iPatch, paneId)
subroutine, public rflu_genx_getfilestemmixtsurf(fileStem)