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_SetupSolS(this) !> Setup the solution vector, and initialize it to zero implicit none class(hypre_obj), intent(inout) :: this !! Hypre machinery ! Work variables real(wp), allocatable :: values(:) integer :: nval integer :: ierr ! Create empty vector call HYPRE_StructVectorCreate(this%comm,this%grid,this%sol,ierr) ! Indicate vector coefficients are ready to set call HYPRE_StructVectorInitialize(this%sol,ierr) ! Initial guess is the zero vector (maybe changed later) nval=(this%block%hi(3)-this%block%lo(3)+1) & *(this%block%hi(2)-this%block%lo(2)+1) & *(this%block%hi(1)-this%block%lo(1)+1) allocate(values(nval)) values=0.0_wp call HYPRE_StructVectorSetBoxValues(this%sol,this%block%lo(1:this%dim), & this%block%hi(1:this%dim),values(1:nval),ierr) deallocate(values) ! Assemble for future use call HYPRE_StructVectorAssemble(this%sol,ierr) return end subroutine hypre_obj_SetupSolS