FrontISTR  5.9.0
Large-scale structural analysis program with finit element method
solve_LINEQ_mkl.F90
Go to the documentation of this file.
1 !-------------------------------------------------------------------------------
2 ! Copyright (c) 2019 FrontISTR Commons
3 ! This software is released under the MIT License, see LICENSE.txt
4 !-------------------------------------------------------------------------------
7 
9  use hecmw_util
10  use m_sparse_matrix
17  use hecmw_ebc_defer
18 
19  implicit none
20 
21  private
23  public :: solve_lineq_mkl_contact
24 
25  logical, save :: NEED_ANALYSIS = .true.
26  type (sparse_matrix), save :: spMAT
27 
28 contains
29 
30  subroutine solve_lineq_mkl_contact_init(hecMESH,is_sym)
31  type (hecmwst_local_mesh), intent(in) :: hecmesh
32  logical, intent(in) :: is_sym
33 
34  integer(kind=kint) :: spmat_type
35  integer(kind=kint) :: spmat_symtype
36  integer(kind=kint) :: i
37 
38  call sparse_matrix_finalize(spmat)
39 
40  if (is_sym) then
41  spmat_symtype = sparse_matrix_symtype_sym
42  else
43  spmat_symtype = sparse_matrix_symtype_asym
44  end if
45  if(hecmesh%PETOT.GT.1) then
46  spmat_type = sparse_matrix_type_coo
47  else
48  spmat_type = sparse_matrix_type_csr
49  endif
50  call sparse_matrix_set_type(spmat, spmat_type, spmat_symtype)
51 
52  need_analysis = .true.
53  end subroutine solve_lineq_mkl_contact_init
54 
56  subroutine solve_lineq_mkl_contact(hecMESH,hecMAT,hecLagMAT,hecEBC,istat,conMAT)
57  type (hecmwst_local_mesh), intent(in) :: hecmesh
58  type (hecmwst_matrix ), intent(inout) :: hecmat
59  type (hecmwst_matrix_lagrange), intent(inout) :: heclagmat
60  type (hecmwst_ebc), intent(inout) :: hecebc
61  integer(kind=kint), intent(out) :: istat
62  type (hecmwst_matrix), intent(inout),optional :: conmat
63 
64  integer(kind=kint) :: phase_start
65  real(kind=kreal) :: t1,t2
66  integer(kind=kint) :: mpc_method
67 
68  t1=hecmw_wtime()
69 
70  mpc_method = hecmw_mat_get_mpc_method(hecmat)
71  if (mpc_method /= 1 .and. mpc_method /= 3) then
72  mpc_method = 1
73  call hecmw_mat_set_mpc_method(hecmat,mpc_method)
74  endif
75  if (mpc_method /= 1) then
76  write(*,*) 'ERROR: MPCMETHOD other than penalty is not available for DIRECTmkl solver', &
77  ' in contact analysis without elimination'
78  stop
79  endif
80  call hecmw_mat_ass_equation(hecmesh, hecmat)
81  call hecmw_mat_ass_equation_rhs(hecmesh, hecmat)
82  if(present(conmat)) then
83  call hecmw_ebc_apply(hecmesh, hecmat, hecebc, conmat)
84  else
85  call hecmw_ebc_apply(hecmesh, hecmat, hecebc)
86  endif
87 
88  call hecmw_mat_dump(hecmat, hecmesh)
89 
90  if (need_analysis) then
91  !constrtuct new structure
92  call sparse_matrix_contact_init_prof(spmat, hecmat, heclagmat, hecmesh)
93  endif
94 
95  ! ---- For Parallel Contact with Multi-Partition Domains
96  if(present(conmat)) then
97  call sparse_matrix_para_contact_set_vals(spmat, hecmat, heclagmat, conmat)
98  call sparse_matrix_para_contact_set_rhs(spmat, hecmat, heclagmat, conmat)
99  else
100  call sparse_matrix_contact_set_vals(spmat, hecmat, heclagmat)
101  call sparse_matrix_contact_set_rhs(spmat, hecmat, heclagmat)
102  endif
103 
104  t2=hecmw_wtime()
105  if ( hecmw_comm_get_rank() == 0 .and. spmat%timelog > 0) then
106  if( hecmesh%PETOT .GT. 1 ) then
107  write(*,'(A,f10.3)') ' [Cluster Pardiso]: Setup completed. time(sec)=',t2-t1
108  else
109  write(*,'(A,f10.3)') ' [Pardiso]: Setup completed. time(sec)=',t2-t1
110  end if
111  endif
112 
113  phase_start = 2
114  if (need_analysis) then
115  phase_start = 1
116  need_analysis = .false.
117  endif
118 
119  ! SOLVE
120  if( hecmesh%PETOT.GT.1 ) then
121  call hecmw_clustermkl_wrapper(spmat, phase_start, hecmat%X, istat)
122  call sparse_matrix_contact_get_rhs(spmat, hecmat, heclagmat)
123  else
124  call hecmw_mkl_wrapper(spmat, phase_start, hecmat%X, istat)
125  deallocate(spmat%rhs)
126  endif
127 
128  call hecmw_mat_dump_solution(hecmat)
129  end subroutine solve_lineq_mkl_contact
130 
131 end module m_solve_lineq_mkl_contact
Essential boundary conditions kept as per-DOF marks and values so that they can be imposed on the mat...
subroutine, public hecmw_ebc_apply(hecMESH, hecMAT, hecEBC, conMAT)
subroutine, public hecmw_mat_ass_equation_rhs(hecMESH, hecMAT)
subroutine, public hecmw_mat_ass_equation(hecMESH, hecMAT)
subroutine, public hecmw_mat_dump(hecMAT, hecMESH)
subroutine, public hecmw_mat_dump_solution(hecMAT)
integer(kind=kint) function, public hecmw_mat_get_mpc_method(hecMAT)
subroutine, public hecmw_mat_set_mpc_method(hecMAT, mpc_method)
I/O and Utility.
Definition: hecmw_util_f.F90:7
integer(kind=4), parameter kreal
integer(kind=kint) function hecmw_comm_get_rank()
real(kind=kreal) function hecmw_wtime()
This module provides linear equation solver interface for Cluster Pardiso.
subroutine, public hecmw_clustermkl_wrapper(spMAT, phase_start, solution, istat)
This module provides linear equation solver interface for Pardiso.
subroutine, public hecmw_mkl_wrapper(spMAT, phase_start, solx, istat)
This module provides functions to solve sparse system of \linear equitions using intel MKL direct spa...
subroutine, public solve_lineq_mkl_contact_init(hecMESH, is_sym)
subroutine, public solve_lineq_mkl_contact(hecMESH, hecMAT, hecLagMAT, hecEBC, istat, conMAT)
This subroutine executes the MKL solver.
This module provides conversion routines between HEC and FISTR data structures and DOF based sparse m...
subroutine, public sparse_matrix_para_contact_set_vals(spMAT, hecMAT, hecLagMAT, conMAT)
subroutine, public sparse_matrix_contact_get_rhs(spMAT, hecMAT, hecLagMAT)
subroutine, public sparse_matrix_contact_init_prof(spMAT, hecMAT, hecLagMAT, hecMESH)
subroutine, public sparse_matrix_contact_set_rhs(spMAT, hecMAT, hecLagMAT)
subroutine, public sparse_matrix_contact_set_vals(spMAT, hecMAT, hecLagMAT)
subroutine, public sparse_matrix_para_contact_set_rhs(spMAT, hecMAT, hecLagMAT, conMAT)
This module provides DOF based sparse matrix data structure (CSR and COO)
integer(kind=kint), parameter, public sparse_matrix_type_coo
integer(kind=kint), parameter, public sparse_matrix_type_csr
integer(kind=kint), parameter, public sparse_matrix_symtype_sym
subroutine, public sparse_matrix_finalize(spMAT)
integer(kind=kint), parameter, public sparse_matrix_symtype_asym
subroutine, public sparse_matrix_set_type(spMAT, type, symtype)
Structure for Lagrange multiplier-related part of stiffness matrix (Lagrange multiplier-related matri...