My Project
programmer's documentation
Data Structures | Macros | Enumerations | Functions
cs_property.h File Reference
#include "cs_flag.h"
#include "cs_param.h"
#include "cs_xdef.h"
#include "cs_xdef_cw_eval.h"
#include "cs_xdef_eval.h"
Include dependency graph for cs_property.h:

Go to the source code of this file.

Data Structures

struct  cs_property_t
 

Macros

#define CS_PROPERTY_POST_FOURIER   (1 << 0)
 

Enumerations

enum  cs_property_key_t { CS_PTYKEY_POST_FOURIER, CS_PTYKEY_N_KEYS }
 List of available keys for setting options on a property. More...
 
enum  cs_property_type_t { CS_PROPERTY_ISO, CS_PROPERTY_ORTHO, CS_PROPERTY_ANISO, CS_PROPERTY_N_TYPES }
 Type of property to consider. More...
 

Functions

void cs_property_set_shared_pointers (const cs_cdo_quantities_t *quant, const cs_cdo_connect_t *connect)
 Set shared pointers to main domain members. More...
 
int cs_property_get_n_properties (void)
 Retrieve the number of properties. More...
 
cs_property_tcs_property_add (const char *name, cs_property_type_t type)
 Create and initialize a new property structure. More...
 
cs_property_tcs_property_by_name (const char *name)
 Find the related property definition from its name. More...
 
cs_property_tcs_property_by_id (int id)
 Find the related property definition from its id. More...
 
void cs_property_set_option (cs_property_t *pty, cs_property_key_t key)
 Set optional parameters related to a cs_property_t structure. More...
 
void cs_property_destroy_all (void)
 Free all cs_property_t structures and the array storing all the structures. More...
 
void cs_property_finalize_setup (void)
 Last stage of the definition of a property based on several definitions (i.e. definition by subdomains) More...
 
static bool cs_property_is_uniform (const cs_property_t *pty)
 returns true if the property is uniform, otherwise false More...
 
static bool cs_property_is_isotropic (const cs_property_t *pty)
 returns true if the property is isotropic, otherwise false More...
 
static const char * cs_property_get_name (const cs_property_t *pty)
 Retrieve the name of a property. More...
 
static cs_property_type_t cs_property_get_type (const cs_property_t *pty)
 Retrieve the type of a property. More...
 
cs_xdef_tcs_property_def_iso_by_value (cs_property_t *pty, const char *zname, double val)
 Define an isotropic cs_property_t structure by value for entities related to a volume zone. More...
 
cs_xdef_tcs_property_def_ortho_by_value (cs_property_t *pty, const char *zname, double val[])
 Define an orthotropic cs_property_t structure by value for entities related to a volume zone. More...
 
cs_xdef_tcs_property_def_aniso_by_value (cs_property_t *pty, const char *zname, cs_real_t tens[3][3])
 Define an anisotropic cs_property_t structure by value for entities related to a volume zone. More...
 
cs_xdef_tcs_property_def_by_time_func (cs_property_t *pty, const char *zname, cs_time_func_t *func, void *input)
 Define a cs_property_t structure thanks to an analytic function in a subdomain attached to the mesh location named ml_name. More...
 
cs_xdef_tcs_property_def_by_analytic (cs_property_t *pty, const char *zname, cs_analytic_func_t *func, void *input)
 Define a cs_property_t structure thanks to an analytic function in a subdomain attached to the mesh location named ml_name. More...
 
cs_xdef_tcs_property_def_by_func (cs_property_t *pty, const char *zname, void *context, cs_xdef_eval_t *get_eval_at_cell, cs_xdef_cw_eval_t *get_eval_at_cell_cw)
 Define a cs_property_t structure thanks to law depending on one scalar variable in a subdomain attached to the mesh location named ml_name. More...
 
cs_xdef_tcs_property_def_by_array (cs_property_t *pty, cs_flag_t loc, cs_real_t *array, bool is_owner, cs_lnum_t *index)
 Define a cs_property_t structure thanks to an array of values. More...
 
void cs_property_def_by_field (cs_property_t *pty, cs_field_t *field)
 Define a cs_property_t structure thanks to an array of values. More...
 
void cs_property_eval_at_cells (cs_real_t t_eval, const cs_property_t *pty, cs_real_t *array)
 Evaluate the value of the property at each cell. Store the evaluation in the given array. More...
 
void cs_property_get_cell_tensor (cs_lnum_t c_id, cs_real_t t_eval, const cs_property_t *pty, bool do_inversion, cs_real_3_t *tensor)
 Compute the value of the tensor attached a property at the cell center. More...
 
cs_real_t cs_property_get_cell_value (cs_lnum_t c_id, cs_real_t t_eval, const cs_property_t *pty)
 Compute the value of a property at the cell center. More...
 
void cs_property_tensor_in_cell (const cs_cell_mesh_t *cm, const cs_property_t *pty, cs_real_t t_eval, bool do_inversion, cs_real_3_t *tensor)
 Compute the value of the tensor attached a property at the cell center Version using a cs_cell_mesh_t structure. More...
 
cs_real_t cs_property_value_in_cell (const cs_cell_mesh_t *cm, const cs_property_t *pty, cs_real_t t_eval)
 Compute the value of a property at the cell center Version using a cs_cell_mesh_t structure. More...
 
void cs_property_get_fourier (const cs_property_t *pty, cs_real_t t_eval, double dt, cs_real_t fourier[])
 Compute the Fourier number in each cell. More...
 
void cs_property_log_setup (void)
 Print a summary of the settings for all defined cs_property_t structures. More...
 

Enumeration Type Documentation

◆ cs_property_key_t

List of available keys for setting options on a property.

Enumerator
CS_PTYKEY_POST_FOURIER 

Perform the computation (and post-processing) of the Fourier number

CS_PTYKEY_N_KEYS 

◆ cs_property_type_t

Type of property to consider.

Enumerator
CS_PROPERTY_ISO 

Isotropic behavior (one real number is sufficient to describe the property)

CS_PROPERTY_ORTHO 

Orthotropic behavior (three real numbers describe the behavior assuming that the different behavior is aligned with Cartesian axis)

CS_PROPERTY_ANISO 

Anisotropic behavior (a 3x3 tensor describe the behavior). This tensor should be symmetric positive definite (i.e 6 real numbers describe the behavior).

CS_PROPERTY_N_TYPES 

Function Documentation

◆ cs_property_add()

cs_property_t* cs_property_add ( const char *  name,
cs_property_type_t  type 
)

Create and initialize a new property structure.

Parameters
[in]namename of the property
[in]typetype of property
Returns
a pointer to a new allocated cs_property_t structure

◆ cs_property_by_id()

cs_property_t* cs_property_by_id ( int  id)

Find the related property definition from its id.

Parameters
[in]idid of the property to find
Returns
NULL if not found otherwise the associated pointer

◆ cs_property_by_name()

cs_property_t* cs_property_by_name ( const char *  name)

Find the related property definition from its name.

Parameters
[in]namename of the property to find
Returns
NULL if not found otherwise the associated pointer

◆ cs_property_def_aniso_by_value()

cs_xdef_t* cs_property_def_aniso_by_value ( cs_property_t pty,
const char *  zname,
cs_real_t  tens[3][3] 
)

Define an anisotropic cs_property_t structure by value for entities related to a volume zone.

Parameters
[in,out]ptypointer to a cs_property_t structure
[in]znamename of the associated zone (if NULL or "" all cells are considered)
[in]tensvalues to set (3x3 tensor)
Returns
a pointer to the resulting cs_xdef_t structure

◆ cs_property_def_by_analytic()

cs_xdef_t* cs_property_def_by_analytic ( cs_property_t pty,
const char *  zname,
cs_analytic_func_t func,
void *  input 
)

Define a cs_property_t structure thanks to an analytic function in a subdomain attached to the mesh location named ml_name.

Parameters
[in,out]ptypointer to a cs_property_t structure
[in]znamename of the associated zone (if NULL or "" all cells are considered)
[in]funcpointer to a cs_analytic_func_t function
[in]inputNULL or pointer to a structure cast on-the-fly
Returns
a pointer to the resulting cs_xdef_t structure

◆ cs_property_def_by_array()

cs_xdef_t* cs_property_def_by_array ( cs_property_t pty,
cs_flag_t  loc,
cs_real_t array,
bool  is_owner,
cs_lnum_t index 
)

Define a cs_property_t structure thanks to an array of values.

Parameters
[in,out]ptypointer to a cs_property_t structure
[in]locinformation to know where are located values
[in]arraypointer to an array
[in]is_ownertransfer the lifecycle to the cs_xdef_t structure (true or false)
[in]indexoptional pointer to the array index
Returns
a pointer to the resulting cs_xdef_t structure

◆ cs_property_def_by_field()

void cs_property_def_by_field ( cs_property_t pty,
cs_field_t field 
)

Define a cs_property_t structure thanks to an array of values.

Parameters
[in,out]ptypointer to a cs_property_t structure
[in]fieldpointer to a cs_field_t structure

◆ cs_property_def_by_func()

cs_xdef_t* cs_property_def_by_func ( cs_property_t pty,
const char *  zname,
void *  context,
cs_xdef_eval_t get_eval_at_cell,
cs_xdef_cw_eval_t get_eval_at_cell_cw 
)

Define a cs_property_t structure thanks to law depending on one scalar variable in a subdomain attached to the mesh location named ml_name.

Parameters
[in,out]ptypointer to a cs_property_t structure
[in]znamename of the associated zone (if NULL or "" all cells are considered)
[in]contextpointer to a structure (may be NULL)
[in]get_eval_at_cellpointer to a function (may be NULL)
[in]get_eval_at_cell_cwpointer to a function
Returns
a pointer to the resulting cs_xdef_t structure

◆ cs_property_def_by_time_func()

cs_xdef_t* cs_property_def_by_time_func ( cs_property_t pty,
const char *  zname,
cs_time_func_t func,
void *  input 
)

Define a cs_property_t structure thanks to an analytic function in a subdomain attached to the mesh location named ml_name.

Parameters
[in,out]ptypointer to a cs_property_t structure
[in]znamename of the associated zone (if NULL or "" all cells are considered)
[in]funcpointer to a cs_analytic_func_t function
[in]inputNULL or pointer to a structure cast on-the-fly
Returns
a pointer to the resulting cs_xdef_t structure

◆ cs_property_def_iso_by_value()

cs_xdef_t* cs_property_def_iso_by_value ( cs_property_t pty,
const char *  zname,
double  val 
)

Define an isotropic cs_property_t structure by value for entities related to a volume zone.

Parameters
[in,out]ptypointer to a cs_property_t structure
[in]znamename of the associated zone (if NULL or "" all cells are considered)
[in]valvalue to set
Returns
a pointer to the resulting cs_xdef_t structure

◆ cs_property_def_ortho_by_value()

cs_xdef_t* cs_property_def_ortho_by_value ( cs_property_t pty,
const char *  zname,
double  val[] 
)

Define an orthotropic cs_property_t structure by value for entities related to a volume zone.

Parameters
[in,out]ptypointer to a cs_property_t structure
[in]znamename of the associated zone (if NULL or "" all cells are considered)
[in]valvalues to set (vector of size 3)
Returns
a pointer to the resulting cs_xdef_t structure

◆ cs_property_destroy_all()

void cs_property_destroy_all ( void  )

Free all cs_property_t structures and the array storing all the structures.

◆ cs_property_eval_at_cells()

void cs_property_eval_at_cells ( cs_real_t  t_eval,
const cs_property_t pty,
cs_real_t array 
)

Evaluate the value of the property at each cell. Store the evaluation in the given array.

Parameters
[in]t_evalphysical time at which one evaluates the term
[in]ptypointer to a cs_property_t structure
[in,out]arraypointer to an array of values (must be allocated)

◆ cs_property_finalize_setup()

void cs_property_finalize_setup ( void  )

Last stage of the definition of a property based on several definitions (i.e. definition by subdomains)

◆ cs_property_get_cell_tensor()

void cs_property_get_cell_tensor ( cs_lnum_t  c_id,
cs_real_t  t_eval,
const cs_property_t pty,
bool  do_inversion,
cs_real_3_t tensor 
)

Compute the value of the tensor attached a property at the cell center.

Parameters
[in]c_idid of the current cell
[in]t_evalphysical time at which one evaluates the term
[in]ptypointer to a cs_property_t structure
[in]do_inversiontrue or false
[in,out]tensor3x3 matrix

◆ cs_property_get_cell_value()

cs_real_t cs_property_get_cell_value ( cs_lnum_t  c_id,
cs_real_t  t_eval,
const cs_property_t pty 
)

Compute the value of a property at the cell center.

Parameters
[in]c_idid of the current cell
[in]t_evalphysical time at which one evaluates the term
[in]ptypointer to a cs_property_t structure
Returns
the value of the property for the given cell

◆ cs_property_get_fourier()

void cs_property_get_fourier ( const cs_property_t pty,
cs_real_t  t_eval,
double  dt,
cs_real_t  fourier[] 
)

Compute the Fourier number in each cell.

Parameters
[in]ptypointer to the diffusive property struct.
[in]t_evalphysical time at which one evaluates the term
[in]dtvalue of the current time step
[in,out]fourierpointer to an array storing Fourier numbers

◆ cs_property_get_n_properties()

int cs_property_get_n_properties ( void  )

Retrieve the number of properties.

Returns
the number of properties

◆ cs_property_get_name()

static const char* cs_property_get_name ( const cs_property_t pty)
inlinestatic

Retrieve the name of a property.

Parameters
[in]ptypointer to a property
Returns
the name of the related property

◆ cs_property_get_type()

static cs_property_type_t cs_property_get_type ( const cs_property_t pty)
inlinestatic

Retrieve the type of a property.

Parameters
[in]ptypointer to a property
Returns
the type of the related property

◆ cs_property_is_isotropic()

static bool cs_property_is_isotropic ( const cs_property_t pty)
inlinestatic

returns true if the property is isotropic, otherwise false

Parameters
[in]ptypointer to a property to test
Returns
true or false

◆ cs_property_is_uniform()

static bool cs_property_is_uniform ( const cs_property_t pty)
inlinestatic

returns true if the property is uniform, otherwise false

Parameters
[in]ptypointer to a property to test
Returns
true or false

◆ cs_property_log_setup()

void cs_property_log_setup ( void  )

Print a summary of the settings for all defined cs_property_t structures.

◆ cs_property_set_option()

void cs_property_set_option ( cs_property_t pty,
cs_property_key_t  key 
)

Set optional parameters related to a cs_property_t structure.

Parameters
[in,out]ptypointer to a cs_property_t structure
[in]keykey related to a setting option

◆ cs_property_set_shared_pointers()

void cs_property_set_shared_pointers ( const cs_cdo_quantities_t quant,
const cs_cdo_connect_t connect 
)

Set shared pointers to main domain members.

Parameters
[in]quantadditional mesh quantities struct.
[in]connectpointer to a cs_cdo_connect_t struct.

◆ cs_property_tensor_in_cell()

void cs_property_tensor_in_cell ( const cs_cell_mesh_t cm,
const cs_property_t pty,
cs_real_t  t_eval,
bool  do_inversion,
cs_real_3_t tensor 
)

Compute the value of the tensor attached a property at the cell center Version using a cs_cell_mesh_t structure.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]ptypointer to a cs_property_t structure
[in]t_evalphysical time at which one evaluates the term
[in]do_inversiontrue or false
[in,out]tensor3x3 matrix

◆ cs_property_value_in_cell()

cs_real_t cs_property_value_in_cell ( const cs_cell_mesh_t cm,
const cs_property_t pty,
cs_real_t  t_eval 
)

Compute the value of a property at the cell center Version using a cs_cell_mesh_t structure.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]ptypointer to a cs_property_t structure
[in]t_evalphysical time at which one evaluates the term
Returns
the value of the property for the given cell