8.3
general documentation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
cs_cdocb_scaleq.h
Go to the documentation of this file.
1#ifndef __CS_CDOCB_SCALEQ_H__
2#define __CS_CDOCB_SCALEQ_H__
3
4/*============================================================================
5 * Build an algebraic CDO cell-based system for the diffusion equations
6 * and solved it as one block (monolithic approach of the flux-potential
7 * coupling)
8 *============================================================================*/
9
10/*
11 This file is part of code_saturne, a general-purpose CFD tool.
12
13 Copyright (C) 1998-2024 EDF S.A.
14
15 This program is free software; you can redistribute it and/or modify it under
16 the terms of the GNU General Public License as published by the Free Software
17 Foundation; either version 2 of the License, or (at your option) any later
18 version.
19
20 This program is distributed in the hope that it will be useful, but WITHOUT
21 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
22 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
23 details.
24
25 You should have received a copy of the GNU General Public License along with
26 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
27 Street, Fifth Floor, Boston, MA 02110-1301, USA.
28*/
29
30/*----------------------------------------------------------------------------*/
31
32#include "cs_defs.h"
33
34/*----------------------------------------------------------------------------
35 * Standard C library headers
36 *----------------------------------------------------------------------------*/
37
38/*----------------------------------------------------------------------------
39 * Local headers
40 *----------------------------------------------------------------------------*/
41
42#include "cs_base.h"
43#include "cs_cdo_connect.h"
44#include "cs_cdocb_priv.h"
45#include "cs_cdo_quantities.h"
46#include "cs_equation.h"
47#include "cs_mesh.h"
48#include "cs_time_step.h"
49#include "cs_domain.h"
50/*----------------------------------------------------------------------------*/
51
53
54/*============================================================================
55 * Macro definitions
56 *============================================================================*/
57
58/*============================================================================
59 * Type definitions
60 *============================================================================*/
61
62/*============================================================================
63 * Static inline public function prototypes
64 *============================================================================*/
65
66/*============================================================================
67 * Public function prototypes
68 *============================================================================*/
69
70/*----------------------------------------------------------------------------*/
77/*----------------------------------------------------------------------------*/
78
79bool
81
82/*----------------------------------------------------------------------------*/
89/*----------------------------------------------------------------------------*/
90
91void
94
95/*----------------------------------------------------------------------------*/
104/*----------------------------------------------------------------------------*/
105
106void
108 const cs_cdo_quantities_t *cdoq,
109 const cs_cdo_connect_t *connect,
110 const cs_time_step_t *time_step);
111
112/*----------------------------------------------------------------------------*/
116/*----------------------------------------------------------------------------*/
117
118void
120
121/*----------------------------------------------------------------------------*/
133/*----------------------------------------------------------------------------*/
134
135void *
137 int var_id,
138 int bflux_id,
140
141/*----------------------------------------------------------------------------*/
149/*----------------------------------------------------------------------------*/
150
151void *
152cs_cdocb_scaleq_free_context(void *scheme_context);
153
154/*----------------------------------------------------------------------------*/
166/*----------------------------------------------------------------------------*/
167
168void
170 const cs_mesh_t *mesh,
171 const cs_equation_param_t *eqp,
173
174/*----------------------------------------------------------------------------*/
187/*----------------------------------------------------------------------------*/
188
189void
191 const int field_id,
192 const cs_mesh_t *mesh,
193 const cs_equation_param_t *eqp,
195 void *context);
196
197/*----------------------------------------------------------------------------*/
210/*----------------------------------------------------------------------------*/
211
212void
214 const cs_equation_builder_t *eqb,
215 const cs_cdocb_scaleq_t *eqc,
216 const cs_cell_mesh_t *cm,
217 cs_hodge_t *diff_hodge,
218 cs_cell_sys_t *csys,
220
221
222/*----------------------------------------------------------------------------*/
235/*----------------------------------------------------------------------------*/
236
237void
239 const cs_mesh_t *mesh,
240 const int field_id,
241 const cs_equation_param_t *eqp,
243 void *context);
244
245/*----------------------------------------------------------------------------*/
256/*----------------------------------------------------------------------------*/
257
258void
261 void *context);
262
263/*----------------------------------------------------------------------------*/
275/*----------------------------------------------------------------------------*/
276
277cs_real_t *
279 bool previous);
280
281/*----------------------------------------------------------------------------*/
293/*----------------------------------------------------------------------------*/
294
295cs_real_t *
297 bool previous);
298
299/*----------------------------------------------------------------------------*/
312/*----------------------------------------------------------------------------*/
313
314void
316 const cs_equation_param_t *eqp,
317 cs_real_t t_eval,
319 void *context,
320 cs_real_t *diff_flux);
321
322/*----------------------------------------------------------------------------*/
334/*----------------------------------------------------------------------------*/
335
339 void *context);
340
341/*----------------------------------------------------------------------------*/
349/*----------------------------------------------------------------------------*/
350
351void
354 void *context);
355
356/*----------------------------------------------------------------------------*/
357
359
360#endif /* __CS_CDOCB_SCALEQ_H__ */
void * cs_cdocb_scaleq_free_context(void *scheme_context)
Destroy a cs_cdocb_scaleq_t structure.
Definition: cs_cdocb_scaleq.cpp:1218
cs_real_t * cs_cdocb_scaleq_get_face_values(void *context, bool previous)
Retrieve an array of values at mesh faces for the variable field associated to the given context The ...
Definition: cs_cdocb_scaleq.cpp:1696
void cs_cdocb_scaleq_current_to_previous(const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *context)
Copy current content of the related variables-fields to previous values Case of the monolithic coupli...
Definition: cs_cdocb_scaleq.cpp:1637
bool cs_cdocb_scaleq_is_initialized(void)
Check if the generic structures for building a CDO-Cb scheme are allocated.
Definition: cs_cdocb_scaleq.cpp:874
void cs_cdocb_scaleq_diffusion(const cs_equation_param_t *eqp, const cs_equation_builder_t *eqb, const cs_cdocb_scaleq_t *eqc, const cs_cell_mesh_t *cm, cs_hodge_t *diff_hodge, cs_cell_sys_t *csys, cs_cell_builder_t *cb)
Build the local matrices arising from the diffusion term in the scalar-valued CDO-Cb schemes.
Definition: cs_cdocb_scaleq.cpp:1484
void cs_cdocb_scaleq_setup(cs_real_t t_eval, const cs_mesh_t *mesh, const cs_equation_param_t *eqp, cs_equation_builder_t *eqb)
Set the boundary conditions known from the settings Define an indirection array for the enforcement o...
Definition: cs_cdocb_scaleq.cpp:1284
void cs_cdocb_scaleq_init_sharing(const cs_mesh_t *mesh, const cs_cdo_quantities_t *cdoq, const cs_cdo_connect_t *connect, const cs_time_step_t *time_step)
Set shared pointers from the main domain members.
Definition: cs_cdocb_scaleq.cpp:917
cs_cdo_balance_t * cs_cdocb_scaleq_balance(const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *context)
Compute the balance for an equation over the full computational domain Case of scalar-valued CDO cell...
Definition: cs_cdocb_scaleq.cpp:1785
void cs_cdocb_scaleq_extra_post(const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *context)
Predefined extra-operations related to this equation.
Definition: cs_cdocb_scaleq.cpp:1911
void cs_cdocb_scaleq_solve_steady_state(bool cur2prev, const cs_mesh_t *mesh, const int field_id, const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *context)
Solve the steady-state equation with a CDO cell-based scheme Scalar-valued diffusion equation up-to-n...
Definition: cs_cdocb_scaleq.cpp:1535
cs_real_t * cs_cdocb_scaleq_get_cell_values(void *context, bool previous)
Retrieve an array of values at mesh cellss for the variable field associated to the given context The...
Definition: cs_cdocb_scaleq.cpp:1663
void * cs_cdocb_scaleq_init_context(cs_equation_param_t *eqp, int var_id, int bflux_id, cs_equation_builder_t *eqb)
Initialize a cs_cdocb_scaleq_t structure storing data useful for building and managing such a scheme.
Definition: cs_cdocb_scaleq.cpp:1006
void cs_cdocb_scaleq_init_values(cs_real_t t_eval, const int field_id, const cs_mesh_t *mesh, const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *context)
Set the initial values of the variable field taking into account the boundary conditions....
Definition: cs_cdocb_scaleq.cpp:1330
void cs_cdocb_scaleq_get(cs_cell_sys_t **csys, cs_cell_builder_t **cb)
Retrieve work buffers used for building a CDO system cellwise.
Definition: cs_cdocb_scaleq.cpp:892
void cs_cdocb_scaleq_finalize_sharing(void)
Free shared pointers with lifecycle dedicated to this file.
Definition: cs_cdocb_scaleq.cpp:970
void cs_cdocb_scaleq_diff_flux_faces(const cs_real_t *values, const cs_equation_param_t *eqp, cs_real_t t_eval, cs_equation_builder_t *eqb, void *context, cs_real_t *diff_flux)
Cellwise computation of the diffusive flux accross (primal) faces A scalar-valued flux for each face....
Definition: cs_cdocb_scaleq.cpp:1735
#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
Definition: mesh.f90:26
Definition: cs_cdo_toolbox.h:68
Definition: cs_cdo_connect.h:61
Definition: cs_cdo_quantities.h:139
Set of local and temporary buffers.
Definition: cs_cdo_local.h:60
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
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 associated to a discrete Hodge operator *.
Definition: cs_hodge.h:183
Definition: cs_mesh.h:85
time step descriptor
Definition: cs_time_step.h:64