6. Building the PETSc matrix#
6.1. Data model PETSc#
PETSc proposes a Mat data type. This type of data assumes, in parallel, that the matrix is distributed over the available processors by group of contiguous rows.
It is therefore necessary to redistribute the Code_Aster matrix. A new global numbering is being built for PETSc. In this numbering, a degree of freedom that belongs only to one processor is assigned to this processor and a degree of freedom shared by several processors belongs to the lower-ranking processor.
Note:
PETSc stores the entire array (no symmetric storage).
PETSc uses the C convention for indexing arrays (0 to N-1 for an array of size N).
6.2. Matrix descriptor for B modeling#
The correspondence between the local numbering of the matrix and its global numbering for PETSc is given by table NUML. NLGP. The following table shows the three numbers for modeling B: \({i}_{l}\) is the local index, \({i}_{g}\) is the global index for Code_Aster numbering and \({i}_{\mathit{gp}}\) is the global index for PETSc.
