8.3
general documentation
cs_cdofb_priv.h
Go to the documentation of this file.
1#ifndef __CS_CDOFB_PRIV_H__
2#define __CS_CDOFB_PRIV_H__
3
4/*============================================================================
5 * Definition of cs_cdofb_scaleq_t and cs_cdofb_vecteq structures
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_advection.h"
33#include "cs_equation_bc.h"
34#include "cs_equation_builder.h"
35#include "cs_hodge.h"
36
37/*----------------------------------------------------------------------------*/
38
40
41/*============================================================================
42 * Macro definitions
43 *============================================================================*/
44
45/*============================================================================
46 * Type definitions
47 *============================================================================*/
48
49/* Algebraic system for CDO face-based discretization */
50
52
53 /* Ids related to the variable field and to the boundary flux field */
54
57
58 /* System size (n_faces + n_cells) */
59
62
63 /* Solution of the algebraic system DoF unknowns (x) + BCs */
64
65 cs_real_t *face_values; /* At the last iteration */
66 cs_real_t *face_values_pre; /* At the previous iteration */
67
68 /* Members related to the static condensation */
69
70 cs_real_t *rc_tilda; /* Acc^-1 * RHS_cell */
71 cs_real_t *acf_tilda; /* Acc^-1 * Acf
72 Cell-faces lower-left block of the full matrix
73 Access to the values thanks to the c2f
74 connectivity */
75
76 /* Array storing the value arising from the contribution of all source
77 terms (only allocated to n_cells) */
78
80
81 /* Pointer of function to build the diffusion term */
82
88
89 /* Pointer of functions to define the advection term:
90 * advection_open is called first, then advection_main which calls
91 * advection_scheme and after the build step, advection_close is called last
92 */
93
98
100
101 /* If one needs to build a local hodge op. for time and reaction */
102
106
107};
108
109typedef struct _cs_cdofb_t cs_cdofb_priv_t;
110
111/*============================================================================
112 * Public function prototypes
113 *============================================================================*/
114
115/*----------------------------------------------------------------------------*/
124/*----------------------------------------------------------------------------*/
125
126void
129 cs_cdofb_priv_t *eqc);
130
131/*----------------------------------------------------------------------------*/
132
134
135#endif /* __CS_CDOFB_PRIV_H__ */
void() cs_cdofb_adv_build_t(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_cell_sys_t *csys, cs_cdofb_adv_scheme_t *scheme_func, cs_cell_builder_t *cb)
Build the cellwise advection operator for CDO-Fb schemes The local matrix related to this operator is...
Definition: cs_cdo_advection.h:116
void() cs_cdofb_adv_scheme_t(int dim, const cs_cell_mesh_t *cm, const cs_cell_sys_t *csys, cs_cell_builder_t *cb, cs_sdm_t *adv)
Define the local convection operator in CDO-Fb schemes. Case of an operator that should be assemble i...
Definition: cs_cdo_advection.h:92
void() cs_cdofb_adv_close_hook_t(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_cell_sys_t *csys, cs_cell_builder_t *cb, cs_sdm_t *adv)
Operation done after the matrix related to the advection term has been defined.
Definition: cs_cdo_advection.h:136
void() cs_cdofb_adv_open_hook_t(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_cell_sys_t *csys, void *input, cs_cell_builder_t *cb)
Perform preprocessing such as the computation of the advection flux at the expected location in order...
Definition: cs_cdo_advection.h:71
void cs_cdofb_set_advection_function(const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, cs_cdofb_priv_t *eqc)
Set the advection-related parameters in the context structure of CDO face-based schemes.
Definition: cs_cdofb_priv.cpp:90
#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_cdofb_priv.h:51
cs_real_t * rc_tilda
Definition: cs_cdofb_priv.h:70
cs_lnum_t n_dofs
Definition: cs_cdofb_priv.h:61
cs_cdo_enforce_bc_t * enforce_sliding
Definition: cs_cdofb_priv.h:87
cs_cdofb_adv_open_hook_t * advection_open
Definition: cs_cdofb_priv.h:94
cs_cdofb_adv_scheme_t * advection_scheme
Definition: cs_cdofb_priv.h:97
cs_hodge_param_t mass_hodgep
Definition: cs_cdofb_priv.h:103
cs_hodge_t ** diffusion_hodge
Definition: cs_cdofb_priv.h:83
cs_cdo_enforce_bc_t * enforce_dirichlet
Definition: cs_cdofb_priv.h:85
cs_lnum_t n_faces
Definition: cs_cdofb_priv.h:60
cs_cdofb_adv_close_hook_t * advection_close
Definition: cs_cdofb_priv.h:96
cs_real_t * acf_tilda
Definition: cs_cdofb_priv.h:71
cs_hodge_compute_t * get_stiffness_matrix
Definition: cs_cdofb_priv.h:84
cs_cdofb_adv_build_t * advection_main
Definition: cs_cdofb_priv.h:95
cs_real_t * face_values_pre
Definition: cs_cdofb_priv.h:66
cs_hodge_compute_t * get_mass_matrix
Definition: cs_cdofb_priv.h:105
void * advection_input
Definition: cs_cdofb_priv.h:99
cs_real_t * source_terms
Definition: cs_cdofb_priv.h:79
int bflux_field_id
Definition: cs_cdofb_priv.h:56
cs_cdo_enforce_bc_t * enforce_robin_bc
Definition: cs_cdofb_priv.h:86
cs_real_t * face_values
Definition: cs_cdofb_priv.h:65
int var_field_id
Definition: cs_cdofb_priv.h:55
cs_hodge_t ** mass_hodge
Definition: cs_cdofb_priv.h:104
Store common elements used when building an algebraic system related to an equation.
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources.
Definition: cs_equation_param.h:192
Structure storing all metadata/parameters related to the usage of a discrete Hodge operator.
Definition: cs_hodge.h:151
Structure associated to a discrete Hodge operator *.
Definition: cs_hodge.h:183