Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PEUL_SendCornerEdgeCells.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: send smoke values to edge and corner cells of an adjacent region.
26 !
27 ! Description: this is for the case if the other region is located
28 ! on a different processor.
29 !
30 ! Input: regions = data of all regions
31 ! iReg = current region.
32 !
33 ! Output: region%levels%peul%cv = cv variables in dummy cells.
34 !
35 ! Notes: none.
36 !
37 !******************************************************************************
38 !
39 ! $Id: PEUL_SendCornerEdgeCells.F90,v 1.3 2008/12/06 08:44:39 mtcampbe Exp $
40 !
41 ! Copyright: (c) 2004 by the University of Illinois
42 !
43 !******************************************************************************
44 
45 SUBROUTINE peul_sendcorneredgecells( regions,iReg )
46 
47  USE moddatatypes
48  USE modglobal, ONLY : t_global
49  USE moddatastruct, ONLY : t_region, t_level, t_dcelltransf
50  USE moderror
51  USE modmpi
52  USE modparameters
54  IMPLICIT NONE
55 
56 ! ... parameters
57  TYPE(t_region), POINTER :: regions(:)
58  INTEGER, INTENT(IN) :: ireg
59 
60 ! ... loop variables
61  INTEGER :: ir, iedge, icorner, ijk, icv
62 
63 ! ... local variables
64  CHARACTER(CHRLEN) :: rcsidentstring
65 
66  INTEGER :: ilev, iregsrc, icell, ibuff, ncv, ndim, dest, tag
67 
68  REAL(RFREAL), POINTER :: cv(:,:)
69 
70  TYPE(t_global), POINTER :: global
71  TYPE(t_level), POINTER :: level
72  TYPE(t_dcelltransf), POINTER :: sndpeuleccell
73 
74 !******************************************************************************
75 
76  rcsidentstring = &
77  '$RCSfile: PEUL_SendCornerEdgeCells.F90,v $ $Revision: 1.3 $'
78 
79  global => regions(ireg)%global
80 
81  CALL registerfunction( global,'PEUL_SendCornerEdgeCells',&
82  'PEUL_SendCornerEdgeCells.F90' )
83 
84 ! get dimensions and pointers -------------------------------------------------
85 
86  ilev = regions(ireg)%currLevel
87  cv => regions(ireg)%levels(ilev)%peul%cv
88  ncv = regions(ireg)%levels(ilev)%peul%nCv
89 
90 ! fill send buffers
91 
92  DO ir=1,global%nRegions
93  IF (regions(ir)%procid /= global%myProcid) THEN
94  IF (regions(ireg)%levels(ilev)%sndPeulEcCells(ir)%nCells > 0) THEN
95 
96  sndpeuleccell => regions(ireg)%levels(ilev)%sndPeulEcCells(ir)
97  level => regions(ir)%levels(ilev)
98  ndim = sndpeuleccell%nCells
99  ibuff = 0
100 
101  DO iedge=1,12
102  IF (level%edgeCells(iedge)%interact) THEN
103  DO ijk=1,ubound(level%edgeCells(iedge)%cells,1)
104  iregsrc = level%edgeCells(iedge)%cells(ijk)%srcRegion
105  icell = level%edgeCells(iedge)%cells(ijk)%srcCell
106  IF (iregsrc == ireg) THEN
107  ibuff = ibuff + 1
108  DO icv=1,ncv
109  sndpeuleccell%buff(ibuff+(icv-1)*ndim) = cv(icv,icell)
110  ENDDO
111  ENDIF
112  ENDDO
113  ENDIF
114  ENDDO
115  DO icorner=1,8
116  IF (level%cornerCells(icorner)%interact) THEN
117  DO ijk=1,ubound(level%cornerCells(icorner)%cells,1)
118  iregsrc = level%cornerCells(icorner)%cells(ijk)%srcRegion
119  icell = level%cornerCells(icorner)%cells(ijk)%srcCell
120  IF (iregsrc == ireg) THEN
121  ibuff = ibuff + 1
122  DO icv=1,ncv
123  sndpeuleccell%buff(ibuff+(icv-1)*ndim) = cv(icv,icell)
124  ENDDO
125  ENDIF
126  ENDDO
127  ENDIF
128  ENDDO
129 
130 #ifdef MPI
131  dest = regions(ir)%procid
132  tag = regions(ir)%localNumber + peul_tag_shift
133  CALL mpi_isend( sndpeuleccell%buff,ncv*ndim,mpi_rfreal, &
134  dest,tag,global%mpiComm, &
135  global%requests(sndpeuleccell%iRequest),global%mpierr )
136  IF (global%mpierr /= 0) CALL errorstop( global,err_mpi_trouble,__line__ )
137 #endif
138 
139  ENDIF ! some cells to send
140  ENDIF ! not my processor
141  ENDDO ! ir
142 
143 ! finalize --------------------------------------------------------------------
144 
145  CALL deregisterfunction( global )
146 
147 END SUBROUTINE peul_sendcorneredgecells
148 
149 !******************************************************************************
150 !
151 ! RCS Revision history:
152 !
153 ! $Log: PEUL_SendCornerEdgeCells.F90,v $
154 ! Revision 1.3 2008/12/06 08:44:39 mtcampbe
155 ! Updated license.
156 !
157 ! Revision 1.2 2008/11/19 22:17:52 mtcampbe
158 ! Added Illinois Open Source License/Copyright
159 !
160 ! Revision 1.1 2004/12/01 21:09:55 haselbac
161 ! Initial revision after changing case
162 !
163 ! Revision 1.1 2004/03/02 21:44:07 jferry
164 ! Added corner and edge cell data structures and routines
165 !
166 !******************************************************************************
167 
168 
169 
170 
171 
172 
173 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
**********************************************************************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
**********************************************************************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 icell
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine peul_sendcorneredgecells(regions, iReg)
subroutine deregisterfunction(global)
Definition: ModError.F90:469