8.3
general documentation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
cs_matrix_util.h
Go to the documentation of this file.
1#ifndef __CS_MATRIX_UTIL_H__
2#define __CS_MATRIX_UTIL_H__
3
4/*============================================================================
5 * Utilitary functions for sparse matrixes.
6 *============================================================================*/
7
8/*----------------------------------------------------------------------------
9 * Local headers
10 *----------------------------------------------------------------------------*/
11
12#include "cs_defs.h"
13
14#include "cs_halo.h"
15#include "cs_numbering.h"
16
17#include "cs_matrix.h"
18
19/*----------------------------------------------------------------------------*/
20
22
23/*============================================================================
24 * Macro definitions
25 *============================================================================*/
26
27/*============================================================================
28 * Type definitions
29 *============================================================================*/
30
31/*============================================================================
32 * Global variables
33 *============================================================================*/
34
35/*=============================================================================
36 * Public function prototypes
37 *============================================================================*/
38
39/*----------------------------------------------------------------------------
40 * Compute diagonal dominance metric.
41 *
42 * parameters:
43 * matrix <-- pointer to matrix structure
44 * dd --> diagonal dominance (normalized)
45 *----------------------------------------------------------------------------*/
46
47void
49 cs_real_t dd[]);
50
51/*----------------------------------------------------------------------------
52 * Dump a linear system matrix and right-hand side to file.
53 *
54 * parameters:
55 * matrix <-- pointer to mat$rix structure
56 * rhs <-- right hand side vector
57 * name <-- identifier string used in file name
58 *----------------------------------------------------------------------------*/
59
60void
62 const cs_real_t rhs[],
63 const char *name);
64
65/*----------------------------------------------------------------------------
66 * Dump a vector to file.
67 *
68 * parameters:
69 * n_rows <-- number of local rows
70 * stride <-- associated stride
71 * x <-- associated vector
72 * name <-- identifier string used in file name
73 *----------------------------------------------------------------------------*/
74
75void
77 const cs_lnum_t stride,
78 const cs_real_t x[],
79 const char *name);
80
81/*----------------------------------------------------------------------------
82 * Dump a matrix to file.
83 *
84 * parameters:
85 * matrix <-- pointer to matrix structure
86 * name <-- identifier string used in file name
87 *----------------------------------------------------------------------------*/
88
89void
90cs_matrix_dump(const cs_matrix_t *matrix,
91 const char *name);
92
93/*----------------------------------------------------------------------------
94 * Log general info relative to matrix.
95 *
96 * parameters:
97 * matrix <-- pointer to matrix structure
98 * verbosity <-- verbosity level
99 *----------------------------------------------------------------------------*/
100
101void
102cs_matrix_log_info(const cs_matrix_t *matrix,
103 int verbosity);
104
105/*----------------------------------------------------------------------------
106 * Test matrix dump operations.
107 *
108 * parameters:
109 * n_rows <-- number of local rows
110 * n_cols_ext <-- number of colmuns including ghost columns (array size)
111 * n_edges <-- local number of graph edges
112 * edges <-- graph edges connectivity
113 * halo <-- cell halo structure
114 * numbering <-- vectorization or thread-related numbering info, or nullptr
115 *----------------------------------------------------------------------------*/
116
117void
119 cs_lnum_t n_cols_ext,
120 cs_lnum_t n_edges,
121 const cs_lnum_2_t *edges,
122 const cs_halo_t *halo,
123 const cs_numbering_t *numbering);
124
125/*----------------------------------------------------------------------------*/
126
128
129#endif /* __CS_MATRIX_UTIL_H__ */
#define BEGIN_C_DECLS
Definition: cs_defs.h:542
double cs_real_t
Floating-point value.
Definition: cs_defs.h:342
cs_lnum_t cs_lnum_2_t[2]
vector of 2 local mesh-entity ids
Definition: cs_defs.h:352
#define END_C_DECLS
Definition: cs_defs.h:543
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:335
struct _cs_matrix_t cs_matrix_t
Definition: cs_matrix.h:110
void cs_matrix_dump_linear_system(const cs_matrix_t *matrix, const cs_real_t rhs[], const char *name)
Definition: cs_matrix_util.cpp:1843
void cs_matrix_dump_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)
Definition: cs_matrix_util.cpp:2040
void cs_matrix_diag_dominance(const cs_matrix_t *matrix, cs_real_t dd[])
Definition: cs_matrix_util.cpp:1785
void cs_matrix_dump(const cs_matrix_t *matrix, const char *name)
Definition: cs_matrix_util.cpp:1944
void cs_matrix_log_info(const cs_matrix_t *matrix, int verbosity)
Log general info relative to matrix.
Definition: cs_matrix_util.cpp:1995
void cs_matrix_dump_vector(const cs_lnum_t n_rows, const cs_lnum_t stride, const cs_real_t x[], const char *name)
Definition: cs_matrix_util.cpp:1892
Definition: cs_halo.h:77
Definition: cs_numbering.h:87