Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_floRansRecvDummyVals.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: receive RaNS data to the dummy cells of the patch from neighboring
26 ! region / periodic boundary, which is located on a different
27 ! processor.
28 !
29 ! Description: none.
30 !
31 ! Input: region = current region
32 ! regionSrc = source region
33 ! patch = current patch of region
34 ! patchSrc = source patch of regionSrc.
35 !
36 ! Output: region%levels%turb = RaNS variables in dummy cells.
37 !
38 ! Notes: none.
39 !
40 !******************************************************************************
41 !
42 ! $Id: TURB_floRansRecvDummyVals.F90,v 1.7 2009/04/07 15:00:28 mtcampbe Exp $
43 !
44 ! Copyright: (c) 2003 by the University of Illinois
45 !
46 !******************************************************************************
47 
48 SUBROUTINE turb_floransrecvdummyvals( region,regionSrc,patch,patchSrc )
49 
50  USE moddatatypes
51  USE modbndpatch, ONLY : t_patch
52  USE moddatastruct, ONLY : t_region
53  USE modglobal, ONLY : t_global
55  USE moderror
56  USE modmpi
57  USE modparameters
59  IMPLICIT NONE
60 
61 #include "Indexing.h"
62 
63 ! ... parameters
64  TYPE(t_region) :: region, regionsrc
65  TYPE(t_patch) :: patch, patchsrc
66 
67 ! ... loop variables
68  INTEGER :: idum, i, j, k, l, ijkbuff
69 
70 ! ... local variables
71 #ifdef MPI
72  INTEGER :: status(mpi_status_size)
73 #endif
74  INTEGER :: lb, ibeg, iend, jbeg, jend, kbeg, kend, icoff, ijcoff, ijkd, &
75  n1, n2, ndim, source, tag, ilev, ncv
76 
77  REAL(RFREAL), POINTER :: tcv(:,:)
78 
79  TYPE(t_global), POINTER :: global
80 
81 !******************************************************************************
82 
83  global => region%global
84 
85  CALL registerfunction( global,'TURB_FloRansRecvDummyVals',&
86  'TURB_floRansRecvDummyVals.F90' )
87 
88 ! check if the source region is active
89 
90  IF (regionsrc%active == off) THEN
91  CALL errorstop( global,err_srcregion_off,__line__ )
92  ENDIF
93 
94 ! get dimensions and pointers
95 
96  ilev = region%currLevel
97 
98  CALL rflo_getpatchindices( region,patch,ilev,ibeg,iend, &
99  jbeg,jend,kbeg,kend )
100  CALL rflo_getcelloffset( region,ilev,icoff,ijcoff )
101 
102  tcv => region%levels(ilev)%turb%cv
103  ncv = region%turbInput%nCv
104 
105  n1 = abs(patch%l1end-patch%l1beg) + 1 ! here, dimensions of current
106  n2 = abs(patch%l2end-patch%l2beg) + 1 ! and source patch are identical
107  ndim = n1*n2*region%nDumCells ! ... but not the # of dummy cells
108 
109 ! receive data
110 
111 #ifdef MPI
112  source = regionsrc%procid
113  tag = region%localNumber + mpi_patchoff*patchsrc%srcPatch + &
114  turb_tag_shift
115  IF(tag .GT. global%mpiTagMax) tag = mod(tag,global%mpiTagMax)
116  CALL mpi_recv( patch%turb%recvBuff,ncv*ndim,mpi_rfreal, &
117  source,tag,global%mpiComm,status,global%mpierr )
118  IF (global%mpierr /= 0) CALL errorstop( global,err_mpi_trouble,__line__ )
119 #endif
120 
121 ! copy from buffer to dummy nodes ---------------------------------------------
122 
123  lb = patch%lbound
124  ijkbuff = 0
125 
126  DO idum=1,region%nDumCells
127 
128 ! - face i=const.
129 
130  IF (lb==1 .OR. lb==2) THEN
131  IF (lb == 1) i = ibeg - idum
132  IF (lb == 2) i = iend + idum
133  DO k=kbeg,kend
134  DO j=jbeg,jend
135  ijkd = indijk(i,j,k,icoff,ijcoff)
136  ijkbuff = ijkbuff + 1
137  DO l=1,ncv
138  tcv(l,ijkd) = patch%turb%recvBuff(ijkbuff+(l-1)*ndim)
139  ENDDO
140  ENDDO
141  ENDDO
142 
143 ! - face j=const.
144 
145  ELSE IF (lb==3 .OR. lb==4) THEN
146  IF (lb == 3) j = jbeg - idum
147  IF (lb == 4) j = jend + idum
148  DO i=ibeg,iend
149  DO k=kbeg,kend
150  ijkd = indijk(i,j,k,icoff,ijcoff)
151  ijkbuff = ijkbuff + 1
152  DO l=1,ncv
153  tcv(l,ijkd) = patch%turb%recvBuff(ijkbuff+(l-1)*ndim)
154  ENDDO
155  ENDDO
156  ENDDO
157 
158 ! - face k=const.
159 
160  ELSE IF (lb==5 .OR. lb==6) THEN
161  IF (lb == 5) k = kbeg - idum
162  IF (lb == 6) k = kend + idum
163  DO j=jbeg,jend
164  DO i=ibeg,iend
165  ijkd = indijk(i,j,k,icoff,ijcoff)
166  ijkbuff = ijkbuff + 1
167  DO l=1,ncv
168  tcv(l,ijkd) = patch%turb%recvBuff(ijkbuff+(l-1)*ndim)
169  ENDDO
170  ENDDO
171  ENDDO
172  ENDIF ! lb
173 
174  ENDDO ! idum
175 
176 ! finalize --------------------------------------------------------------------
177 
178  CALL deregisterfunction( global )
179 
180 END SUBROUTINE turb_floransrecvdummyvals
181 
182 !******************************************************************************
183 !
184 ! RCS Revision history:
185 !
186 ! $Log: TURB_floRansRecvDummyVals.F90,v $
187 ! Revision 1.7 2009/04/07 15:00:28 mtcampbe
188 ! Fixed possible tag errors.
189 !
190 ! Revision 1.6 2008/12/06 08:44:44 mtcampbe
191 ! Updated license.
192 !
193 ! Revision 1.5 2008/11/19 22:17:56 mtcampbe
194 ! Added Illinois Open Source License/Copyright
195 !
196 ! Revision 1.4 2008/10/23 18:20:57 mtcampbe
197 ! Crazy number of changes to track and fix initialization and
198 ! restart bugs. Many improperly formed logical expressions
199 ! were fixed, and bug in allocation for data associated with
200 ! the BC_INFLOWVELTEMP boundary condition squashed in
201 ! RFLO_ReadBcInflowVelSection.F90.
202 !
203 ! Revision 1.3 2006/08/19 15:40:47 mparmar
204 ! Renamed patch variables
205 !
206 ! Revision 1.2 2004/03/12 02:55:36 wasistho
207 ! changed rocturb routine names
208 !
209 ! Revision 1.1 2004/03/08 23:35:46 wasistho
210 ! changed turb nomenclature
211 !
212 ! Revision 1.1 2003/10/07 02:17:03 wasistho
213 ! initial installation of RaNS-SA and DES
214 !
215 !
216 !******************************************************************************
217 
218 
219 
220 
221 
222 
223 
**********************************************************************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 registerfunction(global, funName, fileName)
Definition: ModError.F90:449
int status() const
Obtain the status of the attribute.
Definition: Attribute.h:240
subroutine rflo_getpatchindices(region, patch, iLev, ibeg, iend, jbeg, jend, kbeg, kend)
Definition: patch.h:74
**********************************************************************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 rflo_getcelloffset(region, iLev, iCellOffset, ijCellOffset)
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
CGAL::Point_2< R > source() const
Definition: Ray_2.h:128
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
**********************************************************************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
subroutine turb_floransrecvdummyvals(region, regionSrc, patch, patchSrc)