Sets up the rhs vector.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(hypre_obj), | intent(inout) | :: | this |
Hypre machinery |
impure subroutine hypre_obj_SetupRHSIJ(this) !> Sets up the rhs vector. implicit none class(hypre_obj), intent(inout) :: this !! Hypre machinery ! Work variables integer :: ierr integer :: n,i,j,k call HYPRE_IJVectorCreate(this%comm,this%irow_lo,this%irow_hi, this%rhs , ierr) call HYPRE_IJVectorSetObjectType(this%rhs, HYPRE_PARCSR, ierr) call HYPRE_IJVectorInitialize(this%rhs,ierr) associate(lo=>this%block%lo, hi=>this%block%hi, irow=>this%irow, & irow_hi=>this%irow_hi,irow_lo =>this%irow_lo) n = 0 do k=lo(3),hi(3) do j=lo(2),hi(2) do i=lo(1),hi(1) n = n + 1 this%rhs_values(n) = 0.0_wp this%rows(n) = irow%cell(i,j,k) end do end do end do call HYPRE_IJVectorSetValues(this%rhs, irow_hi-irow_lo+1,this%rows,this%rhs_values, ierr) end associate call HYPRE_IJVectorAssemble(this%rhs, ierr) call HYPRE_IJVectorGetObject(this%rhs, this%par_rhs, ierr) return end subroutine hypre_obj_SetupRHSIJ