9.2
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-2026 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 "alge/cs_matrix.h"
33#include "alge/cs_param_sles.h"
34#include "alge/cs_sles.h"
35#include "base/cs_range_set.h"
36
37/*============================================================================
38 * Macro definitions
39 *============================================================================*/
40
41/*============================================================================
42 * Type definitions
43 *============================================================================*/
44
45/*============================================================================
46 * Public function prototypes
47 *============================================================================*/
48
49/*----------------------------------------------------------------------------*/
63/*----------------------------------------------------------------------------*/
64
65void
67 double vol_tot,
68 cs_lnum_t rhs_size,
69 const cs_real_t rhs[],
70 double *normalization);
71
72/*----------------------------------------------------------------------------*/
87/*----------------------------------------------------------------------------*/
88
89void
91 bool interlace,
92 cs_lnum_t x_size,
93 const cs_range_set_t *rset,
94 bool rhs_redux,
95 cs_real_t *x,
96 cs_real_t *b);
97
98/*----------------------------------------------------------------------------*/
113/*----------------------------------------------------------------------------*/
114
115int
117 const cs_param_sles_t *slesp,
118 const cs_matrix_t *matrix,
119 cs_real_t normalization,
120 cs_sles_t *sles,
121 cs_real_t *x,
122 cs_real_t *b);
123
124/*----------------------------------------------------------------------------*/
141/*----------------------------------------------------------------------------*/
142
143int
145 const cs_param_sles_t *slesp,
146 const cs_matrix_t *matrix,
147 const cs_range_set_t *rset,
148 cs_real_t normalization,
149 bool rhs_redux,
150 cs_sles_t *sles,
151 cs_real_t *x,
152 cs_real_t *b);
153
154/*----------------------------------------------------------------------------*/
173/*----------------------------------------------------------------------------*/
174
175int
177 bool interlace,
178 const cs_param_sles_t *slesp,
179 const cs_matrix_t *matrix,
180 const cs_range_set_t *rset,
181 cs_real_t normalization,
182 bool rhs_redux,
183 cs_sles_t *sles,
184 cs_real_t *x,
185 cs_real_t *b);
186
187#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.cpp:514
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.cpp:300
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.cpp:396
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.cpp:222
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.cpp:164
double cs_real_t
Floating-point value.
Definition: cs_defs.h:332
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:325
struct _cs_matrix_t cs_matrix_t
Definition: cs_matrix.h:108
Structure and routines handling the SLES ((Sparse Linear Equation Solver) settings stored inside a cs...
cs_param_resnorm_type_t
Definition: cs_param_types.h:974
struct _cs_sles_t cs_sles_t
Definition: cs_sles.h:72
Structure storing all metadata related to the resolution of a linear system with an iterative solver.
Definition: cs_param_sles.h:63
Definition: cs_range_set.h:53