Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLO_CheckMinimumCells.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: check that the number of cells inside the physical domain is
26 ! the same or larger than the number of dummy cells.
27 !
28 ! Description: none.
29 !
30 ! Input: regions%levels%grid = coordinates (physical cells) and dimensions
31 !
32 ! Output: regions%levels%grid%xyz = coordinates (dummy cells)
33 !
34 ! Notes: only region interfaces with continuous grid are treated here.
35 !
36 !******************************************************************************
37 !
38 ! $Id: RFLO_CheckMinimumCells.F90,v 1.3 2008/12/06 08:44:26 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2001 by the University of Illinois
41 !
42 !******************************************************************************
43 
44 SUBROUTINE rflo_checkminimumcells( regions )
45 
46  USE moddatatypes
47  USE modbndpatch, ONLY : t_patch
48  USE moddatastruct, ONLY : t_region
49  USE modglobal, ONLY : t_global
50  USE modinterfaces, ONLY :
51  USE moderror
52  USE modparameters
53  IMPLICIT NONE
54 
55 ! ... parameters
56  TYPE(t_region), POINTER :: regions(:)
57 
58 ! ... loop variables
59  INTEGER :: ireg, ilev, ipatch
60 
61 ! ... local variables
62  CHARACTER(CHRLEN) :: msg
63 
64  INTEGER :: bctype, iregsrc, ndumcells, ipc, jpc, kpc
65 
66  TYPE(t_patch), POINTER :: patch
67  TYPE(t_global), POINTER :: global
68 
69 !******************************************************************************
70 
71  global => regions(1)%global
72 
73  CALL registerfunction( global,'RFLO_CheckMinimumCells',&
74  'RFLO_CheckMinimumCells.F90' )
75 
76 ! loop over all regions
77 
78  DO ireg=1,global%nRegions
79  IF (regions(ireg)%procid==global%myProcid .AND. & ! region active and
80  regions(ireg)%active==active) THEN ! on my processor
81 
82 ! --- loop over all levels
83 
84  DO ilev=1,regions(ireg)%nGridLevels
85 
86 ! ----- loop over patches
87 
88  DO ipatch=1,regions(ireg)%nPatches
89  patch => regions(ireg)%levels(ilev)%patches(ipatch)
90  bctype = patch%bcType
91 
92 ! ------- inter-region boundary / periodicity
93 
94  IF ((bctype>=bc_regionconf .AND. bctype<=bc_regionconf+bc_range) .OR.&
95  (bctype>=bc_regionint .AND. bctype<=bc_regionint +bc_range) .OR.&
96  (bctype>=bc_regnonconf .AND. bctype<=bc_regnonconf+bc_range) .OR.&
97  (bctype>=bc_tra_peri .AND. bctype<=bc_tra_peri +bc_range) .OR.&
98  (bctype>=bc_rot_peri .AND. bctype<=bc_rot_peri +bc_range)) THEN
99  iregsrc = patch%srcRegion
100  ipc = regions(ireg)%levels(ilev)%grid%ipc
101  jpc = regions(ireg)%levels(ilev)%grid%jpc
102  kpc = regions(ireg)%levels(ilev)%grid%kpc
103  ndumcells = regions(iregsrc)%nDumCells
104  IF (ndumcells > min(ipc,jpc,kpc)) THEN ! better check all dims.
105  WRITE(msg,1000) ireg,ilev,ipatch,bctype
106  CALL errorstop( global,err_number_cells,__line__,msg )
107  ENDIF
108  ENDIF
109  ENDDO ! iPatch
110 
111  ENDDO ! iLev
112 
113  ENDIF ! region on this processor and active
114  ENDDO ! iReg
115 
116 ! finalize
117 
118  CALL deregisterfunction( global )
119 
120 1000 FORMAT('Region ',i5,', level ',i1,', patch ',i3,', BC type ',i3)
121 
122 END SUBROUTINE rflo_checkminimumcells
123 
124 !******************************************************************************
125 !
126 ! RCS Revision history:
127 !
128 ! $Log: RFLO_CheckMinimumCells.F90,v $
129 ! Revision 1.3 2008/12/06 08:44:26 mtcampbe
130 ! Updated license.
131 !
132 ! Revision 1.2 2008/11/19 22:17:37 mtcampbe
133 ! Added Illinois Open Source License/Copyright
134 !
135 ! Revision 1.1 2004/11/29 20:51:38 wasistho
136 ! lower to upper case
137 !
138 ! Revision 1.9 2003/11/20 16:40:39 mdbrandy
139 ! Backing out RocfluidMP changes from 11-17-03
140 !
141 ! Revision 1.5 2003/05/15 02:57:03 jblazek
142 ! Inlined index function.
143 !
144 ! Revision 1.4 2003/03/20 00:47:10 jblazek
145 ! Purpose of the routine was missing ...
146 !
147 ! Revision 1.3 2002/09/27 00:57:10 jblazek
148 ! Changed makefiles - no makelinks needed.
149 !
150 ! Revision 1.2 2002/09/05 17:40:21 jblazek
151 ! Variable global moved into regions().
152 !
153 ! Revision 1.1 2002/03/18 23:11:32 jblazek
154 ! Finished multiblock and MPI.
155 !
156 !******************************************************************************
157 
158 
159 
160 
161 
162 
163 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
Definition: patch.h:74
subroutine rflo_checkminimumcells(regions)
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:346
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469