7.1
general documentation
cs_equation_param.h
Go to the documentation of this file.
1 #ifndef __CS_EQUATION_PARAM_H__
2 #define __CS_EQUATION_PARAM_H__
3 
4 /*============================================================================
5  * Functions related to the structure cs_equation_param_t storing the settings
6  * related to an equation.
7  *============================================================================*/
8 
9 /*
10  This file is part of Code_Saturne, a general-purpose CFD tool.
11 
12  Copyright (C) 1998-2021 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 "cs_advection_field.h"
34 #include "cs_enforcement.h"
35 #include "cs_hodge.h"
36 #include "cs_param_cdo.h"
37 #include "cs_param_sles.h"
38 #include "cs_property.h"
39 #include "cs_xdef.h"
40 
41 /*----------------------------------------------------------------------------*/
42 
44 
45 /*============================================================================
46  * Macro definitions
47  *============================================================================*/
48 
86 #define CS_EQUATION_LOCKED (1 << 0) /* 1 */
87 #define CS_EQUATION_UNSTEADY (1 << 1) /* 2 */
88 #define CS_EQUATION_CONVECTION (1 << 2) /* 4 */
89 #define CS_EQUATION_DIFFUSION (1 << 3) /* 8 */
90 #define CS_EQUATION_CURLCURL (1 << 4) /* 16 */
91 #define CS_EQUATION_GRADDIV (1 << 5) /* 32 */
92 #define CS_EQUATION_REACTION (1 << 6) /* 64 */
93 #define CS_EQUATION_FORCE_VALUES (1 << 7) /* 128 */
94 #define CS_EQUATION_USER_HOOK (1 << 8) /* 256 */
95 #define CS_EQUATION_USER_TRIGGERED (1 << 9) /* 512 */
96 
97 
117 #define CS_EQUATION_POST_BALANCE (1 << 0) /* 1 */
118 #define CS_EQUATION_POST_PECLET (1 << 1) /* 2 */
119 #define CS_EQUATION_POST_UPWIND_COEF (1 << 2) /* 4 */
120 #define CS_EQUATION_POST_NORMAL_FLUX (1 << 3) /* 8 */
121 
124 /*============================================================================
125  * Type definitions
126  *============================================================================*/
127 
156 typedef enum {
157 
165 
167 
169 
170 /*----------------------------------------------------------------------------*/
171 
177 typedef struct {
178 
184  char *restrict name;
186  int dim;
196  union {
198  int iwarni;
199  };
200 
207 
214 
215  /* Numerical settings */
216 
225 
437  int iconv;
438  int istat;
439  int idircl;
440  int ndircl;
441  int idiff;
442  int idifft;
443  int idften;
444  int iswdyn;
445  int ischcv;
446  int ibdtso;
447  int isstpc;
448  int nswrgr;
449  int nswrsm;
450  int imvisf;
451  int imrgra;
452  int imligr;
453  int ircflu;
454  int iwgrec;
455  int icoupl;
456  double thetav; /* TODO: merge with theta */
457  double blencv;
458  double blend_st;
459  double epsilo;
460  double epsrsm;
461  double epsrgr;
462  double climgr;
463  double relaxv;
464 
503 
507 
522 
536 
557 
572 
588 
604 
650 
673 
690 
710 
731 
745 
756 
760 
761 /*----------------------------------------------------------------------------*/
762 
1086 typedef enum {
1087 
1119 
1121 
1123 
1124 /*============================================================================
1125  * Static inline public function prototypes
1126  *============================================================================*/
1127 
1128 /*----------------------------------------------------------------------------*/
1135 /*----------------------------------------------------------------------------*/
1136 
1137 static inline void
1138 cs_equation_param_set_flag(cs_equation_param_t *eqp,
1139  cs_flag_t flag)
1140 {
1141  assert(eqp != NULL);
1142  eqp->flag |= flag;
1143 }
1144 
1145 /*----------------------------------------------------------------------------*/
1153 /*----------------------------------------------------------------------------*/
1154 
1155 static inline bool
1156 cs_equation_param_has_diffusion(const cs_equation_param_t *eqp)
1157 {
1158  assert(eqp != NULL);
1159  if (eqp->flag & CS_EQUATION_DIFFUSION)
1160  return true;
1161  else
1162  return false;
1163 }
1164 
1165 /*----------------------------------------------------------------------------*/
1173 /*----------------------------------------------------------------------------*/
1174 
1175 static inline bool
1176 cs_equation_param_has_curlcurl(const cs_equation_param_t *eqp)
1177 {
1178  assert(eqp != NULL);
1179  if (eqp->flag & CS_EQUATION_CURLCURL)
1180  return true;
1181  else
1182  return false;
1183 }
1184 
1185 /*----------------------------------------------------------------------------*/
1193 /*----------------------------------------------------------------------------*/
1194 
1195 static inline bool
1196 cs_equation_param_has_graddiv(const cs_equation_param_t *eqp)
1197 {
1198  assert(eqp != NULL);
1199  if (eqp->flag & CS_EQUATION_GRADDIV)
1200  return true;
1201  else
1202  return false;
1203 }
1204 
1205 /*----------------------------------------------------------------------------*/
1213 /*----------------------------------------------------------------------------*/
1214 
1215 static inline bool
1216 cs_equation_param_has_convection(const cs_equation_param_t *eqp)
1217 {
1218  assert(eqp != NULL);
1219  if (eqp->flag & CS_EQUATION_CONVECTION)
1220  return true;
1221  else
1222  return false;
1223 }
1224 
1225 /*----------------------------------------------------------------------------*/
1233 /*----------------------------------------------------------------------------*/
1234 
1235 static inline bool
1236 cs_equation_param_has_reaction(const cs_equation_param_t *eqp)
1237 {
1238  assert(eqp != NULL);
1239  if (eqp->flag & CS_EQUATION_REACTION)
1240  return true;
1241  else
1242  return false;
1243 }
1244 
1245 /*----------------------------------------------------------------------------*/
1253 /*----------------------------------------------------------------------------*/
1254 
1255 static inline bool
1256 cs_equation_param_has_time(const cs_equation_param_t *eqp)
1257 {
1258  assert(eqp != NULL);
1259  if (eqp->flag & CS_EQUATION_UNSTEADY)
1260  return true;
1261  else
1262  return false;
1263 }
1264 
1265 /*----------------------------------------------------------------------------*/
1273 /*----------------------------------------------------------------------------*/
1274 
1275 static inline bool
1276 cs_equation_param_has_sourceterm(const cs_equation_param_t *eqp)
1277 {
1278  assert(eqp != NULL);
1279  if (eqp->n_source_terms > 0)
1280  return true;
1281  else
1282  return false;
1283 }
1284 
1285 /*----------------------------------------------------------------------------*/
1294 /*----------------------------------------------------------------------------*/
1295 
1296 static inline bool
1297 cs_equation_param_has_internal_enforcement(const cs_equation_param_t *eqp)
1298 {
1299  assert(eqp != NULL);
1300  if (eqp->flag & CS_EQUATION_FORCE_VALUES)
1301  return true;
1302  else
1303  return false;
1304 }
1305 
1306 /*----------------------------------------------------------------------------*/
1315 /*----------------------------------------------------------------------------*/
1316 
1317 static inline bool
1318 cs_equation_param_has_implicit_advection(const cs_equation_param_t *eqp)
1319 {
1320  assert(eqp != NULL);
1321  if (eqp->flag & CS_EQUATION_CONVECTION) {
1324  return true;
1325  else
1326  return false;
1327  }
1328  else
1329  return false;
1330 }
1331 
1332 /*----------------------------------------------------------------------------*/
1341 /*----------------------------------------------------------------------------*/
1342 
1343 static inline bool
1344 cs_equation_param_has_user_hook(const cs_equation_param_t *eqp)
1345 {
1346  assert(eqp != NULL);
1347  if (eqp->flag & CS_EQUATION_USER_HOOK)
1348  return true;
1349  else
1350  return false;
1351 }
1352 
1353 /*----------------------------------------------------------------------------*/
1364 /*----------------------------------------------------------------------------*/
1365 
1366 static inline bool
1367 cs_equation_param_has_name(cs_equation_param_t *eqp,
1368  const char *name)
1369 {
1370  if (eqp == NULL)
1371  return false;
1372  if (eqp->name == NULL)
1373  return false;
1374  if (strcmp(eqp->name, name) == 0)
1375  return true;
1376  else
1377  return false;
1378 }
1379 
1380 /*============================================================================
1381  * Public function prototypes
1382  *============================================================================*/
1383 
1384 /*----------------------------------------------------------------------------*/
1395 /*----------------------------------------------------------------------------*/
1396 
1398 cs_equation_param_create(const char *name,
1399  cs_equation_type_t type,
1400  int dim,
1401  cs_param_bc_type_t default_bc);
1402 
1403 /*----------------------------------------------------------------------------*/
1416 /*----------------------------------------------------------------------------*/
1417 
1418 inline static cs_equation_param_t *
1419 cs_equation_create_param(const char *name,
1420  cs_equation_type_t type,
1421  int dim,
1422  cs_param_bc_type_t default_bc)
1423 {
1424  return cs_equation_param_create(name, type, dim, default_bc);
1425 }
1426 
1427 /*----------------------------------------------------------------------------*/
1436 /*----------------------------------------------------------------------------*/
1437 
1438 void
1440  cs_equation_param_t *dst,
1441  bool copy_fid);
1442 
1443 /*----------------------------------------------------------------------------*/
1454 /*----------------------------------------------------------------------------*/
1455 
1456 inline static void
1457 cs_equation_copy_param_from(const cs_equation_param_t *ref,
1458  cs_equation_param_t *dst,
1459  bool copy_fid)
1460 {
1461  cs_equation_param_copy_from(ref, dst, copy_fid);
1462 }
1463 
1464 /*----------------------------------------------------------------------------*/
1476 /*----------------------------------------------------------------------------*/
1477 
1478 void
1480 
1481 /*----------------------------------------------------------------------------*/
1495 /*----------------------------------------------------------------------------*/
1496 
1497 inline static void
1498 cs_equation_clear_param(cs_equation_param_t *eqp)
1499 {
1501 }
1502 
1503 /*----------------------------------------------------------------------------*/
1511 /*----------------------------------------------------------------------------*/
1512 
1515 
1516 /*----------------------------------------------------------------------------*/
1526 /*----------------------------------------------------------------------------*/
1527 
1528 inline static cs_equation_param_t *
1529 cs_equation_free_param(cs_equation_param_t *eqp)
1530 {
1531  return cs_equation_param_free(eqp);
1532 }
1533 
1534 /*----------------------------------------------------------------------------*/
1543 /*----------------------------------------------------------------------------*/
1544 
1545 void
1547  cs_equation_key_t key,
1548  const char *keyval);
1549 
1550 /*----------------------------------------------------------------------------*/
1561 /*----------------------------------------------------------------------------*/
1562 
1563 inline static void
1564 cs_equation_set_param(cs_equation_param_t *eqp,
1565  cs_equation_key_t key,
1566  const char *keyval)
1567 {
1568  cs_equation_param_set(eqp, key, keyval);
1569 }
1570 
1571 /*----------------------------------------------------------------------------*/
1579 /*----------------------------------------------------------------------------*/
1580 
1581 void
1583 
1584 /*----------------------------------------------------------------------------*/
1591 /*----------------------------------------------------------------------------*/
1592 
1593 void
1595 
1596 /*----------------------------------------------------------------------------*/
1602 /*----------------------------------------------------------------------------*/
1603 
1604 void
1606 
1607 /*----------------------------------------------------------------------------*/
1616 /*----------------------------------------------------------------------------*/
1617 
1618 bool
1620 
1621 /*----------------------------------------------------------------------------*/
1636 /*----------------------------------------------------------------------------*/
1637 
1638 cs_xdef_t *
1640  const char *z_name,
1641  cs_real_t *val);
1642 
1643 /*----------------------------------------------------------------------------*/
1659 /*----------------------------------------------------------------------------*/
1660 
1661 cs_xdef_t *
1663  const char *z_name,
1664  double quantity);
1665 
1666 /*----------------------------------------------------------------------------*/
1681 /*----------------------------------------------------------------------------*/
1682 
1683 cs_xdef_t *
1685  const char *z_name,
1686  cs_analytic_func_t *analytic,
1687  void *input);
1688 
1689 /*----------------------------------------------------------------------------*/
1698 /*----------------------------------------------------------------------------*/
1699 
1700 void
1702  cs_xdef_t *xdef);
1703 
1704 /*----------------------------------------------------------------------------*/
1717 /*----------------------------------------------------------------------------*/
1718 
1719 cs_xdef_t *
1721  const cs_param_bc_type_t bc_type,
1722  const char *z_name,
1723  cs_real_t *values);
1724 
1725 /*----------------------------------------------------------------------------*/
1742 /*----------------------------------------------------------------------------*/
1743 
1744 cs_xdef_t *
1746  const cs_param_bc_type_t bc_type,
1747  const char *z_name,
1748  cs_flag_t loc,
1749  cs_real_t *array,
1750  bool is_owner,
1751  cs_lnum_t *index);
1752 
1753 /*----------------------------------------------------------------------------*/
1766 /*----------------------------------------------------------------------------*/
1767 
1768 cs_xdef_t *
1770  const cs_param_bc_type_t bc_type,
1771  const char *z_name,
1772  cs_field_t *field);
1773 
1774 /*----------------------------------------------------------------------------*/
1789 /*----------------------------------------------------------------------------*/
1790 
1791 cs_xdef_t *
1793  const cs_param_bc_type_t bc_type,
1794  const char *z_name,
1795  cs_analytic_func_t *analytic,
1796  void *input);
1797 
1798 /*----------------------------------------------------------------------------*/
1814 /*----------------------------------------------------------------------------*/
1815 
1816 cs_xdef_t *
1818  const cs_param_bc_type_t bc_type,
1819  const char *z_name,
1820  cs_flag_t loc_flag,
1821  cs_dof_func_t *func,
1822  void *input);
1823 
1824 /*----------------------------------------------------------------------------*/
1835 /*----------------------------------------------------------------------------*/
1836 
1837 cs_xdef_t *
1839  const char *z_name);
1840 
1841 /*----------------------------------------------------------------------------*/
1853 /*----------------------------------------------------------------------------*/
1854 
1855 void
1857  const char *z_name);
1858 
1859 /*----------------------------------------------------------------------------*/
1868 /*----------------------------------------------------------------------------*/
1869 
1870 void
1872  const char *z_name);
1873 
1874 /*----------------------------------------------------------------------------*/
1884 /*----------------------------------------------------------------------------*/
1885 
1886 void
1888  cs_property_t *property);
1889 
1890 /*----------------------------------------------------------------------------*/
1899 /*----------------------------------------------------------------------------*/
1900 
1901 void
1903  cs_property_t *property,
1904  int inversion);
1905 
1906 /*----------------------------------------------------------------------------*/
1914 /*----------------------------------------------------------------------------*/
1915 
1916 void
1918  cs_property_t *property);
1919 
1920 /*----------------------------------------------------------------------------*/
1929 /*----------------------------------------------------------------------------*/
1930 
1931 void
1933  cs_property_t *property);
1934 
1935 /*----------------------------------------------------------------------------*/
1943 /*----------------------------------------------------------------------------*/
1944 
1945 void
1947  cs_adv_field_t *adv_field);
1948 
1949 /*----------------------------------------------------------------------------*/
1956 /*----------------------------------------------------------------------------*/
1957 
1958 void
1960  cs_property_t *property);
1961 
1962 /*----------------------------------------------------------------------------*/
1972 /*----------------------------------------------------------------------------*/
1973 
1974 int
1976  cs_property_t *property);
1977 
1978 /*----------------------------------------------------------------------------*/
1990 /*----------------------------------------------------------------------------*/
1991 
1992 cs_xdef_t *
1994  const char *z_name,
1995  cs_real_t *val);
1996 
1997 /*----------------------------------------------------------------------------*/
2010 /*----------------------------------------------------------------------------*/
2011 
2012 cs_xdef_t *
2014  const char *z_name,
2015  cs_analytic_func_t *func,
2016  void *input);
2017 
2018 /*----------------------------------------------------------------------------*/
2032 /*----------------------------------------------------------------------------*/
2033 
2034 cs_xdef_t *
2036  const char *z_name,
2037  cs_flag_t loc_flag,
2038  cs_dof_func_t *func,
2039  void *input);
2040 
2041 /*----------------------------------------------------------------------------*/
2057 /*----------------------------------------------------------------------------*/
2058 
2059 cs_xdef_t *
2061  const char *z_name,
2062  cs_flag_t loc,
2063  cs_real_t *array,
2064  bool is_owner,
2065  cs_lnum_t *index);
2066 
2067 /*----------------------------------------------------------------------------*/
2079 /*----------------------------------------------------------------------------*/
2080 
2081 cs_xdef_t *
2083  const char *z_name,
2084  double *val);
2085 
2086 /*----------------------------------------------------------------------------*/
2099 /*----------------------------------------------------------------------------*/
2100 
2101 cs_xdef_t *
2103  const char *z_name,
2104  double *quantity);
2105 
2106 /*----------------------------------------------------------------------------*/
2119 /*----------------------------------------------------------------------------*/
2120 
2121 cs_xdef_t *
2123  const char *z_name,
2124  cs_analytic_func_t *func,
2125  void *input);
2126 
2127 /*----------------------------------------------------------------------------*/
2146 /*----------------------------------------------------------------------------*/
2147 
2150  cs_lnum_t n_vertices,
2151  const cs_lnum_t vertex_ids[],
2152  const cs_real_t ref_value[],
2153  const cs_real_t vtx_values[]);
2154 
2155 /*----------------------------------------------------------------------------*/
2174 /*----------------------------------------------------------------------------*/
2175 
2178  cs_lnum_t n_edges,
2179  const cs_lnum_t edge_ids[],
2180  const cs_real_t ref_value[],
2181  const cs_real_t edge_values[]);
2182 
2183 /*----------------------------------------------------------------------------*/
2202 /*----------------------------------------------------------------------------*/
2203 
2206  cs_lnum_t n_faces,
2207  const cs_lnum_t face_ids[],
2208  const cs_real_t ref_value[],
2209  const cs_real_t face_values[]);
2210 
2211 /*----------------------------------------------------------------------------*/
2228 /*----------------------------------------------------------------------------*/
2229 
2232  cs_lnum_t n_cells,
2233  const cs_lnum_t elt_ids[],
2234  const cs_real_t ref_value[],
2235  const cs_real_t cell_values[]);
2236 
2237 /*----------------------------------------------------------------------------*/
2238 
2240 
2241 #endif /* __CS_EQUATION_PARAM_H__ */
cs_param_advection_strategy_t adv_strategy
Definition: cs_equation_param.h:645
Definition: cs_equation_param.h:1102
cs_hodge_param_t graddiv_hodgep
Definition: cs_equation_param.h:602
cs_adv_field_t * adv_field
Definition: cs_equation_param.h:648
cs_enforcement_param_t * cs_equation_add_face_dof_enforcement(cs_equation_param_t *eqp, cs_lnum_t n_faces, const cs_lnum_t face_ids[], const cs_real_t ref_value[], const cs_real_t face_values[])
Add an enforcement of the value of degrees of freedom located at the mesh faces. The spatial discreti...
Definition: cs_equation_param.c:3296
#define restrict
Definition: cs_defs.h:142
int imligr
Definition: cs_equation_param.h:452
Definition: cs_equation_param.h:1090
cs_real_t theta
Definition: cs_equation_param.h:556
Definition: cs_equation_param.h:1107
cs_xdef_t * cs_equation_add_volume_mass_injection_by_qov(cs_equation_param_t *eqp, const char *z_name, double *quantity)
Add a new volume mass injection definition source term by initializing a cs_xdef_t structure...
Definition: cs_equation_param.c:3045
int iwgrec
Definition: cs_equation_param.h:454
Definition: cs_advection_field.h:149
cs_flag_t flag
Definition: cs_equation_param.h:206
int ndircl
Definition: cs_equation_param.h:440
Definition: cs_equation_param.h:1110
cs_flag_t process_flag
Definition: cs_equation_param.h:213
Field descriptor.
Definition: cs_field.h:125
int imvisf
Definition: cs_equation_param.h:450
cs_xdef_t ** ic_defs
Definition: cs_equation_param.h:521
cs_param_advection_form_t adv_formulation
Definition: cs_equation_param.h:643
int verbosity
Definition: cs_equation_param.h:197
cs_param_assemble_omp_strategy_t
Definition: cs_param_cdo.h:92
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources...
Definition: cs_equation_param.h:177
Definition: cs_equation_param.h:1092
Definition: cs_equation_param.h:1088
cs_xdef_t * cs_equation_add_bc_by_dof_func(cs_equation_param_t *eqp, const cs_param_bc_type_t bc_type, const char *z_name, cs_flag_t loc_flag, cs_dof_func_t *func, void *input)
Define and initialize a new structure to set a boundary condition related to the given cs_equation_pa...
Definition: cs_equation_param.c:2373
cs_equation_type_t type
Definition: cs_equation_param.h:185
void cs_equation_param_set(cs_equation_param_t *eqp, cs_equation_key_t key, const char *keyval)
Set a parameter attached to a keyname in a cs_equation_param_t structure.
Definition: cs_equation_param.c:1514
Definition: cs_equation_param.h:1120
#define CS_EQUATION_CURLCURL
The term related to the curl-curl operator is needed.
Definition: cs_equation_param.h:90
cs_xdef_t * cs_equation_add_ic_by_value(cs_equation_param_t *eqp, const char *z_name, cs_real_t *val)
Define the initial condition for the unknown related to this equation This definition can be done on ...
Definition: cs_equation_param.c:1916
cs_param_dof_reduction_t dof_reduction
Definition: cs_equation_param.h:218
Definition: cs_equation_param.h:163
cs_param_bc_enforce_t
Definition: cs_param_types.h:483
cs_param_space_scheme_t space_scheme
Definition: cs_equation_param.h:217
#define BEGIN_C_DECLS
Definition: cs_defs.h:510
void cs_equation_param_copy_from(const cs_equation_param_t *ref, cs_equation_param_t *dst, bool copy_fid)
Copy the settings from one cs_equation_param_t structure to another one. The name is not copied...
Definition: cs_equation_param.c:1234
cs_real_t upwind_portion
Definition: cs_equation_param.h:647
Definition: cs_equation_param.h:1112
double epsilo
Definition: cs_equation_param.h:459
double epsrgr
Definition: cs_equation_param.h:461
int istat
Definition: cs_equation_param.h:438
int space_poly_degree
Definition: cs_equation_param.h:224
cs_property_t ** reaction_properties
Definition: cs_equation_param.h:672
cs_xdef_t ** volume_mass_injections
Definition: cs_equation_param.h:709
cs_xdef_t * cs_equation_add_bc_by_field(cs_equation_param_t *eqp, const cs_param_bc_type_t bc_type, const char *z_name, cs_field_t *field)
Define and initialize a new structure to set a boundary condition related to the given equation struc...
Definition: cs_equation_param.c:2224
void cs_equation_add_curlcurl(cs_equation_param_t *eqp, cs_property_t *property, int inversion)
Associate a new term related to the curl-curl operator for the equation associated to the given cs_eq...
Definition: cs_equation_param.c:2598
cs_param_advection_extrapol_t adv_extrapol
Definition: cs_equation_param.h:646
Definition: cs_equation_param.h:1099
int imrgra
Definition: cs_equation_param.h:451
cs_real_t strong_pena_bc_coeff
Definition: cs_equation_param.h:505
Definition: cs_equation_param.h:1097
cs_property_t * curlcurl_property
Definition: cs_equation_param.h:587
cs_xdef_t * cs_equation_add_bc_by_value(cs_equation_param_t *eqp, const cs_param_bc_type_t bc_type, const char *z_name, cs_real_t *values)
Define and initialize a new structure to set a boundary condition related to the given equation struc...
Definition: cs_equation_param.c:2085
Definition: field.f90:27
Definition: cs_equation_param.h:1095
cs_xdef_t * cs_equation_add_source_term_by_val(cs_equation_param_t *eqp, const char *z_name, cs_real_t *val)
Add a new source term by initializing a cs_xdef_t structure. Case of a definition by a constant value...
Definition: cs_equation_param.c:2768
int n_enforcements
Definition: cs_equation_param.h:729
cs_enforcement_param_t * cs_equation_add_cell_enforcement(cs_equation_param_t *eqp, cs_lnum_t n_cells, const cs_lnum_t elt_ids[], const cs_real_t ref_value[], const cs_real_t cell_values[])
Add an enforcement of the value related to the degrees of freedom associated to the list of selected ...
Definition: cs_equation_param.c:3365
cs_param_time_scheme_t time_scheme
Definition: cs_equation_param.h:555
cs_param_advection_strategy_t
Choice of how to handle the advection term in an equation.
Definition: cs_param_types.h:352
#define CS_EQUATION_USER_HOOK
Activate a user hook to get a fine control of the discretization process during the cellwise building...
Definition: cs_equation_param.h:94
Definition: cs_equation_param.h:1103
Structure and routines handling the SLES settings stored inside a cs_param_sles_t structure...
cs_equation_param_t * cs_equation_param_create(const char *name, cs_equation_type_t type, int dim, cs_param_bc_type_t default_bc)
Create a cs_equation_param_t structure.
Definition: cs_equation_param.c:1047
cs_xdef_t * cs_equation_add_bc_by_array(cs_equation_param_t *eqp, const cs_param_bc_type_t bc_type, const char *z_name, cs_flag_t loc, cs_real_t *array, bool is_owner, cs_lnum_t *index)
Define and initialize a new structure to set a boundary condition related to the given equation struc...
Definition: cs_equation_param.c:2146
double cs_real_t
Floating-point value.
Definition: cs_defs.h:322
#define CS_EQUATION_UNSTEADY
Unsteady term is needed.
Definition: cs_equation_param.h:87
Definition: cs_equation_param.h:1115
cs_property_t * time_property
Definition: cs_equation_param.h:554
Definition: cs_equation_param.h:1091
cs_real_t weak_pena_bc_coeff
Definition: cs_equation_param.h:506
void cs_equation_param_set_sles(cs_equation_param_t *eqp)
Set parameters for initializing SLES structures used for the resolution of the linear system...
Definition: cs_equation_param.c:1550
cs_param_advection_extrapol_t
Choice of how to extrapolate the advection field in the advection term.
Definition: cs_param_types.h:386
Definition: cs_equation_param.h:1117
void() cs_dof_func_t(cs_lnum_t n_elts, const cs_lnum_t *elt_ids, bool dense_output, void *input, cs_real_t *retval)
Generic function pointer for computing a quantity at predefined locations such as degrees of freedom ...
Definition: cs_param_types.h:127
void cs_equation_add_sliding_condition(cs_equation_param_t *eqp, const char *z_name)
Define and initialize a new structure to set a sliding boundary condition related to the given equati...
Definition: cs_equation_param.c:2531
Definition: cs_equation_param.h:162
void cs_equation_param_clear(cs_equation_param_t *eqp)
Free the contents of a cs_equation_param_t.
Definition: cs_equation_param.c:1406
Definition: cs_equation_param.h:1118
Definition: cs_equation_param.h:160
void cs_equation_remove_bc(cs_equation_param_t *eqp, const char *z_name)
Remove boundary condition from the given equation param structure for a given zone.
Definition: cs_equation_param.c:2487
cs_param_space_scheme_t
Type of numerical scheme for the discretization in space.
Definition: cs_param_types.h:180
cs_equation_param_t * cs_equation_param_free(cs_equation_param_t *eqp)
Free a cs_equation_param_t.
Definition: cs_equation_param.c:1490
cs_enforcement_param_t ** enforcement_params
Definition: cs_equation_param.h:730
bool cs_equation_param_has_robin_bc(const cs_equation_param_t *eqp)
Ask if the parameter settings of the equation has requested the treatment of Robin boundary condition...
Definition: cs_equation_param.c:1885
cs_xdef_t ** source_terms
Definition: cs_equation_param.h:689
int icoupl
Definition: cs_equation_param.h:455
int n_volume_mass_injections
Definition: cs_equation_param.h:708
#define CS_EQUATION_CONVECTION
Convection term is needed.
Definition: cs_equation_param.h:88
Definition: cs_equation_param.h:1116
int iconv
Definition: cs_equation_param.h:437
void() cs_analytic_func_t(cs_real_t time, cs_lnum_t n_elts, const cs_lnum_t *elt_ids, const cs_real_t *coords, bool dense_output, void *input, cs_real_t *retval)
Generic function pointer for an evaluation relying on an analytic function.
Definition: cs_param_types.h:100
Definition: cs_equation_param.h:1094
double climgr
Definition: cs_equation_param.h:462
double thetav
Definition: cs_equation_param.h:456
int cs_equation_add_reaction(cs_equation_param_t *eqp, cs_property_t *property)
Associate a new term related to the reaction operator for the equation associated to the given cs_equ...
Definition: cs_equation_param.c:2730
Definition: cs_equation_param.h:1100
double blend_st
Definition: cs_equation_param.h:458
cs_xdef_t * cs_equation_add_source_term_by_dof_func(cs_equation_param_t *eqp, const char *z_name, cs_flag_t loc_flag, cs_dof_func_t *func, void *input)
Add a new source term by initializing a cs_xdef_t structure. Case of a definition by a DoF function...
Definition: cs_equation_param.c:2874
cs_param_assemble_omp_strategy_t omp_assembly_choice
Definition: cs_equation_param.h:755
Definition: cs_equation_param.h:1105
int dim
Definition: cs_equation_param.h:186
Definition: cs_equation_param.h:1113
Definition: cs_equation_param.h:1089
Definition: cs_equation_param.h:1096
int ircflu
Definition: cs_equation_param.h:453
cs_xdef_t * cs_equation_add_bc_by_analytic(cs_equation_param_t *eqp, const cs_param_bc_type_t bc_type, const char *z_name, cs_analytic_func_t *analytic, void *input)
Define and initialize a new structure to set a boundary condition related to the given equation param...
Definition: cs_equation_param.c:2293
cs_property_t * diffusion_property
Definition: cs_equation_param.h:571
Definition: cs_equation_param.h:1106
double blencv
Definition: cs_equation_param.h:457
int idften
Definition: cs_equation_param.h:443
Definition: cs_equation_param.h:1093
char *restrict name
Definition: cs_equation_param.h:184
cs_property_t * adv_scaling_property
Definition: cs_equation_param.h:649
Definition: cs_equation_param.h:1101
Definition: cs_equation_param.h:1108
cs_xdef_t * cs_equation_add_source_term_by_array(cs_equation_param_t *eqp, const char *z_name, cs_flag_t loc, cs_real_t *array, bool is_owner, cs_lnum_t *index)
Add a new source term by initializing a cs_xdef_t structure. Case of a definition by an array...
Definition: cs_equation_param.c:2935
void cs_equation_add_xdef_bc(cs_equation_param_t *eqp, cs_xdef_t *xdef)
Set a boundary condition from an existing cs_xdef_t structure The lifecycle of the cs_xdef_t structur...
Definition: cs_equation_param.c:2057
int n_ic_defs
Definition: cs_equation_param.h:520
Definition: cs_equation_param.h:159
cs_xdef_t * cs_equation_add_ic_by_qov(cs_equation_param_t *eqp, const char *z_name, double quantity)
Define the initial condition for the unknown related to this equation This definition can be done on ...
Definition: cs_equation_param.c:1964
Structure storing medata for defining a quantity in a very flexible way.
Definition: cs_xdef.h:154
int ischcv
Definition: cs_equation_param.h:445
#define CS_EQUATION_GRADDIV
The term related to the grad-div operator is needed.
Definition: cs_equation_param.h:91
int n_source_terms
Definition: cs_equation_param.h:688
#define CS_EQUATION_FORCE_VALUES
Add an algebraic manipulation to set the value of a given set of interior degrees of freedom...
Definition: cs_equation_param.h:93
int nswrgr
Definition: cs_equation_param.h:448
cs_property_t * graddiv_property
Definition: cs_equation_param.h:603
cs_hodge_param_t curlcurl_hodgep
Definition: cs_equation_param.h:586
int iwarni
Definition: cs_equation_param.h:198
cs_equation_key_t
List of available keys for setting the parameters of an equation.
Definition: cs_equation_param.h:1086
Definition: cs_equation_param.h:158
int idircl
Definition: cs_equation_param.h:439
cs_equation_type_t
Type of equations managed by the solver.
Definition: cs_equation_param.h:156
cs_param_sles_t * sles_param
Definition: cs_equation_param.h:744
void cs_equation_add_time(cs_equation_param_t *eqp, cs_property_t *property)
Associate a new term related to the time derivative operator for the equation associated to the given...
Definition: cs_equation_param.c:2655
int isstpc
Definition: cs_equation_param.h:447
void cs_equation_add_advection(cs_equation_param_t *eqp, cs_adv_field_t *adv_field)
Associate a new term related to the advection operator for the equation associated to the given cs_eq...
Definition: cs_equation_param.c:2680
int nswrsm
Definition: cs_equation_param.h:449
Definition: cs_equation_param.h:164
cs_param_bc_enforce_t default_enforcement
Definition: cs_equation_param.h:504
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:316
int n_reaction_terms
Definition: cs_equation_param.h:671
cs_param_advection_scheme_t adv_scheme
Definition: cs_equation_param.h:644
int iswdyn
Definition: cs_equation_param.h:444
int n_bc_defs
Definition: cs_equation_param.h:501
int ibdtso
Definition: cs_equation_param.h:446
Definition: cs_equation_param.h:166
#define END_C_DECLS
Definition: cs_defs.h:511
cs_xdef_t * cs_equation_add_source_term_by_analytic(cs_equation_param_t *eqp, const char *z_name, cs_analytic_func_t *func, void *input)
Add a new source term by initializing a cs_xdef_t structure. Case of a definition by an analytical fu...
Definition: cs_equation_param.c:2817
unsigned short int cs_flag_t
Definition: cs_defs.h:324
cs_param_dof_reduction_t
Definition: cs_param_types.h:207
cs_param_bc_type_t
Definition: cs_param_types.h:439
double relaxv
Definition: cs_equation_param.h:463
int idifft
Definition: cs_equation_param.h:442
cs_xdef_t * cs_equation_add_ic_by_analytic(cs_equation_param_t *eqp, const char *z_name, cs_analytic_func_t *analytic, void *input)
Define the initial condition for the unknown related to this equation. This definition can be done on...
Definition: cs_equation_param.c:2011
Definition: cs_param_types.h:354
cs_xdef_t * cs_equation_add_volume_mass_injection_by_analytic(cs_equation_param_t *eqp, const char *z_name, cs_analytic_func_t *func, void *input)
Add a new volume mass injection definition source term by initializing a cs_xdef_t structure...
Definition: cs_equation_param.c:3093
void cs_equation_param_log(const cs_equation_param_t *eqp)
Print the detail of a cs_equation_param_t structure.
Definition: cs_equation_param.c:1605
bool do_lumping
Definition: cs_equation_param.h:535
cs_param_bc_type_t default_bc
Definition: cs_equation_param.h:500
cs_hodge_param_t reaction_hodgep
Definition: cs_equation_param.h:670
cs_xdef_t ** bc_defs
Definition: cs_equation_param.h:502
cs_param_advection_scheme_t
Definition: cs_param_types.h:319
Definition: cs_equation_param.h:1104
cs_xdef_t * cs_equation_find_bc(cs_equation_param_t *eqp, const char *z_name)
Return pointer to existing boundary condition definition structure for the given equation param struc...
Definition: cs_equation_param.c:2450
Definition: cs_equation_param.h:1114
Definition: cs_equation_param.h:1098
#define CS_EQUATION_REACTION
Reaction term is needed.
Definition: cs_equation_param.h:92
cs_enforcement_param_t * cs_equation_add_vertex_dof_enforcement(cs_equation_param_t *eqp, cs_lnum_t n_vertices, const cs_lnum_t vertex_ids[], const cs_real_t ref_value[], const cs_real_t vtx_values[])
Add an enforcement of the value of degrees of freedom located at the mesh vertices. The spatial discretization scheme for the given equation has to be CDO vertex-based or CDO vertex+cell-based schemes.
Definition: cs_equation_param.c:3152
cs_hodge_param_t diffusion_hodgep
Definition: cs_equation_param.h:570
void cs_equation_add_advection_scaling_property(cs_equation_param_t *eqp, cs_property_t *property)
Associate a scaling property to the advection.
Definition: cs_equation_param.c:2704
#define CS_EQUATION_DIFFUSION
Diffusion term is needed. A scalar-/vector-valued Laplacian with div .grad.
Definition: cs_equation_param.h:89
Definition: cs_param_types.h:355
int idiff
Definition: cs_equation_param.h:441
cs_enforcement_param_t * cs_equation_add_edge_dof_enforcement(cs_equation_param_t *eqp, cs_lnum_t n_edges, const cs_lnum_t edge_ids[], const cs_real_t ref_value[], const cs_real_t edge_values[])
Add an enforcement of the value of degrees of freedom located at the mesh edges. The spatial discreti...
Definition: cs_equation_param.c:3223
cs_param_time_scheme_t
Definition: cs_param_types.h:242
Definition: cs_equation_param.h:1109
Definition: cs_equation_param.h:1111
cs_param_advection_form_t
Definition: cs_param_types.h:275
Structure associated to the definition of a property relying on the cs_xdef_t structure.
void cs_equation_param_last_stage(cs_equation_param_t *eqp)
Last modification of the cs_equation_param_t structure before launching the computation.
Definition: cs_equation_param.c:1573
cs_hodge_param_t time_hodgep
Definition: cs_equation_param.h:553
Structure storing all metadata/parameters related to the usage of a discrete Hodge operator...
Definition: cs_hodge.h:154
cs_xdef_t * cs_equation_add_volume_mass_injection_by_value(cs_equation_param_t *eqp, const char *z_name, double *val)
Add a new volume mass injection definition source term by initializing a cs_xdef_t structure...
Definition: cs_equation_param.c:2997
Structure storing all metadata related to the resolution of a linear system with an iterative solver...
Definition: cs_param_sles.h:62
Set of data defining an enforcement.
Definition: cs_enforcement.h:89
void cs_equation_add_diffusion(cs_equation_param_t *eqp, cs_property_t *property)
Associate a new term related to the Laplacian operator for the equation associated to the given cs_eq...
Definition: cs_equation_param.c:2572
double epsrsm
Definition: cs_equation_param.h:460
void cs_equation_add_graddiv(cs_equation_param_t *eqp, cs_property_t *property)
Associate a new term related to the grad-div operator for the equation associated to the given cs_equ...
Definition: cs_equation_param.c:2629
Definition: cs_equation_param.h:161