8.3
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-2024 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_cdo_assembly.h"
33#include "cs_equation_bc.h"
34#include "cs_equation_builder.h"
35#include "cs_equation_param.h"
36#include "cs_hodge.h"
37#include "cs_saddle_solver.h"
38
39/*----------------------------------------------------------------------------*/
40
42
43/*============================================================================
44 * Macro definitions
45 *============================================================================*/
46
47/*============================================================================
48 * Type definitions
49 *============================================================================*/
50
51typedef struct _cs_cdocb_t cs_cdocb_scaleq_t;
52
53/*----------------------------------------------------------------------------*/
63/*----------------------------------------------------------------------------*/
64
65typedef void
67 const cs_cell_mesh_t *cm,
68 cs_cdocb_scaleq_t *eqc,
69 cs_cdo_assembly_t *asb);
70
71/*----------------------------------------------------------------------------*/
83/*----------------------------------------------------------------------------*/
84
85typedef int
88 cs_real_t *pot);
89
90/* Main structure */
91/* ============== */
92
93/* Context structure for CDO cell-based discretizations */
94/* ---------------------------------------------------- */
95
97
98 /* Ids related to the variable field and to the boundary flux field */
99
102
103 /* System size (n_faces + n_cells) */
104
108
109 /* Solution of the algebraic system DoF unknowns (x) + BCs */
110
111 cs_real_t *flux; /* At the last iteration */
112 cs_real_t *flux_pre; /* At the previous iteration */
113
114 /* Reconstructred variable face values */
115
118
119 /* Members used for the cell-wise building of the linear system */
120 /* ------------------------------------------------------------ */
121
122 /* Array storing the local cell-wise divergence operator (one by thread) */
123
125
126 /* Pointer of function to build the diffusion term */
127
130
131 /* Boundary conditions */
132 /* ------------------- */
133
137
138 /* Linear system */
139 /* ------------- */
140
141 /* \var block21_op
142 * Unassembled (2,1)-block (related to the divergence). Not always
143 * allocated. It depends on the solver for the saddle-point system.
144 */
145
147
148 /* \var system_helper
149 * Set of structure to handle the saddle-point matrix and its rhs
150 */
151
153
161 /* \var assemble
162 * Function pointer to manage the assembly process for the Navier-Stokes
163 * system of equation
164 */
165
167
179
180 /* \var saddle_solver
181 * Set of pointers to enable the resolution of saddle-point system
182 * with various algorithms. This structure allows us to unify the prototype
183 * of "solve" functions
184 */
185
187
188};
189
190/*============================================================================
191 * Public function prototypes
192 *============================================================================*/
193
194/*----------------------------------------------------------------------------*/
200/*----------------------------------------------------------------------------*/
201
202void
204
205/*----------------------------------------------------------------------------*/
206
208
209#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:85
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:86
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:66
#define BEGIN_C_DECLS
Definition: cs_defs.h:542
double cs_real_t
Floating-point value.
Definition: cs_defs.h:342
#define END_C_DECLS
Definition: cs_defs.h:543
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:335
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:90
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:218
Definition: cs_cdocb_priv.h:96
cs_saddle_solver_t * saddle_solver
Definition: cs_cdocb_priv.h:186
cs_cdo_system_helper_t * system_helper
Definition: cs_cdocb_priv.h:152
cs_lnum_t n_dofs
Definition: cs_cdocb_priv.h:107
cs_cdocb_scaleq_solve_t * solve
Definition: cs_cdocb_priv.h:178
cs_cdo_enforce_bc_t * enforce_neumann
Definition: cs_cdocb_priv.h:135
cs_cdocb_scaleq_assemble_t * assemble
Definition: cs_cdocb_priv.h:166
cs_cdo_enforce_bc_t * enforce_dirichlet
Definition: cs_cdocb_priv.h:134
cs_lnum_t n_faces
Definition: cs_cdocb_priv.h:105
cs_lnum_t n_cells
Definition: cs_cdocb_priv.h:106
cs_real_t ** div_op_cw
Definition: cs_cdocb_priv.h:124
cs_real_t * flux_pre
Definition: cs_cdocb_priv.h:112
cs_real_t * face_values_pre
Definition: cs_cdocb_priv.h:117
cs_hodge_compute_t * compute_diff_hodge
Definition: cs_cdocb_priv.h:129
cs_hodge_t ** diff_hodge
Definition: cs_cdocb_priv.h:128
int bflux_field_id
Definition: cs_cdocb_priv.h:101
cs_cdo_enforce_bc_t * enforce_robin_bc
Definition: cs_cdocb_priv.h:136
cs_real_t * flux
Definition: cs_cdocb_priv.h:111
cs_real_t * face_values
Definition: cs_cdocb_priv.h:116
int var_field_id
Definition: cs_cdocb_priv.h:100
cs_real_t * block21_op
Definition: cs_cdocb_priv.h:146
Definition: cs_cdo_system.h:377
Set of local quantities and connectivities related to a mesh cell.
Definition: cs_cdo_local.h:203
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:147
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources.
Definition: cs_equation_param.h:192
Structure associated to a discrete Hodge operator *.
Definition: cs_hodge.h:183
Definition: cs_saddle_solver.h:88