Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PEUL_SetCornerEdgeCells.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: set values in edge and corner cells of a region for smoke.
26 !
27 ! Description: this is for the case if the cells are not located
28 ! within another region.
29 !
30 ! Input: region = region data.
31 !
32 ! Output: region%levels%peul%cv = cv variables in dummy cells.
33 !
34 ! Notes: values in ALL edge and corner cells are averaged from neighboring
35 ! cells. Hence, this routine should be called first, before values
36 ! from adjacent regions are copied.
37 !
38 !******************************************************************************
39 !
40 ! $Id: PEUL_SetCornerEdgeCells.F90,v 1.3 2008/12/06 08:44:39 mtcampbe Exp $
41 !
42 ! Copyright: (c) 2004 by the University of Illinois
43 !
44 !******************************************************************************
45 
46 SUBROUTINE peul_setcorneredgecells( region )
47 
48  USE moddatatypes
49  USE moddatastruct, ONLY : t_region
50  USE modglobal, ONLY : t_global
53  USE moderror
54  IMPLICIT NONE
55 
56 #include "Indexing.h"
57 
58 ! ... parameters
59  TYPE(t_region), INTENT(INOUT) :: region
60 
61 ! ... loop variables
62  INTEGER :: i, j, k
63 
64 ! ... local variables
65  CHARACTER(CHRLEN) :: rcsidentstring
66 
67  INTEGER :: idcbeg, idcend, jdcbeg, jdcend, kdcbeg, kdcend
68  INTEGER :: ipcbeg, ipcend, jpcbeg, jpcend, kpcbeg, kpcend
69  INTEGER :: ilev, icoff, ijcoff, ijkd, ijkc1, ijkc2
70 
71  REAL(RFREAL), POINTER :: cv(:,:)
72  TYPE(t_global), POINTER :: global
73 
74 !******************************************************************************
75 
76  rcsidentstring = '$RCSfile: PEUL_SetCornerEdgeCells.F90,v $ $Revision: 1.3 $'
77 
78  global => region%global
79 
80  CALL registerfunction( global,'PEUL_SetCornerEdgeCells',&
81  'PEUL_SetCornerEdgeCells.F90' )
82 
83 ! get dimensions and pointers -------------------------------------------------
84 
85  ilev = region%currLevel
86 
87  CALL rflo_getdimensdummy( region,ilev,idcbeg,idcend, &
88  jdcbeg,jdcend,kdcbeg,kdcend )
89  CALL rflo_getdimensphys( region,ilev,ipcbeg,ipcend, &
90  jpcbeg,jpcend,kpcbeg,kpcend )
91  CALL rflo_getcelloffset( region,ilev,icoff,ijcoff )
92 
93  cv => region%levels(ilev)%peul%cv
94 
95 ! edges 9, 10, 11, 12 ---------------------------------------------------------
96 
97  DO i=ipcbeg,ipcend
98  DO j=jpcbeg-1,jdcbeg,-1 ! edges 9, 10
99  DO k=kpcbeg-1,kdcbeg,-1
100  ijkd = indijk(i,j ,k ,icoff,ijcoff)
101  ijkc1 = indijk(i,j+1,k ,icoff,ijcoff)
102  ijkc2 = indijk(i,j ,k+1,icoff,ijcoff)
103  cv(:,ijkd) = 0.5_rfreal*(cv(:,ijkc1) + cv(:,ijkc2))
104  ENDDO
105  DO k=kpcend+1,kdcend
106  ijkd = indijk(i,j,k,icoff,ijcoff)
107  ijkc1 = indijk(i,j+1,k ,icoff,ijcoff)
108  ijkc2 = indijk(i,j ,k-1,icoff,ijcoff)
109  cv(:,ijkd) = 0.5_rfreal*(cv(:,ijkc1) + cv(:,ijkc2))
110  ENDDO
111  ENDDO
112 
113  DO j=jpcend+1,jdcend ! edges 11, 12
114  DO k=kpcbeg-1,kdcbeg,-1
115  ijkd = indijk(i,j,k,icoff,ijcoff)
116  ijkc1 = indijk(i,j-1,k ,icoff,ijcoff)
117  ijkc2 = indijk(i,j ,k+1,icoff,ijcoff)
118  cv(:,ijkd) = 0.5_rfreal*(cv(:,ijkc1) + cv(:,ijkc2))
119  ENDDO
120  DO k=kpcend+1,kdcend
121  ijkd = indijk(i,j,k,icoff,ijcoff)
122  ijkc1 = indijk(i,j-1,k ,icoff,ijcoff)
123  ijkc2 = indijk(i,j ,k-1,icoff,ijcoff)
124  cv(:,ijkd) = 0.5_rfreal*(cv(:,ijkc1) + cv(:,ijkc2))
125  ENDDO
126  ENDDO
127  ENDDO
128 
129 ! edges 2, 4, 6, 8 ------------------------------------------------------------
130 
131  DO j=jpcbeg,jpcend
132  DO i=ipcbeg-1,idcbeg,-1 ! edges 2, 4
133  DO k=kpcend+1,kdcend
134  ijkd = indijk(i ,j,k ,icoff,ijcoff)
135  ijkc1 = indijk(i+1,j,k ,icoff,ijcoff)
136  ijkc2 = indijk(i ,j,k-1,icoff,ijcoff)
137  cv(:,ijkd) = 0.5_rfreal*(cv(:,ijkc1) + cv(:,ijkc2))
138  ENDDO
139  DO k=kpcbeg-1,kdcbeg,-1
140  ijkd = indijk(i ,j,k ,icoff,ijcoff)
141  ijkc1 = indijk(i+1,j,k ,icoff,ijcoff)
142  ijkc2 = indijk(i ,j,k+1,icoff,ijcoff)
143  cv(:,ijkd) = 0.5_rfreal*(cv(:,ijkc1) + cv(:,ijkc2))
144  ENDDO
145  ENDDO
146 
147  DO i=ipcend+1,idcend ! edges 6, 8
148  DO k=kpcend+1,kdcend
149  ijkd = indijk(i ,j,k ,icoff,ijcoff)
150  ijkc1 = indijk(i-1,j,k ,icoff,ijcoff)
151  ijkc2 = indijk(i ,j,k-1,icoff,ijcoff)
152  cv(:,ijkd) = 0.5_rfreal*(cv(:,ijkc1) + cv(:,ijkc2))
153  ENDDO
154  DO k=kpcbeg-1,kdcbeg,-1
155  ijkd = indijk(i ,j,k ,icoff,ijcoff)
156  ijkc1 = indijk(i-1,j,k ,icoff,ijcoff)
157  ijkc2 = indijk(i ,j,k+1,icoff,ijcoff)
158  cv(:,ijkd) = 0.5_rfreal*(cv(:,ijkc1) + cv(:,ijkc2))
159  ENDDO
160  ENDDO
161  ENDDO
162 
163 ! edges 1, 3, 5, 7 ------------------------------------------------------------
164 
165  DO k=kdcbeg,kdcend
166  DO i=ipcbeg-1,idcbeg,-1 ! edges 1, 3
167  DO j=jpcbeg-1,jdcbeg,-1
168  ijkd = indijk(i ,j ,k,icoff,ijcoff)
169  ijkc1 = indijk(i+1,j ,k,icoff,ijcoff)
170  ijkc2 = indijk(i ,j+1,k,icoff,ijcoff)
171  cv(:,ijkd) = 0.5_rfreal*(cv(:,ijkc1) + cv(:,ijkc2))
172  ENDDO
173  DO j=jpcend+1,jdcend
174  ijkd = indijk(i ,j ,k,icoff,ijcoff)
175  ijkc1 = indijk(i+1,j ,k,icoff,ijcoff)
176  ijkc2 = indijk(i ,j-1,k,icoff,ijcoff)
177  cv(:,ijkd) = 0.5_rfreal*(cv(:,ijkc1) + cv(:,ijkc2))
178  ENDDO
179  ENDDO
180 
181  DO i=ipcend+1,idcend ! edges 5, 7
182  DO j=jpcbeg-1,jdcbeg,-1
183  ijkd = indijk(i ,j ,k,icoff,ijcoff)
184  ijkc1 = indijk(i-1,j ,k,icoff,ijcoff)
185  ijkc2 = indijk(i ,j+1,k,icoff,ijcoff)
186  cv(:,ijkd) = 0.5_rfreal*(cv(:,ijkc1) + cv(:,ijkc2))
187  ENDDO
188  DO j=jpcend+1,jdcend
189  ijkd = indijk(i ,j ,k,icoff,ijcoff)
190  ijkc1 = indijk(i-1,j ,k,icoff,ijcoff)
191  ijkc2 = indijk(i ,j-1,k,icoff,ijcoff)
192  cv(:,ijkd) = 0.5_rfreal*(cv(:,ijkc1) + cv(:,ijkc2))
193  ENDDO
194  ENDDO
195  ENDDO
196 
197 ! finalize --------------------------------------------------------------------
198 
199  CALL deregisterfunction( global )
200 
201 END SUBROUTINE peul_setcorneredgecells
202 
203 !******************************************************************************
204 !
205 ! RCS Revision history:
206 !
207 ! $Log: PEUL_SetCornerEdgeCells.F90,v $
208 ! Revision 1.3 2008/12/06 08:44:39 mtcampbe
209 ! Updated license.
210 !
211 ! Revision 1.2 2008/11/19 22:17:52 mtcampbe
212 ! Added Illinois Open Source License/Copyright
213 !
214 ! Revision 1.1 2004/12/01 21:09:58 haselbac
215 ! Initial revision after changing case
216 !
217 ! Revision 1.2 2004/04/15 16:04:03 jferry
218 ! minor formatting (removed trailing spaces)
219 !
220 ! Revision 1.1 2004/03/02 21:44:07 jferry
221 ! Added corner and edge cell data structures and routines
222 !
223 !******************************************************************************
224 
225 
226 
227 
228 
229 
230 
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE idcend
j indices k indices k
Definition: Indexing.h:6
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE kpcbeg
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE jpcbeg
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE ipcend
subroutine rflo_getdimensdummy(region, iLev, idcbeg, idcend, jdcbeg, jdcend, kdcbeg, kdcend)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE kdcbeg
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE ipcbeg
subroutine peul_setcorneredgecells(region)
blockLoc i
Definition: read.cpp:79
subroutine rflo_getcelloffset(region, iLev, iCellOffset, ijCellOffset)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE idcbeg
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE jdcend
j indices j
Definition: Indexing.h:6
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE jpcend
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE jdcbeg
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine rflo_getdimensphys(region, iLev, ipcbeg, ipcend, jpcbeg, jpcend, kpcbeg, kpcend)