Problem of equation solving after MatLoad

Hi, everyone

I have recently been learning parallel programming with PETSc and encountered an issue regarding MatLoad. I want to use MatLoad to load a previously saved matrix and then solve a system of linear equations, but the results are not as expected.
The script file has been uploaded Matload_test.edp (1.7 KB) , the output in terminal reads as follows,

rhsLoadPETSc: 36
          1     0.02    0.02    0.02    0.02
        0.006666666667  0.04    0.04    0.04    0.04
        0.02    0.04    0.04    0.02    0.02
          1       1     0.04    0.04      1
        0.04    0.04    0.04    0.04      1
        0.04    0.04    0.04    0.04    0.02
          1     0.02    0.02    0.02    0.02
        0.01333333333
 solLoad: 36
          0       0       0       0       0
          0       0       0       0       0
          0       0       0       0       0
          0       0       0       0       0
          0       0       0       0       0
          0       0       0       0       0
          0       0       0       0       0
          0
 rhs[]: 27
          1     0.02    0.02    0.02    0.02
        0.006666666667    1     0.04    0.04    0.04
        0.04    0.02      1     0.04    0.04
        0.04    0.04    0.02    0.01333333333   0.02666666667
        0.04    0.04    0.02    0.01333333333   0.02666666667
        0.02    0.006666666667
 sol[]: 27
        1.000000028     1.17974331      1.319379114     1.418734878     1.477407774
        1.494145153     1.000000028     1.179797049     1.319518824     1.419076003
        1.478375806     1.497549157     1.000000028     1.179924846     1.319824538
        1.419675883     1.479470061     1.499298595     1.180076533     1.320177181
        1.420328661     1.480533087     1.500705098     1.420926489     1.481626849
        1.502453926     1.505857998

I wonder why all values printed from solLoad are zeros. Have I misunderstood something?

Best regrads

I’m investigating the issue, in the meantime, please switch to KSPSolve(MatLoadA, rhsLoadPETSc, solLoad); (instead of solLoad = MatLoadA^-1 * rhsLoadPETSc;).

This is fixed in Fix missing member initialization for single-process Mat · FreeFem/FreeFem-sources@1155541 · GitHub. Thank you for your report.

Thank you, Professor. It works well.