7.3
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 
1155 typedef enum {
1156 
1188 
1190 
1192 
1193 /*============================================================================
1194  * Static inline public function prototypes
1195  *============================================================================*/
1196 
1197 /*----------------------------------------------------------------------------*/
1204 /*----------------------------------------------------------------------------*/
1205 
1206 static inline void
1208  cs_flag_t flag)
1209 {
1210  assert(eqp != NULL);
1211  eqp->flag |= flag;
1212 }
1213 
1214 /*----------------------------------------------------------------------------*/
1222 /*----------------------------------------------------------------------------*/
1223 
1224 static inline bool
1226 {
1227  assert(eqp != NULL);
1228  if (eqp->flag & CS_EQUATION_DIFFUSION)
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_CURLCURL)
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_GRADDIV)
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_CONVECTION)
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->flag & CS_EQUATION_REACTION)
1309  return true;
1310  else
1311  return false;
1312 }
1313 
1314 /*----------------------------------------------------------------------------*/
1322 /*----------------------------------------------------------------------------*/
1323 
1324 static inline bool
1326 {
1327  assert(eqp != NULL);
1328  if (eqp->flag & CS_EQUATION_UNSTEADY)
1329  return true;
1330  else
1331  return false;
1332 }
1333 
1334 /*----------------------------------------------------------------------------*/
1342 /*----------------------------------------------------------------------------*/
1343 
1344 static inline bool
1346 {
1347  assert(eqp != NULL);
1348  if (eqp->n_source_terms > 0)
1349  return true;
1350  else
1351  return false;
1352 }
1353 
1354 /*----------------------------------------------------------------------------*/
1363 /*----------------------------------------------------------------------------*/
1364 
1365 static inline bool
1367 {
1368  assert(eqp != NULL);
1369  if (eqp->flag & CS_EQUATION_FORCE_VALUES)
1370  return true;
1371  else
1372  return false;
1373 }
1374 
1375 /*----------------------------------------------------------------------------*/
1384 /*----------------------------------------------------------------------------*/
1385 
1386 static inline bool
1388 {
1389  assert(eqp != NULL);
1390  if (eqp->flag & CS_EQUATION_CONVECTION) {
1393  return true;
1394  else
1395  return false;
1396  }
1397  else
1398  return false;
1399 }
1400 
1401 /*----------------------------------------------------------------------------*/
1410 /*----------------------------------------------------------------------------*/
1411 
1412 static inline bool
1414 {
1415  assert(eqp != NULL);
1416  if (eqp->flag & CS_EQUATION_BUILD_HOOK)
1417  return true;
1418  else
1419  return false;
1420 }
1421 
1422 /*----------------------------------------------------------------------------*/
1433 /*----------------------------------------------------------------------------*/
1434 
1435 static inline bool
1437  const char *name)
1438 {
1439  if (eqp == NULL)
1440  return false;
1441  if (eqp->name == NULL)
1442  return false;
1443  if (strcmp(eqp->name, name) == 0)
1444  return true;
1445  else
1446  return false;
1447 }
1448 
1449 /*============================================================================
1450  * Public function prototypes
1451  *============================================================================*/
1452 
1453 /*----------------------------------------------------------------------------*/
1464 /*----------------------------------------------------------------------------*/
1465 
1467 cs_equation_param_create(const char *name,
1468  cs_equation_type_t type,
1469  int dim,
1470  cs_param_bc_type_t default_bc);
1471 
1472 /*----------------------------------------------------------------------------*/
1485 /*----------------------------------------------------------------------------*/
1486 
1487 inline static cs_equation_param_t *
1488 cs_equation_create_param(const char *name,
1489  cs_equation_type_t type,
1490  int dim,
1491  cs_param_bc_type_t default_bc)
1492 {
1493  return cs_equation_param_create(name, type, dim, default_bc);
1494 }
1495 
1496 /*----------------------------------------------------------------------------*/
1505 /*----------------------------------------------------------------------------*/
1506 
1507 void
1509  cs_equation_param_t *dst,
1510  bool copy_fid);
1511 
1512 /*----------------------------------------------------------------------------*/
1521 /*----------------------------------------------------------------------------*/
1522 
1523 void
1525  cs_equation_param_t *dst);
1526 
1527 /*----------------------------------------------------------------------------*/
1538 /*----------------------------------------------------------------------------*/
1539 
1540 inline static void
1542  cs_equation_param_t *dst,
1543  bool copy_fid)
1544 {
1545  cs_equation_param_copy_from(ref, dst, copy_fid);
1546 }
1547 
1548 /*----------------------------------------------------------------------------*/
1560 /*----------------------------------------------------------------------------*/
1561 
1562 void
1564 
1565 /*----------------------------------------------------------------------------*/
1579 /*----------------------------------------------------------------------------*/
1580 
1581 inline static void
1583 {
1585 }
1586 
1587 /*----------------------------------------------------------------------------*/
1595 /*----------------------------------------------------------------------------*/
1596 
1599 
1600 /*----------------------------------------------------------------------------*/
1610 /*----------------------------------------------------------------------------*/
1611 
1612 inline static cs_equation_param_t *
1614 {
1615  return cs_equation_param_free(eqp);
1616 }
1617 
1618 /*----------------------------------------------------------------------------*/
1627 /*----------------------------------------------------------------------------*/
1628 
1629 void
1631  cs_equation_key_t key,
1632  const char *keyval);
1633 
1634 /*----------------------------------------------------------------------------*/
1645 /*----------------------------------------------------------------------------*/
1646 
1647 inline static void
1649  cs_equation_key_t key,
1650  const char *keyval)
1651 {
1652  cs_equation_param_set(eqp, key, keyval);
1653 }
1654 
1655 /*----------------------------------------------------------------------------*/
1663 /*----------------------------------------------------------------------------*/
1664 
1665 void
1667 
1668 /*----------------------------------------------------------------------------*/
1675 /*----------------------------------------------------------------------------*/
1676 
1677 void
1679 
1680 /*----------------------------------------------------------------------------*/
1686 /*----------------------------------------------------------------------------*/
1687 
1688 void
1690 
1691 /*----------------------------------------------------------------------------*/
1700 /*----------------------------------------------------------------------------*/
1701 
1702 bool
1704 
1705 /*----------------------------------------------------------------------------*/
1720 /*----------------------------------------------------------------------------*/
1721 
1722 cs_xdef_t *
1724  const char *z_name,
1725  cs_real_t *val);
1726 
1727 /*----------------------------------------------------------------------------*/
1743 /*----------------------------------------------------------------------------*/
1744 
1745 cs_xdef_t *
1747  const char *z_name,
1748  double quantity);
1749 
1750 /*----------------------------------------------------------------------------*/
1766 /*----------------------------------------------------------------------------*/
1767 
1768 cs_xdef_t *
1770  const char *z_name,
1771  cs_analytic_func_t *analytic,
1772  void *input);
1773 
1774 /*----------------------------------------------------------------------------*/
1790 /*----------------------------------------------------------------------------*/
1791 
1792 cs_xdef_t *
1794  const char *z_name,
1795  cs_flag_t loc_flag,
1796  cs_dof_func_t *func,
1797  void *input);
1798 
1799 /*----------------------------------------------------------------------------*/
1808 /*----------------------------------------------------------------------------*/
1809 
1810 void
1812  cs_xdef_t *xdef);
1813 
1814 /*----------------------------------------------------------------------------*/
1827 /*----------------------------------------------------------------------------*/
1828 
1829 cs_xdef_t *
1831  const cs_param_bc_type_t bc_type,
1832  const char *z_name,
1833  cs_real_t *values);
1834 
1835 /*----------------------------------------------------------------------------*/
1853 /*----------------------------------------------------------------------------*/
1854 
1855 cs_xdef_t *
1857  const cs_param_bc_type_t bc_type,
1858  const char *z_name,
1859  cs_flag_t loc,
1860  cs_real_t *array,
1861  bool is_owner,
1862  const cs_lnum_t *index,
1863  const cs_lnum_t *ids);
1864 
1865 /*----------------------------------------------------------------------------*/
1878 /*----------------------------------------------------------------------------*/
1879 
1880 cs_xdef_t *
1882  const cs_param_bc_type_t bc_type,
1883  const char *z_name,
1884  cs_field_t *field);
1885 
1886 /*----------------------------------------------------------------------------*/
1901 /*----------------------------------------------------------------------------*/
1902 
1903 cs_xdef_t *
1905  const cs_param_bc_type_t bc_type,
1906  const char *z_name,
1907  cs_analytic_func_t *analytic,
1908  void *input);
1909 
1910 /*----------------------------------------------------------------------------*/
1926 /*----------------------------------------------------------------------------*/
1927 
1928 cs_xdef_t *
1930  const cs_param_bc_type_t bc_type,
1931  const char *z_name,
1932  cs_flag_t loc_flag,
1933  cs_dof_func_t *func,
1934  void *input);
1935 
1936 /*----------------------------------------------------------------------------*/
1947 /*----------------------------------------------------------------------------*/
1948 
1949 cs_xdef_t *
1951  const char *z_name);
1952 
1953 /*----------------------------------------------------------------------------*/
1965 /*----------------------------------------------------------------------------*/
1966 
1967 void
1969  const char *z_name);
1970 
1971 /*----------------------------------------------------------------------------*/
1980 /*----------------------------------------------------------------------------*/
1981 
1982 void
1984  const char *z_name);
1985 
1986 /*----------------------------------------------------------------------------*/
1996 /*----------------------------------------------------------------------------*/
1997 
1998 void
2000  cs_property_t *property);
2001 
2002 /*----------------------------------------------------------------------------*/
2011 /*----------------------------------------------------------------------------*/
2012 
2013 void
2015  cs_property_t *property,
2016  int inversion);
2017 
2018 /*----------------------------------------------------------------------------*/
2026 /*----------------------------------------------------------------------------*/
2027 
2028 void
2030  cs_property_t *property);
2031 
2032 /*----------------------------------------------------------------------------*/
2041 /*----------------------------------------------------------------------------*/
2042 
2043 void
2045  cs_property_t *property);
2046 
2047 /*----------------------------------------------------------------------------*/
2055 /*----------------------------------------------------------------------------*/
2056 
2057 void
2059  cs_adv_field_t *adv_field);
2060 
2061 /*----------------------------------------------------------------------------*/
2068 /*----------------------------------------------------------------------------*/
2069 
2070 void
2072  cs_property_t *property);
2073 
2074 /*----------------------------------------------------------------------------*/
2084 /*----------------------------------------------------------------------------*/
2085 
2086 int
2088  cs_property_t *property);
2089 
2090 /*----------------------------------------------------------------------------*/
2102 /*----------------------------------------------------------------------------*/
2103 
2104 cs_xdef_t *
2106  const char *z_name,
2107  cs_real_t *val);
2108 
2109 /*----------------------------------------------------------------------------*/
2122 /*----------------------------------------------------------------------------*/
2123 
2124 cs_xdef_t *
2126  const char *z_name,
2127  cs_analytic_func_t *func,
2128  void *input);
2129 
2130 /*----------------------------------------------------------------------------*/
2144 /*----------------------------------------------------------------------------*/
2145 
2146 cs_xdef_t *
2148  const char *z_name,
2149  cs_flag_t loc_flag,
2150  cs_dof_func_t *func,
2151  void *input);
2152 
2153 /*----------------------------------------------------------------------------*/
2170 /*----------------------------------------------------------------------------*/
2171 
2172 cs_xdef_t *
2174  const char *z_name,
2175  cs_flag_t loc,
2176  cs_real_t *array,
2177  bool is_owner,
2178  const cs_lnum_t *index,
2179  const cs_lnum_t *ids);
2180 
2181 /*----------------------------------------------------------------------------*/
2193 /*----------------------------------------------------------------------------*/
2194 
2195 cs_xdef_t *
2197  const char *z_name,
2198  double *val);
2199 
2200 /*----------------------------------------------------------------------------*/
2213 /*----------------------------------------------------------------------------*/
2214 
2215 cs_xdef_t *
2217  const char *z_name,
2218  double *quantity);
2219 
2220 /*----------------------------------------------------------------------------*/
2233 /*----------------------------------------------------------------------------*/
2234 
2235 cs_xdef_t *
2237  const char *z_name,
2238  cs_analytic_func_t *func,
2239  void *input);
2240 
2241 /*----------------------------------------------------------------------------*/
2255 /*----------------------------------------------------------------------------*/
2256 
2257 cs_xdef_t *
2259  const char *z_name,
2260  cs_flag_t loc_flag,
2261  cs_dof_func_t *func,
2262  void *input);
2263 
2264 /*----------------------------------------------------------------------------*/
2283 /*----------------------------------------------------------------------------*/
2284 
2287  cs_lnum_t n_vertices,
2288  const cs_lnum_t vertex_ids[],
2289  const cs_real_t ref_value[],
2290  const cs_real_t vtx_values[]);
2291 
2292 /*----------------------------------------------------------------------------*/
2311 /*----------------------------------------------------------------------------*/
2312 
2315  cs_lnum_t n_edges,
2316  const cs_lnum_t edge_ids[],
2317  const cs_real_t ref_value[],
2318  const cs_real_t edge_values[]);
2319 
2320 /*----------------------------------------------------------------------------*/
2339 /*----------------------------------------------------------------------------*/
2340 
2343  cs_lnum_t n_faces,
2344  const cs_lnum_t face_ids[],
2345  const cs_real_t ref_value[],
2346  const cs_real_t face_values[]);
2347 
2348 /*----------------------------------------------------------------------------*/
2365 /*----------------------------------------------------------------------------*/
2366 
2369  cs_lnum_t n_cells,
2370  const cs_lnum_t elt_ids[],
2371  const cs_real_t ref_value[],
2372  const cs_real_t cell_values[]);
2373 
2374 /*----------------------------------------------------------------------------*/
2393 /*----------------------------------------------------------------------------*/
2394 
2397  int enforcement_id,
2398  cs_lnum_t n_cells,
2399  const cs_lnum_t cell_ids[],
2400  const cs_real_t ref_value[],
2401  const cs_real_t cell_values[]);
2402 
2403 /*----------------------------------------------------------------------------*/
2404 
2406 
2407 #endif /* __CS_EQUATION_PARAM_H__ */
cs_param_advection_strategy_t adv_strategy
Definition: cs_equation_param.h:654
Definition: cs_equation_param.h:1171
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:3753
#define restrict
Definition: cs_defs.h:142
int imligr
Definition: cs_equation_param.h:461
Definition: cs_equation_param.h:1159
cs_real_t theta
Definition: cs_equation_param.h:565
Definition: cs_equation_param.h:1176
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:3443
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:3547
Definition: cs_equation_param.h:1179
Field descriptor.
Definition: cs_field.h:130
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:1161
cs_param_nl_algo_t incremental_algo_type
Definition: cs_equation_param.h:770
Definition: cs_equation_param.h:1157
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:2738
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:3328
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:1648
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:1750
Definition: cs_equation_param.h:1189
#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:2186
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:1325
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:2338
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:512
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:1403
cs_real_t upwind_portion
Definition: cs_equation_param.h:656
Definition: cs_equation_param.h:1181
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:1225
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:2573
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:2486
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:2979
cs_param_advection_extrapol_t adv_extrapol
Definition: cs_equation_param.h:655
Definition: cs_equation_param.h:1168
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:1166
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:2417
Definition: field.f90:27
Definition: cs_equation_param.h:1164
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:3151
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:3822
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:1172
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:1198
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:1184
cs_property_t * time_property
Definition: cs_equation_param.h:563
Definition: cs_equation_param.h:1160
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:1787
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:1265
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:1186
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:2910
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:1642
Definition: cs_equation_param.h:1187
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:2864
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:1726
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:2154
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:1185
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:1163
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:3111
Definition: cs_equation_param.h:1169
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:1413
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:3262
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:1207
Definition: cs_equation_param.h:1174
int dim
Definition: cs_equation_param.h:195
Definition: cs_equation_param.h:1182
Definition: cs_equation_param.h:1158
Definition: cs_equation_param.h:1165
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:2647
cs_property_t * diffusion_property
Definition: cs_equation_param.h:580
Definition: cs_equation_param.h:1175
double blencv
Definition: cs_equation_param.h:466
int idften
Definition: cs_equation_param.h:452
Definition: cs_equation_param.h:1162
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:1170
Definition: cs_equation_param.h:1177
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:2389
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:1436
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:2235
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:1541
Structure storing medata for defining a quantity in a very flexible way.
Definition: cs_xdef.h:155
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:1155
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:3888
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:3036
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:3061
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:513
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:3202
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:2284
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:3492
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:1842
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:1366
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:1488
cs_param_advection_scheme_t
Definition: cs_param_types.h:346
Definition: cs_equation_param.h:1173
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:2826
Definition: cs_equation_param.h:1183
Definition: cs_equation_param.h:1167
#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:3609
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:1582
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:3085
#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:1613
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:3680
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:1305
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:1387
Definition: cs_equation_param.h:1178
Definition: cs_equation_param.h:1180
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:1345
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:1245
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:1811
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:3394
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:2953
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:3010
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:1581
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:1285