Setup the solution vector, and initialize it to zero
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(hypre_obj), | intent(inout) | :: | this |
Hypre machinery |
impure subroutine hypre_obj_SetupSolIJ(this) !> Setup the solution vector, and initialize it to zero 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%sol , ierr) call HYPRE_IJVectorSetObjectType(this%sol, HYPRE_PARCSR, ierr) call HYPRE_IJVectorInitialize(this%sol,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%sol_values(n) = 0.0_wp this%rows(n) = irow%cell(i,j,k) end do end do end do call HYPRE_IJVectorSetValues(this%sol, irow_hi-irow_lo+1,this%rows,this%sol_values, ierr) end associate call HYPRE_IJVectorAssemble(this%sol, ierr) call HYPRE_IJVectorGetObject(this%sol, this%par_sol, ierr) return end subroutine hypre_obj_SetupSolIJ