Builds an integer field, where cells=0 denotes interior cells, and cells=1 denotes boundary cells for input variable.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bc_set), | intent(in) | :: | this |
Boundary conditions utility |
||
| character(len=*), | intent(in) | :: | name |
Name of the variable |
||
| type(eulerian_obj_i), | intent(inout) | :: | mask |
Mask for this variable |
impure subroutine bc_set_BuildMask(this,name,mask) !> Builds an integer field, where cells=0 denotes interior ! cells, and cells=1 denotes boundary cells for input variable. use leapeulerian class(bc_set), intent(in) :: this !! Boundary conditions utility character(len=*), intent(in) :: name !! Name of the variable type(eulerian_obj_i), intent(inout) :: mask !! Mask for this variable ! Work variables type(extent_obj) :: extents integer :: i,j,k integer :: n,ind logical :: found ! Initialize all cell to be interior cells mask%cell = 1 ! Leave, if not regions found if (.not.allocated(this%region)) return ! Loop over regions do n=1,this%count ! Get index of variable within this region ! Check Whether we have a BC for this variable on this region found = this%CheckBCExists(this%region(n)%name,name) if (.not.found) cycle ! If variable found, get its index ind = this%region(n)%GetBCIndex(name) ! Get extents of this region extents = this%GetExtents(this%region(n)%name) ! Mark cells as boundary cells if (this%region(n)%dir.eq.mask%staggering.and.this%region(n)%side.eq.BC_LEFT) then do k=extents%lo(3),extents%hi(3) do j=extents%lo(2),extents%hi(2) do i=extents%lo(1),extents%hi(1) mask%cell(i,j,k) = 0 end do end do end do end if end do call mask%UpdateGhostCells() return end subroutine bc_set_BuildMask