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