Functions to handle extended definitions of quantities thanks to the cs_xdef_t structures. More...
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include "bft_mem.h"
#include "cs_array.h"
#include "cs_field.h"
#include "cs_flag.h"
#include "cs_log.h"
#include "cs_mesh_location.h"
#include "cs_xdef.h"
Macros | |
#define | CS_XDEF_DBG 0 |
Functions | |
cs_xdef_t * | cs_xdef_volume_create (cs_xdef_type_t type, int dim, int z_id, cs_flag_t state, cs_flag_t meta, void *context) |
Allocate and initialize a new cs_xdef_t structure based on volumic elements. More... | |
cs_xdef_t * | cs_xdef_boundary_create (cs_xdef_type_t type, int dim, int z_id, cs_flag_t state, cs_flag_t meta, void *context) |
Allocate and initialize a new cs_xdef_t structure based on boundary elements. More... | |
cs_xdef_t * | cs_xdef_timestep_create (cs_xdef_type_t type, cs_flag_t state, cs_flag_t meta, void *context) |
Allocate and initialize a new cs_xdef_t structure for setting the time step. More... | |
cs_xdef_t * | cs_xdef_free (cs_xdef_t *d) |
Free a cs_xdef_t structure. More... | |
cs_xdef_t * | cs_xdef_copy (cs_xdef_t *src) |
copy a cs_xdef_t structure More... | |
void | cs_xdef_set_input_context (cs_xdef_t *d, void *input) |
In the case of a definition by an analytic function, a time function or a function relying on degrees of freedom (DoFs), this function allows one to set a more or less complex input data structure. This call should be done before the first evaluation of the associated cs_xdef_t structure. More... | |
void | cs_xdef_set_free_input_function (cs_xdef_t *d, cs_xdef_free_input_t *free_input) |
In case of a definition by an analytic function, a time function or a function relying on degrees of freedom (DoFs). One can set a function to free a complex input data structure (please refer to cs_xdef_free_input_t) for more details. More... | |
void | cs_xdef_set_quadrature (cs_xdef_t *d, cs_quadrature_type_t qtype) |
Set the type of quadrature to use for evaluating the given description. More... | |
cs_quadrature_type_t | cs_xdef_get_quadrature (cs_xdef_t *d) |
Get the type of quadrature to use for evaluating the given description. More... | |
cs_xdef_type_t | cs_xdef_get_type (const cs_xdef_t *d) |
Retrieve the flag dedicated to the state. More... | |
cs_flag_t | cs_xdef_get_state_flag (const cs_xdef_t *d) |
Retrieve the flag dedicated to the state. More... | |
void | cs_xdef_log_setup (const char *prefix, const cs_xdef_t *d) |
Output the settings related to a cs_xdef_t structure in the setup logging file. More... | |
void | cs_xdef_log (cs_log_t log_type, const char *prefix, const cs_xdef_t *d) |
Output the settings related to a cs_xdef_t structure. More... | |
const char * | cs_xdef_type_get_name (cs_xdef_type_t xdef_type) |
Retrieve a pointer to the cs_xdef_type's name string. More... | |
void | cs_xdef_array_set_values (cs_xdef_t *d, bool is_owner, cs_real_t *values) |
In case of definition by array, set the array values after having added this definition. More... | |
void | cs_xdef_array_set_zone_id (cs_xdef_t *d, int z_id) |
In case of definition by array, set the zone id related to the size of the array. By default, the zone id is the same as the zone id related to the definition so that there is no need to call this function. More... | |
void | cs_xdef_array_build_full2subset (const cs_xdef_t *d) |
In case of definition by array, build the full2subset array. The direct members of the cs_xdef_t structure are not modified but the context dedicated to definition by array is updated. d is declared as const to avoid a compiler warning. More... | |
void | cs_xdef_array_set_adjacency (cs_xdef_t *d, const cs_adjacency_t *adj) |
In case of definition by array, set the optional adjacency structure. More... | |
void | cs_xdef_array_set_sublist (cs_xdef_t *d, cs_lnum_t n_elts, const cs_lnum_t elt_ids[]) |
In case of definition by array, set the optional sub-list of elements used to link elements in the partial view and in the full-length view. More... | |
cs_real_t * | cs_xdef_field_get_values (cs_xdef_t *def) |
Get the current field values in case of definition by field. More... | |
Variables | |
static const char * | _xdef_type_name [] |
Functions to handle extended definitions of quantities thanks to the cs_xdef_t structures.
#define CS_XDEF_DBG 0 |
void cs_xdef_array_build_full2subset | ( | const cs_xdef_t * | d | ) |
void cs_xdef_array_set_adjacency | ( | cs_xdef_t * | d, |
const cs_adjacency_t * | adj | ||
) |
In case of definition by array, set the optional adjacency structure.
[in,out] | d | pointer to a cs_xdef_t structure |
[in] | adj | pointer to the adjacency structure |
In case of definition by array, set the optional sub-list of elements used to link elements in the partial view and in the full-length view.
[in,out] | d | pointer to a cs_xdef_t structure |
[in] | n_elts | number of elements in the sub-list |
[in] | elt_ids | list of element ids constituting the sub-list |
In case of definition by array, set the array values after having added this definition.
[in,out] | d | pointer to a cs_xdef_t structure |
[in] | is_owner | manage or not the lifecycle of the array values |
[in] | values | array of values |
void cs_xdef_array_set_zone_id | ( | cs_xdef_t * | d, |
int | z_id | ||
) |
In case of definition by array, set the zone id related to the size of the array. By default, the zone id is the same as the zone id related to the definition so that there is no need to call this function.
[in,out] | d | pointer to a cs_xdef_t structure |
[in] | z_id | zone id associated to the array size |
cs_xdef_t * cs_xdef_boundary_create | ( | cs_xdef_type_t | type, |
int | dim, | ||
int | z_id, | ||
cs_flag_t | state, | ||
cs_flag_t | meta, | ||
void * | context | ||
) |
Allocate and initialize a new cs_xdef_t structure based on boundary elements.
[in] | type | type of definition |
[in] | dim | dimension of the values to define |
[in] | z_id | volume zone id |
[in] | state | flag to know if this uniform, cellwise, steady... |
[in] | meta | metadata associated to this description |
[in] | context | pointer to a structure |
Get the current field values in case of definition by field.
[in] | def | pointer to a cs_xdef_t structure |
cs_quadrature_type_t cs_xdef_get_quadrature | ( | cs_xdef_t * | d | ) |
Get the type of quadrature to use for evaluating the given description.
[in] | d | pointer to a cs_xdef_t structure |
Retrieve the flag dedicated to the state.
[in] | d | pointer to a cs_xdef_t structure |
cs_xdef_type_t cs_xdef_get_type | ( | const cs_xdef_t * | d | ) |
Retrieve the flag dedicated to the state.
[in] | d | pointer to a cs_xdef_t structure |
void cs_xdef_log_setup | ( | const char * | prefix, |
const cs_xdef_t * | d | ||
) |
void cs_xdef_set_free_input_function | ( | cs_xdef_t * | d, |
cs_xdef_free_input_t * | free_input | ||
) |
In case of a definition by an analytic function, a time function or a function relying on degrees of freedom (DoFs). One can set a function to free a complex input data structure (please refer to cs_xdef_free_input_t) for more details.
[in,out] | d | pointer to a cs_xdef_t structure |
[in] | free_input | pointer to a function which free the input structure |
void cs_xdef_set_input_context | ( | cs_xdef_t * | d, |
void * | input | ||
) |
In the case of a definition by an analytic function, a time function or a function relying on degrees of freedom (DoFs), this function allows one to set a more or less complex input data structure. This call should be done before the first evaluation of the associated cs_xdef_t structure.
[in,out] | d | pointer to a cs_xdef_t structure |
[in] | input | pointer to an input structure |
void cs_xdef_set_quadrature | ( | cs_xdef_t * | d, |
cs_quadrature_type_t | qtype | ||
) |
Set the type of quadrature to use for evaluating the given description.
[in,out] | d | pointer to a cs_xdef_t structure |
[in] | qtype | type of quadrature |
cs_xdef_t * cs_xdef_timestep_create | ( | cs_xdef_type_t | type, |
cs_flag_t | state, | ||
cs_flag_t | meta, | ||
void * | context | ||
) |
Allocate and initialize a new cs_xdef_t structure for setting the time step.
[in] | type | type of definition |
[in] | state | flag to know if this uniform, cellwise, steady... |
[in] | meta | metadata associated to this description |
[in] | context | pointer to a structure storing the parameters (cast on-the-fly according to the type of definition) |
const char * cs_xdef_type_get_name | ( | cs_xdef_type_t | xdef_type | ) |
Retrieve a pointer to the cs_xdef_type's name string.
[in] | xdef_type | type to query |
cs_xdef_t * cs_xdef_volume_create | ( | cs_xdef_type_t | type, |
int | dim, | ||
int | z_id, | ||
cs_flag_t | state, | ||
cs_flag_t | meta, | ||
void * | context | ||
) |
Allocate and initialize a new cs_xdef_t structure based on volumic elements.
[in] | type | type of definition |
[in] | dim | dimension of the values to define |
[in] | z_id | volume zone id |
[in] | state | flag to know if this uniform, cellwise, steady... |
[in] | meta | metadata associated to this description |
[in] | context | pointer to a structure |
|
static |