![]() |
programmer's documentation
|
#include "cs_defs.h"
#include <assert.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <bft_mem.h>
#include "cs_log.h"
#include "cs_math.h"
#include "cs_mesh_location.h"
#include "cs_reco.h"
#include "cs_property.h"
Macros | |
#define | CS_PROPERTY_DBG 0 |
Functions | |
static void | _check_tensor_symmetry (const cs_property_t *pty, cs_get_t get) |
Check if the settings are valid. More... | |
static cs_param_def_t * | _init_new_def (cs_property_t *pty, const char *ml_name) |
Add a new definition to a cs_property_t structure defined by domain Sanity checks on the settings related to this definition. More... | |
static void | _get_tensor_by_value (const cs_property_t *pty, cs_get_t get, cs_real_3_t *tensor) |
Compute the value using a law with one argument. More... | |
static double | _get_cell_val_from_array_cm (const cs_cell_mesh_t *cm, const cs_desc_t desc, const cs_real_t array[]) |
Retrieve the value for a cell from an array Version using a cs_cell_mesh_t structure. More... | |
static void | _get_cell_vec_from_array_cm (const cs_cell_mesh_t *cm, const cs_desc_t desc, const cs_real_t array[], cs_real_3_t vect_val) |
Retrieve the vector at the cell center for cell c_id from an array Version using a cs_cell_mesh_t structure. More... | |
static double | _get_cell_val_from_array (cs_lnum_t c_id, const cs_desc_t desc, const cs_real_t array[]) |
Retrieve the value at the cell center for cell c_id from an array. More... | |
static void | _get_cell_vec_from_array (cs_lnum_t c_id, const cs_desc_t desc, const cs_real_t array[], cs_real_3_t vect_val) |
Retrieve the vector at the cell center for cell c_id from an array. More... | |
void | cs_property_set_shared_pointers (const cs_cdo_quantities_t *quant, const cs_cdo_connect_t *connect, const cs_time_step_t *time_step) |
Set shared pointers to main domain members. More... | |
cs_property_t * | cs_property_create (const char *name, const char *key_type, int n_subdomains) |
Create and initialize a new property structure. More... | |
void | cs_property_last_definition_stage (cs_property_t *pty) |
Last stage of the definition of a property based on several subdomains. More... | |
cs_property_t * | cs_property_free (cs_property_t *pty) |
Free a cs_property_t structure. More... | |
bool | cs_property_check_name (const cs_property_t *pty, const char *ref_name) |
Check if the given property has the name ref_name. More... | |
bool | cs_property_is_uniform (const cs_property_t *pty) |
returns true if the property is uniform, otherwise false More... | |
const char * | cs_property_get_name (const cs_property_t *pty) |
Retrieve the name of a property. More... | |
cs_property_type_t | cs_property_get_type (const cs_property_t *pty) |
Retrieve the type of a property. More... | |
void | cs_property_set_option (cs_property_t *pty, cs_property_key_t key, const char *keyval) |
Set optional parameters related to a cs_property_t structure. More... | |
void | cs_property_def_by_value (cs_property_t *pty, const char *ml_name, const char *key_val) |
Define a cs_property_t structure by value for entities attached to the mesh location named ml_name. More... | |
void | cs_property_iso_def_by_value (cs_property_t *pty, const char *ml_name, double val) |
Define an isotropic cs_property_t structure by value for entities attached to the mesh location named ml_name. More... | |
void | cs_property_ortho_def_by_value (cs_property_t *pty, const char *ml_name, const double val[]) |
Define orthotropic cs_property_t structure by value for entities attached to the mesh location named ml_name. More... | |
void | cs_property_aniso_def_by_value (cs_property_t *pty, const char *ml_name, const double tens[3][3]) |
Define an anisotropic cs_property_t structure by value for entities attached to the mesh location named ml_name. More... | |
void | cs_property_def_by_analytic (cs_property_t *pty, const char *ml_name, cs_analytic_func_t *func) |
Define a cs_property_t structure thanks to an analytic function in a subdomain attached to the mesh location named ml_name. More... | |
void | cs_property_def_by_onevar_law (cs_property_t *pty, const char *ml_name, const void *context, cs_onevar_law_func_t *func) |
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... | |
void | cs_property_def_by_twovar_law (cs_property_t *pty, const char *ml_name, const void *context, cs_twovar_law_func_t *func) |
Define a cs_property_t structure thanks to a law depending on two scalars variables in a subdomain attached to the mesh location named ml_name. More... | |
void | cs_property_def_by_array (cs_property_t *pty, cs_desc_t desc, cs_real_t *array) |
Define a cs_property_t structure thanks to an array of values. More... | |
void | cs_property_set_array (cs_property_t *pty, cs_desc_t desc, cs_real_t *array) |
Set the "array" member of a cs_property_t structure. More... | |
void | cs_property_set_second_array (cs_property_t *pty, cs_desc_t desc, cs_real_t *array) |
Set the second "array" member of a cs_property_t structure. More... | |
void | cs_property_get_cell_tensor (cs_lnum_t c_id, 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, 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, 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) |
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, double dt, cs_real_t fourier[]) |
Compute the Fourier number in each cell. More... | |
void | cs_property_summary (const cs_property_t *pty) |
Print a summary of a cs_property_t structure. More... | |
Variables | |
static const char | _err_empty_pty [] |
static const cs_cdo_quantities_t * | cs_cdo_quant |
static const cs_cdo_connect_t * | cs_cdo_connect |
static const cs_time_step_t * | cs_time_step |
#define CS_PROPERTY_DBG 0 |
|
inlinestatic |
Check if the settings are valid.
[in] | pty | pointer to a cs_property_t structure |
[in] | get | accessor to the tensor values |
|
static |
Retrieve the value at the cell center for cell c_id from an array.
[in] | c_id | id of the cell to treat |
[in] | desc | information about the array to handle |
[in] | array | values |
|
static |
Retrieve the value for a cell from an array Version using a cs_cell_mesh_t structure.
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | desc | information about the array to handle |
[in] | array | array of values (mesh view not cellwise) |
|
static |
Retrieve the vector at the cell center for cell c_id from an array.
[in] | c_id | if of the cell to treat |
[in] | desc | information about the array to handle |
[in] | array | values |
[in,out] | vect_val | vector at the cell center |
|
static |
Retrieve the vector at the cell center for cell c_id from an array Version using a cs_cell_mesh_t structure.
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | desc | information about the array to handle |
[in] | array | values |
[in,out] | vect_val | vector at the cell center |
|
static |
Compute the value using a law with one argument.
[in] | pty | pointer to a cs_property_t structure |
[in] | get | accessor to the value |
[in,out] | tensor | result stored in a 3x3 tensor |
|
static |
Add a new definition to a cs_property_t structure defined by domain Sanity checks on the settings related to this definition.
[in,out] | pty | pointer to a cs_property_t structure |
[in] | ml_name | name of the related mesh location |
void cs_property_aniso_def_by_value | ( | cs_property_t * | pty, |
const char * | ml_name, | ||
const double | tens[3][3] | ||
) |
Define an anisotropic cs_property_t structure by value for entities attached to the mesh location named ml_name.
[in,out] | pty | pointer to a cs_property_t structure |
[in] | ml_name | name of the related mesh location |
[in] | tens | values to set (3x3 tensor) |
bool cs_property_check_name | ( | const cs_property_t * | pty, |
const char * | ref_name | ||
) |
Check if the given property has the name ref_name.
[in] | pty | pointer to a cs_property_t structure to test |
[in] | ref_name | name of the property to find |
cs_property_t* cs_property_create | ( | const char * | name, |
const char * | key_type, | ||
int | n_subdomains | ||
) |
Create and initialize a new property structure.
[in] | name | name of the property |
[in] | key_type | keyname of the type of property |
[in] | n_subdomains | piecewise definition on n_subdomains |
void cs_property_def_by_analytic | ( | cs_property_t * | pty, |
const char * | ml_name, | ||
cs_analytic_func_t * | func | ||
) |
Define a cs_property_t structure thanks to an analytic function in a subdomain attached to the mesh location named ml_name.
[in,out] | pty | pointer to a cs_property_t structure |
[in] | ml_name | name of the related mesh location |
[in] | func | pointer to a cs_analytic_func_t function |
void cs_property_def_by_array | ( | cs_property_t * | pty, |
cs_desc_t | desc, | ||
cs_real_t * | array | ||
) |
Define a cs_property_t structure thanks to an array of values.
[in,out] | pty | pointer to a cs_property_t structure |
[in] | desc | information about this array |
[in] | array | pointer to an array |
void cs_property_def_by_onevar_law | ( | cs_property_t * | pty, |
const char * | ml_name, | ||
const void * | context, | ||
cs_onevar_law_func_t * | func | ||
) |
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.
[in,out] | pty | pointer to a cs_property_t structure |
[in] | ml_name | name of the related mesh location |
[in] | context | pointer to a structure (may be NULL) |
[in] | func | pointer to a law function defined by subdomain |
void cs_property_def_by_twovar_law | ( | cs_property_t * | pty, |
const char * | ml_name, | ||
const void * | context, | ||
cs_twovar_law_func_t * | func | ||
) |
Define a cs_property_t structure thanks to a law depending on two scalars variables in a subdomain attached to the mesh location named ml_name.
[in,out] | pty | pointer to a cs_property_t structure |
[in] | ml_name | name of the related mesh location |
[in] | context | pointer to a structure (may be NULL) |
[in] | func | pointer to a function |
void cs_property_def_by_value | ( | cs_property_t * | pty, |
const char * | ml_name, | ||
const char * | key_val | ||
) |
Define a cs_property_t structure by value for entities attached to the mesh location named ml_name.
[in,out] | pty | pointer to a cs_property_t structure |
[in] | ml_name | name of the related mesh location |
[in] | keyval | accessor to the value to set |
cs_property_t* cs_property_free | ( | cs_property_t * | pty | ) |
Free a cs_property_t structure.
[in,out] | pty | pointer to a cs_property_t structure to free |
void cs_property_get_cell_tensor | ( | cs_lnum_t | c_id, |
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.
[in] | c_id | id of the current cell |
[in] | pty | pointer to a cs_property_t structure |
[in] | do_inversion | true or false |
[in,out] | tensor | 3x3 matrix |
cs_real_t cs_property_get_cell_value | ( | cs_lnum_t | c_id, |
const cs_property_t * | pty | ||
) |
Compute the value of a property at the cell center.
[in] | c_id | id of the current cell |
[in] | pty | pointer to a cs_property_t structure |
void cs_property_get_fourier | ( | const cs_property_t * | pty, |
double | dt, | ||
cs_real_t | fourier[] | ||
) |
Compute the Fourier number in each cell.
[in] | pty | pointer to the diffusive property struct. |
[in] | dt | value of the current time step |
[in,out] | fourier | pointer to an array storing Fourier numbers |
const char* cs_property_get_name | ( | const cs_property_t * | pty | ) |
Retrieve the name of a property.
[in] | pty | pointer to a property |
cs_property_type_t cs_property_get_type | ( | const cs_property_t * | pty | ) |
Retrieve the type of a property.
[in] | pty | pointer to a property |
bool cs_property_is_uniform | ( | const cs_property_t * | pty | ) |
returns true if the property is uniform, otherwise false
[in] | pty | pointer to a property to test |
void cs_property_iso_def_by_value | ( | cs_property_t * | pty, |
const char * | ml_name, | ||
double | val | ||
) |
Define an isotropic cs_property_t structure by value for entities attached to the mesh location named ml_name.
[in,out] | pty | pointer to a cs_property_t structure |
[in] | ml_name | name of the related mesh location |
[in] | val | value to set |
void cs_property_last_definition_stage | ( | cs_property_t * | pty | ) |
Last stage of the definition of a property based on several subdomains.
[in,out] | pty | pointer to cs_property_t structure |
void cs_property_ortho_def_by_value | ( | cs_property_t * | pty, |
const char * | ml_name, | ||
const double | val[] | ||
) |
Define orthotropic cs_property_t structure by value for entities attached to the mesh location named ml_name.
[in,out] | pty | pointer to a cs_property_t structure |
[in] | ml_name | name of the related mesh location |
[in] | val | values to set (vector of size 3) |
void cs_property_set_array | ( | cs_property_t * | pty, |
cs_desc_t | desc, | ||
cs_real_t * | array | ||
) |
Set the "array" member of a cs_property_t structure.
[in,out] | pty | pointer to a cs_property_t structure |
[in] | desc | information about this array |
[in] | array | pointer to an array of values |
void cs_property_set_option | ( | cs_property_t * | pty, |
cs_property_key_t | key, | ||
const char * | keyval | ||
) |
Set optional parameters related to a cs_property_t structure.
[in,out] | pty | pointer to a cs_property_t structure |
[in] | key | key related to the member of pty to set |
[in] | keyval | accessor to the value to set |
void cs_property_set_second_array | ( | cs_property_t * | pty, |
cs_desc_t | desc, | ||
cs_real_t * | array | ||
) |
Set the second "array" member of a cs_property_t structure.
[in,out] | pty | pointer to a cs_property_t structure |
[in] | desc | information about this array |
[in] | array | pointer to an array of values |
void cs_property_set_shared_pointers | ( | const cs_cdo_quantities_t * | quant, |
const cs_cdo_connect_t * | connect, | ||
const cs_time_step_t * | time_step | ||
) |
Set shared pointers to main domain members.
[in] | quant | additional mesh quantities struct. |
[in] | connect | pointer to a cs_cdo_connect_t struct. |
[in] | time_step | pointer to a time step structure |
void cs_property_summary | ( | const cs_property_t * | pty | ) |
Print a summary of a cs_property_t structure.
[in] | pty | pointer to a cs_property_t structure to summarize |
void cs_property_tensor_in_cell | ( | const cs_cell_mesh_t * | cm, |
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 Version using a cs_cell_mesh_t structure.
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | pty | pointer to a cs_property_t structure |
[in] | do_inversion | true or false |
[in,out] | tensor | 3x3 matrix |
cs_real_t cs_property_value_in_cell | ( | const cs_cell_mesh_t * | cm, |
const cs_property_t * | pty | ||
) |
Compute the value of a property at the cell center Version using a cs_cell_mesh_t structure.
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | pty | pointer to a cs_property_t structure |
|
static |
|
static |
|
static |
|
static |