#include "cs_defs.h"
#include "cs_mesh_location.h"
#include "cs_param_types.h"
#include "cs_restart_default.h"
Go to the source code of this file.
Data Structures | |
struct | cs_function_t |
Macros | |
#define | CS_FUNCTION_INTENSIVE (1 << 0) |
#define | CS_FUNCTION_EXTENSIVE (1 << 1) |
#define | CS_FUNCTION_TIME_INDEPENDENT (1 << 2) |
#define | CS_FUNCTION_USER (1 << 3) |
Typedefs | |
typedef void() | cs_eval_at_location_t(int location_id, cs_lnum_t n_elts, const cs_lnum_t *elt_ids, void *input, void *vals) |
Function pointer for evaluation of local function values. More... | |
Functions | |
cs_function_t * | cs_function_define_by_func (const char *name, int location_id, int dim, bool is_intensive, cs_datatype_t datatype, cs_eval_at_location_t *data_func, void *data_input) |
Define a function whose data values will be computed using the provided evaluation function. More... | |
cs_function_t * | cs_function_define_by_analytic_func (const char *name, int location_id, int dim, bool is_intensive, cs_analytic_func_t *data_func, void *data_input) |
Define a function whose data values will be computed using the provided "degree of freedom" type evaluation function. More... | |
cs_function_t * | cs_function_define_by_dof_func (const char *name, int location_id, int dim, bool is_intensive, cs_dof_func_t *data_func, void *data_input) |
Define a function whose data values will be computed using the provided "degree of freedom" type evaluation function. More... | |
void | cs_function_destroy_all (void) |
Destroy all functions management metadata. More... | |
int | cs_function_n_functions (void) |
Return the number of defined functions. More... | |
cs_function_t * | cs_function_by_id (int id) |
Return a pointer to a function object based on its id. More... | |
cs_function_t * | cs_function_by_name (const char *name) |
Return a pointer to a function object based on its name. More... | |
cs_function_t * | cs_function_by_name_try (const char *name) |
Return a pointer to a function object based on its name if present. More... | |
void | cs_function_set_label (cs_function_t *f, const char *label) |
Assig a label to a function object. More... | |
void | cs_function_log_defs (void) |
Log function definition setup information. More... | |
void | cs_function_log_all_settings (void) |
Print info relative to all given function object settings to log file. More... | |
void | cs_function_evaluate (const cs_function_t *f, const cs_time_step_t *ts, int location_id, cs_lnum_t n_elts, const cs_lnum_t *elt_ids, void *vals) |
Evaluate function values. More... | |
typedef void() cs_eval_at_location_t(int location_id, cs_lnum_t n_elts, const cs_lnum_t *elt_ids, void *input, void *vals) |
Function pointer for evaluation of local function values.
If the matching values are multidimensional, they must be interleaved. The output values are assumed to use a dense storage (i.e. of size n_elts
*
for the associated data type, in the same order as elt_ids
if present.)
Note: if the input pointer is non-NULL, it must point to valid data when the selection function is called, so either:
[in] | location_id | base associated mesh location id |
[in] | n_elts | number of associated elements |
[in] | elt_ids | ids of associated elements, or NULL if no filtering is required |
[in,out] | input | pointer to optional (untyped) value or structure. |
[in,out] | vals | pointer to output values (size: n_elts*dimension) |
cs_function_t* cs_function_by_id | ( | int | id | ) |
Return a pointer to a function object based on its id.
This function requires that a function of the given id is defined.
[in] | id | function id |
cs_function_t* cs_function_by_name | ( | const char * | name | ) |
Return a pointer to a function object based on its name.
This function requires that a function of the given name is defined.
[in] | name | function name |
cs_function_t* cs_function_by_name_try | ( | const char * | name | ) |
Return a pointer to a function object based on its name if present.
If no function of the given name is defined, NULL is returned.
[in] | name | function name |
cs_function_t* cs_function_define_by_analytic_func | ( | const char * | name, |
int | location_id, | ||
int | dim, | ||
bool | is_intensive, | ||
cs_analytic_func_t * | data_func, | ||
void * | data_input | ||
) |
Define a function whose data values will be computed using the provided "degree of freedom" type evaluation function.
The provided function and optional associated input is of the same form as and may be shared with some boundary condition or property definitions.
[in] | name | name of associated function |
[in] | location_id | id of associated mesh location |
[in] | dim | dimension associated with element data |
[in] | is_intensive | is the function intensive? |
[in] | data_func | function used to define data values |
[in] | data_input | pointer to optional (untyped) value or structure to be used by data_func |
cs_function_t* cs_function_define_by_dof_func | ( | const char * | name, |
int | location_id, | ||
int | dim, | ||
bool | is_intensive, | ||
cs_dof_func_t * | data_func, | ||
void * | data_input | ||
) |
Define a function whose data values will be computed using the provided "degree of freedom" type evaluation function.
The provided function and optional associated input is of the same form as and may be shared with some boundary condition or property definitions.
[in] | name | name of associated function |
[in] | location_id | id of associated mesh location |
[in] | dim | dimension associated with element data |
[in] | is_intensive | is the function intensive? |
[in] | data_func | function used to define data values |
[in] | data_input | pointer to optional (untyped) value or structure to be used by data_func |
cs_function_t* cs_function_define_by_func | ( | const char * | name, |
int | location_id, | ||
int | dim, | ||
bool | is_intensive, | ||
cs_datatype_t | datatype, | ||
cs_eval_at_location_t * | data_func, | ||
void * | data_input | ||
) |
Define a function whose data values will be computed using the provided evaluation function.
If of dimension > 1, the evaluated values are always interleaved.
[in] | name | name of associated function |
[in] | location_id | id of associated mesh location |
[in] | dim | dimension associated with element data |
[in] | is_intensive | is the function intensive? |
[in] | datatype | associated data values type |
[in] | data_func | function used to define data values |
[in] | data_input | pointer to optional (untyped) value or structure to be used by data_func |
void cs_function_destroy_all | ( | void | ) |
Destroy all functions management metadata.
void cs_function_evaluate | ( | const cs_function_t * | f, |
const cs_time_step_t * | ts, | ||
int | location_id, | ||
cs_lnum_t | n_elts, | ||
const cs_lnum_t * | elt_ids, | ||
void * | vals | ||
) |
Evaluate function values.
If the matching values are multidimensional, they must be interleaved. The output values are assumed to use a dense storage (i.e. of size n_elts
*
for the associated data type, in the same order as elt_ids
if present.)
[in] | f | pointer to associated function handle |
[in] | location_id | base associated mesh location id |
[in] | n_elts | number of associated elements |
[in] | elt_ids | ids of associated elements, or NULL if no filtering is required |
[in,out] | vals | pointer to output values (size: n_elts*dimension) |
void cs_function_log_all_settings | ( | void | ) |
Print info relative to all given function object settings to log file.
void cs_function_log_defs | ( | void | ) |
Log function definition setup information.
int cs_function_n_functions | ( | void | ) |
Return the number of defined functions.
void cs_function_set_label | ( | cs_function_t * | f, |
const char * | label | ||
) |
Assig a label to a function object.
[in,out] | f | pointer to associated function handle |
[in] | label | associated label |