Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLO_GridRemesh.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: conduct linear interpolation to remesh blocks with inverted cells
26 !
27 ! Description: none.
28 !
29 ! Input: region = data of current region
30 !
31 ! Output: region%levels%grid%xyz = new mesh in regions with inverted cells
32 !
33 ! Notes: none
34 !
35 !******************************************************************************
36 !
37 ! $Id: RFLO_GridRemesh.F90,v 1.6 2008/12/06 08:44:07 mtcampbe Exp $
38 !
39 ! Copyright: (c) 2003 by the University of Illinois
40 !
41 !******************************************************************************
42 
43 SUBROUTINE rflo_gridremesh( region )
44 
45  USE moddatatypes
46  USE moddatastruct, ONLY : t_region
50  USE moderror
51  USE modmpi
52  USE modparameters
53  IMPLICIT NONE
54 
55 #include "Indexing.h"
56 
57 ! ... parameters
58  TYPE(t_region) :: region
59 
60 ! ... loop variables
61  INTEGER :: i, j, k, iter
62 
63 ! ... local variables
64  INTEGER :: ilev, inoff, ijnoff, icoff, ijcoff
65  INTEGER :: ipnbeg, ipnend, jpnbeg, jpnend, kpnbeg, kpnend
66  INTEGER :: ib, ie, ir, jb, je, jr, kb, ke, kr
67  INTEGER :: ijk, ijkc, ip1, im1, jp1, jm1, kp1, km1
68  INTEGER :: ia1, is1, ja1, js1, ka1, ks1
69 
70  REAL(RFREAL) :: rxi, ryi, rzi, rxj, ryj, rzj, rxk, ryk, rzk, rd, p
71  REAL(RFREAL) :: rmi, rpi, rmj, rpj, rmk, rpk, volmax
72  REAL(RFREAL) :: qmi, qpi, qmj, qpj, qmk, qpk
73  REAL(RFREAL) :: rati, ratj, ratk, dsi, dsj, dsk, dli, dlj, dlk, wi, wj, wk
74  REAL(RFREAL), POINTER :: xyz(:,:), xyzorig(:,:), xyzold(:,:)
75 
76 !******************************************************************************
77 
78  CALL registerfunction( region%global,'RFLO_GridRemesh',&
79  'RFLO_GridRemesh.F90' )
80 
81 ! write to stdout -------------------------------------------------------------
82 
83  IF (region%global%verbLevel /= verbose_none) THEN
84  WRITE(stdout,1000) solver_name,region%iRegionGlobal
85  ENDIF ! verbLevel
86 
87 ! get dimensions and pointers -------------------------------------------------
88 
89  ilev = 1
90 
92  kpnbeg,kpnend )
93  CALL rflo_getnodeoffset( region,ilev,inoff,ijnoff )
94  CALL rflo_getcelloffset( region,ilev,icoff,ijcoff )
95 
96  xyz => region%levels(ilev)%grid%xyz
97  xyzorig => region%levels(ilev)%gridOld%xyz
98  xyzold => region%levels(ilev)%grid%xyzOld
99  p = region%global%moveGridWeight
100 
101  rd = 1._rfreal/3._rfreal
102  volmax = -1.e+30_rfreal
103 
104 ! determine remeshing direction -----------------------------------------------
105 
106  dsi = 0._rfreal
107  DO i=ipnbeg,ipnend-1
108  ijk = indijk(i ,jpnbeg ,kpnbeg ,inoff,ijnoff)
109  ip1 = indijk(i+1,jpnbeg ,kpnbeg ,inoff,ijnoff)
110 
111  dsi= dsi+ sqrt((xyzorig(xcoord,ip1)- xyzorig(xcoord,ijk))**2 + &
112  (xyzorig(ycoord,ip1)- xyzorig(ycoord,ijk))**2 + &
113  (xyzorig(zcoord,ip1)- xyzorig(zcoord,ijk))**2 )
114 
115  ijk = indijk(i ,jpnbeg ,kpnend ,inoff,ijnoff)
116  ip1 = indijk(i+1,jpnbeg ,kpnend ,inoff,ijnoff)
117 
118  dsi= dsi+ sqrt((xyzorig(xcoord,ip1)- xyzorig(xcoord,ijk))**2 + &
119  (xyzorig(ycoord,ip1)- xyzorig(ycoord,ijk))**2 + &
120  (xyzorig(zcoord,ip1)- xyzorig(zcoord,ijk))**2 )
121 
122  ijk = indijk(i ,jpnend ,kpnend ,inoff,ijnoff)
123  ip1 = indijk(i+1,jpnend ,kpnend ,inoff,ijnoff)
124 
125  dsi= dsi+ sqrt((xyzorig(xcoord,ip1)- xyzorig(xcoord,ijk))**2 + &
126  (xyzorig(ycoord,ip1)- xyzorig(ycoord,ijk))**2 + &
127  (xyzorig(zcoord,ip1)- xyzorig(zcoord,ijk))**2 )
128 
129  ijk = indijk(i ,jpnend ,kpnbeg ,inoff,ijnoff)
130  ip1 = indijk(i+1,jpnend ,kpnbeg ,inoff,ijnoff)
131 
132  dsi= dsi+ sqrt((xyzorig(xcoord,ip1)- xyzorig(xcoord,ijk))**2 + &
133  (xyzorig(ycoord,ip1)- xyzorig(ycoord,ijk))**2 + &
134  (xyzorig(zcoord,ip1)- xyzorig(zcoord,ijk))**2 )
135  ENDDO
136 
137  dli = 0._rfreal
138 
139  ijk = indijk(ipnbeg ,jpnbeg ,kpnbeg ,inoff,ijnoff)
140  ip1 = indijk(ipnend ,jpnbeg ,kpnbeg ,inoff,ijnoff)
141  dli= dli+ sqrt((xyzorig(xcoord,ip1)- xyzorig(xcoord,ijk))**2 + &
142  (xyzorig(ycoord,ip1)- xyzorig(ycoord,ijk))**2 + &
143  (xyzorig(zcoord,ip1)- xyzorig(zcoord,ijk))**2 )
144 
145  ijk = indijk(ipnbeg ,jpnbeg ,kpnend ,inoff,ijnoff)
146  ip1 = indijk(ipnend ,jpnbeg ,kpnend ,inoff,ijnoff)
147  dli= dli+ sqrt((xyzorig(xcoord,ip1)- xyzorig(xcoord,ijk))**2 + &
148  (xyzorig(ycoord,ip1)- xyzorig(ycoord,ijk))**2 + &
149  (xyzorig(zcoord,ip1)- xyzorig(zcoord,ijk))**2 )
150 
151  ijk = indijk(ipnbeg ,jpnend ,kpnend ,inoff,ijnoff)
152  ip1 = indijk(ipnend ,jpnend ,kpnend ,inoff,ijnoff)
153  dli= dli+ sqrt((xyzorig(xcoord,ip1)- xyzorig(xcoord,ijk))**2 + &
154  (xyzorig(ycoord,ip1)- xyzorig(ycoord,ijk))**2 + &
155  (xyzorig(zcoord,ip1)- xyzorig(zcoord,ijk))**2 )
156 
157  ijk = indijk(ipnbeg ,jpnend ,kpnbeg ,inoff,ijnoff)
158  ip1 = indijk(ipnend ,jpnend ,kpnbeg ,inoff,ijnoff)
159  dli= dli+ sqrt((xyzorig(xcoord,ip1)- xyzorig(xcoord,ijk))**2 + &
160  (xyzorig(ycoord,ip1)- xyzorig(ycoord,ijk))**2 + &
161  (xyzorig(zcoord,ip1)- xyzorig(zcoord,ijk))**2 )
162 
163 ! --------------------
164 
165  dsj = 0._rfreal
166  DO j=jpnbeg,jpnend-1
167  ijk = indijk(ipnbeg ,j ,kpnbeg ,inoff,ijnoff)
168  ip1 = indijk(ipnbeg ,j+1 ,kpnbeg ,inoff,ijnoff)
169 
170  dsj= dsj+ sqrt((xyzorig(xcoord,ip1)- xyzorig(xcoord,ijk))**2 + &
171  (xyzorig(ycoord,ip1)- xyzorig(ycoord,ijk))**2 + &
172  (xyzorig(zcoord,ip1)- xyzorig(zcoord,ijk))**2 )
173 
174  ijk = indijk(ipnbeg ,j ,kpnend ,inoff,ijnoff)
175  ip1 = indijk(ipnbeg ,j+1 ,kpnend ,inoff,ijnoff)
176 
177  dsj= dsj+ sqrt((xyzorig(xcoord,ip1)- xyzorig(xcoord,ijk))**2 + &
178  (xyzorig(ycoord,ip1)- xyzorig(ycoord,ijk))**2 + &
179  (xyzorig(zcoord,ip1)- xyzorig(zcoord,ijk))**2 )
180 
181  ijk = indijk(ipnend ,j ,kpnend ,inoff,ijnoff)
182  ip1 = indijk(ipnend ,j+1 ,kpnend ,inoff,ijnoff)
183 
184  dsj= dsj+ sqrt((xyzorig(xcoord,ip1)- xyzorig(xcoord,ijk))**2 + &
185  (xyzorig(ycoord,ip1)- xyzorig(ycoord,ijk))**2 + &
186  (xyzorig(zcoord,ip1)- xyzorig(zcoord,ijk))**2 )
187 
188  ijk = indijk(ipnend ,j ,kpnbeg ,inoff,ijnoff)
189  ip1 = indijk(ipnend ,j+1 ,kpnbeg ,inoff,ijnoff)
190 
191  dsj= dsj+ sqrt((xyzorig(xcoord,ip1)- xyzorig(xcoord,ijk))**2 + &
192  (xyzorig(ycoord,ip1)- xyzorig(ycoord,ijk))**2 + &
193  (xyzorig(zcoord,ip1)- xyzorig(zcoord,ijk))**2 )
194  ENDDO
195 
196  dlj = 0._rfreal
197 
198  ijk = indijk(ipnbeg ,jpnbeg ,kpnbeg ,inoff,ijnoff)
199  ip1 = indijk(ipnbeg ,jpnend ,kpnbeg ,inoff,ijnoff)
200  dlj= dlj+ sqrt((xyzorig(xcoord,ip1)- xyzorig(xcoord,ijk))**2 + &
201  (xyzorig(ycoord,ip1)- xyzorig(ycoord,ijk))**2 + &
202  (xyzorig(zcoord,ip1)- xyzorig(zcoord,ijk))**2 )
203 
204  ijk = indijk(ipnbeg ,jpnbeg ,kpnend ,inoff,ijnoff)
205  ip1 = indijk(ipnbeg ,jpnend ,kpnend ,inoff,ijnoff)
206  dlj= dlj+ sqrt((xyzorig(xcoord,ip1)- xyzorig(xcoord,ijk))**2 + &
207  (xyzorig(ycoord,ip1)- xyzorig(ycoord,ijk))**2 + &
208  (xyzorig(zcoord,ip1)- xyzorig(zcoord,ijk))**2 )
209 
210  ijk = indijk(ipnend ,jpnbeg ,kpnend ,inoff,ijnoff)
211  ip1 = indijk(ipnend ,jpnend ,kpnend ,inoff,ijnoff)
212  dlj= dlj+ sqrt((xyzorig(xcoord,ip1)- xyzorig(xcoord,ijk))**2 + &
213  (xyzorig(ycoord,ip1)- xyzorig(ycoord,ijk))**2 + &
214  (xyzorig(zcoord,ip1)- xyzorig(zcoord,ijk))**2 )
215 
216  ijk = indijk(ipnend ,jpnbeg ,kpnbeg ,inoff,ijnoff)
217  ip1 = indijk(ipnend ,jpnend ,kpnbeg ,inoff,ijnoff)
218  dlj= dlj+ sqrt((xyzorig(xcoord,ip1)- xyzorig(xcoord,ijk))**2 + &
219  (xyzorig(ycoord,ip1)- xyzorig(ycoord,ijk))**2 + &
220  (xyzorig(zcoord,ip1)- xyzorig(zcoord,ijk))**2 )
221 
222 ! -----------------
223 
224  dsk = 0._rfreal
225  DO k=kpnbeg,kpnend-1
226  ijk = indijk(ipnbeg ,jpnbeg ,k ,inoff,ijnoff)
227  ip1 = indijk(ipnbeg ,jpnbeg ,k+1 ,inoff,ijnoff)
228 
229  dsk= dsk+ sqrt((xyzorig(xcoord,ip1)- xyzorig(xcoord,ijk))**2 + &
230  (xyzorig(ycoord,ip1)- xyzorig(ycoord,ijk))**2 + &
231  (xyzorig(zcoord,ip1)- xyzorig(zcoord,ijk))**2 )
232 
233  ijk = indijk(ipnend ,jpnbeg ,k ,inoff,ijnoff)
234  ip1 = indijk(ipnend ,jpnbeg ,k+1 ,inoff,ijnoff)
235 
236  dsk= dsk+ sqrt((xyzorig(xcoord,ip1)- xyzorig(xcoord,ijk))**2 + &
237  (xyzorig(ycoord,ip1)- xyzorig(ycoord,ijk))**2 + &
238  (xyzorig(zcoord,ip1)- xyzorig(zcoord,ijk))**2 )
239 
240  ijk = indijk(ipnend ,jpnend ,k ,inoff,ijnoff)
241  ip1 = indijk(ipnend ,jpnend ,k+1 ,inoff,ijnoff)
242 
243  dsk= dsk+ sqrt((xyzorig(xcoord,ip1)- xyzorig(xcoord,ijk))**2 + &
244  (xyzorig(ycoord,ip1)- xyzorig(ycoord,ijk))**2 + &
245  (xyzorig(zcoord,ip1)- xyzorig(zcoord,ijk))**2 )
246 
247  ijk = indijk(ipnbeg ,jpnend ,k ,inoff,ijnoff)
248  ip1 = indijk(ipnbeg ,jpnend ,k+1 ,inoff,ijnoff)
249 
250  dsk= dsk+ sqrt((xyzorig(xcoord,ip1)- xyzorig(xcoord,ijk))**2 + &
251  (xyzorig(ycoord,ip1)- xyzorig(ycoord,ijk))**2 + &
252  (xyzorig(zcoord,ip1)- xyzorig(zcoord,ijk))**2 )
253  ENDDO
254 
255  dlk = 0._rfreal
256 
257  ijk = indijk(ipnbeg ,jpnbeg ,kpnbeg ,inoff,ijnoff)
258  ip1 = indijk(ipnbeg ,jpnbeg ,kpnend ,inoff,ijnoff)
259  dlk= dlk+ sqrt((xyzorig(xcoord,ip1)- xyzorig(xcoord,ijk))**2 + &
260  (xyzorig(ycoord,ip1)- xyzorig(ycoord,ijk))**2 + &
261  (xyzorig(zcoord,ip1)- xyzorig(zcoord,ijk))**2 )
262 
263  ijk = indijk(ipnend ,jpnbeg ,kpnbeg ,inoff,ijnoff)
264  ip1 = indijk(ipnend ,jpnbeg ,kpnend ,inoff,ijnoff)
265  dlk= dlk+ sqrt((xyzorig(xcoord,ip1)- xyzorig(xcoord,ijk))**2 + &
266  (xyzorig(ycoord,ip1)- xyzorig(ycoord,ijk))**2 + &
267  (xyzorig(zcoord,ip1)- xyzorig(zcoord,ijk))**2 )
268 
269  ijk = indijk(ipnend ,jpnend ,kpnbeg ,inoff,ijnoff)
270  ip1 = indijk(ipnend ,jpnend ,kpnend ,inoff,ijnoff)
271  dlk= dlk+ sqrt((xyzorig(xcoord,ip1)- xyzorig(xcoord,ijk))**2 + &
272  (xyzorig(ycoord,ip1)- xyzorig(ycoord,ijk))**2 + &
273  (xyzorig(zcoord,ip1)- xyzorig(zcoord,ijk))**2 )
274 
275  ijk = indijk(ipnend ,jpnend ,kpnbeg ,inoff,ijnoff)
276  ip1 = indijk(ipnend ,jpnend ,kpnend ,inoff,ijnoff)
277  dlk= dlk+ sqrt((xyzorig(xcoord,ip1)- xyzorig(xcoord,ijk))**2 + &
278  (xyzorig(ycoord,ip1)- xyzorig(ycoord,ijk))**2 + &
279  (xyzorig(zcoord,ip1)- xyzorig(zcoord,ijk))**2 )
280 
281 ! linear interolate for new mesh ---------------------------------------------
282 
283  rati = dli/dsi
284  ratj = dlj/dsj
285  ratk = dlk/dsk
286  IF (rati > ratj .AND. rati > ratk .AND. ratj > ratk) THEN
287  wi = 1._rfreal
288  wj = 0._rfreal
289  wk = 0._rfreal
290  ELSEIF (rati > ratj .AND. rati > ratk .AND. ratj < ratk) THEN
291  wi = 1._rfreal
292  wj = 0._rfreal
293  wk = 0._rfreal
294  ELSEIF (ratj > rati .AND. ratj > ratk .AND. rati > ratk) THEN
295  wi = 0._rfreal
296  wj = 1._rfreal
297  wk = 0._rfreal
298  ELSEIF (ratj > rati .AND. ratj > ratk .AND. rati < ratk) THEN
299  wi = 0._rfreal
300  wj = 1._rfreal
301  wk = 0._rfreal
302  ELSEIF (ratk > rati .AND. ratk > ratj .AND. rati > ratj) THEN
303  wi = 0._rfreal
304  wj = 0._rfreal
305  wk = 1._rfreal
306  ELSEIF (ratk > rati .AND. ratk > ratj .AND. rati < ratj) THEN
307  wi = 0._rfreal
308  wj = 0._rfreal
309  wk = 1._rfreal
310  ENDIF
311 
312  DO k=kpnbeg+1,kpnend-1
313  DO j=jpnbeg+1,jpnend-1
314  DO i=ipnbeg+1,ipnend-1
315  ijk = indijk(i ,j ,k ,inoff,ijnoff)
316  ip1 = indijk(ipnend,j ,k ,inoff,ijnoff)
317  im1 = indijk(ipnbeg,j ,k ,inoff,ijnoff)
318  jp1 = indijk(i ,jpnend,k ,inoff,ijnoff)
319  jm1 = indijk(i ,jpnbeg,k ,inoff,ijnoff)
320  kp1 = indijk(i ,j ,kpnend,inoff,ijnoff)
321  km1 = indijk(i ,j ,kpnbeg,inoff,ijnoff)
322 
323  ia1 = indijk(i+1 ,j ,k ,inoff,ijnoff)
324  is1 = indijk(i-1 ,j ,k ,inoff,ijnoff)
325  ja1 = indijk(i ,j+1 ,k ,inoff,ijnoff)
326  js1 = indijk(i ,j-1 ,k ,inoff,ijnoff)
327  ka1 = indijk(i ,j ,k+1 ,inoff,ijnoff)
328  ks1 = indijk(i ,j ,k-1 ,inoff,ijnoff)
329 
330  qpi= (xyzorig(xcoord,ia1)- xyzorig(xcoord,ijk))**2 + &
331  (xyzorig(ycoord,ia1)- xyzorig(ycoord,ijk))**2 + &
332  (xyzorig(zcoord,ia1)- xyzorig(zcoord,ijk))**2
333  qmi= (xyzorig(xcoord,is1)- xyzorig(xcoord,ijk))**2 + &
334  (xyzorig(ycoord,is1)- xyzorig(ycoord,ijk))**2 + &
335  (xyzorig(zcoord,is1)- xyzorig(zcoord,ijk))**2
336 
337  qpj= (xyzorig(xcoord,ja1)- xyzorig(xcoord,ijk))**2 + &
338  (xyzorig(ycoord,ja1)- xyzorig(ycoord,ijk))**2 + &
339  (xyzorig(zcoord,ja1)- xyzorig(zcoord,ijk))**2
340  qmj= (xyzorig(xcoord,js1)- xyzorig(xcoord,ijk))**2 + &
341  (xyzorig(ycoord,js1)- xyzorig(ycoord,ijk))**2 + &
342  (xyzorig(zcoord,js1)- xyzorig(zcoord,ijk))**2
343 
344  qpk= (xyzorig(xcoord,ka1)- xyzorig(xcoord,ijk))**2 + &
345  (xyzorig(ycoord,ka1)- xyzorig(ycoord,ijk))**2 + &
346  (xyzorig(zcoord,ka1)- xyzorig(zcoord,ijk))**2
347  qmk= (xyzorig(xcoord,ks1)- xyzorig(xcoord,ijk))**2 + &
348  (xyzorig(ycoord,ks1)- xyzorig(ycoord,ijk))**2 + &
349  (xyzorig(zcoord,ks1)- xyzorig(zcoord,ijk))**2
350 
351  qpi = sqrt( qpi )
352  qmi = sqrt( qmi )
353  qpj = sqrt( qpj )
354  qmj = sqrt( qmj )
355  qpk = sqrt( qpk )
356  qmk = sqrt( qmk )
357 
358  rpi = REAL(ipnend-i)
359  rmi = REAL(i-ipnbeg)
360  rpj = REAL(jpnend-j)
361  rmj = REAL(j-jpnbeg)
362  rpk = REAL(kpnend-k)
363  rmk = REAL(k-kpnbeg)
364 
365  rxi = (rpi*xyzorig(xcoord,im1) + rmi*xyzorig(xcoord,ip1))/(rpi+rmi)+&
366  (qpj*xyzorig(xcoord,js1) + qmj*xyzorig(xcoord,ja1))/(qpj+qmj)+&
367  (qpk*xyzorig(xcoord,ks1) + qmk*xyzorig(xcoord,ka1))/(qpk+qmk)
368  ryi = (rpi*xyzorig(ycoord,im1) + rmi*xyzorig(ycoord,ip1))/(rpi+rmi)+&
369  (qpj*xyzorig(ycoord,js1) + qmj*xyzorig(ycoord,ja1))/(qpj+qmj)+&
370  (qpk*xyzorig(ycoord,ks1) + qmk*xyzorig(ycoord,ka1))/(qpk+qmk)
371  rzi = (rpi*xyzorig(zcoord,im1) + rmi*xyzorig(zcoord,ip1))/(rpi+rmi)+&
372  (qpj*xyzorig(zcoord,js1) + qmj*xyzorig(zcoord,ja1))/(qpj+qmj)+&
373  (qpk*xyzorig(zcoord,ks1) + qmk*xyzorig(zcoord,ka1))/(qpk+qmk)
374 
375  rxj = (rpj*xyzorig(xcoord,jm1) + rmj*xyzorig(xcoord,jp1))/(rpj+rmj)+&
376  (qpi*xyzorig(xcoord,is1) + qmi*xyzorig(xcoord,ia1))/(qpi+qmi)+&
377  (qpk*xyzorig(xcoord,ks1) + qmk*xyzorig(xcoord,ka1))/(qpk+qmk)
378  ryj = (rpj*xyzorig(ycoord,jm1) + rmj*xyzorig(ycoord,jp1))/(rpj+rmj)+&
379  (qpi*xyzorig(ycoord,is1) + qmi*xyzorig(ycoord,ia1))/(qpi+qmi)+&
380  (qpk*xyzorig(ycoord,ks1) + qmk*xyzorig(ycoord,ka1))/(qpk+qmk)
381  rzj = (rpj*xyzorig(zcoord,jm1) + rmj*xyzorig(zcoord,jp1))/(rpj+rmj)+&
382  (qpi*xyzorig(zcoord,is1) + qmi*xyzorig(zcoord,ia1))/(qpi+qmi)+&
383  (qpk*xyzorig(zcoord,ks1) + qmk*xyzorig(zcoord,ka1))/(qpk+qmk)
384 
385  rxk = (rpk*xyzorig(xcoord,km1) + rmk*xyzorig(xcoord,kp1))/(rpk+rmk)+&
386  (qpi*xyzorig(xcoord,is1) + qmi*xyzorig(xcoord,ia1))/(qpi+qmi)+&
387  (qpj*xyzorig(xcoord,js1) + qmj*xyzorig(xcoord,ja1))/(qpj+qmj)
388  ryk = (rpk*xyzorig(ycoord,km1) + rmk*xyzorig(ycoord,kp1))/(rpk+rmk)+&
389  (qpi*xyzorig(ycoord,is1) + qmi*xyzorig(ycoord,ia1))/(qpi+qmi)+&
390  (qpj*xyzorig(ycoord,js1) + qmj*xyzorig(ycoord,ja1))/(qpj+qmj)
391  rzk = (rpk*xyzorig(zcoord,km1) + rmk*xyzorig(zcoord,kp1))/(rpk+rmk)+&
392  (qpi*xyzorig(zcoord,is1) + qmi*xyzorig(zcoord,ia1))/(qpi+qmi)+&
393  (qpj*xyzorig(zcoord,js1) + qmj*xyzorig(zcoord,ja1))/(qpj+qmj)
394 
395  xyz(xcoord,ijk) = rd*(wi*rxi+wj*rxj+wk*rxk)/(wi+wj+wk)
396  xyz(ycoord,ijk) = rd*(wi*ryi+wj*ryj+wk*ryk)/(wi+wj+wk)
397  xyz(zcoord,ijk) = rd*(wi*rzi+wj*rzj+wk*rzk)/(wi+wj+wk)
398 
399  ENDDO ! i
400  ENDDO ! j
401  ENDDO ! k
402 
403 ! update coarse grids and dummy cells
404 
405  CALL rflo_generatecoarsegrids( region ) ! coarsen finest grid
406  CALL rflo_copygeometrydummy( region ) ! copy to dummy nodes
407  CALL rflo_extrapolategeometry( region ) ! extrapolate
408 
409 ! finalize --------------------------------------------------------------------
410 
411  CALL deregisterfunction( region%global )
412 
413 1000 FORMAT(a,1x,'Remesh region: ',i6)
414 
415 END SUBROUTINE rflo_gridremesh
416 
417 !******************************************************************************
418 !
419 ! RCS Revision history:
420 !
421 ! $Log: RFLO_GridRemesh.F90,v $
422 ! Revision 1.6 2008/12/06 08:44:07 mtcampbe
423 ! Updated license.
424 !
425 ! Revision 1.5 2008/11/19 22:17:20 mtcampbe
426 ! Added Illinois Open Source License/Copyright
427 !
428 ! Revision 1.4 2005/06/01 07:12:20 wasistho
429 ! added 4 adjacent neighbours in averaging process
430 !
431 ! Revision 1.3 2005/05/28 05:42:50 wasistho
432 ! cosmetics
433 !
434 ! Revision 1.2 2005/05/27 08:39:36 wasistho
435 ! write to stdout when remeshing
436 !
437 ! Revision 1.1 2005/05/27 01:53:41 wasistho
438 ! added rflo_gridremesh
439 !
440 !
441 !******************************************************************************
442 
443 
444 
445 
446 
447 
448 
subroutine rflo_copygeometrydummy(region)
**********************************************************************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 jpnbeg
j indices k indices k
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 kpnbeg
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine rflo_extrapolategeometry(region)
double sqrt(double d)
Definition: double.h:73
**********************************************************************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 jpnend
subroutine rflo_getnodeoffset(region, iLev, iNodeOffset, ijNodeOffset)
subroutine rflo_generatecoarsegrids(region)
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 ipnbeg
subroutine rflo_getcelloffset(region, iLev, iCellOffset, ijCellOffset)
void int int REAL * x
Definition: read.cpp:74
subroutine rflo_gridremesh(region)
subroutine rflo_getdimensphysnodes(region, iLev, ipnbeg, ipnend, jpnbeg, jpnend, kpnbeg, kpnend)
j indices j
Definition: Indexing.h:6
subroutine deregisterfunction(global)
Definition: ModError.F90:469
**********************************************************************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 ipnend
RT a() const
Definition: Line_2.h:140