Sets up and builds the matrix.
Currently, assuming that we are solving laplacian( sol ) = rhs with periodic boundary conditions. This will be generalized at a later time to include non-periodic BC, and other differential equations. Assemble matrix
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(hypre_obj), | intent(inout) | :: | this |
Hypre machinery |
impure subroutine hypre_obj_SetupMatrixS(this) !> Sets up and builds the matrix. ! ! Currently, assuming that we are solving ! laplacian( sol ) = rhs ! with periodic boundary conditions. ! This will be generalized at a later time to include ! non-periodic BC, and other differential equations. implicit none class(hypre_obj), intent(inout) :: this !! Hypre machinery ! Work variables integer :: ierr ! Create an empty matrix object call HYPRE_StructMatrixCreate(this%comm,this%grid,this%stencil,this%matrix,ierr) ! initialize matrix (indicates the matrix coefficients are ready to be set) call HYPRE_StructMatrixInitialize(this%matrix,ierr) ! Now build the matrix of coefficients call hypre_obj_BuildMatrixS(this) !! Assemble matrix call HYPRE_StructMatrixAssemble(this%matrix,ierr) !call HYPRE_StructMatrixPrint("mat",this%matrix,ierr) !call hypre_obj_PrintMatrixS(this) return end subroutine hypre_obj_SetupMatrixS