FrontISTR  5.7.0
Large-scale structural analysis program with finit element method
hecmw_solver_las.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 
7  use hecmw_util
14 
15  implicit none
16 
17  private
18 
19  public :: hecmw_matvec
20  public :: hecmw_matvec_set_async
21  public :: hecmw_matvec_unset_async
22  public :: hecmw_matresid
23  public :: hecmw_rel_resid_l2
24  public :: hecmw_tvec
25  public :: hecmw_ttvec
26  public :: hecmw_ttmattvec
27  public :: hecmw_matvec_clear_timer
28  public :: hecmw_matvec_get_timer
29  public :: hecmw_mat_diag_sr
30  public :: hecmw_mat_add
31  public :: hecmw_mat_multiple
32 
33  real(kind=kreal), save :: time_ax = 0.d0
34 
35 contains
36 
37  !C
38  !C***
39  !C*** hecmw_matvec
40  !C***
41  !C
42  subroutine hecmw_matvec (hecMESH, hecMAT, X, Y, COMMtime)
44 
45  implicit none
46  type (hecmwst_local_mesh), intent(in) :: hecmesh
47  type (hecmwst_matrix), intent(in), target :: hecmat
48  real(kind=kreal), intent(in) :: x(:)
49  real(kind=kreal), intent(out) :: y(:)
50  real(kind=kreal), intent(inout), optional :: commtime
51  select case(hecmat%NDOF)
52  case (3)
53  call hecmw_matvec_33(hecmesh, hecmat, x, y, time_ax, commtime)
54  case (4)
55  call hecmw_matvec_44(hecmesh, hecmat, x, y, time_ax,commtime)
56  case (6)
57  call hecmw_matvec_66(hecmesh, hecmat, x, y, time_ax,commtime)
58  case (1)
59  call hecmw_matvec_11(hecmesh, hecmat, x, y, time_ax, commtime)
60  case (2)
61  call hecmw_matvec_22(hecmesh, hecmat, x, y, time_ax, commtime)
62  case default
63  call hecmw_matvec_nn(hecmesh, hecmat, x, y, time_ax, commtime)
64  end select
65 
66  end subroutine hecmw_matvec
67 
68  !C
69  !C***
70  !C*** hecmw_matvec_set_async
71  !C***
72  !C
73  subroutine hecmw_matvec_set_async (hecMAT)
75  implicit none
76  type (hecmwst_matrix), intent(in) :: hecmat
77 
78  end subroutine hecmw_matvec_set_async
79 
80  !C
81  !C***
82  !C*** hecmw_matvec_unset_async
83  !C***
84  !C
85  subroutine hecmw_matvec_unset_async
86  implicit none
87  end subroutine hecmw_matvec_unset_async
88 
89  !C
90  !C***
91  !C*** hecmw_matresid
92  !C***
93  !C
94  subroutine hecmw_matresid (hecMESH, hecMAT, X, B, R, COMMtime)
96  implicit none
97  type (hecmwst_local_mesh), intent(in) :: hecmesh
98  type (hecmwst_matrix), intent(in) :: hecmat
99  real(kind=kreal), intent(in) :: x(:), b(:)
100  real(kind=kreal), intent(out) :: r(:)
101  real(kind=kreal), intent(inout), optional :: commtime
102 
103  select case(hecmat%NDOF)
104  case (3)
105  call hecmw_matresid_33(hecmesh, hecmat, x, b, r, time_ax, commtime)
106  case (4)
107  call hecmw_matresid_44(hecmesh, hecmat, x, b, r, time_ax, commtime)
108  case (6)
109  call hecmw_matresid_66(hecmesh, hecmat, x, b, r, time_ax, commtime)
110  case (1)
111  call hecmw_matresid_11(hecmesh, hecmat, x, b, r, time_ax, commtime)
112  case (2)
113  call hecmw_matresid_22(hecmesh, hecmat, x, b, r, time_ax, commtime)
114  case default
115  call hecmw_matresid_nn(hecmesh, hecmat, x, b, r, time_ax, commtime)
116  end select
117  end subroutine hecmw_matresid
118 
119  !C
120  !C***
121  !C*** hecmw_rel_resid_L2
122  !C***
123  !C
124  function hecmw_rel_resid_l2 (hecMESH, hecMAT, COMMtime)
126  implicit none
127  real(kind=kreal) :: hecmw_rel_resid_l2
128  type ( hecmwst_local_mesh ), intent(in) :: hecmesh
129  type ( hecmwst_matrix ), intent(in) :: hecmat
130  real(kind=kreal), intent(inout), optional :: commtime
131 
132  select case(hecmat%NDOF)
133  case (3)
134  hecmw_rel_resid_l2 = hecmw_rel_resid_l2_33(hecmesh, hecmat, time_ax, commtime)
135  case (4)
136  hecmw_rel_resid_l2 = hecmw_rel_resid_l2_44(hecmesh, hecmat, time_ax, commtime)
137  case (6)
138  hecmw_rel_resid_l2 = hecmw_rel_resid_l2_66(hecmesh, hecmat, time_ax, commtime)
139  case (1)
140  hecmw_rel_resid_l2 = hecmw_rel_resid_l2_11(hecmesh, hecmat, time_ax, commtime)
141  case (2)
142  hecmw_rel_resid_l2 = hecmw_rel_resid_l2_22(hecmesh, hecmat, time_ax, commtime)
143  case default
144  hecmw_rel_resid_l2 = hecmw_rel_resid_l2_nn(hecmesh, hecmat, time_ax, commtime)
145  end select
146  end function hecmw_rel_resid_l2
147 
148  !C
149  !C***
150  !C*** hecmw_Tvec
151  !C***
152  !C
153  subroutine hecmw_tvec (hecMESH, ndof, X, Y, COMMtime)
157 
158  implicit none
159  type (hecmwst_local_mesh), intent(in) :: hecmesh
160  integer(kind=kint), intent(in) :: ndof
161  real(kind=kreal), intent(in) :: x(:)
162  real(kind=kreal), intent(out) :: y(:)
163  real(kind=kreal), intent(inout) :: commtime
164 
165  select case(ndof)
166  case (3)
167  call hecmw_tvec_33(hecmesh, x, y, commtime)
168  case default
169  call hecmw_tvec_nn(hecmesh, ndof, x, y, commtime)
170  end select
171 
172  end subroutine hecmw_tvec
173 
174  !C
175  !C***
176  !C*** hecmw_Ttvec
177  !C***
178  !C
179  subroutine hecmw_ttvec (hecMESH, ndof, X, Y, COMMtime)
183  implicit none
184  type (hecmwst_local_mesh), intent(in) :: hecmesh
185  integer(kind=kint), intent(in) :: ndof
186  real(kind=kreal), intent(in) :: x(:)
187  real(kind=kreal), intent(out) :: y(:)
188  real(kind=kreal), intent(inout) :: commtime
189 
190  select case(ndof)
191  case (3)
192  call hecmw_ttvec_33(hecmesh, x, y, commtime)
193  case default
194  call hecmw_ttvec_nn(hecmesh, ndof, x, y, commtime)
195  end select
196 
197  end subroutine hecmw_ttvec
198 
199  !C
200  !C***
201  !C*** hecmw_TtmatTvec
202  !C***
203  !C
204  subroutine hecmw_ttmattvec (hecMESH, hecMAT, X, Y, W, COMMtime)
206  implicit none
207  type (hecmwst_local_mesh), intent(in) :: hecmesh
208  type (hecmwst_matrix), intent(in) :: hecmat
209  real(kind=kreal), intent(in) :: x(:)
210  real(kind=kreal), intent(out) :: y(:), w(:)
211  real(kind=kreal), intent(inout) :: commtime
212 
213  ! call hecmw_Tvec(hecMESH, X, Y, COMMtime)
214  ! call hecmw_matvec(hecMESH, hecMAT, Y, W, COMMtime)
215  ! call hecmw_Ttvec(hecMESH, W, Y, COMMtime)
216  select case(hecmesh%n_dof)
217  case (3)
218  call hecmw_ttmattvec_33 (hecmesh, hecmat, x, y, w, time_ax, commtime)
219  case default
220  call hecmw_ttmattvec_nn (hecmesh, hecmat, x, y, w, time_ax, commtime)
221  end select
222 
223  end subroutine hecmw_ttmattvec
224 
225  !C
226  !C***
227  !C*** hecmw_matvec_clear_timer
228  !C***
229  !C
230  subroutine hecmw_matvec_clear_timer
231  implicit none
232  time_ax = 0.d0
233  end subroutine hecmw_matvec_clear_timer
234 
235  !C
236  !C***
237  !C*** hecmw_matvec_get_timer
238  !C***
239  !C
240  function hecmw_matvec_get_timer()
241  implicit none
242  real(kind=kreal) :: hecmw_matvec_get_timer
243  hecmw_matvec_get_timer = time_ax
244  end function hecmw_matvec_get_timer
245 
246  !C
247  !C***
248  !C*** hecmw_mat_diag_sr
249  !C***
250  !C
251  subroutine hecmw_mat_diag_sr(hecMESH, hecMAT, COMMtime)
255  implicit none
256  type (hecmwst_local_mesh), intent(in) :: hecmesh
257  type (hecmwst_matrix), intent(inout), target :: hecmat
258  real(kind=kreal), intent(inout), optional :: commtime
259 
260  select case(hecmesh%n_dof)
261  case (3)
262  call hecmw_mat_diag_sr_33(hecmesh, hecmat, commtime)
263  case default
264  call hecmw_mat_diag_sr_nn(hecmesh, hecmat, commtime)
265  end select
266 
267  end subroutine hecmw_mat_diag_sr
268 
269  subroutine hecmw_mat_add(hecMAT1, hecMAT2, hecMAT3)
273  implicit none
274  type (hecmwst_matrix), intent(inout), target :: hecmat1, hecmat2, hecmat3
275 
276  call hecmw_mat_add_nn(hecmat1, hecmat2, hecmat3)
277  end subroutine hecmw_mat_add
278 
279  subroutine hecmw_mat_multiple(hecMAT, alpha)
283  implicit none
284  type (hecmwst_matrix), intent(inout), target :: hecmat
285  real(kind=kreal), intent(in) :: alpha
286 
287  call hecmw_mat_multiple_nn(hecmat, alpha)
288  end subroutine hecmw_mat_multiple
289 end module hecmw_solver_las
hecmw_solver_las::hecmw_matvec_unset_async
subroutine, public hecmw_matvec_unset_async
Definition: hecmw_solver_las.f90:86
hecmw_solver_las_11::hecmw_matvec_11
subroutine, public hecmw_matvec_11(hecMESH, hecMAT, X, Y, time_Ax, COMMtime)
Definition: hecmw_solver_las_11.f90:22
hecmw_solver_las_33::hecmw_matvec_33
subroutine, public hecmw_matvec_33(hecMESH, hecMAT, X, Y, time_Ax, COMMtime)
Definition: hecmw_solver_las_33.f90:35
hecmw_solver_las_33::hecmw_ttvec_33
subroutine, public hecmw_ttvec_33(hecMESH, X, Y, COMMtime)
Definition: hecmw_solver_las_33.f90:448
hecmw_solver_las::hecmw_matvec
subroutine, public hecmw_matvec(hecMESH, hecMAT, X, Y, COMMtime)
Definition: hecmw_solver_las.f90:43
hecmw_solver_las_nn::hecmw_ttvec_nn
subroutine, public hecmw_ttvec_nn(hecMESH, ndof, X, Y, COMMtime)
Definition: hecmw_solver_las_nn.f90:428
hecmw_solver_las::hecmw_mat_add
subroutine, public hecmw_mat_add(hecMAT1, hecMAT2, hecMAT3)
Definition: hecmw_solver_las.f90:270
hecmw_solver_las_22
Definition: hecmw_solver_las_22.f90:6
hecmw_solver_las_33::hecmw_matresid_33
subroutine, public hecmw_matresid_33(hecMESH, hecMAT, X, B, R, time_Ax, COMMtime)
Definition: hecmw_solver_las_33.f90:335
hecmw_solver_las::hecmw_matvec_clear_timer
subroutine, public hecmw_matvec_clear_timer
Definition: hecmw_solver_las.f90:231
hecmw_solver_las_44
Definition: hecmw_solver_las_44.f90:6
hecmw_solver_las_nn::hecmw_mat_multiple_nn
subroutine, public hecmw_mat_multiple_nn(hecMAT, alpha)
Definition: hecmw_solver_las_nn.f90:555
hecmw_solver_las_nn
Definition: hecmw_solver_las_nn.f90:6
hecmw_solver_las_66::hecmw_rel_resid_l2_66
real(kind=kreal) function, public hecmw_rel_resid_l2_66(hecMESH, hecMAT, time_Ax, COMMtime)
Definition: hecmw_solver_las_66.f90:245
hecmw_solver_las_nn::hecmw_mat_add_nn
subroutine, public hecmw_mat_add_nn(hecMAT1, hecMAT2, hecMAT3)
Definition: hecmw_solver_las_nn.f90:536
hecmw_solver_las
Definition: hecmw_solver_las.f90:6
hecmw_solver_las_nn::hecmw_mat_diag_sr_nn
subroutine, public hecmw_mat_diag_sr_nn(hecMESH, hecMAT, COMMtime)
Definition: hecmw_solver_las_nn.f90:499
hecmw_solver_las_66
Definition: hecmw_solver_las_66.f90:6
hecmw_solver_las::hecmw_matresid
subroutine, public hecmw_matresid(hecMESH, hecMAT, X, B, R, COMMtime)
Definition: hecmw_solver_las.f90:95
hecmw_util
I/O and Utility.
Definition: hecmw_util_f.F90:7
hecmw_util::hecmwst_local_mesh
Definition: hecmw_util_f.F90:234
hecmw_solver_las_44::hecmw_rel_resid_l2_44
real(kind=kreal) function, public hecmw_rel_resid_l2_44(hecMESH, hecMAT, time_Ax, COMMtime)
Definition: hecmw_solver_las_44.f90:306
hecmw_solver_las_22::hecmw_matvec_22
subroutine, public hecmw_matvec_22(hecMESH, hecMAT, X, Y, time_Ax, COMMtime)
Definition: hecmw_solver_las_22.f90:32
hecmw_solver_las_nn::hecmw_tvec_nn
subroutine, public hecmw_tvec_nn(hecMESH, ndof, X, Y, COMMtime)
Definition: hecmw_solver_las_nn.f90:380
hecmw_solver_las::hecmw_ttvec
subroutine, public hecmw_ttvec(hecMESH, ndof, X, Y, COMMtime)
Definition: hecmw_solver_las.f90:180
hecmw_solver_las_33::hecmw_tvec_33
subroutine, public hecmw_tvec_33(hecMESH, X, Y, COMMtime)
Definition: hecmw_solver_las_33.f90:401
hecmw_solver_las_22::hecmw_matresid_22
subroutine, public hecmw_matresid_22(hecMESH, hecMAT, X, B, R, time_Ax, COMMtime)
Definition: hecmw_solver_las_22.f90:240
hecmw_solver_las_nn::hecmw_matvec_nn
subroutine, public hecmw_matvec_nn(hecMESH, hecMAT, X, Y, time_Ax, COMMtime)
Definition: hecmw_solver_las_nn.f90:37
hecmw_solver_las::hecmw_rel_resid_l2
real(kind=kreal) function, public hecmw_rel_resid_l2(hecMESH, hecMAT, COMMtime)
Definition: hecmw_solver_las.f90:125
hecmw_solver_las_66::hecmw_matvec_66
subroutine, public hecmw_matvec_66(hecMESH, hecMAT, X, Y, time_Ax, COMMtime)
Definition: hecmw_solver_las_66.f90:27
hecmw_util::kreal
integer(kind=4), parameter kreal
Definition: hecmw_util_f.F90:16
hecmw_solver_las_66::hecmw_matresid_66
subroutine, public hecmw_matresid_66(hecMESH, hecMAT, X, B, R, time_Ax, COMMtime)
Definition: hecmw_solver_las_66.f90:218
hecmw_solver_las_44::hecmw_matresid_44
subroutine, public hecmw_matresid_44(hecMESH, hecMAT, X, B, R, time_Ax, COMMtime)
Definition: hecmw_solver_las_44.f90:276
hecmw_solver_las_33::hecmw_rel_resid_l2_33
real(kind=kreal) function, public hecmw_rel_resid_l2_33(hecMESH, hecMAT, time_Ax, COMMtime)
Definition: hecmw_solver_las_33.f90:365
hecmw_solver_las::hecmw_ttmattvec
subroutine, public hecmw_ttmattvec(hecMESH, hecMAT, X, Y, W, COMMtime)
Definition: hecmw_solver_las.f90:205
hecmw_solver_las_44::hecmw_matvec_44
subroutine, public hecmw_matvec_44(hecMESH, hecMAT, X, Y, time_Ax, COMMtime)
Definition: hecmw_solver_las_44.f90:35
hecmw_solver_las_nn::hecmw_rel_resid_l2_nn
real(kind=kreal) function, public hecmw_rel_resid_l2_nn(hecMESH, hecMAT, time_Ax, COMMtime)
Definition: hecmw_solver_las_nn.f90:344
hecmw_solver_las_11::hecmw_rel_resid_l2_11
real(kind=kreal) function, public hecmw_rel_resid_l2_11(hecMESH, hecMAT, time_Ax, COMMtime)
Definition: hecmw_solver_las_11.f90:98
hecmw_solver_las::hecmw_matvec_get_timer
real(kind=kreal) function, public hecmw_matvec_get_timer()
Definition: hecmw_solver_las.f90:241
hecmw_solver_las::hecmw_mat_diag_sr
subroutine, public hecmw_mat_diag_sr(hecMESH, hecMAT, COMMtime)
Definition: hecmw_solver_las.f90:252
hecmw_solver_las_33::hecmw_ttmattvec_33
subroutine, public hecmw_ttmattvec_33(hecMESH, hecMAT, X, Y, W, time_Ax, COMMtime)
Definition: hecmw_solver_las_33.f90:496
hecmw_solver_las::hecmw_tvec
subroutine, public hecmw_tvec(hecMESH, ndof, X, Y, COMMtime)
Definition: hecmw_solver_las.f90:154
hecmw_solver_las_22::hecmw_rel_resid_l2_22
real(kind=kreal) function, public hecmw_rel_resid_l2_22(hecMESH, hecMAT, time_Ax, COMMtime)
Definition: hecmw_solver_las_22.f90:270
hecmw_solver_las_nn::hecmw_ttmattvec_nn
subroutine, public hecmw_ttmattvec_nn(hecMESH, hecMAT, X, Y, W, time_Ax, COMMtime)
Definition: hecmw_solver_las_nn.f90:478
hecmw_solver_las_11
Definition: hecmw_solver_las_11.f90:6
hecmw_solver_las_11::hecmw_matresid_11
subroutine, public hecmw_matresid_11(hecMESH, hecMAT, X, B, R, time_Ax, COMMtime)
Definition: hecmw_solver_las_11.f90:70
hecmw_solver_las::hecmw_matvec_set_async
subroutine, public hecmw_matvec_set_async(hecMAT)
Definition: hecmw_solver_las.f90:74
hecmw_solver_las_33
Definition: hecmw_solver_las_33.f90:6
hecmw_solver_las_33::hecmw_mat_diag_sr_33
subroutine, public hecmw_mat_diag_sr_33(hecMESH, hecMAT, COMMtime)
Definition: hecmw_solver_las_33.f90:518
hecmw_solver_las_nn::hecmw_matresid_nn
subroutine, public hecmw_matresid_nn(hecMESH, hecMAT, X, B, R, time_Ax, COMMtime)
Definition: hecmw_solver_las_nn.f90:314
hecmw_solver_las::hecmw_mat_multiple
subroutine, public hecmw_mat_multiple(hecMAT, alpha)
Definition: hecmw_solver_las.f90:280
hecmw_util::hecmwst_matrix
Definition: hecmw_util_f.F90:444