Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PEUL_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: region%levels%peul%cv = cv variables in dummy cells.
35 !
36 ! Notes: none.
37 !
38 !******************************************************************************
39 !
40 ! $Id: PEUL_ReceiveCornerEdgeCells.F90,v 1.3 2008/12/06 08:44:39 mtcampbe Exp $
41 !
42 ! Copyright: (c) 2004 by the University of Illinois
43 !
44 !******************************************************************************
45 
46 SUBROUTINE peul_receivecorneredgecells( regions,iReg )
47 
48  USE moddatatypes
49  USE moddatastruct, ONLY : t_region, t_level, t_dcelltransf
50  USE modglobal, ONLY : t_global
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  INTEGER, INTENT(IN) :: ireg
64 
65 ! ... loop variables
66  INTEGER :: ir, iedge, icorner, i, j, k, ijk, icv
67 
68 ! ... local variables
69  CHARACTER(CHRLEN) :: rcsidentstring
70 
71 #ifdef MPI
72  INTEGER :: status(mpi_status_size)
73 #endif
74  INTEGER :: ilev, iregsrc, ibuff, ncv, ndim, source, tag
75  INTEGER :: ibeg, iend, jbeg, jend, kbeg, kend, icoff, ijcoff, ijkc
76 
77  REAL(RFREAL), POINTER :: cv(:,:)
78 
79  TYPE(t_global), POINTER :: global
80  TYPE(t_level), POINTER :: level
81  TYPE(t_dcelltransf), POINTER :: rcvpeuleccell
82 
83 !******************************************************************************
84 
85  rcsidentstring = &
86  '$RCSfile: PEUL_ReceiveCornerEdgeCells.F90,v $ $Revision: 1.3 $'
87 
88  global => regions(ireg)%global
89 
90  CALL registerfunction( global,'PEUL_ReceiveCornerEdgeCells',&
91  'PEUL_ReceiveCornerEdgeCells.F90' )
92 
93 ! get dimensions and pointers -------------------------------------------------
94 
95  ilev = regions(ireg)%currLevel
96  level => regions(ireg)%levels(ilev)
97  cv => level%peul%cv
98  ncv = level%peul%nCv
99 
100  CALL rflo_getcelloffset( regions(ireg),ilev,icoff,ijcoff )
101 
102 ! copy data from buffer to dummy cells
103 
104  DO ir=1,global%nRegions
105  IF (regions(ir)%procid /= global%myProcid) THEN
106  IF (level%rcvPeulEcCells(ir)%nCells > 0) THEN
107 
108  rcvpeuleccell => level%rcvPeulEcCells(ir)
109  ndim = rcvpeuleccell%nCells
110  ibuff = 0
111 
112 #ifdef MPI
113  source = regions(ir)%procid
114  tag = regions(ireg)%localNumber + peul_tag_shift
115  CALL mpi_recv( rcvpeuleccell%buff,ncv*ndim,mpi_rfreal, &
116  source,tag,global%mpiComm,status,global%mpierr )
117  IF (global%mpierr /= 0) CALL errorstop( global,err_mpi_trouble,__line__ )
118 #endif
119 
120 ! --- edges
121 
122  DO iedge=1,12
123  IF (level%edgeCells(iedge)%interact) THEN
124  CALL rflo_getedgecellsindices( regions(ireg),ilev,iedge, &
125  ibeg,iend,jbeg,jend,kbeg,kend )
126 
127  ijk = 0
128  DO k=kbeg,kend
129  DO j=jbeg,jend
130  DO i=ibeg,iend
131  ijk = ijk + 1
132  ijkc = indijk(i,j,k,icoff,ijcoff)
133  iregsrc = level%edgeCells(iedge)%cells(ijk)%srcRegion
134  IF (iregsrc == ir) THEN
135  ibuff = ibuff + 1
136  IF (level%edgeCells(iedge)%cells(ijk)%rotate) THEN
137  ! rotational periodicity
138  ELSE
139  DO icv=1,ncv
140  cv(icv,ijkc) = rcvpeuleccell%buff(ibuff+(icv-1)*ndim)
141  ENDDO ! iCv
142  ENDIF
143  ENDIF
144  ENDDO
145  ENDDO
146  ENDDO
147 
148  ENDIF ! interact
149  ENDDO ! iedge
150 
151 ! --- corners
152 
153  DO icorner=1,8
154  IF (level%cornerCells(icorner)%interact) THEN
155  CALL rflo_getcornercellsindices( regions(ireg),ilev,icorner, &
156  ibeg,iend,jbeg,jend,kbeg,kend )
157 
158  ijk = 0
159  DO k=kbeg,kend
160  DO j=jbeg,jend
161  DO i=ibeg,iend
162  ijk = ijk + 1
163  ijkc = indijk(i,j,k,icoff,ijcoff)
164  iregsrc = level%cornerCells(icorner)%cells(ijk)%srcRegion
165  IF (iregsrc == ir) THEN
166  ibuff = ibuff + 1
167  IF (level%cornerCells(icorner)%cells(ijk)%rotate) THEN
168  ! rotational periodicity
169  ELSE
170  DO icv=1,ncv
171  cv(icv,ijkc) = rcvpeuleccell%buff(ibuff+(icv-1)*ndim)
172  ENDDO ! iCv
173  ENDIF
174  ENDIF
175  ENDDO
176  ENDDO
177  ENDDO
178 
179  ENDIF ! interact
180  ENDDO ! icorner
181 
182  ENDIF ! some cells to receive
183  ENDIF ! not my processor
184  ENDDO ! ir
185 
186 ! finalize --------------------------------------------------------------------
187 
188  CALL deregisterfunction( global )
189 
190 END SUBROUTINE peul_receivecorneredgecells
191 
192 !******************************************************************************
193 !
194 ! RCS Revision history:
195 !
196 ! $Log: PEUL_ReceiveCornerEdgeCells.F90,v $
197 ! Revision 1.3 2008/12/06 08:44:39 mtcampbe
198 ! Updated license.
199 !
200 ! Revision 1.2 2008/11/19 22:17:52 mtcampbe
201 ! Added Illinois Open Source License/Copyright
202 !
203 ! Revision 1.1 2004/12/01 21:09:50 haselbac
204 ! Initial revision after changing case
205 !
206 ! Revision 1.1 2004/03/02 21:44:07 jferry
207 ! Added corner and edge cell data structures and routines
208 !
209 !******************************************************************************
210 
211 
212 
213 
214 
215 
216 
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 peul_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
**********************************************************************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