9.2
general documentation
cs_cdocb_priv.h
Go to the documentation of this file.
1#ifndef CS_CDOCB_PRIV_H
2#define CS_CDOCB_PRIV_H
3
4/*============================================================================
5 * Structure and functions common to all CDO cell-based schemes but not public
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
33#include "cdo/cs_cdo_assembly.h"
34#include "cdo/cs_equation_bc.h"
37#include "cdo/cs_hodge.h"
38
39/*============================================================================
40 * Macro definitions
41 *============================================================================*/
42
43/*============================================================================
44 * Type definitions
45 *============================================================================*/
46
47typedef struct _cs_cdocb_t cs_cdocb_scaleq_t;
48
49/*----------------------------------------------------------------------------*/
59/*----------------------------------------------------------------------------*/
60
61typedef void
63 const cs_cell_mesh_t *cm,
64 cs_cdocb_scaleq_t *eqc,
65 cs_cdo_assembly_t *asb);
66
67/*----------------------------------------------------------------------------*/
79/*----------------------------------------------------------------------------*/
80
81typedef int
84 cs_real_t *pot);
85
86/* Main structure */
87/* ============== */
88
89/* Context structure for CDO cell-based discretizations */
90/* ---------------------------------------------------- */
91
93
100 /* Ids related to the variable field and to the boundary flux field */
101
104
105 /* System size (n_faces + n_cells) */
106
110
111 /* Solution of the algebraic system DoF unknowns (x) + BCs */
112
113 cs_real_t *flux; /* At the last iteration */
114 cs_real_t *flux_pre; /* At the previous iteration */
115
116 /* Reconstructred variable face values */
117
120
121 /* Members used for the cell-wise building of the linear system */
122 /* ------------------------------------------------------------ */
123
124 /* Array storing the local cell-wise divergence operator (one by thread) */
125
127
128 /* Pointer of function to build the diffusion term */
129
132
133 /* Boundary conditions */
134 /* ------------------- */
135
139
140 /* Linear system */
141 /* ------------- */
142
143 /* \var block21_op
144 * Unassembled (2,1)-block (related to the divergence). Not always
145 * allocated. It depends on the solver for the saddle-point system.
146 */
147
149
150 /* \var system_helper
151 * Set of structure to handle the saddle-point matrix and its rhs
152 */
153
155
163 /* \var assemble
164 * Function pointer to manage the assembly process for the Navier-Stokes
165 * system of equation
166 */
167
169
181
182 /* \var saddle_solver
183 * Set of pointers to enable the resolution of saddle-point system
184 * with various algorithms. This structure allows us to unify the prototype
185 * of "solve" functions
186 */
187
189
190};
191
192/*============================================================================
193 * Public function prototypes
194 *============================================================================*/
195
196/*----------------------------------------------------------------------------*/
202/*----------------------------------------------------------------------------*/
203
204void
206
207#endif /* CS_CDOCB_PRIV_H */
void cs_cdocb_init_default_param(cs_equation_param_t *eqp)
Define the default settings for a scalar-valued CDO cell-based scheme.
Definition: cs_cdocb_priv.cpp:83
int() cs_cdocb_scaleq_solve_t(cs_saddle_solver_t *saddle, cs_real_t *flux, cs_real_t *pot)
Generic function prototype to solve the saddle-point linear system arising from the discretization of...
Definition: cs_cdocb_priv.h:82
void() cs_cdocb_scaleq_assemble_t(const cs_cell_sys_t *csys, const cs_cell_mesh_t *cm, cs_cdocb_scaleq_t *eqc, cs_cdo_assembly_t *asb)
Perform the assembly stage for a vector-valued system obtained with CDO-Fb schemes.
Definition: cs_cdocb_priv.h:62
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
void() cs_cdo_enforce_bc_t(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_hodge_t *hodge, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
Enforcement of a boundary condition (Dirichlet, Robin, sliding...)
Definition: cs_equation_bc.h:86
bool() cs_hodge_compute_t(const cs_cell_mesh_t *cm, cs_hodge_t *hodge, cs_cell_builder_t *cb)
Build a discrete Hodge operator or a related operator (such as the stiffmess matrix) for a given cell...
Definition: cs_hodge.h:214
Definition: cs_cdocb_priv.h:92
cs_saddle_solver_t * saddle_solver
Definition: cs_cdocb_priv.h:188
cs_cdo_system_helper_t * system_helper
Definition: cs_cdocb_priv.h:154
cs_lnum_t n_dofs
Definition: cs_cdocb_priv.h:109
cs_cdocb_scaleq_solve_t * solve
Definition: cs_cdocb_priv.h:180
cs_cdo_enforce_bc_t * enforce_neumann
Definition: cs_cdocb_priv.h:137
cs_cdocb_scaleq_assemble_t * assemble
Definition: cs_cdocb_priv.h:168
cs_cdo_enforce_bc_t * enforce_dirichlet
Definition: cs_cdocb_priv.h:136
cs_lnum_t n_faces
Definition: cs_cdocb_priv.h:107
cs_lnum_t n_cells
Definition: cs_cdocb_priv.h:108
cs_real_t ** div_op_cw
Definition: cs_cdocb_priv.h:126
cs_real_t * flux_pre
Definition: cs_cdocb_priv.h:114
cs_real_t * face_values_pre
Definition: cs_cdocb_priv.h:119
cs_hodge_compute_t * compute_diff_hodge
Definition: cs_cdocb_priv.h:131
cs_hodge_t ** diff_hodge
Definition: cs_cdocb_priv.h:130
int bflux_field_id
Definition: cs_cdocb_priv.h:103
cs_cdo_enforce_bc_t * enforce_robin_bc
Definition: cs_cdocb_priv.h:138
cs_real_t * flux
Definition: cs_cdocb_priv.h:113
cs_real_t * face_values
Definition: cs_cdocb_priv.h:118
int var_field_id
Definition: cs_cdocb_priv.h:102
cs_real_t * block21_op
Definition: cs_cdocb_priv.h:148
Definition: cs_cdo_system.h:373
Set of local quantities and connectivities related to a mesh cell.
Definition: cs_cdo_local.h:242
Set of arrays and local (small) dense matrices related to a mesh cell This is a key structure for bui...
Definition: cs_cdo_local.h:163
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources.
Definition: cs_equation_param.h:190
Structure associated to a discrete Hodge operator *.
Definition: cs_hodge.h:179
Definition: cs_saddle_solver.h:85