Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLO_MoveGridInterfaces.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 deformations between the regions as to ensure
26 ! matching grid nodes at the interfaces.
27 !
28 ! Description: none.
29 !
30 ! Input: regions = data of all grid regions, deformations.
31 !
32 ! Output: regions%levels%grid%xyz = deformations at the boundaries.
33 !
34 ! Notes: grid%xyz temporarily stores nodal displacements. The deformation
35 ! is applied to the finest grid first.
36 !
37 !******************************************************************************
38 !
39 ! $Id: RFLO_MoveGridInterfaces.F90,v 1.4 2008/12/06 08:44:27 mtcampbe Exp $
40 !
41 ! Copyright: (c) 2003 by the University of Illinois
42 !
43 !******************************************************************************
44 
45 SUBROUTINE rflo_movegridinterfaces( regions )
46 
47  USE moddatatypes
48  USE modbndpatch, ONLY : t_patch
49  USE modglobal, ONLY : t_global
50  USE moddatastruct, ONLY : t_region
51  USE modgrid, ONLY : t_grid
55  USE moderror
56  USE modparameters
57  IMPLICIT NONE
58 
59 ! ... parameters
60  TYPE(t_region), POINTER :: regions(:)
61 
62 ! ... loop variables
63  INTEGER :: ireg, ipatch, ipass
64 
65 ! ... local variables
66  INTEGER :: bctype, iregsrc, ipatchsrc
67 
68  TYPE(t_grid), POINTER :: grid, gridold, gridsrc
69  TYPE(t_global), POINTER :: global
70  TYPE(t_patch), POINTER :: patch, patchsrc
71 
72 !******************************************************************************
73 
74  global => regions(1)%global
75 
76  CALL registerfunction( global,'RFLO_MoveGridInterfaces',&
77  'RFLO_MoveGridInterfaces.F90' )
78 
79 ! fix interfaces between regions ----------------------------------------------
80 
81  DO ipass=1,2
82 
83 ! - copy / send deformations
84 
85  DO ireg=1,global%nRegions
86  IF (regions(ireg)%procid==global%myProcid .AND. & ! region active and
87  regions(ireg)%active==active .AND. & ! on my processor
88  regions(ireg)%mixtInput%moveGrid) THEN ! and moving
89 
90  grid => regions(ireg)%levels(1)%grid
91  gridold => regions(ireg)%levels(1)%gridOld
92 
93  DO ipatch=1,regions(ireg)%nPatches
94  patch => regions(ireg)%levels(1)%patches(ipatch)
95  bctype = patch%bcType
96  IF ((bctype>=bc_regionconf .AND. bctype<=bc_regionconf+bc_range) .OR. &
97  (bctype>=bc_tra_peri .AND. bctype<=bc_tra_peri +bc_range) .OR. &
98  (bctype>=bc_rot_peri .AND. bctype<=bc_rot_peri +bc_range)) THEN
99  iregsrc = patch%srcRegion
100  ipatchsrc = patch%srcPatch
101  patchsrc => regions(iregsrc)%levels(1)%patches(ipatchsrc)
102  gridsrc => regions(iregsrc)%levels(1)%grid
103 
104  IF (regions(iregsrc)%procid == global%myProcid) THEN
105  CALL rflo_exchangednodecopy( regions(ireg),regions(iregsrc), &
106  patch,patchsrc,.false., &
107  grid%xyz,gridsrc%xyz )
108  CALL rflo_edgedeformation( regions(ireg),grid%boundMoved, &
109  grid%edgeMoved,grid%arcLen12, &
110  grid%arcLen34,grid%arcLen56, &
111  gridold%xyzOld,grid%xyz )
112  CALL rflo_boundarydeformation( regions(ireg),grid%boundMoved, &
113  grid%edgeMoved,grid%arcLen12, &
114  grid%arcLen34,grid%arcLen56, &
115  gridold%xyzOld,grid%xyz )
116  ELSE
117  CALL rflo_exchangednodesend( regions(ireg),regions(iregsrc), &
118  patch,grid%xyz )
119  ENDIF
120  ENDIF ! bcType
121  ENDDO ! iPatch
122 
123  ENDIF ! region on this processor and active, grid moving
124  ENDDO ! iReg
125 
126 ! - receive deformations
127 
128  DO ireg=1,global%nRegions
129  IF (regions(ireg)%procid==global%myProcid .AND. & ! region active and
130  regions(ireg)%active==active .AND. & ! on my processor
131  regions(ireg)%mixtInput%moveGrid) THEN ! and moving
132 
133  grid => regions(ireg)%levels(1)%grid
134  gridold => regions(ireg)%levels(1)%gridOld
135 
136  DO ipatch=1,regions(ireg)%nPatches
137  patch => regions(ireg)%levels(1)%patches(ipatch)
138  bctype = patch%bcType
139  IF ((bctype>=bc_regionconf .AND. bctype<=bc_regionconf+bc_range) .OR. &
140  (bctype>=bc_tra_peri .AND. bctype<=bc_tra_peri +bc_range) .OR. &
141  (bctype>=bc_rot_peri .AND. bctype<=bc_rot_peri +bc_range)) THEN
142  iregsrc = patch%srcRegion
143  ipatchsrc = patch%srcPatch
144  patchsrc => regions(iregsrc)%levels(1)%patches(ipatchsrc)
145  gridsrc => regions(iregsrc)%levels(1)%grid
146 
147  IF (regions(iregsrc)%procid /= global%myProcid) THEN
148  CALL rflo_exchangednoderecv( regions(ireg),regions(iregsrc), &
149  patch,patchsrc,.false.,grid%xyz )
150  CALL rflo_edgedeformation( regions(ireg),grid%boundMoved, &
151  grid%edgeMoved,grid%arcLen12, &
152  grid%arcLen34,grid%arcLen56, &
153  gridold%xyzOld,grid%xyz )
154  CALL rflo_boundarydeformation( regions(ireg),grid%boundMoved, &
155  grid%edgeMoved,grid%arcLen12, &
156  grid%arcLen34,grid%arcLen56, &
157  gridold%xyzOld,grid%xyz )
158  ENDIF
159  ENDIF ! bcType
160  ENDDO ! iPatch
161 
162  ENDIF ! region on this processor and active, grid moving
163  ENDDO ! iReg
164 
165 ! - clear send requests
166 
167  DO ireg=1,global%nRegions
168  IF (regions(ireg)%procid==global%myProcid .AND. & ! region active and
169  regions(ireg)%active==active .AND. & ! on my processor
170  regions(ireg)%mixtInput%moveGrid) THEN ! and moving
171  CALL rflo_clearsendrequests( regions,ireg,.true. )
172  ENDIF
173  ENDDO
174 
175  ENDDO ! iPass
176 
177 ! finalize --------------------------------------------------------------------
178 
179  CALL deregisterfunction( global )
180 
181 END SUBROUTINE rflo_movegridinterfaces
182 
183 !******************************************************************************
184 !
185 ! RCS Revision history:
186 !
187 ! $Log: RFLO_MoveGridInterfaces.F90,v $
188 ! Revision 1.4 2008/12/06 08:44:27 mtcampbe
189 ! Updated license.
190 !
191 ! Revision 1.3 2008/11/19 22:17:38 mtcampbe
192 ! Added Illinois Open Source License/Copyright
193 !
194 ! Revision 1.2 2006/03/05 19:03:04 wasistho
195 ! set computational space coordinates from initial grid
196 !
197 ! Revision 1.1 2004/11/29 20:51:39 wasistho
198 ! lower to upper case
199 !
200 ! Revision 1.5 2003/11/20 16:40:39 mdbrandy
201 ! Backing out RocfluidMP changes from 11-17-03
202 !
203 ! Revision 1.1 2003/08/11 21:51:18 jblazek
204 ! Added basic global grid smoothing scheme.
205 !
206 !******************************************************************************
207 
208 
209 
210 
211 
212 
213 
subroutine rflo_edgedeformation(region, boundMoved, edgeMoved, arcLen12, arcLen34, arcLen56, xyzOld, dNode)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine rflo_exchangednoderecv(region, regionSrc, patch, patchSrc, average, dNode)
subroutine rflo_movegridinterfaces(regions)
Definition: patch.h:74
subroutine rflo_clearsendrequests(regions, iReg, geometry)
subroutine rflo_exchangednodecopy(region, regionSrc, patch, patchSrc, average, dNode, dNodeSrc)
subroutine rflo_boundarydeformation(region, boundMoved, edgeMoved, arcLen12, arcLen34, arcLen56, xyzOld, dNode)
subroutine grid(bp)
Definition: setup_py.f90:257
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine rflo_exchangednodesend(region, regionSrc, patch, dNode)