Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLO_ReceiveCornerEdgeCells.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 conservative variables.
35 !
36 ! Notes: none.
37 !
38 !******************************************************************************
39 !
40 ! $Id: RFLO_ReceiveCornerEdgeCells.F90,v 1.4 2008/12/06 08:44:27 mtcampbe Exp $
41 !
42 ! Copyright: (c) 2001 by the University of Illinois
43 !
44 !******************************************************************************
45 
46 SUBROUTINE rflo_receivecorneredgecells( 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
56  IMPLICIT NONE
57 
58 #include "Indexing.h"
59 
60 ! ... parameters
61  TYPE(t_region), POINTER :: regions(:)
62 
63  INTEGER :: ireg
64 
65 ! ... loop variables
66  INTEGER :: ir, iedge, icorner, i, j, k, ijk
67 
68 ! ... local variables
69 #ifdef MPI
70  INTEGER :: status(mpi_status_size)
71 #endif
72  INTEGER :: ilev, iregsrc, ibuff, ndim, source, tag, gasmodel
73  INTEGER :: ibeg, iend, jbeg, jend, kbeg, kend, icoff, ijcoff, ijkc
74 
75  REAL(RFREAL), POINTER :: cv(:,:)
76 
77  TYPE(t_global), POINTER :: global
78  TYPE(t_level), POINTER :: level
79  TYPE(t_dcelltransf), POINTER :: recveccell
80 
81 !******************************************************************************
82 
83  global => regions(ireg)%global
84 
85  CALL registerfunction( global,'RFLO_ReceiveCornerEdgeCells',&
86  'RFLO_ReceiveCornerEdgeCells.F90' )
87 
88  ilev = regions(ireg)%currLevel
89  gasmodel = regions(ireg)%mixtInput%gasModel
90  level => regions(ireg)%levels(ilev)
91  cv => level%mixt%cv
92 
93  CALL rflo_getcelloffset( regions(ireg),ilev,icoff,ijcoff )
94 
95 ! copy data from buffer to dummy cells
96 
97  DO ir=1,global%nRegions
98  IF (regions(ir)%procid /= global%myProcid) THEN
99  IF (level%recvEcCells(ir)%nCells > 0) THEN
100 
101  recveccell => level%recvEcCells(ir)
102  ndim = recveccell%nCells
103  ibuff = 0
104 
105 #ifdef MPI
106  source = regions(ir)%procid
107  tag = regions(ireg)%localNumber
108  CALL mpi_recv( recveccell%buff,cv_mixt_neqs*ndim,mpi_rfreal, &
109  source,tag,global%mpiComm,status,global%mpierr )
110  IF (global%mpierr /= 0) CALL errorstop( global,err_mpi_trouble,__line__ )
111 #endif
112 
113 ! --- edges
114 
115  DO iedge=1,12
116  IF (level%edgeCells(iedge)%interact .AND. &
117  level%edgeCells(iedge)%degenrt==degenerat_none) THEN
118  CALL rflo_getedgecellsindices( regions(ireg),ilev,iedge, &
119  ibeg,iend,jbeg,jend,kbeg,kend )
120 
121  ijk = 0
122  DO k=kbeg,kend
123  DO j=jbeg,jend
124  DO i=ibeg,iend
125  ijk = ijk + 1
126  ijkc = indijk(i,j,k,icoff,ijcoff)
127  iregsrc = level%edgeCells(iedge)%cells(ijk)%srcRegion
128  IF (iregsrc == ir) THEN
129  ibuff = ibuff + 1
130  IF (level%edgeCells(iedge)%cells(ijk)%rotate) THEN
131  ! rotational periodicity
132  ELSE
133  cv(cv_mixt_dens,ijkc) = recveccell%buff(ibuff )
134  cv(cv_mixt_xmom,ijkc) = recveccell%buff(ibuff+ ndim)
135  cv(cv_mixt_ymom,ijkc) = recveccell%buff(ibuff+2*ndim)
136  cv(cv_mixt_zmom,ijkc) = recveccell%buff(ibuff+3*ndim)
137  cv(cv_mixt_ener,ijkc) = recveccell%buff(ibuff+4*ndim)
138  ENDIF
139 
140  IF (gasmodel == gas_model_tcperf) THEN
141  CALL mixtureproperties( regions(ireg),ijkc,ijkc,.false. )
142  ELSE
143  CALL mixtureproperties( regions(ireg),ijkc,ijkc,.true. )
144  ENDIF
145  ENDIF
146  ENDDO
147  ENDDO
148  ENDDO
149 
150  ENDIF ! interact
151  ENDDO ! iedge
152 
153 ! --- corners
154 
155  DO icorner=1,8
156  IF (level%cornerCells(icorner)%interact .AND. &
157  level%cornerCells(icorner)%degenrt==degenerat_none) THEN
158  CALL rflo_getcornercellsindices( regions(ireg),ilev,icorner, &
159  ibeg,iend,jbeg,jend,kbeg,kend )
160 
161  ijk = 0
162  DO k=kbeg,kend
163  DO j=jbeg,jend
164  DO i=ibeg,iend
165  ijk = ijk + 1
166  ijkc = indijk(i,j,k,icoff,ijcoff)
167  iregsrc = level%cornerCells(icorner)%cells(ijk)%srcRegion
168  IF (iregsrc == ir) THEN
169  ibuff = ibuff + 1
170  IF (level%cornerCells(icorner)%cells(ijk)%rotate) THEN
171  ! rotational periodicity
172  ELSE
173  cv(cv_mixt_dens,ijkc) = recveccell%buff(ibuff )
174  cv(cv_mixt_xmom,ijkc) = recveccell%buff(ibuff+ ndim)
175  cv(cv_mixt_ymom,ijkc) = recveccell%buff(ibuff+2*ndim)
176  cv(cv_mixt_zmom,ijkc) = recveccell%buff(ibuff+3*ndim)
177  cv(cv_mixt_ener,ijkc) = recveccell%buff(ibuff+4*ndim)
178  ENDIF
179 
180  IF (gasmodel == gas_model_tcperf) THEN
181  CALL mixtureproperties( regions(ireg),ijkc,ijkc,.false. )
182  ELSE
183  CALL mixtureproperties( regions(ireg),ijkc,ijkc,.true. )
184  ENDIF
185  ENDIF
186  ENDDO
187  ENDDO
188  ENDDO
189 
190  ENDIF ! interact
191  ENDDO ! icorner
192 
193  ENDIF ! some cells to receive
194  ENDIF ! not my processor
195  ENDDO ! ir
196 
197 ! finalize
198 
199  CALL deregisterfunction( global )
200 
201 END SUBROUTINE rflo_receivecorneredgecells
202 
203 !******************************************************************************
204 !
205 ! RCS Revision history:
206 !
207 ! $Log: RFLO_ReceiveCornerEdgeCells.F90,v $
208 ! Revision 1.4 2008/12/06 08:44:27 mtcampbe
209 ! Updated license.
210 !
211 ! Revision 1.3 2008/11/19 22:17:38 mtcampbe
212 ! Added Illinois Open Source License/Copyright
213 !
214 ! Revision 1.2 2005/10/31 21:09:36 haselbac
215 ! Changed specModel and SPEC_MODEL_NONE
216 !
217 ! Revision 1.1 2004/11/29 20:51:40 wasistho
218 ! lower to upper case
219 !
220 ! Revision 1.13 2004/09/02 01:35:10 wasistho
221 ! replaced 0 with DEGENERAT_NONE
222 !
223 ! Revision 1.12 2004/09/02 01:23:13 wasistho
224 ! do not exchange and send/recv for degenerated e/c
225 !
226 ! Revision 1.11 2003/11/20 16:40:40 mdbrandy
227 ! Backing out RocfluidMP changes from 11-17-03
228 !
229 ! Revision 1.7 2003/05/15 02:57:04 jblazek
230 ! Inlined index function.
231 !
232 ! Revision 1.6 2003/02/28 21:04:27 jblazek
233 ! Corrected bug in send/recv of CE cells on single processor.
234 !
235 ! Revision 1.5 2003/02/14 22:32:37 jblazek
236 ! Finished implementation of corener and edge cells.
237 !
238 ! Revision 1.4 2002/09/05 17:40:22 jblazek
239 ! Variable global moved into regions().
240 !
241 ! Revision 1.3 2002/03/18 23:11:33 jblazek
242 ! Finished multiblock and MPI.
243 !
244 ! Revision 1.2 2002/02/21 23:25:06 jblazek
245 ! Blocks renamed as regions.
246 !
247 ! Revision 1.1 2002/01/31 20:20:13 jblazek
248 ! Added treatment of edge & corner cells.
249 !
250 !******************************************************************************
251 
252 
253 
254 
255 
256 
257 
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
subroutine rflo_receivecorneredgecells(regions, iReg)
**********************************************************************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
subroutine mixtureproperties(region, inBeg, inEnd, gasUpdate)
**********************************************************************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