FrontISTR  5.7.1
Large-scale structural analysis program with finit element method
hecmw_precond_ML_33.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 !-------------------------------------------------------------------------------
5 
6 !C
7 !C***
8 !C*** module hecmw_precond_ML_33
9 !C***
10 !C
12  use hecmw_util
13 
14  private
15 
19 
20  integer(kind=kint), save :: id
21 
22  logical, save :: INITIALIZED = .false.
23 
24 contains
25 
26  subroutine hecmw_precond_ml_33_setup(hecMAT, hecMESH, sym)
28  use hecmw_mat_id
29  implicit none
30  type(hecmwst_matrix), intent(inout) :: hecmat
31  type(hecmwst_local_mesh), intent(in) :: hecmesh
32  integer(kind=kint), intent(in) :: sym
33  integer(kind=kint) :: ierr
34  integer(kind=kint), save :: n_recycle = 0
35  if (initialized) then
36  if (hecmat%Iarray(98) == 1) then ! need symbolic and numerical setup
38  else if (hecmat%Iarray(97) == 1) then ! need numerical setup only
40  else ! no need to setup or skip setup
41  call hecmw_mat_id_clear(id)
42  call hecmw_mat_id_set(hecmat, hecmesh, id)
43  return
44  endif
45  endif
46  call hecmw_mat_id_set(hecmat, hecmesh, id)
47  call hecmw_ml_wrapper_setup(id, sym, hecmat%NDOF, ierr)
48  initialized = .true.
49  hecmat%Iarray(98) = 0 ! symbolic setup done
50  hecmat%Iarray(97) = 0 ! numerical setup done
51  n_recycle = 0
52  end subroutine hecmw_precond_ml_33_setup
53 
55  implicit none
56  real(kind=kreal), intent(inout) :: ww(:)
57  integer(kind=kint) :: ierr
58  call hecmw_ml_wrapper_apply(id, ww, ierr)
59  end subroutine hecmw_precond_ml_33_apply
60 
62  use hecmw_mat_id
63  implicit none
64  integer(kind=kint) :: ierr
65  call hecmw_ml_wrapper_clear(id, ierr)
66  call hecmw_mat_id_clear(id)
67  initialized = .false.
68  end subroutine hecmw_precond_ml_33_clear
69 
70 end module hecmw_precond_ml_33
subroutine, public hecmw_mat_id_set(hecMAT, hecMESH, id)
subroutine, public hecmw_mat_id_clear(id)
subroutine, public hecmw_precond_ml_33_apply(WW)
subroutine, public hecmw_precond_ml_33_clear()
subroutine, public hecmw_precond_ml_33_setup(hecMAT, hecMESH, sym)
I/O and Utility.
Definition: hecmw_util_f.F90:7
integer(kind=4), parameter kreal