|
My Project
programmer's documentation
|
Go to the documentation of this file. 1 #ifndef __CS_MATRIX_H__
2 #define __CS_MATRIX_H__
1071 const char *func_name);
void cs_matrix_variant_destroy(cs_matrix_variant_t **mv)
Destroy a matrix variant structure.
Definition: cs_matrix.c:7515
Definition: cs_matrix.h:57
void cs_matrix_vector_multiply(cs_halo_rotation_t rotation_mode, const cs_matrix_t *matrix, cs_real_t *restrict x, cs_real_t *restrict y)
Matrix.vector product y = A.x.
Definition: cs_matrix.c:6784
Definition: cs_matrix.h:71
cs_real_t * _vals
Definition: cs_matrix.h:105
Definition: cs_matrix.h:80
void cs_matrix_copy_coefficients(cs_matrix_t *matrix, bool symmetric, const cs_lnum_t *diag_block_size, const cs_lnum_t *extra_diag_block_size, const cs_lnum_t n_edges, const cs_lnum_2_t edges[], const cs_real_t *da, const cs_real_t *xa)
Set matrix coefficients, copying values to private arrays.
Definition: cs_matrix.c:6021
bool cs_matrix_is_symmetric(const cs_matrix_t *matrix)
Query matrix coefficients symmetry.
Definition: cs_matrix.c:6285
void cs_matrix_row_init(cs_matrix_row_info_t *r)
Initialize row info for a given matrix.
Definition: cs_matrix.c:6454
void cs_matrix_row_finalize(cs_matrix_row_info_t *r)
Finalize row info for a given matrix.
Definition: cs_matrix.c:6473
const cs_real_t * cs_matrix_get_diagonal(const cs_matrix_t *matrix)
Get matrix diagonal values.
Definition: cs_matrix.c:6330
#define restrict
Definition: cs_defs.h:127
struct _cs_matrix_structure_t cs_matrix_structure_t
Definition: cs_matrix.h:86
const cs_lnum_t * cs_matrix_get_diag_block_size(const cs_matrix_t *matrix)
Return matrix diagonal block sizes.
Definition: cs_matrix.c:5816
void cs_matrix_get_msr_arrays(const cs_matrix_t *matrix, const cs_lnum_t **row_index, const cs_lnum_t **col_id, const cs_real_t **d_val, const cs_real_t **x_val)
Get arrays describing a matrix in MSR format.
Definition: cs_matrix.c:6731
const cs_halo_t * cs_matrix_get_halo(const cs_matrix_t *matrix)
Return pointer to matrix halo structure.
Definition: cs_matrix.c:5860
void cs_matrix_variant_set_func(cs_matrix_variant_t *mv, const cs_numbering_t *numbering, cs_matrix_fill_type_t fill_type, int ed_flag, const char *func_name)
Select the sparse matrix-vector product function to be used by a matrix variant for a given fill type...
Definition: cs_matrix.c:7557
Definition: cs_matrix.h:77
void cs_matrix_variant_build_list(int n_fill_types, cs_matrix_fill_type_t fill_types[], bool type_filter[], const cs_numbering_t *numbering, int *n_variants, cs_matrix_variant_t **m_variant)
Build list of variants for tuning or testing.
Definition: cs_matrix.c:7282
struct _cs_matrix_assembler_values_t cs_matrix_assembler_values_t
Definition: cs_matrix_assembler.h:65
void cs_matrix_set_coefficients(cs_matrix_t *matrix, bool symmetric, const cs_lnum_t *diag_block_size, const cs_lnum_t *extra_diag_block_size, const cs_lnum_t n_edges, const cs_lnum_2_t edges[], const cs_real_t *da, const cs_real_t *xa)
Set matrix coefficients defined relative to a "native" edge graph, sharing arrays with the caller whe...
Definition: cs_matrix.c:5957
#define END_C_DECLS
Definition: cs_defs.h:468
cs_matrix_t * cs_matrix_create_by_copy(cs_matrix_t *src)
Create a matrix container by copying another.
Definition: cs_matrix.c:5602
void cs_matrix_csr_assembler_values_init(void *matrix_p, const cs_lnum_t db_size[4], const cs_lnum_t eb_size[4])
Function for initialization of CSR matrix coefficients using local row ids and column indexes.
Definition: cs_matrix.c:6913
const char * cs_matrix_type_name[]
double cs_real_t
Floating-point value.
Definition: cs_defs.h:302
Definition: cs_matrix.h:79
#define BEGIN_C_DECLS
Definition: cs_defs.h:467
cs_matrix_fill_type_t cs_matrix_get_fill_type(bool symmetric, const cs_lnum_t *diag_block_size, const cs_lnum_t *extra_diag_block_size)
Get matrix fill type, depending on block sizes.
Definition: cs_matrix.c:5887
struct _cs_matrix_t cs_matrix_t
Definition: cs_matrix.h:90
Definition: cs_matrix.h:73
cs_matrix_t * cs_matrix_create(const cs_matrix_structure_t *ms)
Create a matrix container using a given structure.
Definition: cs_matrix.c:5487
void cs_matrix_msr_assembler_values_init(void *matrix_p, const cs_lnum_t db_size[4], const cs_lnum_t eb_size[4])
Function for initialization of MSR matrix coefficients using local row ids and column indexes.
Definition: cs_matrix.c:7064
Definition: cs_numbering.h:83
void cs_matrix_transfer_coefficients_msr(cs_matrix_t *matrix, bool symmetric, const cs_lnum_t *diag_block_size, const cs_lnum_t *extra_diag_block_size, const cs_lnum_t row_index[], const cs_lnum_t col_id[], cs_real_t **d_val, cs_real_t **x_val)
Set matrix coefficients in an MSR format, transfering the property of those arrays to the matrix.
Definition: cs_matrix.c:6081
cs_lnum_t cs_matrix_get_n_columns(const cs_matrix_t *matrix)
Return number of columns in a matrix.
Definition: cs_matrix.c:5724
bool cs_matrix_is_mapped_from_native(const cs_matrix_t *matrix)
Indicate whether coefficients were mapped from native face-based arrays.
Definition: cs_matrix.c:6306
struct _cs_matrix_variant_t cs_matrix_variant_t
Definition: cs_matrix.h:94
void const int const int const int const cs_real_t const int const cs_real_t const cs_real_t const cs_real_t const cs_real_t const cs_real_t const cs_real_t const cs_real_t const cs_real_t cs_real_t da[]
Definition: cs_matrix_building.h:65
void const cs_int_t const cs_int_t const cs_int_t const cs_int_t * stride
Definition: cs_sat_coupling.h:325
void cs_matrix_release_coefficients(cs_matrix_t *matrix)
Release shared matrix coefficients.
Definition: cs_matrix.c:6152
const cs_lnum_t * cs_matrix_get_extra_diag_block_size(const cs_matrix_t *matrix)
Return matrix extra-diagonal block sizes.
Definition: cs_matrix.c:5840
cs_matrix_variant_t * cs_matrix_variant_create(cs_matrix_type_t type, const cs_numbering_t *numbering)
Build matrix variant.
Definition: cs_matrix.c:7239
const cs_lnum_t * col_id
Definition: cs_matrix.h:102
void cs_matrix_msr_assembler_values_add(void *matrix_p, cs_lnum_t n, cs_lnum_t stride, const cs_lnum_t row_id[], const cs_lnum_t col_idx[], const cs_real_t vals[])
Function pointer for addition to MSR matrix coefficients using local row ids and column indexes.
Definition: cs_matrix.c:7132
void cs_matrix_variant_test(cs_lnum_t n_rows, cs_lnum_t n_cols_ext, cs_lnum_t n_edges, const cs_lnum_2_t *edges, const cs_halo_t *halo, const cs_numbering_t *numbering)
Test local matrix.vector product operations.
Definition: cs_matrix.c:7651
void cs_matrix_get_row(const cs_matrix_t *matrix, const cs_lnum_t row_id, cs_matrix_row_info_t *r)
Get row values for a given matrix.
Definition: cs_matrix.c:6504
void cs_matrix_pre_vector_multiply_sync(cs_halo_rotation_t rotation_mode, const cs_matrix_t *matrix, cs_real_t *x)
Definition: cs_matrix.c:6888
void cs_matrix_get_native_arrays(const cs_matrix_t *matrix, bool *symmetric, cs_lnum_t *n_edges, const cs_lnum_2_t **edges, const cs_real_t **d_val, const cs_real_t **x_val)
Get arrays describing a matrix in native format.
Definition: cs_matrix.c:6633
void const cs_lnum_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const y
Definition: cs_wall_functions.h:1147
Definition: cs_matrix.h:59
cs_matrix_structure_t * cs_matrix_structure_create_from_assembler(cs_matrix_type_t type, cs_matrix_assembler_t *ma)
Create a matrix structure using a matrix assembler.
Definition: cs_matrix.c:5420
const cs_real_t * vals
Definition: cs_matrix.h:104
void cs_matrix_exdiag_vector_multiply(cs_halo_rotation_t rotation_mode, const cs_matrix_t *matrix, cs_real_t *restrict x, cs_real_t *restrict y)
Matrix.vector product y = (A-D).x.
Definition: cs_matrix.c:6855
const char * cs_matrix_type_fullname[]
cs_lnum_t * _col_id
Definition: cs_matrix.h:103
cs_matrix_t * cs_matrix_create_from_assembler(cs_matrix_type_t type, cs_matrix_assembler_t *ma)
Create a matrix directly from assembler.
Definition: cs_matrix.c:5555
cs_matrix_t * cs_matrix_create_by_variant(const cs_matrix_structure_t *ms, const cs_matrix_variant_t *mv)
Create a matrix container using a given variant.
Definition: cs_matrix.c:5520
const char * cs_matrix_fill_type_name[]
void cs_matrix_csr_assembler_values_add(void *matrix_p, cs_lnum_t n, cs_lnum_t stride, const cs_lnum_t row_id[], const cs_lnum_t col_idx[], const cs_real_t vals[])
Function pointer for addition to CSR matrix coefficients using local row ids and column indexes.
Definition: cs_matrix.c:6972
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:298
void cs_matrix_variant_merge(cs_matrix_variant_t *mv, const cs_matrix_variant_t *mv_merge, cs_matrix_fill_type_t fill_type)
Merge a functions to a matrix variant from another variant sharing the same structure.
Definition: cs_matrix.c:7603
Definition: cs_matrix.h:60
cs_lnum_t row_size
Definition: cs_matrix.h:100
void cs_matrix_destroy(cs_matrix_t **matrix)
Definition: cs_matrix.c:5648
void cs_matrix_copy_diagonal(const cs_matrix_t *matrix, cs_real_t *restrict da)
Copy matrix diagonal values.
Definition: cs_matrix.c:6261
Definition: cs_matrix.h:58
cs_matrix_structure_t * cs_matrix_structure_create_msr_shared(bool have_diag, bool direct_assmbly, cs_lnum_t n_rows, cs_lnum_t n_cols_ext, const cs_lnum_t *row_index, const cs_lnum_t *col_id, const cs_halo_t *halo, const cs_numbering_t *numbering)
Create an MSR matrix structure sharing an existing connectivity definition as well as an optional edg...
Definition: cs_matrix.c:5370
void cs_matrix_vector_multiply_nosync(const cs_matrix_t *matrix, const cs_real_t *x, cs_real_t *restrict y)
Matrix.vector product y = A.x with no prior halo update of x.
Definition: cs_matrix.c:6823
Definition: cs_matrix.h:61
cs_lnum_t cs_matrix_get_n_entries(const cs_matrix_t *matrix)
Return number of entries in matrix.
Definition: cs_matrix.c:5761
struct _cs_matrix_assembler_t cs_matrix_assembler_t
Definition: cs_matrix_assembler.h:61
int cs_lnum_2_t[2]
vector of 2 local mesh-entity ids
Definition: cs_defs.h:308
Definition: cs_matrix.h:70
Definition: cs_matrix.h:69
cs_matrix_structure_t * cs_matrix_structure_create(cs_matrix_type_t type, bool have_diag, cs_lnum_t n_rows, cs_lnum_t n_cols_ext, cs_lnum_t n_edges, const cs_lnum_2_t *edges, const cs_halo_t *halo, const cs_numbering_t *numbering)
Create a matrix structure.
Definition: cs_matrix.c:5188
cs_matrix_fill_type_t
Definition: cs_matrix.h:67
cs_matrix_type_t
Definition: cs_matrix.h:55
cs_lnum_t buffer_size
Definition: cs_matrix.h:101
cs_matrix_type_t cs_matrix_get_type(const cs_matrix_t *matrix)
Return matrix type.
Definition: cs_matrix.c:5707
void cs_matrix_get_csr_arrays(const cs_matrix_t *matrix, const cs_lnum_t **row_index, const cs_lnum_t **col_id, const cs_real_t **val)
Get arrays describing a matrix in CSR format.
Definition: cs_matrix.c:6687
cs_matrix_type_t cs_matrix_variant_type(const cs_matrix_variant_t *mv)
Get the type associated with a matrix variant.
Definition: cs_matrix.c:7629
cs_matrix_assembler_values_t * cs_matrix_assembler_values_init(cs_matrix_t *matrix, const cs_lnum_t *diag_block_size, const cs_lnum_t *extra_diag_block_size)
Create and initialize a CSR matrix assembler values structure.
Definition: cs_matrix.c:6196
cs_matrix_structure_t * cs_matrix_structure_create_msr(cs_matrix_type_t type, bool transfer, bool have_diag, cs_lnum_t n_rows, cs_lnum_t n_cols_ext, cs_lnum_t **row_index, cs_lnum_t **col_id, const cs_halo_t *halo, const cs_numbering_t *numbering)
Create a matrix structure based on a MSR connectivity definition.
Definition: cs_matrix.c:5285
Definition: cs_matrix.h:98
cs_halo_rotation_t
Definition: cs_halo.h:60
void cs_matrix_structure_destroy(cs_matrix_structure_t **ms)
Destroy a matrix structure.
Definition: cs_matrix.c:5459
void const cs_int_t * type
Definition: cs_measures_util.h:425
void const int const int const int const cs_real_t const int const cs_real_t const cs_real_t const cs_real_t const cs_real_t const cs_real_t const cs_real_t const cs_real_t const cs_real_t cs_real_t cs_real_t xa[]
Definition: cs_matrix_building.h:65
cs_lnum_t cs_matrix_get_n_rows(const cs_matrix_t *matrix)
Return number of rows in matrix.
Definition: cs_matrix.c:5741
const cs_real_t * cs_matrix_get_extra_diagonal(const cs_matrix_t *matrix)
Get pointer to matrix extra-diagonal values in "native" format.
Definition: cs_matrix.c:6430