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