7.1
general documentation
cs_cdoeb_vecteq.h
Go to the documentation of this file.
1 #ifndef __CS_CDOEB_VECTEQ_H__
2 #define __CS_CDOEB_VECTEQ_H__
3 
4 /*============================================================================
5  * Build an algebraic CDO edge-based system. Degrees of freedom are defined as
6  * a circulation. Degrees of freedom are scalar-valued but the equation to
7  * solve is vector-valued
8  *============================================================================*/
9 
10 /*
11  This file is part of Code_Saturne, a general-purpose CFD tool.
12 
13  Copyright (C) 1998-2021 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  * Local headers
32  *----------------------------------------------------------------------------*/
33 
34 #include "cs_base.h"
35 #include "cs_cdo_connect.h"
36 #include "cs_cdo_local.h"
37 #include "cs_cdo_quantities.h"
38 #include "cs_cdoeb_priv.h"
39 #include "cs_equation_common.h"
40 #include "cs_equation_param.h"
41 #include "cs_field.h"
42 #include "cs_matrix.h"
43 #include "cs_mesh.h"
44 #include "cs_restart.h"
45 #include "cs_source_term.h"
46 #include "cs_time_step.h"
47 
48 /*----------------------------------------------------------------------------*/
49 
51 
52 /*============================================================================
53  * Macro definitions
54  *============================================================================*/
55 
56 /*============================================================================
57  * Type definitions
58  *============================================================================*/
59 
60 /* Algebraic system for CDO edge-based discretization */
61 typedef struct _cs_cdoeb_t cs_cdoeb_vecteq_t;
62 
63 /*============================================================================
64  * Public function prototypes
65  *============================================================================*/
66 
67 /*----------------------------------------------------------------------------*/
74 /*----------------------------------------------------------------------------*/
75 
76 bool
78 
79 /*----------------------------------------------------------------------------*/
89 /*----------------------------------------------------------------------------*/
90 
91 void
93  const cs_cdo_connect_t *connect,
94  const cs_time_step_t *time_step,
95  const cs_matrix_structure_t *ms);
96 
97 /*----------------------------------------------------------------------------*/
105 /*----------------------------------------------------------------------------*/
106 
107 void
109  cs_cell_builder_t **cb);
110 
111 /*----------------------------------------------------------------------------*/
116 /*----------------------------------------------------------------------------*/
117 
118 void
120 
121 /*----------------------------------------------------------------------------*/
133 /*----------------------------------------------------------------------------*/
134 
135 void *
137  int var_id,
138  int bflux_id,
139  cs_equation_builder_t *eqb);
140 
141 /*----------------------------------------------------------------------------*/
149 /*----------------------------------------------------------------------------*/
150 
151 void *
152 cs_cdoeb_vecteq_free_context(void *builder);
153 
154 /*----------------------------------------------------------------------------*/
167 /*----------------------------------------------------------------------------*/
168 
169 void
171  const int field_id,
172  const cs_mesh_t *mesh,
173  const cs_equation_param_t *eqp,
175  void *context);
176 
177 /*----------------------------------------------------------------------------*/
190 /*----------------------------------------------------------------------------*/
191 
192 void
194  const cs_mesh_t *mesh,
195  const int field_id,
196  const cs_equation_param_t *eqp,
198  void *context);
199 
200 /*----------------------------------------------------------------------------*/
209 /*----------------------------------------------------------------------------*/
210 
211 void
214  void *context);
215 
216 /*----------------------------------------------------------------------------*/
224 /*----------------------------------------------------------------------------*/
225 
226 void
229  void *context);
230 
231 /*----------------------------------------------------------------------------*/
242 /*----------------------------------------------------------------------------*/
243 
244 cs_real_t *
245 cs_cdoeb_vecteq_get_edge_values(void *context,
246  bool previous);
247 
248 /*----------------------------------------------------------------------------*/
259 /*----------------------------------------------------------------------------*/
260 
261 cs_real_t *
262 cs_cdoeb_vecteq_get_cell_values(void *context,
263  bool previous);
264 
265 /*----------------------------------------------------------------------------*/
274 /*----------------------------------------------------------------------------*/
275 
276 void
278  const char *eqname,
279  void *scheme_context);
280 
281 /*----------------------------------------------------------------------------*/
290 /*----------------------------------------------------------------------------*/
291 
292 void
294  const char *eqname,
295  void *scheme_context);
296 
297 /*----------------------------------------------------------------------------*/
298 
300 
301 #endif /* __CS_CDOEB_VECTEQ_H__ */
Store common elements used when building an algebraic system related to an equation.
time step descriptor
Definition: cs_time_step.h:64
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources...
Definition: cs_equation_param.h:177
void cs_cdoeb_vecteq_finalize_common(void)
Free work buffer and general structure related to CDO edge-based schemes.
Definition: cs_cdoeb_vecteq.c:575
void cs_cdoeb_vecteq_read_restart(cs_restart_t *restart, const char *eqname, void *scheme_context)
Read additional arrays (not defined as fields) but useful for the checkpoint/restart process...
Definition: cs_cdoeb_vecteq.c:1236
#define BEGIN_C_DECLS
Definition: cs_defs.h:510
void * cs_cdoeb_vecteq_init_context(const cs_equation_param_t *eqp, int var_id, int bflux_id, cs_equation_builder_t *eqb)
Initialize a cs_cdoeb_vecteq_t structure storing data useful for building and managing such a scheme...
Definition: cs_cdoeb_vecteq.c:611
Definition: cs_cdo_connect.h:79
double cs_real_t
Floating-point value.
Definition: cs_defs.h:322
Definition: cs_cdo_quantities.h:129
void cs_cdoeb_vecteq_current_to_previous(const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *context)
Operate a current to previous operation for the field associated to this equation and potentially for...
Definition: cs_cdoeb_vecteq.c:1125
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:146
void cs_cdoeb_vecteq_get(cs_cell_sys_t **csys, cs_cell_builder_t **cb)
Retrieve work buffers used for building a CDO system cellwise in case of scalar-valued edge-based sch...
Definition: cs_cdoeb_vecteq.c:553
Structures for building an algebraic CDO edge-based system for unsteady diffusion-reaction equations ...
Definition: cs_mesh.h:84
cs_real_t * cs_cdoeb_vecteq_get_edge_values(void *context, bool previous)
Get the values at mesh edges (the DoFs) The lifecycle of this array is managed by the code...
Definition: cs_cdoeb_vecteq.c:1180
struct _cs_restart_t cs_restart_t
Definition: cs_restart.h:93
void * cs_cdoeb_vecteq_free_context(void *builder)
Destroy a cs_cdoeb_vecteq_t structure.
Definition: cs_cdoeb_vecteq.c:762
void cs_cdoeb_vecteq_extra_post(const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *context)
Predefined extra-operations related to this equation.
Definition: cs_cdoeb_vecteq.c:1157
Set of local and temporary buffers.
Definition: cs_cdo_local.h:60
void cs_cdoeb_vecteq_write_restart(cs_restart_t *restart, const char *eqname, void *scheme_context)
Write additional arrays (not defined as fields) but useful for the checkpoint/restart process...
Definition: cs_cdoeb_vecteq.c:1257
void cs_cdoeb_vecteq_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)
Build and solve the linear system arising from a scalar steady-state convection/diffusion/reaction eq...
Definition: cs_cdoeb_vecteq.c:896
#define END_C_DECLS
Definition: cs_defs.h:511
void cs_cdoeb_vecteq_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. Case of scalar-valued CDO-Eb schemes.
Definition: cs_cdoeb_vecteq.c:799
void cs_cdoeb_vecteq_init_common(const cs_cdo_quantities_t *quant, const cs_cdo_connect_t *connect, const cs_time_step_t *time_step, const cs_matrix_structure_t *ms)
Allocate work buffers and general structures related to CDO edge-based schemes. Set shared pointers...
Definition: cs_cdoeb_vecteq.c:493
cs_real_t * cs_cdoeb_vecteq_get_cell_values(void *context, bool previous)
Get the values at mesh cells from a reconstruction of edge values. The lifecycle of this array is man...
Definition: cs_cdoeb_vecteq.c:1208
struct _cs_matrix_structure_t cs_matrix_structure_t
Definition: cs_matrix.h:89
Definition: mesh.f90:26
Definition: cs_cdoeb_priv.h:62
bool cs_cdoeb_vecteq_is_initialized(void)
Check if the generic structures for building a CDO-Eb scheme are allocated.
Definition: cs_cdoeb_vecteq.c:472