PaStiX Handbook  6.4.0
symbol_base.c
Go to the documentation of this file.
1 /**
2  *
3  * @file symbol_base.c
4  *
5  * PaStiX symbol structure base function
6  *
7  * @copyright 1999-2024 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
8  * Univ. Bordeaux. All rights reserved.
9  *
10  * @version 6.4.0
11  * @author Francois Pellegrini
12  * @author Mathieu Faverge
13  * @date 2024-07-05
14  *
15  **/
16 #include "common.h"
17 #include "symbol/symbol.h"
18 
19 /**
20  *******************************************************************************
21  *
22  * @ingroup pastix_symbol
23  *
24  * @brief Sets the base of the given symbol matrix structure to the given
25  * base value.
26  *
27  *******************************************************************************
28  *
29  * @param[inout] symbptr
30  * The symbol structure to initialize.
31  *
32  * @param[in] baseval
33  * The base value.
34  *
35  *******************************************************************************/
36 void
38  const pastix_int_t baseval )
39 {
40  symbol_cblk_t *cblk;
41  symbol_blok_t *blok;
42  pastix_int_t baseadj; /* Base adjust */
43  pastix_int_t cblknum;
44  pastix_int_t bloknum;
45 
46  baseadj = baseval - symbptr->baseval; /* Set base adjust */
47  if (baseadj == 0) /* If base already set */
48  return;
49 
50  symbptr->baseval = baseval; /* Set graph base */
51 
52  symbptr->schurfcol += baseadj;
53 
54  cblk = symbptr->cblktab;
55  for (cblknum = 0; cblknum <= symbptr->cblknbr; cblknum ++, cblk++) {
56  cblk->fcolnum += baseadj;
57  cblk->lcolnum += baseadj;
58  cblk->bloknum += baseadj;
59  }
60 
61  blok = symbptr->bloktab;
62  for (bloknum = 0; bloknum < symbptr->bloknbr; bloknum ++) {
63  blok->frownum += baseadj;
64  blok->lrownum += baseadj;
65  blok->lcblknm += baseadj;
66  blok->fcblknm += baseadj;
67  }
68 
69  if ( symbptr->dof < 1 ) {
70  pastix_int_t i;
71  pastix_int_t *dofs = symbptr->dofs;
72 
73  assert( dofs != NULL );
74 
75  for (i = 0; i <= symbptr->nodenbr; i ++, dofs++) {
76  *dofs += baseadj;
77  }
78  }
79 }
BEGIN_C_DECLS typedef int pastix_int_t
Definition: datatypes.h:51
pastix_int_t fcblknm
Definition: symbol.h:63
pastix_int_t frownum
Definition: symbol.h:60
pastix_int_t lrownum
Definition: symbol.h:61
pastix_int_t bloknbr
Definition: symbol.h:80
pastix_int_t baseval
Definition: symbol.h:78
symbol_cblk_t * cblktab
Definition: symbol.h:83
pastix_int_t schurfcol
Definition: symbol.h:82
pastix_int_t bloknum
Definition: symbol.h:48
pastix_int_t fcolnum
Definition: symbol.h:46
pastix_int_t lcolnum
Definition: symbol.h:47
pastix_int_t dof
Definition: symbol.h:87
symbol_blok_t * bloktab
Definition: symbol.h:84
pastix_int_t lcblknm
Definition: symbol.h:62
pastix_int_t * dofs
Definition: symbol.h:89
pastix_int_t nodenbr
Definition: symbol.h:81
pastix_int_t cblknbr
Definition: symbol.h:79
void pastixSymbolBase(symbol_matrix_t *symbptr, const pastix_int_t baseval)
Sets the base of the given symbol matrix structure to the given base value.
Definition: symbol_base.c:37
Symbol block structure.
Definition: symbol.h:59
Symbol column block structure.
Definition: symbol.h:45
Symbol matrix structure.
Definition: symbol.h:77