7.1
general documentation
cs_matrix_default.h File Reference
#include "cs_defs.h"
#include "cs_field.h"
#include "cs_halo.h"
#include "cs_matrix.h"
#include "cs_numbering.h"
#include "cs_halo_perio.h"
+ Include dependency graph for cs_matrix_default.h:

Go to the source code of this file.

Functions

void cs_matrix_vector_native_multiply (bool symmetric, const cs_lnum_t db_size[4], const cs_lnum_t eb_size[4], 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_tcs_matrix_default (bool symmetric, const cs_lnum_t *diag_block_size, const cs_lnum_t *extra_diag_block_size)
 
cs_matrix_tcs_matrix_msr (bool symmetric, const cs_lnum_t *diag_block_size, const cs_lnum_t *extra_diag_block_size)
 
cs_matrix_tcs_matrix_native (bool symmetric, const cs_lnum_t *diag_block_size, const cs_lnum_t *extra_diag_block_size)
 
cs_matrix_tcs_matrix_external (const char *type_name, bool symmetric, const cs_lnum_t *diag_block_size, const cs_lnum_t *extra_diag_block_size)
 Return matrix wrapper for external library for a given fill type. More...
 
cs_matrix_tcs_matrix_copy_to_external (cs_matrix_t *src, bool symmetric, const cs_lnum_t *diag_block_size, const 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_tcs_matrix_get_block_row_g_id (cs_lnum_t n_rows, const cs_halo_t *halo)
 
cs_matrix_tcs_matrix_set_coefficients_by_assembler (const cs_field_t *f, cs_matrix_type_t type, bool symmetric, const cs_lnum_t *diag_block_size, const 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...
 

Function Documentation

◆ cs_matrix_copy_to_external()

cs_matrix_t* cs_matrix_copy_to_external ( cs_matrix_t src,
bool  symmetric,
const cs_lnum_t diag_block_size,
const 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.

Parameters
[in]symmetricIndicates if matrix coefficients are symmetric
[in]diag_block_sizeBlock sizes for diagonal, or NULL
[in]extra_diag_block_sizeBlock sizes for extra diagonal, or NULL
Returns
pointer to native matrix adapted to 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.

Parameters
[in]symmetricIndicates if matrix coefficients are symmetric
[in]diag_block_sizeBlock sizes for diagonal, or NULL
[in]extra_diag_block_sizeBlock sizes for extra diagonal, or NULL
Returns
pointer to native matrix adapted to fill type

◆ cs_matrix_default()

cs_matrix_t* cs_matrix_default ( bool  symmetric,
const cs_lnum_t diag_block_size,
const cs_lnum_t extra_diag_block_size 
)

◆ cs_matrix_default_set_tuned()

void cs_matrix_default_set_tuned ( cs_matrix_t m)

◆ cs_matrix_default_set_type()

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.

Parameters
[in]filltype Fill type for which tuning behavior is set
[in]typeMatrix type to use

◆ cs_matrix_external()

cs_matrix_t* cs_matrix_external ( const char *  type_name,
bool  symmetric,
const cs_lnum_t diag_block_size,
const cs_lnum_t extra_diag_block_size 
)

Return matrix wrapper for external library for a given fill type.

Parameters
[in]type_nameMatrix type name
[in]symmetricIndicates if coefficients are symmetric
[in]diag_block_sizeNlock sizes for diagonal, or NULL
[in]extra_diag_block_sizeBlock sizes for extra diagonal, or NULL
Returns
Pointer to matrix matching requested type

◆ cs_matrix_finalize()

void cs_matrix_finalize ( void  )

◆ cs_matrix_get_block_row_g_id()

const cs_gnum_t* cs_matrix_get_block_row_g_id ( cs_lnum_t  n_rows,
const cs_halo_t halo 
)

◆ cs_matrix_get_tuning_runs()

void cs_matrix_get_tuning_runs ( int *  n_min_products,
double *  t_measure 
)

◆ cs_matrix_initialize()

void cs_matrix_initialize ( void  )

◆ cs_matrix_msr()

cs_matrix_t* cs_matrix_msr ( bool  symmetric,
const cs_lnum_t diag_block_size,
const cs_lnum_t extra_diag_block_size 
)

◆ cs_matrix_native()

cs_matrix_t* cs_matrix_native ( bool  symmetric,
const cs_lnum_t diag_block_size,
const cs_lnum_t extra_diag_block_size 
)

◆ cs_matrix_set_coefficients_by_assembler()

cs_matrix_t* cs_matrix_set_coefficients_by_assembler ( const cs_field_t f,
cs_matrix_type_t  type,
bool  symmetric,
const cs_lnum_t diag_block_size,
const 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.

Parameters
[in]fpointer to associated field
[in]typematrix type
[in]symmetricis matrix symmetric ?
[in]diag_block_sizeblock sizes for diagonal, or NULL
[in]extra_diag_block_sizeblock sizes for extra diagonal, or NULL
[in]dadiagonal values (NULL if zero)
[in]xaextradiagonal values (NULL if zero) casts as: xa[n_edges] if symmetric, xa[n_edges][2] if non symmetric
Returns
pointer to associated matrix structure

◆ cs_matrix_set_tuning_runs()

void cs_matrix_set_tuning_runs ( int  n_min_products,
double  t_measure 
)

◆ cs_matrix_update_mesh()

void cs_matrix_update_mesh ( void  )

◆ cs_matrix_vector_native_multiply()

void cs_matrix_vector_native_multiply ( bool  symmetric,
const cs_lnum_t  db_size[4],
const cs_lnum_t  eb_size[4],
int  f_id,
const cs_real_t dam,
const cs_real_t xam,
cs_real_t vx,
cs_real_t vy 
)