FrontISTR  5.9.0
Large-scale structural analysis program with finit element method
solve_LINEQ_direct_serial_lag.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 !-------------------------------------------------------------------------------
6 
7  use hecmw_util
13  use hecmw_ebc_defer
14 
15 contains
16 
17  subroutine solve_lineq_serial_lag_hecmw_init(hecMAT,hecLagMAT,is_sym)
18  implicit none
19  type (hecmwST_matrix) :: hecMAT
20  type (hecmwST_matrix_lagrange) :: hecLagMAT
21  logical :: is_sym
22 
23  call set_pointersandindices_directsolver(hecmat,heclagmat,is_sym)
24 
26 
27 
28  subroutine solve_lineq_serial_lag_hecmw(hecMESH,hecMAT,hecLagMAT,hecEBC)
29  implicit none
30  type (hecmwST_local_mesh) :: hecMESH
31  type (hecmwST_matrix) :: hecMAT
32  type (hecmwST_matrix_lagrange) :: hecLagMAT
33  type (hecmwST_ebc) :: hecEBC
34  integer (kind=4) :: ntdf, ilag_sta
35  integer (kind=4) :: numNon0
36  integer (kind=4) :: ierr, nprocs, myrank
37 
38  real(kind=8), allocatable :: b(:)
39  integer(kind=kint) :: mpc_method
40 
41  mpc_method = hecmw_mat_get_mpc_method(hecmat)
42  if (mpc_method /= 1 .and. mpc_method /= 3) then
43  mpc_method = 1
44  call hecmw_mat_set_mpc_method(hecmat,mpc_method)
45  endif
46  if (mpc_method /= 1) then
47  write(*,*) 'ERROR: MPCMETHOD other than penalty is not available for DIRECT solver', &
48  ' in contact analysis without elimination'
49  stop
50  endif
51  call hecmw_mat_ass_equation(hecmesh, hecmat)
52  call hecmw_mat_ass_equation_rhs(hecmesh, hecmat)
53  call hecmw_ebc_apply(hecmesh, hecmat, hecebc)
54 
55  call hecmw_mat_dump(hecmat, hecmesh)
56 
57  call set_values_directsolver(hecmat,heclagmat)
58 
59  ntdf = hecmat%NP*hecmat%NDOF + heclagmat%num_lagrange
60  ilag_sta = hecmat%NP*hecmat%NDOF + 1
61  numnon0 = hecmat%NPU*hecmat%NDOF**2+hecmat%NP*hecmat%NDOF*(ntdf+1)/2 &
62  + (heclagmat%numU_lagrange)*hecmat%NDOF+heclagmat%num_lagrange
63 
64  allocate(b(size(hecmat%B)))
65  b = hecmat%B
66 
67  call hecmw_solve_direct_serial_lag(ntdf, ilag_sta, numnon0, pointers, indices, values, b)
68 
69  hecmat%X = b
70 
71  deallocate(b)
72 
73  call hecmw_mat_dump_solution(hecmat)
74 
75  end subroutine solve_lineq_serial_lag_hecmw
76 
77 
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)
subroutine, public hecmw_solve_direct_serial_lag(nrows, ilag_sta, nttbr, pointers, indices, values, b)
I/O and Utility.
Definition: hecmw_util_f.F90:7
This module provides functions to set arrays for direct sparse solver \in the case of using standard ...
real(kind=kreal), dimension(:), allocatable values
a
integer(kind=kint), dimension(:), allocatable pointers
ia
subroutine set_pointersandindices_directsolver(hecMAT, hecLagMAT, is_sym)
This subroutine sets index arrays for direct sparse solver from those stored \in the matrix structure...
integer(kind=kint), dimension(:), allocatable indices
ja
subroutine set_values_directsolver(hecMAT, hecLagMAT)
This subroutine sets the array for direct sparse solver that contains \the non-zero items(elements)of...
subroutine solve_lineq_serial_lag_hecmw_init(hecMAT, hecLagMAT, is_sym)
subroutine solve_lineq_serial_lag_hecmw(hecMESH, hecMAT, hecLagMAT, hecEBC)