20 integer(kind=intType),
intent(in) :: level, sps, nFamList
21 logical,
intent(in) :: useDual
22 type(
oversetwall),
intent(inout),
dimension(nClusters),
target :: walls
23 integer(Kind=intType),
intent(in) :: famList(nFamList)
26 integer(kind=intType) :: i, j, k, l, ii, jj, kk, nn, mm, iNode, iCell, c
27 integer(kind=intType) :: iBeg, iEnd, jBeg, jEnd, ni, nj, nUnique, cellID, cellID2
28 integer(kind=intType) :: ierr, iDim, lj
31 integer(kind=intType) :: nNodes, nCells
32 integer(kind=intType) :: nNodesLocal, nCellsLocal
33 integer(kind=intType),
dimension(:, :),
allocatable :: connLocal
34 integer(kind=intType),
dimension(:),
allocatable :: clusterNodeLocal
35 integer(kind=intType),
dimension(:),
allocatable :: clusterCellLocal
36 real(kind=realtype),
dimension(:, :),
allocatable :: nodeslocal
37 real(kind=realtype),
dimension(:, :, :),
pointer :: xx, xx1, xx2, xx3, xx4 => null()
38 integer(kind=intType),
dimension(:, :, :),
pointer :: globalCGNSNode => null()
39 integer(kind=intType),
dimension(:, :),
pointer :: ind, indCGNS => null()
40 integer(kind=intType),
dimension(:, :),
pointer :: indCell => null()
41 logical :: regularOrdering
44 integer(kind=intTYpe) :: nNodesGlobal, nCellsGlobal
45 integer(kind=intType),
dimension(:, :),
allocatable,
target :: connGlobal
46 real(kind=realtype),
dimension(:, :),
allocatable,
target :: nodesglobal
47 integer(kind=intType),
dimension(:),
allocatable,
target :: nodeIndicesGlobal
48 integer(kind=intType),
dimension(:),
allocatable,
target :: nodeIndicesCGNSGlobal
49 integer(kind=intType),
dimension(:),
allocatable,
target :: cellIndicesGlobal
51 integer(kind=intType),
dimension(:),
allocatable :: nodesPerCluster, cellsPerCluster, cnc, ccc
52 integer(kind=intType),
dimension(:),
allocatable :: clusterNodeGlobal
53 integer(kind=intType),
dimension(:),
allocatable :: clusterCellGlobal
54 integer(kind=intType),
dimension(:),
allocatable :: localNodeNums
55 integer(kind=intType),
dimension(:),
allocatable :: nodeIndicesLocal
56 integer(kind=intType),
dimension(:),
allocatable :: nodeIndicesCGNSLocal
57 integer(kind=intType),
dimension(:),
allocatable :: cellIndicesLocal
58 integer(kind=intType),
dimension(:),
allocatable :: cgnsIndices, curCGNSNode
60 integer(kind=intType),
dimension(:),
allocatable :: nCellProc, cumCellProc
61 integer(kind=intType),
dimension(:),
allocatable :: nNodeProc, cumNodeProc
62 real(kind=realtype),
dimension(:, :),
allocatable :: uniquenodes
63 integer(kind=intType),
dimension(:),
allocatable :: link
64 real(kind=realtype),
parameter :: tol = 1e-12
67 integer(kind=intType),
dimension(:, :),
pointer :: conn
68 integer(kind=intType),
dimension(:),
pointer :: tmpInd
85 allocate (flowdoms(nn, level, sps)%globalCGNSNode(1:
il, 1:
jl, 1:
kl))
86 flowdoms(nn, level, sps)%globalCGNSNode = 0
91 allocate (cgnsindices(3 * ii))
105 flowdoms(nn, level, sps)%globalCGNSNode(i, j, k) = cgnsindices(ii) / 3
110 deallocate (cgnsindices)
123 nnodeslocal = nnodeslocal + &
124 (iend - ibeg + 2) * (jend - jbeg + 2)
125 ncellslocal = ncellslocal + &
126 (iend - ibeg + 1) * (jend - jbeg + 1)
128 nnodeslocal = nnodeslocal + &
129 (iend - ibeg + 1) * (jend - jbeg + 1)
130 ncellslocal = ncellslocal + &
131 (iend - ibeg) * (jend - jbeg)
138 allocate (ncellproc(
nproc), cumcellproc(0:
nproc), &
141 call mpi_allgather(ncellslocal, 1, adflow_integer, ncellproc, 1, adflow_integer, &
143 call echk(ierr, __file__, __line__)
145 call mpi_allgather(nnodeslocal, 1, adflow_integer, nnodeproc, 1, adflow_integer, &
147 call echk(ierr, __file__, __line__)
153 cumcellproc(i) = cumcellproc(i - 1) + ncellproc(i)
154 cumnodeproc(i) = cumnodeproc(i - 1) + nnodeproc(i)
158 ncellsglobal = cumcellproc(
nproc)
159 nnodesglobal = cumnodeproc(
nproc)
162 allocate (nodeslocal(3, nnodeslocal), connlocal(4, ncellslocal), &
163 clustercelllocal(ncellslocal), clusternodelocal(nnodeslocal), &
164 nodeindiceslocal(nnodeslocal), nodeindicescgnslocal(nnodeslocal), &
165 cellindiceslocal(ncellslocal))
173 globalcgnsnode => flowdoms(nn, level, sps)%globalCGNSNode
184 xx1 =>
x(1, 0:
jl, 0:
kl, :)
185 xx2 =>
x(1, 1:
je, 0:
kl, :)
186 xx3 =>
x(1, 0:
jl, 1:
ke, :)
187 xx4 =>
x(1, 1:
je, 1:
ke, :)
197 xx1 =>
x(0:
il, 1, 0:
kl, :)
198 xx2 =>
x(1:
ie, 1, 0:
kl, :)
199 xx3 =>
x(0:
il, 1, 1:
ke, :)
200 xx4 =>
x(1:
ie, 1, 1:
ke, :)
211 xx1 =>
x(0:
il, 0:
jl, 1, :)
212 xx2 =>
x(1:
ie, 0:
jl, 1, :)
213 xx3 =>
x(0:
il, 1:
je, 1, :)
214 xx4 =>
x(1:
ie, 1:
je, 1, :)
230 indcgns => globalcgnsnode(1, :, :)
237 indcgns => globalcgnsnode(
il, :, :)
245 indcgns => globalcgnsnode(:, 1, :)
252 indcgns => globalcgnsnode(:,
jl, :)
259 indcgns => globalcgnsnode(:, :, 1)
266 indcgns => globalcgnsnode(:, :,
kl)
298 case (imin, jmax, kmin)
299 regularordering = .true.
301 regularordering = .false.
307 regularordering = .not. (regularordering)
325 if (regularordering)
then
329 connlocal(1, icell) = cumnodeproc(
myid) + inode + (j - 1) * ni + i
330 connlocal(2, icell) = cumnodeproc(
myid) + inode + (j - 1) * ni + i + 1
331 connlocal(3, icell) = cumnodeproc(
myid) + inode + (j) * ni + i + 1
332 connlocal(4, icell) = cumnodeproc(
myid) + inode + (j) * ni + i
334 clustercelllocal(icell) = c
338 cellindiceslocal(icell) = 0
341 cellindiceslocal(icell) = indcell(ibeg + i + 1, jbeg + j + 1)
350 connlocal(1, icell) = cumnodeproc(
myid) + inode + (j - 1) * ni + i
351 connlocal(2, icell) = cumnodeproc(
myid) + inode + (j) * ni + i
352 connlocal(3, icell) = cumnodeproc(
myid) + inode + (j) * ni + i + 1
353 connlocal(4, icell) = cumnodeproc(
myid) + inode + (j - 1) * ni + i + 1
356 clustercelllocal(icell) = c
360 cellindiceslocal(icell) = 0
363 cellindiceslocal(icell) = indcell(ibeg + i + 1, jbeg + j + 1)
374 nodeslocal(:, inode) = fourth * ( &
375 xx1(i + 1, j + 1, :) + xx2(i + 1, j + 1, :) + &
376 xx3(i + 1, j + 1, :) + xx4(i + 1, j + 1, :))
378 clusternodelocal(inode) = c
379 nodeindiceslocal(inode) = ind(i + 1, j + 1)
380 if (.not. usedual)
then
381 nodeindicescgnslocal(inode) = indcgns(i, j)
383 nodeindicescgnslocal(inode) = 0
392 allocate (nodesglobal(3, nnodesglobal), connglobal(4, ncellsglobal), &
393 clustercellglobal(ncellsglobal), clusternodeglobal(nnodesglobal), &
394 nodeindicesglobal(nnodesglobal), nodeindicescgnsglobal(nnodesglobal), &
395 cellindicesglobal(ncellsglobal))
398 call mpi_allgatherv(nodeslocal, 3 * nnodeslocal, adflow_real, &
399 nodesglobal, nnodeproc * 3, cumnodeproc * 3, adflow_real, &
401 call echk(ierr, __file__, __line__)
403 call mpi_allgatherv(clusternodelocal, nnodeslocal, adflow_integer, &
404 clusternodeglobal, nnodeproc, cumnodeproc, adflow_integer, &
406 call echk(ierr, __file__, __line__)
408 call mpi_allgatherv(nodeindiceslocal, nnodeslocal, adflow_integer, &
409 nodeindicesglobal, nnodeproc, cumnodeproc, adflow_integer, &
411 call echk(ierr, __file__, __line__)
413 call mpi_allgatherv(nodeindicescgnslocal, nnodeslocal, adflow_integer, &
414 nodeindicescgnsglobal, nnodeproc, cumnodeproc, adflow_integer, &
416 call echk(ierr, __file__, __line__)
418 call mpi_allgatherv(connlocal, 4 * ncellslocal, adflow_integer, &
419 connglobal, ncellproc * 4, cumcellproc * 4, adflow_integer, &
421 call echk(ierr, __file__, __line__)
423 call mpi_allgatherv(clustercelllocal, ncellslocal, adflow_integer, &
424 clustercellglobal, ncellproc, cumcellproc, adflow_integer, &
426 call echk(ierr, __file__, __line__)
428 call mpi_allgatherv(cellindiceslocal, ncellslocal, adflow_integer, &
429 cellindicesglobal, ncellproc, cumcellproc, adflow_integer, &
431 call echk(ierr, __file__, __line__)
434 deallocate (nodeslocal, connlocal, clustercelllocal, clusternodelocal, &
435 ncellproc, cumcellproc, nnodeproc, cumnodeproc, nodeindiceslocal, &
436 nodeindicescgnslocal, cellindiceslocal)
445 do i = 1, ncellsglobal
446 cellspercluster(clustercellglobal(i)) = cellspercluster(clustercellglobal(i)) + 1
449 do i = 1, nnodesglobal
450 nodespercluster(clusternodeglobal(i)) = nodespercluster(clusternodeglobal(i)) + 1
454 allocate (localnodenums(nnodesglobal))
458 nnodes = nodespercluster(i)
459 ncells = cellspercluster(i)
460 walls(i)%nCells = ncells
461 walls(i)%nNodes = nnodes
463 allocate (walls(i)%x(3, nnodes), walls(i)%conn(4, ncells), &
464 walls(i)%ind(nnodes))
465 allocate (walls(i)%indCell(ncells))
474 do i = 1, nnodesglobal
475 c = clusternodeglobal(i)
478 walls(c)%x(:, cnc(c)) = nodesglobal(:, i)
479 walls(c)%ind(cnc(c)) = nodeindicesglobal(i)
480 localnodenums(i) = cnc(c)
484 do i = 1, ncellsglobal
485 c = clustercellglobal(i)
487 walls(c)%conn(:, ccc(c)) = connglobal(:, i)
489 walls(c)%indCell(ccc(c)) = cellindicesglobal(i)
494 ncells = walls(i)%nCells
495 nnodes = walls(i)%nNodes
500 walls(i)%conn(k, j) = localnodenums(walls(i)%conn(k, j))
505 allocate (uniquenodes(3, nnodes), link(nnodes))
507 call pointreduce(walls(i)%x, nnodes, tol, uniquenodes, link, nunique)
510 tmpind => walls(i)%ind
511 allocate (walls(i)%ind(nunique))
512 allocate (curcgnsnode(nunique))
515 do j = 1, walls(i)%nNodes
525 if (walls(i)%ind(lj) == -1)
then
527 walls(i)%ind(lj) = tmpind(j)
528 curcgnsnode(lj) = nodeindicescgnsglobal(j)
530 if (nodeindicescgnsglobal(j) < curcgnsnode(lj))
then
533 walls(i)%ind(lj) = tmpind(j)
534 curcgnsnode(lj) = nodeindicescgnsglobal(j)
538 deallocate (tmpind, curcgnsnode)
542 walls(i)%nNodes = nnodes
546 walls(i)%x(:, j) = uniquenodes(:, j)
552 walls(i)%conn(k, j) = link(walls(i)%conn(k, j))
557 deallocate (link, uniquenodes)
559 call buildserialquad(ncells, nnodes, walls(i)%x, walls(i)%conn, walls(i)%ADT)
563 deallocate (nodesglobal, connglobal, clustercellglobal, &
564 clusternodeglobal, localnodenums, nodeindicesglobal, &
565 nodeindicescgnsglobal)
568 deallocate (flowdoms(nn, level, sps)%globalCGNSNode)
subroutine buildclusterwalls(level, sps, useDual, walls, famList, nFamList)
subroutine buildserialquad(nQuad, nNodes, coor, quadsConn, ADT)
integer(kind=inttype), dimension(:, :, :), pointer globalcell
integer(kind=inttype), dimension(:), pointer bcfaceid
integer(kind=inttype) nbocos
integer(kind=inttype), dimension(:, :, :), pointer globalnode
real(kind=realtype), dimension(:, :, :, :), pointer x
integer adflow_comm_world
integer(kind=inttype) nclusters
integer(kind=inttype), dimension(:), allocatable cumdomproc
integer(kind=inttype), dimension(:), allocatable clusters
logical function faminlist(famID, famList)
subroutine pointreduce(pts, N, tol, uniquePts, link, nUnique)
subroutine echk(errorcode, file, line)
subroutine setpointers(nn, mm, ll)
subroutine getcgnsmeshindices(ndof, indices)