63 TYPE(t_region
) :: region
66 INTEGER :: ilev,
i,
j,
k, l,myerr
69 CHARACTER(CHRLEN) ::
msg
73 INTEGER :: icoff, ijcoff, inoff, ijnoff, ijkcell, ijknode(8),
face(6)
76 REAL(RFREAL) ::
sum(3), edgelen, edgemin2, edgemin3, edge(3,4), dprod(8)
77 REAL(RFREAL) :: ds, dprodm, dpmax, emag, smag1, smag2, skewness, minvol
78 REAL(RFREAL),
POINTER :: xyz(:,:), si(:,:), sj(:,:), sk(:,:), vol(:)
84 global => region%global
88 'RFLO_CheckMetrics.F90' )
92 DO ilev=1,region%nGridLevels
101 xyz => region%levels(ilev)%grid%xyz
102 si => region%levels(ilev)%grid%si
103 sj => region%levels(ilev)%grid%sj
104 sk => region%levels(ilev)%grid%sk
105 vol => region%levels(ilev)%grid%vol
109 edgelen = 1.e+30_rfreal
119 ijknode(1) = indijk(
i ,
j ,
k ,inoff,ijnoff)
120 ijknode(2) = indijk(
i+1,
j ,
k ,inoff,ijnoff)
121 ijknode(3) = indijk(
i ,
j+1,
k ,inoff,ijnoff)
122 ijknode(4) = indijk(
i ,
j ,
k+1,inoff,ijnoff)
123 ds =
sqrt((xyz(xcoord,ijknode(2))-xyz(xcoord,ijknode(1)))**2+ &
124 (xyz(ycoord,ijknode(2))-xyz(ycoord,ijknode(1)))**2+ &
125 (xyz(zcoord,ijknode(2))-xyz(zcoord,ijknode(1)))**2)
126 edgelen =
min(edgelen,ds)
127 ds =
sqrt((xyz(xcoord,ijknode(3))-xyz(xcoord,ijknode(1)))**2+ &
128 (xyz(ycoord,ijknode(3))-xyz(ycoord,ijknode(1)))**2+ &
129 (xyz(zcoord,ijknode(3))-xyz(zcoord,ijknode(1)))**2)
130 edgelen =
min(edgelen,ds)
131 ds =
sqrt((xyz(xcoord,ijknode(4))-xyz(xcoord,ijknode(1)))**2+ &
132 (xyz(ycoord,ijknode(4))-xyz(ycoord,ijknode(1)))**2+ &
133 (xyz(zcoord,ijknode(4))-xyz(zcoord,ijknode(1)))**2)
134 edgelen =
min(edgelen,ds)
144 edgemin2 = 0.1_rfreal*edgelen*edgelen
145 edgemin3 = edgelen*edgemin2
152 face(1) = indijk(
i ,
j ,
k ,inoff,ijnoff)
153 face(2) = indijk(
i+1,
j ,
k ,inoff,ijnoff)
154 face(4) = indijk(
i ,
j+1,
k ,inoff,ijnoff)
155 face(6) = indijk(
i ,
j ,
k+1,inoff,ijnoff)
158 sj(1:3,
face(1)) - sj(1:3,
face(4)) + &
161 IF (maxval(abs(
sum)) > edgemin2)
THEN
162 WRITE(
msg,1000) maxval(abs(
sum)),ireg,ilev,
i,
j,
k
176 region%levels(ilev)%grid%remesh = 0
183 ijknode(1) = indijk(
i ,
j ,
k ,inoff,ijnoff)
184 ijknode(2) = indijk(
i+1,
j ,
k ,inoff,ijnoff)
185 ijknode(3) = indijk(
i ,
j+1,
k ,inoff,ijnoff)
186 ijknode(4) = indijk(
i ,
j ,
k+1,inoff,ijnoff)
187 ijknode(5) = indijk(
i+1,
j+1,
k+1,inoff,ijnoff)
188 ijknode(6) = indijk(
i+1,
j+1,
k ,inoff,ijnoff)
189 ijknode(7) = indijk(
i+1,
j ,
k+1,inoff,ijnoff)
190 ijknode(8) = indijk(
i ,
j+1,
k+1,inoff,ijnoff)
199 edge(1,1) = xyz(xcoord,ijknode(1))-xyz(xcoord,ijknode(2))
200 edge(2,1) = xyz(ycoord,ijknode(1))-xyz(ycoord,ijknode(2))
201 edge(3,1) = xyz(zcoord,ijknode(1))-xyz(zcoord,ijknode(2))
203 edge(1,2) = xyz(xcoord,ijknode(3))-xyz(xcoord,ijknode(6))
204 edge(2,2) = xyz(ycoord,ijknode(3))-xyz(ycoord,ijknode(6))
205 edge(3,2) = xyz(zcoord,ijknode(3))-xyz(zcoord,ijknode(6))
207 edge(1,3) = xyz(xcoord,ijknode(8))-xyz(xcoord,ijknode(5))
208 edge(2,3) = xyz(ycoord,ijknode(8))-xyz(ycoord,ijknode(5))
209 edge(3,3) = xyz(zcoord,ijknode(8))-xyz(zcoord,ijknode(5))
211 edge(1,4) = xyz(xcoord,ijknode(4))-xyz(xcoord,ijknode(7))
212 edge(2,4) = xyz(ycoord,ijknode(4))-xyz(ycoord,ijknode(7))
213 edge(3,4) = xyz(zcoord,ijknode(4))-xyz(zcoord,ijknode(7))
216 emag =
sqrt( edge(1,l)*edge(1,l) + &
217 edge(2,l)*edge(2,l) + &
218 edge(3,l)*edge(3,l) )
226 dprod(l) = (si(1,
face(1))*edge(1,l) + &
227 si(2,
face(1))*edge(2,l) + &
228 si(3,
face(1))*edge(3,l))/(smag1*emag)
230 dprod(l+4) = (si(1,
face(2))*edge(1,l) + &
231 si(2,
face(2))*edge(2,l) + &
232 si(3,
face(2))*edge(3,l))/(smag2*emag)
235 IF (minval(dprod) < dprodm)
THEN
236 dprodm = minval( dprod )
242 IF (maxval(dprod) > dpmax)
THEN
243 dpmax = maxval( dprod )
248 edge(1,1) = xyz(xcoord,ijknode(1))-xyz(xcoord,ijknode(3))
249 edge(2,1) = xyz(ycoord,ijknode(1))-xyz(ycoord,ijknode(3))
250 edge(3,1) = xyz(zcoord,ijknode(1))-xyz(zcoord,ijknode(3))
252 edge(1,2) = xyz(xcoord,ijknode(4))-xyz(xcoord,ijknode(8))
253 edge(2,2) = xyz(ycoord,ijknode(4))-xyz(ycoord,ijknode(8))
254 edge(3,2) = xyz(zcoord,ijknode(4))-xyz(zcoord,ijknode(8))
256 edge(1,3) = xyz(xcoord,ijknode(7))-xyz(xcoord,ijknode(5))
257 edge(2,3) = xyz(ycoord,ijknode(7))-xyz(ycoord,ijknode(5))
258 edge(3,3) = xyz(zcoord,ijknode(7))-xyz(zcoord,ijknode(5))
260 edge(1,4) = xyz(xcoord,ijknode(2))-xyz(xcoord,ijknode(6))
261 edge(2,4) = xyz(ycoord,ijknode(2))-xyz(ycoord,ijknode(6))
262 edge(3,4) = xyz(zcoord,ijknode(2))-xyz(zcoord,ijknode(6))
265 emag =
sqrt( edge(1,l)*edge(1,l) + &
266 edge(2,l)*edge(2,l) + &
267 edge(3,l)*edge(3,l) )
275 dprod(l) = (sj(1,
face(1))*edge(1,l) + &
276 sj(2,
face(1))*edge(2,l) + &
277 sj(3,
face(1))*edge(3,l))/(smag1*emag)
279 dprod(l+4) = (sj(1,
face(4))*edge(1,l) + &
280 sj(2,
face(4))*edge(2,l) + &
281 sj(3,
face(4))*edge(3,l))/(smag2*emag)
284 IF (minval(dprod) < dprodm)
THEN
285 dprodm = minval( dprod )
291 IF (maxval(dprod) > dpmax)
THEN
292 dpmax = maxval( dprod )
297 edge(1,1) = xyz(xcoord,ijknode(1))-xyz(xcoord,ijknode(4))
298 edge(2,1) = xyz(ycoord,ijknode(1))-xyz(ycoord,ijknode(4))
299 edge(3,1) = xyz(zcoord,ijknode(1))-xyz(zcoord,ijknode(4))
301 edge(1,2) = xyz(xcoord,ijknode(2))-xyz(xcoord,ijknode(7))
302 edge(2,2) = xyz(ycoord,ijknode(2))-xyz(ycoord,ijknode(7))
303 edge(3,2) = xyz(zcoord,ijknode(2))-xyz(zcoord,ijknode(7))
305 edge(1,3) = xyz(xcoord,ijknode(6))-xyz(xcoord,ijknode(5))
306 edge(2,3) = xyz(ycoord,ijknode(6))-xyz(ycoord,ijknode(5))
307 edge(3,3) = xyz(zcoord,ijknode(6))-xyz(zcoord,ijknode(5))
309 edge(1,4) = xyz(xcoord,ijknode(3))-xyz(xcoord,ijknode(8))
310 edge(2,4) = xyz(ycoord,ijknode(3))-xyz(ycoord,ijknode(8))
311 edge(3,4) = xyz(zcoord,ijknode(3))-xyz(zcoord,ijknode(8))
314 emag =
sqrt( edge(1,l)*edge(1,l) + &
315 edge(2,l)*edge(2,l) + &
316 edge(3,l)*edge(3,l) )
324 dprod(l) = (sk(1,
face(1))*edge(1,l) + &
325 sk(2,
face(1))*edge(2,l) + &
326 sk(3,
face(1))*edge(3,l))/(smag1*emag)
328 dprod(l+4) = (sk(1,
face(6))*edge(1,l) + &
329 sk(2,
face(6))*edge(2,l) + &
330 sk(3,
face(6))*edge(3,l))/(smag2*emag)
333 IF (minval(dprod) < dprodm)
THEN
334 dprodm = minval( dprod )
340 IF (maxval(dprod) > dpmax)
THEN
341 dpmax = maxval( dprod )
361 IF (skewness < 0._rfreal)
THEN
365 WRITE(stdout,
'(A)') solver_name//
'Warning: inverted cell, '//
msg
372 minvol = huge( 1._rfreal )
379 ijkcell = indijk(
i,
j,
k,icoff,ijcoff)
380 minvol =
min( minvol,vol(ijkcell) )
383 IF (vol(ijkcell) < 0._rfreal)
THEN
384 WRITE(
msg,1000) vol(ijkcell),ireg,ilev,
i,
j,
k
390 region%levels(ilev)%grid%minVol = minvol
391 global%minVol = minvol
401 1000
FORMAT(
'value = ',1pe12.5,
', region ',i5,
', lev ',i1,
', ijk=',3i4)
402 2000
FORMAT(
'skewness, vol.= ',2(1pe10.3),
', reg.',i5,
', lev.',i1,
', ijk=',3i4)
Tfloat sum() const
Return the sum of all the pixel values in an image.
**********************************************************************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 idcend
**********************************************************************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 kpcbeg
subroutine registerfunction(global, funName, fileName)
**********************************************************************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 jpcbeg
**********************************************************************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 ipcend
subroutine rflo_getnodeoffset(region, iLev, iNodeOffset, ijNodeOffset)
subroutine rflo_getdimensdummy(region, iLev, idcbeg, idcend, jdcbeg, jdcend, kdcbeg, kdcend)
**********************************************************************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 kdcbeg
**********************************************************************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 ipcbeg
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 idcbeg
**********************************************************************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 jdcend
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
**********************************************************************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 jpcend
**********************************************************************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 jdcbeg
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine deregisterfunction(global)
subroutine rflo_checkmetrics(iReg, region)
subroutine rflo_getdimensphys(region, iLev, ipcbeg, ipcend, jpcbeg, jpcend, kpcbeg, kpcend)