Merge branch 'master' into reconnection

This commit is contained in:
Grzegorz Kowal 2022-02-11 22:48:56 -03:00
commit 05121d375c
3 changed files with 27 additions and 29 deletions

View File

@ -198,12 +198,17 @@ module blocks
logical :: leaf
! the flag indicates that the corresponding
! data needs to be updated (e.g. boundaries or
! primitive variables), therefore it is
! usually .true.
! block needs to be updated since it was
! refined or derefined
!
logical :: update
! the flag indicates that the boundary of
! the block have been updated, so it needs
! the update of the primitive variables
!
logical :: boundary
! the block bounds in the coordinate units
!
real(kind=8) :: xmin, xmax, ymin, ymax, zmin, zmax
@ -850,6 +855,7 @@ module blocks
pmeta%refine = 0
pmeta%leaf = .false.
pmeta%update = .true.
pmeta%boundary = .false.
! initialize the position in the parent block
!

View File

@ -1073,6 +1073,7 @@ module boundaries
if (associated(pneigh)) then
if (pneigh%level == pmeta%level) then
if (pmeta%update .or. pneigh%update) then
pmeta%boundary = .true.
#ifdef MPI
if (pmeta%process == pneigh%process) then
if (pneigh%process == nproc) then
@ -1361,6 +1362,7 @@ module boundaries
if (associated(pneigh)) then
if (pneigh%level > pmeta%level) then
if (pmeta%update .or. pneigh%update) then
pmeta%boundary = .true.
#ifdef MPI
if (pmeta%process == pneigh%process) then
if (pneigh%process == nproc) then
@ -1662,6 +1664,7 @@ module boundaries
if (associated(pneigh)) then
if (pneigh%level < pmeta%level) then
if (pmeta%update .or. pneigh%update) then
pmeta%boundary = .true.
#ifdef MPI
if (pmeta%process == pneigh%process) then
if (pneigh%process == nproc) then
@ -1988,6 +1991,7 @@ module boundaries
if (associated(pneigh)) then
if (pneigh%level == pmeta%level) then
if (pmeta%update .or. pneigh%update) then
pmeta%boundary = .true.
#ifdef MPI
if (pmeta%process == pneigh%process) then
if (pneigh%process == nproc) then
@ -2302,6 +2306,7 @@ module boundaries
if (associated(pneigh)) then
if (pneigh%level > pmeta%level) then
if (pmeta%update .or. pneigh%update) then
pmeta%boundary = .true.
#ifdef MPI
if (pmeta%process == pneigh%process) then
if (pneigh%process == nproc) then
@ -2626,6 +2631,7 @@ module boundaries
if (associated(pneigh)) then
if (pneigh%level < pmeta%level) then
if (pmeta%update .or. pneigh%update) then
pmeta%boundary = .true.
#ifdef MPI
if (pmeta%process == pneigh%process) then
if (pneigh%process == nproc) then
@ -2923,36 +2929,24 @@ module boundaries
#endif /* NDIMS == 3 */
if (associated(pneigh)) then
if (pneigh%level == pmeta%level) then
if (pmeta%update .or. pneigh%update) then
pmeta%boundary = .true.
#ifdef MPI
if (pmeta%process == pneigh%process) then
if (pneigh%process == nproc) then
#endif /* MPI */
pdata%u(:,il:iu,jl:ju,kl:ku) = &
pneigh%data%u(:,is:it,js:jt,ks:kt)
#ifdef MPI
end if
else
call append_exchange_block(pmeta, pneigh, -1, [ i, j, k ])
end if
#endif /* MPI */
end if
end if
end if
end do
end do
#if NDIMS == 3
@ -3169,35 +3163,24 @@ module boundaries
#endif /* NDIMS == 3 */
if (associated(pneigh)) then
if (pneigh%level > pmeta%level) then
if (pmeta%update .or. pneigh%update) then
pmeta%boundary = .true.
#ifdef MPI
if (pmeta%process == pneigh%process) then
if (pneigh%process == nproc) then
#endif /* MPI */
call block_corner_restrict([ i, j, k ], pneigh%data%u, &
pdata%u(:,il:iu,jl:ju,kl:ku))
#ifdef MPI
end if
else
call append_exchange_block(pmeta, pneigh, -1, [ i, j, k ])
end if
#endif /* MPI */
end if
end if
end if
end do
end do
#if NDIMS == 3
@ -3431,6 +3414,7 @@ module boundaries
if (associated(pneigh)) then
if (pneigh%level < pmeta%level) then
if (pmeta%update .or. pneigh%update) then
pmeta%boundary = .true.
#ifdef MPI
if (pmeta%process == pneigh%process) then
if (pneigh%process == nproc) then
@ -3658,6 +3642,7 @@ module boundaries
do i = 1, nsides
s(1) = i
if (.not. associated(pmeta%edges(i,j,m)%ptr)) then
pmeta%boundary = .true.
call block_primitive_variables(n, pmeta%data, status)
call block_boundary_specific(n, [ i, j, k ], t, dt, &
x, y, z, pmeta%data%q, status)
@ -3682,6 +3667,7 @@ module boundaries
do i = 1, nsides
s(1) = i
if (.not. associated(pmeta%faces(i,j,k,n)%ptr)) then
pmeta%boundary = .true.
call block_primitive_variables(n, pmeta%data, status)
call block_boundary_specific(n, [ i, j, k ], t, dt, &
x, y, z, pmeta%data%q, status)

View File

@ -4111,7 +4111,7 @@ module evolution
do l = 1, n
pdata => data_blocks(l)%ptr
if (pdata%meta%update) then
if (pdata%meta%update .or. pdata%meta%boundary) then
call update_primitive_variables(pdata%u, pdata%q, .true., s)
!$omp critical
if (s /= 0) status = 1
@ -4135,6 +4135,12 @@ module evolution
end do
!$omp end parallel do
pmeta => list_meta
do while (associated(pmeta))
pmeta%boundary = .false.
pmeta => pmeta%next
end do
if (fix_unphysical_cells) then
! if an unphysical cell appeared in a block while updating its primitive