7.2
general documentation
cs_param_sles.h
Go to the documentation of this file.
1 #ifndef __CS_PARAM_SLES_H__
2 #define __CS_PARAM_SLES_H__
3 
4 /*============================================================================
5  * Routines to handle the SLES settings
6  *============================================================================*/
7 
8 /*
9  This file is part of code_saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2022 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_param_types.h"
35 
36 /*----------------------------------------------------------------------------*/
37 
39 
48 /*============================================================================
49  * Macro definitions
50  *============================================================================*/
51 
52 /*============================================================================
53  * Type definitions
54  *============================================================================*/
55 
62 typedef struct {
63 
64  bool setup_done;
65  int verbosity;
66  int field_id;
68  char *name;
74  bool flexible;
80 
86 
92  int n_max_iter;
93  int restart;
94  double eps;
97 
98 /*============================================================================
99  * Global variables
100  *============================================================================*/
101 
102 /*============================================================================
103  * Public function prototypes
104  *============================================================================*/
105 
106 /*----------------------------------------------------------------------------*/
116 /*----------------------------------------------------------------------------*/
117 
119 cs_param_sles_create(int field_id,
120  const char *system_name);
121 
122 /*----------------------------------------------------------------------------*/
128 /*----------------------------------------------------------------------------*/
129 
130 void
132 
133 /*----------------------------------------------------------------------------*/
140 /*----------------------------------------------------------------------------*/
141 
142 void
144 
145 /*----------------------------------------------------------------------------*/
152 /*----------------------------------------------------------------------------*/
153 
154 void
156  cs_param_sles_t *dst);
157 
158 /*----------------------------------------------------------------------------*/
168 /*----------------------------------------------------------------------------*/
169 
170 int
171 cs_param_sles_set(bool use_field_id,
172  cs_param_sles_t *slesp);
173 
174 /*----------------------------------------------------------------------------*/
186 /*----------------------------------------------------------------------------*/
187 
188 void
189 cs_param_sles_update_cvg_settings(bool use_field_id,
190  const cs_param_sles_t *slesp);
191 
192 /*----------------------------------------------------------------------------*/
200 /*----------------------------------------------------------------------------*/
201 
204 
205 /*----------------------------------------------------------------------------*/
215 /*----------------------------------------------------------------------------*/
216 
219 
220 /*----------------------------------------------------------------------------*/
227 /*----------------------------------------------------------------------------*/
228 
229 void
231 
232 #if defined(HAVE_PETSC)
233 /*----------------------------------------------------------------------------*/
242 /*----------------------------------------------------------------------------*/
243 
244 void
245 cs_param_sles_petsc_cmd(bool use_prefix,
246  const char *prefix,
247  const char *keyword,
248  const char *keyval);
249 #endif
250 
251 /*----------------------------------------------------------------------------*/
252 
254 
255 #endif /* __CS_PARAM_SLES_H__ */
bool setup_done
Definition: cs_param_sles.h:64
cs_param_sles_t * cs_param_sles_create(int field_id, const char *system_name)
Create a cs_param_sles_t structure and assign a default settings.
Definition: cs_param_sles.c:2184
double eps
Definition: cs_param_sles.h:94
cs_param_precond_type_t precond
Definition: cs_param_sles.h:72
cs_param_precond_block_t pcd_block_type
Definition: cs_param_sles.h:85
void cs_param_sles_copy_from(cs_param_sles_t *src, cs_param_sles_t *dst)
Copy a cs_param_sles_t structure from src to dst.
Definition: cs_param_sles.c:2333
cs_param_resnorm_type_t
Definition: cs_param_types.h:937
cs_param_sles_class_t solver_class
Definition: cs_param_sles.h:71
#define BEGIN_C_DECLS
Definition: cs_defs.h:510
void cs_param_sles_log(cs_param_sles_t *slesp)
Log information related to the linear settings stored in the structure.
Definition: cs_param_sles.c:2255
cs_param_amg_type_t
Definition: cs_param_types.h:598
cs_param_precond_type_t
Definition: cs_param_types.h:799
cs_param_precond_block_t
Definition: cs_param_types.h:724
cs_param_sles_class_t
Class of iterative solvers to consider for solver the linear system.
Definition: cs_param_types.h:580
int n_max_iter
Definition: cs_param_sles.h:92
int restart
Definition: cs_param_sles.h:93
cs_param_sles_class_t cs_param_sles_get_class_from_amg(cs_param_amg_type_t amg_type)
Retrieve the related solver class from the amg type.
Definition: cs_param_sles.c:2543
cs_param_resnorm_type_t resnorm_type
Definition: cs_param_sles.h:91
cs_param_sles_class_t cs_param_sles_check_class(cs_param_sles_class_t wanted_class)
Check the availability of a solver library and return the requested one if this is possible or an alt...
Definition: cs_param_sles.c:2574
void cs_param_sles_update_cvg_settings(bool use_field_id, const cs_param_sles_t *slesp)
Update the settings associated to a cs_sles_t structure and apply those defined in the given cs_param...
Definition: cs_param_sles.c:2448
int verbosity
Definition: cs_param_sles.h:65
cs_param_itsol_type_t solver
Definition: cs_param_sles.h:73
cs_param_amg_type_t amg_type
Definition: cs_param_sles.h:79
void cs_param_sles_check_amg(cs_param_sles_t *slesp)
Check if the setting related to the AMG is consistent with the solver class.
Definition: cs_param_sles.c:2642
#define END_C_DECLS
Definition: cs_defs.h:511
char * name
Definition: cs_param_sles.h:68
int field_id
Definition: cs_param_sles.h:66
cs_param_itsol_type_t
Definition: cs_param_types.h:902
bool flexible
Definition: cs_param_sles.h:74
void cs_param_sles_free(cs_param_sles_t **p_slesp)
Free a cs_param_sles_t structure.
Definition: cs_param_sles.c:2230
int cs_param_sles_set(bool use_field_id, cs_param_sles_t *slesp)
Define cs_sles_t structure in accordance with the settings of a cs_param_sles_t structure (SLES = Spa...
Definition: cs_param_sles.c:2369
Structure storing all metadata related to the resolution of a linear system with an iterative solver...
Definition: cs_param_sles.h:62