9.0
general documentation
Loading...
Searching...
No Matches
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-2025 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
50
51/*============================================================================
52 * Macro definitions
53 *============================================================================*/
54
55/*============================================================================
56 * Type definitions
57 *============================================================================*/
58
59/*----------------------------------------------------------------------------*/
70/*----------------------------------------------------------------------------*/
71
72typedef void
74 const cs_real_t *vec,
75 const cs_adjacency_t *mat_adj,
76 const cs_real_t *mat_op,
77 cs_real_t *matvec);
78
79/*
80 * Main structure to solve a saddle-point problem described as follows
81 *
82 * | M11 | M12 | | x1 | |rhs1 |
83 * M = |-----------| |----| = |-----|
84 * | M21 | 0 | | x2 | |rhs2 |
85 *
86 * One assumes that M12 = M21^T
87 */
88
89typedef struct {
90
91 /* Set of parameters to know how to solve the saddle-point system (shared) */
92
94
95 /* Structure to handle iterative algorithms */
96
98
99 /* Description of the saddle-point system to solve (shared) */
100
102
104
105 /* Main SLES structure associated to the saddle-point problem. According to
106 * the type of saddle-point solver, additional SLES can be allocated, for
107 * instance to compute an approximation of the Schur complement. */
108
110
111 /* Scatter viewpoint */
112
117
120
121 /* Additional members according to the type of saddle-point solver. This
122 * structure is cast on-the-fly */
123
124 void *context;
125
126 /* Monitoring */
127
128 unsigned n_calls;
129 unsigned n_iter_min;
130 unsigned n_iter_max;
131 unsigned n_iter_tot;
132
134
135
136/* ==================================================== */
137/* List of context structures dedicated to some solvers */
138/* ==================================================== */
139
140/* Context structure for the ALU algorithm */
141/* --------------------------------------- */
142
143typedef struct {
144
145 /* Auxiliary buffers */
146
147 cs_real_t *inv_m22; /* reciprocal of the mass matrix for the (2,2)
148 * block; buffer of size n2_dofs */
149 cs_real_t *res2; /* buffer of size n2_dofs */
150 cs_real_t *m21x1; /* buffer of size n2_dofs */
151
152 cs_real_t *b1_tilda; /* Modified RHS (size n1_dofs) */
153 cs_real_t *rhs; /* buffer of size n1_dofs */
154
155 /* SLES associated to the transformation of the right-hand side */
156
158
159 /* Function pointers for computing operations needed in the algorithm */
160 /* ------------------------------------------------------------------ */
161
165
166 /* Shared pointers */
167
169
170 /* Indexed list used to scan the unassembled m21 operator */
171
173
175
176
177/* Context structure for block preconditioner used in combination with a Krylov
178 * solver such as MINRES or GCR.
179 * ----------------------------------------------------------------------------
180 *
181 * A hybrid storage is used to represent the system described below
182 *
183 * | M11 | M12 | | x1 | |rhs1 |
184 * M = |-----------| |----| = |-----|
185 * | M21 | 0 | | x2 | |rhs2 |
186 *
187 * One assumes that M12 = M21^T
188 */
189
190typedef struct {
191
192 /* Shortcut on pointers available through the system helper */
193
196
197 /* Max. size of the blocks (scatter or gather view). This size takes into
198 account the size needed for synchronization. */
199
202
203 /* SLES structure associated to the Schur complement. It depends on the type
204 of Schur complement approximation used */
205
209
210 /* Native arrays for the Schur matrix (optional) */
211
214
215 /* Diagonal approximations of block matrices (optional) */
216
219
221
222 /* Function pointers */
223
226
227 /* Shared pointers */
228
229 const cs_property_t *pty_22; /* Property related to the (2,2) block */
231 const cs_adjacency_t *m21_adj; /* Indexed list used to scan the unassembled
232 m21 operator */
233
235
236
237/* Context structure for the GKB algorithm */
238/* --------------------------------------- */
239/* This structure follows the algorithm given in the article entitled "An
240 * iterative generalized Golub-Kahan algorithm for problems in structural
241 * mechanics" by M. Arioli, C. Kruse, U. Ruede and N. Tardieu
242 */
243
244typedef struct {
245
246 /* Orthogonalization coefficients */
247
251
252 /* Energy norm estimation */
253
257
258 /* Auxiliary buffers */
259
260 cs_real_t *q; /* buffer of size n2_dofs */
261 cs_real_t *d; /* buffer of size n2_dofs */
262 cs_real_t *m21v; /* buffer of size n2_dofs */
263 cs_real_t *inv_m22; /* reciprocal of the mass matrix for the (2,2)
264 * block; buffer of size n2_dofs */
265 const cs_real_t *m22; /* mass matrix for the (2,2) block (shared pointer) */
266
267 cs_real_t *w; /* buffer of size n1_dofs */
268 cs_real_t *m12q; /* buffer of size n1_dofs */
269 cs_real_t *v; /* buffer of size n1_dofs */
270 cs_real_t *x1_tilda; /* buffer of size n1_dofs */
271
272 cs_real_t *rhs_tilda; /* buffer of size MAX(n1_dofs, n2_dofs) */
273
274 /* Optional SLES to perform the transformation of the right hand-side */
275
277
278 /* Function pointers */
279
283
284 /* Shared pointers */
285
287
288 /* Indexed list used to scan the unassembled m21 operator */
289
291
293
294
295/* Context structure for the Notay's algebraic transformation */
296/* ---------------------------------------------------------- */
297
298typedef struct {
299
300 /* Function pointer */
301
303
304 /* Shared pointers */
305
307
308 /* Indexed list used to scan the unassembled m21 operator */
309
311
313
314
315/* Context structure for the Uzawa-CG algorithm */
316/* -------------------------------------------- */
317
318typedef struct {
319
320 /* Auxiliary scaling coefficient */
321
323
324 /* Auxiliary buffers */
325
326 cs_real_t *res2; /* buffer of size n2_dofs */
327 cs_real_t *m21x1; /* buffer of size n2_dofs */
328 cs_real_t *gk; /* buffer of size n2_dofs */
329
330 cs_real_t *b1_tilda; /* Modified RHS (size n1_dofs) */
331 cs_real_t *dzk; /* buffer of size n1_dofs */
332 cs_real_t *rhs; /* buffer of size n1_dofs */
333
334 /* Function pointers */
335
339
340 /* Shortcut on pointers available through the system helper */
341
344
345 /* Max. size of the blocks (scatter or gather view). This size takes into
346 account the size needed for synchronization. */
347
350
351 /* SLES structure associated to the Schur complement. It depends on the type
352 of Schur complement approximation used */
353
354 cs_real_t *inv_m22; /* reciprocal of the mass matrix for the
355 * (2,2) block; buffer of size n2_dofs */
358
359 /* Native arrays for the Schur matrix (optional) */
360
363
364 /* Diagonal approximations of block matrices (optional) */
365
367
370
371 /* Shared pointers */
372
373 const cs_property_t *pty_22; /* Property related to the (2,2) block */
375 const cs_adjacency_t *m21_adj; /* Indexed list used to scan the unassembled
376 m21 operator */
377
379
380/* Context structure for the SIMPLE-lile algorithm */
381/* ----------------------------------------------- */
382
383typedef struct {
384
385
386 /* Auxiliary buffers */
387
388 cs_real_t *res2; /* buffer of size n2_dofs */
389 cs_real_t *m21x1; /* buffer of size n2_dofs */
390
391 cs_real_t *b1_tilda; /* Modified RHS (size n1_dofs) */
392 cs_real_t *rhs; /* buffer of size n1_dofs */
393
394 /* Function pointers */
395
399
400 /* Shortcut on pointers available through the system helper */
401
404
405 /* Max. size of the blocks (scatter or gather view). This size takes into
406 account the size needed for synchronization. */
407
410
411 /* SLES structure associated to the Schur complement. It depends on the type
412 of Schur complement approximation used */
413
414 cs_real_t *inv_m22; /* reciprocal of the mass matrix for the
415 * (2,2) block; buffer of size n2_dofs */
418
419 /* Native arrays for the Schur matrix (optional) */
420
423
424 /* Diagonal approximations of block matrices (optional) */
425
427
430
431 /* Shared pointers */
432
433 const cs_property_t *pty_22; /* Property related to the (2,2) block */
435 const cs_adjacency_t *m21_adj; /* Indexed list used to scan the unassembled
436 m21 operator */
437
439
440/*============================================================================
441 * Public function prototypes
442 *============================================================================*/
443
444/*----------------------------------------------------------------------------*/
450/*----------------------------------------------------------------------------*/
451
452int
454
455/*----------------------------------------------------------------------------*/
463/*----------------------------------------------------------------------------*/
464
467
468/*----------------------------------------------------------------------------*/
483/*----------------------------------------------------------------------------*/
484
487 int n1_dofs_by_elt,
488 cs_lnum_t n2_elts,
489 int n2_dofs_by_elt,
490 const cs_param_saddle_t *saddlep,
492 cs_sles_t *main_sles);
493
494/*----------------------------------------------------------------------------*/
498/*----------------------------------------------------------------------------*/
499
500void
502
503/*----------------------------------------------------------------------------*/
509/*----------------------------------------------------------------------------*/
510
511void
513
514/*----------------------------------------------------------------------------*/
520/*----------------------------------------------------------------------------*/
521
522void
524
525/*----------------------------------------------------------------------------*/
532/*----------------------------------------------------------------------------*/
533
534void
536 unsigned n_iter);
537
538/*----------------------------------------------------------------------------*/
542/*----------------------------------------------------------------------------*/
543
544void
546
547/*----------------------------------------------------------------------------*/
561/*----------------------------------------------------------------------------*/
562
563cs_real_t *
565 const cs_matrix_t *m11,
566 const cs_range_set_t *b11_rset,
567 cs_sles_t *xtra_sles,
568 int *n_iter);
569
570/*----------------------------------------------------------------------------*/
585/*----------------------------------------------------------------------------*/
586
587void
589 const cs_real_t *x2,
590 const cs_adjacency_t *m21_adj,
591 const cs_real_t *m21_val,
592 cs_real_t *m12x2);
593
594/*----------------------------------------------------------------------------*/
609/*----------------------------------------------------------------------------*/
610
611void
613 const cs_real_t *x2,
614 const cs_adjacency_t *m21_adj,
615 const cs_real_t *m21_val,
616 cs_real_t *m12x2);
617
618/*----------------------------------------------------------------------------*/
630/*----------------------------------------------------------------------------*/
631
632void
634 const cs_real_t *x1,
635 const cs_adjacency_t *m21_adj,
636 const cs_real_t *m21_val,
637 cs_real_t *m21x1);
638
639/*----------------------------------------------------------------------------*/
651/*----------------------------------------------------------------------------*/
652
653void
655 const cs_real_t *x1,
656 const cs_adjacency_t *m21_adj,
657 const cs_real_t *m21_val,
658 cs_real_t *m21x1);
659
660/*----------------------------------------------------------------------------*/
667/*----------------------------------------------------------------------------*/
668
669void
671
672/*----------------------------------------------------------------------------*/
679/*----------------------------------------------------------------------------*/
680
681void
683(
685);
686
687/*----------------------------------------------------------------------------*/
693/*----------------------------------------------------------------------------*/
694
695void
697(
699);
700
701/*----------------------------------------------------------------------------*/
709/*----------------------------------------------------------------------------*/
710
711void
713 cs_saddle_solver_t *solver);
714
715/*----------------------------------------------------------------------------*/
722/*----------------------------------------------------------------------------*/
723
724void
726(
728);
729
730/*----------------------------------------------------------------------------*/
737/*----------------------------------------------------------------------------*/
738
739void
741(
743);
744
745/*----------------------------------------------------------------------------*/
751/*----------------------------------------------------------------------------*/
752
753void
755
756/*----------------------------------------------------------------------------*/
763/*----------------------------------------------------------------------------*/
764
765void
767
768/*----------------------------------------------------------------------------*/
774/*----------------------------------------------------------------------------*/
775
776void
778(
780);
781
782/*----------------------------------------------------------------------------*/
789/*----------------------------------------------------------------------------*/
790
791void
793
794/*----------------------------------------------------------------------------*/
802/*----------------------------------------------------------------------------*/
803
804void
806 cs_saddle_solver_t *solver);
807
808/*----------------------------------------------------------------------------*/
815/*----------------------------------------------------------------------------*/
816
817void
819(
821);
822
823/*----------------------------------------------------------------------------*/
829/*----------------------------------------------------------------------------*/
830
831void
833(
835);
836
837/*----------------------------------------------------------------------------*/
845/*----------------------------------------------------------------------------*/
846
847void
849 cs_saddle_solver_t *solver);
850
851/*----------------------------------------------------------------------------*/
858/*----------------------------------------------------------------------------*/
859
860void
862(
864);
865
866/*----------------------------------------------------------------------------*/
872/*----------------------------------------------------------------------------*/
873
874void
876(
878);
879
880/*----------------------------------------------------------------------------*/
890/*----------------------------------------------------------------------------*/
891
892void
894 cs_real_t *x1,
895 cs_real_t *x2);
896
897/*----------------------------------------------------------------------------*/
911/*----------------------------------------------------------------------------*/
912
913void
915 cs_real_t *x1,
916 cs_real_t *x2);
917
918/*----------------------------------------------------------------------------*/
929/*----------------------------------------------------------------------------*/
930
931void
933 cs_real_t *x1,
934 cs_real_t *x2);
935
936/*----------------------------------------------------------------------------*/
945/*----------------------------------------------------------------------------*/
946
947void
949 cs_real_t *x1,
950 cs_real_t *x2);
951
952/*----------------------------------------------------------------------------*/
963/*----------------------------------------------------------------------------*/
964
965void
967 cs_real_t *x1,
968 cs_real_t *x2);
969
970/*----------------------------------------------------------------------------*/
979/*----------------------------------------------------------------------------*/
980
981void
983 cs_real_t *x1,
984 cs_real_t *x2);
985
986/*----------------------------------------------------------------------------*/
997/*----------------------------------------------------------------------------*/
998
999void
1001 cs_real_t *x1,
1002 cs_real_t *x2);
1003
1004/*----------------------------------------------------------------------------*/
1012/*----------------------------------------------------------------------------*/
1013
1014void
1016 cs_real_t *x1,
1017 cs_real_t *x2);
1018
1019/*----------------------------------------------------------------------------*/
1020
1022
1023#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:202
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:4125
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:2619
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:2712
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:3095
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:4663
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:3055
void cs_saddle_solver_free(cs_saddle_solver_t **p_solver)
Free a cs_saddle_solver_t structure.
Definition cs_saddle_solver.cpp:2208
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:2762
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:3868
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:3427
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:2130
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:4352
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:2389
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:3455
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:3030
void cs_saddle_solver_finalize(void)
Free all remaining structures related to saddle-point solvers.
Definition cs_saddle_solver.cpp:2193
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:2736
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:3683
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:3281
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:2443
void cs_saddle_solver_log_monitoring(void)
Log the monitoring performance of all saddle-point systems.
Definition cs_saddle_solver.cpp:2412
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:2917
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:73
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:4514
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:2649
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:4908
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:3395
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:3219
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:2992
int cs_saddle_solver_get_n_systems(void)
Retrieve the number of saddle-point systems which have been added.
Definition cs_saddle_solver.cpp:2114
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:2864
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:2550
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:2503
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:2584
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:2305
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:3255
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:2893
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:2157
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:143
cs_sles_t * init_sles
Definition cs_saddle_solver.h:157
cs_saddle_solver_matvec_t * m12_vector_multiply
Definition cs_saddle_solver.h:163
cs_real_t * rhs
Definition cs_saddle_solver.h:153
cs_real_t * b1_tilda
Definition cs_saddle_solver.h:152
cs_real_t * inv_m22
Definition cs_saddle_solver.h:147
const cs_adjacency_t * m21_adj
Definition cs_saddle_solver.h:172
const cs_real_t * m21_val
Definition cs_saddle_solver.h:168
cs_saddle_solver_matvec_t * m21_vector_multiply
Definition cs_saddle_solver.h:164
cs_real_t * m21x1
Definition cs_saddle_solver.h:150
cs_real_t * res2
Definition cs_saddle_solver.h:149
cs_cdo_blas_square_norm_t * square_norm_b11
Definition cs_saddle_solver.h:162
Definition cs_saddle_solver.h:190
cs_real_t * schur_diag
Definition cs_saddle_solver.h:212
cs_range_set_t * b11_range_set
Definition cs_saddle_solver.h:195
cs_saddle_solver_matvec_t * m12_vector_multiply
Definition cs_saddle_solver.h:224
cs_real_t * m11_inv_diag
Definition cs_saddle_solver.h:217
cs_matrix_t * m11
Definition cs_saddle_solver.h:194
cs_sles_t * xtra_sles
Definition cs_saddle_solver.h:220
const cs_property_t * pty_22
Definition cs_saddle_solver.h:229
cs_matrix_t * schur_matrix
Definition cs_saddle_solver.h:206
const cs_adjacency_t * m21_adj
Definition cs_saddle_solver.h:231
const cs_real_t * m21_val
Definition cs_saddle_solver.h:230
double schur_scaling
Definition cs_saddle_solver.h:208
cs_sles_t * schur_sles
Definition cs_saddle_solver.h:207
cs_saddle_solver_matvec_t * m21_vector_multiply
Definition cs_saddle_solver.h:225
cs_lnum_t b11_max_size
Definition cs_saddle_solver.h:200
cs_real_t * m22_mass_diag
Definition cs_saddle_solver.h:218
cs_real_t * schur_xtra
Definition cs_saddle_solver.h:213
cs_lnum_t b22_max_size
Definition cs_saddle_solver.h:201
Definition cs_saddle_solver.h:244
cs_real_t zeta_square_sum
Definition cs_saddle_solver.h:256
cs_sles_t * init_sles
Definition cs_saddle_solver.h:276
cs_real_t * rhs_tilda
Definition cs_saddle_solver.h:272
cs_saddle_solver_matvec_t * m12_vector_multiply
Definition cs_saddle_solver.h:281
cs_real_t alpha
Definition cs_saddle_solver.h:248
cs_real_t * m21v
Definition cs_saddle_solver.h:262
cs_real_t zeta
Definition cs_saddle_solver.h:250
cs_real_t * m12q
Definition cs_saddle_solver.h:268
cs_real_t * inv_m22
Definition cs_saddle_solver.h:263
cs_real_t * zeta_array
Definition cs_saddle_solver.h:255
const cs_adjacency_t * m21_adj
Definition cs_saddle_solver.h:290
const cs_real_t * m22
Definition cs_saddle_solver.h:265
const cs_real_t * m21_val
Definition cs_saddle_solver.h:286
cs_real_t beta
Definition cs_saddle_solver.h:249
cs_saddle_solver_matvec_t * m21_vector_multiply
Definition cs_saddle_solver.h:282
cs_real_t * q
Definition cs_saddle_solver.h:260
int zeta_size
Definition cs_saddle_solver.h:254
cs_real_t * x1_tilda
Definition cs_saddle_solver.h:270
cs_real_t * d
Definition cs_saddle_solver.h:261
cs_cdo_blas_square_norm_t * square_norm_b11
Definition cs_saddle_solver.h:280
cs_real_t * w
Definition cs_saddle_solver.h:267
cs_real_t * v
Definition cs_saddle_solver.h:269
Definition cs_saddle_solver.h:298
cs_saddle_solver_matvec_t * m12_vector_multiply
Definition cs_saddle_solver.h:302
const cs_adjacency_t * m21_adj
Definition cs_saddle_solver.h:310
const cs_real_t * m21_val
Definition cs_saddle_solver.h:306
Definition cs_saddle_solver.h:383
cs_sles_t * init_sles
Definition cs_saddle_solver.h:429
cs_real_t * schur_diag
Definition cs_saddle_solver.h:421
cs_range_set_t * b11_range_set
Definition cs_saddle_solver.h:403
cs_saddle_solver_matvec_t * m12_vector_multiply
Definition cs_saddle_solver.h:397
cs_real_t * m11_inv_diag
Definition cs_saddle_solver.h:426
cs_real_t * rhs
Definition cs_saddle_solver.h:392
cs_matrix_t * m11
Definition cs_saddle_solver.h:402
cs_real_t * b1_tilda
Definition cs_saddle_solver.h:391
cs_sles_t * xtra_sles
Definition cs_saddle_solver.h:428
const cs_property_t * pty_22
Definition cs_saddle_solver.h:433
cs_matrix_t * schur_matrix
Definition cs_saddle_solver.h:416
cs_real_t * inv_m22
Definition cs_saddle_solver.h:414
const cs_adjacency_t * m21_adj
Definition cs_saddle_solver.h:435
const cs_real_t * m21_val
Definition cs_saddle_solver.h:434
cs_sles_t * schur_sles
Definition cs_saddle_solver.h:417
cs_saddle_solver_matvec_t * m21_vector_multiply
Definition cs_saddle_solver.h:398
cs_real_t * m21x1
Definition cs_saddle_solver.h:389
cs_real_t * res2
Definition cs_saddle_solver.h:388
cs_lnum_t b11_max_size
Definition cs_saddle_solver.h:408
cs_cdo_blas_square_norm_t * square_norm_b11
Definition cs_saddle_solver.h:396
cs_real_t * schur_xtra
Definition cs_saddle_solver.h:422
cs_lnum_t b22_max_size
Definition cs_saddle_solver.h:409
Definition cs_saddle_solver.h:318
cs_sles_t * init_sles
Definition cs_saddle_solver.h:369
cs_real_t * schur_diag
Definition cs_saddle_solver.h:361
cs_range_set_t * b11_range_set
Definition cs_saddle_solver.h:343
cs_saddle_solver_matvec_t * m12_vector_multiply
Definition cs_saddle_solver.h:337
cs_real_t * gk
Definition cs_saddle_solver.h:328
cs_real_t * m11_inv_diag
Definition cs_saddle_solver.h:366
cs_real_t * rhs
Definition cs_saddle_solver.h:332
cs_matrix_t * m11
Definition cs_saddle_solver.h:342
cs_real_t * b1_tilda
Definition cs_saddle_solver.h:330
cs_sles_t * xtra_sles
Definition cs_saddle_solver.h:368
cs_real_t alpha
Definition cs_saddle_solver.h:322
const cs_property_t * pty_22
Definition cs_saddle_solver.h:373
cs_matrix_t * schur_matrix
Definition cs_saddle_solver.h:356
cs_real_t * dzk
Definition cs_saddle_solver.h:331
cs_real_t * inv_m22
Definition cs_saddle_solver.h:354
const cs_adjacency_t * m21_adj
Definition cs_saddle_solver.h:375
const cs_real_t * m21_val
Definition cs_saddle_solver.h:374
cs_sles_t * schur_sles
Definition cs_saddle_solver.h:357
cs_saddle_solver_matvec_t * m21_vector_multiply
Definition cs_saddle_solver.h:338
cs_real_t * m21x1
Definition cs_saddle_solver.h:327
cs_real_t * res2
Definition cs_saddle_solver.h:326
cs_lnum_t b11_max_size
Definition cs_saddle_solver.h:348
cs_cdo_blas_square_norm_t * square_norm_b11
Definition cs_saddle_solver.h:336
cs_real_t * schur_xtra
Definition cs_saddle_solver.h:362
cs_lnum_t b22_max_size
Definition cs_saddle_solver.h:349
Definition cs_saddle_solver.h:89
cs_cdo_system_helper_t * system_helper
Definition cs_saddle_solver.h:101
cs_sles_t * main_sles
Definition cs_saddle_solver.h:109
cs_lnum_t n1_scatter_dofs
Definition cs_saddle_solver.h:118
bool do_setup
Definition cs_saddle_solver.h:103
cs_lnum_t n2_elts
Definition cs_saddle_solver.h:115
unsigned n_calls
Definition cs_saddle_solver.h:128
cs_lnum_t n1_elts
Definition cs_saddle_solver.h:113
cs_iter_algo_t * algo
Definition cs_saddle_solver.h:97
cs_lnum_t n2_scatter_dofs
Definition cs_saddle_solver.h:119
unsigned n_iter_max
Definition cs_saddle_solver.h:130
int n2_dofs_by_elt
Definition cs_saddle_solver.h:116
unsigned n_iter_tot
Definition cs_saddle_solver.h:131
unsigned n_iter_min
Definition cs_saddle_solver.h:129
const cs_param_saddle_t * param
Definition cs_saddle_solver.h:93
int n1_dofs_by_elt
Definition cs_saddle_solver.h:114
void * context
Definition cs_saddle_solver.h:124