FrontISTR  5.9.0
Large-scale structural analysis program with finit element method
hecmw_matrix_misc.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
9  implicit none
10 
11  private
12  public :: hecmw_mat_clear
13  public :: hecmw_mat_clear_b
14  public :: hecmw_mat_init
15  public :: hecmw_mat_finalize
16  public :: hecmw_mat_copy_profile
17  public :: hecmw_mat_copy_val
18 
19  public :: hecmw_mat_set_iter
20  public :: hecmw_mat_get_iter
21  public :: hecmw_mat_set_method
22  public :: hecmw_mat_get_method
23  public :: hecmw_mat_set_precond
24  public :: hecmw_mat_get_precond
25  public :: hecmw_mat_set_nset
26  public :: hecmw_mat_get_nset
27  public :: hecmw_mat_set_iterpremax
28  public :: hecmw_mat_get_iterpremax
29  public :: hecmw_mat_set_nrest
30  public :: hecmw_mat_get_nrest
31  public :: hecmw_mat_set_nbfgs
32  public :: hecmw_mat_get_nbfgs
33  public :: hecmw_mat_set_scaling
34  public :: hecmw_mat_get_scaling
35  public :: hecmw_mat_set_penalized
36  public :: hecmw_mat_get_penalized
39  public :: hecmw_mat_set_mpc_method
40  public :: hecmw_mat_get_mpc_method
41  public :: hecmw_mat_set_estcond
42  public :: hecmw_mat_get_estcond
47  public :: hecmw_mat_set_iterlog
48  public :: hecmw_mat_get_iterlog
49  public :: hecmw_mat_set_timelog
50  public :: hecmw_mat_get_timelog
51  public :: hecmw_mat_set_loglevel
52  public :: hecmw_mat_get_loglevel
53  public :: hecmw_mat_set_dump
54  public :: hecmw_mat_get_dump
55  public :: hecmw_mat_set_dump_exit
56  public :: hecmw_mat_get_dump_exit
57  public :: hecmw_mat_set_usejad
58  public :: hecmw_mat_get_usejad
63  public :: hecmw_mat_set_ncolor_in
64  public :: hecmw_mat_get_ncolor_in
77 
78  public :: hecmw_mat_set_method2
79  public :: hecmw_mat_get_method2
84 
85  public :: hecmw_mat_set_solver_opt
86  public :: hecmw_mat_get_solver_opt
89 
90  public :: hecmw_mat_set_resid
91  public :: hecmw_mat_get_resid
92  public :: hecmw_mat_set_sigma_diag
93  public :: hecmw_mat_get_sigma_diag
94  public :: hecmw_mat_set_omega
95  public :: hecmw_mat_get_omega
96  public :: hecmw_mat_set_thresh
97  public :: hecmw_mat_get_thresh
98  public :: hecmw_mat_set_filter
99  public :: hecmw_mat_get_filter
100  public :: hecmw_mat_set_penalty
101  public :: hecmw_mat_get_penalty
104 
105  public :: hecmw_matvec_impl_bsr
106  public :: hecmw_matvec_impl_csr
107  public :: hecmw_matvec_impl_sblas
108  public :: hecmw_precond_impl_bsr
109  public :: hecmw_precond_impl_csr
110  public :: hecmw_precond_impl_sblas
111  public :: hecmw_matvec_impl_default
113 
114  public :: hecmw_mat_diag_max
115  public :: hecmw_mat_diag
117  public :: hecmw_mat_substitute
118  public :: hecmw_mat_integrate
119 
120  integer, parameter :: IDX_I_ITER = 1
121  integer, parameter :: IDX_I_METHOD = 2
122  integer, parameter :: IDX_I_PRECOND = 3
123  integer, parameter :: IDX_I_NSET = 4
124  integer, parameter :: IDX_I_ITERPREMAX = 5
125  integer, parameter :: IDX_I_NREST = 6
126  integer, parameter :: IDX_I_NBFGS = 60
127  integer, parameter :: IDX_I_SCALING = 7
128  integer, parameter :: IDX_I_PENALIZED = 11
129  integer, parameter :: IDX_I_PENALIZED_B = 12
130  integer, parameter :: IDX_I_MPC_METHOD = 13
131  integer, parameter :: IDX_I_ESTCOND = 14
132  integer, parameter :: IDX_I_CONTACT_ELIM = 15
133  integer, parameter :: IDX_I_RECOMPUTE_RESIDUAL = 16
134  integer, parameter :: IDX_I_ITERLOG = 21
135  integer, parameter :: IDX_I_TIMELOG = 22
136  integer, parameter :: IDX_I_LOGLEVEL = 24 ! 23 is steplog (svIarray)
137  integer, parameter :: IDX_I_DUMP = 31
138  integer, parameter :: IDX_I_DUMP_EXIT = 32
139  integer, parameter :: IDX_I_USEJAD = 33
140  integer, parameter :: IDX_I_NCOLOR_IN = 34
141  integer, parameter :: IDX_I_MAXRECYCLE_PRECOND = 35
142  integer, parameter :: IDX_I_MATVEC_IMPL = 36
143  integer, parameter :: IDX_I_PRECOND_IMPL = 37
144  integer, parameter :: IDX_I_NRECYCLE_PRECOND = 96
145  integer, parameter :: IDX_I_FLAG_NUMFACT = 97
146  integer, parameter :: IDX_I_FLAG_SYMBFACT = 98
147  integer, parameter :: IDX_I_SOLVER_TYPE = 99
148 
149  integer, parameter :: IDX_I_METHOD2 = 8
150  integer, parameter :: IDX_I_FLAG_CONVERGED = 81
151  integer, parameter :: IDX_I_FLAG_DIVERGED = 82
152 
153  integer, parameter :: IDX_I_SOLVER_OPT_S = 41
154  integer, parameter :: IDX_I_SOLVER_OPT_E = 50
155 
156  integer, parameter :: IDX_R_RESID = 1
157  integer, parameter :: IDX_R_SIGMA_DIAG = 2
158  integer, parameter :: IDX_R_OMEGA = 3
159  integer, parameter :: IDX_R_THRESH = 4
160  integer, parameter :: IDX_R_FILTER = 5
161  integer, parameter :: IDX_R_PENALTY = 11
162  integer, parameter :: IDX_R_PENALTY_ALPHA = 12
163  ! real-valued solver options, mirroring the integer SOLVER_OPT block (41:50)
164  integer, parameter :: IDX_R_SOLVER_OPT_S = 41
165  integer, parameter :: IDX_R_SOLVER_OPT_E = 50
166 
167  ! storage format the matvec and the preconditioner work in, selected by
168  ! IDX_I_MATVEC_IMPL / IDX_I_PRECOND_IMPL. BSR is hecmwST_matrix's own format and is
169  ! the only one every build carries; the others keep a private copy in their own layout
170  ! and are built only for the architecture cmake -DARCH= names, so the dispatchers fall
171  ! back to BSR for a format this build does not have. The names match the MATRIXFORMAT
172  ! values accepted by the cnt file.
173  integer(kind=kint), parameter :: hecmw_matvec_impl_bsr = 0
174  integer(kind=kint), parameter :: hecmw_matvec_impl_csr = 1
175  integer(kind=kint), parameter :: hecmw_matvec_impl_sblas = 2
176  integer(kind=kint), parameter :: hecmw_precond_impl_bsr = 0
177  integer(kind=kint), parameter :: hecmw_precond_impl_csr = 1
178  integer(kind=kint), parameter :: hecmw_precond_impl_sblas = 2
179 
180  ! cmake -DARCH= names the constants above through the format it defaults to; without
181  ! it the build defaults to BSR. Both initializers of hecmwST_matrix read these, so
182  ! the fallback stays in one place.
183 #ifndef HECMW_ARCH_DEFAULT_MATVEC_IMPL
184 #define HECMW_ARCH_DEFAULT_MATVEC_IMPL HECMW_MATVEC_IMPL_BSR
185 #endif
186 #ifndef HECMW_ARCH_DEFAULT_PRECOND_IMPL
187 #define HECMW_ARCH_DEFAULT_PRECOND_IMPL HECMW_PRECOND_IMPL_BSR
188 #endif
189  integer(kind=kint), parameter :: hecmw_matvec_impl_default = hecmw_arch_default_matvec_impl
190  integer(kind=kint), parameter :: hecmw_precond_impl_default = hecmw_arch_default_precond_impl
191 
192 contains
193 
194  subroutine hecmw_mat_clear( hecMAT )
195  type(hecmwst_matrix) :: hecmat
196 
197  hecmat%D = 0.0d0
198  hecmat%AL = 0.0d0
199  hecmat%AU = 0.0d0
200  call hecmw_mat_set_penalized( hecmat, 0 )
201  call hecmw_mat_set_penalty_alpha( hecmat, 0.d0 )
202  end subroutine hecmw_mat_clear
203 
204  subroutine hecmw_mat_clear_b( hecMAT )
205  type(hecmwst_matrix) :: hecmat
206 
207  hecmat%B = 0.0d0
208  call hecmw_mat_set_penalized_b( hecmat, 0 )
209  end subroutine hecmw_mat_clear_b
210 
211  subroutine hecmw_mat_init( hecMAT )
212  type(hecmwst_matrix) :: hecmat
213 
214  call hecmw_nullify_matrix( hecmat )
215 
216  hecmat%Iarray = 0
217  hecmat%Rarray = 0.d0
218 
219  call hecmw_mat_set_iter( hecmat, 100 )
220  call hecmw_mat_set_method( hecmat, 1 )
221  call hecmw_mat_set_precond( hecmat, 1 )
222  call hecmw_mat_set_nset( hecmat, 0 )
223  call hecmw_mat_set_iterpremax( hecmat, 1 )
224  call hecmw_mat_set_nrest( hecmat, 10 )
225  call hecmw_mat_set_nbfgs( hecmat, 0 )
226  call hecmw_mat_set_scaling( hecmat, 0 )
227  call hecmw_mat_set_iterlog( hecmat, 0 )
228  call hecmw_mat_set_timelog( hecmat, 0 )
229  call hecmw_mat_set_loglevel( hecmat, -1 ) ! -1 = unset: consumers fall back to their default
230  call hecmw_mat_set_dump( hecmat, 0 )
231  call hecmw_mat_set_dump_exit( hecmat, 0 )
232  call hecmw_mat_set_usejad( hecmat, 0 )
235  call hecmw_mat_set_ncolor_in( hecmat, 10 )
236  call hecmw_mat_set_estcond( hecmat, 0 )
237  call hecmw_mat_set_recompute_residual( hecmat, 0 ) ! 0 = unset: each iterative solver falls back to its own period
238  call hecmw_mat_set_maxrecycle_precond( hecmat, 3 )
239 
240  call hecmw_mat_set_resid( hecmat, 1.d-8 )
241  call hecmw_mat_set_sigma_diag( hecmat, 1.d0 )
242  call hecmw_mat_set_omega( hecmat, 1.d0 )
243  call hecmw_mat_set_thresh( hecmat, 0.10d0 )
244  call hecmw_mat_set_filter( hecmat, 0.10d0 )
245 
246  call hecmw_mat_set_penalized( hecmat, 0 )
247  call hecmw_mat_set_penalty( hecmat, 1.d+4 )
248  call hecmw_mat_set_penalty_alpha( hecmat, 0.d0 )
249  call hecmw_mat_set_mpc_method( hecmat, 0 )
250 
251  call hecmw_mat_reset_nrecycle_precond( hecmat )
252  call hecmw_mat_set_flag_numfact( hecmat, 1 )
253  call hecmw_mat_set_flag_symbfact( hecmat, 1 )
254  call hecmw_mat_set_solver_type( hecmat, 1 )
255  end subroutine hecmw_mat_init
256 
257  subroutine hecmw_mat_finalize( hecMAT )
258  type(hecmwst_matrix) :: hecmat
259  if (associated(hecmat%D)) deallocate(hecmat%D)
260  if (associated(hecmat%B)) deallocate(hecmat%B)
261  if (associated(hecmat%X)) deallocate(hecmat%X)
262  if (associated(hecmat%AL)) deallocate(hecmat%AL)
263  if (associated(hecmat%AU)) deallocate(hecmat%AU)
264  if (associated(hecmat%indexL)) deallocate(hecmat%indexL)
265  if (associated(hecmat%indexU)) deallocate(hecmat%indexU)
266  if (associated(hecmat%itemL)) deallocate(hecmat%itemL)
267  if (associated(hecmat%itemU)) deallocate(hecmat%itemU)
268 #ifdef _OPENACC
269  if (associated(hecmat%A)) deallocate(hecmat%A)
270  if (associated(hecmat%indexA)) deallocate(hecmat%indexA)
271  if (associated(hecmat%itemA)) deallocate(hecmat%itemA)
272 #endif
273  end subroutine hecmw_mat_finalize
274 
275  subroutine hecmw_mat_copy_profile( hecMATorg, hecMAT )
276  type(hecmwst_matrix), intent(in) :: hecmatorg
277  type(hecmwst_matrix), intent(inout) :: hecmat
278  hecmat%N = hecmatorg%N
279  hecmat%NP = hecmatorg%NP
280  hecmat%NDOF = hecmatorg%NDOF
281  hecmat%NPL = hecmatorg%NPL
282  hecmat%NPU = hecmatorg%NPU
283  allocate(hecmat%indexL(0:size(hecmatorg%indexL)-1))
284  allocate(hecmat%indexU(0:size(hecmatorg%indexU)-1))
285  allocate(hecmat%itemL (size(hecmatorg%itemL )))
286  allocate(hecmat%itemU (size(hecmatorg%itemU )))
287  allocate(hecmat%D (size(hecmatorg%D )))
288  allocate(hecmat%AL(size(hecmatorg%AL)))
289  allocate(hecmat%AU(size(hecmatorg%AU)))
290  allocate(hecmat%B (size(hecmatorg%B )))
291  allocate(hecmat%X (size(hecmatorg%X )))
292  hecmat%indexL = hecmatorg%indexL
293  hecmat%indexU = hecmatorg%indexU
294  hecmat%itemL = hecmatorg%itemL
295  hecmat%itemU = hecmatorg%itemU
296  hecmat%D = 0.d0
297  hecmat%AL = 0.d0
298  hecmat%AU = 0.d0
299  hecmat%B = 0.d0
300  hecmat%X = 0.d0
301  end subroutine hecmw_mat_copy_profile
302 
303  subroutine hecmw_mat_copy_val( hecMATorg, hecMAT )
304  type(hecmwst_matrix), intent(in) :: hecmatorg
305  type(hecmwst_matrix), intent(inout) :: hecmat
306  integer(kind=kint) :: ierr
307  integer(kind=kint) :: i
308  ierr = 0
309  if (hecmat%N /= hecmatorg%N) ierr = 1
310  if (hecmat%NP /= hecmatorg%NP) ierr = 1
311  if (hecmat%NDOF /= hecmatorg%NDOF) ierr = 1
312  if (hecmat%NPL /= hecmatorg%NPL) ierr = 1
313  if (hecmat%NPU /= hecmatorg%NPU) ierr = 1
314  if (ierr /= 0) then
315  write(0,*) 'ERROR: hecmw_mat_copy_val: different profile'
316  stop
317  endif
318  do i = 1, size(hecmat%D)
319  hecmat%D(i) = hecmatorg%D(i)
320  enddo
321  do i = 1, size(hecmat%AL)
322  hecmat%AL(i) = hecmatorg%AL(i)
323  enddo
324  do i = 1, size(hecmat%AU)
325  hecmat%AU(i) = hecmatorg%AU(i)
326  enddo
327  end subroutine hecmw_mat_copy_val
328 
329  subroutine hecmw_mat_set_iter( hecMAT, iter )
330  type(hecmwst_matrix) :: hecmat
331  integer(kind=kint) :: iter
332 
333  hecmat%Iarray(idx_i_iter) = iter
334  end subroutine hecmw_mat_set_iter
335 
336  function hecmw_mat_get_iter( hecMAT )
337  integer(kind=kint) :: hecmw_mat_get_iter
338  type(hecmwst_matrix) :: hecmat
339 
340  hecmw_mat_get_iter = hecmat%Iarray(idx_i_iter)
341  end function hecmw_mat_get_iter
342 
343  subroutine hecmw_mat_set_method( hecMAT, method )
344  type(hecmwst_matrix) :: hecmat
345  integer(kind=kint) :: method
346 
347  hecmat%Iarray(idx_i_method) = method
348  end subroutine hecmw_mat_set_method
349 
350  function hecmw_mat_get_method( hecMAT )
351  integer(kind=kint) :: hecmw_mat_get_method
352  type(hecmwst_matrix) :: hecmat
353 
354  hecmw_mat_get_method = hecmat%Iarray(idx_i_method)
355  end function hecmw_mat_get_method
356 
357  subroutine hecmw_mat_set_method2( hecMAT, method2 )
358  type(hecmwst_matrix) :: hecmat
359  integer(kind=kint) :: method2
360 
361  hecmat%Iarray(idx_i_method2) = method2
362  end subroutine hecmw_mat_set_method2
363 
364  function hecmw_mat_get_method2( hecMAT )
365  integer(kind=kint) :: hecmw_mat_get_method2
366  type(hecmwst_matrix) :: hecmat
367 
368  hecmw_mat_get_method2 = hecmat%Iarray(idx_i_method2)
369  end function hecmw_mat_get_method2
370 
371  subroutine hecmw_mat_set_precond( hecMAT, precond )
372  type(hecmwst_matrix) :: hecmat
373  integer(kind=kint) :: precond
374 
375  hecmat%Iarray(idx_i_precond) = precond
376  end subroutine hecmw_mat_set_precond
377 
378  function hecmw_mat_get_precond( hecMAT )
379  integer(kind=kint) :: hecmw_mat_get_precond
380  type(hecmwst_matrix) :: hecmat
381 
382  hecmw_mat_get_precond = hecmat%Iarray(idx_i_precond)
383  end function hecmw_mat_get_precond
384 
385  subroutine hecmw_mat_set_nset( hecMAT, nset )
386  type(hecmwst_matrix) :: hecmat
387  integer(kind=kint) :: nset
388 
389  hecmat%Iarray(idx_i_nset) = nset
390  end subroutine hecmw_mat_set_nset
391 
392  function hecmw_mat_get_nset( hecMAT )
393  integer(kind=kint) :: hecmw_mat_get_nset
394  type(hecmwst_matrix) :: hecmat
395 
396  hecmw_mat_get_nset = hecmat%Iarray(idx_i_nset)
397  end function hecmw_mat_get_nset
398 
399  subroutine hecmw_mat_set_iterpremax( hecMAT, iterpremax )
400  type(hecmwst_matrix) :: hecmat
401  integer(kind=kint) :: iterpremax
402 
403  if (iterpremax.lt.0) iterpremax= 0
404  if (iterpremax.gt.4) iterpremax= 4
405 
406  hecmat%Iarray(idx_i_iterpremax) = iterpremax
407  end subroutine hecmw_mat_set_iterpremax
408 
409  function hecmw_mat_get_iterpremax( hecMAT )
410  integer(kind=kint) :: hecmw_mat_get_iterpremax
411  type(hecmwst_matrix) :: hecmat
412 
413  hecmw_mat_get_iterpremax = hecmat%Iarray(idx_i_iterpremax)
414  end function hecmw_mat_get_iterpremax
415 
416  subroutine hecmw_mat_set_nrest( hecMAT, nrest )
417  type(hecmwst_matrix) :: hecmat
418  integer(kind=kint) :: nrest
419 
420  hecmat%Iarray(idx_i_nrest) = nrest
421  end subroutine hecmw_mat_set_nrest
422 
423  function hecmw_mat_get_nrest( hecMAT )
424  integer(kind=kint) :: hecmw_mat_get_nrest
425  type(hecmwst_matrix) :: hecmat
426 
427  hecmw_mat_get_nrest = hecmat%Iarray(idx_i_nrest)
428  end function hecmw_mat_get_nrest
429 
430  subroutine hecmw_mat_set_nbfgs( hecMAT, nbfgs )
431  type(hecmwst_matrix) :: hecmat
432  integer(kind=kint) :: nbfgs
433 
434  hecmat%Iarray(idx_i_nbfgs) = nbfgs
435  end subroutine hecmw_mat_set_nbfgs
436 
437  function hecmw_mat_get_nbfgs( hecMAT )
438  integer(kind=kint) :: hecmw_mat_get_nbfgs
439  type(hecmwst_matrix) :: hecmat
440 
441  hecmw_mat_get_nbfgs = hecmat%Iarray(idx_i_nbfgs)
442  end function hecmw_mat_get_nbfgs
443 
444  subroutine hecmw_mat_set_scaling( hecMAT, scaling )
445  type(hecmwst_matrix) :: hecmat
446  integer(kind=kint) :: scaling
447 
448  hecmat%Iarray(idx_i_scaling) = scaling
449  end subroutine hecmw_mat_set_scaling
450 
451  function hecmw_mat_get_scaling( hecMAT )
452  integer(kind=kint) :: hecmw_mat_get_scaling
453  type(hecmwst_matrix) :: hecmat
454 
455  hecmw_mat_get_scaling = hecmat%Iarray(idx_i_scaling)
456  end function hecmw_mat_get_scaling
457 
458  subroutine hecmw_mat_set_penalized( hecMAT, penalized )
459  type(hecmwst_matrix) :: hecmat
460  integer(kind=kint) :: penalized
461 
462  hecmat%Iarray(idx_i_penalized) = penalized
463  end subroutine hecmw_mat_set_penalized
464 
465  function hecmw_mat_get_penalized( hecMAT )
466  integer(kind=kint) :: hecmw_mat_get_penalized
467  type(hecmwst_matrix) :: hecmat
468 
469  hecmw_mat_get_penalized = hecmat%Iarray(idx_i_penalized)
470  end function hecmw_mat_get_penalized
471 
472  subroutine hecmw_mat_set_penalized_b( hecMAT, penalized_b )
473  type(hecmwst_matrix) :: hecmat
474  integer(kind=kint) :: penalized_b
475 
476  hecmat%Iarray(idx_i_penalized_b) = penalized_b
477  end subroutine hecmw_mat_set_penalized_b
478 
479  function hecmw_mat_get_penalized_b( hecMAT )
480  integer(kind=kint) :: hecmw_mat_get_penalized_b
481  type(hecmwst_matrix) :: hecmat
482 
483  hecmw_mat_get_penalized_b = hecmat%Iarray(idx_i_penalized_b)
484  end function hecmw_mat_get_penalized_b
485 
486  subroutine hecmw_mat_set_mpc_method( hecMAT, mpc_method )
487  type(hecmwst_matrix) :: hecmat
488  integer(kind=kint) :: mpc_method
489 
490  hecmat%Iarray(idx_i_mpc_method) = mpc_method
491  end subroutine hecmw_mat_set_mpc_method
492 
493  function hecmw_mat_get_mpc_method( hecMAT )
494  integer(kind=kint) :: hecmw_mat_get_mpc_method
495  type(hecmwst_matrix) :: hecmat
496 
497  hecmw_mat_get_mpc_method = hecmat%Iarray(idx_i_mpc_method)
498  end function hecmw_mat_get_mpc_method
499 
500  function hecmw_mat_get_estcond( hecMAT )
501  integer(kind=kint) :: hecmw_mat_get_estcond
502  type(hecmwst_matrix) :: hecmat
503  hecmw_mat_get_estcond = hecmat%Iarray(idx_i_estcond)
504  end function hecmw_mat_get_estcond
505 
506  subroutine hecmw_mat_set_estcond( hecMAT, estcond )
507  type(hecmwst_matrix) :: hecmat
508  integer(kind=kint) :: estcond
509  hecmat%Iarray(idx_i_estcond) = estcond
510  end subroutine hecmw_mat_set_estcond
511 
513  integer(kind=kint) :: hecmw_mat_get_recompute_residual
514  type(hecmwst_matrix) :: hecmat
515  hecmw_mat_get_recompute_residual = hecmat%Iarray(idx_i_recompute_residual)
517 
518  subroutine hecmw_mat_set_recompute_residual( hecMAT, recompute_residual )
519  type(hecmwst_matrix) :: hecmat
520  integer(kind=kint) :: recompute_residual
521  hecmat%Iarray(idx_i_recompute_residual) = recompute_residual
522  end subroutine hecmw_mat_set_recompute_residual
523 
524  function hecmw_mat_get_contact_elim( hecMAT )
525  integer(kind=kint) :: hecmw_mat_get_contact_elim
526  type(hecmwst_matrix) :: hecmat
527  hecmw_mat_get_contact_elim = hecmat%Iarray(idx_i_contact_elim)
528  end function hecmw_mat_get_contact_elim
529 
530  subroutine hecmw_mat_set_contact_elim( hecMAT, contact_elim )
531  type(hecmwst_matrix) :: hecmat
532  integer(kind=kint) :: contact_elim
533  hecmat%Iarray(idx_i_contact_elim) = contact_elim
534  end subroutine hecmw_mat_set_contact_elim
535 
536  subroutine hecmw_mat_set_iterlog( hecMAT, iterlog )
537  type(hecmwst_matrix) :: hecmat
538  integer(kind=kint) :: iterlog
539 
540  hecmat%Iarray(idx_i_iterlog) = iterlog
541  end subroutine hecmw_mat_set_iterlog
542 
543  function hecmw_mat_get_iterlog( hecMAT )
544  integer(kind=kint) :: hecmw_mat_get_iterlog
545  type(hecmwst_matrix) :: hecmat
546 
547  hecmw_mat_get_iterlog = hecmat%Iarray(idx_i_iterlog)
548  end function hecmw_mat_get_iterlog
549 
550  subroutine hecmw_mat_set_timelog( hecMAT, timelog )
551  type(hecmwst_matrix) :: hecmat
552  integer(kind=kint) :: timelog
553 
554  hecmat%Iarray(idx_i_timelog) = timelog
555  end subroutine hecmw_mat_set_timelog
556 
557  function hecmw_mat_get_timelog( hecMAT )
558  integer(kind=kint) :: hecmw_mat_get_timelog
559  type(hecmwst_matrix) :: hecmat
560 
561  hecmw_mat_get_timelog = hecmat%Iarray(idx_i_timelog)
562  end function hecmw_mat_get_timelog
563 
567  subroutine hecmw_mat_set_loglevel( hecMAT, loglevel )
568  type(hecmwst_matrix) :: hecmat
569  integer(kind=kint) :: loglevel
570 
571  hecmat%Iarray(idx_i_loglevel) = loglevel
572  end subroutine hecmw_mat_set_loglevel
573 
574  function hecmw_mat_get_loglevel( hecMAT )
575  integer(kind=kint) :: hecmw_mat_get_loglevel
576  type(hecmwst_matrix) :: hecmat
577 
578  hecmw_mat_get_loglevel = hecmat%Iarray(idx_i_loglevel)
579  end function hecmw_mat_get_loglevel
580 
581  function hecmw_mat_get_dump( hecMAT )
582  integer(kind=kint) :: hecmw_mat_get_dump
583  type(hecmwst_matrix) :: hecmat
584  hecmw_mat_get_dump = hecmat%Iarray(idx_i_dump)
585  end function hecmw_mat_get_dump
586 
587  subroutine hecmw_mat_set_dump( hecMAT, dump_type )
588  type(hecmwst_matrix) :: hecmat
589  integer(kind=kint) :: dump_type
590  hecmat%Iarray(idx_i_dump) = dump_type
591  end subroutine hecmw_mat_set_dump
592 
593  function hecmw_mat_get_dump_exit( hecMAT )
594  integer(kind=kint) :: hecmw_mat_get_dump_exit
595  type(hecmwst_matrix) :: hecmat
596  hecmw_mat_get_dump_exit = hecmat%Iarray(idx_i_dump_exit)
597  end function hecmw_mat_get_dump_exit
598 
599  subroutine hecmw_mat_set_dump_exit( hecMAT, dump_exit )
600  type(hecmwst_matrix) :: hecmat
601  integer(kind=kint) :: dump_exit
602  hecmat%Iarray(idx_i_dump_exit) = dump_exit
603  end subroutine hecmw_mat_set_dump_exit
604 
605  function hecmw_mat_get_usejad( hecMAT )
606  integer(kind=kint) :: hecmw_mat_get_usejad
607  type(hecmwst_matrix) :: hecmat
608  hecmw_mat_get_usejad = hecmat%Iarray(idx_i_usejad)
609  end function hecmw_mat_get_usejad
610 
611  subroutine hecmw_mat_set_usejad( hecMAT, usejad )
612  type(hecmwst_matrix) :: hecmat
613  integer(kind=kint) :: usejad
614  hecmat%Iarray(idx_i_usejad) = usejad
615  end subroutine hecmw_mat_set_usejad
616 
617  function hecmw_mat_get_matvec_impl( hecMAT )
618  integer(kind=kint) :: hecmw_mat_get_matvec_impl
619  type(hecmwst_matrix) :: hecmat
620  hecmw_mat_get_matvec_impl = hecmat%Iarray(idx_i_matvec_impl)
621  end function hecmw_mat_get_matvec_impl
622 
623  subroutine hecmw_mat_set_matvec_impl( hecMAT, matvec_impl )
624  type(hecmwst_matrix) :: hecmat
625  integer(kind=kint) :: matvec_impl
626  hecmat%Iarray(idx_i_matvec_impl) = matvec_impl
627  end subroutine hecmw_mat_set_matvec_impl
628 
629  function hecmw_mat_get_precond_impl( hecMAT )
630  integer(kind=kint) :: hecmw_mat_get_precond_impl
631  type(hecmwst_matrix) :: hecmat
632  hecmw_mat_get_precond_impl = hecmat%Iarray(idx_i_precond_impl)
633  end function hecmw_mat_get_precond_impl
634 
635  subroutine hecmw_mat_set_precond_impl( hecMAT, precond_impl )
636  type(hecmwst_matrix) :: hecmat
637  integer(kind=kint) :: precond_impl
638  hecmat%Iarray(idx_i_precond_impl) = precond_impl
639  end subroutine hecmw_mat_set_precond_impl
640 
641  function hecmw_mat_get_ncolor_in( hecMAT )
642  integer(kind=kint) :: hecmw_mat_get_ncolor_in
643  type(hecmwst_matrix) :: hecmat
644  hecmw_mat_get_ncolor_in = hecmat%Iarray(idx_i_ncolor_in)
645  end function hecmw_mat_get_ncolor_in
646 
647  subroutine hecmw_mat_set_ncolor_in( hecMAT, ncolor_in )
648  type(hecmwst_matrix) :: hecmat
649  integer(kind=kint) :: ncolor_in
650  hecmat%Iarray(idx_i_ncolor_in) = ncolor_in
651  end subroutine hecmw_mat_set_ncolor_in
652 
654  integer(kind=kint) :: hecmw_mat_get_maxrecycle_precond
655  type(hecmwst_matrix) :: hecmat
656  hecmw_mat_get_maxrecycle_precond = hecmat%Iarray(idx_i_maxrecycle_precond)
658 
659  subroutine hecmw_mat_set_maxrecycle_precond( hecMAT, maxrecycle_precond )
660  type(hecmwst_matrix) :: hecmat
661  integer(kind=kint) :: maxrecycle_precond
662  if (maxrecycle_precond > 100) maxrecycle_precond = 100
663  hecmat%Iarray(idx_i_maxrecycle_precond) = maxrecycle_precond
664  end subroutine hecmw_mat_set_maxrecycle_precond
665 
667  integer(kind=kint) :: hecmw_mat_get_nrecycle_precond
668  type(hecmwst_matrix) :: hecmat
669  hecmw_mat_get_nrecycle_precond = hecmat%Iarray(idx_i_nrecycle_precond)
670  end function hecmw_mat_get_nrecycle_precond
671 
672  subroutine hecmw_mat_reset_nrecycle_precond( hecMAT )
673  type(hecmwst_matrix) :: hecmat
674  hecmat%Iarray(idx_i_nrecycle_precond) = 0
675  end subroutine hecmw_mat_reset_nrecycle_precond
676 
677  subroutine hecmw_mat_incr_nrecycle_precond( hecMAT )
678  type(hecmwst_matrix) :: hecmat
679  hecmat%Iarray(idx_i_nrecycle_precond) = hecmat%Iarray(idx_i_nrecycle_precond) + 1
680  end subroutine hecmw_mat_incr_nrecycle_precond
681 
682  function hecmw_mat_get_flag_numfact( hecMAT )
683  integer(kind=kint) :: hecmw_mat_get_flag_numfact
684  type(hecmwst_matrix) :: hecmat
685  hecmw_mat_get_flag_numfact = hecmat%Iarray(idx_i_flag_numfact)
686  end function hecmw_mat_get_flag_numfact
687 
688  subroutine hecmw_mat_set_flag_numfact( hecMAT, flag_numfact )
689  type(hecmwst_matrix) :: hecmat
690  integer(kind=kint) :: flag_numfact
691  hecmat%Iarray(idx_i_flag_numfact) = flag_numfact
692  end subroutine hecmw_mat_set_flag_numfact
693 
694  function hecmw_mat_get_flag_symbfact( hecMAT )
695  integer(kind=kint) :: hecmw_mat_get_flag_symbfact
696  type(hecmwst_matrix) :: hecmat
697  hecmw_mat_get_flag_symbfact = hecmat%Iarray(idx_i_flag_symbfact)
698  end function hecmw_mat_get_flag_symbfact
699 
700  subroutine hecmw_mat_set_flag_symbfact( hecMAT, flag_symbfact )
701  type(hecmwst_matrix) :: hecmat
702  integer(kind=kint) :: flag_symbfact
703  hecmat%Iarray(idx_i_flag_symbfact) = flag_symbfact
704  end subroutine hecmw_mat_set_flag_symbfact
705 
706  subroutine hecmw_mat_clear_flag_symbfact( hecMAT )
707  type(hecmwst_matrix) :: hecmat
708  hecmat%Iarray(idx_i_flag_symbfact) = 0
709  end subroutine hecmw_mat_clear_flag_symbfact
710 
711  function hecmw_mat_get_solver_type( hecMAT )
712  integer(kind=kint) :: hecmw_mat_get_solver_type
713  type(hecmwst_matrix) :: hecmat
714  hecmw_mat_get_solver_type = hecmat%Iarray(idx_i_solver_type)
715  end function hecmw_mat_get_solver_type
716 
717  subroutine hecmw_mat_set_solver_type( hecMAT, solver_type )
718  type(hecmwst_matrix) :: hecmat
719  integer(kind=kint) :: solver_type
720  hecmat%Iarray(idx_i_solver_type) = solver_type
721  end subroutine hecmw_mat_set_solver_type
722 
723  subroutine hecmw_mat_set_flag_converged( hecMAT, flag_converged )
724  type(hecmwst_matrix) :: hecmat
725  integer(kind=kint) :: flag_converged
726  hecmat%Iarray(idx_i_flag_converged) = flag_converged
727  end subroutine hecmw_mat_set_flag_converged
728 
729  function hecmw_mat_get_flag_converged( hecMAT )
730  integer(kind=kint) :: hecmw_mat_get_flag_converged
731  type(hecmwst_matrix) :: hecmat
732  hecmw_mat_get_flag_converged = hecmat%Iarray(idx_i_flag_converged)
733  end function hecmw_mat_get_flag_converged
734 
735  subroutine hecmw_mat_set_flag_diverged( hecMAT, flag_diverged )
736  type(hecmwst_matrix) :: hecmat
737  integer(kind=kint) :: flag_diverged
738  hecmat%Iarray(idx_i_flag_diverged) = flag_diverged
739  end subroutine hecmw_mat_set_flag_diverged
740 
741  function hecmw_mat_get_flag_diverged( hecMAT )
742  integer(kind=kint) :: hecmw_mat_get_flag_diverged
743  type(hecmwst_matrix) :: hecmat
744  hecmw_mat_get_flag_diverged = hecmat%Iarray(idx_i_flag_diverged)
745  end function hecmw_mat_get_flag_diverged
746 
747  subroutine hecmw_mat_set_solver_opt( hecMAT, solver_opt )
748  type(hecmwst_matrix) :: hecmat
749  integer(kind=kint) :: solver_opt(:)
750  integer(kind=kint) :: nopt
751  nopt = idx_i_solver_opt_e - idx_i_solver_opt_s + 1
752  hecmat%Iarray(idx_i_solver_opt_s:idx_i_solver_opt_e) = solver_opt(1:nopt)
753  end subroutine hecmw_mat_set_solver_opt
754 
755  subroutine hecmw_mat_get_solver_opt( hecMAT, solver_opt )
756  type(hecmwst_matrix) :: hecmat
757  integer(kind=kint) :: solver_opt(:)
758  integer(kind=kint) :: nopt
759  nopt = idx_i_solver_opt_e - idx_i_solver_opt_s + 1
760  solver_opt(1:nopt) = hecmat%Iarray(idx_i_solver_opt_s:idx_i_solver_opt_e)
761  end subroutine hecmw_mat_get_solver_opt
762 
763  subroutine hecmw_mat_set_solver_ropt( hecMAT, solver_ropt )
764  type(hecmwst_matrix) :: hecmat
765  real(kind=kreal) :: solver_ropt(:)
766  integer(kind=kint) :: nopt
767  nopt = idx_r_solver_opt_e - idx_r_solver_opt_s + 1
768  hecmat%Rarray(idx_r_solver_opt_s:idx_r_solver_opt_e) = solver_ropt(1:nopt)
769  end subroutine hecmw_mat_set_solver_ropt
770 
771  subroutine hecmw_mat_get_solver_ropt( hecMAT, solver_ropt )
772  type(hecmwst_matrix) :: hecmat
773  real(kind=kreal) :: solver_ropt(:)
774  integer(kind=kint) :: nopt
775  nopt = idx_r_solver_opt_e - idx_r_solver_opt_s + 1
776  solver_ropt(1:nopt) = hecmat%Rarray(idx_r_solver_opt_s:idx_r_solver_opt_e)
777  end subroutine hecmw_mat_get_solver_ropt
778 
779  subroutine hecmw_mat_set_resid( hecMAT, resid )
780  type(hecmwst_matrix) :: hecmat
781  real(kind=kreal) :: resid
782 
783  hecmat%Rarray(idx_r_resid) = resid
784  end subroutine hecmw_mat_set_resid
785 
786  function hecmw_mat_get_resid( hecMAT )
787  real(kind=kreal) :: hecmw_mat_get_resid
788  type(hecmwst_matrix) :: hecmat
789 
790  hecmw_mat_get_resid = hecmat%Rarray(idx_r_resid)
791  end function hecmw_mat_get_resid
792 
793  subroutine hecmw_mat_set_sigma_diag( hecMAT, sigma_diag )
794  type(hecmwst_matrix) :: hecmat
795  real(kind=kreal) :: sigma_diag
796 
797  if( sigma_diag < 0.d0 ) then
798  hecmat%Rarray(idx_r_sigma_diag) = -1.d0
799  elseif( sigma_diag < 1.d0 ) then
800  hecmat%Rarray(idx_r_sigma_diag) = 1.d0
801  elseif( sigma_diag > 2.d0 ) then
802  hecmat%Rarray(idx_r_sigma_diag) = 2.d0
803  else
804  hecmat%Rarray(idx_r_sigma_diag) = sigma_diag
805  endif
806  end subroutine hecmw_mat_set_sigma_diag
807 
808  function hecmw_mat_get_sigma_diag( hecMAT )
809  real(kind=kreal) :: hecmw_mat_get_sigma_diag
810  type(hecmwst_matrix) :: hecmat
811 
812  hecmw_mat_get_sigma_diag = hecmat%Rarray(idx_r_sigma_diag)
813  end function hecmw_mat_get_sigma_diag
814 
815  subroutine hecmw_mat_set_omega( hecMAT, omega )
816  type(hecmwst_matrix) :: hecmat
817  real(kind=kreal) :: omega
818 
819  ! the preconditioner is defined only for 0 < omega < 2; anything else, including
820  ! values within machine epsilon of 0 or 2, falls back to plain SSOR
821  if (omega < 0.d0 .or. omega > 2.d0 .or. abs(omega) < epsilon(1.d0) &
822  .or. abs(omega - 2.d0) < epsilon(1.d0)) then
823  hecmat%Rarray(idx_r_omega) = 1.d0
824  else
825  hecmat%Rarray(idx_r_omega) = omega
826  endif
827  end subroutine hecmw_mat_set_omega
828 
829  function hecmw_mat_get_omega( hecMAT )
830  real(kind=kreal) :: hecmw_mat_get_omega
831  type(hecmwst_matrix) :: hecmat
832 
833  hecmw_mat_get_omega = hecmat%Rarray(idx_r_omega)
834  end function hecmw_mat_get_omega
835 
836  subroutine hecmw_mat_set_thresh( hecMAT, thresh )
837  type(hecmwst_matrix) :: hecmat
838  real(kind=kreal) :: thresh
839 
840  hecmat%Rarray(idx_r_thresh) = thresh
841  end subroutine hecmw_mat_set_thresh
842 
843  function hecmw_mat_get_thresh( hecMAT )
844  real(kind=kreal) :: hecmw_mat_get_thresh
845  type(hecmwst_matrix) :: hecmat
846 
847  hecmw_mat_get_thresh = hecmat%Rarray(idx_r_thresh)
848  end function hecmw_mat_get_thresh
849 
850  subroutine hecmw_mat_set_filter( hecMAT, filter )
851  type(hecmwst_matrix) :: hecmat
852  real(kind=kreal) :: filter
853 
854  hecmat%Rarray(idx_r_filter) = filter
855  end subroutine hecmw_mat_set_filter
856 
857  function hecmw_mat_get_filter( hecMAT )
858  real(kind=kreal) :: hecmw_mat_get_filter
859  type(hecmwst_matrix) :: hecmat
860 
861  hecmw_mat_get_filter = hecmat%Rarray(idx_r_filter)
862  end function hecmw_mat_get_filter
863 
864  subroutine hecmw_mat_set_penalty( hecMAT, penalty )
865  type(hecmwst_matrix) :: hecmat
866  real(kind=kreal) :: penalty
867 
868  hecmat%Rarray(idx_r_penalty) = penalty
869  end subroutine hecmw_mat_set_penalty
870 
871  function hecmw_mat_get_penalty( hecMAT )
872  real(kind=kreal) :: hecmw_mat_get_penalty
873  type(hecmwst_matrix) :: hecmat
874 
875  hecmw_mat_get_penalty = hecmat%Rarray(idx_r_penalty)
876  end function hecmw_mat_get_penalty
877 
878  subroutine hecmw_mat_set_penalty_alpha( hecMAT, alpha )
879  type(hecmwst_matrix) :: hecmat
880  real(kind=kreal) :: alpha
881 
882  hecmat%Rarray(idx_r_penalty_alpha) = alpha
883  end subroutine hecmw_mat_set_penalty_alpha
884 
885  function hecmw_mat_get_penalty_alpha( hecMAT )
886  real(kind=kreal) :: hecmw_mat_get_penalty_alpha
887  type(hecmwst_matrix) :: hecmat
888 
889  hecmw_mat_get_penalty_alpha = hecmat%Rarray(idx_r_penalty_alpha)
890  end function hecmw_mat_get_penalty_alpha
891 
892  function hecmw_mat_diag_max(hecMAT, hecMESH)
893  real(kind=kreal) :: hecmw_mat_diag_max
894  type (hecmwst_matrix) :: hecmat
895  type (hecmwst_local_mesh) :: hecmesh
896  integer(kind=kint) :: ndiag, i
897 
898  hecmw_mat_diag_max = -1.0e20
899  ndiag = hecmat%NDOF**2 * hecmat%NP
900  do i = 1, ndiag
901  if( hecmat%D(i) > hecmw_mat_diag_max ) hecmw_mat_diag_max = hecmat%D(i)
902  enddo
904  end function hecmw_mat_diag_max
905 
909  function hecmw_mat_diag(hecMAT) result(diag)
910  type(hecmwst_matrix), intent(in), target :: hecmat
911  real(kind=kreal), pointer :: diag(:)
912  integer(kind=kint) :: i, k, idx, ndof, np
913 
914  ndof = hecmat%NDOF
915  np = hecmat%NP
916  allocate(diag(ndof * np))
917 
918  do i = 1, np
919  do k = 1, ndof
920  idx = ndof * ndof * (i - 1) + (k-1) * ndof + k
921  diag(ndof * (i - 1) + k) = hecmat%D(idx)
922  enddo
923  enddo
924  end function hecmw_mat_diag
925 
927  type (hecmwst_matrix) :: hecmat
928  integer(kind=kint) :: nrecycle, maxrecycle
929  if (hecmat%Iarray(idx_i_flag_symbfact) >= 1) then
930  hecmat%Iarray(idx_i_flag_numfact)=1
932  elseif (hecmat%Iarray(idx_i_flag_numfact) > 1) then
934  hecmat%Iarray(idx_i_flag_numfact) = 1
935  elseif (hecmat%Iarray(idx_i_flag_numfact) == 1) then
936  nrecycle = hecmw_mat_get_nrecycle_precond(hecmat)
937  maxrecycle = hecmw_mat_get_maxrecycle_precond(hecmat)
938  if ( nrecycle < maxrecycle ) then
939  hecmat%Iarray(idx_i_flag_numfact) = 0
941  else
943  endif
944  endif
945  end subroutine hecmw_mat_recycle_precond_setting
946 
947  subroutine hecmw_mat_substitute( dest, src )
948  type (hecmwst_matrix), intent(inout) :: dest
949  type (hecmwst_matrix), intent(inout) :: src
950  dest%N = src%N
951  dest%NP = src%NP
952  dest%NPL = src%NPL
953  dest%NPU = src%NPU
954  dest%NDOF = src%NDOF
955  if (associated(src%D)) dest%D => src%D
956  if (associated(src%B)) dest%B => src%B
957  if (associated(src%X)) dest%X => src%X
958  if (associated(src%AL)) dest%AL => src%AL
959  if (associated(src%AU)) dest%AU => src%AU
960  if (associated(src%indexL)) dest%indexL => src%indexL
961  if (associated(src%indexU)) dest%indexU => src%indexU
962  if (associated(src%itemL)) dest%itemL => src%itemL
963  if (associated(src%itemU)) dest%itemU => src%itemU
964  dest%Iarray(:) = src%Iarray(:)
965  dest%Rarray(:) = src%Rarray(:)
966  end subroutine hecmw_mat_substitute
967 
980  subroutine hecmw_mat_integrate( hecMAT )
981  type (hecmwst_matrix), intent(inout) :: hecmat
982 #ifdef _OPENACC
983  integer(kind=kint) :: i, j, k, nn, pre, pp, js, je
984 
985  nn = hecmat%NDOF * hecmat%NDOF
986  hecmat%NPA = hecmat%NP + hecmat%NPL + hecmat%NPU
987  if (associated(hecmat%A)) deallocate(hecmat%A)
988  if (associated(hecmat%indexA)) deallocate(hecmat%indexA)
989  if (associated(hecmat%itemA)) deallocate(hecmat%itemA)
990  allocate (hecmat%A(nn * hecmat%NPA))
991  allocate (hecmat%indexA(0:hecmat%NP))
992  allocate (hecmat%itemA(hecmat%NPA))
993  hecmat%indexA(0) = 0
994 
995  pre = 0
996  pp = 0
997  !$acc parallel loop private(i, j, k, pre, pp, jS, jE)
998  do i = 1, hecmat%NP
999  hecmat%indexA(i) = i + hecmat%indexL(i) + hecmat%indexU(i)
1000 
1001  pre = i - 1 + hecmat%indexU(i - 1)
1002  js= hecmat%indexL(i - 1) + 1
1003  je= hecmat%indexL(i )
1004  do j = js, je
1005  pp = pre + j
1006  hecmat%itemA(pp) = hecmat%itemL(j)
1007  do k = -nn+1, 0
1008  hecmat%A(nn * pp + k) = hecmat%AL(nn * j + k)
1009  enddo
1010  enddo
1011 
1012  pp = i + hecmat%indexU(i - 1) + hecmat%indexL(i)
1013  hecmat%itemA(pp) = i
1014  do k = -nn+1, 0
1015  hecmat%A(nn * pp + k) = hecmat%D(nn * i + k)
1016  enddo
1017 
1018  pre = i + hecmat%indexL(i)
1019  js= hecmat%indexU(i - 1) + 1
1020  je= hecmat%indexU(i )
1021  do j = js, je
1022  pp = pre + j
1023  hecmat%itemA(pp) = hecmat%itemU(j)
1024  do k = -nn+1, 0
1025  hecmat%A(nn * pp + k) = hecmat%AU(nn * j + k)
1026  enddo
1027  enddo
1028  enddo
1029  !$acc end parallel
1030 #endif
1031  end subroutine hecmw_mat_integrate
1032 
1033 end module hecmw_matrix_misc
integer(kind=kint) function, public hecmw_mat_get_solver_type(hecMAT)
subroutine, public hecmw_mat_set_usejad(hecMAT, usejad)
real(kind=kreal) function, dimension(:), pointer, public hecmw_mat_diag(hecMAT)
Extract diagonal components from matrix D into a 1D vector Returns: diag(i) = D(ndof*ndof*(node-1) + ...
subroutine, public hecmw_mat_set_ncolor_in(hecMAT, ncolor_in)
integer(kind=kint) function, public hecmw_mat_get_flag_diverged(hecMAT)
subroutine, public hecmw_mat_integrate(hecMAT)
Integrate matrix components into a single array for efficient access.
integer(kind=kint), parameter, public hecmw_matvec_impl_default
real(kind=kreal) function, public hecmw_mat_get_omega(hecMAT)
subroutine, public hecmw_mat_clear_flag_symbfact(hecMAT)
real(kind=kreal) function, public hecmw_mat_get_sigma_diag(hecMAT)
real(kind=kreal) function, public hecmw_mat_diag_max(hecMAT, hecMESH)
integer(kind=kint) function, public hecmw_mat_get_iterpremax(hecMAT)
subroutine, public hecmw_mat_set_contact_elim(hecMAT, contact_elim)
integer(kind=kint) function, public hecmw_mat_get_dump_exit(hecMAT)
integer(kind=kint) function, public hecmw_mat_get_nrest(hecMAT)
subroutine, public hecmw_mat_init(hecMAT)
subroutine, public hecmw_mat_set_omega(hecMAT, omega)
subroutine, public hecmw_mat_set_iter(hecMAT, iter)
subroutine, public hecmw_mat_set_recompute_residual(hecMAT, recompute_residual)
subroutine, public hecmw_mat_set_iterlog(hecMAT, iterlog)
subroutine, public hecmw_mat_finalize(hecMAT)
integer(kind=kint) function, public hecmw_mat_get_nrecycle_precond(hecMAT)
integer(kind=kint), parameter, public hecmw_matvec_impl_sblas
integer(kind=kint) function, public hecmw_mat_get_penalized(hecMAT)
subroutine, public hecmw_mat_copy_val(hecMATorg, hecMAT)
subroutine, public hecmw_mat_set_flag_diverged(hecMAT, flag_diverged)
subroutine, public hecmw_mat_set_penalized_b(hecMAT, penalized_b)
real(kind=kreal) function, public hecmw_mat_get_resid(hecMAT)
subroutine, public hecmw_mat_set_estcond(hecMAT, estcond)
integer(kind=kint) function, public hecmw_mat_get_maxrecycle_precond(hecMAT)
subroutine, public hecmw_mat_set_thresh(hecMAT, thresh)
integer(kind=kint), parameter, public hecmw_precond_impl_csr
subroutine, public hecmw_mat_set_flag_converged(hecMAT, flag_converged)
integer(kind=kint) function, public hecmw_mat_get_flag_converged(hecMAT)
integer(kind=kint) function, public hecmw_mat_get_precond_impl(hecMAT)
integer(kind=kint) function, public hecmw_mat_get_penalized_b(hecMAT)
integer(kind=kint) function, public hecmw_mat_get_dump(hecMAT)
subroutine, public hecmw_mat_set_matvec_impl(hecMAT, matvec_impl)
real(kind=kreal) function, public hecmw_mat_get_penalty_alpha(hecMAT)
subroutine, public hecmw_mat_get_solver_opt(hecMAT, solver_opt)
subroutine, public hecmw_mat_set_solver_ropt(hecMAT, solver_ropt)
integer(kind=kint) function, public hecmw_mat_get_nbfgs(hecMAT)
subroutine, public hecmw_mat_substitute(dest, src)
real(kind=kreal) function, public hecmw_mat_get_penalty(hecMAT)
subroutine, public hecmw_mat_recycle_precond_setting(hecMAT)
subroutine, public hecmw_mat_incr_nrecycle_precond(hecMAT)
subroutine, public hecmw_mat_set_sigma_diag(hecMAT, sigma_diag)
subroutine, public hecmw_mat_set_penalty_alpha(hecMAT, alpha)
subroutine, public hecmw_mat_clear_b(hecMAT)
subroutine, public hecmw_mat_set_dump_exit(hecMAT, dump_exit)
integer(kind=kint) function, public hecmw_mat_get_iterlog(hecMAT)
subroutine, public hecmw_mat_set_flag_symbfact(hecMAT, flag_symbfact)
integer(kind=kint) function, public hecmw_mat_get_matvec_impl(hecMAT)
integer(kind=kint) function, public hecmw_mat_get_timelog(hecMAT)
subroutine, public hecmw_mat_set_nset(hecMAT, nset)
integer(kind=kint), parameter, public hecmw_precond_impl_bsr
subroutine, public hecmw_mat_set_flag_numfact(hecMAT, flag_numfact)
integer(kind=kint) function, public hecmw_mat_get_loglevel(hecMAT)
subroutine, public hecmw_mat_copy_profile(hecMATorg, hecMAT)
subroutine, public hecmw_mat_set_method(hecMAT, method)
subroutine, public hecmw_mat_set_filter(hecMAT, filter)
integer(kind=kint) function, public hecmw_mat_get_method2(hecMAT)
integer(kind=kint) function, public hecmw_mat_get_flag_numfact(hecMAT)
subroutine, public hecmw_mat_set_penalized(hecMAT, penalized)
subroutine, public hecmw_mat_set_penalty(hecMAT, penalty)
subroutine, public hecmw_mat_set_maxrecycle_precond(hecMAT, maxrecycle_precond)
subroutine, public hecmw_mat_clear(hecMAT)
subroutine, public hecmw_mat_set_precond_impl(hecMAT, precond_impl)
integer(kind=kint) function, public hecmw_mat_get_contact_elim(hecMAT)
subroutine, public hecmw_mat_set_timelog(hecMAT, timelog)
subroutine, public hecmw_mat_set_resid(hecMAT, resid)
real(kind=kreal) function, public hecmw_mat_get_thresh(hecMAT)
integer(kind=kint), parameter, public hecmw_precond_impl_sblas
integer(kind=kint) function, public hecmw_mat_get_flag_symbfact(hecMAT)
integer(kind=kint), parameter, public hecmw_precond_impl_default
integer(kind=kint) function, public hecmw_mat_get_recompute_residual(hecMAT)
integer(kind=kint), parameter, public hecmw_matvec_impl_bsr
integer(kind=kint) function, public hecmw_mat_get_method(hecMAT)
subroutine, public hecmw_mat_get_solver_ropt(hecMAT, solver_ropt)
integer(kind=kint) function, public hecmw_mat_get_precond(hecMAT)
integer(kind=kint) function, public hecmw_mat_get_nset(hecMAT)
subroutine, public hecmw_mat_set_iterpremax(hecMAT, iterpremax)
real(kind=kreal) function, public hecmw_mat_get_filter(hecMAT)
integer(kind=kint) function, public hecmw_mat_get_estcond(hecMAT)
subroutine, public hecmw_mat_set_nrest(hecMAT, nrest)
integer(kind=kint) function, public hecmw_mat_get_usejad(hecMAT)
subroutine, public hecmw_mat_set_solver_type(hecMAT, solver_type)
subroutine, public hecmw_mat_set_method2(hecMAT, method2)
integer(kind=kint) function, public hecmw_mat_get_mpc_method(hecMAT)
integer(kind=kint) function, public hecmw_mat_get_ncolor_in(hecMAT)
subroutine, public hecmw_mat_set_nbfgs(hecMAT, nbfgs)
integer(kind=kint) function, public hecmw_mat_get_iter(hecMAT)
integer(kind=kint), parameter, public hecmw_matvec_impl_csr
subroutine, public hecmw_mat_set_precond(hecMAT, precond)
subroutine, public hecmw_mat_set_solver_opt(hecMAT, solver_opt)
integer(kind=kint) function, public hecmw_mat_get_scaling(hecMAT)
subroutine, public hecmw_mat_reset_nrecycle_precond(hecMAT)
subroutine, public hecmw_mat_set_scaling(hecMAT, scaling)
subroutine, public hecmw_mat_set_mpc_method(hecMAT, mpc_method)
subroutine, public hecmw_mat_set_dump(hecMAT, dump_type)
subroutine, public hecmw_mat_set_loglevel(hecMAT, loglevel)
Diagnostic verbosity level, set independently of TIMELOG via the !SOLVER LOGLEVEL keyword (defaults t...
I/O and Utility.
Definition: hecmw_util_f.F90:7
integer(kind=kint), parameter hecmw_max
integer(kind=4), parameter kreal
subroutine hecmw_nullify_matrix(P)
subroutine hecmw_allreduce_r1(hecMESH, s, ntag)