8.1
general documentation
cs_cdo_solve.h
Go to the documentation of this file.
1 #ifndef __CS_CDO_SOLVE_H__
2 #define __CS_CDO_SOLVE_H__
3 
4 /*============================================================================
5  * Set of helper functions to prepare or solve linear systems
6  *============================================================================*/
7 
8 /*
9  This file is part of code_saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2023 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  * Local headers
30  *----------------------------------------------------------------------------*/
31 
32 #include "cs_matrix.h"
33 #include "cs_param_sles.h"
34 #include "cs_range_set.h"
35 #include "cs_sles.h"
36 
37 /*----------------------------------------------------------------------------*/
38 
40 
41 /*============================================================================
42  * Macro definitions
43  *============================================================================*/
44 
45 /*============================================================================
46  * Type definitions
47  *============================================================================*/
48 
49 /*============================================================================
50  * Public function prototypes
51  *============================================================================*/
52 
53 /*----------------------------------------------------------------------------*/
67 /*----------------------------------------------------------------------------*/
68 
69 void
71  double vol_tot,
72  cs_lnum_t rhs_size,
73  const cs_real_t rhs[],
74  double *normalization);
75 
76 /*----------------------------------------------------------------------------*/
91 /*----------------------------------------------------------------------------*/
92 
93 void
95  bool interlace,
96  cs_lnum_t x_size,
97  const cs_range_set_t *rset,
98  bool rhs_redux,
99  cs_real_t *x,
100  cs_real_t *b);
101 
102 /*----------------------------------------------------------------------------*/
117 /*----------------------------------------------------------------------------*/
118 
119 int
121  const cs_param_sles_t *slesp,
122  const cs_matrix_t *matrix,
123  cs_real_t normalization,
124  cs_sles_t *sles,
125  cs_real_t *x,
126  cs_real_t *b);
127 
128 /*----------------------------------------------------------------------------*/
145 /*----------------------------------------------------------------------------*/
146 
147 int
149  const cs_param_sles_t *slesp,
150  const cs_matrix_t *matrix,
151  const cs_range_set_t *rset,
152  cs_real_t normalization,
153  bool rhs_redux,
154  cs_sles_t *sles,
155  cs_real_t *x,
156  cs_real_t *b);
157 
158 /*----------------------------------------------------------------------------*/
177 /*----------------------------------------------------------------------------*/
178 
179 int
181  bool interlace,
182  const cs_param_sles_t *slesp,
183  const cs_matrix_t *matrix,
184  const cs_range_set_t *rset,
185  cs_real_t normalization,
186  bool rhs_redux,
187  cs_sles_t *sles,
188  cs_real_t *x,
189  cs_real_t *b);
190 
191 /*----------------------------------------------------------------------------*/
192 
194 
195 #endif /* __CS_CDO_SOLVE_H__ */
int cs_cdo_solve_vector_system(cs_lnum_t n_scatter_elts, bool interlace, const cs_param_sles_t *slesp, const cs_matrix_t *matrix, const cs_range_set_t *rset, cs_real_t normalization, bool rhs_redux, cs_sles_t *sles, cs_real_t *x, cs_real_t *b)
Solve a linear system arising from CDO schemes with vector-valued degrees of freedom (DoFs)....
Definition: cs_cdo_solve.c:503
int cs_cdo_solve_scalar_cell_system(cs_lnum_t n_dofs, const cs_param_sles_t *slesp, const cs_matrix_t *matrix, cs_real_t normalization, cs_sles_t *sles, cs_real_t *x, cs_real_t *b)
Solve a linear system arising with scalar-valued cell-based DoFs No rotation is taken into account wh...
Definition: cs_cdo_solve.c:307
int cs_cdo_solve_scalar_system(cs_lnum_t n_scatter_dofs, const cs_param_sles_t *slesp, const cs_matrix_t *matrix, const cs_range_set_t *rset, cs_real_t normalization, bool rhs_redux, cs_sles_t *sles, cs_real_t *x, cs_real_t *b)
Solve a linear system arising from CDO schemes with scalar-valued degrees of freedom.
Definition: cs_cdo_solve.c:403
void cs_cdo_solve_prepare_system(int stride, bool interlace, cs_lnum_t x_size, const cs_range_set_t *rset, bool rhs_redux, cs_real_t *x, cs_real_t *b)
Prepare a linear system and synchronize buffers in case of parallel or periodic computations....
Definition: cs_cdo_solve.c:229
void cs_cdo_solve_sync_rhs_norm(cs_param_resnorm_type_t type, double vol_tot, cs_lnum_t rhs_size, const cs_real_t rhs[], double *normalization)
Compute the value of the rhs norm used as a renormalization coefficient for the residual norm when so...
Definition: cs_cdo_solve.c:171
#define BEGIN_C_DECLS
Definition: cs_defs.h:514
double cs_real_t
Floating-point value.
Definition: cs_defs.h:319
#define END_C_DECLS
Definition: cs_defs.h:515
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:313
struct _cs_matrix_t cs_matrix_t
Definition: cs_matrix.h:110
void matrix(const int *iconvp, const int *idiffp, const int *ndircp, const int *isym, const cs_real_t *thetap, const int *imucpp, const cs_real_t coefbp[], const cs_real_t cofbfp[], const cs_real_t rovsdt[], const cs_real_t i_massflux[], const cs_real_t b_massflux[], const cs_real_t i_visc[], const cs_real_t b_visc[], const cs_real_t xcpp[], cs_real_t da[], cs_real_t xa[])
Structure and routines handling the SLES settings stored inside a cs_param_sles_t structure.
cs_param_resnorm_type_t
Definition: cs_param_types.h:1021
struct _cs_sles_t cs_sles_t
Definition: cs_sles.h:68
Structure storing all metadata related to the resolution of a linear system with an iterative solver.
Definition: cs_param_sles.h:213
Definition: cs_range_set.h:57