Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_floRansRecvCornEdgeCells.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: receives values for edge and corner cells from an adjacent
26 ! region.
27 !
28 ! Description: this is for the case if the other region is located
29 ! on a different processor.
30 !
31 ! Input: regions = data of all regions
32 ! iReg = current region.
33 !
34 ! Output: new values of RaNS variables.
35 !
36 ! Notes: none.
37 !
38 !******************************************************************************
39 !
40 ! $Id: TURB_floRansRecvCornEdgeCells.F90,v 1.6 2009/08/26 12:28:53 mtcampbe Exp $
41 !
42 ! Copyright: (c) 2001 by the University of Illinois
43 !
44 !******************************************************************************
45 
46 SUBROUTINE turb_floransrecvcornedgecells( regions,iReg )
47 
48  USE moddatatypes
49  USE modglobal, ONLY : t_global
50  USE moddatastruct, ONLY : t_region, t_level, t_dcelltransf
53  USE moderror
54  USE modmpi
55  USE modparameters
57  IMPLICIT NONE
58 
59 #include "Indexing.h"
60 
61 ! ... parameters
62  TYPE(t_region), POINTER :: regions(:)
63 
64  INTEGER :: ireg
65 
66 ! ... loop variables
67  INTEGER :: ir, iedge, icorner, i, j, k, l, ijk
68 
69 ! ... local variables
70 #ifdef MPI
71  INTEGER :: status(mpi_status_size)
72 #endif
73  INTEGER :: ilev, ncv, iregsrc, ibuff, ndim, source, tag
74  INTEGER :: ibeg, iend, jbeg, jend, kbeg, kend, icoff, ijcoff, ijkc
75 
76  REAL(RFREAL), POINTER :: tcv(:,:)
77 
78  TYPE(t_global), POINTER :: global
79  TYPE(t_level), POINTER :: level
80  TYPE(t_dcelltransf), POINTER :: rcvturbeccell
81 
82 !******************************************************************************
83 
84  global => regions(ireg)%global
85 
86  CALL registerfunction( global,'TURB_FloRansRecvCornEdgeCells',&
87  'TURB_floRansRecvCornEdgeCells.F90' )
88 
89  ilev = regions(ireg)%currLevel
90  ncv = regions(ireg)%turbInput%nCv
91 
92  level => regions(ireg)%levels(ilev)
93  tcv => level%turb%cv
94 
95  CALL rflo_getcelloffset( regions(ireg),ilev,icoff,ijcoff )
96 
97 ! copy data from buffer to dummy cells
98 
99  DO ir=1,global%nRegions
100  IF (regions(ir)%procid /= global%myProcid) THEN
101  IF (level%rcvTurbEcCells(ir)%nCells > 0) THEN
102 
103  rcvturbeccell => level%rcvTurbEcCells(ir)
104  ndim = rcvturbeccell%nCells
105  ibuff = 0
106 
107 #ifdef MPI
108  source = regions(ir)%procid
109  tag = regions(ireg)%localNumber + turb_tag_shift
110  IF(tag .GT. global%mpiTagMax) tag = mod(tag,global%mpiTagMax)
111  CALL mpi_recv( rcvturbeccell%buff,ncv*ndim,mpi_rfreal, &
112  source,tag,global%mpiComm,status,global%mpierr )
113  IF (global%mpierr /= 0) CALL errorstop( global,err_mpi_trouble,__line__ )
114 #endif
115 
116 ! --- edges
117 
118  DO iedge=1,12
119  IF (level%edgeCells(iedge)%interact.eqv..true.) THEN
120  CALL rflo_getedgecellsindices( regions(ireg),ilev,iedge, &
121  ibeg,iend,jbeg,jend,kbeg,kend )
122 
123  ijk = 0
124  DO k=kbeg,kend
125  DO j=jbeg,jend
126  DO i=ibeg,iend
127  ijk = ijk + 1
128  ijkc = indijk(i,j,k,icoff,ijcoff)
129  iregsrc = level%edgeCells(iedge)%cells(ijk)%srcRegion
130  IF (iregsrc == ir) THEN
131  ibuff = ibuff + 1
132  IF (level%edgeCells(iedge)%cells(ijk)%rotate.eqv..true.) THEN
133  ! rotational periodicity
134  ELSE
135  DO l=1,ncv
136  tcv(l,ijkc) = rcvturbeccell%buff(ibuff+(l-1)*ndim)
137  ENDDO
138  ENDIF
139  ENDIF
140  ENDDO
141  ENDDO
142  ENDDO
143 
144  ENDIF ! interact
145  ENDDO ! iedge
146 
147 ! --- corners (currently not participating)
148 
149 ! DO icorner=1,8
150 ! IF (level%cornerCells(icorner)%interact) THEN
151 ! CALL RFLO_GetCornerCellsIndices( regions(iReg),iLev,icorner, &
152 ! ibeg,iend,jbeg,jend,kbeg,kend )
153 
154 ! ijk = 0
155 ! DO k=kbeg,kend
156 ! DO j=jbeg,jend
157 ! DO i=ibeg,iend
158 ! ijk = ijk + 1
159 ! ijkC = IndIJK(i,j,k,iCOff,ijCOff)
160 ! iRegSrc = level%cornerCells(icorner)%cells(ijk)%srcRegion
161 ! IF (iRegSrc == ir) THEN
162 ! ibuff = ibuff + 1
163 ! IF (level%cornerCells(icorner)%cells(ijk)%rotate) THEN
164 ! ! rotational periodicity
165 ! ELSE
166 ! DO l=1,nCv
167 ! tcv(l,ijkC) = rcvTurbEcCell%buff(ibuff+(l-1)*nDim)
168 ! ENDDO
169 ! ENDIF
170 ! ENDIF
171 ! ENDDO
172 ! ENDDO
173 ! ENDDO
174 
175 ! ENDIF ! interact
176 ! ENDDO ! icorner
177 
178  ENDIF ! some cells to receive
179  ENDIF ! not my processor
180  ENDDO ! ir
181 
182 ! finalize
183 
184  CALL deregisterfunction( global )
185 
186 END SUBROUTINE turb_floransrecvcornedgecells
187 
188 !******************************************************************************
189 !
190 ! RCS Revision history:
191 !
192 ! $Log: TURB_floRansRecvCornEdgeCells.F90,v $
193 ! Revision 1.6 2009/08/26 12:28:53 mtcampbe
194 ! Ported to Hera. Fixed logical expression syntax errors. Replaced all
195 ! IF (logical_variable) with IF (logical_variable .eqv. .true.) as
196 ! consistent with the specification. Also changed: IF( ASSOCIATED(expr) )
197 ! to IF ( ASSOCIATED(expr) .eqv. .true. ). Intel compilers produce code
198 ! which silently fails for some mal-formed expressions, so these changes
199 ! are a net which should ensure that they are evaluated as intended.
200 !
201 ! Revision 1.5 2009/04/07 15:00:28 mtcampbe
202 ! Fixed possible tag errors.
203 !
204 ! Revision 1.4 2008/12/06 08:44:44 mtcampbe
205 ! Updated license.
206 !
207 ! Revision 1.3 2008/11/19 22:17:56 mtcampbe
208 ! Added Illinois Open Source License/Copyright
209 !
210 ! Revision 1.2 2004/03/12 02:55:36 wasistho
211 ! changed rocturb routine names
212 !
213 ! Revision 1.1 2004/03/08 23:35:45 wasistho
214 ! changed turb nomenclature
215 !
216 ! Revision 1.2 2004/02/18 22:51:32 wasistho
217 ! added TURB_TAG_SHIFT in mpi_recv tag
218 !
219 ! Revision 1.1 2004/01/23 00:39:06 wasistho
220 ! added communication routines for RaNS edge/corners
221 !
222 !
223 !******************************************************************************
224 
225 
226 
227 
228 
229 
230 
subroutine turb_floransrecvcornedgecells(regions, iReg)
subroutine rflo_getedgecellsindices(region, iLev, iedge, iebeg, ieend, jebeg, jeend, kebeg, keend)
**********************************************************************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
**********************************************************************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)
**********************************************************************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 icorner
subroutine rflo_getcornercellsindices(region, iLev, icorner, icbeg, icend, jcbeg, jcend, kcbeg, kcend)
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