24 logical,
save :: INITIALIZED = .false.
25 integer,
save :: SymType = 0
27 integer,
parameter :: DEBUG = 0
28 logical,
parameter :: DEBUG_VECTOR = .false.
29 logical,
parameter :: DEBUG_MATRIX = .false.
37 logical,
intent(in) :: is_sym
59 integer(kind=kint),
intent(out) :: istat
61 logical,
intent(in) :: is_contact_active
63 integer(kind=kint) :: solver_type, method_org
64 integer(kind=kint) :: is_contact
65 integer(kind=kint) :: myrank
72 if (is_contact_active) is_contact = 1
75 if (is_contact == 0)
then
76 if ((debug >= 1 .and. myrank==0) .or. debug >= 2)
write(0,*)
'DEBUG: no contact'
78 if (solver_type == 1)
then
84 call solve_with_mpc(hecmesh, hecmat)
85 if (solver_type == 1)
then
90 if ((debug >= 1 .and. myrank==0) .or. debug >= 2)
write(0,*)
'DEBUG: with contact'
91 call solve_eliminate(hecmesh, hecmat, heclagmat, conmat)
97 subroutine solve_with_mpc(hecMESH, hecMAT)
103 integer(kind=kint) :: method
104 logical :: fg_cg, fg_amg
116 hecmatmpc%Iarray(97:98) = 1
117 hecmatmpc%X(:) = 0.d0
123 end subroutine solve_with_mpc
127 subroutine solve_eliminate(hecMESH,hecMAT,hecLagMAT,conMAT)
136 integer(kind=kint),
allocatable :: slaves4lag(:)
137 real(kind=
kreal),
allocatable :: bls_inv(:)
138 real(kind=
kreal),
allocatable :: bus_inv(:)
139 type(hecmwst_local_matrix) :: tmat
140 type(hecmwst_local_matrix) :: ttmat
141 integer(kind=kint),
allocatable :: slaves(:)
142 type(hecmwst_contact_comm) :: concomm
143 type(hecmwst_local_matrix) :: kmat
144 real(kind=
kreal),
allocatable :: btot(:)
146 integer(kind=kint) :: ndof
147 integer(kind=kint) :: myrank
148 real(kind=
kreal) :: t0, t1, t2
152 if ((debug >= 1 .and. myrank==0) .or. debug >= 2)
write(0,*)
'DEBUG: solve_eliminate start'
156 if (debug >= 2)
write(0,*)
' DEBUG2[',myrank,
']: num_lagrange',heclagmat%num_lagrange
158 call copy_mesh(hecmesh, hecmeshtmp)
160 allocate(slaves4lag(heclagmat%num_lagrange), bls_inv(heclagmat%num_lagrange), &
161 bus_inv(heclagmat%num_lagrange))
164 call make_transformation_matrices(hecmesh, hecmeshtmp, hecmat, heclagmat, &
165 slaves4lag, bls_inv, bus_inv, slaves, tmat, ttmat)
167 if ((debug >= 1 .and. myrank==0) .or. debug >= 2)
write(0,*)
'DEBUG: made trans matrices', t2-t1
170 call make_contact_comm_table(hecmesh, hecmat, heclagmat, concomm)
172 if (debug >= 2)
write(0,*)
' DEBUG2: make contact comm_table done',
hecmw_wtime()-t1
175 allocate(btot(hecmat%NP*ndof+heclagmat%num_lagrange))
176 call assemble_equation(hecmesh, hecmeshtmp, hecmat, conmat, heclagmat%num_lagrange, &
179 if ((debug >= 1 .and. myrank==0) .or. debug >= 2)
write(0,*)
'DEBUG: assembled equation ', t2-t1
182 if (kmat%nc /= ttmat%nc)
then
183 if (debug >= 2)
write(0,*)
' DEBUG2[',myrank,
']: node migrated with Kmat',kmat%nc-ttmat%nc
190 call convert_equation(hecmeshtmp, hecmat, kmat, tmat, ttmat, btot, slaves, &
191 slaves4lag, bls_inv, concomm, hectkt)
193 if ((debug >= 1 .and. myrank==0) .or. debug >= 2)
write(0,*)
'DEBUG: converted equation ', t2-t1
196 call solve_with_mpc(hecmeshtmp, hectkt)
197 if (debug_vector)
call debug_write_vector(hectkt%X,
'Solution(converted)',
'hecTKT%X', ndof, hectkt%N)
199 if ((debug >= 1 .and. myrank==0) .or. debug >= 2)
write(0,*)
'DEBUG: linear solver done ', t2-t1
202 call recover_solution(hecmeshtmp, hecmat, hectkt, tmat, kmat, btot, &
203 slaves4lag, bls_inv, bus_inv, concomm, slaves)
205 if ((debug >= 1 .and. myrank==0) .or. debug >= 2)
write(0,*)
'DEBUG: recovered solution ', t2-t1
207 if (debug >= 1)
call check_solution(hecmesh, hecmeshtmp, hecmat, hectkt, heclagmat, kmat, btot, &
209 if (debug >= 2)
call check_solution2(hecmesh, hecmat, conmat, heclagmat, concomm, slaves)
216 call free_mesh(hecmeshtmp)
217 deallocate(slaves4lag)
219 if ((debug >= 1 .and. myrank==0) .or. debug >= 2)
write(0,*)
'DEBUG: solve_eliminate end', t2-t0
220 end subroutine solve_eliminate
224 subroutine copy_mesh(src, dst)
229 dst%MPI_COMM = src%MPI_COMM
230 dst%PETOT = src%PETOT
231 dst%PEsmpTOT = src%PEsmpTOT
232 dst%my_rank = src%my_rank
233 dst%n_subdomain = src%n_subdomain
234 dst%n_node = src%n_node
235 dst%nn_internal = src%nn_internal
236 dst%n_elem = src%n_elem
237 dst%ne_internal = src%ne_internal
238 dst%n_elem_type = src%n_elem_type
239 dst%n_dof = src%n_dof
240 dst%n_neighbor_pe = src%n_neighbor_pe
241 if (src%n_neighbor_pe > 0)
then
242 allocate(dst%neighbor_pe(dst%n_neighbor_pe))
243 dst%neighbor_pe(:) = src%neighbor_pe(:)
244 allocate(dst%import_index(0:dst%n_neighbor_pe))
245 dst%import_index(:)= src%import_index(:)
246 allocate(dst%export_index(0:dst%n_neighbor_pe))
247 dst%export_index(:)= src%export_index(:)
248 allocate(dst%import_item(dst%import_index(dst%n_neighbor_pe)))
249 dst%import_item(1:dst%import_index(dst%n_neighbor_pe)) = src%import_item(1:dst%import_index(dst%n_neighbor_pe))
250 allocate(dst%export_item(dst%export_index(dst%n_neighbor_pe)))
251 dst%export_item(1:dst%export_index(dst%n_neighbor_pe)) = src%export_item(1:dst%export_index(dst%n_neighbor_pe))
253 dst%neighbor_pe => null()
254 dst%import_index => null()
255 dst%export_index => null()
256 dst%import_item => null()
257 dst%export_item => null()
259 allocate(dst%global_node_ID(dst%n_node))
260 dst%global_node_ID(1:dst%n_node) = src%global_node_ID(1:dst%n_node)
261 allocate(dst%node_ID(2*dst%n_node))
262 dst%node_ID(1:2*dst%n_node) = src%node_ID(1:2*dst%n_node)
263 allocate(dst%elem_type_item(dst%n_elem_type))
264 dst%elem_type_item(:) = src%elem_type_item(:)
266 dst%mpc%n_mpc = src%mpc%n_mpc
267 dst%mpc%mpc_index => src%mpc%mpc_index
268 dst%mpc%mpc_item => src%mpc%mpc_item
269 dst%mpc%mpc_dof => src%mpc%mpc_dof
270 dst%mpc%mpc_val => src%mpc%mpc_val
271 dst%mpc%mpc_const => src%mpc%mpc_const
273 dst%node_group%n_grp = src%node_group%n_grp
274 dst%node_group%n_bc = src%node_group%n_bc
275 dst%node_group%grp_name => src%node_group%grp_name
276 dst%node_group%grp_index => src%node_group%grp_index
277 dst%node_group%grp_item => src%node_group%grp_item
278 dst%node_group%bc_grp_ID => src%node_group%bc_grp_ID
279 dst%node_group%bc_grp_type => src%node_group%bc_grp_type
280 dst%node_group%bc_grp_index => src%node_group%bc_grp_index
281 dst%node_group%bc_grp_dof => src%node_group%bc_grp_dof
282 dst%node_group%bc_grp_val => src%node_group%bc_grp_val
285 end subroutine copy_mesh
289 subroutine free_mesh(hecMESH)
292 if (hecmesh%n_neighbor_pe > 0)
then
293 deallocate(hecmesh%neighbor_pe)
294 deallocate(hecmesh%import_index)
295 deallocate(hecmesh%export_index)
296 deallocate(hecmesh%import_item)
297 deallocate(hecmesh%export_item)
298 deallocate(hecmesh%global_node_ID)
300 deallocate(hecmesh%node_ID)
301 deallocate(hecmesh%elem_type_item)
303 end subroutine free_mesh
307 subroutine make_transformation_matrices(hecMESH, hecMESHtmp, hecMAT, hecLagMAT, &
308 slaves4lag, BLs_inv, BUs_inv, slaves, Tmat, Ttmat)
313 integer(kind=kint),
intent(out) :: slaves4lag(:)
314 real(kind=
kreal),
intent(out) :: bls_inv(:)
315 real(kind=
kreal),
intent(out) :: bus_inv(:)
316 integer(kind=kint),
allocatable,
intent(out) :: slaves(:)
317 type(hecmwst_local_matrix),
intent(out) :: tmat
318 type(hecmwst_local_matrix),
intent(out) :: ttmat
320 integer(kind=kint) :: myrank, n
326 call choose_slaves(hecmat, heclagmat, n, slaves4lag)
327 if (debug >= 2)
write(0,*)
' DEBUG2[',myrank,
']: slave DOFs chosen'
329 call make_bls_inv(heclagmat, hecmat%NDOF, slaves4lag, bls_inv)
330 call make_bus_inv(heclagmat, hecmat%NDOF, slaves4lag, bus_inv)
332 call add_c_to_tmat(hecmat, heclagmat, n, slaves4lag, bls_inv, tmat)
333 if (debug_matrix)
call debug_write_matrix(tmat,
'Tmat (local, C only)')
334 if (debug >= 2)
write(0,*)
' DEBUG2[',myrank,
']: add C to Tmat done'
336 call add_ct_to_ttmat(hecmat, heclagmat, n, slaves4lag, bus_inv, ttmat)
337 if (debug_matrix)
call debug_write_matrix(ttmat,
'Ttmat (local, Ct only)')
338 if (debug >= 2)
write(0,*)
' DEBUG2[',myrank,
']: add Ct to Tt done'
344 write(0,*)
' DEBUG2[',myrank,
']: assemble T done'
345 if (tmat%nc /= hecmesh%n_node)
write(0,*)
' DEBUG2[',myrank,
']: node migrated with T',tmat%nc-hecmesh%n_node
347 if (debug_matrix)
call debug_write_matrix(tmat,
'Tmat (assembled, C only)')
352 write(0,*)
' DEBUG2[',myrank,
']: assemble Tt done'
353 if (ttmat%nc /= tmat%nc)
write(0,*)
' DEBUG2[',myrank,
']: node migrated with Ttmat',ttmat%nc-tmat%nc
356 if (debug_matrix)
call debug_write_matrix(ttmat,
'Ttmat (assembled, Ct only)')
360 call make_slave_list(hecmeshtmp, tmat%ndof, slaves4lag, slaves)
361 call add_ip_to_tmat(tmat, slaves)
362 if (debug_matrix)
call debug_write_matrix(tmat,
'Tmat (final)')
363 call add_ip_to_tmat(ttmat, slaves)
364 if (debug_matrix)
call debug_write_matrix(ttmat,
'Ttmat (final)')
365 if (debug >= 2)
write(0,*)
' DEBUG2[',myrank,
']: place 1 on diag of T and Tt done'
366 end subroutine make_transformation_matrices
370 subroutine choose_slaves(hecMAT, hecLagMAT, n, slaves4lag)
373 integer(kind=kint),
intent(in) :: n
374 integer(kind=kint),
intent(out) :: slaves4lag(:)
376 integer(kind=kint) :: ndof, i, j, idof, jdof, l, ls, le, idx, imax, iwmin
377 real(kind=
kreal) :: val, vmax
378 integer(kind=kint),
allocatable :: mark_slave4lag(:)
379 integer(kind=kint),
allocatable :: iw1l(:), iw1u(:)
380 integer(kind=kint) :: n_slave_in, n_slave_out, ilag
381 integer(kind=kint) :: myrank
386 allocate(mark_slave4lag(n*ndof), source=0)
389 if (heclagmat%num_lagrange == 0)
return
391 allocate(iw1l(n*ndof))
392 allocate(iw1u(n*ndof))
398 do i=1,heclagmat%num_lagrange
399 ls=heclagmat%indexL_lagrange(i-1)+1
400 le=heclagmat%indexL_lagrange(i)
402 j=heclagmat%itemL_lagrange(l)
405 iw1l(idx)=iw1l(idx)+1
411 ls=heclagmat%indexU_lagrange(i-1)+1
412 le=heclagmat%indexU_lagrange(i)
414 j=heclagmat%itemU_lagrange(l)
417 iw1u(idx)=iw1u(idx)+1
429 do i=1,heclagmat%num_lagrange
430 ls=heclagmat%indexL_lagrange(i-1)+1
431 le=heclagmat%indexL_lagrange(i)
436 j=heclagmat%itemL_lagrange(l)
439 val=heclagmat%AL_lagrange((l-1)*ndof+jdof)
440 if (iw1l(idx) < iwmin .and. iw1u(idx) < iwmin)
then
441 iwmin = min(iw1l(idx),iw1u(idx))
444 if (iw1l(idx) == iwmin .and. iw1u(idx) == iwmin)
then
445 if (abs(val) > abs(vmax))
then
452 if (imax == -1) stop
"ERROR: iterative solver for contact failed"
453 mark_slave4lag(imax)=i
465 do ilag=1,heclagmat%num_lagrange
467 if (0 < i .and. i <= hecmat%N*ndof)
then
468 n_slave_in = n_slave_in + 1
469 elseif (hecmat%N*ndof < i .and. i <= hecmat%NP*ndof)
then
470 n_slave_out = n_slave_out + 1
473 write(0,*)
' DEBUG2[',myrank,
']: n_slave(in,out,tot)',n_slave_in,n_slave_out,heclagmat%num_lagrange
476 deallocate(mark_slave4lag)
477 deallocate(iw1l, iw1u)
478 end subroutine choose_slaves
482 subroutine make_bls_inv(hecLagMAT, ndof, slaves4lag, BLs_inv)
484 integer(kind=kint),
intent(in) :: ndof
485 integer(kind=kint),
intent(in) :: slaves4lag(:)
486 real(kind=
kreal),
intent(out) :: bls_inv(:)
488 integer(kind=kint) :: ilag, ls, le, l, j, jdof, idx
490 if (heclagmat%num_lagrange == 0)
return
493 do ilag=1,heclagmat%num_lagrange
494 ls=heclagmat%indexL_lagrange(ilag-1)+1
495 le=heclagmat%indexL_lagrange(ilag)
497 j=heclagmat%itemL_lagrange(l)
500 if (idx==slaves4lag(ilag))
then
501 bls_inv(ilag) = 1.0d0/heclagmat%AL_lagrange((l-1)*ndof+jdof)
508 end subroutine make_bls_inv
512 subroutine make_bus_inv(hecLagMAT, ndof, slaves4lag, BUs_inv)
514 integer(kind=kint),
intent(in) :: ndof
515 integer(kind=kint),
intent(in) :: slaves4lag(:)
516 real(kind=
kreal),
intent(out) :: bus_inv(:)
518 integer(kind=kint) :: ilag, i, idof, js, je, j, k
520 if (heclagmat%num_lagrange == 0)
return
523 do ilag=1,
size(slaves4lag)
524 i=(slaves4lag(ilag)+ndof-1)/ndof
525 idof=slaves4lag(ilag)-(i-1)*ndof
526 js=heclagmat%indexU_lagrange(i-1)+1
527 je=heclagmat%indexU_lagrange(i)
529 k=heclagmat%itemU_lagrange(j)
531 bus_inv(ilag) = 1.0d0/heclagmat%AU_lagrange((j-1)*ndof+idof)
537 end subroutine make_bus_inv
541 subroutine add_c_to_tmat(hecMAT, hecLagMAT, n, slaves4lag, BLs_inv, Tmat)
544 integer(kind=kint),
intent(in) :: n
545 integer(kind=kint),
intent(in) :: slaves4lag(:)
546 real(kind=
kreal),
intent(in) :: bls_inv(:)
547 type(hecmwst_local_matrix),
intent(out) :: tmat
549 type(hecmwst_local_matrix) :: tmat11
550 integer(kind=kint),
allocatable :: nz_cnt(:)
551 integer(kind=kint) :: ndof, i, ilag, l, js, je, j, k, jdof, kk, jj
552 real(kind=
kreal) :: factor
557 tmat11%nnz=heclagmat%numL_lagrange*ndof-heclagmat%num_lagrange
560 allocate(tmat11%index(0:tmat11%nr))
561 allocate(tmat11%item(tmat11%nnz), tmat11%A(tmat11%nnz))
562 allocate(nz_cnt(tmat11%nr), source=0)
564 do ilag=1,
size(slaves4lag)
565 nz_cnt(slaves4lag(ilag))=ndof*(heclagmat%indexL_lagrange(ilag)-heclagmat%indexL_lagrange(ilag-1))-1
569 tmat11%index(i)=tmat11%index(i-1)+nz_cnt(i)
572 if (tmat11%nnz /= tmat11%index(tmat11%nr))
then
573 write(0,*) tmat11%nnz, tmat11%index(tmat11%nr)
574 tmat11%nnz = tmat11%index(tmat11%nr)
578 do ilag=1,
size(slaves4lag)
580 l=tmat11%index(i-1)+1
581 js=heclagmat%indexL_lagrange(ilag-1)+1
582 je=heclagmat%indexL_lagrange(ilag)
583 factor=-bls_inv(ilag)
585 k=heclagmat%itemL_lagrange(j)
591 tmat11%A(l)=heclagmat%AL_lagrange(jj)*factor
595 if (l /= tmat11%index(i)+1)
then
596 write(0,*) l, tmat11%index(i)+1
597 stop
'ERROR: Tmat11%index wrong'
604 end subroutine add_c_to_tmat
608 subroutine add_ct_to_ttmat(hecMAT, hecLagMAT, n, slaves4lag, BUs_inv, Ttmat)
611 integer(kind=kint),
intent(in) :: n
612 integer(kind=kint),
intent(in) :: slaves4lag(:)
613 real(kind=
kreal),
intent(in) :: bus_inv(:)
614 type(hecmwst_local_matrix),
intent(out) :: ttmat
616 type(hecmwst_local_matrix) :: ttmat11
617 integer(kind=kint),
allocatable :: nz_cnt(:)
618 integer(kind=kint) :: ndof, i, idof, idx, ilag, l, js, je, j, k
622 ttmat11%nc=ttmat11%nr
623 ttmat11%nnz=heclagmat%numU_lagrange*ndof-heclagmat%num_lagrange
626 allocate(ttmat11%index(0:ttmat11%nr))
627 allocate(ttmat11%item(ttmat11%nnz), ttmat11%A(ttmat11%nnz))
628 allocate(nz_cnt(ttmat11%nr), source=0)
630 if (heclagmat%num_lagrange > 0)
then
634 nz_cnt(idx)=heclagmat%indexU_lagrange(i)-heclagmat%indexU_lagrange(i-1)
637 do ilag=1,
size(slaves4lag)
638 nz_cnt(slaves4lag(ilag))=0
643 ttmat11%index(i)=ttmat11%index(i-1)+nz_cnt(i)
645 if (ttmat11%nnz /= ttmat11%index(ttmat11%nr))
then
646 write(0,*) ttmat11%nnz, ttmat11%index(ttmat11%nr)
648 ttmat11%nnz = ttmat11%index(ttmat11%nr)
654 l=ttmat11%index(idx-1)+1
655 if (nz_cnt(idx) > 0)
then
657 js=heclagmat%indexU_lagrange(i-1)+1
658 je=heclagmat%indexU_lagrange(i)
660 k=heclagmat%itemU_lagrange(j)
661 ttmat11%item(l)=slaves4lag(k)
662 ttmat11%A(l)=-heclagmat%AU_lagrange((j-1)*ndof+idof)*bus_inv(k)
666 if (l /= ttmat11%index(idx)+1)
then
667 write(0,*) l, ttmat11%index(idx)+1
668 stop
'ERROR: Ttmat11%index wrong'
677 end subroutine add_ct_to_ttmat
681 subroutine make_slave_list(hecMESHtmp, ndof, slaves4lag, slaves)
683 integer(kind=kint),
intent(in) :: ndof
684 integer(kind=kint),
intent(in) :: slaves4lag(:)
685 integer(kind=kint),
allocatable,
intent(out) :: slaves(:)
687 integer(kind=kint),
allocatable :: mark_slave(:)
688 integer(kind=kint) :: n_slave
689 integer(kind=kint) :: ilag, i
690 integer(kind=kint) :: myrank
693 allocate(mark_slave(hecmeshtmp%n_node*ndof), source=0)
694 do ilag=1,
size(slaves4lag)
695 mark_slave(slaves4lag(ilag))=1
699 do i = 1, hecmeshtmp%nn_internal * ndof
700 if (mark_slave(i) /= 0) n_slave = n_slave + 1
702 if (debug >= 2)
write(0,*)
' DEBUG2[',myrank,
']: n_slave',n_slave
703 allocate(slaves(n_slave))
705 do i = 1, hecmeshtmp%nn_internal * ndof
706 if (mark_slave(i) /= 0)
then
707 n_slave = n_slave + 1
711 if (debug >= 3)
write(0,*)
' DEBUG3[',myrank,
']: slaves',slaves(:)
712 deallocate(mark_slave)
713 end subroutine make_slave_list
717 subroutine add_ip_to_tmat(Tmat, slaves)
718 type(hecmwst_local_matrix),
intent(inout) :: tmat
719 integer(kind=kint),
intent(in) :: slaves(:)
721 type(hecmwst_local_matrix) :: imat, wmat
722 integer(kind=kint) :: ndof, ndof2, i, irow, idof
731 allocate(imat%index(0:imat%nr))
732 allocate(imat%item(imat%nnz))
738 allocate(imat%A(ndof2 * imat%nnz))
742 imat%A(ndof2*(irow-1)+ndof*(idof-1)+idof) = 1.0d0
745 do i = 1,
size(slaves)
746 irow = (slaves(i)+ndof-1)/ndof
747 idof = slaves(i)-ndof*(irow-1)
748 imat%A(ndof2*(irow-1)+ndof*(idof-1)+idof) = 0.0d0
756 tmat%ndof = wmat%ndof
757 tmat%index => wmat%index
758 tmat%item => wmat%item
760 end subroutine add_ip_to_tmat
764 subroutine make_contact_comm_table(hecMESH, hecMAT, hecLagMAT, conCOMM)
768 type(hecmwst_contact_comm),
intent(out) :: concomm
770 integer(kind=kint) :: n_contact_dof
771 integer(kind=kint),
allocatable :: contact_dofs(:)
774 call make_contact_dof_list(hecmat, heclagmat, n_contact_dof, contact_dofs)
778 end subroutine make_contact_comm_table
782 subroutine make_contact_dof_list(hecMAT, hecLagMAT, n_contact_dof, contact_dofs)
785 integer(kind=kint),
intent(out) :: n_contact_dof
786 integer(kind=kint),
allocatable,
intent(out) :: contact_dofs(:)
788 integer(kind=kint) :: ndof, icnt, ilag, ls, le, l, jnode, k, inode, idof, i
789 integer(kind=kint),
allocatable :: iw(:)
791 integer(kind=kint) :: myrank
793 if (heclagmat%num_lagrange == 0)
then
799 allocate(iw(hecmat%NP))
801 do ilag = 1, heclagmat%num_lagrange
802 ls = heclagmat%indexL_lagrange(ilag-1)+1
803 le = heclagmat%indexL_lagrange(ilag)
804 lloop1:
do l = ls, le
805 jnode = heclagmat%itemL_lagrange(l)
807 if (iw(k) == jnode) cycle lloop1
814 do inode = 1, hecmat%NP
815 ls = heclagmat%indexU_lagrange(inode-1)+1
816 le = heclagmat%indexU_lagrange(inode)
820 if (iw(k) == inode) found = .true.
822 if (.not. found)
then
828 call quick_sort(iw, 1, icnt)
829 allocate(contact_dofs(icnt*ndof))
832 contact_dofs((i-1)*ndof+idof) = (iw(i)-1)*ndof+idof
835 n_contact_dof = icnt*ndof
838 if (debug >= 2)
write(0,*)
' DEBUG2[',myrank,
']: n_contact_dof',n_contact_dof
839 if (debug >= 3)
write(0,*)
' DEBUG3[',myrank,
']: contact_dofs',contact_dofs(:)
840 end subroutine make_contact_dof_list
844 recursive subroutine quick_sort(array, id1, id2)
845 integer(kind=kint),
intent(inout) :: array(:)
846 integer(kind=kint),
intent(in) :: id1, id2
848 integer(kind=kint) :: pivot, center, left, right, tmp
850 if (id1 >= id2)
return
851 center = (id1 + id2) / 2
852 pivot = array(center)
856 do while (array(left) < pivot)
859 do while (pivot < array(right))
862 if (left >= right)
exit
864 array(left) = array(right)
869 if (id1 < left-1)
call quick_sort(array, id1, left-1)
870 if (right+1 < id2)
call quick_sort(array, right+1, id2)
872 end subroutine quick_sort
876 subroutine assemble_equation(hecMESH, hecMESHtmp, hecMAT, conMAT, num_lagrange, &
882 integer(kind=kint),
intent(in) :: num_lagrange
883 integer(kind=kint),
intent(in) :: slaves(:)
885 type(hecmwst_local_matrix),
intent(out) :: kmat
886 real(kind=
kreal),
intent(out) :: btot(:)
888 integer(kind=kint) :: myrank
892 call assemble_matrix(hecmesh, hecmeshtmp, hecmat, conmat, num_lagrange, kmat)
893 if (debug >= 2)
write(0,*)
' DEBUG2[',myrank,
']: assemble matrix done'
895 call assemble_rhs(hecmesh, hecmat, conmat, num_lagrange, slaves, btot)
896 if (debug >= 2)
write(0,*)
' DEBUG2[',myrank,
']: assemble rhs done'
898 end subroutine assemble_equation
902 subroutine assemble_matrix(hecMESH, hecMESHtmp, hecMAT, conMAT, num_lagrange, Kmat)
907 integer(kind=kint),
intent(in) :: num_lagrange
908 type(hecmwst_local_matrix),
intent(out) :: kmat
910 integer(kind=kint) :: myrank
916 if (debug_matrix)
call debug_write_matrix(kmat,
'Kmat (conMAT local)')
921 if (debug_matrix)
call debug_write_matrix(kmat,
'Kmat (conMAT assembled)')
922 if (debug >= 3)
write(0,*)
' DEBUG3[',myrank,
']: assemble K (conMAT) done'
927 if (debug_matrix)
call debug_write_matrix(kmat,
'Kmat (hecMAT added)')
928 if (debug >= 3)
write(0,*)
' DEBUG3[',myrank,
']: add hecMAT to K done'
929 end subroutine assemble_matrix
933 subroutine assemble_rhs(hecMESH, hecMAT, conMAT, num_lagrange, slaves, Btot)
937 integer(kind=kint),
intent(in) :: num_lagrange
938 integer(kind=kint),
intent(in) :: slaves(:)
940 real(kind=
kreal),
intent(out) :: btot(:)
942 integer(kind=kint) :: ndof, nndof, npndof, i, myrank
947 npndof = hecmat%NP*ndof
948 nndof = hecmat%N *ndof
950 if (debug_vector)
call debug_write_vector(hecmat%B,
'RHS(hecMAT)',
'hecMAT%B', ndof, hecmat%N, &
951 hecmat%NP, .false., num_lagrange, slaves)
952 if (debug_vector)
call debug_write_vector(conmat%B,
'RHS(conMAT)',
'conMAT%B', ndof, conmat%N, &
953 conmat%NP, .true., num_lagrange, slaves)
955 do i=1,npndof+num_lagrange
956 btot(i) = conmat%B(i)
962 if (debug_vector)
call debug_write_vector(btot,
'RHS(conMAT assembled)',
'Btot', ndof, conmat%N, &
963 conmat%NP, .false., num_lagrange, slaves)
964 if (debug >= 3)
write(0,*)
' DEBUG3[',myrank,
']: assemble RHS (conMAT%B) done'
969 btot(i)=btot(i)+hecmat%B(i)
971 if (debug_vector)
call debug_write_vector(btot,
'RHS(total)',
'Btot', ndof, conmat%N, &
972 conmat%NP, .false., num_lagrange, slaves)
973 if (debug >= 3)
write(0,*)
' DEBUG3[',myrank,
']: add hecMAT%B to RHS done'
974 end subroutine assemble_rhs
978 subroutine convert_equation(hecMESHtmp, hecMAT, Kmat, Tmat, Ttmat, Btot, slaves, &
979 slaves4lag, BLs_inv, conCOMM, hecTKT)
982 type(hecmwst_local_matrix),
intent(inout) :: kmat
983 type(hecmwst_local_matrix),
intent(inout) :: tmat
984 type(hecmwst_local_matrix),
intent(in) :: ttmat
985 real(kind=
kreal),
intent(in) :: btot(:)
986 integer(kind=kint),
intent(in) :: slaves(:)
987 integer(kind=kint),
intent(in) :: slaves4lag(:)
988 real(kind=
kreal),
intent(in) :: bls_inv(:)
989 type(hecmwst_contact_comm),
intent(in) :: concomm
992 integer(kind=kint) :: myrank
996 call convert_matrix(hecmeshtmp, hecmat, ttmat, kmat, tmat, slaves, hectkt)
997 if (debug >= 2)
write(0,*)
' DEBUG2[',myrank,
']: converted matrix'
999 call convert_rhs(hecmeshtmp, hecmat, hectkt, ttmat, kmat, &
1000 slaves4lag, bls_inv, btot, concomm)
1001 if (debug >= 2)
write(0,*)
' DEBUG2[',myrank,
']: converted RHS'
1002 end subroutine convert_equation
1006 subroutine convert_matrix(hecMESHtmp, hecMAT, Ttmat, Kmat, Tmat, slaves, hecTKT)
1009 type(hecmwst_local_matrix),
intent(in) :: ttmat
1010 type(hecmwst_local_matrix),
intent(inout) :: kmat
1011 type(hecmwst_local_matrix),
intent(inout) :: tmat
1012 integer(kind=kint),
intent(in) :: slaves(:)
1015 type(hecmwst_local_matrix) :: ttkmat, ttktmat
1016 integer(kind=kint) :: myrank
1022 if (debug_matrix)
call debug_write_matrix(ttkmat,
'TtKmat')
1023 if (debug >= 3)
write(0,*)
' DEBUG3[',myrank,
']: multiply Tt and K done'
1027 if (debug_matrix)
call debug_write_matrix(ttktmat,
'TtKTmat')
1028 if (debug >= 3)
write(0,*)
' DEBUG3[',myrank,
']: multiply TtK and T done'
1034 call place_one_on_diag_of_slave_dof(ttktmat, slaves)
1035 if (debug_matrix)
call debug_write_matrix(ttktmat,
'TtKTmat (place 1.0 on slave diag)')
1039 if (debug >= 3)
write(0,*)
' DEBUG3[',myrank,
']: convert TtKT to hecTKT done'
1041 end subroutine convert_matrix
1045 subroutine place_one_on_diag_of_slave_dof(TtKTmat, slaves)
1046 type(hecmwst_local_matrix),
intent(inout) :: ttktmat
1047 integer(kind=kint),
intent(in) :: slaves(:)
1049 integer(kind=kint) :: ndof, ndof2, i, irow, idof, js, je, j, jcol
1053 do i = 1,
size(slaves)
1054 irow = (slaves(i)+ndof-1)/ndof
1055 idof = slaves(i)-ndof*(irow-1)
1056 js = ttktmat%index(irow-1)+1
1057 je = ttktmat%index(irow)
1059 jcol = ttktmat%item(j)
1060 if (irow /= jcol) cycle
1061 if (abs(ttktmat%A(ndof2*(j-1)+ndof*(idof-1)+idof)) > tiny(0.0d0)) &
1062 stop
'ERROR: nonzero diag on slave dof of TtKTmat'
1063 ttktmat%A(ndof2*(j-1)+ndof*(idof-1)+idof) = 1.0d0
1066 end subroutine place_one_on_diag_of_slave_dof
1070 subroutine convert_rhs(hecMESHtmp, hecMAT, hecTKT, Ttmat, Kmat, &
1071 slaves4lag, BLs_inv, Btot, conCOMM)
1075 type(hecmwst_local_matrix),
intent(in) :: ttmat
1076 type(hecmwst_local_matrix),
intent(in) :: kmat
1077 integer(kind=kint),
intent(in) :: slaves4lag(:)
1078 real(kind=
kreal),
intent(in) :: bls_inv(:)
1079 real(kind=
kreal),
target,
intent(in) :: btot(:)
1080 type(hecmwst_contact_comm),
intent(in) :: concomm
1082 real(kind=
kreal),
allocatable :: btmp(:)
1083 real(kind=
kreal),
pointer :: blag(:)
1084 integer(kind=kint) :: ndof, npndof, nndof, npndof_new, num_lagrange, i
1091 npndof = hecmat%NP*ndof
1092 nndof = hecmat%N *ndof
1093 npndof_new = hectkt%NP*ndof
1094 num_lagrange =
size(slaves4lag)
1096 allocate(hectkt%B(npndof_new), source=0.d0)
1097 allocate(hectkt%X(npndof_new), source=0.d0)
1098 allocate(btmp(npndof_new))
1103 blag => btot(npndof+1:npndof+num_lagrange)
1104 hectkt%B(slaves4lag(:))=-bls_inv(:)*blag(:)
1112 btmp(i)=btot(i)+btmp(i)
1119 if (debug_vector)
call debug_write_vector(hectkt%B,
'RHS(converted)',
'hecTKT%B', ndof, hectkt%N)
1120 end subroutine convert_rhs
1124 subroutine recover_solution(hecMESHtmp, hecMAT, hecTKT, Tmat, Kmat, Btot, &
1125 slaves4lag, BLs_inv, BUs_inv, conCOMM, slaves)
1130 type(hecmwst_local_matrix),
intent(in) :: tmat
1131 type(hecmwst_local_matrix),
intent(in) :: kmat
1132 real(kind=
kreal),
intent(in) :: btot(:)
1133 integer(kind=kint),
intent(in) :: slaves4lag(:)
1134 real(kind=
kreal),
intent(in) :: bls_inv(:)
1135 real(kind=
kreal),
intent(in) :: bus_inv(:)
1136 type(hecmwst_contact_comm),
intent(in) :: concomm
1137 integer(kind=kint),
intent(in) :: slaves(:)
1139 integer(kind=kint) :: myrank
1143 hecmat%Iarray=hectkt%Iarray
1144 hecmat%Rarray=hectkt%Rarray
1146 call comp_x_slave(hecmeshtmp, hecmat, hectkt, tmat, btot, &
1147 slaves4lag, bls_inv, concomm, slaves)
1148 if (debug >= 2)
write(0,*)
' DEBUG2[',myrank,
']: recovered slave disp'
1150 call comp_lag(hecmeshtmp, hecmat, hectkt, kmat, btot, &
1151 slaves4lag, bus_inv, concomm, slaves)
1152 if (debug >= 2)
write(0,*)
' DEBUG2[',myrank,
']: recovered lag'
1154 if (debug_vector)
call debug_write_vector(hecmat%X,
'Solution(original)',
'hecMAT%X', hecmat%NDOF, hecmat%N, &
1155 hecmat%NP, .false.,
size(slaves4lag), slaves)
1156 end subroutine recover_solution
1160 subroutine comp_x_slave(hecMESHtmp, hecMAT, hecTKT, Tmat, Btot, &
1161 slaves4lag, BLs_inv, conCOMM, slaves)
1166 type(hecmwst_local_matrix),
intent(in) :: tmat
1167 real(kind=
kreal),
target,
intent(in) :: btot(:)
1168 integer(kind=kint),
intent(in) :: slaves4lag(:)
1169 real(kind=
kreal),
intent(in) :: bls_inv(:)
1170 type(hecmwst_contact_comm),
intent(in) :: concomm
1171 integer(kind=kint),
intent(in) :: slaves(:)
1173 integer(kind=kint) :: ndof, ndof2, npndof, nndof, num_lagrange
1174 real(kind=
kreal),
allocatable :: xtmp(:)
1175 real(kind=
kreal),
pointer :: blag(:)
1179 npndof = hecmat%NP * ndof
1180 nndof = hecmat%N * ndof
1181 num_lagrange =
size(slaves4lag)
1190 allocate(xtmp(npndof), source=0.0d0)
1191 blag => btot(npndof+1:npndof+num_lagrange)
1192 xtmp(slaves4lag(:)) = -bls_inv(:) * blag(:)
1199 hecmat%X(slaves(:)) = hecmat%X(slaves(:)) - xtmp(slaves(:))
1201 end subroutine comp_x_slave
1205 subroutine comp_lag(hecMESHtmp, hecMAT, hecTKT, Kmat, Btot, &
1206 slaves4lag, BUs_inv, conCOMM, slaves)
1211 type(hecmwst_local_matrix),
intent(in) :: kmat
1212 real(kind=
kreal),
intent(in) :: btot(:)
1213 integer(kind=kint),
intent(in) :: slaves4lag(:)
1214 real(kind=
kreal),
intent(in) :: bus_inv(:)
1215 type(hecmwst_contact_comm),
intent(in) :: concomm
1216 integer(kind=kint),
intent(in) :: slaves(:)
1218 integer(kind=kint) :: ndof, npndof, nndof, npndof_new, num_lagrange
1219 real(kind=
kreal),
allocatable :: btmp(:)
1220 real(kind=
kreal),
pointer :: xlag(:)
1223 npndof = hecmat%NP * ndof
1224 nndof = hecmat%N * ndof
1225 npndof_new = hectkt%NP * ndof
1226 num_lagrange =
size(slaves4lag)
1232 hectkt%X(1:nndof) = hecmat%X(1:nndof)
1234 allocate(btmp(npndof))
1238 btmp(slaves(:)) = btot(slaves(:)) - btmp(slaves(:))
1245 xlag => hecmat%X(npndof+1:npndof+num_lagrange)
1246 xlag(:)=bus_inv(:)*btmp(slaves4lag(:))
1248 end subroutine comp_lag
1252 subroutine check_solution(hecMESH, hecMESHtmp, hecMAT, hecTKT, hecLagMAT, Kmat, Btot, &
1259 type(hecmwst_local_matrix),
intent(in) :: kmat
1260 real(kind=
kreal),
target,
intent(in) :: btot(:)
1261 type(hecmwst_contact_comm),
intent(in) :: concomm
1262 integer(kind=kint),
intent(in) :: slaves(:)
1264 integer(kind=kint) :: ndof, nndof, npndof, num_lagrange, i, ls, le, l, j, idof, jdof
1265 real(kind=
kreal),
allocatable,
target :: r(:)
1266 real(kind=
kreal),
allocatable :: btmp(:)
1267 real(kind=
kreal),
pointer :: rlag(:), blag(:), xlag(:)
1268 real(kind=
kreal) :: rnrm2, rlagnrm2
1269 real(kind=
kreal) :: bnrm2, blagnrm2
1270 integer(kind=kint) :: myrank
1274 nndof = hecmat%N * ndof
1275 npndof = hecmat%NP * ndof
1276 num_lagrange = heclagmat%num_lagrange
1278 allocate(r(npndof + num_lagrange), source=0.0d0)
1279 allocate(btmp(npndof))
1281 rlag => r(npndof+1:npndof+num_lagrange)
1282 blag => btot(npndof+1:npndof+num_lagrange)
1283 xlag => hecmat%X(npndof+1:npndof+num_lagrange)
1290 hectkt%X(i) = hecmat%X(i)
1295 r(i) = btot(i) - btmp(i)
1300 if (heclagmat%num_lagrange > 0)
then
1302 ls = heclagmat%indexU_lagrange(i-1)+1
1303 le = heclagmat%indexU_lagrange(i)
1305 j = heclagmat%itemU_lagrange(l)
1307 btmp(ndof*(i-1)+idof) = btmp(ndof*(i-1)+idof) + heclagmat%AU_lagrange(ndof*(l-1)+idof) * xlag(j)
1315 r(i) = r(i) - btmp(i)
1320 do i = 1, num_lagrange
1322 ls = heclagmat%indexL_lagrange(i-1)+1
1323 le = heclagmat%indexL_lagrange(i)
1325 j = heclagmat%itemL_lagrange(l)
1327 rlag(i) = rlag(i) - heclagmat%AL_lagrange(ndof*(l-1)+jdof) * hecmat%X(ndof*(j-1)+jdof)
1333 if (debug_vector)
call debug_write_vector(r,
'Residual',
'R', ndof, hecmat%N, &
1334 hecmat%NP, .false., heclagmat%num_lagrange, slaves)
1338 rlagnrm2 = dot_product(rlag, rlag)
1340 blagnrm2 = dot_product(blag, blag)
1343 if (myrank == 0)
then
1344 write(0,*)
'INFO: resid(x,lag,tot)',sqrt(rnrm2),sqrt(rlagnrm2),sqrt(rnrm2+rlagnrm2)
1345 write(0,*)
'INFO: rhs (x,lag,tot)',sqrt(bnrm2),sqrt(blagnrm2),sqrt(bnrm2+blagnrm2)
1347 end subroutine check_solution
1351 subroutine check_solution2(hecMESH, hecMAT, conMAT, hecLagMAT, conCOMM, slaves)
1357 type(hecmwst_contact_comm),
intent(in) :: concomm
1358 integer(kind=kint),
intent(in) :: slaves(:)
1360 integer(kind=kint) :: ndof, ndof2, nndof, npndof, num_lagrange
1361 integer(kind=kint) :: i, idof, j, jdof, ls, le, l
1362 integer(kind=kint) :: irow, js, je, jcol
1363 real(kind=
kreal),
allocatable,
target :: r(:)
1364 real(kind=
kreal),
allocatable :: r_con(:)
1365 real(kind=
kreal),
pointer :: rlag(:), blag(:), xlag(:)
1366 real(kind=
kreal) :: rnrm2, rlagnrm2
1367 integer(kind=kint) :: myrank
1372 nndof = hecmat%N * ndof
1373 npndof = hecmat%NP * ndof
1374 num_lagrange = heclagmat%num_lagrange
1376 allocate(r(npndof + num_lagrange))
1378 allocate(r_con(npndof))
1381 rlag => r(npndof+1:npndof+num_lagrange)
1382 blag => conmat%B(npndof+1:npndof+num_lagrange)
1383 xlag => hecmat%X(npndof+1:npndof+num_lagrange)
1397 if (debug_vector)
call debug_write_vector(r,
'Residual(original)',
'R', ndof, hecmat%N, &
1398 hecmat%NP, .false., num_lagrange, slaves)
1405 r_con(i) = conmat%B(i)
1407 do irow = 1,hecmat%NP
1409 js = conmat%indexL(irow-1)+1
1410 je = conmat%indexL(irow)
1412 jcol = conmat%itemL(j)
1414 i = ndof*(irow-1)+idof
1416 r_con(i) = r_con(i) - conmat%AL(ndof2*(j-1)+ndof*(idof-1)+jdof) * hecmat%X(ndof*(jcol-1)+jdof)
1422 i = ndof*(irow-1)+idof
1424 r_con(i) = r_con(i) - conmat%D(ndof2*(irow-1)+ndof*(idof-1)+jdof) * hecmat%X(ndof*(irow-1)+jdof)
1428 js = conmat%indexU(irow-1)+1
1429 je = conmat%indexU(irow)
1431 jcol = conmat%itemU(j)
1433 i = ndof*(irow-1)+idof
1435 r_con(i) = r_con(i) - conmat%AU(ndof2*(j-1)+ndof*(idof-1)+jdof) * hecmat%X(ndof*(jcol-1)+jdof)
1442 if (num_lagrange > 0)
then
1444 ls = heclagmat%indexU_lagrange(i-1)+1
1445 le = heclagmat%indexU_lagrange(i)
1447 j = heclagmat%itemU_lagrange(l)
1449 r_con(ndof*(i-1)+idof) = r_con(ndof*(i-1)+idof) - heclagmat%AU_lagrange(ndof*(l-1)+idof) * xlag(j)
1455 if (debug_vector)
call debug_write_vector(r,
'Residual(contact,local)',
'R_con', ndof, hecmat%N, &
1456 hecmat%NP, .true., num_lagrange, slaves)
1461 if (debug_vector)
call debug_write_vector(r,
'Residual(contact,assembled)',
'R_con', ndof, hecmat%N, &
1462 hecmat%NP, .false., num_lagrange, slaves)
1466 r(i) = r(i) + r_con(i)
1469 if (debug_vector)
call debug_write_vector(r,
'Residual(total)',
'R', ndof, hecmat%N, &
1470 hecmat%NP, .false., num_lagrange, slaves)
1474 do i = 1, num_lagrange
1476 ls = heclagmat%indexL_lagrange(i-1)+1
1477 le = heclagmat%indexL_lagrange(i)
1479 j = heclagmat%itemL_lagrange(l)
1481 rlag(i) = rlag(i) - heclagmat%AL_lagrange(ndof*(l-1)+jdof) * hecmat%X(ndof*(j-1)+jdof)
1486 if (debug_vector)
then
1487 write(1000+myrank,*)
'Residual(lagrange)-----------------------------------------------------'
1488 if (num_lagrange > 0)
then
1489 write(1000+myrank,*)
'R(lag):',npndof+1,
'-',npndof+num_lagrange
1490 write(1000+myrank,*) r(npndof+1:npndof+num_lagrange)
1495 rlagnrm2 = dot_product(rlag, rlag)
1498 if (myrank == 0)
write(0,*)
'INFO: resid(x,lag,tot)',sqrt(rnrm2),sqrt(rlagnrm2),sqrt(rnrm2+rlagnrm2)
1499 end subroutine check_solution2
1503 subroutine debug_write_matrix(Mat, label)
1504 type(hecmwst_local_matrix),
intent(in) :: mat
1505 character(len=*),
intent(in) :: label
1507 integer(kind=kint) :: myrank
1510 write(1000+myrank,*) trim(label),
'============================================================'
1512 end subroutine debug_write_matrix
1516 subroutine debug_write_vector(Vec, label, name, ndof, N, &
1517 NP, write_ext, num_lagrange, slaves)
1518 real(kind=
kreal),
intent(in) :: vec(:)
1519 character(len=*),
intent(in) :: label
1520 character(len=*),
intent(in) :: name
1521 integer(kind=kint),
intent(in) :: ndof
1522 integer(kind=kint),
intent(in) :: n
1523 integer(kind=kint),
intent(in),
optional :: np
1524 logical,
intent(in),
optional :: write_ext
1525 integer(kind=kint),
intent(in),
optional :: num_lagrange
1526 integer(kind=kint),
intent(in),
optional :: slaves(:)
1528 integer(kind=kint) :: myrank
1531 write(1000+myrank,*) trim(label),
'------------------------------------------------------------'
1532 write(1000+myrank,*)
'size of ',trim(name),
size(vec)
1533 write(1000+myrank,*) trim(name),
': 1-',n*ndof
1534 write(1000+myrank,*) vec(1:n*ndof)
1535 if (
present(write_ext) .and.
present(np))
then
1537 write(1000+myrank,*) trim(name),
'(external): ',n*ndof+1,
'-',np*ndof
1538 write(1000+myrank,*) vec(n*ndof+1:np*ndof)
1541 if (
present(num_lagrange) .and.
present(np))
then
1542 if (num_lagrange > 0)
then
1543 write(1000+myrank,*) trim(name),
'(lag):',np*ndof+1,
'-',np*ndof+num_lagrange
1544 write(1000+myrank,*) vec(np*ndof+1:np*ndof+num_lagrange)
1547 if (
present(slaves))
then
1548 if (
size(slaves) > 0)
then
1549 write(1000+myrank,*) trim(name),
'(slave):',slaves(:)
1550 write(1000+myrank,*) vec(slaves(:))
1553 end subroutine debug_write_vector
subroutine, public hecmw_localmat_init_with_hecmat(BKmat, hecMAT, num_lagrange)
subroutine, public hecmw_localmat_free(Tmat)
subroutine, public hecmw_localmat_add(Amat, Bmat, Cmat)
subroutine, public hecmw_localmat_multmat(BKmat, BTmat, hecMESH, BKTmat)
subroutine, public hecmw_localmat_mulvec(BTmat, V, TV)
subroutine, public hecmw_localmat_write(Tmat, iunit)
subroutine, public hecmw_localmat_blocking(Tmat, ndof, BTmat)
subroutine, public hecmw_localmat_make_hecmat(hecMAT, BTtKTmat, hecTKT)
subroutine, public hecmw_localmat_assemble(BTmat, hecMESH, hecMESHnew)
subroutine, public hecmw_localmat_add_hecmat(BKmat, hecMAT)
integer(kind=kint) function, public hecmw_mat_get_solver_type(hecMAT)
integer(kind=kint) function, public hecmw_mat_get_flag_diverged(hecMAT)
subroutine, public hecmw_mat_init(hecMAT)
subroutine, public hecmw_mat_finalize(hecMAT)
subroutine, public hecmw_mat_set_method(hecMAT, method)
integer(kind=kint) function, public hecmw_mat_get_method(hecMAT)
integer(kind=kint) function, public hecmw_mat_get_precond(hecMAT)
subroutine, public hecmw_mat_set_precond(hecMAT, precond)
subroutine, public hecmw_mpc_tback_sol(hecMESH, hecMAT, hecMATmpc)
subroutine, public hecmw_mpc_mat_init(hecMESH, hecMAT, hecMESHmpc, hecMATmpc, conMAT, conMATmpc)
subroutine, public hecmw_mpc_mat_ass(hecMESH, hecMAT, hecMESHmpc, hecMATmpc, conMAT, conMATmpc, hecLagMAT)
subroutine, public hecmw_mpc_mat_finalize(hecMESH, hecMAT, hecMESHmpc, hecMATmpc, conMATmpc)
subroutine, public hecmw_mpc_trans_rhs(hecMESH, hecMAT, hecMATmpc)
subroutine, public hecmw_matresid(hecMESH, hecMAT, X, B, R, COMMtime)
subroutine hecmw_innerproduct_r(hecMESH, ndof, X, Y, sum, COMMtime)
subroutine hecmw_solve(hecMESH, hecMAT)
integer(kind=kint), parameter hecmw_sum
integer(kind=kint) function hecmw_comm_get_size()
integer(kind=kint), parameter hecmw_max
integer(kind=4), parameter kreal
integer(kind=kint) function hecmw_comm_get_rank()
real(kind=kreal) function hecmw_wtime()
subroutine hecmw_assemble_r(hecMESH, val, n, m)
subroutine hecmw_update_r(hecMESH, val, n, m)
subroutine hecmw_allreduce_i1(hecMESH, s, ntag)
subroutine hecmw_assemble_i(hecMESH, val, n, m)
subroutine hecmw_allreduce_r1(hecMESH, s, ntag)
Structure for Lagrange multiplier-related part of stiffness matrix (Lagrange multiplier-related matri...