Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLO_ModExtrapolation.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 for extrapolation routines.
26 !
27 ! Description: None.
28 !
29 ! ******************************************************************************
30 !
31 ! $Id: RFLO_ModExtrapolation.F90,v 1.3 2008/12/06 08:44:16 mtcampbe Exp $
32 !
33 ! Copyright: (c) 2004 by the University of Illinois
34 !
35 ! ******************************************************************************
36 
38 
39  USE modglobal, ONLY : t_global
40  USE moddatastruct, ONLY: t_region
41  USE modgrid, ONLY : t_grid
42  USE modbndpatch, ONLY : t_patch
43  USE modparameters
44  USE moddatatypes
45  USE moderror
46  USE modmpi
47 
48  IMPLICIT NONE
49 
50  PRIVATE
51  PUBLIC :: rflo_extrapregdummynode, &
53 
54 ! private :
55 
56 ! ******************************************************************************
57 ! Declarations and definitions
58 ! ******************************************************************************
59 
60  CHARACTER(CHRLEN) :: RCSIdentString = &
61  '$RCSfile: RFLO_ModExtrapolation.F90,v $ $Revision: 1.3 $'
62 
63 ! ******************************************************************************
64 ! Routines
65 ! ******************************************************************************
66 
67  CONTAINS
68 
69 !******************************************************************************
70 !
71 ! Purpose: extrapolate to region dummy nodes
72 !
73 ! Description: based on uniform grid linear interpolation
74 !
75 ! Input: ibeg, iend, jbeg, jend, kbeg, kend = region dimension incl. dummies
76 ! ndum = number of dummy points/cells
77 ! iNOff = i-stride
78 ! ijNOff = ij-stride
79 ! idb, ide = begin and end indexing of first dimension of var(:,:)
80 ! var = real variable to be extrapolated
81 !
82 ! Output: var = dummy points of var assigned extrapolated values
83 !
84 ! Notes: none.
85 !
86 !******************************************************************************
87 
88 SUBROUTINE rflo_extrapregdummynode( ibeg,iend,jbeg,jend,kbeg,kend,ndum, &
89  inoff,ijnoff,idb,ide,var )
90 
91  IMPLICIT NONE
92 
93 #include "Indexing.h"
94 
95 ! ... parameters
96  INTEGER :: ibeg, iend, jbeg, jend, kbeg, kend, ndum, idb, ide, inoff, ijnoff
97  REAL(RFREAL), POINTER :: var(:,:)
98 
99 ! ... loop variables
100  INTEGER :: i, j, k
101 
102 ! ... local variables
103  INTEGER :: nelm, ndim, ijkn, ijkn1, ijkn2, error
104 
105 !******************************************************************************
106 
107  nelm = ide-idb+1
108  ndim = (iend-ibeg+1)*(jend-jbeg+1)*(kend-kbeg+1)
109 
110  IF ((SIZE( var,1 ) < nelm) .OR. (SIZE( var,2 ) /= ndim)) THEN
111  WRITE(stderr,'(A)') solver_name
112  WRITE(stderr,'(A,1X,A)') solver_name,'ERROR in RFLO_ExtrapRegDummyNode: '
113  WRITE(stderr,'(A,1X,A)') solver_name,'inconsistent 1st or 2nd dimension'
114  WRITE(stderr,'(A)') solver_name
115 #ifdef MPI
116  CALL mpi_abort( error )
117 #endif
118  stop
119  ENDIF
120 
121  DO k=kbeg,kend
122  DO j=jbeg,jend
123  DO i=ibeg+ndum-1,ibeg,-1
124  ijkn = indijk(i ,j ,k ,inoff,ijnoff)
125  ijkn1 = indijk(i+1 ,j ,k ,inoff,ijnoff)
126  ijkn2 = indijk(i+2 ,j ,k ,inoff,ijnoff)
127  var(idb:ide,ijkn) = 2*var(idb:ide,ijkn1) - var(idb:ide,ijkn2)
128  ENDDO
129  DO i=iend-ndum+1,iend
130  ijkn = indijk(i ,j ,k ,inoff,ijnoff)
131  ijkn1 = indijk(i-1 ,j ,k ,inoff,ijnoff)
132  ijkn2 = indijk(i-2 ,j ,k ,inoff,ijnoff)
133  var(idb:ide,ijkn) = 2*var(idb:ide,ijkn1) - var(idb:ide,ijkn2)
134  ENDDO
135  ENDDO
136  ENDDO
137 
138  DO i=ibeg,iend
139  DO k=kbeg,kend
140  DO j=jbeg+ndum-1,jbeg,-1
141  ijkn = indijk(i ,j ,k ,inoff,ijnoff)
142  ijkn1 = indijk(i ,j+1 ,k ,inoff,ijnoff)
143  ijkn2 = indijk(i ,j+2 ,k ,inoff,ijnoff)
144  var(idb:ide,ijkn) = 2*var(idb:ide,ijkn1) - var(idb:ide,ijkn2)
145  ENDDO
146  DO j=jend-ndum+1,jend
147  ijkn = indijk(i ,j ,k ,inoff,ijnoff)
148  ijkn1 = indijk(i ,j-1 ,k ,inoff,ijnoff)
149  ijkn2 = indijk(i ,j-2 ,k ,inoff,ijnoff)
150  var(idb:ide,ijkn) = 2*var(idb:ide,ijkn1) - var(idb:ide,ijkn2)
151  ENDDO
152  ENDDO
153  ENDDO
154 
155  DO j=jbeg,jend
156  DO i=ibeg,iend
157  DO k=kbeg+ndum-1,kbeg,-1
158  ijkn = indijk(i ,j ,k ,inoff,ijnoff)
159  ijkn1 = indijk(i ,j ,k+1 ,inoff,ijnoff)
160  ijkn2 = indijk(i ,j ,k+2 ,inoff,ijnoff)
161  var(idb:ide,ijkn) = 2*var(idb:ide,ijkn1) - var(idb:ide,ijkn2)
162  ENDDO
163  DO k=kend-ndum+1,kend
164  ijkn = indijk(i ,j ,k ,inoff,ijnoff)
165  ijkn1 = indijk(i ,j ,k-1 ,inoff,ijnoff)
166  ijkn2 = indijk(i ,j ,k-2 ,inoff,ijnoff)
167  var(idb:ide,ijkn) = 2*var(idb:ide,ijkn1) - var(idb:ide,ijkn2)
168  ENDDO
169  ENDDO
170  ENDDO
171 
172 ! finalize --------------------------------------------------------------------
173 
174 END SUBROUTINE rflo_extrapregdummynode
175 
176 !******************************************************************************
177 !
178 ! Purpose: extrapolate to last layer of dummy nodes
179 !
180 ! Description: based on uniform grid linear interpolation
181 !
182 ! Input: ibeg, iend, jbeg, jend, kbeg, kend = region dimension incl. dummies
183 ! ndum = number of dummy points/cells
184 ! iNOff = i-stride
185 ! ijNOff = ij-stride
186 ! idb, ide = begin and end indexing of first dimension of var(:,:)
187 ! var = real variable to be extrapolated
188 !
189 ! Output: var = dummy points of var assigned extrapolated values
190 !
191 ! Notes: none.
192 !
193 !******************************************************************************
194 
195 SUBROUTINE rflo_extrapreglastnode( ibeg,iend,jbeg,jend,kbeg,kend, &
196  inoff,ijnoff,idb,ide,var )
197 
198  IMPLICIT NONE
199 
200 #include "Indexing.h"
201 
202 ! ... parameters
203  INTEGER :: ibeg, iend, jbeg, jend, kbeg, kend, idb, ide, inoff, ijnoff
204  REAL(RFREAL), POINTER :: var(:,:)
205 
206 ! ... loop variables
207  INTEGER :: i, j, k
208 
209 ! ... local variables
210  INTEGER :: nelm, ndim, ijkn, ijkn1, ijkn2, error
211 
212 !******************************************************************************
213 
214  nelm = ide-idb+1
215  ndim = (iend-ibeg+1)*(jend-jbeg+1)*(kend-kbeg+1)
216 
217  IF ((SIZE( var,1 ) < nelm) .OR. (SIZE( var,2 ) /= ndim)) THEN
218  WRITE(stderr,'(A)') solver_name
219  WRITE(stderr,'(A,1X,A)') solver_name,'ERROR in RFLO_ExtrapRegDummyNode: '
220  WRITE(stderr,'(A,1X,A)') solver_name,'inconsistent 1st or 2nd dimension'
221  WRITE(stderr,'(A)') solver_name
222 #ifdef MPI
223  CALL mpi_abort( error )
224 #endif
225  stop
226  ENDIF
227 
228  DO k=kbeg,kend
229  DO j=jbeg,jend
230  DO i=ibeg,ibeg
231  ijkn = indijk(i ,j ,k ,inoff,ijnoff)
232  ijkn1 = indijk(i+1 ,j ,k ,inoff,ijnoff)
233  ijkn2 = indijk(i+2 ,j ,k ,inoff,ijnoff)
234  var(idb:ide,ijkn) = 2*var(idb:ide,ijkn1) - var(idb:ide,ijkn2)
235  ENDDO
236  DO i=iend,iend
237  ijkn = indijk(i ,j ,k ,inoff,ijnoff)
238  ijkn1 = indijk(i-1 ,j ,k ,inoff,ijnoff)
239  ijkn2 = indijk(i-2 ,j ,k ,inoff,ijnoff)
240  var(idb:ide,ijkn) = 2*var(idb:ide,ijkn1) - var(idb:ide,ijkn2)
241  ENDDO
242  ENDDO
243  ENDDO
244 
245  DO i=ibeg,iend
246  DO k=kbeg,kend
247  DO j=jbeg,jbeg
248  ijkn = indijk(i ,j ,k ,inoff,ijnoff)
249  ijkn1 = indijk(i ,j+1 ,k ,inoff,ijnoff)
250  ijkn2 = indijk(i ,j+2 ,k ,inoff,ijnoff)
251  var(idb:ide,ijkn) = 2*var(idb:ide,ijkn1) - var(idb:ide,ijkn2)
252  ENDDO
253  DO j=jend,jend
254  ijkn = indijk(i ,j ,k ,inoff,ijnoff)
255  ijkn1 = indijk(i ,j-1 ,k ,inoff,ijnoff)
256  ijkn2 = indijk(i ,j-2 ,k ,inoff,ijnoff)
257  var(idb:ide,ijkn) = 2*var(idb:ide,ijkn1) - var(idb:ide,ijkn2)
258  ENDDO
259  ENDDO
260  ENDDO
261 
262  DO j=jbeg,jend
263  DO i=ibeg,iend
264  DO k=kbeg,kbeg
265  ijkn = indijk(i ,j ,k ,inoff,ijnoff)
266  ijkn1 = indijk(i ,j ,k+1 ,inoff,ijnoff)
267  ijkn2 = indijk(i ,j ,k+2 ,inoff,ijnoff)
268  var(idb:ide,ijkn) = 2*var(idb:ide,ijkn1) - var(idb:ide,ijkn2)
269  ENDDO
270  DO k=kend,kend
271  ijkn = indijk(i ,j ,k ,inoff,ijnoff)
272  ijkn1 = indijk(i ,j ,k-1 ,inoff,ijnoff)
273  ijkn2 = indijk(i ,j ,k-2 ,inoff,ijnoff)
274  var(idb:ide,ijkn) = 2*var(idb:ide,ijkn1) - var(idb:ide,ijkn2)
275  ENDDO
276  ENDDO
277  ENDDO
278 
279 ! finalize --------------------------------------------------------------------
280 
281 END SUBROUTINE rflo_extrapreglastnode
282 
283 ! ******************************************************************************
284 ! End
285 ! ******************************************************************************
286 
287 END MODULE rflo_modextrapolation
288 
289 ! ******************************************************************************
290 !
291 ! RCS Revision history:
292 !
293 ! $Log: RFLO_ModExtrapolation.F90,v $
294 ! Revision 1.3 2008/12/06 08:44:16 mtcampbe
295 ! Updated license.
296 !
297 ! Revision 1.2 2008/11/19 22:17:27 mtcampbe
298 ! Added Illinois Open Source License/Copyright
299 !
300 ! Revision 1.1 2005/12/03 09:39:47 wasistho
301 ! initial import
302 !
303 !
304 !
305 ! ******************************************************************************
306 
307 
308 
309 
310 
311 
**********************************************************************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 ibeg
j indices k indices k
Definition: Indexing.h:6
subroutine, public rflo_extrapreglastnode(ibeg, iend, jbeg, jend, kbeg, kend, iNOff, ijNOff, idb, ide, var)
**********************************************************************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 knode iend
blockLoc i
Definition: read.cpp:79
subroutine, public rflo_extrapregdummynode(ibeg, iend, jbeg, jend, kbeg, kend, ndum, iNOff, ijNOff, idb, ide, var)
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 knode jend
**********************************************************************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 knode jbeg
**********************************************************************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 knode kbeg