7.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-2022 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_connect.h"
33 #include "cs_cdo_quantities.h"
34 #include "cs_cdo_toolbox.h"
35 #include "cs_equation_param.h"
36 #include "cs_equation_builder.h"
37 #include "cs_field.h"
38 #include "cs_mesh.h"
39 #include "cs_restart.h"
40 #include "cs_time_step.h"
41 
42 /*----------------------------------------------------------------------------*/
43 
45 
46 /*============================================================================
47  * Macro definitions
48  *============================================================================*/
49 
50 /*============================================================================
51  * Type definitions
52  *============================================================================*/
53 
54 typedef struct _cs_equation_t cs_equation_t;
55 
82 typedef struct {
83 
87 
89 
90 /*============================================================================
91  * Public function prototypes
92  *============================================================================*/
93 
94 /*----------------------------------------------------------------------------*/
100 /*----------------------------------------------------------------------------*/
101 
102 int
104 
105 /*----------------------------------------------------------------------------*/
114 /*----------------------------------------------------------------------------*/
115 
117 cs_equation_by_name(const char *eqname);
118 
119 /*----------------------------------------------------------------------------*/
128 /*----------------------------------------------------------------------------*/
129 
131 cs_equation_by_field_name(const char *field_name);
132 
133 /*----------------------------------------------------------------------------*/
144 /*----------------------------------------------------------------------------*/
145 
146 bool
148  const char *fld_name);
149 
150 /*----------------------------------------------------------------------------*/
163 /*----------------------------------------------------------------------------*/
164 
166 cs_equation_param_by_name(const char *eqname);
167 
168 /*----------------------------------------------------------------------------*/
178 /*----------------------------------------------------------------------------*/
179 
181 cs_equation_param_by_field_name(const char *field_name);
182 
183 /*----------------------------------------------------------------------------*/
192 /*----------------------------------------------------------------------------*/
193 
196 
197 /*----------------------------------------------------------------------------*/
206 /*----------------------------------------------------------------------------*/
207 
209 cs_equation_by_id(int eq_id);
210 
211 /*----------------------------------------------------------------------------*/
219 /*----------------------------------------------------------------------------*/
220 
221 const char *
223 
224 /*----------------------------------------------------------------------------*/
232 /*----------------------------------------------------------------------------*/
233 
234 int
236 
237 /*----------------------------------------------------------------------------*/
245 /*----------------------------------------------------------------------------*/
246 
247 cs_field_t *
249 
250 /*----------------------------------------------------------------------------*/
259 /*----------------------------------------------------------------------------*/
260 
261 int
263 
264 /*----------------------------------------------------------------------------*/
275 /*----------------------------------------------------------------------------*/
276 
277 const cs_range_set_t *
279 
280 /*----------------------------------------------------------------------------*/
290 /*----------------------------------------------------------------------------*/
291 
292 cs_gnum_t
294  const cs_cdo_quantities_t *cdoq);
295 
296 /*----------------------------------------------------------------------------*/
305 /*----------------------------------------------------------------------------*/
306 
307 cs_field_t *
309 
310 /*----------------------------------------------------------------------------*/
318 /*----------------------------------------------------------------------------*/
319 
320 cs_flag_t
322 
323 /*----------------------------------------------------------------------------*/
330 /*----------------------------------------------------------------------------*/
331 
332 void
334  cs_flag_t flag);
335 
336 /*----------------------------------------------------------------------------*/
347 /*----------------------------------------------------------------------------*/
348 
349 void
351  void *context,
353 
354 /*----------------------------------------------------------------------------*/
363 /*----------------------------------------------------------------------------*/
364 
367 
368 /*----------------------------------------------------------------------------*/
377 /*----------------------------------------------------------------------------*/
378 
379 void *
381 
382 /*----------------------------------------------------------------------------*/
391 /*----------------------------------------------------------------------------*/
392 
395 
396 /*----------------------------------------------------------------------------*/
404 /*----------------------------------------------------------------------------*/
405 
406 bool
408 
409 /*----------------------------------------------------------------------------*/
417 /*----------------------------------------------------------------------------*/
418 
419 bool
421 
422 /*----------------------------------------------------------------------------*/
434 /*----------------------------------------------------------------------------*/
435 
437 cs_equation_add(const char *eqname,
438  const char *varname,
439  cs_equation_type_t eqtype,
440  int dim,
441  cs_param_bc_type_t default_bc);
442 
443 /*----------------------------------------------------------------------------*/
454 /*----------------------------------------------------------------------------*/
455 
457 cs_equation_add_user(const char *eqname,
458  const char *varname,
459  int dim,
460  cs_param_bc_type_t default_bc);
461 
462 /*----------------------------------------------------------------------------*/
479 /*----------------------------------------------------------------------------*/
480 
482 cs_equation_add_user_tracer(const char *eqname,
483  const char *varname,
484  int dim,
485  cs_param_bc_type_t default_bc,
486  cs_property_t *time_pty,
487  cs_adv_field_t *adv,
488  cs_property_t *diff_pty);
489 /*----------------------------------------------------------------------------*/
493 /*----------------------------------------------------------------------------*/
494 
495 void
497 
498 /*----------------------------------------------------------------------------*/
505 /*----------------------------------------------------------------------------*/
506 
507 bool
509 
510 /*----------------------------------------------------------------------------*/
515 /*----------------------------------------------------------------------------*/
516 
517 void
519 
520 /*----------------------------------------------------------------------------*/
528 /*----------------------------------------------------------------------------*/
529 
530 void
531 cs_equation_get_count(int *n_equations,
532  int *n_predef_equations,
533  int *n_user_equations);
534 
535 /*----------------------------------------------------------------------------*/
539 /*----------------------------------------------------------------------------*/
540 
541 void
543 
544 /*----------------------------------------------------------------------------*/
551 /*----------------------------------------------------------------------------*/
552 
553 void
555  const char *keyval);
556 
557 /*----------------------------------------------------------------------------*/
561 /*----------------------------------------------------------------------------*/
562 
563 void
565 
566 /*----------------------------------------------------------------------------*/
580 /*----------------------------------------------------------------------------*/
581 
582 void
584  const cs_cdo_quantities_t *quant,
585  const cs_time_step_t *time_step,
586  cs_flag_t eb_scheme_flag,
587  cs_flag_t fb_scheme_flag,
588  cs_flag_t vb_scheme_flag,
589  cs_flag_t vcb_scheme_flag,
590  cs_flag_t hho_scheme_flag);
591 
592 /*----------------------------------------------------------------------------*/
602 /*----------------------------------------------------------------------------*/
603 
604 void
606  cs_flag_t vcb_scheme_flag,
607  cs_flag_t eb_scheme_flag,
608  cs_flag_t fb_scheme_flag,
609  cs_flag_t hho_scheme_flag);
610 
611 /*----------------------------------------------------------------------------*/
620 /*----------------------------------------------------------------------------*/
621 
622 bool
624 
625 /*----------------------------------------------------------------------------*/
641 /*----------------------------------------------------------------------------*/
642 
643 void
645  cs_equation_t *eq);
646 
647 /*----------------------------------------------------------------------------*/
651 /*----------------------------------------------------------------------------*/
652 
653 void
655 
656 /*----------------------------------------------------------------------------*/
662 /*----------------------------------------------------------------------------*/
663 
664 void
666 
667 /*----------------------------------------------------------------------------*/
671 /*----------------------------------------------------------------------------*/
672 
673 void
675 
676 /*----------------------------------------------------------------------------*/
684 /*----------------------------------------------------------------------------*/
685 
686 void
688  cs_equation_core_t **p_core);
689 
690 /*----------------------------------------------------------------------------*/
698 /*----------------------------------------------------------------------------*/
699 
700 void
702  const cs_time_step_t *ts);
703 
704 /*----------------------------------------------------------------------------*/
712 /*----------------------------------------------------------------------------*/
713 
714 void
716  cs_equation_t *eq);
717 
718 /*----------------------------------------------------------------------------*/
727 /*----------------------------------------------------------------------------*/
728 
729 void
730 cs_equation_solve(bool cur2prev,
731  const cs_mesh_t *mesh,
732  cs_equation_t *eq);
733 
734 /*----------------------------------------------------------------------------*/
742 /*----------------------------------------------------------------------------*/
743 
744 void
745 cs_equation_solve_steady_state_wrapper(const char *eqname);
746 
747 /*----------------------------------------------------------------------------*/
756 /*----------------------------------------------------------------------------*/
757 
758 void
759 cs_equation_solve_wrapper(bool cur2prev,
760  const char *eqname);
761 
762 /*----------------------------------------------------------------------------*/
769 /*----------------------------------------------------------------------------*/
770 
771 void
773  cs_equation_t *eq);
774 
775 /*----------------------------------------------------------------------------*/
781 /*----------------------------------------------------------------------------*/
782 
783 void
785 
786 /*----------------------------------------------------------------------------*/
795 /*----------------------------------------------------------------------------*/
796 
799 
800 /*----------------------------------------------------------------------------*/
809 /*----------------------------------------------------------------------------*/
810 
813 
814 /*----------------------------------------------------------------------------*/
826 /*----------------------------------------------------------------------------*/
827 
830  const int reaction_id);
831 
832 /*----------------------------------------------------------------------------*/
841 /*----------------------------------------------------------------------------*/
842 
845 
846 /*----------------------------------------------------------------------------*/
856 /*----------------------------------------------------------------------------*/
857 
858 cs_real_t
860 
861 /*----------------------------------------------------------------------------*/
870 /*----------------------------------------------------------------------------*/
871 
874 
875 /*----------------------------------------------------------------------------*/
884 /*----------------------------------------------------------------------------*/
885 
886 int
888 
889 /*----------------------------------------------------------------------------*/
897 /*----------------------------------------------------------------------------*/
898 
899 int
901 
902 /*----------------------------------------------------------------------------*/
910 /*----------------------------------------------------------------------------*/
911 
914 
915 /*----------------------------------------------------------------------------*/
923 /*----------------------------------------------------------------------------*/
924 
925 void
927 
928 /*----------------------------------------------------------------------------*/
937 /*----------------------------------------------------------------------------*/
938 
939 void
941  cs_cell_sys_t **csys,
942  cs_cell_builder_t **cb);
943 
944 /*----------------------------------------------------------------------------*/
954 /*----------------------------------------------------------------------------*/
955 
956 cs_real_t *
958  bool previous);
959 
960 /*----------------------------------------------------------------------------*/
970 /*----------------------------------------------------------------------------*/
971 
972 cs_real_t *
974  bool previous);
975 
976 /*----------------------------------------------------------------------------*/
986 /*----------------------------------------------------------------------------*/
987 
988 cs_real_t *
990  bool previous);
991 
992 /*----------------------------------------------------------------------------*/
1002 /*----------------------------------------------------------------------------*/
1003 
1004 cs_real_t *
1006  bool previous);
1007 
1008 /*----------------------------------------------------------------------------*/
1018 /*----------------------------------------------------------------------------*/
1019 
1020 void
1022  const cs_cdo_quantities_t *cdoq,
1023  const cs_equation_t *eq,
1024  cs_real_t *result);
1025 
1026 /*----------------------------------------------------------------------------*/
1037 /*----------------------------------------------------------------------------*/
1038 
1039 void
1041  const cs_equation_t *eq,
1042  cs_real_t *diff_flux);
1043 
1044 /*----------------------------------------------------------------------------*/
1055 /*----------------------------------------------------------------------------*/
1056 
1057 void
1059  const char *ml_name,
1060  const cs_real_3_t direction,
1061  cs_real_t *diff_flux,
1062  cs_real_t *conv_flux);
1063 
1064 /*----------------------------------------------------------------------------*/
1076 /*----------------------------------------------------------------------------*/
1077 
1078 void
1080  cs_flag_t location,
1081  cs_real_t t_eval,
1082  cs_real_t *diff_flux);
1083 
1084 /*----------------------------------------------------------------------------*/
1091 /*----------------------------------------------------------------------------*/
1092 
1093 void
1095  cs_real_t *v_gradient);
1096 
1097 /*----------------------------------------------------------------------------*/
1106 /*----------------------------------------------------------------------------*/
1107 
1108 void
1110  const cs_time_step_t *ts,
1111  cs_real_t peclet[]);
1112 
1113 /*----------------------------------------------------------------------------*/
1120 /*----------------------------------------------------------------------------*/
1121 
1122 void
1124 
1125 /*----------------------------------------------------------------------------*/
1132 /*----------------------------------------------------------------------------*/
1133 
1134 void
1136 
1137 /*----------------------------------------------------------------------------*/
1146 /*----------------------------------------------------------------------------*/
1147 
1148 void
1150  const cs_cdo_connect_t *connect,
1151  const cs_cdo_quantities_t *cdoq,
1152  const cs_time_step_t *ts);
1153 
1154 /*----------------------------------------------------------------------------*/
1166 /*----------------------------------------------------------------------------*/
1167 
1168 void
1170  const cs_property_t *property,
1171  const cs_real_t *pot,
1172  cs_flag_t loc_res,
1173  cs_real_t *res);
1174 
1175 /*----------------------------------------------------------------------------*/
1180 /*----------------------------------------------------------------------------*/
1181 
1182 void
1184 
1185 /*----------------------------------------------------------------------------*/
1186 
1188 
1189 #endif /* __CS_EQUATION_H__ */
Store common elements used when building an algebraic system related to an equation.
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.c:3536
time step descriptor
Definition: cs_time_step.h:64
unsigned long cs_gnum_t
global mesh entity number
Definition: cs_defs.h:301
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.c:1059
void cs_equation_compute_diffusive_flux(const cs_equation_t *eq, cs_flag_t location, cs_real_t t_eval, cs_real_t *diff_flux)
Cellwise computation of the diffusive flux across the requested location. If the location is not the ...
Definition: cs_equation.c:3303
void cs_equation_define_context_structures(void)
Allocate and define the context structure associated to each equation.
Definition: cs_equation.c:2484
Definition: cs_advection_field.h:150
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.c:3488
void cs_equation_set_flag(cs_equation_t *eq, cs_flag_t flag)
Redefine the flag associated to an equation.
Definition: cs_equation.c:903
Field descriptor.
Definition: cs_field.h:125
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources...
Definition: cs_equation_param.h:186
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.c:1894
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.c:3227
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. Only for an advanced usage.
Definition: cs_equation.c:969
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.c:2975
void cs_equation_define_core(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, then one allocates the structure.
Definition: cs_equation.c:2526
#define BEGIN_C_DECLS
Definition: cs_defs.h:510
void cs_equation_set_sles(void)
Setup the linear algebra requirements.
Definition: cs_equation.c:1739
void cs_equation_compute_boundary_diff_flux(cs_real_t t_eval, const cs_equation_t *eq, cs_real_t *diff_flux)
Compute the diffusive flux across all boundary faces According to the space discretization scheme...
Definition: cs_equation.c:3142
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:76
void cs_equation_user_create_fields(void)
Create a field structure related to all user-defined equations.
Definition: cs_equation.c:2426
bool cs_equation_uses_new_mechanism(const cs_equation_t *eq)
Return true is the given equation is steady otherwise false.
Definition: cs_equation.c:1289
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.c:2867
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.c:2896
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. Only for an advanced usage. The context may be set to NULL if there is no need to get additional information.
Definition: cs_equation.c:927
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.c:1709
Definition: cs_cdo_connect.h:61
void cs_equation_build_system(const cs_mesh_t *mesh, cs_equation_t *eq)
Build the linear system for this equation (deprecated)
Definition: cs_equation.c:2606
double cs_real_t
Floating-point value.
Definition: cs_defs.h:322
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.c:3027
Definition: cs_cdo_quantities.h:132
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
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.c:2399
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.c:1084
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.c:3664
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.c:606
Definition: cs_mesh.h:84
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.c:3001
cs_equation_t * cs_equation_by_id(int eq_id)
Find the cs_equation_t structure with id eq_id Return NULL if not find.
Definition: cs_equation.c:651
cs_equation_param_t * param
Definition: cs_equation.h:84
void cs_equation_finalize_sharing(cs_flag_t vb_scheme_flag, cs_flag_t vcb_scheme_flag, cs_flag_t eb_scheme_flag, cs_flag_t fb_scheme_flag, cs_flag_t hho_scheme_flag)
Free shared local structures among the discretization schemes.
Definition: cs_equation.c:1849
void cs_equation_log_setup(void)
Summarize all cs_equation_t structures.
Definition: cs_equation.c:1673
cs_param_space_scheme_t
Type of numerical scheme for the discretization in space.
Definition: cs_param_types.h:207
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.c:631
void * scheme_context
Definition: cs_equation.h:86
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.c:508
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.c:1180
void cs_equation_init_sharing(const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *time_step, 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)
Set shared pointers to the main structures. Associate these structures among the activated class of d...
Definition: cs_equation.c:1781
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.c:1109
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.c:2949
Main structures composiing an equation structure.
Definition: cs_equation.h:82
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.c:989
struct _cs_restart_t cs_restart_t
Definition: cs_restart.h:93
Definition: cs_range_set.h:57
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.c:3711
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.c:860
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.c:3396
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.c:1037
void cs_equation_solve_deprecated(cs_equation_t *eq)
Solve the linear system for this equation (deprecated)
Definition: cs_equation.c:2633
Set of local and temporary buffers.
Definition: cs_cdo_local.h:60
cs_equation_builder_t * builder
Definition: cs_equation.h:85
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.c:691
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.c:2555
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.c:1457
cs_equation_key_t
List of available keys for setting the parameters of an equation.
Definition: cs_equation_param.h:1115
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:335
cs_equation_type_t
Type of equations managed by the solver.
Definition: cs_equation_param.h:165
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.c:1506
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.c:731
cs_equation_core_t cs_equation_get_core(const cs_equation_t *eq)
Return a pointer to a structure useful to handle low-level operations for the given equation...
Definition: cs_equation.c:1009
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.c:540
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.c:1244
#define END_C_DECLS
Definition: cs_defs.h:511
unsigned short int cs_flag_t
Definition: cs_defs.h:324
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.c:2755
cs_param_bc_type_t
Definition: cs_param_types.h:470
cs_flag_t cs_equation_get_flag(const cs_equation_t *eq)
Return the flag associated to an equation.
Definition: cs_equation.c:881
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.c:787
void cs_equation_define_builders(const cs_mesh_t *mesh)
Allocate and define the builder structure.
Definition: cs_equation.c:2455
bool cs_equation_needs_steady_state_solve(void)
Check if a steady-state computation is requested according to the setting.
Definition: cs_equation.c:1586
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.c:711
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.c:753
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.c:1326
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.c:3438
void cs_equation_solve_steady_state_wrapper(const char *eqname)
Build and then solve the linear system for a steady-state equation. This is wrapper for the FORTRAN i...
Definition: cs_equation.c:2792
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.c:572
int cs_equation_get_var_dim(const cs_equation_t *eq)
Return the dimension of the variable solved by this equation.
Definition: cs_equation.c:1223
void cs_equation_destroy_all(void)
Destroy all cs_equation_t structures.
Definition: cs_equation.c:1542
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.c:1657
Main structure to handle the discretization and the resolution of an equation.
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.c:2718
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.c:2923
cs_param_time_scheme_t
Definition: cs_param_types.h:269
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.c:671
cs_equation_t * cs_equation_by_name(const char *eqname)
Find the cs_equation_t structure with name eqname Return NULL if not find.
Definition: cs_equation.c:474
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.c:1202
char *restrict varname
Definition: cs_equation_priv.h:338
Structure associated to the definition of a property relying on the cs_xdef_t structure.
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.c:3511
Definition: cs_equation_priv.h:321
int cs_equation_get_n_equations(void)
Retrieve the number of equations.
Definition: cs_equation.c:457
Definition: mesh.f90:26
void cs_equation_solve_wrapper(bool cur2prev, const char *eqname)
Build and then solve the linear system for an equation with an unsteady term. This is wrapper for the...
Definition: cs_equation.c:2830
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.c:1132
void cs_equation_log_monitoring(void)
Print a synthesis of the monitoring information in the performance file.
Definition: cs_equation.c:1608
bool cs_equation_is_steady(const cs_equation_t *eq)
Return true is the given equation is steady otherwise false.
Definition: cs_equation.c:1265