programmer's documentation
Data Structures | Macros | Enumerations | Functions
cs_param.h File Reference
#include "cs_cdo.h"
#include "cs_quadrature.h"
Include dependency graph for cs_param.h:

Go to the source code of this file.

Data Structures

union  cs_def_t
 
struct  cs_param_pty_t
 
struct  cs_param_hodge_t
 
struct  cs_param_bc_def_t
 
struct  cs_param_bc_t
 
struct  cs_param_source_term_t
 
struct  cs_param_itsol_t
 

Macros

#define CS_PARAM_FLAG_UNIFORM   (1 << 0)
 
#define CS_PARAM_FLAG_VERTEX   (1 << 1)
 
#define CS_PARAM_FLAG_EDGE   (1 << 2)
 
#define CS_PARAM_FLAG_FACE   (1 << 3)
 
#define CS_PARAM_FLAG_CELL   (1 << 4)
 
#define CS_PARAM_FLAG_PRIMAL   (1 << 5)
 
#define CS_PARAM_FLAG_DUAL   (1 << 6)
 
#define CS_PARAM_FLAG_BORDER   (1 << 7)
 
#define CS_PARAM_FLAG_SCAL   (1 << 8)
 
#define CS_PARAM_FLAG_VECT   (1 << 9)
 
#define CS_PARAM_FLAG_TENS   (1 << 10)
 
#define CS_PARAM_FLAG_SYMMET   (1 << 11)
 
#define CS_PARAM_FLAG_IMPLICIT   (1 << 12)
 
#define CS_PARAM_FLAG_EXPLICIT   (1 << 13)
 
#define CS_PARAM_FLAG_UNSTEADY   (1 << 14)
 

Enumerations

enum  cs_param_def_type_t {
  CS_PARAM_DEF_BY_VALUE, CS_PARAM_DEF_BY_FIELD, CS_PARAM_DEF_BY_EVALUATOR, CS_PARAM_DEF_BY_ANALYTIC_FUNCTION,
  CS_PARAM_DEF_BY_USER_FUNCTION, CS_PARAM_DEF_BY_LAW, CS_PARAM_DEF_BY_FILE, CS_PARAM_N_DEF_TYPES
}
 
enum  cs_param_var_type_t {
  CS_PARAM_VAR_SCAL, CS_PARAM_VAR_VECT, CS_PARAM_VAR_SYMTENS, CS_PARAM_VAR_TENS,
  CS_PARAM_N_VAR_TYPES
}
 
enum  cs_param_pty_type_t { CS_PARAM_PTY_ISO, CS_PARAM_PTY_ORTHO, CS_PARAM_PTY_ANISO, CS_PARAM_N_PTY_TYPES }
 
enum  cs_param_hodge_type_t {
  CS_PARAM_HODGE_TYPE_VPCD, CS_PARAM_HODGE_TYPE_EPFD, CS_PARAM_HODGE_TYPE_FPED, CS_PARAM_HODGE_TYPE_EDFP,
  CS_PARAM_HODGE_TYPE_CPVD, CS_PARAM_N_HODGE_TYPES
}
 
enum  cs_param_hodge_algo_t { CS_PARAM_HODGE_ALGO_VORONOI, CS_PARAM_HODGE_ALGO_WBS, CS_PARAM_HODGE_ALGO_COST, CS_PARAM_N_HODGE_ALGOS }
 
enum  cs_param_bc_type_t {
  CS_PARAM_BC_HMG_DIRICHLET, CS_PARAM_BC_DIRICHLET, CS_PARAM_BC_HMG_NEUMANN, CS_PARAM_BC_NEUMANN,
  CS_PARAM_BC_ROBIN, CS_PARAM_N_BC_TYPES
}
 
enum  cs_param_boundary_type_t {
  CS_PARAM_BOUNDARY_WALL, CS_PARAM_BOUNDARY_INLET, CS_PARAM_BOUNDARY_OUTLET, CS_PARAM_BOUNDARY_SYMMETRY,
  CS_PARAM_N_BOUNDARY_TYPES
}
 
enum  cs_param_source_term_type_t {
  CS_PARAM_SOURCE_TERM_BASIC, CS_PARAM_SOURCE_TERM_IMPLICIT, CS_PARAM_SOURCE_TERM_IMEX, CS_PARAM_SOURCE_TERM_MASS,
  CS_PARAM_SOURCE_TERM_HEADLOSS, CS_PARAM_N_SOURCE_TERM_TYPES
}
 
enum  cs_param_precond_type_t {
  CS_PARAM_PRECOND_DIAG, CS_PARAM_PRECOND_POLY1, CS_PARAM_PRECOND_SSOR, CS_PARAM_PRECOND_ILU0,
  CS_PARAM_PRECOND_ICC0, CS_PARAM_PRECOND_AMG, CS_PARAM_PRECOND_AS, CS_PARAM_N_PRECOND_TYPES
}
 
enum  cs_param_itsol_type_t {
  CS_PARAM_ITSOL_CG, CS_PARAM_ITSOL_BICG, CS_PARAM_ITSOL_GMRES, CS_PARAM_ITSOL_AMG,
  CS_PARAM_N_ITSOL_TYPES
}
 

Functions

void cs_param_pty_free_all (void)
 Destroy all structures related to properties. More...
 
cs_param_pty_tcs_param_pty_get (int pty_id)
 Retrieve a cs_param_pty_t structure from its id. More...
 
int cs_param_pty_get_id_by_name (const char *ref_name)
 Find the id related to a property definition from its name. More...
 
void cs_param_pty_set_default (void)
 Add by default several material properties. More...
 
void cs_param_pty_add (const char *name, cs_param_pty_type_t type, int post_freq)
 Create and intialize a material property. More...
 
void cs_param_pty_add_fields (void)
 Create a field related to a material property. More...
 
void cs_param_pty_set_by_val (const char *name, cs_get_t matval)
 Define a material property by value. More...
 
void cs_param_pty_set_by_analytic_func (const char *name, cs_analytic_func_t *analytic_func)
 Define a material property by an analytical function. More...
 
bool cs_param_pty_is_uniform (int pty_id)
 Query to know if the material property is uniform. More...
 
const char * cs_param_pty_get_name (int pty_id)
 Retrieve the name of a material property from its id. More...
 
void cs_param_pty_get_val (int pty_id, cs_real_t t, cs_real_3_t xyz, bool invers, cs_real_33_t *matval)
 Retrieve the 3x3 matrix related to a general material property. This value is computed at location (x,y,z) and time t. More...
 
void cs_param_pty_resume_all (void)
 Resume all the cs_param_pty_t structures. More...
 
void cs_param_pty_finalize (void)
 Free structures dedicated to the definition of material properties. More...
 
cs_param_bc_tcs_param_bc_create (cs_param_bc_type_t default_bc, bool is_penalized)
 Allocate and initialize a new cs_param_bc_t structure. More...
 
void cs_param_bc_def_set (cs_param_bc_def_t *bc_def, int loc_id, cs_param_bc_type_t bc_type, cs_param_def_type_t def_type, cs_def_t def_coef1, cs_def_t def_coef2)
 Set a cs_param_bc_def_t structure. More...
 
void cs_param_source_term_add (cs_param_source_term_t *st, const char *st_name, int ml_id, cs_param_source_term_type_t type, cs_param_var_type_t var_type, cs_quadra_type_t quad_type, cs_param_def_type_t def_type, cs_def_t imp_def, cs_def_t exp_def)
 Define a source term. This source term is added to the list of source terms associated to an equation. More...
 
const char * cs_param_source_term_get_name (const cs_param_source_term_t st_info)
 Get the name related to a source term. More...
 
const char * cs_param_source_term_get_type_name (const cs_param_source_term_t st_info)
 Get the name related to a source term. More...
 
const char * cs_param_get_var_type_name (const cs_param_var_type_t type)
 Get the name related to a type of variable. More...
 
const char * cs_param_get_def_type_name (const cs_param_def_type_t type)
 Get the name related to a type of definition. More...
 
const char * cs_param_hodge_get_algo_name (const cs_param_hodge_t h_info)
 Get the name of algorithm related to a discrete Hdoge operator. More...
 
const char * cs_param_hodge_get_type_name (const cs_param_hodge_t h_info)
 Get the type of discrete Hodge operator. More...
 
const char * cs_param_get_solver_name (cs_param_itsol_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 preconditionner. More...
 

Macro Definition Documentation

#define CS_PARAM_FLAG_BORDER   (1 << 7)
#define CS_PARAM_FLAG_CELL   (1 << 4)
#define CS_PARAM_FLAG_DUAL   (1 << 6)
#define CS_PARAM_FLAG_EDGE   (1 << 2)
#define CS_PARAM_FLAG_EXPLICIT   (1 << 13)
#define CS_PARAM_FLAG_FACE   (1 << 3)
#define CS_PARAM_FLAG_IMPLICIT   (1 << 12)
#define CS_PARAM_FLAG_PRIMAL   (1 << 5)
#define CS_PARAM_FLAG_SCAL   (1 << 8)
#define CS_PARAM_FLAG_SYMMET   (1 << 11)
#define CS_PARAM_FLAG_TENS   (1 << 10)
#define CS_PARAM_FLAG_UNIFORM   (1 << 0)
#define CS_PARAM_FLAG_UNSTEADY   (1 << 14)
#define CS_PARAM_FLAG_VECT   (1 << 9)
#define CS_PARAM_FLAG_VERTEX   (1 << 1)

Enumeration Type Documentation

Enumerator
CS_PARAM_BC_HMG_DIRICHLET 
CS_PARAM_BC_DIRICHLET 
CS_PARAM_BC_HMG_NEUMANN 
CS_PARAM_BC_NEUMANN 
CS_PARAM_BC_ROBIN 
CS_PARAM_N_BC_TYPES 
Enumerator
CS_PARAM_BOUNDARY_WALL 
CS_PARAM_BOUNDARY_INLET 
CS_PARAM_BOUNDARY_OUTLET 
CS_PARAM_BOUNDARY_SYMMETRY 
CS_PARAM_N_BOUNDARY_TYPES 
Enumerator
CS_PARAM_DEF_BY_VALUE 
CS_PARAM_DEF_BY_FIELD 
CS_PARAM_DEF_BY_EVALUATOR 
CS_PARAM_DEF_BY_ANALYTIC_FUNCTION 
CS_PARAM_DEF_BY_USER_FUNCTION 
CS_PARAM_DEF_BY_LAW 
CS_PARAM_DEF_BY_FILE 
CS_PARAM_N_DEF_TYPES 
Enumerator
CS_PARAM_HODGE_ALGO_VORONOI 
CS_PARAM_HODGE_ALGO_WBS 
CS_PARAM_HODGE_ALGO_COST 
CS_PARAM_N_HODGE_ALGOS 
Enumerator
CS_PARAM_HODGE_TYPE_VPCD 
CS_PARAM_HODGE_TYPE_EPFD 
CS_PARAM_HODGE_TYPE_FPED 
CS_PARAM_HODGE_TYPE_EDFP 
CS_PARAM_HODGE_TYPE_CPVD 
CS_PARAM_N_HODGE_TYPES 
Enumerator
CS_PARAM_ITSOL_CG 
CS_PARAM_ITSOL_BICG 
CS_PARAM_ITSOL_GMRES 
CS_PARAM_ITSOL_AMG 
CS_PARAM_N_ITSOL_TYPES 
Enumerator
CS_PARAM_PRECOND_DIAG 
CS_PARAM_PRECOND_POLY1 
CS_PARAM_PRECOND_SSOR 
CS_PARAM_PRECOND_ILU0 
CS_PARAM_PRECOND_ICC0 
CS_PARAM_PRECOND_AMG 
CS_PARAM_PRECOND_AS 
CS_PARAM_N_PRECOND_TYPES 
Enumerator
CS_PARAM_PTY_ISO 
CS_PARAM_PTY_ORTHO 
CS_PARAM_PTY_ANISO 
CS_PARAM_N_PTY_TYPES 
Enumerator
CS_PARAM_SOURCE_TERM_BASIC 
CS_PARAM_SOURCE_TERM_IMPLICIT 
CS_PARAM_SOURCE_TERM_IMEX 
CS_PARAM_SOURCE_TERM_MASS 
CS_PARAM_SOURCE_TERM_HEADLOSS 
CS_PARAM_N_SOURCE_TERM_TYPES 
Enumerator
CS_PARAM_VAR_SCAL 
CS_PARAM_VAR_VECT 
CS_PARAM_VAR_SYMTENS 
CS_PARAM_VAR_TENS 
CS_PARAM_N_VAR_TYPES 

Function Documentation

cs_param_bc_t* cs_param_bc_create ( cs_param_bc_type_t  default_bc,
bool  is_penalized 
)

Allocate and initialize a new cs_param_bc_t structure.

Parameters
[in]default_bcdefault boundary condition
[in]is_penalizedtrue/false
Returns
a pointer to the new structure (free with cs_param_eq_t)
void cs_param_bc_def_set ( cs_param_bc_def_t bc_def,
int  loc_id,
cs_param_bc_type_t  bc_type,
cs_param_def_type_t  def_type,
cs_def_t  def_coef1,
cs_def_t  def_coef2 
)

Set a cs_param_bc_def_t structure.

Parameters
[in,out]bc_defpointer to cs_param_bc_def_t struct. to set
[in]loc_idid related to a cs_mesh_location_t
[in]bc_typegeneric type of admissible boundary conditions
[in]def_typeby value, function...
[in]def_coef1access to the value of the first coef
[in]def_coef2access to the value of the second coef (optional)
const char* cs_param_get_def_type_name ( const cs_param_def_type_t  type)

Get the name related to a type of definition.

Parameters
[in]typecs_param_def_type_t
Returns
the name associated to this type
const char* cs_param_get_precond_name ( cs_param_precond_type_t  precond)

Get the name of the preconditionner.

Parameters
[in]precondtype of preconditionner
Returns
the associated preconditionner name
const char* cs_param_get_solver_name ( cs_param_itsol_type_t  solver)

Get the name of the solver.

Parameters
[in]solvertype of iterative solver
Returns
the associated solver name
const char* cs_param_get_var_type_name ( const cs_param_var_type_t  type)

Get the name related to a type of variable.

Parameters
[in]typecs_param_var_type_t
Returns
the name associated to this type
const char* cs_param_hodge_get_algo_name ( const cs_param_hodge_t  h_info)

Get the name of algorithm related to a discrete Hdoge operator.

Parameters
[in]h_infocs_param_hodge_t structure
Returns
the name of the algorithm
const char* cs_param_hodge_get_type_name ( const cs_param_hodge_t  h_info)

Get the type of discrete Hodge operator.

Parameters
[in]h_infocs_param_hodge_t structure
Returns
the name of the type
void cs_param_pty_add ( const char *  name,
cs_param_pty_type_t  type,
int  post_freq 
)

Create and intialize a material property.

Parameters
[in]namename of the material property
[in]typetype of behavior of this material property
[in]post_freq-1 (no post-processing), 0 (at the beginning) otherwise every post_freq iteration(s)
void cs_param_pty_add_fields ( void  )

Create a field related to a material property.

void cs_param_pty_finalize ( void  )

Free structures dedicated to the definition of material properties.

void cs_param_pty_free_all ( void  )

Destroy all structures related to properties.

cs_param_pty_t* cs_param_pty_get ( int  pty_id)

Retrieve a cs_param_pty_t structure from its id.

Parameters
[in]pty_idid related to a property
Returns
a pointer to a cs_param_pty_t
int cs_param_pty_get_id_by_name ( const char *  ref_name)

Find the id related to a property definition from its name.

Parameters
[in]ref_namename of the property to find
Returns
-1 if not found otherwise the associated id
const char* cs_param_pty_get_name ( int  pty_id)

Retrieve the name of a material property from its id.

Parameters
[in]pty_idid related to the material property to deal with
Returns
the name of the related property
void cs_param_pty_get_val ( int  pty_id,
cs_real_t  t,
cs_real_3_t  xyz,
bool  invers,
cs_real_33_t matval 
)

Retrieve the 3x3 matrix related to a general material property. This value is computed at location (x,y,z) and time t.

Parameters
[in]pty_idid related to the material property to deal with
[in]ttime at which we evaluate the material property
[in]xyzlocation at which we evaluate the material property
[in]inverstrue or false
[in,out]matvalpointer to the 3x3 matrix to return
bool cs_param_pty_is_uniform ( int  pty_id)

Query to know if the material property is uniform.

Parameters
[in]pty_idid related to the material property to deal with
Returns
true or false
void cs_param_pty_resume_all ( void  )

Resume all the cs_param_pty_t structures.

void cs_param_pty_set_by_analytic_func ( const char *  name,
cs_analytic_func_t analytic_func 
)

Define a material property by an analytical function.

Parameters
[in]namename of the material property
[in]analyticpointer to a cs_analytic_func_t
void cs_param_pty_set_by_val ( const char *  name,
cs_get_t  matval 
)

Define a material property by value.

Parameters
[in]namename of the material property
[in]matvalvalue to set
void cs_param_pty_set_default ( void  )

Add by default several material properties.

void cs_param_source_term_add ( cs_param_source_term_t st,
const char *  st_name,
int  ml_id,
cs_param_source_term_type_t  type,
cs_param_var_type_t  var_type,
cs_quadra_type_t  quad_type,
cs_param_def_type_t  def_type,
cs_def_t  imp_def,
cs_def_t  exp_def 
)

Define a source term. This source term is added to the list of source terms associated to an equation.

Parameters
[in,out]stpointer to the cs_param_source_term_t struc. to set
[in]st_namename of the source term (for log/post-processing)
[in]ml_idid related to a cs_mesh_location_t
[in]typetype of source term
[in]var_typetype of variables (scalar, vector, tensor...)
[in]quad_typetype of quadrature rule to use
[in]def_typetype of definition (by value, function...)
[in]imp_defaccess to the definition of the implicit part
[in]exp-defaccess to the definition of the explicit part
const char* cs_param_source_term_get_name ( const cs_param_source_term_t  st_info)

Get the name related to a source term.

Parameters
[in]st_infocs_param_source_term_t structure
Returns
the name of the source term
const char* cs_param_source_term_get_type_name ( const cs_param_source_term_t  st_info)

Get the name related to a source term.

Parameters
[in]st_infocs_param_source_term_t structure
Returns
the name of the source term