FrontISTR  5.9.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_setup
20  public :: hecmw_matvec_teardown
21  public :: hecmw_matvec
22  public :: hecmw_matresid
23  public :: hecmw_rel_resid_l2
24  public :: hecmw_tvec
25  public :: hecmw_ttvec
26  public :: hecmw_matvec_clear_timer
27  public :: hecmw_matvec_get_timer
28 
29  real(kind=kreal), save :: time_ax = 0.d0
30 
31 contains
32 
33  !C
34  !C***
35  !C*** hecmw_matvec_setup
36  !C***
37  !C
38  subroutine hecmw_matvec_setup (hecMESH, hecMAT)
39  use hecmw_util
40 
41  implicit none
42  type (hecmwst_local_mesh), intent(in) :: hecmesh
43  type (hecmwst_matrix), intent(in), target :: hecmat
44  select case(hecmat%NDOF)
45  case (3)
46  call hecmw_matvec_33_setup(hecmesh, hecmat)
47  case default
48  end select
49 
50  end subroutine hecmw_matvec_setup
51 
52  !C
53  !C***
54  !C*** hecmw_matvec_teardown
55  !C***
56  !C
57  subroutine hecmw_matvec_teardown (hecMAT)
58  use hecmw_util
59 
60  implicit none
61  type (hecmwst_matrix), intent(in) :: hecmat
62  select case(hecmat%NDOF)
63  case (3)
65  case default
66  end select
67 
68  end subroutine hecmw_matvec_teardown
69 
70  !C
71  !C***
72  !C*** hecmw_matvec
73  !C***
74  !C
75  subroutine hecmw_matvec (hecMESH, hecMAT, X, Y, COMMtime)
76  use hecmw_util
77 
78  implicit none
79  type (hecmwst_local_mesh), intent(in) :: hecmesh
80  type (hecmwst_matrix), intent(in), target :: hecmat
81  real(kind=kreal), intent(in) :: x(:)
82  real(kind=kreal), intent(out) :: y(:)
83  real(kind=kreal), intent(inout), optional :: commtime
84  select case(hecmat%NDOF)
85  case (3)
86  call hecmw_matvec_33(hecmesh, hecmat, x, y, time_ax, commtime)
87  case (4)
88  call hecmw_matvec_44(hecmesh, hecmat, x, y, time_ax,commtime)
89  case (6)
90  call hecmw_matvec_66(hecmesh, hecmat, x, y, time_ax,commtime)
91  case (1)
92  call hecmw_matvec_11(hecmesh, hecmat, x, y, time_ax, commtime)
93  case (2)
94  call hecmw_matvec_22(hecmesh, hecmat, x, y, time_ax, commtime)
95  case default
96  call hecmw_matvec_nn(hecmesh, hecmat, x, y, time_ax, commtime)
97  end select
98 
99  end subroutine hecmw_matvec
100 
101  !C
102  !C***
103  !C*** hecmw_matresid
104  !C***
105  !C
106  subroutine hecmw_matresid (hecMESH, hecMAT, X, B, R, COMMtime)
107  use hecmw_util
108  implicit none
109  type (hecmwst_local_mesh), intent(in) :: hecmesh
110  type (hecmwst_matrix), intent(in) :: hecmat
111  real(kind=kreal), intent(in) :: x(:), b(:)
112  real(kind=kreal), intent(out) :: r(:)
113  real(kind=kreal), intent(inout), optional :: commtime
114 
115  select case(hecmat%NDOF)
116  case (3)
117  call hecmw_matresid_33(hecmesh, hecmat, x, b, r, time_ax, commtime)
118  case (4)
119  call hecmw_matresid_44(hecmesh, hecmat, x, b, r, time_ax, commtime)
120  case (6)
121  call hecmw_matresid_66(hecmesh, hecmat, x, b, r, time_ax, commtime)
122  case (1)
123  call hecmw_matresid_11(hecmesh, hecmat, x, b, r, time_ax, commtime)
124  case (2)
125  call hecmw_matresid_22(hecmesh, hecmat, x, b, r, time_ax, commtime)
126  case default
127  call hecmw_matresid_nn(hecmesh, hecmat, x, b, r, time_ax, commtime)
128  end select
129  end subroutine hecmw_matresid
130 
131  !C
132  !C***
133  !C*** hecmw_rel_resid_L2
134  !C***
135  !C
136  function hecmw_rel_resid_l2 (hecMESH, hecMAT, COMMtime)
137  use hecmw_util
138  implicit none
139  real(kind=kreal) :: hecmw_rel_resid_l2
140  type ( hecmwst_local_mesh ), intent(in) :: hecmesh
141  type ( hecmwst_matrix ), intent(in) :: hecmat
142  real(kind=kreal), intent(inout), optional :: commtime
143 
144  select case(hecmat%NDOF)
145  case (3)
146  hecmw_rel_resid_l2 = hecmw_rel_resid_l2_33(hecmesh, hecmat, time_ax, commtime)
147  case (4)
148  hecmw_rel_resid_l2 = hecmw_rel_resid_l2_44(hecmesh, hecmat, time_ax, commtime)
149  case (6)
150  hecmw_rel_resid_l2 = hecmw_rel_resid_l2_66(hecmesh, hecmat, time_ax, commtime)
151  case (1)
152  hecmw_rel_resid_l2 = hecmw_rel_resid_l2_11(hecmesh, hecmat, time_ax, commtime)
153  case (2)
154  hecmw_rel_resid_l2 = hecmw_rel_resid_l2_22(hecmesh, hecmat, time_ax, commtime)
155  case default
156  hecmw_rel_resid_l2 = hecmw_rel_resid_l2_nn(hecmesh, hecmat, time_ax, commtime)
157  end select
158  end function hecmw_rel_resid_l2
159 
160  !C
161  !C***
162  !C*** hecmw_Tvec
163  !C***
164  !C
165  subroutine hecmw_tvec (hecMESH, ndof, X, Y, COMMtime)
166  use hecmw_util
169 
170  implicit none
171  type (hecmwst_local_mesh), intent(in) :: hecmesh
172  integer(kind=kint), intent(in) :: ndof
173  real(kind=kreal), intent(in) :: x(:)
174  real(kind=kreal), intent(out) :: y(:)
175  real(kind=kreal), intent(inout) :: commtime
176 
177  select case(ndof)
178  case (3)
179  call hecmw_tvec_33(hecmesh, x, y, commtime)
180  case default
181  call hecmw_tvec_nn(hecmesh, ndof, x, y, commtime)
182  end select
183 
184  end subroutine hecmw_tvec
185 
186  !C
187  !C***
188  !C*** hecmw_Ttvec
189  !C***
190  !C
191  subroutine hecmw_ttvec (hecMESH, ndof, X, Y, COMMtime)
192  use hecmw_util
195  implicit none
196  type (hecmwst_local_mesh), intent(in) :: hecmesh
197  integer(kind=kint), intent(in) :: ndof
198  real(kind=kreal), intent(in) :: x(:)
199  real(kind=kreal), intent(out) :: y(:)
200  real(kind=kreal), intent(inout) :: commtime
201 
202  select case(ndof)
203  case (3)
204  call hecmw_ttvec_33(hecmesh, x, y, commtime)
205  case default
206  call hecmw_ttvec_nn(hecmesh, ndof, x, y, commtime)
207  end select
208 
209  end subroutine hecmw_ttvec
210 
211  !C
212  !C***
213  !C*** hecmw_matvec_clear_timer
214  !C***
215  !C
217  implicit none
218  time_ax = 0.d0
219  end subroutine hecmw_matvec_clear_timer
220 
221  !C
222  !C***
223  !C*** hecmw_matvec_get_timer
224  !C***
225  !C
227  implicit none
228  real(kind=kreal) :: hecmw_matvec_get_timer
229  hecmw_matvec_get_timer = time_ax
230  end function hecmw_matvec_get_timer
231 
232 end module hecmw_solver_las
real(kind=kreal) function, public hecmw_rel_resid_l2_11(hecMESH, hecMAT, time_Ax, COMMtime)
subroutine, public hecmw_matresid_11(hecMESH, hecMAT, X, B, R, time_Ax, COMMtime)
subroutine, public hecmw_matvec_11(hecMESH, hecMAT, X, Y, time_Ax, COMMtime)
subroutine, public hecmw_matresid_22(hecMESH, hecMAT, X, B, R, time_Ax, COMMtime)
real(kind=kreal) function, public hecmw_rel_resid_l2_22(hecMESH, hecMAT, time_Ax, COMMtime)
subroutine, public hecmw_matvec_22(hecMESH, hecMAT, X, Y, time_Ax, COMMtime)
subroutine, public hecmw_matresid_33(hecMESH, hecMAT, X, B, R, time_Ax, COMMtime)
subroutine, public hecmw_matvec_33(hecMESH, hecMAT, X, Y, time_Ax, COMMtime)
subroutine, public hecmw_matvec_33_setup(hecMESH, hecMAT)
subroutine, public hecmw_matvec_33_teardown
subroutine, public hecmw_ttvec_33(hecMESH, X, Y, COMMtime)
real(kind=kreal) function, public hecmw_rel_resid_l2_33(hecMESH, hecMAT, time_Ax, COMMtime)
subroutine, public hecmw_tvec_33(hecMESH, X, Y, COMMtime)
subroutine, public hecmw_matresid_44(hecMESH, hecMAT, X, B, R, time_Ax, COMMtime)
subroutine, public hecmw_matvec_44(hecMESH, hecMAT, X, Y, time_Ax, COMMtime)
real(kind=kreal) function, public hecmw_rel_resid_l2_44(hecMESH, hecMAT, time_Ax, COMMtime)
subroutine, public hecmw_matresid_66(hecMESH, hecMAT, X, B, R, time_Ax, COMMtime)
real(kind=kreal) function, public hecmw_rel_resid_l2_66(hecMESH, hecMAT, time_Ax, COMMtime)
subroutine, public hecmw_matvec_66(hecMESH, hecMAT, X, Y, time_Ax, COMMtime)
subroutine, public hecmw_ttvec_nn(hecMESH, ndof, X, Y, COMMtime)
real(kind=kreal) function, public hecmw_rel_resid_l2_nn(hecMESH, hecMAT, time_Ax, COMMtime)
subroutine, public hecmw_tvec_nn(hecMESH, ndof, X, Y, COMMtime)
subroutine, public hecmw_matvec_nn(hecMESH, hecMAT, X, Y, time_Ax, COMMtime)
subroutine, public hecmw_matresid_nn(hecMESH, hecMAT, X, B, R, time_Ax, COMMtime)
subroutine, public hecmw_matvec_clear_timer
subroutine, public hecmw_matvec_teardown(hecMAT)
subroutine, public hecmw_matvec_setup(hecMESH, hecMAT)
subroutine, public hecmw_ttvec(hecMESH, ndof, X, Y, COMMtime)
real(kind=kreal) function, public hecmw_rel_resid_l2(hecMESH, hecMAT, COMMtime)
subroutine, public hecmw_tvec(hecMESH, ndof, X, Y, COMMtime)
subroutine, public hecmw_matresid(hecMESH, hecMAT, X, B, R, COMMtime)
real(kind=kreal) function, public hecmw_matvec_get_timer()
subroutine, public hecmw_matvec(hecMESH, hecMAT, X, Y, COMMtime)
I/O and Utility.
Definition: hecmw_util_f.F90:7
integer(kind=4), parameter kreal