Finds the intersection between block owned by this MPI rank, and the plane defining the region.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bc_set), | intent(inout) | :: | this |
Boundary conditions utility |
||
| character(len=*), | intent(in) | :: | name |
Region name |
pure subroutine bc_set_UpdateExtents(this,name) !> Finds the intersection between block owned by this MPI rank, and the ! plane defining the region. class(bc_set), intent(inout) :: this !! Boundary conditions utility character(len=*), intent(in) :: name !! Region name ! Work variable integer :: ind logical :: overlap real(wp):: xlo(3),xhi(3) integer :: i,j,k real(wp):: normal(3) real(wp):: ds ! Get index of region ind = this%GetRegionIndex(name) ! Initialize indices this%region(ind)%lo = floor(huge(1)/100.0_wp) this%region(ind)%hi = -floor(huge(1)/100.0_wp) associate (lo => this%block%lo, hi => this%block%hi, & x => this%block%x, y => this%block%y, z=>this%block%z ) xlo = this%region(ind)%xlo xhi = this%region(ind)%xhi ds = 0.5_wp*minval(this%block%dx) normal = 0.0_wp select case (this%region(ind)%side) case (BC_LEFT) normal(this%region(ind)%dir) = 1.0_wp xhi = xhi + ds*normal case (BC_RIGHT) normal(this%region(ind)%dir) = -1.0_wp xlo = xlo + ds*normal end select do k=lo(3),hi(3) do j=lo(2),hi(2) do i=lo(1),hi(1) overlap = .true. if ( x(i) .ge. xhi(1) .or. xlo(1) .ge. x(i+1) ) overlap=.false. if ( y(j) .ge. xhi(2) .or. xlo(2) .ge. y(j+1) ) overlap=.false. if ( z(k) .ge. xhi(3) .or. xlo(3) .ge. z(k+1) ) overlap=.false. if (overlap) then this%region(ind)%lo(1) = min(this%region(ind)%lo(1),i) this%region(ind)%hi(1) = max(this%region(ind)%hi(1),i) this%region(ind)%lo(2) = min(this%region(ind)%lo(2),j) this%region(ind)%hi(2) = max(this%region(ind)%hi(2),j) this%region(ind)%lo(3) = min(this%region(ind)%lo(3),k) this%region(ind)%hi(3) = max(this%region(ind)%hi(3),k) end if end do end do end do end associate return end subroutine bc_set_UpdateExtents