32 integer(kind=intType),
intent(in) :: level, sps
35 integer(kind=intType) :: i, j, k, nn, mm, ierr, nFlaggedLocal
36 integer(kind=intType) :: iStart, iEnd, jStart, jEnd, kStart, kEnd
37 integer(kind=intType) :: loopIter, nAtBoundaryLocal, nAtBoundary
39 type(xplane),
dimension(:),
allocatable :: planes
40 real(Kind=realtype),
dimension(:, :, :, :),
pointer :: xx,
xseed
42 real(kind=realtype) :: dist
50 if (.not.
associated(flowdoms(nn, level, sps)%nearWall))
then
51 allocate (flowdoms(nn, level, sps)%nearWall(1:
il, 1:
jl, 1:
kl))
54 allocate (flowdoms(nn, level, sps)%XSeed(0:
ie, 0:
je, 0:
ke, 3))
57 xseed => flowdoms(nn, level, sps)%xSeed
58 nearwall => flowdoms(nn, level, sps)%nearWall
75 dist = norm2(planes(k)%x(i, j, :) - planes(1)%x(i, j, :))
77 planes(k)%nearWall(i, j) = 1
78 nflaggedlocal = nflaggedlocal + 1
87 if (k == kend - 1)
then
88 planes(k)%xSeed(i, j, :) = planes(1)%x(i, j, :)
89 natboundarylocal = natboundarylocal + 1
101 call mpi_allreduce(natboundarylocal, natboundary, 1, adflow_integer, mpi_sum, &
103 call echk(ierr, __file__, __line__)
107 parallelsyncloop:
do while (natboundary > 0)
109 print *,
'Flag Near Wall Iteration:', loopiter,
'nAtBoundary', natboundary
118 xseed => flowdoms(nn, level, sps)%xSeed
119 flowdoms(nn, level, sps)%realCommVars(1)%var =>
xseed(:, :, :, 1)
120 flowdoms(nn, level, sps)%realCommVars(2)%var =>
xseed(:, :, :, 2)
121 flowdoms(nn, level, sps)%realCommVars(3)%var =>
xseed(:, :, :, 3)
131 xseed => flowdoms(nn, level, sps)%xSeed
132 nearwall => flowdoms(nn, level, sps)%nearWall
148 if (planes(0)%xSeed(i, j, 1) <
large)
then
153 dist = norm2(planes(k)%x(i, j, :) - planes(0)%xSeed(i, j, :))
154 if (dist <
nearwalldist .and. planes(k)%nearWall(i, j) == 0)
then
155 planes(k)%nearWall(i, j) = 1
159 if (k == kend - 1)
then
160 planes(k)%xSeed(i, j, :) = planes(0)%xSeed(i, j, :)
161 natboundarylocal = natboundarylocal + 1
173 call mpi_allreduce(natboundarylocal, natboundary, 1, adflow_integer, mpi_sum, &
175 call echk(ierr, __file__, __line__)
177 loopiter = loopiter + 1
179 end do parallelsyncloop
185 deallocate (flowdoms(nn, level, sps)%XSeed)
192 integer(kind=intType),
intent(in) :: mm, faceID
193 logical,
intent(in) :: fullFaces
195 if (.not. fullfaces)
then
199 istart = 1; jstart = 1
212 kstart = 1; kend =
il
213 allocate (planes(0:
il))
214 planes(0)%xSeed =>
xseed(0, 1:
jl, 1:
kl, :)
216 planes(i)%x =>
x(i, 1:
jl, 1:
kl, :)
217 planes(i)%xSeed =>
xseed(i, 1:
jl, 1:
kl, :)
218 planes(i)%nearWall => nearwall(i, :, :)
221 kstart = 1; kend =
il
222 allocate (planes(0:
il))
225 planes(i)%x =>
x(
il - i + 1, 1:
jl, 1:
kl, :)
226 planes(i)%xSeed =>
xseed(
il - i + 1, 1:
jl, 1:
kl, :)
227 planes(i)%nearWall => nearwall(
il - i + 1, :, :)
230 kstart = 1; kend =
jl
231 allocate (planes(0:
jl))
232 planes(0)%xSeed =>
xseed(1:
il, 0, 1:
kl, :)
234 planes(j)%x =>
x(1:
il, j, 1:
kl, :)
235 planes(j)%xSeed =>
xseed(1:
il, j, 1:
kl, :)
236 planes(j)%nearWall => nearwall(:, j, :)
239 kstart = 1; kend =
jl
240 allocate (planes(0:
jl))
243 planes(j)%x =>
x(1:
il,
jl - j + 1, 1:
kl, :)
244 planes(j)%xSeed =>
xseed(1:
il,
jl - j + 1, 1:
kl, :)
245 planes(j)%nearWall => nearwall(:,
jl - j + 1, :)
248 kstart = 1; kend =
kl
249 allocate (planes(0:
kl))
250 planes(0)%xSeed =>
xseed(1:
il, 1:
jl, 0, :)
252 planes(k)%x =>
x(1:
il, 1:
jl, k, :)
253 planes(k)%xSeed =>
xseed(1:
il, 1:
jl, k, :)
254 planes(k)%nearWall => nearwall(:, :, k)
257 kstart = 1; kend =
kl
258 allocate (planes(0:
kl))
261 planes(k)%x =>
x(1:
il, 1:
jl,
kl - k + 1, :)
262 planes(k)%xSeed =>
xseed(1:
il, 1:
jl,
kl - k + 1, :)
263 planes(k)%nearWall => nearwall(:, :,
kl - k + 1)
subroutine flagnearwallcells(level, sps)
subroutine setboundarypointers(mm, faceID, fullFaces)
integer(kind=inttype), dimension(:), pointer bcfaceid
integer(kind=inttype) nbocos
integer(kind=inttype), dimension(:), pointer bctype
real(kind=realtype), dimension(:, :, :, :), pointer x
real(kind=realtype), dimension(:, :, :, :), pointer xseed
type(commtype), dimension(:), allocatable commpatternnode_1st
type(internalcommtype), dimension(:), allocatable internalnode_1st
integer adflow_comm_world
integer(kind=inttype), parameter imax
integer(kind=inttype), parameter kmin
integer(kind=inttype), parameter jmax
integer(kind=inttype), parameter imin
real(kind=realtype), parameter large
integer(kind=inttype), parameter kmax
integer(kind=inttype), parameter jmin
logical function iswalltype(bType)
subroutine echk(errorcode, file, line)
subroutine setpointers(nn, mm, ll)