9.2
general documentation
cs_equation.h
Go to the documentation of this file.
1#ifndef CS_EQUATION_H
2#define CS_EQUATION_H
3
4/*============================================================================
5 * Functions to handle the cs_equation_t structure and its related structures
6 *============================================================================*/
7
8/*
9 This file is part of code_saturne, a general-purpose CFD tool.
10
11 Copyright (C) 1998-2026 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 "base/cs_field.h"
33#include "base/cs_restart.h"
34#include "base/cs_time_step.h"
35#include "cdo/cs_cdo_connect.h"
37#include "cdo/cs_cdo_toolbox.h"
40#include "mesh/cs_mesh.h"
41
42/*============================================================================
43 * Macro definitions
44 *============================================================================*/
45
46/*============================================================================
47 * Type definitions
48 *============================================================================*/
49
50typedef struct _cs_equation_t cs_equation_t;
51
78typedef struct {
79
83
85
86/*============================================================================
87 * Public function prototypes
88 *============================================================================*/
89
90/*----------------------------------------------------------------------------*/
96/*----------------------------------------------------------------------------*/
97
98int
100
101/*----------------------------------------------------------------------------*/
110/*----------------------------------------------------------------------------*/
111
113cs_equation_by_name(const char *eqname);
114
115/*----------------------------------------------------------------------------*/
124/*----------------------------------------------------------------------------*/
125
127cs_equation_by_field_name(const char *field_name);
128
129/*----------------------------------------------------------------------------*/
140/*----------------------------------------------------------------------------*/
141
142bool
144 const char *fld_name);
145
146/*----------------------------------------------------------------------------*/
159/*----------------------------------------------------------------------------*/
160
162cs_equation_param_by_name(const char *eqname);
163
164/*----------------------------------------------------------------------------*/
174/*----------------------------------------------------------------------------*/
175
177cs_equation_param_by_field_name(const char *field_name);
178
179/*----------------------------------------------------------------------------*/
188/*----------------------------------------------------------------------------*/
189
192
193/*----------------------------------------------------------------------------*/
202/*----------------------------------------------------------------------------*/
203
205cs_equation_by_id(int eq_id);
206
207/*----------------------------------------------------------------------------*/
215/*----------------------------------------------------------------------------*/
216
217const char *
219
220/*----------------------------------------------------------------------------*/
228/*----------------------------------------------------------------------------*/
229
230int
232
233/*----------------------------------------------------------------------------*/
241/*----------------------------------------------------------------------------*/
242
245
246/*----------------------------------------------------------------------------*/
255/*----------------------------------------------------------------------------*/
256
257int
259
260/*----------------------------------------------------------------------------*/
269/*----------------------------------------------------------------------------*/
270
271const char *
273
274/*----------------------------------------------------------------------------*/
285/*----------------------------------------------------------------------------*/
286
287const cs_range_set_t *
289
290/*----------------------------------------------------------------------------*/
300/*----------------------------------------------------------------------------*/
301
304 const cs_cdo_quantities_t *cdoq);
305
306/*----------------------------------------------------------------------------*/
315/*----------------------------------------------------------------------------*/
316
319
320/*----------------------------------------------------------------------------*/
328/*----------------------------------------------------------------------------*/
329
332
333/*----------------------------------------------------------------------------*/
340/*----------------------------------------------------------------------------*/
341
342void
344 cs_flag_t flag);
345
346/*----------------------------------------------------------------------------*/
357/*----------------------------------------------------------------------------*/
358
359void
361 void *context,
363
364/*----------------------------------------------------------------------------*/
373/*----------------------------------------------------------------------------*/
374
377
378/*----------------------------------------------------------------------------*/
387/*----------------------------------------------------------------------------*/
388
389void *
391
392/*----------------------------------------------------------------------------*/
401/*----------------------------------------------------------------------------*/
402
405
406/*----------------------------------------------------------------------------*/
416/*----------------------------------------------------------------------------*/
417
418cs_real_t *
420
421/*----------------------------------------------------------------------------*/
429/*----------------------------------------------------------------------------*/
430
431bool
433
434/*----------------------------------------------------------------------------*/
444/*----------------------------------------------------------------------------*/
445
446bool
448
449/*----------------------------------------------------------------------------*/
461/*----------------------------------------------------------------------------*/
462
464cs_equation_add(const char *eqname,
465 const char *varname,
466 cs_equation_type_t eqtype,
467 int dim,
468 cs_param_bc_type_t default_bc);
469
470/*----------------------------------------------------------------------------*/
481/*----------------------------------------------------------------------------*/
482
484cs_equation_add_user(const char *eqname,
485 const char *varname,
486 int dim,
487 cs_param_bc_type_t default_bc);
488
489/*----------------------------------------------------------------------------*/
506/*----------------------------------------------------------------------------*/
507
509cs_equation_add_user_tracer(const char *eqname,
510 const char *varname,
511 int dim,
512 cs_param_bc_type_t default_bc,
513 cs_property_t *time_pty,
514 cs_adv_field_t *adv,
515 cs_property_t *diff_pty);
516/*----------------------------------------------------------------------------*/
520/*----------------------------------------------------------------------------*/
521
522void
524
525/*----------------------------------------------------------------------------*/
532/*----------------------------------------------------------------------------*/
533
534bool
536
537/*----------------------------------------------------------------------------*/
545/*----------------------------------------------------------------------------*/
546
547void
549 const cs_cdo_quantities_t *cdoq);
550
551/*----------------------------------------------------------------------------*/
559/*----------------------------------------------------------------------------*/
560
561void
562cs_equation_get_count(int *n_equations,
563 int *n_predef_equations,
564 int *n_user_equations);
565
566/*----------------------------------------------------------------------------*/
570/*----------------------------------------------------------------------------*/
571
572void
574
575/*----------------------------------------------------------------------------*/
582/*----------------------------------------------------------------------------*/
583
584void
586 const char *keyval);
587
588/*----------------------------------------------------------------------------*/
592/*----------------------------------------------------------------------------*/
593
594void
596
597/*----------------------------------------------------------------------------*/
614/*----------------------------------------------------------------------------*/
615
616void
618 const cs_cdo_connect_t *connect,
619 const cs_cdo_quantities_t *cdoq,
620 const cs_time_step_t *time_step,
621 cs_flag_t cb_scheme_flag,
622 cs_flag_t eb_scheme_flag,
623 cs_flag_t fb_scheme_flag,
624 cs_flag_t vb_scheme_flag,
625 cs_flag_t vcb_scheme_flag,
626 cs_flag_t hho_scheme_flag,
627 cs_flag_t mac_scheme_flag);
628
629/*----------------------------------------------------------------------------*/
641/*----------------------------------------------------------------------------*/
642
643void
645 cs_flag_t eb_scheme_flag,
646 cs_flag_t fb_scheme_flag,
647 cs_flag_t vb_scheme_flag,
648 cs_flag_t vcb_scheme_flag,
649 cs_flag_t hho_scheme_flag,
650 cs_flag_t mac_scheme_flag);
651
652/*----------------------------------------------------------------------------*/
661/*----------------------------------------------------------------------------*/
662
663bool
665
666/*----------------------------------------------------------------------------*/
671/*----------------------------------------------------------------------------*/
672
673void
675
676/*----------------------------------------------------------------------------*/
692/*----------------------------------------------------------------------------*/
693
694void
696 cs_equation_t *eq);
697
698/*----------------------------------------------------------------------------*/
702/*----------------------------------------------------------------------------*/
703
704void
706
707/*----------------------------------------------------------------------------*/
713/*----------------------------------------------------------------------------*/
714
715void
717
718/*----------------------------------------------------------------------------*/
722/*----------------------------------------------------------------------------*/
723
724void
726
727/*----------------------------------------------------------------------------*/
735/*----------------------------------------------------------------------------*/
736
737void
739 cs_equation_core_t **p_core);
740
741/*----------------------------------------------------------------------------*/
749/*----------------------------------------------------------------------------*/
750
751void
753 const cs_time_step_t *ts);
754
755/*----------------------------------------------------------------------------*/
763/*----------------------------------------------------------------------------*/
764
765void
767 cs_equation_t *eq);
768
769/*----------------------------------------------------------------------------*/
778/*----------------------------------------------------------------------------*/
779
780void
781cs_equation_solve(bool cur2prev,
782 const cs_mesh_t *mesh,
783 cs_equation_t *eq);
784
785/*----------------------------------------------------------------------------*/
793/*----------------------------------------------------------------------------*/
794
795[[deprecated]] void
797 cs_equation_t *eq);
798
799/*----------------------------------------------------------------------------*/
807/*----------------------------------------------------------------------------*/
808
809[[deprecated]] void
811 cs_equation_t *eq);
812
813/*----------------------------------------------------------------------------*/
822/*----------------------------------------------------------------------------*/
823
826
827/*----------------------------------------------------------------------------*/
836/*----------------------------------------------------------------------------*/
837
840
841/*----------------------------------------------------------------------------*/
852/*----------------------------------------------------------------------------*/
853
856 const int reaction_id);
857
858/*----------------------------------------------------------------------------*/
867/*----------------------------------------------------------------------------*/
868
871
872/*----------------------------------------------------------------------------*/
882/*----------------------------------------------------------------------------*/
883
886
887/*----------------------------------------------------------------------------*/
896/*----------------------------------------------------------------------------*/
897
900
901/*----------------------------------------------------------------------------*/
910/*----------------------------------------------------------------------------*/
911
912int
914
915/*----------------------------------------------------------------------------*/
923/*----------------------------------------------------------------------------*/
924
925int
927
928/*----------------------------------------------------------------------------*/
936/*----------------------------------------------------------------------------*/
937
940
941/*----------------------------------------------------------------------------*/
951/*----------------------------------------------------------------------------*/
952
953double
955 const cs_equation_t *eq);
956
957/*----------------------------------------------------------------------------*/
965/*----------------------------------------------------------------------------*/
966
967void
969
970/*----------------------------------------------------------------------------*/
979/*----------------------------------------------------------------------------*/
980
981void
983 cs_cell_sys_t **csys,
984 cs_cell_builder_t **cb);
985
986/*----------------------------------------------------------------------------*/
996/*----------------------------------------------------------------------------*/
997
998cs_real_t *
1000 bool previous);
1001
1002/*----------------------------------------------------------------------------*/
1012/*----------------------------------------------------------------------------*/
1013
1014cs_real_t *
1016 bool previous);
1017
1018/*----------------------------------------------------------------------------*/
1028/*----------------------------------------------------------------------------*/
1029
1030cs_real_t *
1032 bool previous);
1033
1034/*----------------------------------------------------------------------------*/
1044/*----------------------------------------------------------------------------*/
1045
1046cs_real_t *
1048 bool previous);
1049
1050/*----------------------------------------------------------------------------*/
1062/*----------------------------------------------------------------------------*/
1063
1064void
1066 const cs_cdo_quantities_t *cdoq,
1067 const cs_equation_t *eq,
1068 cs_real_t *result);
1069
1070/*----------------------------------------------------------------------------*/
1110/*----------------------------------------------------------------------------*/
1111
1112void
1114 const cs_equation_param_t *eqp,
1115 const cs_property_t *diff_pty,
1116 const cs_real_t *dof_vals,
1117 const cs_real_t *cell_vals,
1118 cs_real_t t_eval,
1119 cs_real_t *diff_flux);
1120
1121/*----------------------------------------------------------------------------*/
1132/*----------------------------------------------------------------------------*/
1133
1134void
1136 const char *ml_name,
1137 const cs_real_3_t direction,
1138 cs_real_t *diff_flux,
1139 cs_real_t *conv_flux);
1140
1141/*----------------------------------------------------------------------------*/
1180/*----------------------------------------------------------------------------*/
1181
1182void
1184 const cs_equation_param_t *eqp,
1185 const cs_property_t *diff_pty,
1186 const cs_real_t *dof_vals,
1187 const cs_real_t *cell_vals,
1188 cs_flag_t location,
1189 cs_real_t t_eval,
1190 cs_real_t *diff_flux);
1191
1192/*----------------------------------------------------------------------------*/
1199/*----------------------------------------------------------------------------*/
1200
1201void
1203 cs_real_t *v_gradient);
1204
1205/*----------------------------------------------------------------------------*/
1214/*----------------------------------------------------------------------------*/
1215
1216void
1218 const cs_time_step_t *ts,
1219 cs_real_t peclet[]);
1220
1221/*----------------------------------------------------------------------------*/
1228/*----------------------------------------------------------------------------*/
1229
1230void
1232
1233/*----------------------------------------------------------------------------*/
1240/*----------------------------------------------------------------------------*/
1241
1242void
1244
1245/*----------------------------------------------------------------------------*/
1254/*----------------------------------------------------------------------------*/
1255
1256void
1258 const cs_cdo_connect_t *connect,
1259 const cs_cdo_quantities_t *cdoq,
1260 const cs_time_step_t *ts);
1261
1262/*----------------------------------------------------------------------------*/
1274/*----------------------------------------------------------------------------*/
1275
1276void
1278 const cs_property_t *property,
1279 const cs_real_t *pot,
1280 cs_flag_t loc_res,
1281 cs_real_t *res);
1282
1283/*----------------------------------------------------------------------------*/
1288/*----------------------------------------------------------------------------*/
1289
1290void
1292
1293#endif /* CS_EQUATION_H */
Field descriptor.
Definition: cs_field.h:275
time step descriptor
Definition: cs_time_step.h:60
double cs_real_t
Floating-point value.
Definition: cs_defs.h:332
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:349
unsigned cs_gnum_t
global mesh entity number
Definition: cs_defs.h:317
unsigned short int cs_flag_t
Definition: cs_defs.h:334
cs_equation_t * cs_equation_add_user_tracer(const char *eqname, const char *varname, int dim, cs_param_bc_type_t default_bc, cs_property_t *time_pty, cs_adv_field_t *adv, cs_property_t *diff_pty)
Add a new user transport equation and set a first set of parameters If time_pty is null,...
Definition: cs_equation.cpp:1660
void cs_equation_init_sharing(const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *cdoq, const cs_time_step_t *time_step, cs_flag_t cb_scheme_flag, cs_flag_t eb_scheme_flag, cs_flag_t fb_scheme_flag, cs_flag_t vb_scheme_flag, cs_flag_t vcb_scheme_flag, cs_flag_t hho_scheme_flag, cs_flag_t mac_scheme_flag)
Set shared pointers to the main structures. Associate these structures among the activated class of d...
Definition: cs_equation.cpp:1963
cs_real_t * cs_equation_get_cell_values(const cs_equation_t *eq, bool previous)
For a given equation, retrieve an array of values related to each cell of the mesh for the unknowns.
Definition: cs_equation.cpp:3227
void cs_equation_add_build_hook(cs_equation_t *eq, void *context, cs_equation_build_hook_t *func)
Add a hook function to enable an advanced control during the cellwise system building....
Definition: cs_equation.cpp:1374
void cs_equation_define_builders(const cs_mesh_t *mesh)
Allocate and define the builder structure.
Definition: cs_equation.cpp:2807
void cs_equation_predefined_create_field(int n_previous, cs_equation_t *eq)
Create a field structure related to the predefined equation given as parameter. This includes an equa...
Definition: cs_equation.cpp:2751
cs_equation_core_t cs_equation_get_core_structure(const cs_equation_t *eq)
Return a pointer to a structure useful to handle low-level operations for the given equation.
Definition: cs_equation.cpp:966
cs_equation_t * cs_equation_by_id(int eq_id)
Find the cs_equation_t structure with id eq_id Return nullptr if not found.
Definition: cs_equation.cpp:670
void cs_equation_finalize_sharing(cs_flag_t cb_scheme_flag, cs_flag_t eb_scheme_flag, cs_flag_t fb_scheme_flag, cs_flag_t vb_scheme_flag, cs_flag_t vcb_scheme_flag, cs_flag_t hho_scheme_flag, cs_flag_t mac_scheme_flag)
Free shared local structures among the discretization schemes.
Definition: cs_equation.cpp:2052
void cs_equation_lock_settings(void)
After this call, parameters related to an equation are set once for all.
Definition: cs_equation.cpp:2706
void cs_equation_extra_post(void)
Predefined extra-operations related to equations according to the type of numerical scheme (for the s...
Definition: cs_equation.cpp:4260
cs_real_t * cs_equation_get_source_term_array(const cs_equation_t *eq)
Return a pointer to an array of values corresponding to the values of the source terms (cumulated val...
Definition: cs_equation.cpp:994
void cs_equation_write_extra_restart(cs_restart_t *restart)
Write into the restart file additionnal arrays (not defined as fields) but useful for the checkpoint/...
Definition: cs_equation.cpp:4073
cs_property_t * cs_equation_get_time_property(const cs_equation_t *eq)
Return a pointer to the cs_property_t structure associated to the unsteady term for this equation (nu...
Definition: cs_equation.cpp:1069
void cs_equation_post_balance(const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *cdoq, const cs_time_step_t *ts)
Predefined extra-operations related to all equations.
Definition: cs_equation.cpp:4098
const cs_range_set_t * cs_equation_get_range_set(const cs_equation_t *eq)
Return the range set structure associated to a cs_equation_t structure. One assumes that there is onl...
Definition: cs_equation.cpp:792
cs_equation_param_t * cs_equation_get_param(const cs_equation_t *eq)
Return the cs_equation_param_t structure associated to a cs_equation_t structure.
Definition: cs_equation.cpp:650
cs_equation_t * cs_equation_add_user(const char *eqname, const char *varname, int dim, cs_param_bc_type_t default_bc)
Add a new user equation structure and set a first set of parameters.
Definition: cs_equation.cpp:1609
void cs_equation_set_default_param(cs_equation_key_t key, const char *keyval)
Set a parameter attached to a keyname for the default settigns.
Definition: cs_equation.cpp:1888
bool cs_equation_set_functions(void)
Assign a set of pointer functions for managing the cs_equation_t structure during the computation Aft...
Definition: cs_equation.cpp:2103
void cs_equation_read_extra_restart(cs_restart_t *restart)
Write into the restart file additionnal arrays (not defined as fields) but useful for the checkpoint/...
Definition: cs_equation.cpp:4050
void cs_equation_set_sles(void)
Setup the linear algebra requirements.
Definition: cs_equation.cpp:1918
void cs_equation_solve(bool cur2prev, const cs_mesh_t *mesh, cs_equation_t *eq)
Build and then solve the linear system for an equation with an unsteady term.
Definition: cs_equation.cpp:3138
void cs_equation_set_flag(cs_equation_t *eq, cs_flag_t flag)
Redefine the flag associated to an equation.
Definition: cs_equation.cpp:1350
int cs_equation_get_space_poly_degree(const cs_equation_t *eq)
Return the max. degree used in the polynomial basis for the space discretization.
Definition: cs_equation.cpp:1210
bool cs_equation_needs_steady_state_solve(void)
Check if a steady-state computation is requested according to the setting.
Definition: cs_equation.cpp:1743
void cs_equation_solve_steady_state(const cs_mesh_t *mesh, cs_equation_t *eq)
Build and then solve the linear system for this equation when the goal is to find the steady state.
Definition: cs_equation.cpp:3102
void * cs_equation_get_scheme_context(const cs_equation_t *eq)
Return a pointer to a structure useful to handle low-level operations for the given equation.
Definition: cs_equation.cpp:946
cs_flag_t cs_equation_get_flag(const cs_equation_t *eq)
Return the flag associated to an equation.
Definition: cs_equation.cpp:1328
cs_param_time_scheme_t cs_equation_get_time_scheme(const cs_equation_t *eq)
Return the type of numerical scheme used for the discretization in time.
Definition: cs_equation.cpp:1118
cs_field_t * cs_equation_get_field(const cs_equation_t *eq)
Return the field structure associated to a cs_equation_t structure.
Definition: cs_equation.cpp:728
cs_param_space_scheme_t cs_equation_get_space_scheme(const cs_equation_t *eq)
Return the type of numerical scheme used for the discretization in space.
Definition: cs_equation.cpp:1188
cs_equation_param_t * cs_equation_param_by_name(const char *eqname)
Return the cs_equation_param_t structure associated to a cs_equation_t structure based on the equatio...
Definition: cs_equation.cpp:592
void cs_equation_get_count(int *n_equations, int *n_predef_equations, int *n_user_equations)
Get the count of equations of each macro type.
Definition: cs_equation.cpp:1835
bool cs_equation_uses_new_mechanism(const cs_equation_t *eq)
Return true is the given equation follows the new mechanism otherwise false Only HHO and MAC schemes ...
Definition: cs_equation.cpp:1441
void cs_equation_define_context_structures(void)
Allocate and define the context structure associated to each equation.
Definition: cs_equation.cpp:2836
const char * cs_equation_get_name(const cs_equation_t *eq)
Return the name related to the given cs_equation_t structure.
Definition: cs_equation.cpp:689
cs_real_t * cs_equation_get_edge_values(const cs_equation_t *eq, bool previous)
For a given equation, retrieve an array of values related to each edge of the mesh for the unknowns.
Definition: cs_equation.cpp:3279
cs_equation_t * cs_equation_by_field_name(const char *field_name)
Return the pointer to a cs_equation_t structure thanks to the field name of the variable field associ...
Definition: cs_equation.cpp:528
void cs_equation_define_core_structure(const cs_equation_t *eq, cs_equation_core_t **p_core)
Build a pointer to a core structure. If the input core structure is not allocated,...
Definition: cs_equation.cpp:2884
void cs_equation_log_monitoring(const cs_time_step_t *ts, const cs_cdo_quantities_t *cdoq)
Print a synthesis of the monitoring information in the performance file.
Definition: cs_equation.cpp:1768
void cs_equation_compute_vtx_field_gradient(const cs_equation_t *eq, cs_real_t *v_gradient)
Cellwise computation of the discrete gradient at vertices.
Definition: cs_equation.cpp:3961
void cs_equation_init_field_values(const cs_mesh_t *mesh, const cs_time_step_t *ts)
Set the initialize condition to all variable fields associated to each cs_equation_t structure.
Definition: cs_equation.cpp:2913
void cs_equation_solve_deprecated(const cs_mesh_t *mesh, cs_equation_t *eq)
Solve the linear system for this equation (deprecated). Only for HHO schemes.
Definition: cs_equation.cpp:2994
cs_equation_builder_t * cs_equation_get_builder(const cs_equation_t *eq)
Return the cs_equation_builder_t structure associated to a cs_equation_t structure....
Definition: cs_equation.cpp:926
cs_gnum_t cs_equation_get_global_n_dofs(const cs_equation_t *eq, const cs_cdo_quantities_t *cdoq)
Return the global number of degrees of freedom associated to this cs_equation_t structure.
Definition: cs_equation.cpp:825
void cs_equation_compute_diffusive_flux(const cs_equation_t *eq, const cs_equation_param_t *eqp, const cs_property_t *diff_pty, const cs_real_t *dof_vals, const cs_real_t *cell_vals, cs_flag_t location, cs_real_t t_eval, cs_real_t *diff_flux)
Computation of the diffusive flux across the requested location. If the location is not the "natural"...
Definition: cs_equation.cpp:3740
bool cs_equation_is_steady(const cs_equation_t *eq)
Return true is the given equation is steady otherwise false.
Definition: cs_equation.cpp:1415
cs_property_t * cs_equation_get_diffusion_property(const cs_equation_t *eq)
Return a pointer to the cs_property_t structure associated to the diffusion term for this equation (n...
Definition: cs_equation.cpp:1047
bool cs_equation_has_field_name(const cs_equation_t *eq, const char *fld_name)
Check if the asociated field to a cs_equation_t structure has name equal to fld_name.
Definition: cs_equation.cpp:560
cs_property_t * cs_equation_get_reaction_property(const cs_equation_t *eq, const int reaction_id)
Return a pointer to the cs_property_t structure associated to the reaction term with id equal to reac...
Definition: cs_equation.cpp:1093
cs_real_t * cs_equation_get_face_values(const cs_equation_t *eq, bool previous)
For a given equation, retrieve an array of values related to each face of the mesh for the unknowns.
Definition: cs_equation.cpp:3253
void cs_equation_compute_flux_across_plane(const cs_equation_t *eq, const char *ml_name, const cs_real_3_t direction, cs_real_t *diff_flux, cs_real_t *conv_flux)
Compute the diffusive and convective flux across a plane defined by a mesh location structure attache...
Definition: cs_equation.cpp:3635
cs_equation_t * cs_equation_by_name(const char *eqname)
Find the cs_equation_t structure with name eqname Return nullptr if not found.
Definition: cs_equation.cpp:495
void cs_equation_current_to_previous(const cs_equation_t *eq)
Apply the current to previous to all fields (and potentially arrays) related to an equation....
Definition: cs_equation.cpp:3171
void cs_equation_integrate_variable(const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *cdoq, const cs_equation_t *eq, cs_real_t *result)
Compute the integral over the domain of the variable field associated to the given equation....
Definition: cs_equation.cpp:3333
void cs_equation_build_system(const cs_mesh_t *mesh, cs_equation_t *eq)
Build the linear system for this equation (deprecated). Only for HHO schemes.
Definition: cs_equation.cpp:2965
void cs_equation_apply_stiffness(cs_equation_t *eq, const cs_property_t *property, const cs_real_t *pot, cs_flag_t loc_res, cs_real_t *res)
Compute the cellwise stiffness matrix associated to the property given as a parameter and apply it to...
Definition: cs_equation.cpp:4218
void cs_equation_destroy_all(void)
Destroy all cs_equation_t structures.
Definition: cs_equation.cpp:1696
void cs_equation_compute_boundary_diff_flux(const cs_equation_t *eq, const cs_equation_param_t *eqp, const cs_property_t *diff_pty, const cs_real_t *dof_vals, const cs_real_t *cell_vals, cs_real_t t_eval, cs_real_t *diff_flux)
Compute the diffusive flux across all boundary faces According to the space discretization scheme,...
Definition: cs_equation.cpp:3473
void cs_equation_get_cellwise_builders(const cs_equation_t *eq, cs_cell_sys_t **csys, cs_cell_builder_t **cb)
For a given equation, retrieve the related cellwise builder structures: cs_cell_builder_t and cs_cell...
Definition: cs_equation.cpp:3200
void cs_equation_log_setup(void)
Summarize all cs_equation_t structures.
Definition: cs_equation.cpp:1851
void cs_equation_user_create_fields(void)
Create a field structure related to all user-defined equations.
Definition: cs_equation.cpp:2778
cs_real_t cs_equation_get_theta_time_val(const cs_equation_t *eq)
Return the value of the theta parameter in theta time scheme discretization.
Definition: cs_equation.cpp:1141
cs_real_t * cs_equation_get_vertex_values(const cs_equation_t *eq, bool previous)
For a given equation, retrieve an array of values related to each vertex of the mesh for the unknowns...
Definition: cs_equation.cpp:3305
cs_field_t * cs_equation_get_boundary_flux(const cs_equation_t *eq)
Return the field structure for the (normal) boundary flux associated to a cs_equation_t structure.
Definition: cs_equation.cpp:904
int cs_equation_get_id(const cs_equation_t *eq)
Return the id number related to the given cs_equation_t structure.
Definition: cs_equation.cpp:709
cs_equation_type_t cs_equation_get_type(const cs_equation_t *eq)
Return the type of equation for the given equation structure.
Definition: cs_equation.cpp:1252
double cs_equation_get_time_eval(const cs_time_step_t *ts, const cs_equation_t *eq)
Estimate the time at which the evaluation of properties related to the different terms of an equation...
Definition: cs_equation.cpp:1275
cs_equation_t * cs_equation_add(const char *eqname, const char *varname, cs_equation_type_t eqtype, int dim, cs_param_bc_type_t default_bc)
Add a new equation structure and set a first set of parameters.
Definition: cs_equation.cpp:1479
const char * cs_equation_get_field_name(const cs_equation_t *eq)
Return the name related to the variable field structure associated to the given cs_equation_t structu...
Definition: cs_equation.cpp:768
int cs_equation_get_field_id(const cs_equation_t *eq)
Return the id related to the variable field structure associated to the cs_equation_t structure.
Definition: cs_equation.cpp:748
cs_equation_param_t * cs_equation_param_by_field_name(const char *field_name)
Return the cs_equation_param_t structure related to a cs_equation_t structure thanks to the field nam...
Definition: cs_equation.cpp:625
int cs_equation_get_var_dim(const cs_equation_t *eq)
Return the dimension of the variable solved by this equation.
Definition: cs_equation.cpp:1231
int cs_equation_get_n_equations(void)
Retrieve the number of equations.
Definition: cs_equation.cpp:478
void cs_equation_compute_peclet(const cs_equation_t *eq, const cs_time_step_t *ts, cs_real_t peclet[])
Compute and post-process Peclet number if requested.
Definition: cs_equation.cpp:4002
void() cs_equation_build_hook_t(const cs_equation_param_t *eqp, const cs_equation_builder_t *eqb, const void *eqc, const cs_cell_mesh_t *cm, void *context, cs_hodge_t *mass_hodge, cs_hodge_t *diff_hodge, cs_cell_sys_t *csys, cs_cell_builder_t *cb)
Generic function prototype for a hook during the cellwise building of the linear system Enable an adv...
Definition: cs_equation_builder.h:72
cs_equation_key_t
List of available keys for setting the parameters of an equation.
Definition: cs_equation_param.h:1234
cs_equation_type_t
Type of equations managed by the solver.
Definition: cs_equation_param.h:169
cs_param_space_scheme_t
Type of numerical scheme for the discretization in space.
Definition: cs_param_types.h:215
cs_param_bc_type_t
Definition: cs_param_types.h:501
cs_param_time_scheme_t
Definition: cs_param_types.h:279
struct _cs_restart_t cs_restart_t
Definition: cs_restart.h:91
Definition: mesh.f90:26
Definition: cs_equation_priv.h:319
Definition: cs_advection_field.h:151
Definition: cs_cdo_connect.h:57
Definition: cs_cdo_quantities.h:142
Set of local and temporary buffers.
Definition: cs_cdo_local.h:56
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:163
Store common elements used when building an algebraic system related to an equation.
Main structures on which an equation structure relies.
Definition: cs_equation.h:78
void * scheme_context
Definition: cs_equation.h:82
cs_equation_builder_t * builder
Definition: cs_equation.h:81
cs_equation_param_t * param
Definition: cs_equation.h:80
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources.
Definition: cs_equation_param.h:190
Main structure to handle the discretization and the resolution of an equation.
Definition: cs_mesh.h:85
Structure associated to the definition of a property relying on the cs_xdef_t structure.
Definition: cs_range_set.h:53