programmer's documentation
Macros | Functions | Variables
cs_param.c File Reference
#include "cs_defs.h"
#include <string.h>
#include <assert.h>
#include <bft_mem.h>
#include <bft_printf.h>
#include "cs_mesh_location.h"
#include "cs_field.h"
#include "cs_cdo.h"
#include "cs_cdo_toolbox.h"
#include "cs_param.h"
Include dependency graph for cs_param.c:

Macros

#define CS_PARAM_PTY_DBG   0
 

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 tcur, 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...
 

Variables

static int cs_param_n_properties = 0
 
static cs_param_pty_tcs_param_properties = NULL
 
static const char cs_param_def_type_name [CS_PARAM_N_DEF_TYPES][CS_CDO_LEN_NAME]
 
static const char cs_param_var_type_name [CS_PARAM_N_VAR_TYPES][CS_CDO_LEN_NAME]
 
static const char cs_param_pty_type_name [CS_PARAM_N_PTY_TYPES][CS_CDO_LEN_NAME]
 
static const char cs_param_bc_type_name [CS_PARAM_N_BC_TYPES][CS_CDO_LEN_NAME]
 
static const char cs_param_boundary_type_name [CS_PARAM_N_BOUNDARY_TYPES][CS_CDO_LEN_NAME]
 
static const char cs_param_hodge_type_desc [CS_PARAM_N_HODGE_TYPES][CS_CDO_LEN_NAME]
 
static const char cs_param_hodge_algo_desc [CS_PARAM_N_HODGE_ALGOS][CS_CDO_LEN_NAME]
 
static const char cs_param_source_term_type_name [CS_PARAM_N_SOURCE_TERM_TYPES][CS_CDO_LEN_NAME]
 

Macro Definition Documentation

#define CS_PARAM_PTY_DBG   0

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  tcur,
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

Variable Documentation

const char cs_param_bc_type_name[CS_PARAM_N_BC_TYPES][CS_CDO_LEN_NAME]
static
Initial value:
=
{ N_("Homogeneous Dirichlet"),
N_("Dirichlet"),
N_("Homogeneous Neumann"),
N_("Neumann"),
N_("Robin") }
#define N_(String)
Definition: cs_defs.h:56
const char cs_param_boundary_type_name[CS_PARAM_N_BOUNDARY_TYPES][CS_CDO_LEN_NAME]
static
Initial value:
=
{ N_("Wall"),
N_("Inlet"),
N_("Outlet"),
N_("Symmetry") }
#define N_(String)
Definition: cs_defs.h:56
const char cs_param_def_type_name[CS_PARAM_N_DEF_TYPES][CS_CDO_LEN_NAME]
static
Initial value:
=
{ N_("by value"),
N_("by field"),
N_("by evaluator"),
N_("by analytic function"),
N_("by user function"),
N_("by law"),
N_("by file") }
#define N_(String)
Definition: cs_defs.h:56
const char cs_param_hodge_algo_desc[CS_PARAM_N_HODGE_ALGOS][CS_CDO_LEN_NAME]
static
Initial value:
=
{ "Voronoi",
"Whitney on the Barycentric Subdivision (WBS)",
"COnsistency-STabilization splitting (COST)" }
const char cs_param_hodge_type_desc[CS_PARAM_N_HODGE_TYPES][CS_CDO_LEN_NAME]
static
Initial value:
=
{ "VpCd",
"EpFd",
"FpEd",
"EdFp",
"CpVd" }
int cs_param_n_properties = 0
static
cs_param_pty_t* cs_param_properties = NULL
static
const char cs_param_pty_type_name[CS_PARAM_N_PTY_TYPES][CS_CDO_LEN_NAME]
static
Initial value:
=
{ N_("isotropic"),
N_("orthotropic"),
N_("anisotropic") }
#define N_(String)
Definition: cs_defs.h:56
const char cs_param_source_term_type_name[CS_PARAM_N_SOURCE_TERM_TYPES][CS_CDO_LEN_NAME]
static
Initial value:
=
{ N_("standard (explicit)"),
N_("implicit"),
N_("implicit/explicit"),
N_("mass"),
N_("head loss") }
#define N_(String)
Definition: cs_defs.h:56
const char cs_param_var_type_name[CS_PARAM_N_VAR_TYPES][CS_CDO_LEN_NAME]
static
Initial value:
=
{ N_("scalar"),
N_("vector"),
N_("tensor") }
#define N_(String)
Definition: cs_defs.h:56