8.0
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 * Definition of cs_cdocb_scaleq_t and cs_cdocb_vecteq structures
6 *============================================================================*/
7
8/*
9 This file is part of code_saturne, a general-purpose CFD tool.
10
11 Copyright (C) 1998-2022 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_equation_bc.h"
33#include "cs_equation_builder.h"
34#include "cs_hodge.h"
35
36/*----------------------------------------------------------------------------*/
37
39
40/*============================================================================
41 * Macro definitions
42 *============================================================================*/
43
44/*============================================================================
45 * Type definitions
46 *============================================================================*/
47
48/* Context related to the resolution of a saddle point problem */
49
50typedef struct {
51
52 cs_real_t *div_op; /* Block related to the -divergence (block
53 A_{10}) */
54
55 /* Arrays split according to the block shape. U is interlaced or not
56 * according to the SLES strategy */
57
58 cs_lnum_t n_faces; /* local number of DoFs for each component
59 * of the velocity */
60 cs_lnum_t n_cells; /* local number of DoFs for the pressure */
61
62 cs_real_t *flux; /* flux values at faces */
63 cs_real_t *potential; /* pressure values at cells */
64
65 cs_sles_t *sles; /* main SLES structure */
66 cs_sles_t *schur_sles; /* auxiliary SLES for the Schur complement
67 * May be NULL */
68
69 cs_real_t graddiv_coef; /* value of the grad-div coefficient in case
70 * of augmented system */
71
73
74/* Algebraic system for CDO cell-based discretization */
75
77
78 /* Ids related to the variable field and to the boundary flux field */
79
82
83 /* System size (n_faces + n_cells) */
84
88
89 /* Solution of the algebraic system DoF unknowns (x) + BCs */
90
91 cs_real_t *flux; /* At the last iteration */
92 cs_real_t *flux_pre; /* At the previous iteration */
93
94 /* Array storing the value arising from the contribution of all source
95 terms (only allocated to n_cells) */
96
98
99 /* Members used for the cell-wise building of the linear system */
100 /* ------------------------------------------------------------ */
101
102 /* Array storing the local cell-wise divergence operator (one by thread) */
103
105
106 /* Pointer of function to build the diffusion term */
107
110
111 /* Boundary conditions */
112 /* ------------------- */
113
117
118 /* Linear system */
119 /* ------------- */
120
123
125
126};
127
128typedef struct _cs_cdocb_t cs_cdocb_priv_t;
129
130/*============================================================================
131 * Public function prototypes
132 *============================================================================*/
133
134/*----------------------------------------------------------------------------*/
135
137
138#endif /* __CS_CDOCB_PRIV_H__ */
#define BEGIN_C_DECLS
Definition cs_defs.h:509
double cs_real_t
Floating-point value.
Definition cs_defs.h:319
#define END_C_DECLS
Definition cs_defs.h:510
int cs_lnum_t
local mesh entity id
Definition cs_defs.h:313
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
struct _cs_sles_t cs_sles_t
Definition cs_sles.h:68
Definition cs_cdocb_priv.h:76
cs_real_t graddiv_coef
Definition cs_cdocb_priv.h:124
cs_lnum_t n_dofs
Definition cs_cdocb_priv.h:87
cs_cdo_enforce_bc_t * enforce_neumann
Definition cs_cdocb_priv.h:115
cs_cdo_enforce_bc_t * enforce_dirichlet
Definition cs_cdocb_priv.h:114
cs_lnum_t n_faces
Definition cs_cdocb_priv.h:85
cs_cdocb_monolithic_sles_t * msles
Definition cs_cdocb_priv.h:121
cs_lnum_t n_cells
Definition cs_cdocb_priv.h:86
cs_real_t ** div_op_cw
Definition cs_cdocb_priv.h:104
cs_sles_t * schur_sles
Definition cs_cdocb_priv.h:122
cs_real_t * flux_pre
Definition cs_cdocb_priv.h:92
cs_hodge_compute_t * compute_diff_hodge
Definition cs_cdocb_priv.h:109
cs_hodge_t ** diff_hodge
Definition cs_cdocb_priv.h:108
cs_real_t * source_terms
Definition cs_cdocb_priv.h:97
int bflux_field_id
Definition cs_cdocb_priv.h:81
cs_cdo_enforce_bc_t * enforce_robin_bc
Definition cs_cdocb_priv.h:116
cs_real_t * flux
Definition cs_cdocb_priv.h:91
int var_field_id
Definition cs_cdocb_priv.h:80
Definition cs_cdocb_priv.h:50
cs_real_t graddiv_coef
Definition cs_cdocb_priv.h:69
cs_lnum_t n_faces
Definition cs_cdocb_priv.h:58
cs_lnum_t n_cells
Definition cs_cdocb_priv.h:60
cs_sles_t * schur_sles
Definition cs_cdocb_priv.h:66
cs_real_t * div_op
Definition cs_cdocb_priv.h:52
cs_sles_t * sles
Definition cs_cdocb_priv.h:65
cs_real_t * potential
Definition cs_cdocb_priv.h:63
cs_real_t * flux
Definition cs_cdocb_priv.h:62
Structure associated to a discrete Hodge operator *.
Definition cs_hodge.h:183