Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_floExtrapIntCellVec.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: Extrapolate vector variable defined at cells to outer dummy cells.
26 !
27 ! Description: The values are only available in the interior cells.
28 ! Here the values are extrapolated to first up to nDum cells.
29 !
30 ! Input: region = data of current region
31 ! idBeg,idEnd = begin and end variable index of the vector variable
32 ! fVec = vector variable to be extrapolated
33 !
34 ! Output: fVec = values of fVec at the remaining dummy cells are defined.
35 !
36 !******************************************************************************
37 !
38 ! $Id: TURB_floExtrapIntCellVec.F90,v 1.4 2008/12/06 08:44:43 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2001 by the University of Illinois
41 !
42 !******************************************************************************
43 
44 SUBROUTINE turb_floextrapintcellvec( region,idBeg,idEnd,fVec )
45 
46  USE moddatatypes
47  USE moddatastruct, ONLY : t_region
48  USE modglobal, ONLY : t_global
50  USE modturbulence
51  USE moderror
52  IMPLICIT NONE
53 
54 #include "Indexing.h"
55 
56 ! ... parameters
57  TYPE(t_region) :: region
58  INTEGER :: idbeg,idend
59  REAL(RFREAL), POINTER :: fvec(:,:)
60 
61 ! ... loop variables
62  INTEGER :: i, j, k, l, m, ijkc, ijkc0, ijkc1, ijkc2, ijkc3
63  INTEGER :: indxc, indxc0, indxc1, indxc2, indxc3
64 
65 ! ... local variables
66  CHARACTER(CHRLEN) :: rcsidentstring
67  TYPE(t_global), POINTER :: global
68 
69  INTEGER :: ibeg,iend,jbeg,jend,kbeg,kend
70  INTEGER :: idcbeg,idcend,jdcbeg,jdcend,kdcbeg,kdcend
71  INTEGER :: ilev,icoff,ijcoff,ndum,nadd,sign(2),indx(2)
72  INTEGER :: idum
73 
74 !******************************************************************************
75 
76  rcsidentstring = '$RCSfile: TURB_floExtrapIntCellVec.F90,v $'
77 
78  global => region%global
79  CALL registerfunction( global,'TURB_FloExtrapIntCellVec',&
80  'TURB_floExtrapIntCellVec.F90' )
81 
82 ! get indices ---------------------------------------------------------------
83 
84  sign(1)= 1
85  sign(2)=-1
86  ndum = region%nDumCells
87  nadd = -ndum
88  ilev = region%currLevel
89 
90  CALL rflo_getdimensdummy( region,ilev,idcbeg,idcend, &
91  jdcbeg,jdcend,kdcbeg,kdcend )
92  CALL rflo_getcelloffset( region,ilev,icoff,ijcoff )
93 
94  ibeg = idcbeg
95  iend = idcend
96  jbeg = jdcbeg
97  jend = jdcend
98  kbeg = kdcbeg
99  kend = kdcend
100 
101 ! extrapolation to dummy layers, first in I direction
102 
103  indx(1)=ibeg
104  indx(2)=iend
105  DO m=1,2
106  DO idum=2,ndum
107  indxc3 = indx(m)-sign(m)*(nadd-idum+1)
108  indxc2 = indx(m)-sign(m)*nadd+sign(m)
109  indxc1 = indx(m)-sign(m)*nadd
110  indxc0 = indx(m)-sign(m)*nadd-sign(m)
111  indxc = indx(m)-sign(m)*(nadd+idum)
112  DO k=kbeg,kend
113  DO j=jbeg,jend
114  ijkc = indijk(indxc ,j ,k ,icoff,ijcoff)
115  ijkc0 = ijkc + indxc0-indxc
116  ijkc1 = ijkc + indxc1-indxc
117  ijkc2 = ijkc + indxc2-indxc
118  ijkc3 = ijkc + indxc3-indxc
119 
120  DO l=idbeg,idend
121  fvec(l,ijkc0) = 2._rfreal*fvec(l,ijkc1)-fvec(l,ijkc2)
122  fvec(l,ijkc) = fvec(l,ijkc0)+fvec(l,ijkc1)-fvec(l,ijkc3)
123  ENDDO ! l
124  ENDDO ! j
125  ENDDO ! k
126  ENDDO ! iDum
127  ENDDO ! m
128 
129 ! then in J direction
130 
131  indx(1)=jbeg
132  indx(2)=jend
133  DO m=1,2
134  DO idum=2,ndum
135  indxc3 = indx(m)-sign(m)*(nadd-idum+1)
136  indxc2 = indx(m)-sign(m)*nadd+sign(m)
137  indxc1 = indx(m)-sign(m)*nadd
138  indxc0 = indx(m)-sign(m)*nadd-sign(m)
139  indxc = indx(m)-sign(m)*(nadd+idum)
140  DO k=kbeg,kend
141  DO i=ibeg,iend
142  ijkc = indijk(i ,indxc ,k ,icoff,ijcoff)
143  ijkc0 = ijkc + (indxc0-indxc)*icoff
144  ijkc1 = ijkc + (indxc1-indxc)*icoff
145  ijkc2 = ijkc + (indxc2-indxc)*icoff
146  ijkc3 = ijkc + (indxc3-indxc)*icoff
147 
148  DO l=idbeg,idend
149  fvec(l,ijkc0) = 2._rfreal*fvec(l,ijkc1)-fvec(l,ijkc2)
150  fvec(l,ijkc) = fvec(l,ijkc0)+fvec(l,ijkc1)-fvec(l,ijkc3)
151  ENDDO ! l
152  ENDDO ! i
153  ENDDO ! k
154  ENDDO ! iDum
155  ENDDO ! m
156 
157 ! then in K direction
158 
159  indx(1)=kbeg
160  indx(2)=kend
161  DO m=1,2
162  DO idum=2,ndum
163  indxc3 = indx(m)-sign(m)*(nadd-idum+1)
164  indxc2 = indx(m)-sign(m)*nadd+sign(m)
165  indxc1 = indx(m)-sign(m)*nadd
166  indxc0 = indx(m)-sign(m)*nadd-sign(m)
167  indxc = indx(m)-sign(m)*(nadd+idum)
168  DO j=jbeg,jend
169  DO i=ibeg,iend
170  ijkc = indijk(i ,j ,indxc ,icoff,ijcoff)
171  ijkc0 = ijkc + (indxc0-indxc)*ijcoff
172  ijkc1 = ijkc + (indxc1-indxc)*ijcoff
173  ijkc2 = ijkc + (indxc2-indxc)*ijcoff
174  ijkc3 = ijkc + (indxc3-indxc)*ijcoff
175 
176  DO l=idbeg,idend
177  fvec(l,ijkc0) = 2._rfreal*fvec(l,ijkc1)-fvec(l,ijkc2)
178  fvec(l,ijkc) = fvec(l,ijkc0)+fvec(l,ijkc1)-fvec(l,ijkc3)
179  ENDDO ! l
180  ENDDO ! i
181  ENDDO ! j
182  ENDDO ! iDum
183  ENDDO ! m
184 
185 ! finalize --------------------------------------------------------------------
186 
187  CALL deregisterfunction( global )
188 
189 END SUBROUTINE turb_floextrapintcellvec
190 
191 !******************************************************************************
192 !
193 ! RCS Revision history:
194 !
195 ! $Log: TURB_floExtrapIntCellVec.F90,v $
196 ! Revision 1.4 2008/12/06 08:44:43 mtcampbe
197 ! Updated license.
198 !
199 ! Revision 1.3 2008/11/19 22:17:55 mtcampbe
200 ! Added Illinois Open Source License/Copyright
201 !
202 ! Revision 1.2 2004/03/12 02:55:35 wasistho
203 ! changed rocturb routine names
204 !
205 ! Revision 1.1 2004/03/08 23:35:45 wasistho
206 ! changed turb nomenclature
207 !
208 ! Revision 1.1 2004/02/12 03:47:36 wasistho
209 ! filled in RaNS lengthscale in dummy cells
210 !
211 !
212 !
213 !******************************************************************************
214 
215 
216 
217 
218 
219 
220 
**********************************************************************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
FT m(int i, int j) const
**********************************************************************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
static SURF_BEGIN_NAMESPACE double sign(double x)
j indices k indices k
Definition: Indexing.h:6
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
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 knode iend
**********************************************************************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
subroutine turb_floextrapintcellvec(region, idBeg, idEnd, fVec)
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 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 jdcbeg
**********************************************************************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
subroutine deregisterfunction(global)
Definition: ModError.F90:469