9.2
general documentation
cs_equation_system.h
Go to the documentation of this file.
1#ifndef CS_EQUATION_SYSTEM_H
2#define CS_EQUATION_SYSTEM_H
3
4/*============================================================================
5 * Functions to handle a set of coupled equations hinging on the cs_equation_t
6 * structure
7 *============================================================================*/
8
9/*
10 This file is part of code_saturne, a general-purpose CFD tool.
11
12 Copyright (C) 1998-2026 EDF S.A.
13
14 This program is free software; you can redistribute it and/or modify it under
15 the terms of the GNU General Public License as published by the Free Software
16 Foundation; either version 2 of the License, or (at your option) any later
17 version.
18
19 This program is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
21 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
22 details.
23
24 You should have received a copy of the GNU General Public License along with
25 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
26 Street, Fifth Floor, Boston, MA 02110-1301, USA.
27*/
28
29/*----------------------------------------------------------------------------
30 * Local headers
31 *----------------------------------------------------------------------------*/
32
33#include "base/cs_param_types.h"
34#include "cdo/cs_equation.h"
37
38/*============================================================================
39 * Macro definitions
40 *============================================================================*/
41
42/*============================================================================
43 * Type definitions
44 *============================================================================*/
45
46/*----------------------------------------------------------------------------*/
62/*----------------------------------------------------------------------------*/
63
64typedef void *
67 cs_equation_core_t **core_array,
69
70/*----------------------------------------------------------------------------*/
86/*----------------------------------------------------------------------------*/
87
88typedef void *
90 cs_equation_core_t **core_array,
91 void *sys_context);
92
93/*----------------------------------------------------------------------------*/
105/*----------------------------------------------------------------------------*/
106
107typedef void
109 const cs_time_step_t *time_step,
110 int n_eqs,
112 cs_equation_core_t **blocks,
113 void *sys_context,
115
116
121typedef struct {
122
133
151
152 void *context;
153
170
196
221
224
230
231/*============================================================================
232 * Public function prototypes
233 *============================================================================*/
234
235/*----------------------------------------------------------------------------*/
241/*----------------------------------------------------------------------------*/
242
243int
245
246/*----------------------------------------------------------------------------*/
254/*----------------------------------------------------------------------------*/
255
257cs_equation_system_by_id(int sys_id);
258
259/*----------------------------------------------------------------------------*/
268/*----------------------------------------------------------------------------*/
269
272
273/*----------------------------------------------------------------------------*/
283/*----------------------------------------------------------------------------*/
284
286cs_equation_system_add(const char *sysname,
287 int n_eqs,
288 int block_var_dim);
289
290/*----------------------------------------------------------------------------*/
294/*----------------------------------------------------------------------------*/
295
296void
298
299/*----------------------------------------------------------------------------*/
303/*----------------------------------------------------------------------------*/
304
305void
307
308/*----------------------------------------------------------------------------*/
313/*----------------------------------------------------------------------------*/
314
315void
317
318/*----------------------------------------------------------------------------*/
327/*----------------------------------------------------------------------------*/
328
329void
331 const cs_cdo_connect_t *connect,
332 const cs_cdo_quantities_t *quant,
333 const cs_time_step_t *time_step);
334
335/*----------------------------------------------------------------------------*/
340/*----------------------------------------------------------------------------*/
341
342void
344
345/*----------------------------------------------------------------------------*/
349/*----------------------------------------------------------------------------*/
350
351void
353
354/*----------------------------------------------------------------------------*/
362/*----------------------------------------------------------------------------*/
363
364void
366
367/*----------------------------------------------------------------------------*/
375/*----------------------------------------------------------------------------*/
376
377void
379 bool cur2prev,
380 cs_equation_system_t *eqsys);
381
382/*----------------------------------------------------------------------------*/
391/*----------------------------------------------------------------------------*/
392
393void
395 cs_equation_t *eq,
396 cs_equation_system_t *eqsys);
397
398/*----------------------------------------------------------------------------*/
408/*----------------------------------------------------------------------------*/
409
410void
412 int col_id,
414 cs_equation_system_t *eqsys);
415
416#endif /* CS_EQUATION_SYSTEM_H */
time step descriptor
Definition: cs_time_step.h:60
cs_equation_system_t * cs_equation_system_by_id(int sys_id)
Retrieve the pointer to the equation system related to the given id.
Definition: cs_equation_system.cpp:284
void *() cs_equation_system_free_t(int n_eqs, cs_equation_core_t **core_array, void *sys_context)
Free an array of structures (equation parameters, equation builders or scheme context) for each equat...
Definition: cs_equation_system.h:89
void cs_equation_system_init_sharing(const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *time_step)
Assign a set of shared pointer to the main structures.
Definition: cs_equation_system.cpp:484
void cs_equation_system_assign_param(int row_id, int col_id, cs_equation_param_t *eqp, cs_equation_system_t *eqsys)
Assign the given equation parameters to the block with ids (row_id, col_id) in the block matrix.
Definition: cs_equation_system.cpp:808
void cs_equation_system_assign_equation(int row_id, cs_equation_t *eq, cs_equation_system_t *eqsys)
Assign the given equation to the diagonal block located at position (row_id, row_id) in the matrix of...
Definition: cs_equation_system.cpp:761
void cs_equation_system_destroy_all(void)
Destroy all cs_equation_system_t structures.
Definition: cs_equation_system.cpp:354
void cs_equation_system_log_setup(void)
Log the setup for all structures managing systems of equations.
Definition: cs_equation_system.cpp:371
void cs_equation_system_solve(const cs_time_step_t *time_step, bool cur2prev, cs_equation_system_t *eqsys)
Solve of a system of coupled equations. Unsteady case.
Definition: cs_equation_system.cpp:715
void() cs_equation_system_solve_t(bool c2p, const cs_time_step_t *time_step, int n_eqs, cs_equation_system_param_t *sysp, cs_equation_core_t **blocks, void *sys_context, cs_cdo_system_helper_t *sh)
Build and solve a linear system within the CDO framework.
Definition: cs_equation_system.h:108
void cs_equation_system_define(void)
Define the builder and scheme context structures associated to all the systems of equations which hav...
Definition: cs_equation_system.cpp:656
void cs_equation_system_set_functions(void)
Assign a set of pointer functions for managing all the systems of equations.
Definition: cs_equation_system.cpp:551
cs_equation_system_param_t * cs_equation_system_param_by_id(int sys_id)
Retrieve the pointer to the set of parameters of a system of equations related to the given id.
Definition: cs_equation_system.cpp:304
void cs_equation_system_log_monitoring(void)
Print a synthesis of the monitoring information in the performance file.
Definition: cs_equation_system.cpp:454
int cs_equation_system_get_n_systems(void)
Get the number of systems of equations.
Definition: cs_equation_system.cpp:268
cs_equation_system_t * cs_equation_system_add(const char *sysname, int n_eqs, int block_var_dim)
Add a new structure to handle system of coupled equations.
Definition: cs_equation_system.cpp:325
void cs_equation_system_set_sles(void)
Set the SLES associated to each system of equations.
Definition: cs_equation_system.cpp:617
void *() cs_equation_system_define_t(int n_eqs, const cs_equation_system_param_t *sysp, cs_equation_core_t **core_array, cs_cdo_system_helper_t **p_sh)
Create and initialize equation builders and scheme context for each equation which are in the extra-d...
Definition: cs_equation_system.h:65
Definition: mesh.f90:26
Definition: cs_cdo_connect.h:57
Definition: cs_cdo_quantities.h:142
Definition: cs_cdo_system.h:373
Main structures on which an equation structure relies.
Definition: cs_equation.h:78
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources.
Definition: cs_equation_param.h:190
Main structure storing the parameter settings.
Definition: cs_equation_system_param.h:68
Main structure to handle a set of coupled equations.
Definition: cs_equation_system.h:121
cs_equation_system_free_t * free
Definition: cs_equation_system.h:220
void * context
Definition: cs_equation_system.h:152
cs_equation_t ** equations
Definition: cs_equation_system.h:169
cs_equation_system_solve_t * solve_steady_state_system
Definition: cs_equation_system.h:223
cs_equation_system_param_t * param
Definition: cs_equation_system.h:132
int timer_id
Definition: cs_equation_system.h:135
cs_timer_counter_t timer
Definition: cs_equation_system.h:134
cs_equation_core_t ** block_factories
Definition: cs_equation_system.h:195
cs_equation_system_define_t * define
Definition: cs_equation_system.h:219
cs_cdo_system_helper_t * system_helper
Definition: cs_equation_system.h:150
cs_equation_system_solve_t * solve_system
Definition: cs_equation_system.h:222
int n_equations
Definition: cs_equation_system.h:168
Main structure to handle the discretization and the resolution of an equation.
Definition: cs_mesh.h:85
Definition: cs_timer.h:51