Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLO_CalcGradDummyPhys.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: copy gradients at the patch to the dummy points
26 ! for physical boundary conditions
27 !
28 ! Description: dummy gradients copied from interior
29 !
30 ! Input: region = data of current region
31 ! lbound = patch boundary index
32 ! idir,jdir,kdir = patch direction
33 ! indBeg,indEnd,jndBeg,jndEnd,kndBeg,kndEnd = indices of patch nodes
34 ! iBegV, iEndV = begin and end var index
35 ! iBegG, iEndG = begin and end gradient index
36 !
37 ! Output: gradi, gradj, gradk = gradients at dummy faces of the current patch
38 !
39 ! Notes: none.
40 !
41 !******************************************************************************
42 !
43 ! $Id: RFLO_CalcGradDummyPhys.F90,v 1.3 2008/12/06 08:44:06 mtcampbe Exp $
44 !
45 ! Copyright: (c) 2001 by the University of Illinois
46 !
47 !******************************************************************************
48 
49 SUBROUTINE rflo_calcgraddummyphys( region,lbound, &
50  idir ,jdir ,kdir , &
51  indbeg,indend,jndbeg,jndend,kndbeg,kndend, &
52  ibegv ,iendv ,ibegg ,iendg , &
53  gradi ,gradj ,gradk )
54 
55  USE moddatatypes
56  USE moddatastruct, ONLY : t_region
58  USE moderror
59  USE modparameters
60  IMPLICIT NONE
61 
62 #include "Indexing.h"
63 
64 ! ... parameters
65  TYPE(t_region) :: region
66  INTEGER :: lbound, idir, jdir, kdir
67  INTEGER :: indbeg, indend, jndbeg, jndend, kndbeg, kndend
68  INTEGER :: ibegv, iendv, ibegg, iendg
69  REAL(RFREAL), POINTER :: gradi(:,:),gradj(:,:),gradk(:,:)
70 
71 ! ... loop variables
72  INTEGER :: i, j, k, idum, jdum, kdum
73 
74 ! ... local variables
75  INTEGER :: ilev, inoff, ijnoff
76  INTEGER :: ijkni, ijknj, ijknk, ijknd
77  INTEGER :: ig(3), jg(3), kg(3)
78  INTEGER :: idumb(3), jdumb(3), kdumb(3), idume(3), jdume(3), kdume(3)
79 
80 !******************************************************************************
81 
82  CALL registerfunction( region%global,'RFLO_CalcGradDummyPhys',&
83  'RFLO_CalcGradDummyPhys.F90' )
84 
85 ! get dimensions --------------------------------------------------------------
86 
87  ilev = region%currLevel
88  CALL rflo_getnodeoffset( region,ilev,inoff,ijnoff )
89 
90  IF (lbound==1 .OR. lbound==3 .OR. lbound==5) THEN
91  idumb(:) = -idir*region%nDumCells
92  jdumb(:) = -jdir*region%nDumCells
93  kdumb(:) = -kdir*region%nDumCells
94  idume(:) = -idir
95  jdume(:) = -jdir
96  kdume(:) = -kdir
97  ELSE
98  idumb(:) = 0
99  jdumb(:) = 0
100  kdumb(:) = 0
101  idume(:) = -idir*region%nDumCells
102  jdume(:) = -jdir*region%nDumCells
103  kdume(:) = -kdir*region%nDumCells
104  ENDIF
105 
106  ig(:)=0; jg(:)=0; kg(:)=0
107  IF (lbound == 2) THEN
108  idumb(1) = idumb(1)-idir
109  ig(2)=idir; ig(3)=idir
110  ELSE IF (lbound == 4) THEN
111  jdumb(2) = jdumb(2)-jdir
112  jg(1)=jdir; jg(3)=jdir
113  ELSE IF (lbound == 6) THEN
114  kdumb(3) = kdumb(3)-kdir
115  kg(1)=kdir; kg(2)=kdir
116  ENDIF
117 
118 ! 2D loop over patch nodes ----------------------------------------------------
119 
120  DO k=kndbeg,kndend
121  DO j=jndbeg,jndend
122  DO i=indbeg,indend
123 
124  ijkni = indijk(i+ig(1),j+jg(1),k+kg(1),inoff,ijnoff) ! i reference
125  ijknj = indijk(i+ig(2),j+jg(2),k+kg(2),inoff,ijnoff) ! j reference
126  ijknk = indijk(i+ig(3),j+jg(3),k+kg(3),inoff,ijnoff) ! k reference
127 
128 ! ----- 1D loop in direction normal to patch to define grads at dummy faces
129 
130  DO idum=idumb(1),idume(1)
131  DO jdum=jdumb(1),jdume(1)
132  DO kdum=kdumb(1),kdume(1)
133  ijknd = indijk(i+idum,j+jdum,k+kdum,inoff,ijnoff)
134  gradi(:,ijknd) = gradi(:,ijkni)
135  ENDDO
136  ENDDO
137  ENDDO
138 
139  DO idum=idumb(2),idume(2)
140  DO jdum=jdumb(2),jdume(2)
141  DO kdum=kdumb(2),kdume(2)
142  ijknd = indijk(i+idum,j+jdum,k+kdum,inoff,ijnoff)
143  gradj(:,ijknd) = gradj(:,ijknj)
144  ENDDO
145  ENDDO
146  ENDDO
147 
148  DO idum=idumb(3),idume(3)
149  DO jdum=jdumb(3),jdume(3)
150  DO kdum=kdumb(3),kdume(3)
151  ijknd = indijk(i+idum,j+jdum,k+kdum,inoff,ijnoff)
152  gradk(:,ijknd) = gradk(:,ijknk)
153  ENDDO
154  ENDDO
155  ENDDO
156 
157  ENDDO ! i
158  ENDDO ! j
159  ENDDO ! k
160 
161 ! finalize --------------------------------------------------------------------
162 
163  CALL deregisterfunction( region%global )
164 
165 END SUBROUTINE rflo_calcgraddummyphys
166 
167 !******************************************************************************
168 !
169 ! RCS Revision history:
170 !
171 ! $Log: RFLO_CalcGradDummyPhys.F90,v $
172 ! Revision 1.3 2008/12/06 08:44:06 mtcampbe
173 ! Updated license.
174 !
175 ! Revision 1.2 2008/11/19 22:17:20 mtcampbe
176 ! Added Illinois Open Source License/Copyright
177 !
178 ! Revision 1.1 2004/11/29 21:25:16 wasistho
179 ! lower to upper case
180 !
181 ! Revision 1.6 2003/11/20 16:40:34 mdbrandy
182 ! Backing out RocfluidMP changes from 11-17-03
183 !
184 ! Revision 1.3 2003/05/15 02:57:01 jblazek
185 ! Inlined index function.
186 !
187 ! Revision 1.2 2002/09/05 17:40:19 jblazek
188 ! Variable global moved into regions().
189 !
190 ! Revision 1.1 2002/09/02 22:58:54 wasistho
191 ! RFLO grad routines migrated from rocflo to libflo
192 !
193 ! Revision 1.3 2002/07/22 22:59:11 jblazek
194 ! Some more clean up.
195 !
196 ! Revision 1.2 2002/07/19 23:43:35 wasistho
197 ! made compliant with CODING RULE
198 !
199 !******************************************************************************
200 
201 
202 
203 
204 
205 
206 
j indices k indices k
Definition: Indexing.h:6
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine rflo_getnodeoffset(region, iLev, iNodeOffset, ijNodeOffset)
**********************************************************************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 jdir
blockLoc i
Definition: read.cpp:79
**********************************************************************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 idir
**********************************************************************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 iEndG gradi(:,:)
j indices j
Definition: Indexing.h:6
subroutine rflo_calcgraddummyphys(region, lbound, idir, jdir, kdir, indBeg, indEnd, jndBeg, jndEnd, kndBeg, kndEnd, iBegV, iEndV, iBegG, iEndG, gradi, gradj, gradk)
**********************************************************************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 kdir
subroutine deregisterfunction(global)
Definition: ModError.F90:469
**********************************************************************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 iEndG gradj(:,:)