FrontISTR  5.9.0
Large-scale structural analysis program with finit element method
hecmw_ML_helper.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 subroutine hecmw_ml_get_nlocal(id, nlocal, nlocal_allcolumns, ierr)
7  use hecmw_util
8  use hecmw_mat_id
9  implicit none
10  integer(kind=kint), intent(in) :: id
11  integer(kind=kint), intent(out) :: nlocal
12  integer(kind=kint), intent(out) :: nlocal_allcolumns
13  integer(kind=kint), intent(out) :: ierr
14  type(hecmwst_matrix), pointer :: hecMAT
15  type(hecmwst_local_mesh), pointer :: hecMESH
16  call hecmw_mat_id_get(id, hecmat, hecmesh)
17  nlocal = hecmat%N * hecmat%NDOF
18  nlocal_allcolumns = hecmat%NP * hecmat%NDOF
19  ierr = 0
20 end subroutine hecmw_ml_get_nlocal
21 
22 subroutine hecmw_ml_get_coord(id, x, y, z, ierr)
23  use hecmw_util
24  use hecmw_mat_id
25  implicit none
26  integer(kind=kint), intent(in) :: id
27  real(kind=kreal), intent(out) :: x(*), y(*), z(*)
28  integer(kind=kint), intent(out) :: ierr
29  type(hecmwst_matrix), pointer :: hecMAT
30  type(hecmwst_local_mesh), pointer :: hecMESH
31  integer(kind=kint) :: offset, i
32  call hecmw_mat_id_get(id, hecmat, hecmesh)
33  offset = 0
34  do i = 1, hecmesh%nn_internal
35  x(i) = hecmesh%node(offset+1)
36  y(i) = hecmesh%node(offset+2)
37  z(i) = hecmesh%node(offset+3)
38  offset = offset + 3
39  enddo
40  ierr = 0
41 end subroutine hecmw_ml_get_coord
42 
43 subroutine hecmw_ml_get_rbm(id, rbm, ierr)
44  use hecmw_util
45  use hecmw_mat_id
47  implicit none
48  integer(kind=kint), intent(in) :: id
49  real(kind=kreal), intent(out) :: rbm(*)
50  integer(kind=kint), intent(out) :: ierr
51  type(hecmwst_matrix), pointer :: hecMAT
52  type(hecmwst_local_mesh), pointer :: hecMESH
53  call hecmw_mat_id_get(id, hecmat, hecmesh)
54  ! shared rigid-body near-kernel (with SA-AMG)
55  call hecmw_precond_rbm_from_mesh(hecmesh, hecmat%NDOF, rbm)
56  ierr = 0
57 end subroutine hecmw_ml_get_rbm
58 
59 subroutine hecmw_ml_get_loglevel(id, level)
60  use hecmw_util
62  use hecmw_mat_id
63  implicit none
64  integer(kind=kint), intent(in) :: id
65  integer(kind=kint), intent(out) :: level
66  type(hecmwst_matrix), pointer :: hecMAT
67  type(hecmwst_local_mesh), pointer :: hecMESH
68  call hecmw_mat_id_get(id, hecmat, hecmesh)
69  level = hecmw_mat_get_loglevel(hecmat) ! independent LOGLEVEL ...
70  if (level < 0) level = hecmw_mat_get_timelog(hecmat) ! ... unset -> fall back to TIMELOG
71 end subroutine hecmw_ml_get_loglevel
72 
73 subroutine hecmw_ml_get_opt(id, opt, ierr)
74  use hecmw_util
75  use hecmw_mat_id
77  implicit none
78  integer(kind=kint), intent(in) :: id
79  integer(kind=kint), intent(out) :: opt(*)
80  integer(kind=kint), intent(out) :: ierr
81  type(hecmwst_matrix), pointer :: hecMAT
82  type(hecmwst_local_mesh), pointer :: hecMESH
83  integer(kind=kint) :: iopt(10)
84  call hecmw_mat_id_get(id, hecmat, hecmesh)
85  call hecmw_mat_get_solver_opt(hecmat, iopt)
86  opt(1:10) = iopt(1:10)
87  ierr = 0
88 end subroutine hecmw_ml_get_opt
89 
90 subroutine hecmw_ml_set_opt(id, opt, ierr)
91  use hecmw_util
92  use hecmw_mat_id
94  implicit none
95  integer(kind=kint), intent(in) :: id
96  integer(kind=kint), intent(in) :: opt(*)
97  integer(kind=kint), intent(out) :: ierr
98  type(hecmwst_matrix), pointer :: hecMAT
99  type(hecmwst_local_mesh), pointer :: hecMESH
100  integer(kind=kint) :: iopt(10)
101  call hecmw_mat_id_get(id, hecmat, hecmesh)
102  iopt(1:10) = opt(1:10)
103  call hecmw_mat_set_solver_opt(hecmat, iopt)
104  ierr = 0
105 end subroutine hecmw_ml_set_opt
subroutine hecmw_ml_set_opt(id, opt, ierr)
subroutine hecmw_ml_get_rbm(id, rbm, ierr)
subroutine hecmw_ml_get_coord(id, x, y, z, ierr)
subroutine hecmw_ml_get_nlocal(id, nlocal, nlocal_allcolumns, ierr)
subroutine hecmw_ml_get_opt(id, opt, ierr)
subroutine hecmw_ml_get_loglevel(id, level)
subroutine, public hecmw_mat_id_get(id, hecMAT, hecMESH)
subroutine, public hecmw_mat_get_solver_opt(hecMAT, solver_opt)
integer(kind=kint) function, public hecmw_mat_get_timelog(hecMAT)
integer(kind=kint) function, public hecmw_mat_get_loglevel(hecMAT)
subroutine, public hecmw_mat_set_solver_opt(hecMAT, solver_opt)
Rigid-body / near-kernel modes from mesh coordinates.
subroutine, public hecmw_precond_rbm_from_mesh(hecMESH, ndof, rbm)
I/O and Utility.
Definition: hecmw_util_f.F90:7
integer(kind=4), parameter kreal