27 type (sparse_matrix),
intent(inout) :: spmat
30 integer(kind=kint) :: ndof, ndof2, n_loc, nl, nu, nz
31 ndof=hecmat%NDOF; ndof2=ndof*ndof
34 nu=hecmat%indexU(hecmat%N)
35 nz=hecmat%N*(ndof2+ndof)/2+nu*ndof2
37 nl=hecmat%indexL(hecmat%N)
38 nu=hecmat%indexU(hecmat%N)
39 nz=(hecmat%N+nu+nl)*ndof2
43 spmat%iterlog = hecmat%Iarray(21)
44 spmat%timelog = hecmat%Iarray(22)
49 type(sparse_matrix),
intent(inout) :: spmat
51 integer(kind=kint),
intent(in) :: ndof
52 integer(kind=kint) :: i,j,nn_external,id,ierr
53 integer(kint) :: pid,lid,j0
54 if (hecmesh%n_neighbor_pe==0)
return
56 nn_external = hecmesh%n_node - hecmesh%nn_internal
57 allocate(spmat%conv_ext(nn_external*ndof), stat=ierr)
59 write(*,*)
" Allocation error, spMAT%conv_ext"
62 spmat%conv_ext(:) = -1
64 id = i + hecmesh%nn_internal
65 pid = hecmesh%node_ID(id*2)
66 lid = hecmesh%node_ID(id*2-1)
67 j0 = spmat%DISPLS(pid+1) + (lid-1)*ndof
69 spmat%conv_ext((i-1)*ndof+j) = j0+j
75 type(sparse_matrix),
intent(inout) :: spmat
77 integer(kind=kint) :: ndof, ndof2
78 integer(kind=kint) :: m, i, idof, i0, ii, ls, le, l, j, j0, jdof, jdofs
81 ndof=hecmat%NDOF; ndof2=ndof*ndof
86 i0=spmat%offset+ndof*(i-1)
91 ls=hecmat%indexL(i-1)+1
96 j0=spmat%offset+ndof*(j-1)
119 ls=hecmat%indexU(i-1)+1
123 if (j <= hecmat%N)
then
124 j0=spmat%offset+ndof*(j-1)
126 j0=spmat%conv_ext(ndof*(j-hecmat%N))-ndof
141 if (m-1 /= spmat%NZ)
then
143 write(*,*)
'm-1 = ',m-1,
', NZ=',spmat%NZ
149 type(sparse_matrix),
intent(inout) :: spmat
151 integer(kind=kint) :: ndof, ndof2
152 integer(kind=kint) :: m, i, idof, i0, ii, ls, le, l, j, j0, jdof, jdofs
153 integer(kind=kint) :: offset_l, offset_d, offset_u
154 ndof=hecmat%NDOF; ndof2=ndof*ndof
159 i0=spmat%offset+ndof*(i-1)
162 if (spmat%IRN(ii-spmat%offset)/=m) stop
"ERROR: sparse_matrix_set_a1"
166 ls=hecmat%indexL(i-1)+1
171 j0=spmat%offset+ndof*(j-1)
175 offset_l=ndof2*(l-1)+ndof*(idof-1)
178 if (spmat%IRN(m)/=ii) stop
"ERROR: sparse_matrix_set_a2"
181 if (spmat%JCN(m)/=j0+jdof) stop
"ERROR: sparse_matrix_set_a3"
182 spmat%A(m)=hecmat%AL(offset_l+jdof)
188 offset_d=ndof2*(i-1)+ndof*(idof-1)
192 if (spmat%IRN(m)/=ii) stop
"ERROR: sparse_matrix_set_a4"
195 if (spmat%JCN(m)/=i0+jdof) stop
"ERROR: sparse_matrix_set_a5"
196 spmat%A(m)=hecmat%D(offset_d+jdof)
200 ls=hecmat%indexU(i-1)+1
204 if (j <= hecmat%N)
then
205 j0=spmat%offset+ndof*(j-1)
207 j0=spmat%conv_ext(ndof*(j-hecmat%N))-ndof
210 offset_u=ndof2*(l-1)+ndof*(idof-1)
213 if (spmat%IRN(m)/=ii) stop
"ERROR: sparse_matrix_set_a6"
216 if (spmat%JCN(m)/=j0+jdof) stop
"ERROR: sparse_matrix_set_a7"
217 spmat%A(m)=hecmat%AU(offset_u+jdof)
224 if (spmat%IRN(ii+1-spmat%offset)/=m) stop
"ERROR: sparse_matrix_set_a8"
226 if (m-1 /= spmat%NZ) stop
"ERROR: sparse_matrix_set_a9"
231 type (sparse_matrix),
intent(inout) :: spmat
233 integer(kind=kint) :: ierr,i
234 allocate(spmat%rhs(spmat%N_loc), stat=ierr)
236 write(*,*)
" Allocation error, spMAT%rhs"
240 spmat%rhs(i)=hecmat%b(i)
246 type (sparse_matrix),
intent(inout) :: spmat
248 integer(kind=kint) :: i
250 hecmat%x(i)=spmat%rhs(i)
252 deallocate(spmat%rhs)