FrontISTR  6.0.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(inout) :: 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) :: b(:)
112  real(kind=kreal), intent(inout) :: x(:)
113  real(kind=kreal), intent(out) :: r(:)
114  real(kind=kreal), intent(inout), optional :: commtime
115 
116  select case(hecmat%NDOF)
117  case (3)
118  call hecmw_matresid_33(hecmesh, hecmat, x, b, r, time_ax, commtime)
119  case (4)
120  call hecmw_matresid_44(hecmesh, hecmat, x, b, r, time_ax, commtime)
121  case (6)
122  call hecmw_matresid_66(hecmesh, hecmat, x, b, r, time_ax, commtime)
123  case (1)
124  call hecmw_matresid_11(hecmesh, hecmat, x, b, r, time_ax, commtime)
125  case (2)
126  call hecmw_matresid_22(hecmesh, hecmat, x, b, r, time_ax, commtime)
127  case default
128  call hecmw_matresid_nn(hecmesh, hecmat, x, b, r, time_ax, commtime)
129  end select
130  end subroutine hecmw_matresid
131 
132  !C
133  !C***
134  !C*** hecmw_rel_resid_L2
135  !C***
136  !C
137  function hecmw_rel_resid_l2 (hecMESH, hecMAT, COMMtime)
138  use hecmw_util
139  implicit none
140  real(kind=kreal) :: hecmw_rel_resid_l2
141  type ( hecmwst_local_mesh ), intent(in) :: hecmesh
142  type ( hecmwst_matrix ), intent(in) :: hecmat
143  real(kind=kreal), intent(inout), optional :: commtime
144 
145  select case(hecmat%NDOF)
146  case (3)
147  hecmw_rel_resid_l2 = hecmw_rel_resid_l2_33(hecmesh, hecmat, time_ax, commtime)
148  case (4)
149  hecmw_rel_resid_l2 = hecmw_rel_resid_l2_44(hecmesh, hecmat, time_ax, commtime)
150  case (6)
151  hecmw_rel_resid_l2 = hecmw_rel_resid_l2_66(hecmesh, hecmat, time_ax, commtime)
152  case (1)
153  hecmw_rel_resid_l2 = hecmw_rel_resid_l2_11(hecmesh, hecmat, time_ax, commtime)
154  case (2)
155  hecmw_rel_resid_l2 = hecmw_rel_resid_l2_22(hecmesh, hecmat, time_ax, commtime)
156  case default
157  hecmw_rel_resid_l2 = hecmw_rel_resid_l2_nn(hecmesh, hecmat, time_ax, commtime)
158  end select
159  end function hecmw_rel_resid_l2
160 
161  !C
162  !C***
163  !C*** hecmw_Tvec
164  !C***
165  !C
166  subroutine hecmw_tvec (hecMESH, ndof, X, Y, COMMtime)
167  use hecmw_util
170 
171  implicit none
172  type (hecmwst_local_mesh), intent(in) :: hecmesh
173  integer(kind=kint), intent(in) :: ndof
174  real(kind=kreal), intent(inout) :: x(:)
175  real(kind=kreal), intent(out) :: y(:)
176  real(kind=kreal), intent(inout) :: commtime
177 
178  select case(ndof)
179  case (3)
180  call hecmw_tvec_33(hecmesh, x, y, commtime)
181  case default
182  call hecmw_tvec_nn(hecmesh, ndof, x, y, commtime)
183  end select
184 
185  end subroutine hecmw_tvec
186 
187  !C
188  !C***
189  !C*** hecmw_Ttvec
190  !C***
191  !C
192  subroutine hecmw_ttvec (hecMESH, ndof, X, Y, COMMtime)
193  use hecmw_util
196  implicit none
197  type (hecmwst_local_mesh), intent(in) :: hecmesh
198  integer(kind=kint), intent(in) :: ndof
199  real(kind=kreal), intent(inout) :: x(:)
200  real(kind=kreal), intent(inout) :: y(:)
201  real(kind=kreal), intent(inout) :: commtime
202 
203  select case(ndof)
204  case (3)
205  call hecmw_ttvec_33(hecmesh, x, y, commtime)
206  case default
207  call hecmw_ttvec_nn(hecmesh, ndof, x, y, commtime)
208  end select
209 
210  end subroutine hecmw_ttvec
211 
212  !C
213  !C***
214  !C*** hecmw_matvec_clear_timer
215  !C***
216  !C
218  implicit none
219  time_ax = 0.d0
220  end subroutine hecmw_matvec_clear_timer
221 
222  !C
223  !C***
224  !C*** hecmw_matvec_get_timer
225  !C***
226  !C
228  implicit none
229  real(kind=kreal) :: hecmw_matvec_get_timer
230  hecmw_matvec_get_timer = time_ax
231  end function hecmw_matvec_get_timer
232 
233 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