Question about PETSc

Hi, is it possible to use PETSc while using the ‘problem’ keyword? Or is it necessary to use the ‘varf’ keyword when using PETSc?


It is necessary to use the varf keyword.

1 Like

Awesome. One further question: is it possible to use varf to solve a system of transient non-linear homogeneous PDEs in multiple unknowns (with the Newton method employed to deal with the non-linearity)? I assume that this is possible, but I’d just like to check before I try anything. I’ve managed to solve my system using the ‘problem’ keyword, but I really would like to try using the ‘varf’ keyword so that I can use a more efficient solver, such as PETSc. I’ve started getting the occasional memory error with my current code, which I’ve been told could be the result of using the standard UMFPACK solver.

Yes, of course. You can even use SNESSolve, so that you don’t have to reimplement the wheel and code the Newton method yourself.

I’ve not heard of SNESSolve, where can I read about it? Also, by wheel do you mean the iteration loop? Many thanks.

Most of these examples use SNESSolve Also, of course, the PETSc manual is important SNESSolve — PETSc 3.19.4 documentation.

1 Like

Oh I see, what you mean now. I’ll investigate this material, many thanks!

Apologies, but is there a way to view the original form of the PDE problem for each of the examples in the first link you provided? I could probably work backwards from the freefem code to determine the original form of the problem, but it would be awkward. Being able to see the original PDE problem corresponding to each freeFEM script would be very useful.

For some of these, they are in FreeFem-tutorial.