#include "cs_defs.h"
Go to the source code of this file.
Data Structures | |
struct | cs_param_convergence_t |
Set of parameters to check the convergence (or the divergence) of an iterative process (tolerances or max. number of iterations) More... | |
Macros | |
#define | CS_DOF_VTX_SCAL 0 |
#define | CS_DOF_VTX_VECT 1 |
#define | CS_DOF_FACE_SCAL 2 |
#define | CS_DOF_FACE_VECT 3 |
#define | CS_DOF_FACE_SCAP1 3 |
#define | CS_DOF_FACE_SCAP2 4 |
#define | CS_DOF_FACE_VECP0 3 |
#define | CS_DOF_FACE_VECP1 5 |
#define | CS_DOF_FACE_VECP2 6 |
#define | CS_DOF_EDGE_SCAL 7 |
#define | CS_N_DOF_CASES 8 |
#define | CS_ISOTROPIC_DIFFUSION (1 << 0) |
#define | CS_ORTHOTROPIC_DIFFUSION (1 << 1) |
#define | CS_ANISOTROPIC_LEFT_DIFFUSION (1 << 2) |
#define | CS_ANISOTROPIC_RIGHT_DIFFUSION (1 << 3) |
#define | CS_ANISOTROPIC_DIFFUSION ((1 << 2) + (1 << 3)) |
Typedefs | |
typedef 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. More... | |
typedef 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 (DoF): cells, faces, edges or or vertices. More... | |
typedef void() | cs_time_func_t(double time, void *input, cs_real_t *retval) |
Function which defines the evolution of a quantity according to the current time and any structure given as a parameter. More... | |
Enumerations | |
enum | cs_param_space_scheme_t { CS_SPACE_SCHEME_LEGACY , CS_SPACE_SCHEME_CDOVB , CS_SPACE_SCHEME_CDOVCB , CS_SPACE_SCHEME_CDOEB , CS_SPACE_SCHEME_CDOFB , CS_SPACE_SCHEME_CDOCB , CS_SPACE_SCHEME_HHO_P0 , CS_SPACE_SCHEME_HHO_P1 , CS_SPACE_SCHEME_HHO_P2 , CS_SPACE_SCHEME_MACFB , CS_SPACE_N_SCHEMES } |
Type of numerical scheme for the discretization in space. More... | |
enum | cs_param_dof_reduction_t { CS_PARAM_REDUCTION_DERHAM , CS_PARAM_REDUCTION_AVERAGE , CS_PARAM_N_REDUCTIONS } |
Functions | |
bool | cs_param_space_scheme_is_face_based (cs_param_space_scheme_t scheme) |
Return true if the space scheme has degrees of freedom on faces, otherwise false. More... | |
const char * | cs_param_get_space_scheme_name (cs_param_space_scheme_t scheme) |
Get the name of the space discretization scheme. More... | |
const char * | cs_param_get_time_scheme_name (cs_param_time_scheme_t scheme) |
Get the name of the time discretization scheme. More... | |
const char * | cs_param_get_advection_form_name (cs_param_advection_form_t adv_form) |
Get the label associated to the advection formulation. More... | |
const char * | cs_param_get_advection_scheme_name (cs_param_advection_scheme_t scheme) |
Get the label of the advection scheme. More... | |
const char * | cs_param_get_advection_strategy_name (cs_param_advection_strategy_t adv_stra) |
Get the label associated to the advection strategy. More... | |
const char * | cs_param_get_advection_extrapol_name (cs_param_advection_extrapol_t extrapol) |
Get the label associated to the extrapolation used for the advection field. More... | |
const char * | cs_param_get_bc_name (cs_param_bc_type_t bc) |
Get the name of the type of boundary condition. More... | |
const char * | cs_param_get_bc_enforcement_name (cs_param_bc_enforce_t type) |
Get the name of the type of enforcement of the boundary condition. More... | |
const char * | cs_param_get_nl_algo_name (cs_param_nl_algo_t algo) |
Get the name of the non-linear algorithm. More... | |
const char * | cs_param_get_nl_algo_label (cs_param_nl_algo_t algo) |
Get the label (short name) of the non-linear algorithm. More... | |
const char * | cs_param_get_dotprod_type_name (cs_param_dotprod_type_t dp_type) |
Get the name of the type of dot product to apply. More... | |
const char * | cs_param_get_solver_name (cs_param_solver_type_t solver) |
Get the name of the solver. More... | |
const char * | cs_param_get_precond_name (cs_param_precond_type_t precond) |
Get the name of the preconditioner. More... | |
const char * | cs_param_get_precond_block_name (cs_param_precond_block_t type) |
Get the name of the type of block preconditioning. More... | |
Variables | |
const char | cs_sep_h1 [80] |
const char | cs_sep_h2 [80] |
const char | cs_sepline [80] |
const char | cs_med_sepline [50] |
Numerical settings for time discretization | |
enum | cs_param_time_scheme_t { CS_TIME_SCHEME_STEADY , CS_TIME_SCHEME_EULER_IMPLICIT , CS_TIME_SCHEME_EULER_EXPLICIT , CS_TIME_SCHEME_CRANKNICO , CS_TIME_SCHEME_THETA , CS_TIME_SCHEME_BDF2 , CS_TIME_N_SCHEMES } |
Settings for non-linear algorithms | |
enum | cs_param_nl_algo_t { CS_PARAM_NL_ALGO_NONE , CS_PARAM_NL_ALGO_PICARD , CS_PARAM_NL_ALGO_MODIFIED_PICARD , CS_PARAM_NL_ALGO_ANDERSON , CS_PARAM_N_NL_ALGOS } |
Class of non-linear iterative algorithm. More... | |
#define CS_PARAM_BC_CIRCULATION CS_BC_CIRCULATION |
Homogeneous Dirichlet boundary conditions. The value of a variable is set to zero.
#define CS_PARAM_BC_DIRICHLET CS_BC_DIRICHLET |
Homogeneous Dirichlet boundary conditions. The value of a variable is set to zero.
#define CS_PARAM_BC_HMG_DIRICHLET CS_BC_HMG_DIRICHLET |
Homogeneous Dirichlet boundary conditions. The value of a variable is set to zero.
#define CS_PARAM_BC_HMG_NEUMANN CS_BC_SYMMETRY |
Homogeneous Dirichlet boundary conditions. The value of a variable is set to zero.
#define CS_PARAM_BC_NEUMANN CS_BC_NEUMANN |
Homogeneous Dirichlet boundary conditions. The value of a variable is set to zero.
#define CS_PARAM_BC_NEUMANN_FULL CS_BC_NEUMANN_FULL |
Homogeneous Dirichlet boundary conditions. The value of a variable is set to zero.
#define CS_PARAM_BC_ROBIN CS_BC_ROBIN |
Homogeneous Dirichlet boundary conditions. The value of a variable is set to zero.
#define CS_PARAM_BC_SLIDING CS_BC_SYMMETRY |
Homogeneous Dirichlet boundary conditions. The value of a variable is set to zero.
#define CS_PARAM_BC_WALL_PRECRIBED CS_BC_WALL_MODELLED |
Homogeneous Dirichlet boundary conditions. The value of a variable is set to zero.
typedef 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.
For the calling function, elt_ids is optional. If non-null, the coords array should be accessed with an indirection. The same indirection can be applied to fill retval if dense_output is set to false.
[in] | time | when ? |
[in] | n_elts | number of elements to consider |
[in] | elt_ids | list of elements ids (in coords and retval) |
[in] | coords | where ? |
[in] | dense_output | perform an indirection in retval or not |
[in] | input | null or pointer to a structure cast on-the-fly |
[in,out] | retval | resulting value(s). Must be allocated. |
typedef 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 (DoF): cells, faces, edges or or vertices.
For the calling function, elt_ids is optional. If non-null, array(s) should be accessed with an indirection. The same indirection can be applied to fill retval if dense_output is set to false.
[in] | n_elts | number of elements to consider |
[in] | elt_ids | list of elements ids |
[in] | dense_output | perform an indirection in retval or not |
[in] | input | null or pointer to a structure cast on-the-fly |
[in,out] | retval | resulting value(s). Must be allocated. |
typedef void() cs_time_func_t(double time, void *input, cs_real_t *retval) |
Function which defines the evolution of a quantity according to the current time and any structure given as a parameter.
[in] | time | value of the time at the end of the last iteration |
[in] | input | null or pointer to a structure cast on-the-fly |
[in] | retval | result of the evaluation |
Choice of how to extrapolate the advection field in the advection term.
Type of formulation for the advection term
Type of numerical scheme for the advection term
Enumerator | |
---|---|
CS_PARAM_ADVECTION_SCHEME_CENTERED | centered discretization |
CS_PARAM_ADVECTION_SCHEME_CIP | Continuous Interior Penalty discretization. Only available for CS_SPACE_SCHEME_CDOVCB space discretization. |
CS_PARAM_ADVECTION_SCHEME_CIP_CW | Continuous Interior Penalty discretization. Only available for CS_SPACE_SCHEME_CDOVCB space discretization. Variant with a cellwise constant approximation of the advection field |
CS_PARAM_ADVECTION_SCHEME_HYBRID_CENTERED_UPWIND | Centered discretization with a portion between [0,1] of upwinding. The portion is specified thanks to CS_EQKEY_ADV_UPWIND_PORTION If the portion is equal to 0, then one recovers CS_PARAM_ADVECTION_SCHEME_CENTERED. If the portion is equal to 1, then one recovers CS_PARAM_ADVECTION_SCHEME_UPWIND |
CS_PARAM_ADVECTION_SCHEME_SAMARSKII | Weighting between an upwind and a centered discretization relying on the Peclet number. Weighting function = Samarskii |
CS_PARAM_ADVECTION_SCHEME_SG | Weighting between an upwind and a centered discretization relying on the Peclet number. Weighting function = Scharfetter-Gummel |
CS_PARAM_ADVECTION_SCHEME_UPWIND | Low order upwind discretization |
CS_PARAM_N_ADVECTION_SCHEMES |
Choice of how to handle the advection term in an equation.
Enumerator | |
---|---|
CS_PARAM_ADVECTION_IMPLICIT_FULL | The advection term is implicitly treated. The non-linearity stemming from this term has to be solved using a specific algorithm such as the Picard (fixed-point) technique or more elaborated techniques. |
CS_PARAM_ADVECTION_IMPLICIT_LINEARIZED | The advection term is implicitly treated. The non-linearity stemming from this term is simplified. Namely, one assumes a linearized advection. This is equivalent to a one-step Picard technique. |
CS_PARAM_ADVECTION_EXPLICIT | The advection term is treated explicitly. One keeps the non-linearity stemming from this term at the right hand-side. An extrapolation can be used for the advection field (cf. cs_param_advection_extrapol_t) |
CS_PARAM_N_ADVECTION_STRATEGIES |
Type of method for enforcing the boundary conditions. According to the type of numerical scheme, some enforcements are not available.
Enumerator | |
---|---|
CS_PARAM_BC_ENFORCE_ALGEBRAIC | Weak enforcement of the boundary conditions (i.e. one keeps the degrees of freedom in the algebraic system) with an algebraic manipulation of the linear system |
CS_PARAM_BC_ENFORCE_PENALIZED | Weak enforcement of the boundary conditions (i.e. one keeps the degrees of freedom in the algebraic system) with a penalization technique using a huge value. |
CS_PARAM_BC_ENFORCE_WEAK_NITSCHE | Weak enforcement of the boundary conditions (i.e. one keeps the degrees of freedom in the algebraic system) with a Nitsche-like penalization technique. This technique does not increase the conditioning number as much as CS_PARAM_BC_ENFORCE_PENALIZED but is more computationally intensive. The computation of the diffusion term should be activated with this choice. |
CS_PARAM_BC_ENFORCE_WEAK_SYM | Weak enforcement of the boundary conditions (i.e. one keeps the degrees of freedom in the algebraic system) with a Nitsche-like penalization technique. This variant enables to keep the symmetry of the algebraic contrary to CS_PARAM_BC_ENFORCE_WEAK_NITSCHE. The computation of the diffusion term should be activated with this choice. |
CS_PARAM_N_BC_ENFORCEMENTS |
enum cs_param_bc_type_t |
Type of boundary condition to enforce.
enum cs_param_nl_algo_t |
Class of non-linear iterative algorithm.
Type of preconditioning by block
Type of preconditioner to use with the iterative solver. Some of the mentionned preconditioners are available only if the PETSc library is linked with code_saturne
Enumerator | |
---|---|
CS_PARAM_PRECOND_NONE | No preconditioner |
CS_PARAM_PRECOND_AMG | Algebraic multigrid preconditioner (additional options may be set using cs_param_amg_type_t) |
CS_PARAM_PRECOND_BJACOB_ILU0 | Only with PETSc Block Jacobi with an ILU zero fill-in in each block |
CS_PARAM_PRECOND_BJACOB_SGS | Only with PETSc Block Jacobi with a symmetric Gauss-Seidel in each block (rely on Eisenstat's trick with PETSc) |
CS_PARAM_PRECOND_DIAG | Diagonal (also Jacobi) preconditioner. The cheapest one but not the most efficient one. |
CS_PARAM_PRECOND_GKB_CG | Only with PETSc Golub-Kahan Bidiagonalization solver used as a preconditioner. Only useful if one has to solve a saddle-point system (such systems arise when solving Stokes or Navier-Stokes in a fully couple manner). Variant with CG as inner solver. |
CS_PARAM_PRECOND_GKB_GMRES | Only with PETSc Golub-Kahan Bidiagonalization solver used as a preconditioner. Only useful if one has to solve a saddle-point system (such systems arise when solving Stokes or Navier-Stokes in a fully couple manner). Variant with GMRES as inner solver. |
CS_PARAM_PRECOND_LU | Only with PETSc LU factorization (direct solver) with PETSc |
CS_PARAM_PRECOND_ILU0 | Only with PETSc Incomplete LU factorization (fill-in coefficient set to 0) |
CS_PARAM_PRECOND_ICC0 | Only with PETSc Incomplete Cholesky factorization (fill-in coefficient set to 0). This is variant of the ILU0 preconditioner dedicated to symmetric positive definite system |
CS_PARAM_PRECOND_MUMPS | Only with MUMPS Sparse direct solver available with the MUMPS library and used as a preconditioner |
CS_PARAM_PRECOND_HPDDM | Only with PETSc Use HPDDM and Geneo approach for coarse space with PETSc |
CS_PARAM_PRECOND_POLY1 | Neumann polynomial preconditioning. Polynoms of order 1. |
CS_PARAM_PRECOND_POLY2 | Neumann polynomial preconditioning. Polynoms of order 2. |
CS_PARAM_PRECOND_SSOR | Symmetric Successive OverRelaxations (can be seen as a symmetric Gauss-Seidel preconditioner) |
CS_PARAM_N_PRECOND_TYPES |
Way to renormalize (or not) the residual arising during the resolution of linear systems
Class of iterative solvers to consider for solver the linear system.
Type of solver used to solve a linear system. Some of the mentionned solver are available only if the PETSc library is linked with code_saturne.
Enumerator | |
---|---|
CS_PARAM_SOLVER_NONE | No iterative solver (equivalent to a "preonly" choice in PETSc) |
CS_PARAM_SOLVER_AMG | Algebraic multigrid solver (additional options may be set using cs_param_amg_type_t) |
CS_PARAM_SOLVER_BICGS | Bi-Conjugate gradient (useful for non-symmetric systems) |
CS_PARAM_SOLVER_BICGS2 | Stabilized Bi-Conjugate gradient (useful for non-symmetric systems) |
CS_PARAM_SOLVER_CG | Conjugate Gradient (solver of choice for symmetric positive definite systems) |
CS_PARAM_SOLVER_CR3 | 3-layer conjugate residual (can handle non-symmetric systems) |
CS_PARAM_SOLVER_FCG | Flexible Conjugate Gradient (variant of the CG when the preconditioner may change from one iteration to another. For instance when using an AMG as preconditioner) |
CS_PARAM_SOLVER_FGMRES | Only with PETSc Flexible Generalized Minimal RESidual |
CS_PARAM_SOLVER_GAUSS_SEIDEL | Gauss-Seidel |
CS_PARAM_SOLVER_GCR | Generalized conjugate residual (flexible iterative solver for symmetric or non-symmetric system) |
CS_PARAM_SOLVER_GMRES | Only with PETSc Generalized Minimal RESidual |
CS_PARAM_SOLVER_JACOBI | Jacobi (diagonal relaxation) |
CS_PARAM_SOLVER_MUMPS | Only with PETSc or MUMPS MUMPS sparse direct solver |
CS_PARAM_SOLVER_SYM_GAUSS_SEIDEL | Symmetric Gauss-Seidel |
CS_PARAM_SOLVER_USER_DEFINED | User-defined iterative solver. It relies on the implementation of the the function cs_user_sles_it_solver() |
CS_PARAM_N_SOLVER_TYPES |
Type of numerical scheme for the discretization in space.
How is defined the degree of freedom.
Type of numerical scheme for the discretization in time
const char * cs_param_get_advection_extrapol_name | ( | cs_param_advection_extrapol_t | extrapol | ) |
Get the label associated to the extrapolation used for the advection field.
[in] | extrapol | type of extrapolation for the advection field |
const char * cs_param_get_advection_form_name | ( | cs_param_advection_form_t | adv_form | ) |
Get the label associated to the advection formulation.
[in] | adv_form | type of advection formulation |
const char * cs_param_get_advection_scheme_name | ( | cs_param_advection_scheme_t | scheme | ) |
Get the label of the advection scheme.
[in] | scheme | type of advection scheme |
const char * cs_param_get_advection_strategy_name | ( | cs_param_advection_strategy_t | adv_stra | ) |
Get the label associated to the advection strategy.
[in] | adv_stra | type of advection strategy |
const char * cs_param_get_bc_enforcement_name | ( | cs_param_bc_enforce_t | type | ) |
Get the name of the type of enforcement of the boundary condition.
[in] | type | type of enforcement of boundary conditions |
const char * cs_param_get_bc_name | ( | cs_param_bc_type_t | type | ) |
Get the name of the type of boundary condition.
[in] | type | type of boundary condition |
const char * cs_param_get_dotprod_type_name | ( | cs_param_dotprod_type_t | dp_type | ) |
Get the name of the type of dot product to apply.
[in] | dp_type | type of dot product |
const char * cs_param_get_nl_algo_label | ( | cs_param_nl_algo_t | algo | ) |
Get the label (short name) of the non-linear algorithm.
[in] | algo | type of algorithm |
const char * cs_param_get_nl_algo_name | ( | cs_param_nl_algo_t | algo | ) |
Get the name of the non-linear algorithm.
[in] | algo | type of algorithm |
const char * cs_param_get_precond_block_name | ( | cs_param_precond_block_t | type | ) |
Get the name of the type of block preconditioning.
[in] | type | type of block preconditioning |
const char * cs_param_get_precond_name | ( | cs_param_precond_type_t | precond | ) |
Get the name of the preconditioner.
[in] | precond | type of preconditioner |
const char * cs_param_get_solver_name | ( | cs_param_solver_type_t | solver | ) |
Get the name of the solver.
[in] | solver | type of iterative solver |
const char * cs_param_get_space_scheme_name | ( | cs_param_space_scheme_t | scheme | ) |
Get the name of the space discretization scheme.
[in] | scheme | type of space scheme |
const char * cs_param_get_time_scheme_name | ( | cs_param_time_scheme_t | scheme | ) |
Get the name of the time discretization scheme.
[in] | scheme | type of time scheme |
bool cs_param_space_scheme_is_face_based | ( | cs_param_space_scheme_t | scheme | ) |
Return true if the space scheme has degrees of freedom on faces, otherwise false.
[in] | scheme | type of space scheme |
|
extern |
|
extern |
|
extern |
|
extern |