37 type(hecmwst_saamg_bcsr),
intent(out) :: a
38 logical,
optional,
intent(in) :: include_halo
39 integer(kind=kint) :: ndof, ndof2, nnode, ncolnode, i, ii, kk, j, jn, pos, cnt, b0, astat
43 if (
present(include_halo)) halo = include_halo
59 a%n = nnode*ndof; a%ncol = ncolnode*ndof; a%nb = ndof; a%mb = ndof
60 a%nbrow = nnode; a%nbcol = ncolnode
61 allocate(a%browptr(nnode+1))
67 do j = hecmat%indexL(i-1)+1, hecmat%indexL(i)
68 if (halo .or. hecmat%itemL(j) <= nnode) cnt = cnt + 1
70 do j = hecmat%indexU(i-1)+1, hecmat%indexU(i)
71 if (halo .or. hecmat%itemU(j) <= nnode) cnt = cnt + 1
73 a%browptr(i+1) = a%browptr(i) + cnt
75 a%nnzb = a%browptr(nnode+1) - 1
76 a%nnz = ndof2 * a%nnzb
77 allocate(a%bcol(a%nnzb), a%bval(ndof2*a%nnzb), stat=astat)
83 a%bcol(pos) = i; b0 = (pos-1)*ndof2
86 a%bval(b0 + (kk-1)*ndof+ii) = hecmat%D(ndof2*(i-1) + (ii-1)*ndof + kk)
90 do j = hecmat%indexL(i-1)+1, hecmat%indexL(i)
92 if (.not. halo .and. jn > nnode) cycle
93 a%bcol(pos) = jn; b0 = (pos-1)*ndof2
96 a%bval(b0 + (kk-1)*ndof+ii) = hecmat%AL(ndof2*(j-1) + (ii-1)*ndof + kk)
101 do j = hecmat%indexU(i-1)+1, hecmat%indexU(i)
103 if (.not. halo .and. jn > nnode) cycle
104 a%bcol(pos) = jn; b0 = (pos-1)*ndof2
107 a%bval(b0 + (kk-1)*ndof+ii) = hecmat%AU(ndof2*(j-1) + (ii-1)*ndof + kk)
121 integer(kind=kint),
intent(in) :: ndof
122 type(hecmwst_saamg_comm),
intent(out) :: cmt
123 integer(kind=kint) :: nnb, nimp, nexp
126 cmt%comm = hecmesh%MPI_COMM
127 cmt%my_rank = hecmesh%my_rank
128 cmt%nint = hecmesh%nn_internal
129 cmt%nnode = hecmesh%n_node
131 cmt%n_neighbor = hecmesh%n_neighbor_pe
133 allocate(cmt%gnode(hecmesh%n_node))
134 cmt%gnode(1:hecmesh%n_node) = hecmesh%global_node_ID(1:hecmesh%n_node)
138 nimp = hecmesh%import_index(nnb)
139 nexp = hecmesh%export_index(nnb)
140 allocate(cmt%neighbor(nnb))
141 allocate(cmt%import_index(0:nnb), cmt%import_item(nimp))
142 allocate(cmt%export_index(0:nnb), cmt%export_item(nexp))
143 cmt%neighbor(1:nnb) = hecmesh%neighbor_pe(1:nnb)
144 cmt%import_index(0:nnb) = hecmesh%import_index(0:nnb)
145 cmt%export_index(0:nnb) = hecmesh%export_index(0:nnb)
146 if (nimp > 0) cmt%import_item(1:nimp) = hecmesh%import_item(1:nimp)
147 if (nexp > 0) cmt%export_item(1:nexp) = hecmesh%export_item(1:nexp)
Smoothed Aggregation AMG preconditioner : FrontISTR adapter.
subroutine, public hecmw_saamg_from_hecmat(hecMAT, A, include_halo)
Convert hecmwST_matrix (FrontISTR block storage) -> internal block-CSR. Rows are always internal only...
subroutine, public hecmw_saamg_comm_from_mesh(hecMESH, ndof, cmt)
Build the finest-level communication table from the FrontISTR mesh. Copies the node-based halo descri...
Smoothed Aggregation AMG preconditioner : lightweight comm table.
subroutine, public hecmw_saamg_check_alloc(ier, what)
Report a failed allocation (stat /= 0) with a clear message and a collective abort,...
subroutine, public hecmw_saamg_comm_free(cmt)
Smoothed Aggregation AMG preconditioner : internal block-CSR matrix.
subroutine, public hecmw_saamg_bcsr_free(A)
Release the storage held by a hecmwST_saamg_bcsr.