8.2
general documentation
Loading...
Searching...
No Matches
cs_sles_mumps.h
Go to the documentation of this file.
1#ifndef __CS_SLES_MUMPS_H__
2#define __CS_SLES_MUMPS_H__
3
4/*============================================================================
5 * Sparse Linear Equation Solvers using MUMPS (a sparse direct solver library)
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/*----------------------------------------------------------------------------
31 * Local headers
32 *----------------------------------------------------------------------------*/
33
34#include "cs_base.h"
35#include "cs_halo_perio.h"
36#include "cs_matrix.h"
37#include "cs_param_sles.h"
38#include "cs_time_plot.h"
39#include "cs_sles.h"
40#include "cs_sles_pc.h"
41
42/*----------------------------------------------------------------------------*/
43
45
46/*============================================================================
47 * Macro definitions
48 *============================================================================*/
49
50/* Set of macros defined in order to match MUMPS documentation (because of the
51 * difference between C/FORTRAN programming language)
52 */
53
54#define ICNTL(I) icntl[(I)-1]
55#define CNTL(I) cntl[(I)-1]
56#define INFOG(I) infog[(I)-1]
57#define INFO(I) info[(I)-1]
58#define RINFOG(I) rinfog[(I)-1]
59#define RINFO(I) rinfo[(I)-1]
60#define KEEP(I) keep[(I)-1]
61
62/*============================================================================
63 * Type definitions
64 *============================================================================*/
65
66/*----------------------------------------------------------------------------*/
79/*----------------------------------------------------------------------------*/
80
81typedef void
83 void *context,
84 void *mumps);
85
86/* MUMPS solver context (opaque) */
87
88typedef struct _cs_sles_mumps_t cs_sles_mumps_t;
89
90/*============================================================================
91 * Global variables
92 *============================================================================*/
93
94/*=============================================================================
95 * User function prototypes
96 *============================================================================*/
97
98/*----------------------------------------------------------------------------*/
116/*----------------------------------------------------------------------------*/
117
118void
120 void *context,
121 void *pmumps);
122
123/*=============================================================================
124 * Public function prototypes
125 *============================================================================*/
126
127/*----------------------------------------------------------------------------*/
153/*----------------------------------------------------------------------------*/
154
156cs_sles_mumps_define(int f_id,
157 const char *name,
158 const cs_param_sles_t *slesp,
159 cs_sles_mumps_setup_hook_t *setup_hook,
160 void *context);
161
162/*----------------------------------------------------------------------------*/
170/*----------------------------------------------------------------------------*/
171
174
175/*----------------------------------------------------------------------------*/
186/*----------------------------------------------------------------------------*/
187
190 cs_sles_mumps_setup_hook_t *setup_hook,
191 void *context);
192
193/*----------------------------------------------------------------------------*/
204/*----------------------------------------------------------------------------*/
205
206void *
207cs_sles_mumps_copy(const void *context);
208
209/*----------------------------------------------------------------------------*/
220/*----------------------------------------------------------------------------*/
221
222void
223cs_sles_mumps_free(void *context);
224
225/*----------------------------------------------------------------------------*/
232/*----------------------------------------------------------------------------*/
233
234void
235cs_sles_mumps_destroy(void **context);
236
237/*----------------------------------------------------------------------------*/
247/*----------------------------------------------------------------------------*/
248
249void
250cs_sles_mumps_setup(void *context,
251 const char *name,
252 const cs_matrix_t *a,
253 int verbosity);
254
255/*----------------------------------------------------------------------------*/
278/*----------------------------------------------------------------------------*/
279
281cs_sles_mumps_solve(void *context,
282 const char *name,
283 const cs_matrix_t *a,
284 int verbosity,
285 double precision,
286 double r_norm,
287 int *n_iter,
288 double *residual,
289 const cs_real_t *rhs,
290 cs_real_t *vx_ini,
291 cs_real_t *vx,
292 size_t aux_size,
293 void *aux_vectors);
294
295/*----------------------------------------------------------------------------*/
303/*----------------------------------------------------------------------------*/
304
305void
306cs_sles_mumps_log(const void *context,
307 cs_log_t log_type);
308
309/*----------------------------------------------------------------------------*/
315/*----------------------------------------------------------------------------*/
316
317void
319
320/*----------------------------------------------------------------------------*/
321
323
324#endif /* __CS_SLES_MUMPS_H__ */
#define BEGIN_C_DECLS
Definition cs_defs.h:528
double cs_real_t
Floating-point value.
Definition cs_defs.h:332
#define END_C_DECLS
Definition cs_defs.h:529
cs_log_t
Definition cs_log.h:48
struct _cs_matrix_t cs_matrix_t
Definition cs_matrix.h:110
Structure and routines handling the SLES ((Sparse Linear Equation Solver) settings stored inside a cs...
cs_sles_convergence_state_t
Definition cs_sles.h:56
cs_sles_pc_t * cs_sles_mumps_pc_create(const cs_param_sles_t *slesp)
Create a preconditioner structure relying on MUMPS solver.
Definition cs_sles_mumps.c:2623
void cs_sles_mumps_free(void *context)
Free MUMPS linear equation solver setup context.
Definition cs_sles_mumps.c:2738
void cs_sles_mumps_setup_hook_t(const cs_param_sles_t *slesp, void *context, void *mumps)
Function pointer for user settings of a MUMPS solver. This function is called at the end of the setup...
Definition cs_sles_mumps.h:82
void cs_sles_mumps_library_info(cs_log_t log_type)
Print information on MUMPS library.
Definition cs_sles_mumps.c:3568
void cs_sles_mumps_setup(void *context, const char *name, const cs_matrix_t *a, int verbosity)
Setup MUMPS linear equation solver.
Definition cs_sles_mumps.c:2848
void cs_sles_mumps_destroy(void **context)
Destroy MUMPS linear system solver info and context.
Definition cs_sles_mumps.c:2819
void cs_user_sles_mumps_hook(const cs_param_sles_t *slesp, void *context, void *pmumps)
Function pointer for advanced user settings of a MUMPS solver. This function is called two times duri...
Definition cs_sles_mumps.c:2548
struct _cs_sles_mumps_t cs_sles_mumps_t
Definition cs_sles_mumps.h:88
void * cs_sles_mumps_copy(const void *context)
Create MUMPS linear system solver info and context based on existing info and context.
Definition cs_sles_mumps.c:2710
cs_sles_convergence_state_t cs_sles_mumps_solve(void *context, const char *name, const cs_matrix_t *a, int verbosity, double precision, double r_norm, int *n_iter, double *residual, const cs_real_t *rhs, cs_real_t *vx_ini, cs_real_t *vx, size_t aux_size, void *aux_vectors)
Call MUMPS linear equation solver.
Definition cs_sles_mumps.c:3247
void cs_sles_mumps_log(const void *context, cs_log_t log_type)
Log sparse linear equation solver info.
Definition cs_sles_mumps.c:3482
cs_sles_mumps_t * cs_sles_mumps_create(const cs_param_sles_t *slesp, cs_sles_mumps_setup_hook_t *setup_hook, void *context)
Create MUMPS linear system solver info and context.
Definition cs_sles_mumps.c:2662
cs_sles_mumps_t * cs_sles_mumps_define(int f_id, const char *name, const cs_param_sles_t *slesp, cs_sles_mumps_setup_hook_t *setup_hook, void *context)
Define and associate a MUMPS linear system solver for a given field or equation name.
Definition cs_sles_mumps.c:2590
struct _cs_sles_pc_t cs_sles_pc_t
Definition cs_sles_pc.h:66
Structure storing all metadata related to the resolution of a linear system with an iterative solver.
Definition cs_param_sles.h:64