11 public :: hecmwst_mf_graph
20 integer(kind=kint) :: nnode = 0
21 integer(kind=kint),
allocatable :: ndof(:)
22 integer(kind=kint),
allocatable :: dofptr(:)
23 integer(kind=kint),
allocatable :: xadj(:)
24 integer(kind=kint),
allocatable :: adjncy(:)
25 end type hecmwst_mf_graph
35 type(hecmwst_mf_graph),
intent(out) :: graph
36 integer(kind=kint) :: n, i, k, l
40 allocate(graph%ndof(n))
41 allocate(graph%dofptr(n+1))
42 allocate(graph%xadj(n+1))
43 graph%ndof(1:n) = hecmat%NDOF
47 graph%dofptr(i+1) = graph%dofptr(i) + graph%ndof(i)
48 graph%xadj(i+1) = graph%xadj(i) &
49 + (hecmat%indexL(i) - hecmat%indexL(i-1)) + (hecmat%indexU(i) - hecmat%indexU(i-1))
51 allocate(graph%adjncy(graph%xadj(n+1)-1))
54 do k = hecmat%indexL(i-1)+1, hecmat%indexL(i)
56 graph%adjncy(l) = hecmat%itemL(k)
58 do k = hecmat%indexU(i-1)+1, hecmat%indexU(i)
60 graph%adjncy(l) = hecmat%itemU(k)
68 type(hecmwst_mf_graph),
intent(out) :: graph
69 integer(kind=kint),
intent(in) :: nnode
70 integer(kind=kint),
intent(in) :: ndof(:)
71 integer(kind=kint),
intent(in) :: xadj(:)
72 integer(kind=kint),
intent(in) :: adjncy(:)
73 integer(kind=kint) :: i
76 allocate(graph%ndof(nnode))
77 allocate(graph%dofptr(nnode+1))
78 allocate(graph%xadj(nnode+1))
79 allocate(graph%adjncy(xadj(nnode+1)-1))
80 graph%ndof(1:nnode) = ndof(1:nnode)
83 graph%dofptr(i+1) = graph%dofptr(i) + graph%ndof(i)
85 graph%xadj(1:nnode+1) = xadj(1:nnode+1)
86 graph%adjncy(1:xadj(nnode+1)-1) = adjncy(1:xadj(nnode+1)-1)
91 type(hecmwst_mf_graph),
intent(inout) :: graph
94 if (
allocated(graph%ndof))
deallocate(graph%ndof)
95 if (
allocated(graph%dofptr))
deallocate(graph%dofptr)
96 if (
allocated(graph%xadj))
deallocate(graph%xadj)
97 if (
allocated(graph%adjncy))
deallocate(graph%adjncy)
Compressed (node level) graph of a block sparse matrix for the multifrontal solver.
subroutine, public hecmw_mf_graph_from_hecmat(hecMAT, graph)
Build the node graph from the nonzero pattern of hecMAT (values are not referenced)....
subroutine, public hecmw_mf_graph_finalize(graph)
subroutine, public hecmw_mf_graph_set(graph, nnode, ndof, xadj, adjncy)
Build the node graph from explicit arrays (synthetic graphs in tests).