17 integer(kind=intType),
intent(in) :: level, sps
20 integer(kind=intType) :: nn, i, j, k
58 integer(kind=intType),
intent(in) :: level, sps
61 integer(kind=intType) :: nn, i, j, k
90 ie,
je,
ke,
vol,
iblank,
xseed,
forcedrecv,
nbkglobal,
si,
sj,
sk
101 integer(kind=intType) :: nn, level, sps, kk
104 integer(kind=intType) :: i, j, k, mm, nADT, nHexa, planeOffset
105 integer(kind=intType) :: iStart, iEnd, jStart, jEnd, kStart, kEnd
106 real(kind=realtype) :: factor, frac, dist, xp(3), aspect(3), fact
107 integer(kind=intType) :: i_stencil, ii, jj, iii
108 logical :: wallsPresent
109 logical,
allocatable,
dimension(:, :, :) :: nearWallTmp
123 oblock%qualDonor(1,
ie *
je *
ke), &
124 oblock%globalCell(0:
ib, 0:
jb, 0:
kb), &
125 oblock%invalidDonor(1:
ie, 1:
je, 1:
ke))
132 oblock%invalidDonor(i, j, k) =
forcedrecv(i, j, k)
143 if (wallspresent)
then
159 fact = min(aspect(1) * aspect(2) * aspect(3), 100.0_realtype)
161 oblock%qualDonor(1, mm) = (
vol(i, j, k)**
third) / fact
179 allocate (oblock%xADT(3, nadt), oblock%hexaConn(8, nhexa))
184 allocate (oblock%nearWall(1:
il, 1:
jl, 1:
kl))
187 allocate (nearwalltmp(1:
ie, 1:
je, 1:
ke))
188 nearwalltmp = .false.
195 x(i - 1, j - 1, k - 1, :) + &
196 x(i, j - 1, k - 1, :) + &
197 x(i - 1, j, k - 1, :) + &
198 x(i, j, k - 1, :) + &
199 x(i - 1, j - 1, k, :) + &
200 x(i, j - 1, k, :) + &
201 x(i - 1, j, k, :) + &
203 oblock%xADT(:, mm) = xp
210 nearwalltmp(i, j, k) = .true.
225 (nearwalltmp(i, j, k) .or.
globalcell(i, j, k) < 0) .and. &
226 (nearwalltmp(i + 1, j, k) .or.
globalcell(i + 1, j, k) < 0) .and. &
227 (nearwalltmp(i, j + 1, k) .or.
globalcell(i, j + 1, k) < 0) .and. &
228 (nearwalltmp(i + 1, j + 1, k) .or.
globalcell(i + 1, j + 1, k) < 0) .and. &
229 (nearwalltmp(i, j, k + 1) .or.
globalcell(i, j, k + 1) < 0) .and. &
230 (nearwalltmp(i + 1, j, k + 1) .or.
globalcell(i + 1, j, k + 1) < 0) .and. &
231 (nearwalltmp(i, j + 1, k + 1) .or.
globalcell(i, j + 1, k + 1) < 0) .and. &
232 (nearwalltmp(i + 1, j + 1, k + 1) .or.
globalcell(i + 1, j + 1, k + 1) < 0))
then
233 oblock%nearWall(i, j, k) = 1
239 deallocate (nearwalltmp)
242 planeoffset =
ie *
je
247 oblock%hexaConn(1, mm) = (k - 2) * planeoffset + (j - 2) *
ie + (i - 2) + 1
248 oblock%hexaConn(2, mm) = oblock%hexaConn(1, mm) + 1
249 oblock%hexaConn(3, mm) = oblock%hexaConn(2, mm) +
ie
250 oblock%hexaConn(4, mm) = oblock%hexaConn(3, mm) - 1
252 oblock%hexaConn(5, mm) = oblock%hexaConn(1, mm) + planeoffset
253 oblock%hexaConn(6, mm) = oblock%hexaConn(2, mm) + planeoffset
254 oblock%hexaConn(7, mm) = oblock%hexaConn(3, mm) + planeoffset
255 oblock%hexaConn(8, mm) = oblock%hexaConn(4, mm) + planeoffset
263 call buildserialhex(nhexa, nadt, oblock%xADT, oblock%hexaConn, oblock%ADT)
266 oblock%allocated = .true.
287 integer(kind=intType),
intent(in) :: nn
288 integer(kind=intType),
intent(in),
dimension(:) :: famList
290 integer(kind=intTYpe) :: i, j, k, mm, iDim, ii, jj, kk, iii, jjj, myI, myJ, myK
291 integer(kind=intTYpe) :: iStart, iEnd, jStart, jEnd, kStart, kEnd
292 logical :: wallsPresent
293 integer(kind=intType) :: i_stencil
294 real(kind=realtype) :: dist, frac, xp(3)
310 allocate (ofringe%x(3, mm))
311 allocate (ofringe%xSeed(3, mm))
312 allocate (ofringe%wallInd(mm))
313 allocate (ofringe%isWall(mm))
315 ofringe%xSeed =
large
320 allocate (ofringe%fringeIntBuffer(5, mm), ofringe%fringeRealBuffer(4, mm))
331 ofringe%x(idim, ii) =
eighth * ( &
332 x(i - 1, j - 1, k - 1, idim) + &
333 x(i, j - 1, k - 1, idim) + &
334 x(i - 1, j, k - 1, idim) + &
335 x(i, j, k - 1, idim) + &
336 x(i - 1, j - 1, k, idim) + &
337 x(i, j - 1, k, idim) + &
338 x(i - 1, j, k, idim) + &
341 ofringe%xSeed(:, ii) =
xseed(i, j, k, :)
342 ofringe%wallInd(ii) =
wallind(i, j, k)
343 ofringe%fringeIntBuffer(4, ii) = nn
358 istart = 2; iend = 2;
362 istart =
il; iend =
il;
367 jstart = 2; jend = 2;
371 jstart =
jl; jend =
jl;
376 kstart = 2; kend = 2;
380 kstart =
kl; kend =
kl;
388 ii = (k - 2) *
nx *
ny + (j - 2) *
nx + (i - 2) + 1
397 ofringe%allocated = .true.
415 integer(kind=intType),
intent(in),
dimension(:) :: famList
417 logical,
intent(in) :: dualMesh
418 integer(kind=intType),
intent(in) :: cluster
421 integer(kind=intType) :: i, j, k, n, ii, jj, jjj, mm, ni, nj, nodeCount
422 integer(kind=intType) :: iBeg, iEnd, jBeg, jEnd, nNodes, maxCells, nCells, iNode
423 logical :: regularOrdering
430 call getwallsize(famlist, nnodes, maxcells, dualmesh)
432 osurf%nNodes = nnodes
433 osurf%maxCells = maxcells
434 osurf%cluster = cluster
437 allocate (osurf%x(3, nnodes), osurf%conn(4, maxcells), &
438 osurf%cellPtr(maxcells), osurf%iBlank(maxcells), &
439 osurf%delta(nnodes), osurf%nte(4, nnodes))
451 regularordering = .true.
453 regularordering = .false.
459 regularordering = .not. (regularordering)
467 dualcheck:
if (dualmesh)
then
476 osurf%x(:, ii) =
fourth * (
x(1, i, j, :) +
x(1, i + 1, j, :) + &
477 x(1, i, j + 1, :) +
x(1, i + 1, j + 1, :))
479 osurf%x(:, ii) =
fourth * (
x(
il, i, j, :) +
x(
il, i + 1, j, :) + &
480 x(
il, i, j + 1, :) +
x(
il, i + 1, j + 1, :))
482 osurf%x(:, ii) =
fourth * (
x(i, 1, j, :) +
x(i + 1, 1, j, :) + &
483 x(i, 1, j + 1, :) +
x(i + 1, 1, j + 1, :))
485 osurf%x(:, ii) =
fourth * (
x(i,
jl, j, :) +
x(i + 1,
jl, j, :) + &
486 x(i,
jl, j + 1, :) +
x(i + 1,
jl, j + 1, :))
488 osurf%x(:, ii) =
fourth * (
x(i, j, 1, :) +
x(i + 1, j, 1, :) + &
489 x(i, j + 1, 1, :) +
x(i + 1, j + 1, 1, :))
491 osurf%x(:, ii) =
fourth * (
x(i, j,
kl, :) +
x(i + 1, j,
kl, :) + &
492 x(i, j + 1,
kl, :) +
x(i + 1, j + 1,
kl, :))
508 if (regularordering)
then
509 osurf%conn(1, jj) = nodecount + (j) * ni + i + 1
510 osurf%conn(2, jj) = nodecount + (j) * ni + i + 2
511 osurf%conn(3, jj) = nodecount + (j + 1) * ni + i + 2
512 osurf%conn(4, jj) = nodecount + (j + 1) * ni + i + 1
514 osurf%conn(1, jj) = nodecount + (j) * ni + i + 1
515 osurf%conn(2, jj) = nodecount + (j + 1) * ni + i + 1
516 osurf%conn(3, jj) = nodecount + (j + 1) * ni + i + 2
517 osurf%conn(4, jj) = nodecount + (j) * ni + i + 2
521 nodecount = nodecount + ni * nj
538 osurf%x(:, ii) =
x(1, i, j, :)
540 osurf%x(:, ii) =
x(
il, i, j, :)
542 osurf%x(:, ii) =
x(i, 1, j, :)
544 osurf%x(:, ii) =
x(i,
jl, j, :)
546 osurf%x(:, ii) =
x(i, j, 1, :)
548 osurf%x(:, ii) =
x(i, j,
kl, :)
550 osurf%delta(ii) =
bcdata(mm)%deltaNode(i, j)
561 osurf%iBlank(jjj) =
bcdata(mm)%iblank(ibeg + i + 1, jbeg + j + 1)
562 if (osurf%iBlank(jjj) == 1)
then
564 if (regularordering)
then
565 osurf%conn(1, jj) = nodecount + (j) * ni + i + 1
566 osurf%conn(2, jj) = nodecount + (j) * ni + i + 2
567 osurf%conn(3, jj) = nodecount + (j + 1) * ni + i + 2
568 osurf%conn(4, jj) = nodecount + (j + 1) * ni + i + 1
570 osurf%conn(1, jj) = nodecount + (j) * ni + i + 1
571 osurf%conn(2, jj) = nodecount + (j + 1) * ni + i + 1
572 osurf%conn(3, jj) = nodecount + (j + 1) * ni + i + 2
573 osurf%conn(4, jj) = nodecount + (j) * ni + i + 2
575 osurf%cellPtr(jj) = jjj
579 nodecount = nodecount + ni * nj
588 call buildserialquad(osurf%nCells, nnodes, osurf%x, osurf%conn, osurf%ADT)
591 if (osurf%nNodes > 0)
then
597 do i = 1, osurf%nCells
601 if (osurf%nte(k, n) == 0)
then
610 osurf%allocated = .true.
subroutine buildserialhex(nHexa, nNodes, coor, hexaConn, ADT)
subroutine buildserialquad(nQuad, nNodes, coor, quadsConn, ADT)
integer(kind=inttype) nbklocal
integer(kind=inttype), dimension(:, :, :), pointer iblank
integer(kind=inttype), dimension(:, :, :), pointer globalcell
integer(kind=inttype) nbkglobal
integer(kind=inttype), dimension(:), pointer bcfaceid
real(kind=realtype), dimension(:, :, :, :), pointer si
integer(kind=inttype) nbocos
integer(kind=inttype), dimension(:, :, :), pointer status
real(kind=realtype), dimension(:, :, :, :), pointer sj
integer(kind=inttype), dimension(:), pointer bctype
real(kind=realtype), dimension(:, :, :, :), pointer sk
real(kind=realtype), dimension(:, :, :), pointer vol
integer(kind=inttype), dimension(:, :, :), pointer forcedrecv
integer(kind=inttype), dimension(:, :, :), pointer wallind
real(kind=realtype), dimension(:, :, :, :), pointer x
real(kind=realtype), dimension(:, :, :, :), pointer xseed
type(cgnsblockinfotype), dimension(:), allocatable cgnsdoms
real(kind=realtype), parameter zero
integer(kind=inttype), parameter imax
integer(kind=inttype), parameter kmin
real(kind=realtype), parameter third
integer(kind=inttype), parameter jmax
real(kind=realtype), parameter eighth
real(kind=realtype), parameter one
real(kind=realtype), parameter half
integer(kind=inttype), parameter imin
real(kind=realtype), parameter fourth
real(kind=realtype), parameter large
integer(kind=inttype), parameter kmax
integer(kind=inttype), parameter jmin
type(kdtree2) function, pointer, public kdtree2_create(input_data, dim, sort, rearrange)
integer(kind=inttype), dimension(:), allocatable cumdomproc
integer(kind=inttype), dimension(:), allocatable clusters
subroutine initializeosurf(famList, oSurf, dualMesh, cluster)
subroutine reinitializestatus(level, sps)
subroutine initializeofringes(oFringe, nn, famList)
subroutine initializeoblock(oBlock, nn, level, sps)
subroutine initializestatus(level, sps)
subroutine getwallsize(famList, nNodes, nCells, dualMesh)
subroutine wallsonblock(wallsPresent)
subroutine setisdonor(i, flag)
subroutine unwindindex(index, il, jl, kl, i, j, k)
logical function iswalldonor(i)
subroutine setiswalldonor(i, flag)
integer(kind=inttype) function windindex(i, j, k, il, jl, kl)
subroutine setiscompute(i, flag)
subroutine setisreceiver(i, flag)
logical function faminlist(famID, famList)
integer(kind=inttype), parameter n_visc_drdw
integer(kind=inttype), dimension(33, 3), target visc_drdw_stencil
real(kind=realtype) function mynorm2(x)
subroutine setpointers(nn, mm, ll)