9.2
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-2026 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 "base/cs_defs.h"
31
32/*----------------------------------------------------------------------------
33 * Standard C library headers
34 *----------------------------------------------------------------------------*/
35
36/*----------------------------------------------------------------------------
37 * Local headers
38 *----------------------------------------------------------------------------*/
39
40#include "cdo/cs_cdo_blas.h"
41#include "cdo/cs_cdo_system.h"
42#include "cdo/cs_iter_algo.h"
43#include "cdo/cs_property.h"
45#include "alge/cs_sles.h"
46
47/*============================================================================
48 * Macro definitions
49 *============================================================================*/
50
51/*============================================================================
52 * Type definitions
53 *============================================================================*/
54
55/*----------------------------------------------------------------------------*/
66/*----------------------------------------------------------------------------*/
67
68typedef void
70 const cs_real_t *vec,
71 const cs_adjacency_t *mat_adj,
72 const cs_real_t *mat_op,
73 cs_real_t *matvec);
74
75/*
76 * Main structure to solve a saddle-point problem described as follows
77 *
78 * | M11 | M12 | | x1 | |rhs1 |
79 * M = |-----------| |----| = |-----|
80 * | M21 | 0 | | x2 | |rhs2 |
81 *
82 * One assumes that M12 = M21^T
83 */
84
85typedef struct {
86
87 /* Set of parameters to know how to solve the saddle-point system (shared) */
88
90
91 /* Structure to handle iterative algorithms */
92
94
95 /* Description of the saddle-point system to solve (shared) */
96
98
100
101 /* Main SLES structure associated to the saddle-point problem. According to
102 * the type of saddle-point solver, additional SLES can be allocated, for
103 * instance to compute an approximation of the Schur complement. */
104
106
107 /* Scatter viewpoint */
108
113
114 cs_lnum_t n1_scatter_dofs; /* = n1_elts * n1_dofs_by_elt */
115 cs_lnum_t n2_scatter_dofs; /* = n2_elts * n2_dofs_by_elt */
116
117 /* Additional members according to the type of saddle-point solver. This
118 * structure is cast on-the-fly */
119
120 void *context;
121
122 /* Monitoring */
123
124 unsigned n_calls;
125 unsigned n_iter_min;
126 unsigned n_iter_max;
127 unsigned n_iter_tot;
128
130
131
132/* ==================================================== */
133/* List of context structures dedicated to some solvers */
134/* ==================================================== */
135
136/* Context structure for the ALU algorithm */
137/* --------------------------------------- */
138
139typedef struct {
140
141 /* Auxiliary buffers */
142
143 cs_real_t *inv_m22; /* reciprocal of the mass matrix for the (2,2)
144 * block; buffer of size n2_dofs */
145 cs_real_t *res2; /* buffer of size n2_dofs */
146 cs_real_t *m21x1; /* buffer of size n2_dofs */
147
148 cs_real_t *b1_tilda; /* Modified RHS (size n1_dofs) */
149 cs_real_t *rhs; /* buffer of size n1_dofs */
150
151 /* SLES associated to the transformation of the right-hand side */
152
154
155 /* Function pointers for computing operations needed in the algorithm */
156 /* ------------------------------------------------------------------ */
157
161
162 /* Shared pointers */
163
165
166 /* Indexed list used to scan the unassembled m21 operator */
167
169
171
172
173/* Context structure for block preconditioner used in combination with a Krylov
174 * solver such as MINRES or GCR.
175 * ----------------------------------------------------------------------------
176 *
177 * A hybrid storage is used to represent the system described below
178 *
179 * | M11 | M12 | | x1 | |rhs1 |
180 * M = |-----------| |----| = |-----|
181 * | M21 | 0 | | x2 | |rhs2 |
182 *
183 * One assumes that M12 = M21^T
184 */
185
186typedef struct {
187
188 /* Shortcut on pointers available through the system helper */
189
192
193 /* Max. size of the blocks (scatter or gather view). This size takes into
194 account the size needed for synchronization. */
195
198
199 /* SLES structure associated to the Schur complement. It depends on the type
200 of Schur complement approximation used */
201
205
206 /* Native arrays for the Schur matrix (optional) */
207
210
211 /* Diagonal approximations of block matrices (optional) */
212
215
217
218 /* Function pointers */
219
222
223 /* Shared pointers */
224
225 const cs_property_t *pty_22; /* Property related to the (2,2) block */
227 const cs_adjacency_t *m21_adj; /* Indexed list used to scan the unassembled
228 m21 operator */
229
231
232
233/* Context structure for the GKB algorithm */
234/* --------------------------------------- */
235/* This structure follows the algorithm given in the article entitled "An
236 * iterative generalized Golub-Kahan algorithm for problems in structural
237 * mechanics" by M. Arioli, C. Kruse, U. Ruede and N. Tardieu
238 */
239
240typedef struct {
241
242 /* Orthogonalization coefficients */
243
247
248 /* Energy norm estimation */
249
253
254 /* Auxiliary buffers */
255
256 cs_real_t *q; /* buffer of size n2_dofs */
257 cs_real_t *d; /* buffer of size n2_dofs */
258 cs_real_t *m21v; /* buffer of size n2_dofs */
259 cs_real_t *inv_m22; /* reciprocal of the mass matrix for the (2,2)
260 * block; buffer of size n2_dofs */
261 const cs_real_t *m22; /* mass matrix for the (2,2) block (shared pointer) */
262
263 cs_real_t *w; /* buffer of size n1_dofs */
264 cs_real_t *m12q; /* buffer of size n1_dofs */
265 cs_real_t *v; /* buffer of size n1_dofs */
266 cs_real_t *x1_tilda; /* buffer of size n1_dofs */
267
268 cs_real_t *rhs_tilda; /* buffer of size MAX(n1_dofs, n2_dofs) */
269
270 /* Optional SLES to perform the transformation of the right hand-side */
271
273
274 /* Function pointers */
275
279
280 /* Shared pointers */
281
283
284 /* Indexed list used to scan the unassembled m21 operator */
285
287
289
290
291/* Context structure for the Notay's algebraic transformation */
292/* ---------------------------------------------------------- */
293
294typedef struct {
295
296 /* Function pointer */
297
299
300 /* Shared pointers */
301
303
304 /* Indexed list used to scan the unassembled m21 operator */
305
307
309
310
311/* Context structure for the Uzawa-CG algorithm */
312/* -------------------------------------------- */
313
314typedef struct {
315
316 /* Auxiliary scaling coefficient */
317
319
320 /* Auxiliary buffers */
321
322 cs_real_t *res2; /* buffer of size n2_dofs */
323 cs_real_t *m21x1; /* buffer of size n2_dofs */
324 cs_real_t *gk; /* buffer of size n2_dofs */
325
326 cs_real_t *b1_tilda; /* Modified RHS (size n1_dofs) */
327 cs_real_t *dzk; /* buffer of size n1_dofs */
328 cs_real_t *rhs; /* buffer of size n1_dofs */
329
330 /* Function pointers */
331
335
336 /* Shortcut on pointers available through the system helper */
337
340
341 /* Max. size of the blocks (scatter or gather view). This size takes into
342 account the size needed for synchronization. */
343
346
347 /* SLES structure associated to the Schur complement. It depends on the type
348 of Schur complement approximation used */
349
350 cs_real_t *inv_m22; /* reciprocal of the mass matrix for the
351 * (2,2) block; buffer of size n2_dofs */
354
355 /* Native arrays for the Schur matrix (optional) */
356
359
360 /* Diagonal approximations of block matrices (optional) */
361
363
366
367 /* Shared pointers */
368
369 const cs_property_t *pty_22; /* Property related to the (2,2) block */
371 const cs_adjacency_t *m21_adj; /* Indexed list used to scan the unassembled
372 m21 operator */
373
375
376/* Context structure for the SIMPLE-lile algorithm */
377/* ----------------------------------------------- */
378
379typedef struct {
380
381 /* Auxiliary buffers */
382
383 cs_real_t *res2; /* buffer of size n2_dofs */
384 cs_real_t *m21x1; /* buffer of size n2_dofs */
385
386 cs_real_t *b1_tilda; /* Modified RHS (size n1_dofs) */
387 cs_real_t *rhs; /* buffer of size n1_dofs */
388
389 /* Function pointers */
390
394
395 /* Shortcut on pointers available through the system helper */
396
399
400 /* Max. size of the blocks (scatter or gather view). This size takes into
401 account the size needed for synchronization. */
402
405
406 /* SLES structure associated to the Schur complement. It depends on the type
407 of Schur complement approximation used */
408
409 cs_real_t *inv_m22; /* reciprocal of the mass matrix for the
410 * (2,2) block; buffer of size n2_dofs */
413
414 /* Native arrays for the Schur matrix (optional) */
415
418
419 /* Diagonal approximations of block matrices (optional) */
420
422
425
426 /* Shared pointers */
427
428 const cs_property_t *pty_22; /* Property related to the (2,2) block */
430 const cs_adjacency_t *m21_adj; /* Indexed list used to scan the unassembled
431 m21 operator */
432
434
435/*============================================================================
436 * Public function prototypes
437 *============================================================================*/
438
439/*----------------------------------------------------------------------------*/
445/*----------------------------------------------------------------------------*/
446
447int
449
450/*----------------------------------------------------------------------------*/
458/*----------------------------------------------------------------------------*/
459
462
463/*----------------------------------------------------------------------------*/
478/*----------------------------------------------------------------------------*/
479
482 int n1_dofs_by_elt,
483 cs_lnum_t n2_elts,
484 int n2_dofs_by_elt,
485 const cs_param_saddle_t *saddlep,
487 cs_sles_t *main_sles);
488
489/*----------------------------------------------------------------------------*/
493/*----------------------------------------------------------------------------*/
494
495void
497
498/*----------------------------------------------------------------------------*/
504/*----------------------------------------------------------------------------*/
505
506void
508
509/*----------------------------------------------------------------------------*/
515/*----------------------------------------------------------------------------*/
516
517void
519
520/*----------------------------------------------------------------------------*/
527/*----------------------------------------------------------------------------*/
528
529void
531 unsigned n_iter);
532
533/*----------------------------------------------------------------------------*/
537/*----------------------------------------------------------------------------*/
538
539void
541
542/*----------------------------------------------------------------------------*/
557/*----------------------------------------------------------------------------*/
558
559cs_real_t *
561 const cs_real_t scaling_coef,
562 const cs_matrix_t *m11,
563 const cs_range_set_t *b11_rset,
564 cs_sles_t *xtra_sles,
565 int *n_iter);
566
567/*----------------------------------------------------------------------------*/
582/*----------------------------------------------------------------------------*/
583
584void
586 const cs_real_t *x2,
587 const cs_adjacency_t *m21_adj,
588 const cs_real_t *m21_val,
589 cs_real_t *m12x2);
590
591/*----------------------------------------------------------------------------*/
606/*----------------------------------------------------------------------------*/
607
608void
610 const cs_real_t *x2,
611 const cs_adjacency_t *m21_adj,
612 const cs_real_t *m21_val,
613 cs_real_t *m12x2);
614
615/*----------------------------------------------------------------------------*/
627/*----------------------------------------------------------------------------*/
628
629void
631 const cs_real_t *x1,
632 const cs_adjacency_t *m21_adj,
633 const cs_real_t *m21_val,
634 cs_real_t *m21x1);
635
636/*----------------------------------------------------------------------------*/
648/*----------------------------------------------------------------------------*/
649
650void
652 const cs_real_t *x1,
653 const cs_adjacency_t *m21_adj,
654 const cs_real_t *m21_val,
655 cs_real_t *m21x1);
656
657/*----------------------------------------------------------------------------*/
664/*----------------------------------------------------------------------------*/
665
666void
668
669/*----------------------------------------------------------------------------*/
676/*----------------------------------------------------------------------------*/
677
678void
680(
682);
683
684/*----------------------------------------------------------------------------*/
690/*----------------------------------------------------------------------------*/
691
692void
694(
696);
697
698/*----------------------------------------------------------------------------*/
706/*----------------------------------------------------------------------------*/
707
708void
710 cs_saddle_solver_t *solver);
711
712/*----------------------------------------------------------------------------*/
719/*----------------------------------------------------------------------------*/
720
721void
723(
725);
726
727/*----------------------------------------------------------------------------*/
734/*----------------------------------------------------------------------------*/
735
736void
738(
740);
741
742/*----------------------------------------------------------------------------*/
748/*----------------------------------------------------------------------------*/
749
750void
752
753/*----------------------------------------------------------------------------*/
760/*----------------------------------------------------------------------------*/
761
762void
764
765/*----------------------------------------------------------------------------*/
771/*----------------------------------------------------------------------------*/
772
773void
775(
777);
778
779/*----------------------------------------------------------------------------*/
786/*----------------------------------------------------------------------------*/
787
788void
790
791/*----------------------------------------------------------------------------*/
799/*----------------------------------------------------------------------------*/
800
801void
803 cs_saddle_solver_t *solver);
804
805/*----------------------------------------------------------------------------*/
812/*----------------------------------------------------------------------------*/
813
814void
816(
818);
819
820/*----------------------------------------------------------------------------*/
826/*----------------------------------------------------------------------------*/
827
828void
830(
832);
833
834/*----------------------------------------------------------------------------*/
842/*----------------------------------------------------------------------------*/
843
844void
846 cs_saddle_solver_t *solver);
847
848/*----------------------------------------------------------------------------*/
855/*----------------------------------------------------------------------------*/
856
857void
859(
861);
862
863/*----------------------------------------------------------------------------*/
869/*----------------------------------------------------------------------------*/
870
871void
873(
875);
876
877/*----------------------------------------------------------------------------*/
887/*----------------------------------------------------------------------------*/
888
889void
891 cs_real_t *x1,
892 cs_real_t *x2);
893
894/*----------------------------------------------------------------------------*/
908/*----------------------------------------------------------------------------*/
909
910void
912 cs_real_t *x1,
913 cs_real_t *x2);
914
915/*----------------------------------------------------------------------------*/
926/*----------------------------------------------------------------------------*/
927
928void
930 cs_real_t *x1,
931 cs_real_t *x2);
932
933/*----------------------------------------------------------------------------*/
942/*----------------------------------------------------------------------------*/
943
944void
946 cs_real_t *x1,
947 cs_real_t *x2);
948
949/*----------------------------------------------------------------------------*/
960/*----------------------------------------------------------------------------*/
961
962void
964 cs_real_t *x1,
965 cs_real_t *x2);
966
967/*----------------------------------------------------------------------------*/
976/*----------------------------------------------------------------------------*/
977
978void
980 cs_real_t *x1,
981 cs_real_t *x2);
982
983/*----------------------------------------------------------------------------*/
994/*----------------------------------------------------------------------------*/
995
996void
998 cs_real_t *x1,
999 cs_real_t *x2);
1000
1001/*----------------------------------------------------------------------------*/
1009/*----------------------------------------------------------------------------*/
1010
1011void
1013 cs_real_t *x1,
1014 cs_real_t *x2);
1015
1016/*----------------------------------------------------------------------------*/
1026/*----------------------------------------------------------------------------*/
1027
1028void
1030 cs_real_t *x1,
1031 cs_real_t *x2);
1032
1033/*----------------------------------------------------------------------------*/
1034
1035#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:73
double cs_real_t
Floating-point value.
Definition: cs_defs.h:332
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:325
@ x2
Definition: cs_field_pointer.h:199
struct _cs_matrix_t cs_matrix_t
Definition: cs_matrix.h:108
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:3925
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:2410
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:2503
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:2906
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:4482
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:2866
void cs_saddle_solver_free(cs_saddle_solver_t **p_solver)
Free a cs_saddle_solver_t structure.
Definition: cs_saddle_solver.cpp:1995
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:2557
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:3663
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:3246
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:1917
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:4171
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:2176
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:3281
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:2830
void cs_saddle_solver_afs(cs_saddle_solver_t *solver, cs_real_t *x1, cs_real_t *x2)
Apply the AFS (Algebraic Fractional Step) algorithm to solve a saddle point problem cf....
Definition: cs_saddle_solver.cpp:5076
void cs_saddle_solver_finalize(void)
Free all remaining structures related to saddle-point solvers.
Definition: cs_saddle_solver.cpp:1980
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:2527
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:3478
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:3104
void cs_saddle_solver_log_monitoring(void)
Log the monitoring performance of all saddle-point systems.
Definition: cs_saddle_solver.cpp:2199
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:2717
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:4333
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:2440
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:4728
cs_real_t * cs_saddle_solver_m11_inv_lumped(cs_saddle_solver_t *solver, const cs_real_t scaling_coef, 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:2231
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:3212
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:3030
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:2792
int cs_saddle_solver_get_n_systems(void)
Retrieve the number of saddle-point systems which have been added.
Definition: cs_saddle_solver.cpp:1901
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:2659
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:2341
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:2294
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:2375
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:2091
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:3068
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:2690
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:69
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:1944
struct _cs_sles_t cs_sles_t
Definition: cs_sles.h:72
Definition: cs_mesh_adjacencies.h:68
Definition: cs_cdo_system.h:373
Structure to handle the convergence of an iterative algorithm.
Definition: cs_iter_algo.h:285
Structure storing all metadata related to the resolution of a saddle-point linear system....
Definition: cs_param_saddle.h:280
Structure associated to the definition of a property relying on the cs_xdef_t structure.
Definition: cs_range_set.h:53
Definition: cs_saddle_solver.h:139
cs_sles_t * init_sles
Definition: cs_saddle_solver.h:153
cs_saddle_solver_matvec_t * m12_vector_multiply
Definition: cs_saddle_solver.h:159
cs_real_t * rhs
Definition: cs_saddle_solver.h:149
cs_real_t * b1_tilda
Definition: cs_saddle_solver.h:148
cs_real_t * inv_m22
Definition: cs_saddle_solver.h:143
const cs_adjacency_t * m21_adj
Definition: cs_saddle_solver.h:168
const cs_real_t * m21_val
Definition: cs_saddle_solver.h:164
cs_saddle_solver_matvec_t * m21_vector_multiply
Definition: cs_saddle_solver.h:160
cs_real_t * m21x1
Definition: cs_saddle_solver.h:146
cs_real_t * res2
Definition: cs_saddle_solver.h:145
cs_cdo_blas_square_norm_t * square_norm_b11
Definition: cs_saddle_solver.h:158
Definition: cs_saddle_solver.h:186
cs_real_t * schur_diag
Definition: cs_saddle_solver.h:208
cs_range_set_t * b11_range_set
Definition: cs_saddle_solver.h:191
cs_saddle_solver_matvec_t * m12_vector_multiply
Definition: cs_saddle_solver.h:220
cs_real_t * m11_inv_diag
Definition: cs_saddle_solver.h:213
cs_matrix_t * m11
Definition: cs_saddle_solver.h:190
cs_sles_t * xtra_sles
Definition: cs_saddle_solver.h:216
const cs_property_t * pty_22
Definition: cs_saddle_solver.h:225
cs_matrix_t * schur_matrix
Definition: cs_saddle_solver.h:202
const cs_adjacency_t * m21_adj
Definition: cs_saddle_solver.h:227
const cs_real_t * m21_val
Definition: cs_saddle_solver.h:226
double schur_scaling
Definition: cs_saddle_solver.h:204
cs_sles_t * schur_sles
Definition: cs_saddle_solver.h:203
cs_saddle_solver_matvec_t * m21_vector_multiply
Definition: cs_saddle_solver.h:221
cs_lnum_t b11_max_size
Definition: cs_saddle_solver.h:196
cs_real_t * m22_mass_diag
Definition: cs_saddle_solver.h:214
cs_real_t * schur_xtra
Definition: cs_saddle_solver.h:209
cs_lnum_t b22_max_size
Definition: cs_saddle_solver.h:197
Definition: cs_saddle_solver.h:240
cs_real_t zeta_square_sum
Definition: cs_saddle_solver.h:252
cs_sles_t * init_sles
Definition: cs_saddle_solver.h:272
cs_real_t * rhs_tilda
Definition: cs_saddle_solver.h:268
cs_saddle_solver_matvec_t * m12_vector_multiply
Definition: cs_saddle_solver.h:277
cs_real_t alpha
Definition: cs_saddle_solver.h:244
cs_real_t * m21v
Definition: cs_saddle_solver.h:258
cs_real_t zeta
Definition: cs_saddle_solver.h:246
cs_real_t * m12q
Definition: cs_saddle_solver.h:264
cs_real_t * inv_m22
Definition: cs_saddle_solver.h:259
cs_real_t * zeta_array
Definition: cs_saddle_solver.h:251
const cs_adjacency_t * m21_adj
Definition: cs_saddle_solver.h:286
const cs_real_t * m22
Definition: cs_saddle_solver.h:261
const cs_real_t * m21_val
Definition: cs_saddle_solver.h:282
cs_real_t beta
Definition: cs_saddle_solver.h:245
cs_saddle_solver_matvec_t * m21_vector_multiply
Definition: cs_saddle_solver.h:278
cs_real_t * q
Definition: cs_saddle_solver.h:256
int zeta_size
Definition: cs_saddle_solver.h:250
cs_real_t * x1_tilda
Definition: cs_saddle_solver.h:266
cs_real_t * d
Definition: cs_saddle_solver.h:257
cs_cdo_blas_square_norm_t * square_norm_b11
Definition: cs_saddle_solver.h:276
cs_real_t * w
Definition: cs_saddle_solver.h:263
cs_real_t * v
Definition: cs_saddle_solver.h:265
Definition: cs_saddle_solver.h:294
cs_saddle_solver_matvec_t * m12_vector_multiply
Definition: cs_saddle_solver.h:298
const cs_adjacency_t * m21_adj
Definition: cs_saddle_solver.h:306
const cs_real_t * m21_val
Definition: cs_saddle_solver.h:302
Definition: cs_saddle_solver.h:379
cs_sles_t * init_sles
Definition: cs_saddle_solver.h:424
cs_real_t * schur_diag
Definition: cs_saddle_solver.h:416
cs_range_set_t * b11_range_set
Definition: cs_saddle_solver.h:398
cs_saddle_solver_matvec_t * m12_vector_multiply
Definition: cs_saddle_solver.h:392
cs_real_t * m11_inv_diag
Definition: cs_saddle_solver.h:421
cs_real_t * rhs
Definition: cs_saddle_solver.h:387
cs_matrix_t * m11
Definition: cs_saddle_solver.h:397
cs_real_t * b1_tilda
Definition: cs_saddle_solver.h:386
cs_sles_t * xtra_sles
Definition: cs_saddle_solver.h:423
const cs_property_t * pty_22
Definition: cs_saddle_solver.h:428
cs_matrix_t * schur_matrix
Definition: cs_saddle_solver.h:411
cs_real_t * inv_m22
Definition: cs_saddle_solver.h:409
const cs_adjacency_t * m21_adj
Definition: cs_saddle_solver.h:430
const cs_real_t * m21_val
Definition: cs_saddle_solver.h:429
cs_sles_t * schur_sles
Definition: cs_saddle_solver.h:412
cs_saddle_solver_matvec_t * m21_vector_multiply
Definition: cs_saddle_solver.h:393
cs_real_t * m21x1
Definition: cs_saddle_solver.h:384
cs_real_t * res2
Definition: cs_saddle_solver.h:383
cs_lnum_t b11_max_size
Definition: cs_saddle_solver.h:403
cs_cdo_blas_square_norm_t * square_norm_b11
Definition: cs_saddle_solver.h:391
cs_real_t * schur_xtra
Definition: cs_saddle_solver.h:417
cs_lnum_t b22_max_size
Definition: cs_saddle_solver.h:404
Definition: cs_saddle_solver.h:314
cs_sles_t * init_sles
Definition: cs_saddle_solver.h:365
cs_real_t * schur_diag
Definition: cs_saddle_solver.h:357
cs_range_set_t * b11_range_set
Definition: cs_saddle_solver.h:339
cs_saddle_solver_matvec_t * m12_vector_multiply
Definition: cs_saddle_solver.h:333
cs_real_t * gk
Definition: cs_saddle_solver.h:324
cs_real_t * m11_inv_diag
Definition: cs_saddle_solver.h:362
cs_real_t * rhs
Definition: cs_saddle_solver.h:328
cs_matrix_t * m11
Definition: cs_saddle_solver.h:338
cs_real_t * b1_tilda
Definition: cs_saddle_solver.h:326
cs_sles_t * xtra_sles
Definition: cs_saddle_solver.h:364
cs_real_t alpha
Definition: cs_saddle_solver.h:318
const cs_property_t * pty_22
Definition: cs_saddle_solver.h:369
cs_matrix_t * schur_matrix
Definition: cs_saddle_solver.h:352
cs_real_t * dzk
Definition: cs_saddle_solver.h:327
cs_real_t * inv_m22
Definition: cs_saddle_solver.h:350
const cs_adjacency_t * m21_adj
Definition: cs_saddle_solver.h:371
const cs_real_t * m21_val
Definition: cs_saddle_solver.h:370
cs_sles_t * schur_sles
Definition: cs_saddle_solver.h:353
cs_saddle_solver_matvec_t * m21_vector_multiply
Definition: cs_saddle_solver.h:334
cs_real_t * m21x1
Definition: cs_saddle_solver.h:323
cs_real_t * res2
Definition: cs_saddle_solver.h:322
cs_lnum_t b11_max_size
Definition: cs_saddle_solver.h:344
cs_cdo_blas_square_norm_t * square_norm_b11
Definition: cs_saddle_solver.h:332
cs_real_t * schur_xtra
Definition: cs_saddle_solver.h:358
cs_lnum_t b22_max_size
Definition: cs_saddle_solver.h:345
Definition: cs_saddle_solver.h:85
cs_cdo_system_helper_t * system_helper
Definition: cs_saddle_solver.h:97
cs_sles_t * main_sles
Definition: cs_saddle_solver.h:105
cs_lnum_t n1_scatter_dofs
Definition: cs_saddle_solver.h:114
bool do_setup
Definition: cs_saddle_solver.h:99
cs_lnum_t n2_elts
Definition: cs_saddle_solver.h:111
unsigned n_calls
Definition: cs_saddle_solver.h:124
cs_lnum_t n1_elts
Definition: cs_saddle_solver.h:109
cs_iter_algo_t * algo
Definition: cs_saddle_solver.h:93
cs_lnum_t n2_scatter_dofs
Definition: cs_saddle_solver.h:115
unsigned n_iter_max
Definition: cs_saddle_solver.h:126
int n2_dofs_by_elt
Definition: cs_saddle_solver.h:112
unsigned n_iter_tot
Definition: cs_saddle_solver.h:127
unsigned n_iter_min
Definition: cs_saddle_solver.h:125
const cs_param_saddle_t * param
Definition: cs_saddle_solver.h:89
int n1_dofs_by_elt
Definition: cs_saddle_solver.h:110
void * context
Definition: cs_saddle_solver.h:120