Initializes a uniform grid on this block.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(block_obj), | intent(inout) | :: | this |
A block object |
||
| real(kind=wp), | intent(in) | :: | xlo(3) |
Coordinates of the bottom left corner |
||
| real(kind=wp), | intent(in) | :: | xhi(3) |
Coordinates of the top right corner |
||
| integer, | intent(in) | :: | lo(3) |
Array lower bound |
||
| integer, | intent(in) | :: | hi(3) |
Array upper bound |
impure subroutine block_obj_SetupUniformGrid(this,xlo,xhi,lo,hi) !> Initializes a uniform grid on this block. implicit none class(block_obj), intent(inout) :: this !! A block object real(wp), intent(in) :: xlo(3) !! Coordinates of the bottom left corner real(wp), intent(in) :: xhi(3) !! Coordinates of the top right corner integer, intent(in) :: lo(3) !! Array lower bound integer, intent(in) :: hi(3) !! Array upper bound ! Work variables integer :: i,dir real(wp):: dl ! Setup bounds this%lo = lo this%hi = hi ! Initialize axes do dir=1,3 call this%axis(dir)%Initialize(this%lo(dir),this%hi(dir),this%ngc) end do ! Associate pointers call this%SetConveniencePointers ! Create a uniform grid on this block associate (axis => this%axis) ! Define the nodal grid points do dir=1,3 axis(dir)%x=0.0_wp dl = (xhi(dir)-xlo(dir))/real(hi(dir)-lo(dir)+1,wp) do i=lo(dir),hi(dir)+1 axis(dir)%x(i)= xlo(dir)+ (i-lo(dir))*dl end do end do end associate ! Update values within ghostcells call this%UpdateGridGhostCells() ! Update mid points (xm) call this%UpdateMidPoints() ! Update spacing (dxm) call this%UpdateSpacing() ! Create MPI type for ghostcell communication call this%SetupMPITypes() return end subroutine block_obj_SetupUniformGrid