7.0
general documentation
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-2021 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  * MUMPS headers
32  *----------------------------------------------------------------------------*/
33 
34 #include <dmumps_c.h>
35 
36 /*----------------------------------------------------------------------------
37  * Local headers
38  *----------------------------------------------------------------------------*/
39 
40 #include "cs_base.h"
41 #include "cs_halo_perio.h"
42 #include "cs_matrix.h"
43 #include "cs_time_plot.h"
44 #include "cs_sles.h"
45 
46 /*----------------------------------------------------------------------------*/
47 
49 
58 /*============================================================================
59  * Macro definitions
60  *============================================================================*/
61 
62 #define CS_SLES_MUMPS_JOB_INIT -1
63 
64 /*============================================================================
65  * Type definitions
66  *============================================================================*/
67 
68 /*----------------------------------------------------------------------------*/
80 /*----------------------------------------------------------------------------*/
81 
82 typedef void
83 (cs_sles_mumps_setup_hook_t) (void *context,
84  DMUMPS_STRUC_C *dmumps);
85 
86 /* Iterative linear solver context (opaque) */
87 
88 typedef struct _cs_sles_mumps_t cs_sles_mumps_t;
89 
90 /*============================================================================
91  * Global variables
92  *============================================================================*/
93 
94 /*=============================================================================
95  * User function prototypes
96  *============================================================================*/
97 
98 /*----------------------------------------------------------------------------*/
110 /*----------------------------------------------------------------------------*/
111 
112 void
113 cs_user_sles_mumps_hook(void *context,
114  DMUMPS_STRUC_C *mumps);
115 
116 /*=============================================================================
117  * Public function prototypes
118  *============================================================================*/
119 
120 /*----------------------------------------------------------------------------*/
147 /*----------------------------------------------------------------------------*/
148 
150 cs_sles_mumps_define(int f_id,
151  const char *name,
152  int sym,
153  int verbosity,
154  cs_sles_mumps_setup_hook_t *setup_hook,
155  void *context);
156 
157 /*----------------------------------------------------------------------------*/
169 /*----------------------------------------------------------------------------*/
170 
172 cs_sles_mumps_create(int sym,
173  int verbosity,
174  cs_sles_mumps_setup_hook_t *setup_hook,
175  void *context);
176 
177 /*----------------------------------------------------------------------------*/
188 /*----------------------------------------------------------------------------*/
189 
190 void *
191 cs_sles_mumps_copy(const void *context);
192 
193 /*----------------------------------------------------------------------------*/
204 /*----------------------------------------------------------------------------*/
205 
206 void
207 cs_sles_mumps_free(void *context);
208 
209 /*----------------------------------------------------------------------------*/
216 /*----------------------------------------------------------------------------*/
217 
218 void
219 cs_sles_mumps_destroy(void **context);
220 
221 /*----------------------------------------------------------------------------*/
231 /*----------------------------------------------------------------------------*/
232 
233 void
234 cs_sles_mumps_setup(void *context,
235  const char *name,
236  const cs_matrix_t *a,
237  int verbosity);
238 
239 /*----------------------------------------------------------------------------*/
261 /*----------------------------------------------------------------------------*/
262 
264 cs_sles_mumps_solve(void *context,
265  const char *name,
266  const cs_matrix_t *a,
267  int verbosity,
268  cs_halo_rotation_t rotation_mode,
269  double precision,
270  double r_norm,
271  int *n_iter,
272  double *residue,
273  const cs_real_t *rhs,
274  cs_real_t *vx,
275  size_t aux_size,
276  void *aux_vectors);
277 
278 /*----------------------------------------------------------------------------*/
286 /*----------------------------------------------------------------------------*/
287 
288 void
289 cs_sles_mumps_log(const void *context,
290  cs_log_t log_type);
291 
292 /*----------------------------------------------------------------------------*/
293 
295 
296 #endif /* __CS_SLES_MUMPS_H__ */
cs_sles_mumps_t * cs_sles_mumps_create(int sym, int verbosity, cs_sles_mumps_setup_hook_t *setup_hook, void *context)
Create MUMPS linear system solver info and context.
Definition: cs_sles_mumps.c:285
void cs_user_sles_mumps_hook(void *context, DMUMPS_STRUC_C *mumps)
Function pointer for user settings of a MUMPS solver. This function is called at the end of the setup...
Definition: cs_sles_mumps.c:203
cs_halo_rotation_t
Definition: cs_halo.h:60
struct _cs_sles_mumps_t cs_sles_mumps_t
Definition: cs_sles_mumps.h:88
void cs_sles_mumps_log(const void *context, cs_log_t log_type)
Log sparse linear equation solver info.
Definition: cs_sles_mumps.c:793
#define BEGIN_C_DECLS
Definition: cs_defs.h:495
cs_sles_mumps_t * cs_sles_mumps_define(int f_id, const char *name, int sym, int verbosity, 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:244
void cs_sles_mumps_destroy(void **context)
Destroy MUMPS linear system solver info and context.
Definition: cs_sles_mumps.c:400
void() cs_sles_mumps_setup_hook_t(void *context, DMUMPS_STRUC_C *dmumps)
Function pointer for user settings of a MUMPS solver. This function is called at the end of the setup...
Definition: cs_sles_mumps.h:83
double cs_real_t
Floating-point value.
Definition: cs_defs.h:307
struct _cs_matrix_t cs_matrix_t
Definition: cs_matrix.h:94
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:428
cs_sles_convergence_state_t
Convergence status indicator.
Definition: cs_sles.h:56
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:329
double precision, save a
Definition: cs_fuel_incl.f90:146
void cs_sles_mumps_free(void *context)
Free MUMPS linear equation solver setup context.
Definition: cs_sles_mumps.c:358
cs_log_t
Definition: cs_log.h:48
#define END_C_DECLS
Definition: cs_defs.h:496
cs_sles_convergence_state_t cs_sles_mumps_solve(void *context, const char *name, const cs_matrix_t *a, int verbosity, cs_halo_rotation_t rotation_mode, double precision, double r_norm, int *n_iter, double *residue, const cs_real_t *rhs, cs_real_t *vx, size_t aux_size, void *aux_vectors)
Call MUMPS linear equation solver.
Definition: cs_sles_mumps.c:680