1 #ifndef __CS_PROPERTY_H__
2 #define __CS_PROPERTY_H__
51 #define CS_PROPERTY_MASS_DENSITY "mass_density"
61 #define CS_PROPERTY_POST_FOURIER (1 << 0)
75 #define CS_PROPERTY_ISO (1 << 0)
81 #define CS_PROPERTY_ORTHO (1 << 1)
88 #define CS_PROPERTY_ANISO (1 << 2)
94 #define CS_PROPERTY_ANISO_SYM (1 << 3)
100 #define CS_PROPERTY_BY_PRODUCT (1 << 4)
106 #define CS_PROPERTY_SCALED (1 << 5)
115 #define CS_PROPERTY_SUBCELL_DEFINITION (1 << 6)
378 static inline const char *
#define restrict
Definition: cs_defs.h:139
#define BEGIN_C_DECLS
Definition: cs_defs.h:514
double cs_real_t
Floating-point value.
Definition: cs_defs.h:319
#define END_C_DECLS
Definition: cs_defs.h:515
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:313
unsigned short int cs_flag_t
Definition: cs_defs.h:321
@ dt
Definition: cs_field_pointer.h:65
#define CS_FLAG_STATE_UNIFORM
Definition: cs_flag.h:103
#define CS_FLAG_STATE_STEADY
Definition: cs_flag.h:106
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.
Definition: cs_param_types.h:127
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 gi...
Definition: cs_param_types.h:172
cs_xdef_t * cs_property_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 thanks to an analytic function for all cells associated...
Definition: cs_property.c:2225
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 unit...
Definition: cs_property.c:1567
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 typ...
Definition: cs_property.c:1188
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 g...
Definition: cs_property.c:3171
int cs_property_get_n_properties(void)
Retrieve the number of properties.
Definition: cs_property.c:939
static const char * cs_property_get_name(const cs_property_t *pty)
Retrieve the name of a property.
Definition: cs_property.h:379
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 defin...
Definition: cs_property.c:2480
cs_property_key_t
List of available keys for setting options on a property.
Definition: cs_property.h:132
@ CS_PTYKEY_POST_FOURIER
Definition: cs_property.h:134
@ CS_PTYKEY_N_KEYS
Definition: cs_property.h:135
void cs_property_destroy_all(void)
Free all cs_property_t structures and the array storing all the structures.
Definition: cs_property.c:1228
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 stea...
Definition: cs_property.c:1944
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 bou...
Definition: cs_property.c:2617
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.
Definition: cs_property.c:3524
cs_property_t * cs_property_add(const char *name, cs_property_type_t type)
Create and initialize a new property structure.
Definition: cs_property.c:956
cs_property_t * cs_property_by_name(const char *name)
Find the related property definition from its name.
Definition: cs_property.c:1088
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....
Definition: cs_property.c:3706
void cs_property_finalize_setup(void)
Last stage of the definition of a property based on several definitions (i.e. definition by subdomain...
Definition: cs_property.c:1278
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....
Definition: cs_property.c:2749
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.
Definition: cs_property.c:2945
static bool cs_property_is_constant(const cs_property_t *pty)
Returns true if the property is steady and uniform, otherwise false.
Definition: cs_property.h:264
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 subdomai...
Definition: cs_property.c:2171
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.
Definition: cs_property.c:921
void cs_property_set_option(cs_property_t *pty, cs_property_key_t key)
Set optional parameters related to a cs_property_t structure.
Definition: cs_property.c:1135
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 tha...
Definition: cs_property.c:1025
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.
Definition: cs_property.c:1788
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...
Definition: cs_property.c:1745
static bool cs_property_is_uniform(const cs_property_t *pty)
Returns true if the property is uniform, otherwise false.
Definition: cs_property.h:312
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...
Definition: cs_property.c:1508
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 typ...
Definition: cs_property.c:1210
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.
Definition: cs_property.c:3649
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 t...
Definition: cs_property.c:1166
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...
Definition: cs_property.c:2379
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 "d...
Definition: cs_property.c:2685
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 evaluat...
Definition: cs_property.c:2325
static cs_property_type_t cs_property_get_type(const cs_property_t *pty)
Retrieve the type of a property.
Definition: cs_property.h:398
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 bound...
Definition: cs_property.c:2274
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 stea...
Definition: cs_property.c:1840
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.
Definition: cs_property.c:3000
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 ...
Definition: cs_property.c:2555
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....
Definition: cs_property.c:1629
static bool cs_property_is_isotropic(const cs_property_t *pty)
Returns true if the property is isotropic, otherwise false.
Definition: cs_property.h:334
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.
Definition: cs_property.c:1883
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_mes...
Definition: cs_property.c:3583
static int cs_property_get_dim(const cs_property_t *pty)
Retrieve the dimension of the property.
Definition: cs_property.h:417
cs_property_t * cs_property_by_id(int id)
Find the related property definition from its id.
Definition: cs_property.c:1115
void cs_property_log_setup(void)
Print a summary of the settings for all defined cs_property_t structures.
Definition: cs_property.c:3903
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 t...
Definition: cs_property.c:1994
cs_flag_t cs_property_type_t
Definition: cs_property.h:123
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 ther...
Definition: cs_property.c:1477
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-partit...
Definition: cs_property.c:1003
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.
Definition: cs_property.c:3837
static bool cs_property_is_subcell(const cs_property_t *pty)
Returns true if the property is allowed to be evaluated on a sub-partition of a cell.
Definition: cs_property.h:357
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 to a property at the cell center.
Definition: cs_property.c:3460
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 stea...
Definition: cs_property.c:2048
static bool cs_property_is_steady(const cs_property_t *pty)
Returns true if the property is steady, otherwise false.
Definition: cs_property.h:290
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...
Definition: cs_property.c:2093
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.
Definition: cs_property.c:1688
void() cs_xdef_cw_eval_t(const cs_cell_mesh_t *cm, cs_real_t time_eval, void *input, cs_real_t *eval)
Function pointer for evaluating a quantity defined through a descriptor (cs_xdef_t structure) by a ce...
Definition: cs_xdef_cw_eval.h:70
void() cs_xdef_eval_t(cs_lnum_t n_elts, const cs_lnum_t *elt_ids, bool dense_output, const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, cs_real_t time_eval, void *context, cs_real_t *eval)
Function pointer for evaluating a quantity defined through a descriptor (cs_xdef_t structure)
Definition: cs_xdef_eval.h:66
#define CS_PROPERTY_ISO
Definition: cs_property.h:75
#define CS_PROPERTY_ORTHO
Definition: cs_property.h:81
#define CS_PROPERTY_ANISO
Definition: cs_property.h:88
#define CS_PROPERTY_SUBCELL_DEFINITION
Definition: cs_property.h:115
#define CS_PROPERTY_ANISO_SYM
Definition: cs_property.h:94
Definition: cs_property.h:151
cs_flag_t process_flag
Definition: cs_property.h:156
cs_real_t scaling_factor
Definition: cs_property.h:171
short int * b_def_ids
Definition: cs_property.h:213
int n_related_properties
Definition: cs_property.h:200
cs_property_type_t type
Definition: cs_property.h:157
cs_xdef_cw_eval_t ** get_eval_at_cell_cw
Definition: cs_property.h:195
int n_definitions
Definition: cs_property.h:175
int id
Definition: cs_property.h:154
cs_xdef_t ** b_defs
Definition: cs_property.h:208
int n_b_definitions
Definition: cs_property.h:207
const cs_property_t ** related_properties
Definition: cs_property.h:201
cs_xdef_eval_t ** get_eval_at_cell
Definition: cs_property.h:190
cs_flag_t state_flag
Definition: cs_property.h:155
short int * def_ids
Definition: cs_property.h:181
char *restrict name
Definition: cs_property.h:153
cs_real_t ref_value
Definition: cs_property.h:164
cs_xdef_t ** defs
Definition: cs_property.h:176
Definition: cs_cdo_connect.h:61
Definition: cs_cdo_quantities.h:137
Set of local quantities and connectivities related to a mesh cell.
Definition: cs_cdo_local.h:203
Field descriptor.
Definition: cs_field.h:131
Structure storing the evaluation of a property and its related data.
Definition: cs_property.h:223
const cs_property_t * property
Definition: cs_property.h:225
bool need_eigen
Definition: cs_property.h:239
bool need_tensor
Definition: cs_property.h:233
bool is_unity
Definition: cs_property.h:228
cs_real_t eigen_max
Definition: cs_property.h:240
cs_real_t eigen_ratio
Definition: cs_property.h:241
cs_real_t value
Definition: cs_property.h:235
bool is_iso
Definition: cs_property.h:227
Structure associated to the definition of a property relying on the cs_xdef_t structure.
Structure storing medata for defining a quantity in a very flexible way.
Definition: cs_xdef.h:160