#include "cs_defs.h"
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <math.h>
#include "bft_mem.h"
#include "bft_error.h"
#include "bft_printf.h"
#include "cs_base.h"
#include "cs_blas.h"
#include "cs_field.h"
#include "cs_halo.h"
#include "cs_halo_perio.h"
#include "cs_internal_coupling.h"
#include "cs_log.h"
#include "cs_mesh.h"
#include "cs_mesh_adjacencies.h"
#include "cs_numbering.h"
#include "cs_prototypes.h"
#include "cs_range_set.h"
#include "cs_timer.h"
#include "cs_matrix.h"
#include "cs_matrix_priv.h"
#include "cs_matrix_tuning.h"
#include "cs_matrix_default.h"
Functions | |
void | cs_matrix_vector_native_multiply (bool symmetric, cs_lnum_t db_size, cs_lnum_t eb_size, int f_id, const cs_real_t *dam, const cs_real_t *xam, cs_real_t *vx, cs_real_t *vy) |
void | cs_matrix_initialize (void) |
void | cs_matrix_finalize (void) |
void | cs_matrix_update_mesh (void) |
cs_matrix_t * | cs_matrix_default (bool symmetric, cs_lnum_t diag_block_size, cs_lnum_t extra_diag_block_size) |
cs_matrix_t * | cs_matrix_msr (bool symmetric, cs_lnum_t diag_block_size, cs_lnum_t extra_diag_block_size) |
cs_matrix_t * | cs_matrix_native (bool symmetric, cs_lnum_t diag_block_size, cs_lnum_t extra_diag_block_size) |
cs_matrix_t * | cs_matrix_external (const char *type_name, bool symmetric, cs_lnum_t diag_block_size, cs_lnum_t extra_diag_block_size) |
Return matrix wrapper for external library for a given fill type. More... | |
cs_matrix_t * | cs_matrix_copy_to_external (cs_matrix_t *src, bool symmetric, cs_lnum_t diag_block_size, cs_lnum_t extra_diag_block_size) |
Copy base matrix to external library matrix type for given fill type. More... | |
void | cs_matrix_default_set_tuned (cs_matrix_t *m) |
void | cs_matrix_set_tuning_runs (int n_min_products, double t_measure) |
void | cs_matrix_get_tuning_runs (int *n_min_products, double *t_measure) |
void | cs_matrix_default_set_type (cs_matrix_fill_type_t fill_type, cs_matrix_type_t type) |
Set default matrix type for a given fill type. More... | |
const cs_gnum_t * | cs_matrix_get_block_row_g_id (cs_matrix_t *m) |
Return a (0-based) global block row numbering for a given matrix. More... | |
cs_matrix_t * | cs_matrix_set_coefficients_by_assembler (const cs_field_t *f, cs_matrix_type_t type, bool symmetric, cs_lnum_t diag_block_size, cs_lnum_t extra_diag_block_size, const cs_real_t *da, const cs_real_t *xa) |
Assign coefficients to a matrix using a matrix assembler. More... | |
cs_matrix_t* cs_matrix_copy_to_external | ( | cs_matrix_t * | src, |
bool | symmetric, | ||
cs_lnum_t | diag_block_size, | ||
cs_lnum_t | extra_diag_block_size | ||
) |
Copy base matrix to external library matrix type for given fill type.
Note that the matrix containers share the same assigned structure, so they must be both destroyed before that structure.
Coefficients and matching structures are not copied or created.
This function is intended to allow sharing of a base structure or assembler with an external library matrix wrapper, so as to allow efficient coefficient assignment, but with external coefficient handling.
The matrix shoud be converted to the desired external type after calling this function, so that it can the be accessed using cs_matrix_external.
[in] | symmetric | Indicates if matrix coefficients are symmetric |
[in] | diag_block_size | Block sizes for diagonal |
[in] | extra_diag_block_size | Block sizes for extra diagonal |
cs_matrix_t* cs_matrix_default | ( | bool | symmetric, |
cs_lnum_t | diag_block_size, | ||
cs_lnum_t | extra_diag_block_size | ||
) |
void cs_matrix_default_set_tuned | ( | cs_matrix_t * | m | ) |
void cs_matrix_default_set_type | ( | cs_matrix_fill_type_t | fill_type, |
cs_matrix_type_t | type | ||
) |
Set default matrix type for a given fill type.
[in] | fill | type Fill type for which tuning behavior is set |
[in] | type | Matrix type to use |
cs_matrix_t* cs_matrix_external | ( | const char * | type_name, |
bool | symmetric, | ||
cs_lnum_t | diag_block_size, | ||
cs_lnum_t | extra_diag_block_size | ||
) |
Return matrix wrapper for external library for a given fill type.
[in] | type_name | Matrix type name |
[in] | symmetric | Indicates if coefficients are symmetric |
[in] | diag_block_size | Block sizes for diagonal |
[in] | extra_diag_block_size | Block sizes for extra diagonal |
void cs_matrix_finalize | ( | void | ) |
const cs_gnum_t* cs_matrix_get_block_row_g_id | ( | cs_matrix_t * | m | ) |
Return a (0-based) global block row numbering for a given matrix.
The numbering is built or updated if not previously used, or if the previous call considered a differeent matrix, and is simply returned otherwise. In other words, this works as a matrix global numbering cache.
[in] | m | associated matrix |
void cs_matrix_get_tuning_runs | ( | int * | n_min_products, |
double * | t_measure | ||
) |
void cs_matrix_initialize | ( | void | ) |
cs_matrix_t* cs_matrix_msr | ( | bool | symmetric, |
cs_lnum_t | diag_block_size, | ||
cs_lnum_t | extra_diag_block_size | ||
) |
cs_matrix_t* cs_matrix_native | ( | bool | symmetric, |
cs_lnum_t | diag_block_size, | ||
cs_lnum_t | extra_diag_block_size | ||
) |
cs_matrix_t* cs_matrix_set_coefficients_by_assembler | ( | const cs_field_t * | f, |
cs_matrix_type_t | type, | ||
bool | symmetric, | ||
cs_lnum_t | diag_block_size, | ||
cs_lnum_t | extra_diag_block_size, | ||
const cs_real_t * | da, | ||
const cs_real_t * | xa | ||
) |
Assign coefficients to a matrix using a matrix assembler.
[in] | f | pointer to associated field |
[in] | type | matrix type |
[in] | symmetric | is matrix symmetric ? |
[in] | diag_block_size | block sizes for diagonal, or NULL |
[in] | extra_diag_block_size | block sizes for extra diagonal, or NULL |
[in] | da | diagonal values (NULL if zero) |
[in] | xa | extradiagonal values (NULL if zero) casts as: xa[n_edges] if symmetric, xa[n_edges][2] if non symmetric |
void cs_matrix_set_tuning_runs | ( | int | n_min_products, |
double | t_measure | ||
) |
void cs_matrix_update_mesh | ( | void | ) |