8.3
general documentation
cs_saddle_solver.h
Go to the documentation of this file.
1#ifndef __CS_SADDLE_SOLVER_H__
2#define __CS_SADDLE_SOLVER_H__
3
4/*============================================================================
5 * Solvers for saddle-point systems arising from CDO discretizations
6 *============================================================================*/
7
8/*
9 This file is part of code_saturne, a general-purpose CFD tool.
10
11 Copyright (C) 1998-2024 EDF S.A.
12
13 This program is free software; you can redistribute it and/or modify it under
14 the terms of the GNU General Public License as published by the Free Software
15 Foundation; either version 2 of the License, or (at your option) any later
16 version.
17
18 This program is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21 details.
22
23 You should have received a copy of the GNU General Public License along with
24 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
25 Street, Fifth Floor, Boston, MA 02110-1301, USA.
26*/
27
28/*----------------------------------------------------------------------------*/
29
30#include "cs_defs.h"
31
32/*----------------------------------------------------------------------------
33 * Standard C library headers
34 *----------------------------------------------------------------------------*/
35
36/*----------------------------------------------------------------------------
37 * Local headers
38 *----------------------------------------------------------------------------*/
39
40#include "cs_cdo_blas.h"
41#include "cs_cdo_system.h"
42#include "cs_iter_algo.h"
43#include "cs_param_saddle.h"
44#include "cs_sles.h"
45
46/*----------------------------------------------------------------------------*/
47
49
50/*============================================================================
51 * Macro definitions
52 *============================================================================*/
53
54/*============================================================================
55 * Type definitions
56 *============================================================================*/
57
58/*----------------------------------------------------------------------------*/
69/*----------------------------------------------------------------------------*/
70
71typedef void
73 const cs_real_t *vec,
74 const cs_adjacency_t *mat_adj,
75 const cs_real_t *mat_op,
76 cs_real_t *matvec);
77
78/*
79 * Main structure to solve a saddle-point problem described as follows
80 *
81 * | M11 | M12 | | x1 | |rhs1 |
82 * M = |-----------| |----| = |-----|
83 * | M21 | 0 | | x2 | |rhs2 |
84 *
85 * One assumes that M12 = M21^T
86 */
87
88typedef struct {
89
90 /* Set of parameters to know how to solve the saddle-point system (shared) */
91
93
94 /* Structure to handle iterative algorithms */
95
97
98 /* Description of the saddle-point system to solve (shared) */
99
101
103
104 /* Main SLES structure associated to the saddle-point problem. According to
105 * the type of saddle-point solver, additional SLES can be allocated, for
106 * instance to compute an approximation of the Schur complement. */
107
109
110 /* Scatter viewpoint */
111
116
119
120 /* Additional members according to the type of saddle-point solver. This
121 * structure is cast on-the-fly */
122
123 void *context;
124
125 /* Monitoring */
126
127 unsigned n_calls;
128 unsigned n_iter_min;
129 unsigned n_iter_max;
130 unsigned n_iter_tot;
131
133
134
135/* ==================================================== */
136/* List of context structures dedicated to some solvers */
137/* ==================================================== */
138
139/* Context structure for the ALU algorithm */
140/* --------------------------------------- */
141
142typedef struct {
143
144 /* Auxiliary buffers */
145
146 cs_real_t *inv_m22; /* reciprocal of the mass matrix for the (2,2)
147 * block; buffer of size n2_dofs */
148 cs_real_t *res2; /* buffer of size n2_dofs */
149 cs_real_t *m21x1; /* buffer of size n2_dofs */
150
151 cs_real_t *b1_tilda; /* Modified RHS (size n1_dofs) */
152 cs_real_t *rhs; /* buffer of size n1_dofs */
153
154 /* SLES associated to the transformation of the right-hand side */
155
157
158 /* Function pointers for computing operations needed in the algorithm */
159 /* ------------------------------------------------------------------ */
160
164
165 /* Shared pointers */
166
168
169 /* Indexed list used to scan the unassembled m21 operator */
170
172
174
175
176/* Context structure for block preconditioner used in combination with a Krylov
177 * solver such as MINRES or GCR.
178 * ----------------------------------------------------------------------------
179 *
180 * A hybrid storage is used to represent the system described below
181 *
182 * | M11 | M12 | | x1 | |rhs1 |
183 * M = |-----------| |----| = |-----|
184 * | M21 | 0 | | x2 | |rhs2 |
185 *
186 * One assumes that M12 = M21^T
187 */
188
189typedef struct {
190
191 /* Shortcut on pointers available through the system helper */
192
195
196 /* Max. size of the blocks (scatter or gather view). This size takes into
197 account the size needed for synchronization. */
198
201
202 /* SLES structure associated to the Schur complement. It depends on the type
203 of Schur complement approximation used */
204
208
209 /* Native arrays for the Schur matrix (optional) */
210
213
214 /* Diagonal approximations of block matrices (optional) */
215
218
220
221 /* Function pointers */
222
225
226 /* Shared pointers */
227
228 const cs_property_t *pty_22; /* Property related to the (2,2) block */
230 const cs_adjacency_t *m21_adj; /* Indexed list used to scan the unassembled
231 m21 operator */
232
234
235
236/* Context structure for the GKB algorithm */
237/* --------------------------------------- */
238/* This structure follows the algorithm given in the article entitled "An
239 * iterative generalized Golub-Kahan algorithm for problems in structural
240 * mechanics" by M. Arioli, C. Kruse, U. Ruede and N. Tardieu
241 */
242
243typedef struct {
244
245 /* Orthogonalization coefficients */
246
250
251 /* Energy norm estimation */
252
256
257 /* Auxiliary buffers */
258
259 cs_real_t *q; /* buffer of size n2_dofs */
260 cs_real_t *d; /* buffer of size n2_dofs */
261 cs_real_t *m21v; /* buffer of size n2_dofs */
262 cs_real_t *inv_m22; /* reciprocal of the mass matrix for the (2,2)
263 * block; buffer of size n2_dofs */
264 const cs_real_t *m22; /* mass matrix for the (2,2) block (shared pointer) */
265
266 cs_real_t *w; /* buffer of size n1_dofs */
267 cs_real_t *m12q; /* buffer of size n1_dofs */
268 cs_real_t *v; /* buffer of size n1_dofs */
269 cs_real_t *x1_tilda; /* buffer of size n1_dofs */
270
271 cs_real_t *rhs_tilda; /* buffer of size MAX(n1_dofs, n2_dofs) */
272
273 /* Optional SLES to perform the transformation of the right hand-side */
274
276
277 /* Function pointers */
278
282
283 /* Shared pointers */
284
286
287 /* Indexed list used to scan the unassembled m21 operator */
288
290
292
293
294/* Context structure for the Notay's algebraic transformation */
295/* ---------------------------------------------------------- */
296
297typedef struct {
298
299 /* Function pointer */
300
302
303 /* Shared pointers */
304
306
307 /* Indexed list used to scan the unassembled m21 operator */
308
310
312
313
314/* Context structure for the Uzawa-CG algorithm */
315/* -------------------------------------------- */
316
317typedef struct {
318
319 /* Auxiliary scaling coefficient */
320
322
323 /* Auxiliary buffers */
324
325 cs_real_t *res2; /* buffer of size n2_dofs */
326 cs_real_t *m21x1; /* buffer of size n2_dofs */
327 cs_real_t *gk; /* buffer of size n2_dofs */
328
329 cs_real_t *b1_tilda; /* Modified RHS (size n1_dofs) */
330 cs_real_t *dzk; /* buffer of size n1_dofs */
331 cs_real_t *rhs; /* buffer of size n1_dofs */
332
333 /* Function pointers */
334
338
339 /* Shortcut on pointers available through the system helper */
340
343
344 /* Max. size of the blocks (scatter or gather view). This size takes into
345 account the size needed for synchronization. */
346
349
350 /* SLES structure associated to the Schur complement. It depends on the type
351 of Schur complement approximation used */
352
353 cs_real_t *inv_m22; /* reciprocal of the mass matrix for the
354 * (2,2) block; buffer of size n2_dofs */
357
358 /* Native arrays for the Schur matrix (optional) */
359
362
363 /* Diagonal approximations of block matrices (optional) */
364
366
369
370 /* Shared pointers */
371
372 const cs_property_t *pty_22; /* Property related to the (2,2) block */
374 const cs_adjacency_t *m21_adj; /* Indexed list used to scan the unassembled
375 m21 operator */
376
378
379/* Context structure for the SIMPLE-lile algorithm */
380/* ----------------------------------------------- */
381
382typedef struct {
383
384
385 /* Auxiliary buffers */
386
387 cs_real_t *res2; /* buffer of size n2_dofs */
388 cs_real_t *m21x1; /* buffer of size n2_dofs */
389
390 cs_real_t *b1_tilda; /* Modified RHS (size n1_dofs) */
391 cs_real_t *rhs; /* buffer of size n1_dofs */
392
393 /* Function pointers */
394
398
399 /* Shortcut on pointers available through the system helper */
400
403
404 /* Max. size of the blocks (scatter or gather view). This size takes into
405 account the size needed for synchronization. */
406
409
410 /* SLES structure associated to the Schur complement. It depends on the type
411 of Schur complement approximation used */
412
413 cs_real_t *inv_m22; /* reciprocal of the mass matrix for the
414 * (2,2) block; buffer of size n2_dofs */
417
418 /* Native arrays for the Schur matrix (optional) */
419
422
423 /* Diagonal approximations of block matrices (optional) */
424
426
429
430 /* Shared pointers */
431
432 const cs_property_t *pty_22; /* Property related to the (2,2) block */
434 const cs_adjacency_t *m21_adj; /* Indexed list used to scan the unassembled
435 m21 operator */
436
438
439/*============================================================================
440 * Public function prototypes
441 *============================================================================*/
442
443/*----------------------------------------------------------------------------*/
449/*----------------------------------------------------------------------------*/
450
451int
453
454/*----------------------------------------------------------------------------*/
462/*----------------------------------------------------------------------------*/
463
466
467/*----------------------------------------------------------------------------*/
482/*----------------------------------------------------------------------------*/
483
486 int n1_dofs_by_elt,
487 cs_lnum_t n2_elts,
488 int n2_dofs_by_elt,
489 const cs_param_saddle_t *saddlep,
491 cs_sles_t *main_sles);
492
493/*----------------------------------------------------------------------------*/
497/*----------------------------------------------------------------------------*/
498
499void
501
502/*----------------------------------------------------------------------------*/
508/*----------------------------------------------------------------------------*/
509
510void
512
513/*----------------------------------------------------------------------------*/
519/*----------------------------------------------------------------------------*/
520
521void
523
524/*----------------------------------------------------------------------------*/
531/*----------------------------------------------------------------------------*/
532
533void
535 unsigned n_iter);
536
537/*----------------------------------------------------------------------------*/
541/*----------------------------------------------------------------------------*/
542
543void
545
546/*----------------------------------------------------------------------------*/
560/*----------------------------------------------------------------------------*/
561
562cs_real_t *
564 const cs_matrix_t *m11,
565 const cs_range_set_t *b11_rset,
566 cs_sles_t *xtra_sles,
567 int *n_iter);
568
569/*----------------------------------------------------------------------------*/
584/*----------------------------------------------------------------------------*/
585
586void
588 const cs_real_t *x2,
589 const cs_adjacency_t *m21_adj,
590 const cs_real_t *m21_val,
591 cs_real_t *m12x2);
592
593/*----------------------------------------------------------------------------*/
608/*----------------------------------------------------------------------------*/
609
610void
612 const cs_real_t *x2,
613 const cs_adjacency_t *m21_adj,
614 const cs_real_t *m21_val,
615 cs_real_t *m12x2);
616
617/*----------------------------------------------------------------------------*/
629/*----------------------------------------------------------------------------*/
630
631void
633 const cs_real_t *x1,
634 const cs_adjacency_t *m21_adj,
635 const cs_real_t *m21_val,
636 cs_real_t *m21x1);
637
638/*----------------------------------------------------------------------------*/
650/*----------------------------------------------------------------------------*/
651
652void
654 const cs_real_t *x1,
655 const cs_adjacency_t *m21_adj,
656 const cs_real_t *m21_val,
657 cs_real_t *m21x1);
658
659/*----------------------------------------------------------------------------*/
666/*----------------------------------------------------------------------------*/
667
668void
670
671/*----------------------------------------------------------------------------*/
678/*----------------------------------------------------------------------------*/
679
680void
682(
684);
685
686/*----------------------------------------------------------------------------*/
692/*----------------------------------------------------------------------------*/
693
694void
696(
698);
699
700/*----------------------------------------------------------------------------*/
708/*----------------------------------------------------------------------------*/
709
710void
712 cs_saddle_solver_t *solver);
713
714/*----------------------------------------------------------------------------*/
721/*----------------------------------------------------------------------------*/
722
723void
725(
727);
728
729/*----------------------------------------------------------------------------*/
736/*----------------------------------------------------------------------------*/
737
738void
740(
742);
743
744/*----------------------------------------------------------------------------*/
750/*----------------------------------------------------------------------------*/
751
752void
754
755/*----------------------------------------------------------------------------*/
762/*----------------------------------------------------------------------------*/
763
764void
766
767/*----------------------------------------------------------------------------*/
773/*----------------------------------------------------------------------------*/
774
775void
777(
779);
780
781/*----------------------------------------------------------------------------*/
788/*----------------------------------------------------------------------------*/
789
790void
792
793/*----------------------------------------------------------------------------*/
801/*----------------------------------------------------------------------------*/
802
803void
805 cs_saddle_solver_t *solver);
806
807/*----------------------------------------------------------------------------*/
814/*----------------------------------------------------------------------------*/
815
816void
818(
820);
821
822/*----------------------------------------------------------------------------*/
828/*----------------------------------------------------------------------------*/
829
830void
832(
834);
835
836/*----------------------------------------------------------------------------*/
844/*----------------------------------------------------------------------------*/
845
846void
848 cs_saddle_solver_t *solver);
849
850/*----------------------------------------------------------------------------*/
857/*----------------------------------------------------------------------------*/
858
859void
861(
863);
864
865/*----------------------------------------------------------------------------*/
871/*----------------------------------------------------------------------------*/
872
873void
875(
877);
878
879/*----------------------------------------------------------------------------*/
889/*----------------------------------------------------------------------------*/
890
891void
893 cs_real_t *x1,
894 cs_real_t *x2);
895
896/*----------------------------------------------------------------------------*/
910/*----------------------------------------------------------------------------*/
911
912void
914 cs_real_t *x1,
915 cs_real_t *x2);
916
917/*----------------------------------------------------------------------------*/
928/*----------------------------------------------------------------------------*/
929
930void
932 cs_real_t *x1,
933 cs_real_t *x2);
934
935/*----------------------------------------------------------------------------*/
944/*----------------------------------------------------------------------------*/
945
946void
948 cs_real_t *x1,
949 cs_real_t *x2);
950
951/*----------------------------------------------------------------------------*/
962/*----------------------------------------------------------------------------*/
963
964void
966 cs_real_t *x1,
967 cs_real_t *x2);
968
969/*----------------------------------------------------------------------------*/
978/*----------------------------------------------------------------------------*/
979
980void
982 cs_real_t *x1,
983 cs_real_t *x2);
984
985/*----------------------------------------------------------------------------*/
996/*----------------------------------------------------------------------------*/
997
998void
1000 cs_real_t *x1,
1001 cs_real_t *x2);
1002
1003/*----------------------------------------------------------------------------*/
1011/*----------------------------------------------------------------------------*/
1012
1013void
1015 cs_real_t *x1,
1016 cs_real_t *x2);
1017
1018/*----------------------------------------------------------------------------*/
1019
1021
1022#endif /* __CS_SADDLE_SOLVER_H__ */
cs_real_t() cs_cdo_blas_square_norm_t(const cs_real_t *array)
Generic function pointer for computing a square norm. Parallel synchronization is performed inside th...
Definition: cs_cdo_blas.h:79
#define BEGIN_C_DECLS
Definition: cs_defs.h:542
double cs_real_t
Floating-point value.
Definition: cs_defs.h:342
#define END_C_DECLS
Definition: cs_defs.h:543
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:335
@ x2
Definition: cs_field_pointer.h:226
struct _cs_matrix_t cs_matrix_t
Definition: cs_matrix.h:110
Handle the settings of saddle-point systems. These systems arise from the monolithic coupling of the ...
void cs_saddle_solver_gcr(cs_saddle_solver_t *solver, cs_real_t *x1, cs_real_t *x2)
Apply the GCR algorithm to a saddle point problem (the system is stored in a hybrid way)....
Definition: cs_saddle_solver.cpp:4129
void cs_saddle_solver_m21_multiply_scalar(cs_lnum_t n2_dofs, const cs_real_t *x1, const cs_adjacency_t *m21_adj, const cs_real_t *m21_val, cs_real_t *m21x1)
Compute the resulting vector of the operation m21*x1 The stride is equal to 1 for the operator m21 op...
Definition: cs_saddle_solver.cpp:2624
void cs_saddle_solver_context_alu_clean(cs_saddle_solver_context_alu_t *ctx)
Free main memory consuming part of the context structure associated to an ALU algorithm.
Definition: cs_saddle_solver.cpp:2717
void cs_saddle_solver_context_uzawa_cg_create(cs_lnum_t b22_max_size, cs_saddle_solver_t *solver)
Create and initialize the context structure for an algorithm related to the Uzawa-CG algorithm.
Definition: cs_saddle_solver.cpp:3100
void cs_saddle_solver_uzawa_cg(cs_saddle_solver_t *solver, cs_real_t *x1, cs_real_t *x2)
Apply the Uzawa-CG algorithm to solve a saddle point problem (the system is stored in a hybrid way)....
Definition: cs_saddle_solver.cpp:4667
void cs_saddle_solver_context_notay_create(cs_saddle_solver_t *solver)
Create and initialize the context structure for the algorithm relying on the Notay's algebraic transf...
Definition: cs_saddle_solver.cpp:3060
void cs_saddle_solver_free(cs_saddle_solver_t **p_solver)
Free a cs_saddle_solver_t structure.
Definition: cs_saddle_solver.cpp:2213
void cs_saddle_solver_context_block_pcd_create(cs_lnum_t b22_max_size, cs_saddle_solver_t *solver)
Create and initialize the context structure for a block preconditioner used in combination with a Kry...
Definition: cs_saddle_solver.cpp:2767
void cs_saddle_solver_minres(cs_saddle_solver_t *solver, cs_real_t *x1, cs_real_t *x2)
Apply the MINRES algorithm to a saddle point problem (the system is stored in a hybrid way)....
Definition: cs_saddle_solver.cpp:3872
void cs_saddle_solver_context_simple_free(cs_saddle_solver_context_simple_t **p_ctx)
Free the context structure associated to a Uzawa-CG algorithm.
Definition: cs_saddle_solver.cpp:3431
cs_saddle_solver_t * cs_saddle_solver_by_id(int id)
Get a pointer to saddle-point solver from its id.
Definition: cs_saddle_solver.cpp:2135
void cs_saddle_solver_gkb_inhouse(cs_saddle_solver_t *solver, cs_real_t *x1, cs_real_t *x2)
Apply the GKB algorithm to a saddle point problem (the system is stored in a hybrid way)....
Definition: cs_saddle_solver.cpp:4356
void cs_saddle_solver_update_monitoring(cs_saddle_solver_t *solver, unsigned n_iter)
Update the current monitoring state with n_iter.
Definition: cs_saddle_solver.cpp:2394
void cs_saddle_solver_alu_incr(cs_saddle_solver_t *solver, cs_real_t *x1, cs_real_t *x2)
Apply the Augmented Lagrangian-Uzawa algorithm to a saddle point problem (the system is stored in a h...
Definition: cs_saddle_solver.cpp:3459
void cs_saddle_solver_context_gkb_free(cs_saddle_solver_context_gkb_t **p_ctx)
Free the context structure associated to the GKB algorithm.
Definition: cs_saddle_solver.cpp:3035
void cs_saddle_solver_finalize(void)
Free all remaining structures related to saddle-point solvers.
Definition: cs_saddle_solver.cpp:2198
void cs_saddle_solver_context_alu_free(cs_saddle_solver_context_alu_t **p_ctx)
Free the context structure associated to an ALU algorithm.
Definition: cs_saddle_solver.cpp:2741
void cs_saddle_solver_notay(cs_saddle_solver_t *solver, cs_real_t *x1, cs_real_t *x2)
Apply the Notay's transformation algorithm to solve a saddle point problem (the system is stored in a...
Definition: cs_saddle_solver.cpp:3687
void cs_saddle_solver_context_simple_create(cs_lnum_t b22_max_size, cs_saddle_solver_t *solver)
Create and initialize the context structure for an algorithm related to the SIMPLE algorithm.
Definition: cs_saddle_solver.cpp:3286
cs_real_t * cs_saddle_solver_m11_inv_lumped(cs_saddle_solver_t *solver, const cs_matrix_t *m11, const cs_range_set_t *b11_rset, cs_sles_t *xtra_sles, int *n_iter)
Retrieve the lumped matrix the inverse of the diagonal of the (1,1)-block matrix. The storage of a ma...
Definition: cs_saddle_solver.cpp:2448
void cs_saddle_solver_log_monitoring(void)
Log the monitoring performance of all saddle-point systems.
Definition: cs_saddle_solver.cpp:2417
void cs_saddle_solver_context_gkb_create(cs_saddle_solver_t *solver)
Create and initialize the context structure for the GKB algorithm.
Definition: cs_saddle_solver.cpp:2922
void cs_saddle_solver_sles_full_system(cs_saddle_solver_t *solver, cs_real_t *x1, cs_real_t *x2)
Apply an (external) solver to solve a saddle point problem (the system is stored in a monolithic way)...
Definition: cs_saddle_solver.cpp:4518
void cs_saddle_solver_context_alu_create(cs_saddle_solver_t *solver)
Create and initialize the context structure for an algorithm related to the ALU algorithm.
Definition: cs_saddle_solver.cpp:2654
void cs_saddle_solver_simple(cs_saddle_solver_t *solver, cs_real_t *x1, cs_real_t *x2)
Apply the SIMPLE-like algorithm to solve a saddle point problem.
Definition: cs_saddle_solver.cpp:4912
void cs_saddle_solver_context_simple_clean(cs_saddle_solver_context_simple_t *ctx)
Free main memory consuming part of the context structure associated to a SIMPLE algorithm.
Definition: cs_saddle_solver.cpp:3400
void cs_saddle_solver_context_uzawa_cg_clean(cs_saddle_solver_context_uzawa_cg_t *ctx)
Free main memory consuming part of the context structure associated to a Uzawa-CG algorithm.
Definition: cs_saddle_solver.cpp:3224
void cs_saddle_solver_context_gkb_clean(cs_saddle_solver_context_gkb_t *ctx)
Free the main memory consuming part of the context structure associated to the GKB algorithm.
Definition: cs_saddle_solver.cpp:2997
int cs_saddle_solver_get_n_systems(void)
Retrieve the number of saddle-point systems which have been added.
Definition: cs_saddle_solver.cpp:2119
void cs_saddle_solver_context_block_pcd_clean(cs_saddle_solver_context_block_pcd_t *ctx)
Free the context structure for a block preconditioner used in combination with a Krylov solver such a...
Definition: cs_saddle_solver.cpp:2869
void cs_saddle_solver_m12_multiply_scalar(cs_lnum_t n2_elts, const cs_real_t *x2, const cs_adjacency_t *m21_adj, const cs_real_t *m21_val, cs_real_t *m12x2)
Compute the resulting vector of the operation m12*x2 The stride is equal to 1 for the operator m21 (u...
Definition: cs_saddle_solver.cpp:2555
void cs_saddle_solver_m12_multiply_vector(cs_lnum_t n2_dofs, const cs_real_t *x2, const cs_adjacency_t *m21_adj, const cs_real_t *m21_val, cs_real_t *m12x2)
Compute the resulting vector of the operation m12*x2 The stride is equal to 3 for the operator m21 (u...
Definition: cs_saddle_solver.cpp:2508
void cs_saddle_solver_m21_multiply_vector(cs_lnum_t n2_dofs, const cs_real_t *x1, const cs_adjacency_t *m21_adj, const cs_real_t *m21_val, cs_real_t *m21x1)
Compute the resulting vector of the operation m21*x1 The stride is equal to 3 for the operator m21 op...
Definition: cs_saddle_solver.cpp:2589
void cs_saddle_solver_clean(cs_saddle_solver_t *solver)
Free/reset only a part of a cs_saddle_solver_t structure.
Definition: cs_saddle_solver.cpp:2310
void cs_saddle_solver_context_uzawa_cg_free(cs_saddle_solver_context_uzawa_cg_t **p_ctx)
Free the context structure associated to a Uzawa-CG algorithm.
Definition: cs_saddle_solver.cpp:3260
void cs_saddle_solver_context_block_pcd_free(cs_saddle_solver_context_block_pcd_t **p_ctx)
Free the context structure for a block preconditioner used in combination with a Krylov solver such a...
Definition: cs_saddle_solver.cpp:2898
void() cs_saddle_solver_matvec_t(cs_lnum_t n2_dofs, const cs_real_t *vec, const cs_adjacency_t *mat_adj, const cs_real_t *mat_op, cs_real_t *matvec)
Generic function prototype to perform a matrix vector operation This operation takes place between an...
Definition: cs_saddle_solver.h:72
cs_saddle_solver_t * cs_saddle_solver_add(cs_lnum_t n1_elts, int n1_dofs_by_elt, cs_lnum_t n2_elts, int n2_dofs_by_elt, const cs_param_saddle_t *saddlep, cs_cdo_system_helper_t *sh, cs_sles_t *main_sles)
Add a new solver for solving a saddle-point problem.
Definition: cs_saddle_solver.cpp:2162
struct _cs_sles_t cs_sles_t
Definition: cs_sles.h:68
Definition: cs_mesh_adjacencies.h:68
Definition: cs_cdo_system.h:377
Structure to handle the convergence of an iterative algorithm.
Definition: cs_iter_algo.h:290
Structure storing all metadata related to the resolution of a saddle-point linear system....
Definition: cs_param_saddle.h:273
Structure associated to the definition of a property relying on the cs_xdef_t structure.
Definition: cs_range_set.h:57
Definition: cs_saddle_solver.h:142
cs_sles_t * init_sles
Definition: cs_saddle_solver.h:156
cs_saddle_solver_matvec_t * m12_vector_multiply
Definition: cs_saddle_solver.h:162
cs_real_t * rhs
Definition: cs_saddle_solver.h:152
cs_real_t * b1_tilda
Definition: cs_saddle_solver.h:151
cs_real_t * inv_m22
Definition: cs_saddle_solver.h:146
const cs_adjacency_t * m21_adj
Definition: cs_saddle_solver.h:171
const cs_real_t * m21_val
Definition: cs_saddle_solver.h:167
cs_saddle_solver_matvec_t * m21_vector_multiply
Definition: cs_saddle_solver.h:163
cs_real_t * m21x1
Definition: cs_saddle_solver.h:149
cs_real_t * res2
Definition: cs_saddle_solver.h:148
cs_cdo_blas_square_norm_t * square_norm_b11
Definition: cs_saddle_solver.h:161
Definition: cs_saddle_solver.h:189
cs_real_t * schur_diag
Definition: cs_saddle_solver.h:211
cs_range_set_t * b11_range_set
Definition: cs_saddle_solver.h:194
cs_saddle_solver_matvec_t * m12_vector_multiply
Definition: cs_saddle_solver.h:223
cs_real_t * m11_inv_diag
Definition: cs_saddle_solver.h:216
cs_matrix_t * m11
Definition: cs_saddle_solver.h:193
cs_sles_t * xtra_sles
Definition: cs_saddle_solver.h:219
const cs_property_t * pty_22
Definition: cs_saddle_solver.h:228
cs_matrix_t * schur_matrix
Definition: cs_saddle_solver.h:205
const cs_adjacency_t * m21_adj
Definition: cs_saddle_solver.h:230
const cs_real_t * m21_val
Definition: cs_saddle_solver.h:229
double schur_scaling
Definition: cs_saddle_solver.h:207
cs_sles_t * schur_sles
Definition: cs_saddle_solver.h:206
cs_saddle_solver_matvec_t * m21_vector_multiply
Definition: cs_saddle_solver.h:224
cs_lnum_t b11_max_size
Definition: cs_saddle_solver.h:199
cs_real_t * m22_mass_diag
Definition: cs_saddle_solver.h:217
cs_real_t * schur_xtra
Definition: cs_saddle_solver.h:212
cs_lnum_t b22_max_size
Definition: cs_saddle_solver.h:200
Definition: cs_saddle_solver.h:243
cs_real_t zeta_square_sum
Definition: cs_saddle_solver.h:255
cs_sles_t * init_sles
Definition: cs_saddle_solver.h:275
cs_real_t * rhs_tilda
Definition: cs_saddle_solver.h:271
cs_saddle_solver_matvec_t * m12_vector_multiply
Definition: cs_saddle_solver.h:280
cs_real_t alpha
Definition: cs_saddle_solver.h:247
cs_real_t * m21v
Definition: cs_saddle_solver.h:261
cs_real_t zeta
Definition: cs_saddle_solver.h:249
cs_real_t * m12q
Definition: cs_saddle_solver.h:267
cs_real_t * inv_m22
Definition: cs_saddle_solver.h:262
cs_real_t * zeta_array
Definition: cs_saddle_solver.h:254
const cs_adjacency_t * m21_adj
Definition: cs_saddle_solver.h:289
const cs_real_t * m22
Definition: cs_saddle_solver.h:264
const cs_real_t * m21_val
Definition: cs_saddle_solver.h:285
cs_real_t beta
Definition: cs_saddle_solver.h:248
cs_saddle_solver_matvec_t * m21_vector_multiply
Definition: cs_saddle_solver.h:281
cs_real_t * q
Definition: cs_saddle_solver.h:259
int zeta_size
Definition: cs_saddle_solver.h:253
cs_real_t * x1_tilda
Definition: cs_saddle_solver.h:269
cs_real_t * d
Definition: cs_saddle_solver.h:260
cs_cdo_blas_square_norm_t * square_norm_b11
Definition: cs_saddle_solver.h:279
cs_real_t * w
Definition: cs_saddle_solver.h:266
cs_real_t * v
Definition: cs_saddle_solver.h:268
Definition: cs_saddle_solver.h:297
cs_saddle_solver_matvec_t * m12_vector_multiply
Definition: cs_saddle_solver.h:301
const cs_adjacency_t * m21_adj
Definition: cs_saddle_solver.h:309
const cs_real_t * m21_val
Definition: cs_saddle_solver.h:305
Definition: cs_saddle_solver.h:382
cs_sles_t * init_sles
Definition: cs_saddle_solver.h:428
cs_real_t * schur_diag
Definition: cs_saddle_solver.h:420
cs_range_set_t * b11_range_set
Definition: cs_saddle_solver.h:402
cs_saddle_solver_matvec_t * m12_vector_multiply
Definition: cs_saddle_solver.h:396
cs_real_t * m11_inv_diag
Definition: cs_saddle_solver.h:425
cs_real_t * rhs
Definition: cs_saddle_solver.h:391
cs_matrix_t * m11
Definition: cs_saddle_solver.h:401
cs_real_t * b1_tilda
Definition: cs_saddle_solver.h:390
cs_sles_t * xtra_sles
Definition: cs_saddle_solver.h:427
const cs_property_t * pty_22
Definition: cs_saddle_solver.h:432
cs_matrix_t * schur_matrix
Definition: cs_saddle_solver.h:415
cs_real_t * inv_m22
Definition: cs_saddle_solver.h:413
const cs_adjacency_t * m21_adj
Definition: cs_saddle_solver.h:434
const cs_real_t * m21_val
Definition: cs_saddle_solver.h:433
cs_sles_t * schur_sles
Definition: cs_saddle_solver.h:416
cs_saddle_solver_matvec_t * m21_vector_multiply
Definition: cs_saddle_solver.h:397
cs_real_t * m21x1
Definition: cs_saddle_solver.h:388
cs_real_t * res2
Definition: cs_saddle_solver.h:387
cs_lnum_t b11_max_size
Definition: cs_saddle_solver.h:407
cs_cdo_blas_square_norm_t * square_norm_b11
Definition: cs_saddle_solver.h:395
cs_real_t * schur_xtra
Definition: cs_saddle_solver.h:421
cs_lnum_t b22_max_size
Definition: cs_saddle_solver.h:408
Definition: cs_saddle_solver.h:317
cs_sles_t * init_sles
Definition: cs_saddle_solver.h:368
cs_real_t * schur_diag
Definition: cs_saddle_solver.h:360
cs_range_set_t * b11_range_set
Definition: cs_saddle_solver.h:342
cs_saddle_solver_matvec_t * m12_vector_multiply
Definition: cs_saddle_solver.h:336
cs_real_t * gk
Definition: cs_saddle_solver.h:327
cs_real_t * m11_inv_diag
Definition: cs_saddle_solver.h:365
cs_real_t * rhs
Definition: cs_saddle_solver.h:331
cs_matrix_t * m11
Definition: cs_saddle_solver.h:341
cs_real_t * b1_tilda
Definition: cs_saddle_solver.h:329
cs_sles_t * xtra_sles
Definition: cs_saddle_solver.h:367
cs_real_t alpha
Definition: cs_saddle_solver.h:321
const cs_property_t * pty_22
Definition: cs_saddle_solver.h:372
cs_matrix_t * schur_matrix
Definition: cs_saddle_solver.h:355
cs_real_t * dzk
Definition: cs_saddle_solver.h:330
cs_real_t * inv_m22
Definition: cs_saddle_solver.h:353
const cs_adjacency_t * m21_adj
Definition: cs_saddle_solver.h:374
const cs_real_t * m21_val
Definition: cs_saddle_solver.h:373
cs_sles_t * schur_sles
Definition: cs_saddle_solver.h:356
cs_saddle_solver_matvec_t * m21_vector_multiply
Definition: cs_saddle_solver.h:337
cs_real_t * m21x1
Definition: cs_saddle_solver.h:326
cs_real_t * res2
Definition: cs_saddle_solver.h:325
cs_lnum_t b11_max_size
Definition: cs_saddle_solver.h:347
cs_cdo_blas_square_norm_t * square_norm_b11
Definition: cs_saddle_solver.h:335
cs_real_t * schur_xtra
Definition: cs_saddle_solver.h:361
cs_lnum_t b22_max_size
Definition: cs_saddle_solver.h:348
Definition: cs_saddle_solver.h:88
cs_cdo_system_helper_t * system_helper
Definition: cs_saddle_solver.h:100
cs_sles_t * main_sles
Definition: cs_saddle_solver.h:108
cs_lnum_t n1_scatter_dofs
Definition: cs_saddle_solver.h:117
bool do_setup
Definition: cs_saddle_solver.h:102
cs_lnum_t n2_elts
Definition: cs_saddle_solver.h:114
unsigned n_calls
Definition: cs_saddle_solver.h:127
cs_lnum_t n1_elts
Definition: cs_saddle_solver.h:112
cs_iter_algo_t * algo
Definition: cs_saddle_solver.h:96
cs_lnum_t n2_scatter_dofs
Definition: cs_saddle_solver.h:118
unsigned n_iter_max
Definition: cs_saddle_solver.h:129
int n2_dofs_by_elt
Definition: cs_saddle_solver.h:115
unsigned n_iter_tot
Definition: cs_saddle_solver.h:130
unsigned n_iter_min
Definition: cs_saddle_solver.h:128
const cs_param_saddle_t * param
Definition: cs_saddle_solver.h:92
int n1_dofs_by_elt
Definition: cs_saddle_solver.h:113
void * context
Definition: cs_saddle_solver.h:123