8.3
general documentation
cs_property.cpp File Reference
#include "cs_defs.h"
#include <assert.h>
#include <ctype.h>
#include <float.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "bft_mem.h"
#include "cs_array.h"
#include "cs_log.h"
#include "cs_param_cdo.h"
#include "cs_reco.h"
#include "cs_volume_zone.h"
#include "cs_xdef_eval.h"
#include "cs_property.h"
+ Include dependency graph for cs_property.cpp:

Macros

#define CS_PROPERTY_DBG   0
 

Functions

void cs_property_init_sharing (const cs_mesh_t *mesh, 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_subcell_add (const char *name, cs_property_type_t type)
 Create and initialize a new property structure with an evaluation which can be called on a sub-partition of a cell. This kind of property is not available for all numerical scheme. By default, only one evaluation is performed in each cell. More...
 
cs_property_tcs_property_add_as_product (const char *name, const cs_property_t *pty_a, const cs_property_t *pty_b)
 Define a cs_property_t structure thanks to the product of two properties The type is infered from that of the related properties The value of the property is given as value_ab = value_a * value_b. 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_set_reference_value (cs_property_t *pty, double refval)
 Set the reference value associated to a cs_property_t structure This is a real number even whatever the type of property is. More...
 
void cs_property_set_scaling_factor (cs_property_t *pty, double val)
 Set the scaling factor associated to a cs_property_t structure This is a real number whatever the type of property is. If the property was not defined as CS_PROPERTY_SCALED, then this tag is added. More...
 
void cs_property_unscale (cs_property_t *pty)
 Set the scaling factor associated to a cs_property_t structure This is a real number whatever the type of property is. If the property was not defined as CS_PROPERTY_SCALED, then this tag is added. 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...
 
cs_real_tcs_property_get_array (const cs_property_t *pty)
 Retrieve the array associated to the volume definition for the given property. Available only if there is one definition by array for the volume. More...
 
cs_property_data_t cs_property_data_define (bool need_tensor, bool need_eigen, const cs_property_t *property)
 Define a cs_property_data_t structure (not a pointer to this structure). If property is null then one considers that this is a unitary property. More...
 
void cs_property_data_init (bool need_tensor, bool need_eigen, const cs_property_t *property, cs_property_data_t *data)
 Initialize a cs_property_data_t structure. If property is null then one considers that this is a unitary property. More...
 
cs_xdef_tcs_property_def_constant_value (cs_property_t *pty, double val)
 Define a single uniform and steady isotropic definition for the given cs_property_t structure. This is a specialized variant of cs_property_def_iso_by_value since several assumptions are satisfied. 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_boundary_def_iso_by_value (cs_property_t *pty, const char *zname, double val)
 Define the value at the boundary for the given (isotropic) property. This value is uniform and steady for all the boundary faces associated to the boundary zone named zname. 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_boundary_def_ortho_by_value (cs_property_t *pty, const char *zname, double vals[])
 Define the value at the boundary for the given (orthotropic) property. This value is uniform and steady for all the boundary faces associated to the boundary zone named zname. 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_boundary_def_aniso_by_value (cs_property_t *pty, const char *zname, double tens[3][3])
 Define the value at the boundary for the given (anisotropic) property. This value is uniform and steady for all the boundary faces associated to the boundary zone named zname. More...
 
cs_xdef_tcs_property_def_aniso_sym_by_value (cs_property_t *pty, const char *zname, cs_real_t symtens[6])
 Define the value of a cs_property_t structure thanks to a time function for all cells associated to the zone named zname. Optimized case with a symmetric storage. More...
 
cs_xdef_tcs_property_boundary_def_aniso_sym_by_value (cs_property_t *pty, const char *zname, double tens[6])
 Define the value at the boundary for the given (anisotropic) property. This value is uniform and steady for all the boundary faces associated to the boundary zone named zname Optimized case with a symmetric storage. 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 a time function for all cells associated to the zone named zname. More...
 
cs_xdef_tcs_property_boundary_def_by_time_func (cs_property_t *pty, const char *zname, cs_time_func_t *func, void *input)
 Define the value of a cs_property_t structure at the boundary thanks to a time function in a subdomain attached to a zone named zname. 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 for all cells associated to the zone named zname. More...
 
cs_xdef_tcs_property_boundary_def_by_analytic (cs_property_t *pty, const char *zname, cs_analytic_func_t *func, void *input)
 Define the value of a cs_property_t structure at the boundary thanks to a time function for all boundary faces associated to the zone named zname. 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 the value of a cs_property_t structure thanks to low-level functions specifying how to evaluate the property in each cell (with cell-wise structures or not). This definition applies to all cells associated to the zone named zname. More...
 
cs_xdef_tcs_property_def_by_array (cs_property_t *pty, const char *zname, cs_flag_t val_location, cs_real_t *array, bool is_owner, bool full_length)
 Define a cs_property_t structure thanks to an array of values. If an advanced usage of the definition by array is needed, then call cs_xdef_array_set_adjacency and/or cs_xdef_array_set_sublist. More...
 
cs_xdef_tcs_property_boundary_def_by_array (cs_property_t *pty, const char *zname, cs_flag_t val_loc, cs_real_t *array, bool is_owner, bool full_length)
 Define the values of a property at the boundary thanks to an array. If an advanced usage of the definition by array is needed, then call cs_xdef_array_set_adjacency and/or cs_xdef_array_set_sublist. More...
 
cs_xdef_tcs_property_def_by_field (cs_property_t *pty, cs_field_t *field)
 Define a cs_property_t structure thanks to a field structure. One assumes that all cells are defined using this array. More...
 
cs_xdef_tcs_property_boundary_def_by_field (cs_property_t *pty, cs_field_t *field)
 Define the values of a property at the boundary thanks to a field structure. One assumes that all boundary faces are defined using this array. More...
 
void cs_property_evaluate_def (const cs_property_t *pty, int def_id, bool dense_output, double t_eval, cs_real_t *eval)
 Evaluate the values of the property at cells from the given definition. According to the parameter "dense_ouput", the "eval" array should be allocated with a size equal to pty->dim*n_cells (where "dim" depends on the type of property to handle) when no dense ouput is requested. Otherwise, an allocation size equal to pty->dim * the number of cells associated to the definition "def" is enough. More...
 
void cs_property_evaluate_boundary_def (const cs_property_t *pty, int def_id, bool dense_output, double t_eval, cs_real_t *array)
 Evaluate the values of a property at boundary faces from the given boundary definition. If a dense ouput is not requested, then the size of the resulting array should be allocated at least to pty->dim * n_b_faces. Otherwise, n_b_faces can be replaced by the number of boundary faces associated to the current definition. More...
 
void cs_property_iso_get_cell_values (cs_real_t t_eval, const cs_property_t *pty, int *pty_stride, cs_real_t **p_pty_vals)
 Evaluate the value of the property at each cell. Store the evaluation in the given array. 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_eval_at_boundary_faces (cs_real_t t_eval, const cs_property_t *pty, cs_real_t *array)
 Evaluate the value of the property at each boundary face. Store the result of 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_t tensor[3][3])
 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_t tensor[3][3])
 Compute the value of the tensor attached to 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_c2v_values (const cs_cell_mesh_t *cm, const cs_property_t *pty, cs_real_t t_eval, cs_real_t *eval)
 Compute the values of an isotropic property in each portion of dual cell in a (primal) cell. This relies on the c2v connectivity. More...
 
cs_real_t cs_property_get_face_value (cs_lnum_t f_id, cs_real_t t_eval, const cs_property_t *pty)
 Compute the value of a property at the face center by analytic if possible or by averaging value at cells center. 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...
 

Variables

static const char _err_empty_pty []
 
static const cs_cdo_quantities_tcs_cdo_quant
 
static const cs_cdo_connect_tcs_cdo_connect
 
static const cs_mesh_tcs_mesh
 
static int _n_properties = 0
 
static int _n_max_properties = 0
 
static cs_property_t ** _properties = nullptr
 

Macro Definition Documentation

◆ CS_PROPERTY_DBG

#define CS_PROPERTY_DBG   0

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_add_as_product()

cs_property_t * cs_property_add_as_product ( const char *  name,
const cs_property_t pty_a,
const cs_property_t pty_b 
)

Define a cs_property_t structure thanks to the product of two properties The type is infered from that of the related properties The value of the property is given as value_ab = value_a * value_b.

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

◆ cs_property_boundary_def_aniso_by_value()

cs_xdef_t * cs_property_boundary_def_aniso_by_value ( cs_property_t pty,
const char *  zname,
double  tens[3][3] 
)

Define the value at the boundary for the given (anisotropic) property. This value is uniform and steady for all the boundary faces associated to the boundary zone named zname.

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

◆ cs_property_boundary_def_aniso_sym_by_value()

cs_xdef_t * cs_property_boundary_def_aniso_sym_by_value ( cs_property_t pty,
const char *  zname,
double  tens[6] 
)

Define the value at the boundary for the given (anisotropic) property. This value is uniform and steady for all the boundary faces associated to the boundary zone named zname Optimized case with a symmetric storage.

Parameters
[in,out]ptypointer to a cs_property_t structure
[in]znamename of the associated zone (if null or "" all boundary faces are considered)
[in]tenstensor to set given as an array of 6 values
Returns
a pointer to the resulting cs_xdef_t structure

◆ cs_property_boundary_def_by_analytic()

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

Define the value of a cs_property_t structure at the boundary thanks to a time function for all boundary faces associated to the zone named zname.

Parameters
[in,out]ptypointer to a cs_property_t structure
[in]znamename of the associated zone (if null or "" all boundary faces 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_boundary_def_by_array()

cs_xdef_t * cs_property_boundary_def_by_array ( cs_property_t pty,
const char *  zname,
cs_flag_t  val_loc,
cs_real_t array,
bool  is_owner,
bool  full_length 
)

Define the values of a property at the boundary thanks to an array. If an advanced usage of the definition by array is needed, then call cs_xdef_array_set_adjacency and/or cs_xdef_array_set_sublist.

Parameters
[in,out]ptypointer to a cs_property_t structure
[in]znamenull or name of the boundary zone
[in]val_locinformation to know where are located values
[in]arraypointer to an array
[in]is_ownertransfer the lifecycle to the cs_xdef_t struct. (true or false)
[in]full_lengthif true, the size of "array" should be allocated to the total numbers of entities related to the given location. If false, a new list is allocated and filled with the related subset indirection.
Returns
a pointer to the resulting cs_xdef_t structure

◆ cs_property_boundary_def_by_field()

cs_xdef_t * cs_property_boundary_def_by_field ( cs_property_t pty,
cs_field_t field 
)

Define the values of a property at the boundary thanks to a field structure. One assumes that all boundary faces are defined using this array.

Parameters
[in,out]ptypointer to a cs_property_t structure
[in]fieldpointer to a cs_field_t structure
Returns
a pointer to the resulting cs_xdef_t structure

◆ cs_property_boundary_def_by_time_func()

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

Define the value of a cs_property_t structure at the boundary thanks to a time function in a subdomain attached to a zone named zname.

Parameters
[in,out]ptypointer to a cs_property_t structure
[in]znamename of the associated zone (if null or "" all boundary faces are considered)
[in]funcpointer to a cs_time_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_boundary_def_iso_by_value()

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

Define the value at the boundary for the given (isotropic) property. This value is uniform and steady for all the boundary faces associated to the boundary zone named zname.

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

◆ cs_property_boundary_def_ortho_by_value()

cs_xdef_t * cs_property_boundary_def_ortho_by_value ( cs_property_t pty,
const char *  zname,
double  vals[] 
)

Define the value at the boundary for the given (orthotropic) property. This value is uniform and steady for all the boundary faces associated to the boundary zone named zname.

Parameters
[in,out]ptypointer to a cs_property_t structure
[in]znamename of the associated zone (if null or "" all boundary faces are considered)
[in]valsvalues to set
Returns
a pointer to the resulting cs_xdef_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_c2v_values()

void cs_property_c2v_values ( const cs_cell_mesh_t cm,
const cs_property_t pty,
cs_real_t  t_eval,
cs_real_t eval 
)

Compute the values of an isotropic property in each portion of dual cell in a (primal) cell. This relies on the c2v connectivity.

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,out]evalarray of values storing the evaluation

◆ cs_property_data_define()

cs_property_data_t cs_property_data_define ( bool  need_tensor,
bool  need_eigen,
const cs_property_t property 
)

Define a cs_property_data_t structure (not a pointer to this structure). If property is null then one considers that this is a unitary property.

Parameters
[in]need_tensortrue if one needs a tensor-valued evaluation
[in]need_eigentrue if one needs an evaluation of eigen values
[in]propertypointer to the cs_property_t structure
Returns
an initialized structure

◆ cs_property_data_init()

void cs_property_data_init ( bool  need_tensor,
bool  need_eigen,
const cs_property_t property,
cs_property_data_t data 
)

Initialize a cs_property_data_t structure. If property is null then one considers that this is a unitary property.

Parameters
[in]need_tensortrue if one needs a tensor-valued evaluation
[in]need_eigentrue if one needs an evaluation of eigen values
[in]propertypointer to the cs_property_t structure
[in,out]datastructure to initialize (already allocated)

◆ 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_aniso_sym_by_value()

cs_xdef_t * cs_property_def_aniso_sym_by_value ( cs_property_t pty,
const char *  zname,
cs_real_t  symtens[6] 
)

Define the value of a cs_property_t structure thanks to a time function for all cells associated to the zone named zname. Optimized case with a symmetric storage.

Parameters
[in,out]ptypointer to a cs_property_t structure
[in]znamename of the associated zone (if null or "" all boundary faces are considered)
[in]symtenssymmetric tensor given as an array of 6 values
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 for all cells associated to the zone named zname.

Define the value of a cs_property_t structure thanks to an analytic function for all cells associated to the zone named zname.

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,
const char *  zname,
cs_flag_t  val_location,
cs_real_t array,
bool  is_owner,
bool  full_length 
)

Define a cs_property_t structure thanks to an array of values. If an advanced usage of the definition by array is needed, then call cs_xdef_array_set_adjacency and/or cs_xdef_array_set_sublist.

Parameters
[in,out]ptypointer to a cs_property_t structure
[in]znamename of the zone (if null or "" then all cells are selected)
[in]val_locationinformation to know where are located values
[in]arraypointer to an array
[in]is_ownertransfer the lifecycle to the cs_xdef_t struc. (true or false)
[in]full_lengthif true, the size of "array" is allocated to the total numbers of entities related to the given location. If false, a new list is allocated and filled with the related subset indirection.
Returns
a pointer to the resulting cs_xdef_t structure

◆ cs_property_def_by_field()

cs_xdef_t * cs_property_def_by_field ( cs_property_t pty,
cs_field_t field 
)

Define a cs_property_t structure thanks to a field structure. One assumes that all cells are defined using this array.

Parameters
[in,out]ptypointer to a cs_property_t structure
[in]fieldpointer to a cs_field_t structure
Returns
a pointer to the resulting cs_xdef_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 the value of a cs_property_t structure thanks to low-level functions specifying how to evaluate the property in each cell (with cell-wise structures or not). This definition applies to all cells associated to the zone named zname.

Parameters
[in,out]ptypointer to a cs_property_t structure
[in]znamename of the zone (if null or "" then all cells are selected)
[in]contextpointer to a structure (may be nullptr)
[in]get_eval_at_cellpointer to a function
[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 a time function for all cells associated to the zone named zname.

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

◆ cs_property_def_constant_value()

cs_xdef_t * cs_property_def_constant_value ( cs_property_t pty,
double  val 
)

Define a single uniform and steady isotropic definition for the given cs_property_t structure. This is a specialized variant of cs_property_def_iso_by_value since several assumptions are satisfied.

Parameters
[in,out]ptypointer to a cs_property_t structure
[in]valvalue to set
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_boundary_faces()

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

Evaluate the value of the property at each boundary face. Store the result of 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_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_evaluate_boundary_def()

void cs_property_evaluate_boundary_def ( const cs_property_t pty,
int  def_id,
bool  dense_output,
double  t_eval,
cs_real_t array 
)

Evaluate the values of a property at boundary faces from the given boundary definition. If a dense ouput is not requested, then the size of the resulting array should be allocated at least to pty->dim * n_b_faces. Otherwise, n_b_faces can be replaced by the number of boundary faces associated to the current definition.

No scaling is applied to the value. This should be done with a higher level function like cs_property_eval_at_boundary_faces

Parameters
[in]ptypointer to a cs_property_t structure
[in]def_idid associated to the definition
[in]dense_outputtrue/false
[in]t_evaltime at which one performs the evaluation
[in,out]arrayarray storing the result of the evaluation(s)

◆ cs_property_evaluate_def()

void cs_property_evaluate_def ( const cs_property_t pty,
int  def_id,
bool  dense_output,
double  t_eval,
cs_real_t eval 
)

Evaluate the values of the property at cells from the given definition. According to the parameter "dense_ouput", the "eval" array should be allocated with a size equal to pty->dim*n_cells (where "dim" depends on the type of property to handle) when no dense ouput is requested. Otherwise, an allocation size equal to pty->dim * the number of cells associated to the definition "def" is enough.

No scaling is applied to the value. This should be done with a higher level function like cs_property_eval_at_cells or cs_property_get_cell_tensor

Parameters
[in]ptypointer to a property structure
[in]def_idid associated to the definition
[in]dense_outputtrue/false
[in]t_evaltime at which one performs the evaluation
[in,out]evalarray storing the result of the evaluations

◆ 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_array()

cs_real_t * cs_property_get_array ( const cs_property_t pty)

Retrieve the array associated to the volume definition for the given property. Available only if there is one definition by array for the volume.

Parameters
[in]ptypointer to the property structure
Returns
a pointer to the array or nullptr

◆ 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_t  tensor[3][3] 
)

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

Compute the value of the tensor attached to 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_face_value()

cs_real_t cs_property_get_face_value ( cs_lnum_t  f_id,
cs_real_t  t_eval,
const cs_property_t pty 
)

Compute the value of a property at the face center by analytic if possible or by averaging value at cells center.

Compute the value of a property at the face center.

Parameters
[in]f_idid of the current face
[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 face

◆ 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_init_sharing()

void cs_property_init_sharing ( const cs_mesh_t mesh,
const cs_cdo_quantities_t quant,
const cs_cdo_connect_t connect 
)

Set shared pointers to main domain members.

Parameters
[in]meshmesh structure shared between FV and CDO
[in]quantadditional mesh quantities struct.
[in]connectpointer to a cs_cdo_connect_t struct.

◆ cs_property_iso_get_cell_values()

void cs_property_iso_get_cell_values ( cs_real_t  t_eval,
const cs_property_t pty,
int *  pty_stride,
cs_real_t **  p_pty_vals 
)

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
[out]pty_stride= 0 if uniform, =1 otherwise
[in,out]p_pty_valspointer to an array of values. Allocated if not The size of the allocation depends on the value of the pty_stride

◆ 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_reference_value()

void cs_property_set_reference_value ( cs_property_t pty,
double  refval 
)

Set the reference value associated to a cs_property_t structure This is a real number even whatever the type of property is.

Parameters
[in,out]ptypointer to a cs_property_t structure
[in]refvalvalue to set

◆ cs_property_set_scaling_factor()

void cs_property_set_scaling_factor ( cs_property_t pty,
double  val 
)

Set the scaling factor associated to a cs_property_t structure This is a real number whatever the type of property is. If the property was not defined as CS_PROPERTY_SCALED, then this tag is added.

Parameters
[in,out]ptypointer to a cs_property_t structure
[in]valvalue to set

◆ cs_property_subcell_add()

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

Create and initialize a new property structure with an evaluation which can be called on a sub-partition of a cell. This kind of property is not available for all numerical scheme. By default, only one evaluation is performed in each cell.

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

◆ 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_t  tensor[3][3] 
)

Compute the value of the tensor attached to 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_unscale()

void cs_property_unscale ( cs_property_t pty)

Set the scaling factor associated to a cs_property_t structure This is a real number whatever the type of property is. If the property was not defined as CS_PROPERTY_SCALED, then this tag is added.

Parameters
[in,out]ptypointer to a cs_property_t structure

◆ 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

Variable Documentation

◆ _err_empty_pty

const char _err_empty_pty[]
static
Initial value:
=
" Stop setting an empty cs_property_t structure.\n"
" Please check your settings.\n"

◆ _n_max_properties

int _n_max_properties = 0
static

◆ _n_properties

int _n_properties = 0
static

◆ _properties

cs_property_t** _properties = nullptr
static

◆ cs_cdo_connect

const cs_cdo_connect_t* cs_cdo_connect
static

◆ cs_cdo_quant

const cs_cdo_quantities_t* cs_cdo_quant
static

◆ cs_mesh

const cs_mesh_t* cs_mesh
static