Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PEUL_ExchangeDummyConf.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: exchange values between interior and dummy cells of the
26 ! corresponding patches of the adjacent regions (both regions
27 ! are on the same processor) specific to PEUL Module.
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: regions%levels%peul%cv = eulerian particle variables in dummy cells.
37 !
38 ! Notes: intended for conforming grid boundaries only.
39 !
40 !******************************************************************************
41 !
42 ! $Id: PEUL_ExchangeDummyConf.F90,v 1.3 2008/12/06 08:44:39 mtcampbe Exp $
43 !
44 ! Copyright: (c) 2003 by the University of Illinois
45 !
46 !******************************************************************************
47 
48 SUBROUTINE peul_exchangedummyconf( 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
54  USE modindexing, ONLY : indijkmap
57  USE modparteul, ONLY : t_peul
58  USE moderror
59  USE modparameters
61  IMPLICIT NONE
62 
63 #include "Indexing.h"
64 
65 ! ... parameters
66  TYPE(t_region), INTENT(INOUT) :: region
67  TYPE(t_region), INTENT(IN) :: regionsrc
68  TYPE(t_patch), INTENT(INOUT) :: patch
69  TYPE(t_patch), INTENT(IN ) :: patchsrc
70 
71 ! ... loop variables
72  INTEGER :: icv, idum, i, j, k, ii, jj, kk
73 
74 ! ... local variables
75  CHARACTER(CHRLEN) :: rcsidentstring
76 
77  INTEGER :: ibeg, iend, jbeg, jend, kbeg, kend, idir, jdir, kdir, &
78  icoff, ijcoff, ijkd, ilev
79  INTEGER :: ibegsrc, iendsrc, jbegsrc, jendsrc, kbegsrc, kendsrc, &
80  idirsrc, jdirsrc, kdirsrc, icoffsrc, ijcoffsrc, ijkcsrc
81  INTEGER :: lb, lbs, l1srcdir, l2srcdir, mapmat(3,4)
82  INTEGER :: ncv
83 
84  LOGICAL :: align
85 
86  REAL(RFREAL), POINTER, DIMENSION(:,:) :: pcv, pcvsrc
87 
88  TYPE(t_global), POINTER :: global
89 
90 !******************************************************************************
91 
92  rcsidentstring = '$RCSfile: PEUL_ExchangeDummyConf.F90,v $ $Revision: 1.3 $'
93 
94  global => region%global
95 
96  CALL registerfunction( global,'PEUL_ExchangeDummyConf',&
97  'PEUL_ExchangeDummyConf.F90' )
98 
99 ! check if the source region is active ----------------------------------------
100 
101  IF (regionsrc%active == off) THEN
102  CALL errorstop( region%global,err_srcregion_off,__line__ )
103  ENDIF
104 
105 ! get dimensions and pointers -------------------------------------------------
106 
107  ilev = region%currLevel
108 
109  CALL rflo_getpatchindices( region,patch,ilev,ibeg,iend, &
110  jbeg,jend,kbeg,kend )
111  CALL rflo_getpatchindices( regionsrc,patchsrc,ilev,ibegsrc,iendsrc, &
112  jbegsrc,jendsrc,kbegsrc,kendsrc )
114  CALL rflo_getpatchdirection( patchsrc,idirsrc,jdirsrc,kdirsrc )
115  CALL rflo_getcelloffset( region ,ilev,icoff ,ijcoff )
116  CALL rflo_getcelloffset( regionsrc,ilev,icoffsrc,ijcoffsrc )
117 
118  ncv = region%levels(ilev)%peul%nCv
119 
120  pcv => region%levels(ilev)%peul%cv
121  pcvsrc => regionsrc%levels(ilev)%peul%cv
122 
123 ! the implementation assumes that each cv is a smoke density, so check that
124 ! nCv is indeed the number of smoke particle types
125 
126  IF (ncv /= region%peulInput%nPtypes) &
127  CALL errorstop( region%global,err_peul_npmismatch,__line__ )
128 
129 ! mapping between patches -----------------------------------------------------
130 
131  l1srcdir = 1
132  IF (patch%srcL1beg > patch%srcL1end) l1srcdir = -1
133  l2srcdir = 1
134  IF (patch%srcL2beg > patch%srcL2end) l2srcdir = -1
135 
136  lb = patch%lbound
137  lbs = patch%srcLbound
138  align = patch%align
139 
140  CALL rflo_getpatchmapping( lb,lbs,l1srcdir,l2srcdir,align, &
141  idir,jdir,kdir,idirsrc,jdirsrc,kdirsrc, &
142  ibeg,iend,jbeg,jend,kbeg,kend, &
143  ibegsrc,iendsrc,jbegsrc,jendsrc,kbegsrc,kendsrc, &
144  mapmat )
145 
146 ! loop over dummy nodes of current patch --------------------------------------
147 
148  DO icv=1,ncv
149  DO idum=1,region%nDumCells
150  DO k=kbeg,kend
151  DO j=jbeg,jend
152  DO i=ibeg,iend
153  ii = i - idum*idir
154  jj = j - idum*jdir
155  kk = k - idum*kdir
156  ijkd = indijk(ii,jj,kk,icoff,ijcoff)
157  ijkcsrc = indijkmap(ii,jj,kk,mapmat,icoffsrc,ijcoffsrc)
158 
159  pcv(icv,ijkd) = pcvsrc(icv,ijkcsrc)
160  ENDDO ! i
161  ENDDO ! j
162  ENDDO ! k
163  ENDDO ! idum
164  ENDDO ! iCv
165 
166 ! finalize
167 
168  CALL deregisterfunction( global )
169 
170 END SUBROUTINE peul_exchangedummyconf
171 
172 !******************************************************************************
173 !
174 ! RCS Revision history:
175 !
176 ! $Log: PEUL_ExchangeDummyConf.F90,v $
177 ! Revision 1.3 2008/12/06 08:44:39 mtcampbe
178 ! Updated license.
179 !
180 ! Revision 1.2 2008/11/19 22:17:51 mtcampbe
181 ! Added Illinois Open Source License/Copyright
182 !
183 ! Revision 1.1 2004/12/01 21:09:35 haselbac
184 ! Initial revision after changing case
185 !
186 ! Revision 1.3 2004/03/05 22:09:04 jferry
187 ! created global variables for peul, plag, and inrt use
188 !
189 ! Revision 1.2 2003/05/15 02:57:05 jblazek
190 ! Inlined index function.
191 !
192 ! Revision 1.1 2003/04/09 14:33:58 fnajjar
193 ! Initial Import of Multi-region rocsmoke
194 !
195 !******************************************************************************
196 
197 
198 
199 
200 
201 
202 
**********************************************************************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
subroutine rflo_getpatchdirection(patch, idir, jdir, kdir)
j indices k indices k
Definition: Indexing.h:6
INTEGER function indijkmap(i, j, k, mapMat, iOffset, ijOffset)
Definition: ModIndexing.F90:67
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine rflo_getpatchindices(region, patch, iLev, ibeg, iend, jbeg, jend, kbeg, kend)
**********************************************************************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 jdir
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
**********************************************************************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 idir
subroutine rflo_getcelloffset(region, iLev, iCellOffset, ijCellOffset)
subroutine peul_exchangedummyconf(region, regionSrc, patch, patchSrc)
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
**********************************************************************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 kdir
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 rflo_getpatchmapping(lb, lbs, l1SrcDir, l2SrcDir, align, idir, jdir, kdir, idirSrc, jdirSrc, kdirSrc, ibeg, iend, jbeg, jend, kbeg, kend, ibegSrc, iendSrc, jbegSrc, jendSrc, kbegSrc, kendSrc, mapMat)
**********************************************************************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