FrontISTR  5.7.0
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 
54  subroutine hecmw_precond_ml_33_apply(WW)
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 
61  subroutine hecmw_precond_ml_33_clear()
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
hecmw_mat_id::hecmw_mat_id_set
subroutine, public hecmw_mat_id_set(hecMAT, hecMESH, id)
Definition: hecmw_mat_id.f90:28
hecmw_precond_ml_33::hecmw_precond_ml_33_setup
subroutine, public hecmw_precond_ml_33_setup(hecMAT, hecMESH, sym)
Definition: hecmw_precond_ML_33.f90:27
hecmw_precond_ml_33::hecmw_precond_ml_33_apply
subroutine, public hecmw_precond_ml_33_apply(WW)
Definition: hecmw_precond_ML_33.f90:55
hecmw_util
I/O and Utility.
Definition: hecmw_util_f.F90:7
hecmw_util::hecmwst_local_mesh
Definition: hecmw_util_f.F90:234
hecmw_util::kreal
integer(kind=4), parameter kreal
Definition: hecmw_util_f.F90:16
hecmw_mat_id
Definition: hecmw_mat_id.f90:6
hecmw_precond_ml_33::hecmw_precond_ml_33_clear
subroutine, public hecmw_precond_ml_33_clear()
Definition: hecmw_precond_ML_33.f90:62
hecmw_matrix_misc
Definition: hecmw_matrix_misc.f90:6
hecmw_mat_id::hecmw_mat_id_clear
subroutine, public hecmw_mat_id_clear(id)
Definition: hecmw_mat_id.f90:64
hecmw_precond_ml_33
Definition: hecmw_precond_ML_33.f90:11
hecmw_util::hecmwst_matrix
Definition: hecmw_util_f.F90:444