I am leanring to develop a code using FreeFEM with PETSc. I just met a problem that is to create a ‘Mat’ type matrix with all components being zero. My solution is
int N = 200;
real[int, int] A(N, N);
A = 0.; matrix empA = A;
Mat empAm = empA;
However, this solution is not efficient since A is not sparse despite empA is sparse.
I checked the FreeFEM-PETSc tutorial (here) but didn’t find an efficient solution. Does FreeFEM provide a function resembling ‘MatZeroEntries’ in PETSc?
Can this function extend to a matrix with different rows and columns?
A little personal suggestion: I suggest the developers put the link of the FreeFEM-PETSc tutorial on the documentation page (here) since this is a really good material to learn FreeFEM with PETSc.
I really appreciate any help you can provide.