Go to the source code of this file.
Macros | |
| #define | CS_ARRAY_SUBSET_NULL -1 |
| #define | CS_ARRAY_SUBSET_IN 0 |
| #define | CS_ARRAY_SUBSET_OUT 1 |
| #define | CS_ARRAY_SUBSET_INOUT 2 |
Functions | |
| void | cs_array_bool_fill_true (cs_lnum_t size, bool a[restrict]) |
| Assign true to all elements of an array. Case of an array of booleans. | |
| void | cs_array_bool_fill_false (cs_lnum_t size, bool a[restrict]) |
| Assign false to all elements of an array. Case of an array of booleans. | |
| void | cs_array_flag_fill_zero (cs_lnum_t size, cs_flag_t a[restrict]) |
| Assign zero to all elements of an array. Case of a cs_flag_t array. | |
| void | cs_array_lnum_fill_zero (cs_lnum_t size, cs_lnum_t a[restrict]) |
| Assign zero to all elements of an array. Case of a cs_lnum_t array. | |
| void | cs_array_lnum_set_value (cs_lnum_t size, cs_lnum_t num, cs_lnum_t a[restrict]) |
| Assign the value "num" to all elements of an array. Case of a cs_lnum_t array. | |
| void | cs_array_lnum_set_value_on_subset (cs_lnum_t n_elts, const cs_lnum_t elt_ids[], cs_lnum_t num, cs_lnum_t a[restrict]) |
| Assign the value "num" to an array on a selected subset of elements. if elt_ids = NULL, then one recovers the function cs_array_lnum_set_value. | |
| void | cs_array_int_fill_zero (cs_lnum_t size, int a[restrict]) |
| Assign zero to all elements of an array. Case of a int array. | |
| void | cs_array_int_set_value (cs_lnum_t size, int num, int a[restrict]) |
| Assign the value "num" to all elements of an array. Case of a int array. | |
| void | cs_array_int_set_value_on_subset (cs_lnum_t n_elts, const cs_lnum_t elt_ids[], int num, int a[restrict]) |
| Assign the value "num" to an array on a selected subset of elements. if elt_ids = NULL, then one recovers the function cs_array_int_set_value. | |
| void | cs_array_real_copy_subset (cs_lnum_t n_elts, int stride, const cs_lnum_t elt_ids[], int mode, const cs_real_t ref[], cs_real_t dest[]) |
| Copy an array ("ref") into another array ("dest") on possibly only a part of the array(s). Array with stride > 1 are assumed to be interlaced. The subset of elements on which working is defined by "elt_ids". The way to apply the subset is defined with the parameter "mode" as follows: | |
| void | cs_array_real_copy (cs_lnum_t size, const cs_real_t src[], cs_real_t dest[restrict]) |
| Copy real values from an array to another of the same dimensions. | |
| void | cs_array_real_scale (cs_lnum_t n_elts, int stride, const cs_lnum_t *elt_ids, cs_real_t scaling_factor, cs_real_t dest[restrict]) |
| Multiply each value by a scaling factor s.t. dest *= scaling_factor If elt_ids is not NULL, one applies an indirection. A stride can also be applied. One assumes an interlaced array. | |
| void | cs_array_real_set_value (cs_lnum_t n_elts, int stride, const cs_real_t ref_val[], cs_real_t *a) |
| Assign a constant value of dim "stride" to an interlaced array sharing the same stride. | |
| void | cs_array_real_set_wvalue (cs_lnum_t n_elts, int stride, const cs_real_t ref_val[], const cs_real_t weight[], cs_real_t *a) |
| Assign a weighted constant value of dim "stride" to an interlaced array sharing the same stride. Apply a weight for each element. This weight is constant for each component of an element. | |
| void | cs_array_real_set_value_on_subset (cs_lnum_t n_elts, int stride, const cs_lnum_t elt_ids[], const cs_real_t ref_val[], cs_real_t *a) |
| Assign a constant value of dim "stride" to an interlaced array sharing the same stride. Only a subset of elements are considered. If elt_ids = NULL, then one recovers the function cs_array_real_set_value. | |
| void | cs_array_real_set_wvalue_on_subset (cs_lnum_t n_elts, int stride, const cs_lnum_t elt_ids[], const cs_real_t ref_val[], const cs_real_t weight[], cs_real_t *a) |
| Assign a weighted constant value of dim "stride" to an interlaced array sharing the same stride. Only a subset of elements are considered. If elt_ids = NULL, then one recovers the function cs_array_real_set_wvalue Apply a weight for each element. This weight is constant for each component of an element. | |
| void | cs_array_real_set_scalar (cs_lnum_t n_elts, cs_real_t ref_val, cs_real_t a[restrict]) |
| Assign a constant scalar value to an array. | |
| void | cs_array_real_set_wscalar (cs_lnum_t n_elts, cs_real_t ref_val, const cs_real_t weight[], cs_real_t a[restrict]) |
| Assign a weighted constant scalar value to an array. The weight array has the same size as the array "a". | |
| void | cs_array_real_set_scalar_on_subset (cs_lnum_t n_elts, const cs_lnum_t elt_ids[], cs_real_t ref_val, cs_real_t a[restrict]) |
| Assign a constant scalar value to an array on a selected subset of elements. If elt_ids = NULL, then one recovers the function cs_array_real_set_scalar. | |
| void | cs_array_real_set_wscalar_on_subset (cs_lnum_t n_elts, const cs_lnum_t elt_ids[], cs_real_t ref_val, const cs_real_t weight[], cs_real_t a[restrict]) |
| Assign a weighted constant scalar value to an array on a selected subset of elements. If elt_ids = NULL, then one recovers the function cs_array_real_set_wscalar. | |
| void | cs_array_real_set_vector (cs_lnum_t n_elts, const cs_real_t ref_val[3], cs_real_t *a) |
| Assign a constant vector to an array of stride 3 which is interlaced. | |
| void | cs_array_real_set_wvector (cs_lnum_t n_elts, const cs_real_t ref_val[3], const cs_real_t weight[], cs_real_t *a) |
| Assign a weighted constant vector value to an interlaced array (of stride 3). The array of weights has the same size as the array "a". | |
| void | cs_array_real_set_vector_on_subset (cs_lnum_t n_elts, const cs_lnum_t elt_ids[], const cs_real_t ref_val[3], cs_real_t a[]) |
| Assign a constant vector to an interlaced array (of stride 3) on a selected subset of elements. If elt_ids = NULL, then one recovers the function cs_array_real_set_vector. | |
| void | cs_array_real_set_wvector_on_subset (cs_lnum_t n_elts, const cs_lnum_t elt_ids[], const cs_real_t ref_val[3], const cs_real_t weight[], cs_real_t *a) |
| Assign a weighted constant vector value to an interlaced array (of stride 3). The subset selection is given by elt_ids. If NULL, then one recovers the function cs_array_real_set_wvector The array of weights has the same size as the array "a". | |
| void | cs_array_real_set_tensor (cs_lnum_t n_elts, const cs_real_t ref_tens[3][3], cs_real_t *a) |
| Assign a constant 3x3 tensor to an array (of stride 9) which is interlaced. | |
| void | cs_array_real_set_tensor_on_subset (cs_lnum_t n_elts, const cs_lnum_t elt_ids[], const cs_real_t ref_tens[3][3], cs_real_t *a) |
| Assign a constant 3x3 tensor to an interlaced array (of stride 9) on a subset of elements. If elt_ids = NULL, then one recovers the function cs_array_real_set_tensor. | |
| void | cs_array_real_fill_zero (cs_lnum_t size, cs_real_t a[]) |
| Assign zero to all elements of an array. | |
| void | cs_array_set_value_real (cs_lnum_t n_elts, cs_lnum_t dim, cs_real_t v, cs_real_t a[]) |
| Assign a constant value to an array (deprecated function). | |
| #define CS_ARRAY_SUBSET_IN 0 |
| #define CS_ARRAY_SUBSET_INOUT 2 |
| #define CS_ARRAY_SUBSET_NULL -1 |
| #define CS_ARRAY_SUBSET_OUT 1 |
Assign false to all elements of an array. Case of an array of booleans.
| [in] | size | total number of elements to set |
| [in,out] | a | array to set |
Assign true to all elements of an array. Case of an array of booleans.
| [in] | size | total number of elements to set |
| [in,out] | a | array to set |
Assign zero to all elements of an array. Case of a cs_flag_t array.
| [in] | size | total number of elements to set to zero |
| [in,out] | a | array of flags to set |
| void cs_array_int_fill_zero | ( | cs_lnum_t | size, |
| int | a[restrict] ) |
Assign zero to all elements of an array. Case of a int array.
| [in] | size | total number of elements to set to zero |
| [in,out] | a | array to set |
| void cs_array_int_set_value | ( | cs_lnum_t | size, |
| int | num, | ||
| int | a[restrict] ) |
Assign the value "num" to all elements of an array. Case of a int array.
| [in] | size | total number of elements to set |
| [in] | num | value to set |
| [in,out] | a | array to set |
| void cs_array_int_set_value_on_subset | ( | cs_lnum_t | n_elts, |
| const cs_lnum_t | elt_ids[], | ||
| int | num, | ||
| int | a[restrict] ) |
Assign the value "num" to an array on a selected subset of elements. if elt_ids = NULL, then one recovers the function cs_array_int_set_value.
| [in] | n_elts | number of elements |
| [in] | elt_ids | list of ids in the subset or NULL (size: n_elts) |
| [in] | num | value to set |
| [in,out] | a | array to set |
Assign zero to all elements of an array. Case of a cs_lnum_t array.
| [in] | size | total number of elements to set to zero |
| [in,out] | a | array to set |
Assign the value "num" to all elements of an array. Case of a cs_lnum_t array.
| [in] | size | total number of elements to set |
| [in] | num | value to set |
| [in,out] | a | array to set |
| void cs_array_lnum_set_value_on_subset | ( | cs_lnum_t | n_elts, |
| const cs_lnum_t | elt_ids[], | ||
| cs_lnum_t | num, | ||
| cs_lnum_t | a[restrict] ) |
Assign the value "num" to an array on a selected subset of elements. if elt_ids = NULL, then one recovers the function cs_array_lnum_set_value.
| [in] | n_elts | number of elements |
| [in] | elt_ids | list of ids in the subset or NULL (size: n_elts) |
| [in] | num | value to set |
| [in,out] | a | array to set |
Copy real values from an array to another of the same dimensions.
| [in] | size | number of elements * dimension |
| [in] | src | source array values (size: n_elts*dim) |
| [out] | dest | destination array values (size: n_elts*dim) |
| void cs_array_real_copy_subset | ( | cs_lnum_t | n_elts, |
| int | stride, | ||
| const cs_lnum_t | elt_ids[], | ||
| int | mode, | ||
| const cs_real_t | ref[], | ||
| cs_real_t | dest[] ) |
Copy an array ("ref") into another array ("dest") on possibly only a part of the array(s). Array with stride > 1 are assumed to be interlaced. The subset of elements on which working is defined by "elt_ids". The way to apply the subset is defined with the parameter "mode" as follows:
It elt_ids = NULL or mode < 0 (CS_ARRAY_SUBSET_NULL), then the behavior is as cs_array_real_copy
One assumes that all arrays are allocated with a correct size.
| [in] | n_elts | number of elements in the array |
| [in] | stride | number of values for each element |
| [in] | mode | apply the subset ids to which array(s) |
| [in] | elt_ids | list of ids in the subset or NULL (size: n_elts) |
| [in] | ref | reference values to copy |
| [in,out] | dest | array storing values after applying the indirection |
Assign zero to all elements of an array.
| [in] | size | total number of elements to set to zero |
| [in,out] | a | array to set |
| void cs_array_real_scale | ( | cs_lnum_t | n_elts, |
| int | stride, | ||
| const cs_lnum_t * | elt_ids, | ||
| cs_real_t | scaling_factor, | ||
| cs_real_t | dest[restrict] ) |
Multiply each value by a scaling factor s.t. dest *= scaling_factor If elt_ids is not NULL, one applies an indirection. A stride can also be applied. One assumes an interlaced array.
| [in] | n_elts | number of elements |
| [in] | stride | number of values for each element |
| [in] | elt_ids | list of ids in the subset or NULL (size: n_elts) |
| [in] | scaling_factor | value of the scaling factor |
| [out] | dest | destination array values |
Assign a constant scalar value to an array.
| [in] | n_elts | number of elements |
| [in] | ref_val | value to assign |
| [in,out] | a | array to set |
| void cs_array_real_set_scalar_on_subset | ( | cs_lnum_t | n_elts, |
| const cs_lnum_t | elt_ids[], | ||
| cs_real_t | ref_val, | ||
| cs_real_t | a[restrict] ) |
Assign a constant scalar value to an array on a selected subset of elements. If elt_ids = NULL, then one recovers the function cs_array_real_set_scalar.
| [in] | n_elts | number of elements |
| [in] | elt_ids | list of ids in the subset or NULL (size: n_elts) |
| [in] | ref_val | value to assign |
| [in,out] | a | array to set |
Assign a constant 3x3 tensor to an array (of stride 9) which is interlaced.
| [in] | n_elts | number of elements |
| [in] | ref_tens | tensor to assign |
| [in,out] | a | array to set |
| void cs_array_real_set_tensor_on_subset | ( | cs_lnum_t | n_elts, |
| const cs_lnum_t | elt_ids[], | ||
| const cs_real_t | ref_tens[3][3], | ||
| cs_real_t * | a ) |
Assign a constant 3x3 tensor to an interlaced array (of stride 9) on a subset of elements. If elt_ids = NULL, then one recovers the function cs_array_real_set_tensor.
| [in] | n_elts | number of elements |
| [in] | elt_ids | list of ids defining the subset or NULL |
| [in] | ref_tens | tensor to assign |
| [in,out] | a | array to set |
| void cs_array_real_set_value | ( | cs_lnum_t | n_elts, |
| int | stride, | ||
| const cs_real_t | ref_val[], | ||
| cs_real_t * | a ) |
Assign a constant value of dim "stride" to an interlaced array sharing the same stride.
| [in] | n_elts | number of elements |
| [in] | stride | number of values for each element |
| [in] | ref_val | list of values to assign (size: stride) |
| [in,out] | a | array to set (size: n_elts*stride) |
| void cs_array_real_set_value_on_subset | ( | cs_lnum_t | n_elts, |
| int | stride, | ||
| const cs_lnum_t | elt_ids[], | ||
| const cs_real_t | ref_val[], | ||
| cs_real_t * | a ) |
Assign a constant value of dim "stride" to an interlaced array sharing the same stride. Only a subset of elements are considered. If elt_ids = NULL, then one recovers the function cs_array_real_set_value.
| [in] | n_elts | number of elements |
| [in] | stride | number of values for each element |
| [in] | elt_ids | list of ids in the subset or NULL (size: n_elts) |
| [in] | ref_val | list of values to assign (size: stride) |
| [in,out] | a | array to set (size >= n_elts * stride) |
Assign a constant vector to an array of stride 3 which is interlaced.
| [in] | n_elts | number of elements |
| [in] | ref_val | vector to assign |
| [in,out] | a | array to set |
| void cs_array_real_set_vector_on_subset | ( | cs_lnum_t | n_elts, |
| const cs_lnum_t | elt_ids[], | ||
| const cs_real_t | ref_val[3], | ||
| cs_real_t | a[] ) |
Assign a constant vector to an interlaced array (of stride 3) on a selected subset of elements. If elt_ids = NULL, then one recovers the function cs_array_real_set_vector.
| [in] | n_elts | number of elements |
| [in] | elt_ids | list of ids in the subset or NULL (size: n_elts) |
| [in] | ref_val | vector to assign |
| [in,out] | a | array to set |
| void cs_array_real_set_wscalar | ( | cs_lnum_t | n_elts, |
| cs_real_t | ref_val, | ||
| const cs_real_t | weight[], | ||
| cs_real_t | a[restrict] ) |
Assign a weighted constant scalar value to an array. The weight array has the same size as the array "a".
| [in] | n_elts | number of elements |
| [in] | ref_val | value to assign |
| [in] | weight | values of the weight to apply |
| [in,out] | a | array to set |
| void cs_array_real_set_wscalar_on_subset | ( | cs_lnum_t | n_elts, |
| const cs_lnum_t | elt_ids[], | ||
| cs_real_t | ref_val, | ||
| const cs_real_t | weight[], | ||
| cs_real_t | a[restrict] ) |
Assign a weighted constant scalar value to an array on a selected subset of elements. If elt_ids = NULL, then one recovers the function cs_array_real_set_wscalar.
| [in] | n_elts | number of elements |
| [in] | elt_ids | list of ids in the subset or NULL (size: n_elts) |
| [in] | ref_val | value to assign |
| [in] | weight | values of weights to apply |
| [in,out] | a | array to set |
| void cs_array_real_set_wvalue | ( | cs_lnum_t | n_elts, |
| int | stride, | ||
| const cs_real_t | ref_val[], | ||
| const cs_real_t | weight[], | ||
| cs_real_t * | a ) |
Assign a weighted constant value of dim "stride" to an interlaced array sharing the same stride. Apply a weight for each element. This weight is constant for each component of an element.
| [in] | n_elts | number of elements |
| [in] | stride | number of values for each element |
| [in] | ref_val | list of values to assign (size: stride) |
| [in] | weight | values of the weight to apply (size: n_elts) |
| [in,out] | a | array to set (size: n_elts*stride) |
| void cs_array_real_set_wvalue_on_subset | ( | cs_lnum_t | n_elts, |
| int | stride, | ||
| const cs_lnum_t | elt_ids[], | ||
| const cs_real_t | ref_val[], | ||
| const cs_real_t | weight[], | ||
| cs_real_t * | a ) |
Assign a weighted constant value of dim "stride" to an interlaced array sharing the same stride. Only a subset of elements are considered. If elt_ids = NULL, then one recovers the function cs_array_real_set_wvalue Apply a weight for each element. This weight is constant for each component of an element.
| [in] | n_elts | number of elements |
| [in] | stride | number of values for each element |
| [in] | elt_ids | list of ids in the subset or NULL (size: n_elts) |
| [in] | ref_val | list of values to assign (size: stride) |
| [in] | weight | values of the weight to apply (size >= n_elts) |
| [in,out] | a | array to set (size >= n_elts*stride) |
| void cs_array_real_set_wvector | ( | cs_lnum_t | n_elts, |
| const cs_real_t | ref_val[3], | ||
| const cs_real_t | weight[], | ||
| cs_real_t * | a ) |
Assign a weighted constant vector value to an interlaced array (of stride 3). The array of weights has the same size as the array "a".
| [in] | n_elts | number of elements |
| [in] | ref_val | vector to assign |
| [in] | weight | values of the weight to apply |
| [in,out] | a | array to set |
| void cs_array_real_set_wvector_on_subset | ( | cs_lnum_t | n_elts, |
| const cs_lnum_t | elt_ids[], | ||
| const cs_real_t | ref_val[3], | ||
| const cs_real_t | weight[], | ||
| cs_real_t * | a ) |
Assign a weighted constant vector value to an interlaced array (of stride 3). The subset selection is given by elt_ids. If NULL, then one recovers the function cs_array_real_set_wvector The array of weights has the same size as the array "a".
| [in] | n_elts | number of elements |
| [in] | elt_ids | list of ids in the subset or NULL (size: n_elts) |
| [in] | ref_val | vector to assign |
| [in] | weight | values of the weight to apply |
| [in,out] | a | array to set |