7.2
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-2022 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_iter_algo.h"
37 #include "cs_param_cdo.h"
38 #include "cs_param_sles.h"
39 #include "cs_property.h"
40 #include "cs_xdef.h"
41 
42 /*----------------------------------------------------------------------------*/
43 
45 
46 /*============================================================================
47  * Macro definitions
48  *============================================================================*/
49 
94 #define CS_EQUATION_LOCKED (1 << 0) /* 1 */
95 #define CS_EQUATION_UNSTEADY (1 << 1) /* 2 */
96 #define CS_EQUATION_CONVECTION (1 << 2) /* 4 */
97 #define CS_EQUATION_DIFFUSION (1 << 3) /* 8 */
98 #define CS_EQUATION_CURLCURL (1 << 4) /* 16 */
99 #define CS_EQUATION_GRADDIV (1 << 5) /* 32 */
100 #define CS_EQUATION_REACTION (1 << 6) /* 64 */
101 #define CS_EQUATION_FORCE_VALUES (1 << 7) /* 128 */
102 #define CS_EQUATION_INSIDE_SYSTEM (1 << 8) /* 256 */
103 #define CS_EQUATION_BUILD_HOOK (1 << 9) /* 512 */
104 #define CS_EQUATION_USER_TRIGGERED (1 << 10) /* 1024 */
105 
106 
126 #define CS_EQUATION_POST_BALANCE (1 << 0) /* 1 */
127 #define CS_EQUATION_POST_PECLET (1 << 1) /* 2 */
128 #define CS_EQUATION_POST_UPWIND_COEF (1 << 2) /* 4 */
129 #define CS_EQUATION_POST_NORMAL_FLUX (1 << 3) /* 8 */
130 
133 /*============================================================================
134  * Type definitions
135  *============================================================================*/
136 
165 typedef enum {
166 
174 
176 
178 
179 /*----------------------------------------------------------------------------*/
180 
186 typedef struct {
187 
193  char *restrict name;
195  int dim;
205  union {
207  int iwarni;
208  };
209 
216 
223 
224  /* Numerical settings */
225 
234 
446  int iconv;
447  int istat;
448  int idircl;
449  int ndircl;
450  int idiff;
451  int idifft;
452  int idften;
453  int iswdyn;
454  int ischcv;
455  int ibdtso;
456  int isstpc;
457  int nswrgr;
458  int nswrsm;
459  int imvisf;
460  int imrgra;
461  int imligr;
462  int ircflu;
463  int iwgrec;
464  int icoupl;
465  double thetav; /* TODO: merge with theta */
466  double blencv;
467  double blend_st;
468  double epsilo;
469  double epsrsm;
470  double epsrgr;
471  double climgr;
472  double relaxv;
473 
512 
516 
531 
545 
566 
581 
597 
613 
659 
682 
699 
719 
740 
769 
774 
785 
789 
790 /*----------------------------------------------------------------------------*/
791 
1115 typedef enum {
1116 
1148 
1150 
1152 
1153 /*============================================================================
1154  * Static inline public function prototypes
1155  *============================================================================*/
1156 
1157 /*----------------------------------------------------------------------------*/
1164 /*----------------------------------------------------------------------------*/
1165 
1166 static inline void
1168  cs_flag_t flag)
1169 {
1170  assert(eqp != NULL);
1171  eqp->flag |= flag;
1172 }
1173 
1174 /*----------------------------------------------------------------------------*/
1182 /*----------------------------------------------------------------------------*/
1183 
1184 static inline bool
1186 {
1187  assert(eqp != NULL);
1188  if (eqp->flag & CS_EQUATION_DIFFUSION)
1189  return true;
1190  else
1191  return false;
1192 }
1193 
1194 /*----------------------------------------------------------------------------*/
1202 /*----------------------------------------------------------------------------*/
1203 
1204 static inline bool
1206 {
1207  assert(eqp != NULL);
1208  if (eqp->flag & CS_EQUATION_CURLCURL)
1209  return true;
1210  else
1211  return false;
1212 }
1213 
1214 /*----------------------------------------------------------------------------*/
1222 /*----------------------------------------------------------------------------*/
1223 
1224 static inline bool
1226 {
1227  assert(eqp != NULL);
1228  if (eqp->flag & CS_EQUATION_GRADDIV)
1229  return true;
1230  else
1231  return false;
1232 }
1233 
1234 /*----------------------------------------------------------------------------*/
1242 /*----------------------------------------------------------------------------*/
1243 
1244 static inline bool
1246 {
1247  assert(eqp != NULL);
1248  if (eqp->flag & CS_EQUATION_CONVECTION)
1249  return true;
1250  else
1251  return false;
1252 }
1253 
1254 /*----------------------------------------------------------------------------*/
1262 /*----------------------------------------------------------------------------*/
1263 
1264 static inline bool
1266 {
1267  assert(eqp != NULL);
1268  if (eqp->flag & CS_EQUATION_REACTION)
1269  return true;
1270  else
1271  return false;
1272 }
1273 
1274 /*----------------------------------------------------------------------------*/
1282 /*----------------------------------------------------------------------------*/
1283 
1284 static inline bool
1286 {
1287  assert(eqp != NULL);
1288  if (eqp->flag & CS_EQUATION_UNSTEADY)
1289  return true;
1290  else
1291  return false;
1292 }
1293 
1294 /*----------------------------------------------------------------------------*/
1302 /*----------------------------------------------------------------------------*/
1303 
1304 static inline bool
1306 {
1307  assert(eqp != NULL);
1308  if (eqp->n_source_terms > 0)
1309  return true;
1310  else
1311  return false;
1312 }
1313 
1314 /*----------------------------------------------------------------------------*/
1323 /*----------------------------------------------------------------------------*/
1324 
1325 static inline bool
1327 {
1328  assert(eqp != NULL);
1329  if (eqp->flag & CS_EQUATION_FORCE_VALUES)
1330  return true;
1331  else
1332  return false;
1333 }
1334 
1335 /*----------------------------------------------------------------------------*/
1344 /*----------------------------------------------------------------------------*/
1345 
1346 static inline bool
1348 {
1349  assert(eqp != NULL);
1350  if (eqp->flag & CS_EQUATION_CONVECTION) {
1353  return true;
1354  else
1355  return false;
1356  }
1357  else
1358  return false;
1359 }
1360 
1361 /*----------------------------------------------------------------------------*/
1370 /*----------------------------------------------------------------------------*/
1371 
1372 static inline bool
1374 {
1375  assert(eqp != NULL);
1376  if (eqp->flag & CS_EQUATION_BUILD_HOOK)
1377  return true;
1378  else
1379  return false;
1380 }
1381 
1382 /*----------------------------------------------------------------------------*/
1393 /*----------------------------------------------------------------------------*/
1394 
1395 static inline bool
1397  const char *name)
1398 {
1399  if (eqp == NULL)
1400  return false;
1401  if (eqp->name == NULL)
1402  return false;
1403  if (strcmp(eqp->name, name) == 0)
1404  return true;
1405  else
1406  return false;
1407 }
1408 
1409 /*============================================================================
1410  * Public function prototypes
1411  *============================================================================*/
1412 
1413 /*----------------------------------------------------------------------------*/
1424 /*----------------------------------------------------------------------------*/
1425 
1427 cs_equation_param_create(const char *name,
1428  cs_equation_type_t type,
1429  int dim,
1430  cs_param_bc_type_t default_bc);
1431 
1432 /*----------------------------------------------------------------------------*/
1445 /*----------------------------------------------------------------------------*/
1446 
1447 inline static cs_equation_param_t *
1448 cs_equation_create_param(const char *name,
1449  cs_equation_type_t type,
1450  int dim,
1451  cs_param_bc_type_t default_bc)
1452 {
1453  return cs_equation_param_create(name, type, dim, default_bc);
1454 }
1455 
1456 /*----------------------------------------------------------------------------*/
1465 /*----------------------------------------------------------------------------*/
1466 
1467 void
1469  cs_equation_param_t *dst,
1470  bool copy_fid);
1471 
1472 /*----------------------------------------------------------------------------*/
1481 /*----------------------------------------------------------------------------*/
1482 
1483 void
1485  cs_equation_param_t *dst);
1486 
1487 /*----------------------------------------------------------------------------*/
1498 /*----------------------------------------------------------------------------*/
1499 
1500 inline static void
1502  cs_equation_param_t *dst,
1503  bool copy_fid)
1504 {
1505  cs_equation_param_copy_from(ref, dst, copy_fid);
1506 }
1507 
1508 /*----------------------------------------------------------------------------*/
1520 /*----------------------------------------------------------------------------*/
1521 
1522 void
1524 
1525 /*----------------------------------------------------------------------------*/
1539 /*----------------------------------------------------------------------------*/
1540 
1541 inline static void
1543 {
1545 }
1546 
1547 /*----------------------------------------------------------------------------*/
1555 /*----------------------------------------------------------------------------*/
1556 
1559 
1560 /*----------------------------------------------------------------------------*/
1570 /*----------------------------------------------------------------------------*/
1571 
1572 inline static cs_equation_param_t *
1574 {
1575  return cs_equation_param_free(eqp);
1576 }
1577 
1578 /*----------------------------------------------------------------------------*/
1587 /*----------------------------------------------------------------------------*/
1588 
1589 void
1591  cs_equation_key_t key,
1592  const char *keyval);
1593 
1594 /*----------------------------------------------------------------------------*/
1605 /*----------------------------------------------------------------------------*/
1606 
1607 inline static void
1609  cs_equation_key_t key,
1610  const char *keyval)
1611 {
1612  cs_equation_param_set(eqp, key, keyval);
1613 }
1614 
1615 /*----------------------------------------------------------------------------*/
1623 /*----------------------------------------------------------------------------*/
1624 
1625 void
1627 
1628 /*----------------------------------------------------------------------------*/
1635 /*----------------------------------------------------------------------------*/
1636 
1637 void
1639 
1640 /*----------------------------------------------------------------------------*/
1646 /*----------------------------------------------------------------------------*/
1647 
1648 void
1650 
1651 /*----------------------------------------------------------------------------*/
1660 /*----------------------------------------------------------------------------*/
1661 
1662 bool
1664 
1665 /*----------------------------------------------------------------------------*/
1680 /*----------------------------------------------------------------------------*/
1681 
1682 cs_xdef_t *
1684  const char *z_name,
1685  cs_real_t *val);
1686 
1687 /*----------------------------------------------------------------------------*/
1703 /*----------------------------------------------------------------------------*/
1704 
1705 cs_xdef_t *
1707  const char *z_name,
1708  double quantity);
1709 
1710 /*----------------------------------------------------------------------------*/
1726 /*----------------------------------------------------------------------------*/
1727 
1728 cs_xdef_t *
1730  const char *z_name,
1731  cs_analytic_func_t *analytic,
1732  void *input);
1733 
1734 /*----------------------------------------------------------------------------*/
1750 /*----------------------------------------------------------------------------*/
1751 
1752 cs_xdef_t *
1754  const char *z_name,
1755  cs_flag_t loc_flag,
1756  cs_dof_func_t *func,
1757  void *input);
1758 
1759 /*----------------------------------------------------------------------------*/
1768 /*----------------------------------------------------------------------------*/
1769 
1770 void
1772  cs_xdef_t *xdef);
1773 
1774 /*----------------------------------------------------------------------------*/
1787 /*----------------------------------------------------------------------------*/
1788 
1789 cs_xdef_t *
1791  const cs_param_bc_type_t bc_type,
1792  const char *z_name,
1793  cs_real_t *values);
1794 
1795 /*----------------------------------------------------------------------------*/
1813 /*----------------------------------------------------------------------------*/
1814 
1815 cs_xdef_t *
1817  const cs_param_bc_type_t bc_type,
1818  const char *z_name,
1819  cs_flag_t loc,
1820  cs_real_t *array,
1821  bool is_owner,
1822  const cs_lnum_t *index,
1823  const cs_lnum_t *ids);
1824 
1825 /*----------------------------------------------------------------------------*/
1838 /*----------------------------------------------------------------------------*/
1839 
1840 cs_xdef_t *
1842  const cs_param_bc_type_t bc_type,
1843  const char *z_name,
1844  cs_field_t *field);
1845 
1846 /*----------------------------------------------------------------------------*/
1861 /*----------------------------------------------------------------------------*/
1862 
1863 cs_xdef_t *
1865  const cs_param_bc_type_t bc_type,
1866  const char *z_name,
1867  cs_analytic_func_t *analytic,
1868  void *input);
1869 
1870 /*----------------------------------------------------------------------------*/
1886 /*----------------------------------------------------------------------------*/
1887 
1888 cs_xdef_t *
1890  const cs_param_bc_type_t bc_type,
1891  const char *z_name,
1892  cs_flag_t loc_flag,
1893  cs_dof_func_t *func,
1894  void *input);
1895 
1896 /*----------------------------------------------------------------------------*/
1907 /*----------------------------------------------------------------------------*/
1908 
1909 cs_xdef_t *
1911  const char *z_name);
1912 
1913 /*----------------------------------------------------------------------------*/
1925 /*----------------------------------------------------------------------------*/
1926 
1927 void
1929  const char *z_name);
1930 
1931 /*----------------------------------------------------------------------------*/
1940 /*----------------------------------------------------------------------------*/
1941 
1942 void
1944  const char *z_name);
1945 
1946 /*----------------------------------------------------------------------------*/
1956 /*----------------------------------------------------------------------------*/
1957 
1958 void
1960  cs_property_t *property);
1961 
1962 /*----------------------------------------------------------------------------*/
1971 /*----------------------------------------------------------------------------*/
1972 
1973 void
1975  cs_property_t *property,
1976  int inversion);
1977 
1978 /*----------------------------------------------------------------------------*/
1986 /*----------------------------------------------------------------------------*/
1987 
1988 void
1990  cs_property_t *property);
1991 
1992 /*----------------------------------------------------------------------------*/
2001 /*----------------------------------------------------------------------------*/
2002 
2003 void
2005  cs_property_t *property);
2006 
2007 /*----------------------------------------------------------------------------*/
2015 /*----------------------------------------------------------------------------*/
2016 
2017 void
2019  cs_adv_field_t *adv_field);
2020 
2021 /*----------------------------------------------------------------------------*/
2028 /*----------------------------------------------------------------------------*/
2029 
2030 void
2032  cs_property_t *property);
2033 
2034 /*----------------------------------------------------------------------------*/
2044 /*----------------------------------------------------------------------------*/
2045 
2046 int
2048  cs_property_t *property);
2049 
2050 /*----------------------------------------------------------------------------*/
2062 /*----------------------------------------------------------------------------*/
2063 
2064 cs_xdef_t *
2066  const char *z_name,
2067  cs_real_t *val);
2068 
2069 /*----------------------------------------------------------------------------*/
2082 /*----------------------------------------------------------------------------*/
2083 
2084 cs_xdef_t *
2086  const char *z_name,
2087  cs_analytic_func_t *func,
2088  void *input);
2089 
2090 /*----------------------------------------------------------------------------*/
2104 /*----------------------------------------------------------------------------*/
2105 
2106 cs_xdef_t *
2108  const char *z_name,
2109  cs_flag_t loc_flag,
2110  cs_dof_func_t *func,
2111  void *input);
2112 
2113 /*----------------------------------------------------------------------------*/
2130 /*----------------------------------------------------------------------------*/
2131 
2132 cs_xdef_t *
2134  const char *z_name,
2135  cs_flag_t loc,
2136  cs_real_t *array,
2137  bool is_owner,
2138  const cs_lnum_t *index,
2139  const cs_lnum_t *ids);
2140 
2141 /*----------------------------------------------------------------------------*/
2153 /*----------------------------------------------------------------------------*/
2154 
2155 cs_xdef_t *
2157  const char *z_name,
2158  double *val);
2159 
2160 /*----------------------------------------------------------------------------*/
2173 /*----------------------------------------------------------------------------*/
2174 
2175 cs_xdef_t *
2177  const char *z_name,
2178  double *quantity);
2179 
2180 /*----------------------------------------------------------------------------*/
2193 /*----------------------------------------------------------------------------*/
2194 
2195 cs_xdef_t *
2197  const char *z_name,
2198  cs_analytic_func_t *func,
2199  void *input);
2200 
2201 /*----------------------------------------------------------------------------*/
2215 /*----------------------------------------------------------------------------*/
2216 
2217 cs_xdef_t *
2219  const char *z_name,
2220  cs_flag_t loc_flag,
2221  cs_dof_func_t *func,
2222  void *input);
2223 
2224 /*----------------------------------------------------------------------------*/
2243 /*----------------------------------------------------------------------------*/
2244 
2247  cs_lnum_t n_vertices,
2248  const cs_lnum_t vertex_ids[],
2249  const cs_real_t ref_value[],
2250  const cs_real_t vtx_values[]);
2251 
2252 /*----------------------------------------------------------------------------*/
2271 /*----------------------------------------------------------------------------*/
2272 
2275  cs_lnum_t n_edges,
2276  const cs_lnum_t edge_ids[],
2277  const cs_real_t ref_value[],
2278  const cs_real_t edge_values[]);
2279 
2280 /*----------------------------------------------------------------------------*/
2299 /*----------------------------------------------------------------------------*/
2300 
2303  cs_lnum_t n_faces,
2304  const cs_lnum_t face_ids[],
2305  const cs_real_t ref_value[],
2306  const cs_real_t face_values[]);
2307 
2308 /*----------------------------------------------------------------------------*/
2325 /*----------------------------------------------------------------------------*/
2326 
2329  cs_lnum_t n_cells,
2330  const cs_lnum_t elt_ids[],
2331  const cs_real_t ref_value[],
2332  const cs_real_t cell_values[]);
2333 
2334 /*----------------------------------------------------------------------------*/
2353 /*----------------------------------------------------------------------------*/
2354 
2357  int enforcement_id,
2358  cs_lnum_t n_cells,
2359  const cs_lnum_t cell_ids[],
2360  const cs_real_t ref_value[],
2361  const cs_real_t cell_values[]);
2362 
2363 /*----------------------------------------------------------------------------*/
2364 
2366 
2367 #endif /* __CS_EQUATION_PARAM_H__ */
cs_param_advection_strategy_t adv_strategy
Definition: cs_equation_param.h:654
Definition: cs_equation_param.h:1131
cs_hodge_param_t graddiv_hodgep
Definition: cs_equation_param.h:611
cs_adv_field_t * adv_field
Definition: cs_equation_param.h:657
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:3672
#define restrict
Definition: cs_defs.h:142
int imligr
Definition: cs_equation_param.h:461
Definition: cs_equation_param.h:1119
cs_real_t theta
Definition: cs_equation_param.h:565
Definition: cs_equation_param.h:1136
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:3362
int iwgrec
Definition: cs_equation_param.h:463
Definition: cs_advection_field.h:150
cs_flag_t post_flag
Definition: cs_equation_param.h:222
cs_flag_t flag
Definition: cs_equation_param.h:215
int ndircl
Definition: cs_equation_param.h:449
cs_xdef_t * cs_equation_add_volume_mass_injection_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 volume mass injection definition source term by initializing a cs_xdef_t structure...
Definition: cs_equation_param.c:3466
Definition: cs_equation_param.h:1139
Field descriptor.
Definition: cs_field.h:125
int imvisf
Definition: cs_equation_param.h:459
cs_xdef_t ** ic_defs
Definition: cs_equation_param.h:530
cs_param_advection_form_t adv_formulation
Definition: cs_equation_param.h:652
int verbosity
Definition: cs_equation_param.h:206
cs_param_assemble_omp_strategy_t
Definition: cs_param_cdo.h:97
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources...
Definition: cs_equation_param.h:186
Definition: cs_equation_param.h:1121
cs_param_nl_algo_t incremental_algo_type
Definition: cs_equation_param.h:770
Definition: cs_equation_param.h:1117
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:2658
cs_equation_type_t type
Definition: cs_equation_param.h:194
Structure storing all the parameters to drive the algorithm called Anderson acceleration.
Definition: cs_iter_algo.h:177
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, const cs_lnum_t *index, const cs_lnum_t *ids)
Add a new source term by initializing a cs_xdef_t structure. Case of a definition by an array...
Definition: cs_equation_param.c:3247
static void cs_equation_set_param(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.h:1608
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:1673
Definition: cs_equation_param.h:1149
#define CS_EQUATION_CURLCURL
The term related to the curl-curl operator is needed.
Definition: cs_equation_param.h:98
cs_real_t incremental_relax_factor
Definition: cs_equation_param.h:772
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 applies to a v...
Definition: cs_equation_param.c:2109
cs_param_nl_algo_t
Class of non-linear iterative algorithm.
Definition: cs_param_types.h:546
static bool cs_equation_param_has_time(const cs_equation_param_t *eqp)
Ask if the parameters of the equation needs an unsteady term.
Definition: cs_equation_param.h:1285
cs_param_dof_reduction_t dof_reduction
Definition: cs_equation_param.h:227
Definition: cs_equation_param.h:172
cs_xdef_t * cs_equation_add_ic_by_dof_func(cs_equation_param_t *eqp, const char *z_name, cs_flag_t loc_flag, cs_dof_func_t *func, void *input)
Define the initial condition for the unknown related to this equation. This definition applies to a v...
Definition: cs_equation_param.c:2261
cs_param_bc_enforce_t
Definition: cs_param_types.h:515
cs_iter_algo_param_t incremental_algo_param
Definition: cs_equation_param.h:771
cs_param_space_scheme_t space_scheme
Definition: cs_equation_param.h:226
#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:1326
cs_real_t upwind_portion
Definition: cs_equation_param.h:656
Definition: cs_equation_param.h:1141
static bool cs_equation_param_has_diffusion(const cs_equation_param_t *eqp)
Ask if the parameters of the equation needs a diffusion term.
Definition: cs_equation_param.h:1185
double epsilo
Definition: cs_equation_param.h:468
double epsrgr
Definition: cs_equation_param.h:470
int istat
Definition: cs_equation_param.h:447
int space_poly_degree
Definition: cs_equation_param.h:233
cs_property_t ** reaction_properties
Definition: cs_equation_param.h:681
cs_xdef_t ** volume_mass_injections
Definition: cs_equation_param.h:718
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:2495
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, const cs_lnum_t *index, const cs_lnum_t *ids)
Define and initialize a new structure to set a boundary condition related to the given equation struc...
Definition: cs_equation_param.c:2408
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:2898
cs_param_advection_extrapol_t adv_extrapol
Definition: cs_equation_param.h:655
Definition: cs_equation_param.h:1128
int imrgra
Definition: cs_equation_param.h:460
cs_real_t strong_pena_bc_coeff
Definition: cs_equation_param.h:514
Definition: cs_equation_param.h:1126
cs_property_t * curlcurl_property
Definition: cs_equation_param.h:596
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:2340
Definition: field.f90:27
Definition: cs_equation_param.h:1124
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:3070
int n_enforcements
Definition: cs_equation_param.h:738
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:3741
cs_param_time_scheme_t time_scheme
Definition: cs_equation_param.h:564
cs_param_advection_strategy_t
Choice of how to handle the advection term in an equation.
Definition: cs_param_types.h:379
Definition: cs_equation_param.h:1132
Structure and routines handling the SLES settings stored inside a cs_param_sles_t structure...
#define CS_EQUATION_BUILD_HOOK
Activate a build hook to get a fine control of the discretization process during the cellwise buildin...
Definition: cs_equation_param.h:103
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:1120
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:95
Definition: cs_equation_param.h:1144
cs_property_t * time_property
Definition: cs_equation_param.h:563
Definition: cs_equation_param.h:1120
cs_real_t weak_pena_bc_coeff
Definition: cs_equation_param.h:515
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:1710
static bool cs_equation_param_has_graddiv(const cs_equation_param_t *eqp)
Ask if the parameters of the equation needs a grad-div term.
Definition: cs_equation_param.h:1225
cs_param_advection_extrapol_t
Choice of how to extrapolate the advection field in the advection term.
Definition: cs_param_types.h:413
Definition: cs_equation_param.h:1146
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:154
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:2829
Definition: cs_equation_param.h:171
void cs_equation_param_clear(cs_equation_param_t *eqp)
Free the contents of a cs_equation_param_t.
Definition: cs_equation_param.c:1565
Definition: cs_equation_param.h:1147
Definition: cs_equation_param.h:169
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:2783
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_param_free(cs_equation_param_t *eqp)
Free a cs_equation_param_t.
Definition: cs_equation_param.c:1649
cs_enforcement_param_t ** enforcement_params
Definition: cs_equation_param.h:739
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:2077
cs_xdef_t ** source_terms
Definition: cs_equation_param.h:698
int icoupl
Definition: cs_equation_param.h:464
int n_volume_mass_injections
Definition: cs_equation_param.h:717
#define CS_EQUATION_CONVECTION
Convection term is needed.
Definition: cs_equation_param.h:96
Definition: cs_equation_param.h:1145
int iconv
Definition: cs_equation_param.h:446
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:127
Definition: cs_equation_param.h:1123
double climgr
Definition: cs_equation_param.h:471
double thetav
Definition: cs_equation_param.h:465
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:3030
Definition: cs_equation_param.h:1129
double blend_st
Definition: cs_equation_param.h:467
static bool cs_equation_param_has_user_hook(const cs_equation_param_t *eqp)
Ask if the parameters of the equation has activated a user hook to get a fine tuning of the cellwise ...
Definition: cs_equation_param.h:1373
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:3181
cs_param_assemble_omp_strategy_t omp_assembly_choice
Definition: cs_equation_param.h:784
static void cs_equation_param_set_flag(cs_equation_param_t *eqp, cs_flag_t flag)
Update the flag related to a cs_equation_param_t structure.
Definition: cs_equation_param.h:1167
Definition: cs_equation_param.h:1134
int dim
Definition: cs_equation_param.h:195
Definition: cs_equation_param.h:1142
Definition: cs_equation_param.h:1118
Definition: cs_equation_param.h:1125
int ircflu
Definition: cs_equation_param.h:462
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:2568
cs_property_t * diffusion_property
Definition: cs_equation_param.h:580
Definition: cs_equation_param.h:1135
double blencv
Definition: cs_equation_param.h:466
int idften
Definition: cs_equation_param.h:452
Definition: cs_equation_param.h:1122
char *restrict name
Definition: cs_equation_param.h:193
cs_property_t * adv_scaling_property
Definition: cs_equation_param.h:658
Definition: cs_equation_param.h:1130
Definition: cs_equation_param.h:1137
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:2312
int n_ic_defs
Definition: cs_equation_param.h:529
static bool cs_equation_param_has_name(cs_equation_param_t *eqp, const char *name)
Check if a cs_equation_param_t structure has its name member equal to the given name.
Definition: cs_equation_param.h:1396
Definition: cs_equation_param.h:168
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 applies to a v...
Definition: cs_equation_param.c:2158
static void cs_equation_copy_param_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.h:1501
Structure storing medata for defining a quantity in a very flexible way.
Definition: cs_xdef.h:154
int ischcv
Definition: cs_equation_param.h:454
#define CS_EQUATION_GRADDIV
The term related to the grad-div operator is needed.
Definition: cs_equation_param.h:99
int n_source_terms
Definition: cs_equation_param.h:697
#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:101
int nswrgr
Definition: cs_equation_param.h:457
cs_property_t * graddiv_property
Definition: cs_equation_param.h:612
cs_hodge_param_t curlcurl_hodgep
Definition: cs_equation_param.h:595
int iwarni
Definition: cs_equation_param.h:207
cs_equation_key_t
List of available keys for setting the parameters of an equation.
Definition: cs_equation_param.h:1115
Definition: cs_equation_param.h:167
int idircl
Definition: cs_equation_param.h:448
cs_equation_type_t
Type of equations managed by the solver.
Definition: cs_equation_param.h:165
cs_enforcement_param_t * cs_equation_add_or_replace_cell_enforcement(cs_equation_param_t *eqp, int enforcement_id, cs_lnum_t n_cells, const cs_lnum_t cell_ids[], const cs_real_t ref_value[], const cs_real_t cell_values[])
Add a new enforcement if enforcement_id does not exist or replace it otherwise. Enforcement of the va...
Definition: cs_equation_param.c:3807
cs_param_sles_t * sles_param
Definition: cs_equation_param.h:768
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:2955
int isstpc
Definition: cs_equation_param.h:456
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:2980
int nswrsm
Definition: cs_equation_param.h:458
Definition: cs_equation_param.h:173
cs_param_bc_enforce_t default_enforcement
Definition: cs_equation_param.h:513
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:316
int n_reaction_terms
Definition: cs_equation_param.h:680
cs_param_advection_scheme_t adv_scheme
Definition: cs_equation_param.h:653
int iswdyn
Definition: cs_equation_param.h:453
int n_bc_defs
Definition: cs_equation_param.h:510
int ibdtso
Definition: cs_equation_param.h:455
Definition: cs_equation_param.h:175
#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:3121
unsigned short int cs_flag_t
Definition: cs_defs.h:324
cs_param_dof_reduction_t
Definition: cs_param_types.h:234
cs_param_bc_type_t
Definition: cs_param_types.h:470
double relaxv
Definition: cs_equation_param.h:472
int idifft
Definition: cs_equation_param.h:451
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 applies to a v...
Definition: cs_equation_param.c:2207
Definition: cs_iter_algo.h:53
Definition: cs_param_types.h:381
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:3411
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:1765
bool do_lumping
Definition: cs_equation_param.h:544
cs_param_bc_type_t default_bc
Definition: cs_equation_param.h:509
cs_hodge_param_t reaction_hodgep
Definition: cs_equation_param.h:679
static bool cs_equation_param_has_internal_enforcement(const cs_equation_param_t *eqp)
Ask if the parameters of the equation has an internal enforcement of the degrees of freedom...
Definition: cs_equation_param.h:1326
cs_xdef_t ** bc_defs
Definition: cs_equation_param.h:511
static cs_equation_param_t * cs_equation_create_param(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.h:1448
cs_param_advection_scheme_t
Definition: cs_param_types.h:346
Definition: cs_equation_param.h:1133
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:2745
Definition: cs_equation_param.h:1143
Definition: cs_equation_param.h:1127
#define CS_EQUATION_REACTION
Reaction term is needed.
Definition: cs_equation_param.h:100
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:3528
static void cs_equation_clear_param(cs_equation_param_t *eqp)
Free the contents of a cs_equation_param_t.
Definition: cs_equation_param.h:1542
cs_hodge_param_t diffusion_hodgep
Definition: cs_equation_param.h:579
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:3004
#define CS_EQUATION_DIFFUSION
Diffusion term is needed. A scalar-/vector-valued Laplacian with div .grad.
Definition: cs_equation_param.h:97
Definition: cs_param_types.h:382
static cs_equation_param_t * cs_equation_free_param(cs_equation_param_t *eqp)
Free a cs_equation_param_t.
Definition: cs_equation_param.h:1573
int idiff
Definition: cs_equation_param.h:450
cs_iter_algo_param_aa_t incremental_anderson_param
Definition: cs_equation_param.h:773
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:3599
cs_param_time_scheme_t
Definition: cs_param_types.h:269
static bool cs_equation_param_has_reaction(const cs_equation_param_t *eqp)
Ask if the parameters of the equation needs a reaction term.
Definition: cs_equation_param.h:1265
static bool cs_equation_param_has_implicit_advection(const cs_equation_param_t *eqp)
Ask if the parameters of the equation induces an implicit treatment of the advection term...
Definition: cs_equation_param.h:1347
Definition: cs_equation_param.h:1138
Definition: cs_equation_param.h:1140
static bool cs_equation_param_has_sourceterm(const cs_equation_param_t *eqp)
Ask if the parameters of the equation needs a source term.
Definition: cs_equation_param.h:1305
static bool cs_equation_param_has_curlcurl(const cs_equation_param_t *eqp)
Ask if the parameters of the equation needs a curl-curl term.
Definition: cs_equation_param.h:1205
cs_param_advection_form_t
Definition: cs_param_types.h:302
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:1734
cs_hodge_param_t time_hodgep
Definition: cs_equation_param.h:562
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:3313
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:2872
double epsrsm
Definition: cs_equation_param.h:469
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:2929
Definition: cs_equation_param.h:170
void cs_equation_param_copy_bc(const cs_equation_param_t *ref, cs_equation_param_t *dst)
Copy only the part dedicated to the boundary conditions and the DoF (degrees of freedom) enforcement ...
Definition: cs_equation_param.c:1504
static bool cs_equation_param_has_convection(const cs_equation_param_t *eqp)
Ask if the parameters of the equation needs a convection term.
Definition: cs_equation_param.h:1245