![]() |
programmer's documentation
|
#include "cs_defs.h"
#include <stdlib.h>
#include <assert.h>
#include <float.h>
#include <limits.h>
#include <string.h>
#include <bft_mem.h>
#include "cs_cdo.h"
#include "cs_blas.h"
#include "cs_log.h"
#include "cs_math.h"
#include "cs_parall.h"
#include "cs_sort.h"
#include "cs_cdo_toolbox.h"
Functions | |
cs_real_t | cs_euclidean_norm (int len, const cs_real_t v[]) |
Compute the euclidean norm 2 of a vector of size len This algorithm tries to reduce round-off error thanks to intermediate sums. More... | |
cs_real_t | cs_weighted_sum_squared (cs_lnum_t n, const cs_real_t *restrict x, const cs_real_t *restrict weight) |
Compute the weighted sum of squared values of an array. More... | |
cs_connect_index_t * | cs_index_create (int n) |
Create an index structure of size n. More... | |
cs_connect_index_t * | cs_index_map (int n, int *idx, int *ids) |
Map arrays into an index structure of size n (owner = false) More... | |
void | cs_index_free (cs_connect_index_t **pidx) |
Destroy a cs_connect_index_t structure. More... | |
cs_connect_index_t * | cs_index_compose (int nc, const cs_connect_index_t *a2b, const cs_connect_index_t *b2c) |
From 2 indexes : A -> B and B -> C create a new index A -> C. More... | |
cs_connect_index_t * | cs_index_transpose (int nb, const cs_connect_index_t *a2b) |
From a cs_connect_index_t A -> B create a new index B -> A. More... | |
void | cs_index_sort (cs_connect_index_t *x) |
Sort each sub-list related to an entry in a cs_connect_index_t structure. More... | |
void | cs_index_dump (const char *name, FILE *_f, cs_connect_index_t *x) |
Dump a cs_connect_index_t structure to a file or into the standard output. More... | |
cs_locmat_t * | cs_locmat_create (int n_max_ent) |
Allocate and initialize a cs_locmat_t structure. More... | |
cs_locmat_t * | cs_locmat_free (cs_locmat_t *lm) |
Free a cs_locmat_t structure. More... | |
void | cs_locmat_copy (cs_locmat_t *recv, const cs_locmat_t *send) |
Copy a cs_locmat_t structure into another cs_locmat_t structure which has been already allocated. More... | |
void | cs_locmat_matvec (const cs_locmat_t *loc, const cs_real_t *vec, cs_real_t *matvec) |
Compute a local dense matrix-vector product matvec has been previously allocated. More... | |
void | cs_locmat_add (cs_locmat_t *loc, const cs_locmat_t *add) |
Add two local dense matrices: loc += add. More... | |
void | cs_locmat_mult_add (cs_locmat_t *loc, cs_real_t alpha, const cs_locmat_t *add) |
Give the result of the following operation: loc = loc + alpha*add. More... | |
void | cs_locmat_add_transpose (cs_locmat_t *loc, cs_locmat_t *tr) |
Define a new matrix by adding a local matrix with its transpose. Keep the transposed matrix for future use. More... | |
void | cs_locmat_asymm (cs_locmat_t *loc) |
Set the given matrix into its anti-symmetric part. More... | |
void | cs_locmat_dump (int parent_id, const cs_locmat_t *lm) |
Dump a local discrete Hodge operator. More... | |
void | cs_dump_array_to_listing (const char *header, const cs_lnum_t size, const cs_real_t array[], int n_cols) |
Dump an array in the listing (For DEBUG) More... | |
void | cs_dump_integer_to_listing (const char *header, const cs_lnum_t size, const cs_lnum_t array[], int n_cols) |
Dump an array in the listing (For DEBUG) More... | |
void cs_dump_array_to_listing | ( | const char * | header, |
const cs_lnum_t | size, | ||
const cs_real_t | array[], | ||
int | n_cols | ||
) |
Dump an array in the listing (For DEBUG)
void cs_dump_integer_to_listing | ( | const char * | header, |
const cs_lnum_t | size, | ||
const cs_lnum_t | array[], | ||
int | n_cols | ||
) |
Dump an array in the listing (For DEBUG)
Compute the euclidean norm 2 of a vector of size len This algorithm tries to reduce round-off error thanks to intermediate sums.
[in] | len | vector dimension |
[in] | v | vector |
cs_connect_index_t* cs_index_compose | ( | int | nc, |
const cs_connect_index_t * | a2b, | ||
const cs_connect_index_t * | b2c | ||
) |
From 2 indexes : A -> B and B -> C create a new index A -> C.
[in] | nc | number of elements in C set |
[in] | a2b | pointer to the index A -> B |
[in] | b2c | pointer to the index B -> C |
cs_connect_index_t* cs_index_create | ( | int | n | ) |
Create an index structure of size n.
[in] | n | number of entries of the indexed list |
void cs_index_dump | ( | const char * | name, |
FILE * | _f, | ||
cs_connect_index_t * | x | ||
) |
Dump a cs_connect_index_t structure to a file or into the standard output.
[in] | name | name of the dump file. Can be set to NULL |
[in] | _f | pointer to a FILE structure. Can be set to NULL. |
[in] | x | pointer to a cs_connect_index_t structure |
void cs_index_free | ( | cs_connect_index_t ** | pidx | ) |
Destroy a cs_connect_index_t structure.
[in] | pidx | pointer of pointer to a cs_connect_index_t structure |
cs_connect_index_t* cs_index_map | ( | int | n, |
int * | idx, | ||
int * | ids | ||
) |
Map arrays into an index structure of size n (owner = false)
[in] | n | number of entries of the indexed list |
[in] | idx | array of size n+1 |
[in] | ids | array of size idx[n] |
void cs_index_sort | ( | cs_connect_index_t * | x | ) |
Sort each sub-list related to an entry in a cs_connect_index_t structure.
Sort each list related to an entry in a cs_connect_index_t structure.
[in] | x | pointer to a cs_connect_index_t structure |
cs_connect_index_t* cs_index_transpose | ( | int | nb, |
const cs_connect_index_t * | a2b | ||
) |
From a cs_connect_index_t A -> B create a new index B -> A.
From a cs_connect_index_t struct. A -> B create a new index B -> A.
[in] | nb | size of the "b" set |
[in] | a2b | pointer to the index A -> B |
void cs_locmat_add | ( | cs_locmat_t * | loc, |
const cs_locmat_t * | add | ||
) |
Add two local dense matrices: loc += add.
[in,out] | loc | local matrix storing the result |
[in] | add | values to add to loc |
void cs_locmat_add_transpose | ( | cs_locmat_t * | loc, |
cs_locmat_t * | tr | ||
) |
Define a new matrix by adding a local matrix with its transpose. Keep the transposed matrix for future use.
[in,out] | loc | local matrix to transpose and add |
[in,out] | tr | transposed of the local matrix |
void cs_locmat_asymm | ( | cs_locmat_t * | loc | ) |
Set the given matrix into its anti-symmetric part.
[in,out] | loc | local matrix to transform |
void cs_locmat_copy | ( | cs_locmat_t * | recv, |
const cs_locmat_t * | send | ||
) |
Copy a cs_locmat_t structure into another cs_locmat_t structure which has been already allocated.
[in,out] | recv | pointer to a cs_locmat_t struct. |
[in] | send | pointer to a cs_locmat_t struct. |
cs_locmat_t* cs_locmat_create | ( | int | n_max_ent | ) |
Allocate and initialize a cs_locmat_t structure.
[in] | n_max_ent | max number of entities |
void cs_locmat_dump | ( | int | parent_id, |
const cs_locmat_t * | lm | ||
) |
Dump a local discrete Hodge operator.
[in] | parent_id | id of the related parent entity |
[in] | lm | pointer to the cs_sla_locmat_t struct. |
cs_locmat_t* cs_locmat_free | ( | cs_locmat_t * | lm | ) |
Free a cs_locmat_t structure.
[in] | lm | pointer to a cs_locmat_t struct. to free |
void cs_locmat_matvec | ( | const cs_locmat_t * | loc, |
const cs_real_t * | vec, | ||
cs_real_t * | matvec | ||
) |
Compute a local dense matrix-vector product matvec has been previously allocated.
[in] | loc | local matrix to use |
[in] | vec | local vector to use |
[in,out] | matvec | result of the local matrix-vector product |
void cs_locmat_mult_add | ( | cs_locmat_t * | loc, |
cs_real_t | alpha, | ||
const cs_locmat_t * | add | ||
) |
Give the result of the following operation: loc = loc + alpha*add.
[in,out] | loc | local matrix storing the result |
[in] | alpha | multiplicative coefficient |
[in] | add | values to add to loc |
cs_real_t cs_weighted_sum_squared | ( | cs_lnum_t | n, |
const cs_real_t *restrict | x, | ||
const cs_real_t *restrict | weight | ||
) |
Compute the weighted sum of squared values of an array.
Compute the weighted sum of square values of an array.
[in] | n | size of arrays x and weight |
[in] | x | array of floating-point values |
[in] | weight | floating-point values of weights |