8.2
general documentation
Loading...
Searching...
No Matches
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 /* Members used for the cell-wise building of the linear system */
115 /* ------------------------------------------------------------ */
116
117 /* Array storing the local cell-wise divergence operator (one by thread) */
118
120
121 /* Pointer of function to build the diffusion term */
122
125
126 /* Boundary conditions */
127 /* ------------------- */
128
132
133 /* Linear system */
134 /* ------------- */
135
136 /* \var block21_op
137 * Unassembled (2,1)-block (related to the divergence). Not always
138 * allocated. It depends on the solver for the saddle-point system.
139 */
140
142
143 /* \var system_helper
144 * Set of structure to handle the saddle-point matrix and its rhs
145 */
146
148
155
156 /* \var assemble
157 * Function pointer to manage the assembly process for the Navier-Stokes
158 * system of equation
159 */
160
162
172
174
175 /* \var saddle_solver
176 * Set of pointers to enable the resolution of saddle-point system
177 * with various algorithms. This structure allows us to unify the prototype
178 * of "solve" functions
179 */
180
182
183};
184
185/*============================================================================
186 * Public function prototypes
187 *============================================================================*/
188
189/*----------------------------------------------------------------------------*/
195/*----------------------------------------------------------------------------*/
196
197void
199
200/*----------------------------------------------------------------------------*/
201
203
204#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.c:85
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
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
#define BEGIN_C_DECLS
Definition cs_defs.h:528
double cs_real_t
Floating-point value.
Definition cs_defs.h:332
#define END_C_DECLS
Definition cs_defs.h:529
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:89
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:181
cs_cdo_system_helper_t * system_helper
Definition cs_cdocb_priv.h:147
cs_lnum_t n_dofs
Definition cs_cdocb_priv.h:107
cs_cdocb_scaleq_solve_t * solve
Definition cs_cdocb_priv.h:173
cs_cdo_enforce_bc_t * enforce_neumann
Definition cs_cdocb_priv.h:130
cs_cdocb_scaleq_assemble_t * assemble
Definition cs_cdocb_priv.h:161
cs_cdo_enforce_bc_t * enforce_dirichlet
Definition cs_cdocb_priv.h:129
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:119
cs_real_t * flux_pre
Definition cs_cdocb_priv.h:112
cs_hodge_compute_t * compute_diff_hodge
Definition cs_cdocb_priv.h:124
cs_hodge_t ** diff_hodge
Definition cs_cdocb_priv.h:123
int bflux_field_id
Definition cs_cdocb_priv.h:101
cs_cdo_enforce_bc_t * enforce_robin_bc
Definition cs_cdocb_priv.h:131
cs_real_t * flux
Definition cs_cdocb_priv.h:111
int var_field_id
Definition cs_cdocb_priv.h:100
cs_real_t * block21_op
Definition cs_cdocb_priv.h:141
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:193
Structure associated to a discrete Hodge operator *.
Definition cs_hodge.h:183
Definition cs_saddle_solver.h:88