9.1
general documentation
cs_matrix.h
Go to the documentation of this file.
1#ifndef __CS_MATRIX_H__
2#define __CS_MATRIX_H__
3
4/*============================================================================
5 * Sparse Matrix Representation and Operations.
6 *============================================================================*/
7
8/*
9 This file is part of code_saturne, a general-purpose CFD tool.
10
11 Copyright (C) 1998-2025 EDF S.A.
12
13 This program is free software; you can redistribute it and/or modify it under
14 the terms of the GNU General Public License as published by the Free Software
15 Foundation; either version 2 of the License, or (at your option) any later
16 version.
17
18 This program is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21 details.
22
23 You should have received a copy of the GNU General Public License along with
24 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
25 Street, Fifth Floor, Boston, MA 02110-1301, USA.
26*/
27
28/*----------------------------------------------------------------------------*/
29
30/*----------------------------------------------------------------------------
31 * Local headers
32 *----------------------------------------------------------------------------*/
33
34#include "base/cs_defs.h"
35
36#if defined(__cplusplus)
37#include "base/cs_dispatch.h"
38#endif
39
40#include "base/cs_halo.h"
41#include "base/cs_numbering.h"
43
44/*----------------------------------------------------------------------------*/
45
47
48/*============================================================================
49 * Macro definitions
50 *============================================================================*/
51
52/*============================================================================
53 * Type definitions
54 *============================================================================*/
55
56/* Matrix structure representation types */
57
58typedef enum {
59
73
74/* Matrix fill types (for tuning) */
75
76typedef enum {
77
78 CS_MATRIX_SCALAR, /* Simple scalar matrix */
79 CS_MATRIX_SCALAR_SYM, /* Simple scalar symmetric matrix */
80 CS_MATRIX_BLOCK_D, /* Matrix with diagonal blocks
81 (and m.I extradiagonal blocks) */
82 CS_MATRIX_BLOCK_D_66, /* Matrix with 6x6 diagonal blocks
83 (and 6.I extradiagonal blocks;
84 subcase of CS_MATRIX_BLOCK_D, allows
85 separate tuning) */
86 CS_MATRIX_BLOCK_D_SYM, /* Symmetric matrix with diagonal blocks
87 (and m.I extradiagonal blocks) */
88 CS_MATRIX_BLOCK, /* Block matrix */
89 CS_MATRIX_N_FILL_TYPES /* Number of possible matrix fill types */
90
92
99typedef enum {
100
107
108/* Structure associated with opaque matrix structure object */
109
110typedef struct _cs_matrix_structure_t cs_matrix_structure_t;
111
112/* Structure associated with opaque matrix object */
113
114typedef struct _cs_matrix_t cs_matrix_t;
115
116/* Structure associated with opaque matrix tuning results object */
117
118typedef struct _cs_matrix_variant_t cs_matrix_variant_t;
119
120/* Information structure for extraction of matrix row */
121
122typedef struct {
123
124 cs_lnum_t row_size; /*< Row size from last call */
125 cs_lnum_t buffer_size; /*< Allocated buffer size */
126 const cs_lnum_t *col_id; /*< Pointer to local column ids */
127 cs_lnum_t *_col_id; /*< Pointer to local column ids copy */
128 const cs_real_t *vals; /*< Pointer to local row values */
129 cs_real_t *_vals; /*< Pointer to local row values copy */
130
132
133/*============================================================================
134 * Global variables
135 *============================================================================*/
136
139extern const char *cs_matrix_fill_type_name[];
140
143extern const char *cs_matrix_spmv_type_name[];
144
145/*----------------------------------------------------------------------------*/
146
148
149/*=============================================================================
150 * Public C++ function prototypes
151 *============================================================================*/
152
153#if defined(__cplusplus)
154
155/*----------------------------------------------------------------------------*/
156/*
157 * \brief Matrix.vector product y = A.x
158 *
159 * This function includes a halo update of x prior to multiplication by A.
160 *
161 * \param[in, out] ctx reference to dispatch context
162 * \param[in] matrix pointer to matrix structure
163 * \param[in, out] x multiplying vector values
164 * (ghost values updated)
165 * \param[out] y resulting vector
166 */
167/*----------------------------------------------------------------------------*/
168
169void
171 const cs_matrix_t *matrix,
172 cs_real_t x[],
173 cs_real_t y[]);
174
175/*----------------------------------------------------------------------------*/
176/*
177 * \brief Partial matrix.vector product.
178 *
179 * This function includes a halo update of x prior to multiplication,
180 * except for the CS_MATRIX_SPMV_L operation type, which does not require it,
181 * as halo adjacencies are only present and useful in the upper-diagonal part..
182 *
183 * \param[in, out] ctx reference to dispatch context
184 * \param[in] matrix pointer to matrix structure
185 * \param[in] op_type SpMV operation type
186 * \param[in, out] x multiplying vector values
187 * (ghost values updated)
188 * \param[out] y resulting vector
189 */
190/*----------------------------------------------------------------------------*/
191
192void
194(
195 [[maybe_unused]] cs_dispatch_context &ctx,
196 const cs_matrix_t *matrix,
197 cs_matrix_spmv_type_t op_type,
198 cs_real_t x[],
199 cs_real_t y[]
200);
201
202/*----------------------------------------------------------------------------*/
203
204#endif // defined(__cplusplus)
205
207
208/*=============================================================================
209 * Public function prototypes
210 *============================================================================*/
211
212/*----------------------------------------------------------------------------
213 * Create a matrix structure.
214 *
215 * Note that the structure created usually maps to the given existing
216 * cell global number, face -> cell connectivity arrays, and cell halo
217 * structure, so it must be destroyed before they are freed
218 * (usually along with the code's main face -> cell structure).
219 *
220 * Note that the resulting matrix structure will contain a full main
221 * main diagonal, and that the extra-diagonal structure is always
222 * symmetric (though the coefficients my not be, and we may choose a
223 * matrix format that does not exploit this symmetry). If the edges
224 * connectivity argument is null, the matrix will be purely diagonal.
225 *
226 * parameters:
227 * type <-- type of matrix considered
228 * n_rows <-- local number of rows
229 * n_cols_ext <-- number of columns + ghosts
230 * n_edges <-- local number of (undirected) graph edges
231 * edges <-- edges (symmetric row <-> column) connectivity
232 * halo <-- halo structure associated with cells, or nullptr
233 * numbering <-- vectorization or thread-related numbering info, or nullptr
234 *
235 * returns:
236 * pointer to created matrix structure;
237 *----------------------------------------------------------------------------*/
238
241 cs_lnum_t n_rows,
242 cs_lnum_t n_cols_ext,
243 cs_lnum_t n_edges,
244 const cs_lnum_2_t *edges,
245 const cs_halo_t *halo,
246 const cs_numbering_t *numbering);
247
248/*----------------------------------------------------------------------------
249 * Create a matrix structure based on a MSR connectivity definition.
250 *
251 * Only CSR and MSR formats are handled.
252 *
253 * col_id is sorted row by row during the creation of this structure.
254 *
255 * In case the property of the row index and col_id arrays are transferred
256 * to the structure, the arrays pointers passed as arguments are set to nullptr,
257 * to help ensure the caller does not use the original arrays directly after
258 * this call.
259 *
260 * parameters:
261 * type <-- type of matrix considered
262 * transfer <-- transfer property of row_index and col_id
263 * if true, map them otherwise
264 * ordered <-- indicates if column ids are already ordered
265 * have_diag <-- indicates if the structure includes the
266 * diagonal (should be the same for all rows)
267 * n_rows <-- local number of rows
268 * n_cols_ext <-- local number of columns + ghosts
269 * row_index <-> pointer to index on rows
270 * col_id <-> pointer to array of colum ids related to the row index
271 * halo <-- halo structure for synchronization, or nullptr
272 * numbering <-- vectorization or thread-related numbering info, or nullptr
273 *
274 * returns:
275 * a pointer to a created matrix structure
276 *----------------------------------------------------------------------------*/
277
280 bool transfer,
281 bool have_diag,
282 bool ordered,
283 cs_lnum_t n_rows,
284 cs_lnum_t n_cols_ext,
285 cs_lnum_t **row_index,
286 cs_lnum_t **col_id,
287 const cs_halo_t *halo,
288 const cs_numbering_t *numbering);
289
290/*----------------------------------------------------------------------------
291 * Create an MSR matrix structure sharing an existing connectivity definition.
292 *
293 * Note that as the structure created maps to the given existing
294 * cell global number, face -> cell connectivity arrays, and cell halo
295 * structure, it must be destroyed before they are freed
296 * (usually along with the code's main face -> cell structure).
297 *
298 * parameters:
299 * direct_assembly <-- true if each value corresponds to a unique face
300 * n_rows <-- local number of rows
301 * n_cols_ext <-- local number of columns + ghosts
302 * row_index <-- pointer to index on rows
303 * col_id <-- pointer to array of colum ids related to the row index
304 * halo <-- halo structure for synchronization, or nullptr
305 * numbering <-- vectorization or thread-related numbering
306 * info, or nullptr
307 *
308 * returns:
309 * a pointer to a created matrix structure
310 *----------------------------------------------------------------------------*/
311
313cs_matrix_structure_create_msr_shared(bool direct_assmbly,
314 cs_lnum_t n_rows,
315 cs_lnum_t n_cols_ext,
316 const cs_lnum_t *row_index,
317 const cs_lnum_t *col_id,
318 const cs_halo_t *halo,
319 const cs_numbering_t *numbering);
320
321/*----------------------------------------------------------------------------*/
332/*----------------------------------------------------------------------------*/
333
337
338/*----------------------------------------------------------------------------
339 * Destroy a matrix structure.
340 *
341 * parameters:
342 * ms <-> pointer to matrix structure pointer
343 *----------------------------------------------------------------------------*/
344
345void
347
348/*----------------------------------------------------------------------------*/
349/*
350 * \brief Release arrays describing an MSR matrix structure.
351 *
352 * Ownership is provided back to the caller, if pointers are provided.
353 * If the matrix does not own a given array, a nullptr value is returned
354 * for that array.
355 *
356 * This function only works for an MSR matrix (i.e. there is
357 * no automatic conversion from another matrix type).
358 *
359 * \param[in, out] ms pointer to matrix structure
360 * \param[out] row_index MSR row index, or null
361 * \param[out] col_id MSR column id, or null
362 */
363/*----------------------------------------------------------------------------*/
364
365void
367 cs_lnum_t **row_index,
368 cs_lnum_t **col_id);
369
370/*----------------------------------------------------------------------------
371 * Create a matrix container using a given structure.
372 *
373 * Note that the matrix container maps to the assigned structure,
374 * so it must be destroyed before that structure.
375 *
376 * parameters:
377 * ms <-- associated matrix structure
378 *
379 * returns:
380 * pointer to created matrix structure;
381 *----------------------------------------------------------------------------*/
382
385
386/*----------------------------------------------------------------------------*/
397/*----------------------------------------------------------------------------*/
398
402
403/*----------------------------------------------------------------------------*/
416/*----------------------------------------------------------------------------*/
417
420
421/*----------------------------------------------------------------------------*/
433/*----------------------------------------------------------------------------*/
434
437
438/*----------------------------------------------------------------------------
439 * Destroy a matrix structure.
440 *
441 * In the case of a compoud matrix, sub-matrices are not destroyed.
442 *
443 * parameters:
444 * matrix <-> pointer to matrix structure pointer
445 *----------------------------------------------------------------------------*/
446
447void
449
450/*----------------------------------------------------------------------------
451 * Return type of matrix.
452 *
453 * parameters:
454 * matrix --> pointer to matrix structure
455 *----------------------------------------------------------------------------*/
456
458cs_matrix_get_type(const cs_matrix_t *matrix);
459
460/*----------------------------------------------------------------------------
461 * Return matrix type name.
462 *
463 * parameters:
464 * matrix --> pointer to matrix structure
465 *----------------------------------------------------------------------------*/
466
467const char *
469
470/*----------------------------------------------------------------------------
471 * Return matrix type full name.
472 *
473 * parameters:
474 * matrix --> pointer to matrix structure
475 *----------------------------------------------------------------------------*/
476
477const char *
479
480/*----------------------------------------------------------------------------*/
488/*----------------------------------------------------------------------------*/
489
492
493/*----------------------------------------------------------------------------*/
501/*----------------------------------------------------------------------------*/
502
504cs_matrix_get_n_rows(const cs_matrix_t *matrix);
505
506/*----------------------------------------------------------------------------*/
517/*----------------------------------------------------------------------------*/
518
521
522/*----------------------------------------------------------------------------*/
530/*----------------------------------------------------------------------------*/
531
534
535/*----------------------------------------------------------------------------*/
543/*----------------------------------------------------------------------------*/
544
547
548/*----------------------------------------------------------------------------*/
549/*
550 * \brief Return matrix assembler if present.
551 *
552 * \param[in] matrix pointer to matrix structure
553 */
554/*----------------------------------------------------------------------------*/
555
558
559/*----------------------------------------------------------------------------*/
567/*----------------------------------------------------------------------------*/
568
569const cs_halo_t *
570cs_matrix_get_halo(const cs_matrix_t *matrix);
571
572/*----------------------------------------------------------------------------*/
581/*----------------------------------------------------------------------------*/
582
583const cs_gnum_t *
585
586/*----------------------------------------------------------------------------*/
594/*----------------------------------------------------------------------------*/
595
598
599/*----------------------------------------------------------------------------*/
611/*----------------------------------------------------------------------------*/
612
613void
615 cs_alloc_mode_t alloc_mode);
616
617/*----------------------------------------------------------------------------*/
618/*
619 * \brief Query matrix allocation mode.
620 *
621 * \param[in] matrix pointer to matrix structure
622 *
623 * \return host/device allocation mode
624 */
625/*----------------------------------------------------------------------------*/
626
627bool
629
630/*----------------------------------------------------------------------------*/
631/*
632 *\brief Indicate whether matrix will need xa coefficients.
633 *
634 * \param[in, out] matrix pointer to matrix structure
635 * \param[in] need_xa is thr face-based xa array needed ?
636 */
637/*----------------------------------------------------------------------------*/
638
639void
641 bool need_xa);
642
643/*----------------------------------------------------------------------------
644 * Get matrix fill type, depending on block sizes.
645 *
646 * parameters:
647 * symmetric <-- indicates if matrix coefficients are symmetric
648 * diag_block_size <-- block sizes for diagonal
649 * extra_diag_block_size <-- block sizes for extra diagonal
650 *
651 * returns:
652 * matrix fill type
653 *----------------------------------------------------------------------------*/
654
656cs_matrix_get_fill_type(bool symmetric,
657 cs_lnum_t diag_block_size,
658 cs_lnum_t extra_diag_block_size);
659
660/*----------------------------------------------------------------------------
661 * Set matrix coefficients defined relative to a "native" edge graph,
662 * sharing arrays with the caller when possible.
663 *
664 * With shared arrays, the matrix becomes unusable if the arrays passed as
665 * arguments are not be modified (its coefficients should be unset first
666 * to mark this).
667 *
668 * Depending on current options and initialization, values will be copied
669 * or simply mapped.
670 *
671 * parameters:
672 * matrix <-> pointer to matrix structure
673 * symmetric <-- indicates if matrix coefficients are symmetric
674 * diag_block_size <-- block sizes for diagonal
675 * extra_diag_block_size <-- block sizes for extra diagonal
676 * n_edges <-- local number of graph edges
677 * edges <-- edges (row <-> column) connectivity
678 * da <-- diagonal values (nullptr if zero)
679 * xa <-- extradiagonal values (nullptr if zero)
680 * casts as:
681 * xa[n_edges] if symmetric,
682 * xa[n_edges][2] if non symmetric
683 *----------------------------------------------------------------------------*/
684
685void
687 bool symmetric,
688 cs_lnum_t diag_block_size,
689 cs_lnum_t extra_diag_block_size,
690 const cs_lnum_t n_edges,
691 const cs_lnum_2_t edges[],
692 const cs_real_t *da,
693 const cs_real_t *xa);
694
695/*----------------------------------------------------------------------------
696 * Transfer matrix coefficients defined relative to a "native" edge graph.
697 *
698 * parameters:
699 * matrix <-> pointer to matrix structure
700 * symmetric <-- indicates if matrix coefficients are symmetric
701 * diag_block_size <-- block sizes for diagonal
702 * extra_diag_block_size <-- block sizes for extra diagonal
703 * n_edges <-- local number of graph edges
704 * edges <-- edges (row <-> column) connectivity
705 * da <-- diagonal values (nullptr if zero)
706 * xa <-- extradiagonal values (nullptr if zero)
707 * casts as:
708 * xa[n_edges] if symmetric,
709 * xa[n_edges][2] if non symmetric
710 *----------------------------------------------------------------------------*/
711
712void
714 bool symmetric,
715 cs_lnum_t diag_block_size,
716 cs_lnum_t extra_diag_block_size,
717 const cs_lnum_t n_edges,
718 const cs_lnum_2_t edges[],
719 cs_real_t **d_val,
720 cs_real_t **x_val);
721
722/*----------------------------------------------------------------------------
723 * Set matrix coefficients in an MSR format, transferring the
724 * property of those arrays to the matrix.
725 *
726 * If the matrix is also in MSR format, this avoids an extra copy.
727 * If it is in a different format, values are copied to the structure,
728 * and the original arrays freed. In any case, the arrays pointers passed as
729 * arguments are set to nullptr, to help ensure the caller does not use the
730 * original arrays directly after this call.
731 *
732 * parameters:
733 * matrix <-> pointer to matrix structure
734 * symmetric <-- indicates if matrix coefficients are symmetric
735 * diag_block_size <-- block sizes for diagonal
736 * extra_diag_block_size <-- block sizes for extra diagonal
737 * row_index <-- MSR row index (0 to n-1)
738 * col_id <-- MSR column id (0 to n-1)
739 * d_val <-> diagonal values (nullptr if zero)
740 * x_val <-> extradiagonal values (nullptr if zero)
741 *----------------------------------------------------------------------------*/
742
743void
745 bool symmetric,
746 cs_lnum_t diag_block_size,
747 cs_lnum_t extra_diag_block_size,
748 const cs_lnum_t row_index[],
749 const cs_lnum_t col_id[],
750 cs_real_t **d_val,
751 cs_real_t **x_val);
752
753/*----------------------------------------------------------------------------*/
770/*----------------------------------------------------------------------------*/
771
772void
774 bool symmetric,
775 cs_lnum_t diag_block_size,
776 cs_lnum_t extra_diag_block_size,
777 cs_real_t **d_val,
778 cs_real_t **x_val);
779
780/*----------------------------------------------------------------------------*/
793/*----------------------------------------------------------------------------*/
794
797 cs_lnum_t diag_block_size,
798 cs_lnum_t extra_diag_block_size);
799
800/*----------------------------------------------------------------------------
801 * Release shared matrix coefficients.
802 *
803 * Pointers to mapped coefficients are set to nullptr, while
804 * coefficient copies owned by the matrix are not modified.
805 *
806 * This simply ensures the matrix does not maintain pointers
807 * to nonexistant data.
808 *
809 * parameters:
810 * matrix <-> pointer to matrix structure
811 *----------------------------------------------------------------------------*/
812
813void
815
816/*----------------------------------------------------------------------------
817 * Copy matrix diagonal values.
818 *
819 * In case of matrixes with block diagonal coefficients, only the true
820 * diagonal values are copied.
821 *
822 * parameters:
823 * matrix --> pointer to matrix structure
824 * da --> diagonal (pre-allocated, size: n_rows*block_size
825 *----------------------------------------------------------------------------*/
826
827void
829 cs_real_t *da);
830
831/*----------------------------------------------------------------------------
832 * Query matrix coefficients symmetry
833 *
834 * parameters:
835 * matrix <-- pointer to matrix structure
836 *
837 * returns:
838 * true if coefficients are symmetric, false otherwise
839 *----------------------------------------------------------------------------*/
840
841bool
843
844/*----------------------------------------------------------------------------*/
857/*----------------------------------------------------------------------------*/
858
859bool
861
862/*----------------------------------------------------------------------------
863 * Get matrix diagonal values.
864 *
865 * In case of matrixes with block diagonal coefficients, a pointer to
866 * the complete block diagonal is returned.
867 *
868 * parameters:
869 * matrix --> pointer to matrix structure
870 *
871 * returns:
872 * pointer to matrix diagonal array
873 *----------------------------------------------------------------------------*/
874
875const cs_real_t *
877
878/*----------------------------------------------------------------------------
879 * Get pointer to matrix extra-diagonal values in "native" format
880 *
881 * This function currently only functions if the matrix is in "native"
882 * format or the coefficients were mapped from native coefficients using
883 * cs_matrix_set_coefficients(), in which case the pointer returned is
884 * the same as the one passed to that function.
885 *
886 * parameters:
887 * matrix --> pointer to matrix structure
888 *
889 * returns:
890 * pointer to matrix diagonal array
891 *----------------------------------------------------------------------------*/
892
893const cs_real_t *
895
896/*----------------------------------------------------------------------------
897 * Initialize row info for a given matrix.
898 *
899 * parameters:
900 * r --> row info structure
901 *----------------------------------------------------------------------------*/
902
903void
905
906/*----------------------------------------------------------------------------
907 * Finalize row info for a given matrix.
908 *
909 * parameters:
910 * r <-> row info structure
911 *----------------------------------------------------------------------------*/
912
913void
915
916/*----------------------------------------------------------------------------
917 * Get row values for a given matrix.
918 *
919 * This function may not work for all matrix types.
920 *
921 * In the case of blocked matrixes, the true (non-blocked)
922 * values are returned.
923 *
924 * The row information structure must have been previously initialized
925 * using cs_matrix_row_init(), and should be finalized using
926 * using cs_matrix_row_finalize(), so as to free buffers it may have
927 * built for certain matrix formats.
928 *
929 * parameters:
930 * matrix <-- pointer to matrix structure
931 * row_id <-- id of row to query
932 * r <-> row info structure
933 *----------------------------------------------------------------------------*/
934
935void
936cs_matrix_get_row(const cs_matrix_t *matrix,
937 const cs_lnum_t row_id,
939
940/*----------------------------------------------------------------------------
941 * Get arrays describing a matrix in native format.
942 *
943 * This function works for matrix in native format.
944 *
945 * Matrix block sizes can be obtained by cs_matrix_get_diag_block_size()
946 * and cs_matrix_get_extra_diag_block_size().
947 *
948 * parameters:
949 * matrix <-- pointer to matrix structure
950 * symmetric --> true if symmetric
951 * n_edges --> number of associated faces
952 * edges --> edges (symmetric row <-> column) connectivity
953 * d_val --> diagonal values
954 * x_val --> extra-diagonal values
955 *----------------------------------------------------------------------------*/
956
957void
959 bool *symmetric,
960 cs_lnum_t *n_edges,
961 const cs_lnum_2_t **edges,
962 const cs_real_t **d_val,
963 const cs_real_t **x_val);
964
965/*----------------------------------------------------------------------------
966 * Get arrays describing a matrix in CSR format.
967 *
968 * This function only works for an CSR matrix (i.e. there is
969 * no automatic conversion from another matrix type).
970 *
971 * Matrix block sizes can be obtained by cs_matrix_get_diag_block_size()
972 * and cs_matrix_get_extra_diag_block_size().
973 *
974 * parameters:
975 * matrix <-- pointer to matrix structure
976 * row_index --> CSR row index
977 * col_id --> CSR column id
978 * val --> values
979 *----------------------------------------------------------------------------*/
980
981void
983 const cs_lnum_t **row_index,
984 const cs_lnum_t **col_id,
985 const cs_real_t **val);
986
987/*----------------------------------------------------------------------------
988 * Get arrays describing a matrix in MSR format.
989 *
990 * This function only works for an MSR matrix (i.e. there is
991 * no automatic conversion from another matrix type).
992 *
993 * Matrix block sizes can be obtained by cs_matrix_get_diag_block_size()
994 * and cs_matrix_get_extra_diag_block_size().
995 *
996 * parameters:
997 * matrix <-- pointer to matrix structure
998 * row_index --> MSR row index
999 * col_id --> MSR column id
1000 * d_val --> diagonal values
1001 * x_val --> extra-diagonal values
1002 *----------------------------------------------------------------------------*/
1003
1004void
1006 const cs_lnum_t **row_index,
1007 const cs_lnum_t **col_id,
1008 const cs_real_t **d_val,
1009 const cs_real_t **x_val);
1010
1011/*----------------------------------------------------------------------------*/
1012/*
1013 * \brief Release arrays describing a matrix in MSR format.
1014 *
1015 * Ownership is provided back to the caller, if pointers are provided.
1016 * If the matrix does not own a given array, a nullptr value is returned
1017 * for that array.
1018 *
1019 * This function only works for an MSR matrix (i.e. there is
1020 * no automatic conversion from another matrix type).
1021 *
1022 * \param[in, out] matrix pointer to matrix structure
1023 * \param[out] row_index MSR row index, or null
1024 * \param[out] col_id MSR column id, or null
1025 * \param[out] d_val diagonal values, or null
1026 * \param[out] x_val extra-diagonal values, or null
1027 */
1028/*----------------------------------------------------------------------------*/
1029
1030void
1032 cs_lnum_t **row_index,
1033 cs_lnum_t **col_id,
1034 cs_real_t **d_val,
1035 cs_real_t **x_val);
1036
1037/*----------------------------------------------------------------------------*/
1038/*
1039 * \brief Associate mesh information with a matrix.
1040 *
1041 * This may be useful for multigrid smoothing.
1042 *
1043 * At least cell centers and volumes are needed for relaxation, and face
1044 * adjacency and normals are needed for the "classical" option.
1045 *
1046 * Note that cells and faces here do not need to be primary mesh elements,
1047 * but could be dual mesh elements of some sort.
1048 *
1049 * The arrays passed to the matrix are shared, so should have a lifetime
1050 * at least as long as the matrix.
1051 *
1052 * \param[in, out] matrix pointer to matrix structure
1053 * \param[in] c2f_idx cell to faces index, or nullptr
1054 * \param[in] c2f cell to faces adjacency, or nullptr
1055 * \param[in] c2f_sgn cell to faces adjacency sign, or nullptr
1056 * \param[in] cell_cen cell center coordinates
1057 * \param[in] cell_vol cell volumes
1058 * \param[in] face_u_normal face unit normal, or nullptr
1059 * \param[in] face_surf face surface, or nullptr
1060 */
1061/*----------------------------------------------------------------------------*/
1062
1063void
1065 const cs_lnum_t *c2f_idx,
1066 const cs_lnum_t *c2f,
1067 const short int *c2f_sgn,
1068 const cs_real_3_t *cell_cen,
1069 const cs_real_t *cell_vol,
1070 const cs_nreal_3_t *face_u_normal,
1071 const cs_real_t *face_surf);
1072
1073/*----------------------------------------------------------------------------*/
1074/*
1075 * \brief Query mesh information that me be associated with a matrix.
1076 *
1077 * This may be useful for multigrid smoothing.
1078 *
1079 * \param[in] matrix pointer to matrix structure
1080 * \param[out] c2f_idx cell to faces index, or nullptr
1081 * \param[out] c2f cell to faces adjacency, or nullptr
1082 * \param[out] c2f_sgn cell to faces adjacency sign, or nullptr
1083 * \param[out] cell_cen cell center coordinates, or nullptr
1084 * \param[out] cell_vol cell volumes, or nullptr
1085 * \param[out] face_u_normal face unit normal, or nullptr
1086 * \param[out] face_surf face surface, or nullptr
1087 */
1088/*----------------------------------------------------------------------------*/
1089
1090void
1092 const cs_lnum_t **c2f_idx,
1093 const cs_lnum_t **c2f,
1094 const short int **c2f_sgn,
1095 const cs_real_3_t **cell_cen,
1096 const cs_real_t **cell_vol,
1097 const cs_nreal_3_t **face_normal,
1098 const cs_real_t **face_surf);
1099
1100/*----------------------------------------------------------------------------
1101 * Assign functions based on a variant to a given matrix.
1102 *
1103 * If the matrix variant is incompatible with the structure, it is ignored,
1104 * and defaults for that structure are used instead.
1105 *
1106 * parameters:
1107 * m <-> associated matrix structure
1108 * mv <-- associated matrix variant
1109 *
1110 * returns:
1111 * pointer to created matrix structure;
1112 *----------------------------------------------------------------------------*/
1113
1114void
1116 const cs_matrix_variant_t *mv);
1117
1118/*----------------------------------------------------------------------------
1119 * Matrix.vector product y = A.x
1120 *
1121 * This function includes a halo update of x prior to multiplication by A.
1122 *
1123 * parameters:
1124 * matrix --> pointer to matrix structure
1125 * x <-> multipliying vector values (ghost values updated)
1126 * y --> resulting vector
1127 *----------------------------------------------------------------------------*/
1128
1129void
1131 cs_real_t *x,
1132 cs_real_t *y);
1133
1134#if defined(HAVE_ACCEL)
1135
1136/*----------------------------------------------------------------------------*/
1147/*----------------------------------------------------------------------------*/
1148
1149void
1150cs_matrix_vector_multiply_d(const cs_matrix_t *matrix,
1151 cs_real_t *x,
1152 cs_real_t *y);
1153
1154#endif /* defined(HAVE_ACCEL) */
1155
1156/*----------------------------------------------------------------------------
1157 * Matrix.vector product y = A.x with no prior halo update of x.
1158 *
1159 * This function does not include a halo update of x prior to multiplication
1160 * by A, so it should be called only when the halo of x is known to already
1161 * be up to date (in which case we avoid the performance penalty of a
1162 * redundant update by using this variant of the matrix.vector product).
1163 *
1164 * parameters:
1165 * matrix --> pointer to matrix structure
1166 * x --> multipliying vector values
1167 * y <-- resulting vector
1168 *----------------------------------------------------------------------------*/
1169
1170void
1172 cs_real_t *x,
1173 cs_real_t *y);
1174
1175/*----------------------------------------------------------------------------
1176 * Partial matrix.vector product.
1177 *
1178 * This function includes a halo update of x prior to multiplication,
1179 * except for the CS_MATRIX_SPMV_L operation type, which does not require it,
1180 * as halo adjacencies are only present and useful in the upper-diagonal part..
1181 *
1182 * parameters:
1183 * matrix <-- pointer to matrix structure
1184 * op_type <-- SpMV operation type
1185 * x <-> multipliying vector values (ghost values updated)
1186 * y --> resulting vector
1187 *----------------------------------------------------------------------------*/
1188
1189void
1191 cs_matrix_spmv_type_t op_type,
1192 cs_real_t *x,
1193 cs_real_t *y);
1194
1195#if defined(HAVE_ACCEL)
1196
1197/*----------------------------------------------------------------------------*/
1211/*----------------------------------------------------------------------------*/
1212
1213void
1214cs_matrix_vector_multiply_partial_d(const cs_matrix_t *matrix,
1215 cs_matrix_spmv_type_t op_type,
1216 cs_real_t *x,
1217 cs_real_t *y);
1218
1219#endif /* defined(HAVE_ACCEL) */
1220
1221/*----------------------------------------------------------------------------
1222 * Synchronize ghost values prior to matrix.vector product
1223 *
1224 * parameters:
1225 * matrix <-- pointer to matrix structure
1226 * x <-> multipliying vector values (ghost values updated)
1227 *----------------------------------------------------------------------------*/
1228
1229void
1231 cs_real_t *x);
1232
1233/*----------------------------------------------------------------------------*/
1244/*----------------------------------------------------------------------------*/
1245
1246void
1248 int *n_variants,
1249 cs_matrix_variant_t **m_variant);
1250
1251/*----------------------------------------------------------------------------*/
1260/*----------------------------------------------------------------------------*/
1261
1264
1265/*----------------------------------------------------------------------------
1266 * Destroy a matrix variant structure.
1267 *
1268 * parameters:
1269 * mv <-> Pointer to matrix variant pointer
1270 *----------------------------------------------------------------------------*/
1271
1272void
1274
1275/*----------------------------------------------------------------------------*/
1282/*----------------------------------------------------------------------------*/
1283
1284void
1287
1288/*----------------------------------------------------------------------------*/
1295/*----------------------------------------------------------------------------*/
1296
1297void
1300
1301/*----------------------------------------------------------------------------
1302 * Select the sparse matrix-vector product function to be used by a
1303 * matrix variant for a given fill type.
1304 *
1305 * Currently, possible variant functions are:
1306 *
1307 * CS_MATRIX_NATIVE (all fill types)
1308 * default
1309 * baseline
1310 * omp (for OpenMP with compatible numbering)
1311 * omp_atomic (for OpenMP with atomics)
1312 * vector (For vector machine with compatible numbering)
1313 *
1314 * CS_MATRIX_CSR (for CS_MATRIX_SCALAR or CS_MATRIX_SCALAR_SYM)
1315 * default
1316 * mkl (with MKL)
1317 *
1318 * CS_MATRIX_MSR (all fill types)
1319 * default
1320 * mkl (with MKL, for CS_MATRIX_SCALAR or CS_MATRIX_SCALAR_SYM)
1321 * omp_sched (For OpenMP with scheduling)
1322 *
1323 * parameters:
1324 * mv <-> pointer to matrix variant
1325 * numbering <-- mesh numbering info, or nullptr
1326 * fill type <-- matrix fill type to merge from
1327 * spmv_type <-- SpMV operation type (full or sub-matrix)
1328 * (all types if CS_MATRIX_SPMV_N_TYPES)
1329 * func_name <-- function type name
1330 *----------------------------------------------------------------------------*/
1331
1332void
1334 cs_matrix_fill_type_t fill_type,
1335 cs_matrix_spmv_type_t spmv_type,
1336 const cs_numbering_t *numbering,
1337 const char *func_name);
1338
1339/*----------------------------------------------------------------------------*/
1347/*----------------------------------------------------------------------------*/
1348
1351
1352/*----------------------------------------------------------------------------*/
1353
1355
1356#endif /* __CS_MATRIX_H__ */
Definition: cs_dispatch.h:1711
#define BEGIN_C_DECLS
Definition: cs_defs.h:554
double cs_real_t
Floating-point value.
Definition: cs_defs.h:357
cs_nreal_t cs_nreal_3_t[3]
Definition: cs_defs.h:400
cs_lnum_t cs_lnum_2_t[2]
vector of 2 local mesh-entity ids
Definition: cs_defs.h:367
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:374
unsigned cs_gnum_t
global mesh entity number
Definition: cs_defs.h:342
#define END_C_DECLS
Definition: cs_defs.h:555
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:350
void cs_matrix_row_finalize(cs_matrix_row_info_t *r)
Finalize row info for a given matrix.
Definition: cs_matrix.cpp:5817
void cs_matrix_copy_diagonal(const cs_matrix_t *matrix, cs_real_t *da)
struct _cs_matrix_variant_t cs_matrix_variant_t
Definition: cs_matrix.h:118
void cs_matrix_vector_multiply_partial(cs_dispatch_context &ctx, const cs_matrix_t *matrix, cs_matrix_spmv_type_t op_type, cs_real_t x[], cs_real_t y[])
Partial matrix.vector product.
Definition: cs_matrix.cpp:4225
bool cs_matrix_is_symmetric(const cs_matrix_t *matrix)
Query matrix coefficients symmetry.
Definition: cs_matrix.cpp:5694
cs_matrix_t * cs_matrix_create_by_copy(cs_matrix_t *src)
Create a matrix container by copying another.
Definition: cs_matrix.cpp:4756
bool cs_matrix_get_need_xa(const cs_matrix_t *matrix)
Query matrix allocation mode.
Definition: cs_matrix.cpp:5204
void cs_matrix_set_coefficients(cs_matrix_t *matrix, bool symmetric, cs_lnum_t diag_block_size, 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.cpp:5308
const cs_real_t * cs_matrix_get_diagonal(const cs_matrix_t *matrix)
Get matrix diagonal values.
Definition: cs_matrix.cpp:5739
cs_matrix_structure_t * cs_matrix_structure_create_msr_shared(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.
Definition: cs_matrix.cpp:4511
const char * cs_matrix_spmv_type_name[]
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.cpp:4561
const char * cs_matrix_get_type_name(const cs_matrix_t *matrix)
Definition: cs_matrix.cpp:4915
cs_matrix_variant_t * cs_matrix_variant_create(cs_matrix_t *m)
Build matrix variant.
Definition: cs_matrix.cpp:6705
void cs_matrix_set_need_xa(cs_matrix_t *matrix, bool need_xa)
Indicate whether matrix will need xa coefficients.
Definition: cs_matrix.cpp:5224
struct _cs_matrix_structure_t cs_matrix_structure_t
Definition: cs_matrix.h:110
cs_lnum_t cs_matrix_get_extra_diag_block_size(const cs_matrix_t *matrix)
Return the size of the extra-diagonal block for the given matrix.
Definition: cs_matrix.cpp:5063
cs_matrix_spmv_type_t
Definition: cs_matrix.h:99
@ CS_MATRIX_SPMV_N_TYPES
Definition: cs_matrix.h:104
@ CS_MATRIX_SPMV
Definition: cs_matrix.h:101
@ CS_MATRIX_SPMV_E
Definition: cs_matrix.h:102
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.cpp:7164
void cs_matrix_variant_apply_tuned(cs_matrix_t *m, cs_matrix_variant_t *mv)
Apply variants defined by tuning to a given matrix.
Definition: cs_matrix.cpp:7052
struct _cs_matrix_t cs_matrix_t
Definition: cs_matrix.h:114
cs_lnum_t cs_matrix_get_n_entries(const cs_matrix_t *matrix)
Return the number of entries in matrix.
Definition: cs_matrix.cpp:4991
void cs_matrix_vector_multiply_nosync(const cs_matrix_t *matrix, cs_real_t *x, cs_real_t *y)
const cs_matrix_assembler_t * cs_matrix_get_assembler(const cs_matrix_t *matrix)
Return matrix assembler if present.
Definition: cs_matrix.cpp:5080
void cs_matrix_vector_multiply(cs_dispatch_context &ctx, const cs_matrix_t *matrix, cs_real_t x[], cs_real_t y[])
Matrix.vector product y = A.x.
Definition: cs_matrix.cpp:4147
void cs_matrix_transfer_coefficients(cs_matrix_t *matrix, bool symmetric, cs_lnum_t diag_block_size, cs_lnum_t extra_diag_block_size, const cs_lnum_t n_edges, const cs_lnum_2_t edges[], cs_real_t **d_val, cs_real_t **x_val)
Definition: cs_matrix.cpp:5378
void cs_matrix_destroy(cs_matrix_t **matrix)
Definition: cs_matrix.cpp:4866
void cs_matrix_variant_apply(cs_matrix_t *m, cs_matrix_variant_t *mv)
Apply a variant to a given matrix.
Definition: cs_matrix.cpp:7015
const cs_gnum_t * cs_matrix_get_l_range(const cs_matrix_t *matrix)
Return a pointer to local global row range associated with a matrix, if available.
Definition: cs_matrix.cpp:5119
cs_matrix_fill_type_t cs_matrix_get_fill_type(bool symmetric, cs_lnum_t diag_block_size, cs_lnum_t extra_diag_block_size)
Get matrix fill type, depending on block sizes.
Definition: cs_matrix.cpp:5247
cs_matrix_t * cs_matrix_create(const cs_matrix_structure_t *ms)
Create a matrix container using a given structure.
Definition: cs_matrix.cpp:4675
void cs_matrix_variant_set_func(cs_matrix_variant_t *mv, cs_matrix_fill_type_t fill_type, cs_matrix_spmv_type_t spmv_type, const cs_numbering_t *numbering, 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.cpp:7118
void cs_matrix_transfer_coefficients_msr(cs_matrix_t *matrix, bool symmetric, cs_lnum_t diag_block_size, 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, transferring the property of those arrays to the matrix.
Definition: cs_matrix.cpp:5444
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.cpp:4709
const char * cs_matrix_get_type_fullname(const cs_matrix_t *matrix)
Definition: cs_matrix.cpp:4931
void cs_matrix_release_msr_arrays(cs_matrix_t *matrix, cs_lnum_t **row_index, cs_lnum_t **col_id, cs_real_t **d_val, cs_real_t **x_val)
Release arrays describing a matrix in MSR format.
Definition: cs_matrix.cpp:6248
void cs_matrix_apply_variant(cs_matrix_t *m, const cs_matrix_variant_t *mv)
void cs_matrix_set_alloc_mode(cs_matrix_t *matrix, cs_alloc_mode_t alloc_mode)
Set matrix allocation mode.
Definition: cs_matrix.cpp:5162
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.cpp:6148
cs_alloc_mode_t cs_matrix_get_alloc_mode(const cs_matrix_t *matrix)
Query matrix allocation mode.
Definition: cs_matrix.cpp:5142
cs_matrix_t * cs_matrix_create_by_local_restrict(const cs_matrix_t *src)
Create a matrix based on the local restriction of a base matrix.
Definition: cs_matrix.cpp:4794
void cs_matrix_get_mesh_association(const cs_matrix_t *matrix, const cs_lnum_t **c2f_idx, const cs_lnum_t **c2f, const short int **c2f_sgn, const cs_real_3_t **cell_cen, const cs_real_t **cell_vol, const cs_nreal_3_t **face_normal, const cs_real_t **face_surf)
Query mesh information that me be associated with a matrix.
Definition: cs_matrix.cpp:6358
void cs_matrix_row_init(cs_matrix_row_info_t *r)
Initialize row info for a given matrix.
Definition: cs_matrix.cpp:5798
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.cpp:6192
cs_matrix_fill_type_t
Definition: cs_matrix.h:76
@ CS_MATRIX_BLOCK_D_66
Definition: cs_matrix.h:82
@ CS_MATRIX_N_FILL_TYPES
Definition: cs_matrix.h:89
@ CS_MATRIX_SCALAR
Definition: cs_matrix.h:78
@ CS_MATRIX_BLOCK_D
Definition: cs_matrix.h:80
@ CS_MATRIX_BLOCK
Definition: cs_matrix.h:88
@ CS_MATRIX_SCALAR_SYM
Definition: cs_matrix.h:79
@ CS_MATRIX_BLOCK_D_SYM
Definition: cs_matrix.h:86
const char * cs_matrix_fill_type_name[]
const cs_halo_t * cs_matrix_get_halo(const cs_matrix_t *matrix)
Return the pointer to the halo structure for the given matrix.
Definition: cs_matrix.cpp:5099
void cs_matrix_set_mesh_association(cs_matrix_t *matrix, const cs_lnum_t *c2f_idx, const cs_lnum_t *c2f, const short int *c2f_sgn, const cs_real_3_t *cell_cen, const cs_real_t *cell_vol, const cs_nreal_3_t *face_u_normal, const cs_real_t *face_surf)
Associate mesh information with a matrix.
Definition: cs_matrix.cpp:6321
cs_lnum_t cs_matrix_get_diag_block_size(const cs_matrix_t *matrix)
Return the size of the diagonal block for the given matrix.
Definition: cs_matrix.cpp:5044
void cs_matrix_variant_destroy(cs_matrix_variant_t **mv)
Destroy a matrix variant structure.
Definition: cs_matrix.cpp:6999
void cs_matrix_pre_vector_multiply_sync(const cs_matrix_t *matrix, cs_real_t *x)
cs_matrix_assembler_values_t * cs_matrix_assembler_values_init(cs_matrix_t *matrix, cs_lnum_t diag_block_size, cs_lnum_t extra_diag_block_size)
Create and initialize a CSR matrix assembler values structure.
Definition: cs_matrix.cpp:5628
cs_matrix_type_t
Definition: cs_matrix.h:58
@ CS_MATRIX_CSR
Definition: cs_matrix.h:61
@ CS_MATRIX_MSR
Definition: cs_matrix.h:62
@ CS_MATRIX_N_TYPES
Definition: cs_matrix.h:70
@ CS_MATRIX_NATIVE
Definition: cs_matrix.h:60
@ CS_MATRIX_DIST
Definition: cs_matrix.h:64
@ CS_MATRIX_N_BUILTIN_TYPES
Definition: cs_matrix.h:68
void cs_matrix_variant_build_list(const cs_matrix_t *m, int *n_variants, cs_matrix_variant_t **m_variant)
Build list of variants for tuning or testing.
Definition: cs_matrix.cpp:6749
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.cpp:5715
void cs_matrix_release_coefficients(cs_matrix_t *matrix)
Release shared matrix coefficients.
Definition: cs_matrix.cpp:5584
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.cpp:5848
cs_matrix_type_t cs_matrix_get_type(const cs_matrix_t *matrix)
Return matrix type.
Definition: cs_matrix.cpp:4900
cs_lnum_t cs_matrix_get_n_rows(const cs_matrix_t *matrix)
Return the number of rows in matrix.
Definition: cs_matrix.cpp:4969
void cs_matrix_structure_release_msr_arrays(cs_matrix_structure_t *ms, cs_lnum_t **row_index, cs_lnum_t **col_id)
Release arrays describing an MSR matrix structure.
Definition: cs_matrix.cpp:4634
cs_matrix_structure_t * cs_matrix_structure_create_msr(cs_matrix_type_t type, bool transfer, bool have_diag, bool ordered, 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.cpp:4420
void cs_matrix_structure_destroy(cs_matrix_structure_t **ms)
Destroy a matrix structure.
Definition: cs_matrix.cpp:4602
cs_lnum_t cs_matrix_get_n_columns(const cs_matrix_t *matrix)
Return number of columns in a matrix.
Definition: cs_matrix.cpp:4950
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.cpp:6094
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.cpp:5774
cs_matrix_structure_t * cs_matrix_structure_create(cs_matrix_type_t type, 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)
void cs_matrix_get_coefficients_msr_w(cs_matrix_t *matrix, bool symmetric, cs_lnum_t diag_block_size, cs_lnum_t extra_diag_block_size, cs_real_t **d_val, cs_real_t **x_val)
Directly access matrix coefficients in an MSR format for writing.
Definition: cs_matrix.cpp:5519
struct _cs_matrix_assembler_t cs_matrix_assembler_t
Definition: cs_matrix_assembler.h:61
struct _cs_matrix_assembler_values_t cs_matrix_assembler_values_t
Definition: cs_matrix_assembler.h:65
cs_alloc_mode_t
Definition: cs_mem.h:50
Definition: cs_halo.h:78
Definition: cs_matrix.h:122
cs_lnum_t buffer_size
Definition: cs_matrix.h:125
cs_real_t * _vals
Definition: cs_matrix.h:129
const cs_lnum_t * col_id
Definition: cs_matrix.h:126
cs_lnum_t * _col_id
Definition: cs_matrix.h:127
cs_lnum_t row_size
Definition: cs_matrix.h:124
const cs_real_t * vals
Definition: cs_matrix.h:128
Definition: cs_numbering.h:87