What are the best way to get error estimates from a PDE solver?


I am solving eigenfunctions on a simple domain and I want to get some nice error and convergence data from it. What are the best ways to do this? Are there any quick commands in FreeFEM to get it done automatically?

Thank you for your help.

If you are solving the eigenproblem with PETSc, you can get nice error and residual estimates with -eps_error_backward ::ascii_info_detail -eps_error_relative ::ascii_info_detail -eps_error_absolute ::ascii_info_detail.

1 Like

How would I actually implement this in code? Do you have a link to the documentation?

also, I am using SlepC

relErrorApprox[i] = abs(absErrorBnd[i])/abs(int2d(Th)(partX^2 + partY^2));

solverError[i] = EPSComputeError(OP, B,i,EPS_ERROR_RELATIVE,&error);

xBot[i] = int1d(Th,a4)(xpartY^2)/ev[i] + int1d(Th,a5)(xpartY^2)/ev[i];

It continually tells me that EPSComputeError does not exits. DO you have any idea what the issue could be?

There is not interface to EPSComputeError in the SLEPc plugin. You can use the options I gave in the earlier post in the sparams argument of your EPSSolve. If you want to store the errors in a file instead of being printed to screen, you should be able to do -eps_error_relative your_filename::ascii_info_detail.

Does this look right?

int k = EPSSolve(OP, B, values=ev, vectors=eV,sparams = “-st_type sinvert -eps_nev " + nev + " -eps_target " + sigma + " -eps_gen_hermitian” + “-eps_error_relative reportedRelativeError::ascii_info_detail” + “-eps_error_absolute reportedAbsoluteError::ascii_info_detail” + “-eps_error_backward reportedBackwardError::ascii_info_detail”);


No, sorry, it’s ascii:your_filename:ascii_info_detail each time.

So do I leave it as

  • “-eps_error_absolute:reportedAbsoluteError”

in the sparams or do I have to put in more information?

Use what I said initially but put ascii: before your_filename.

So this is correct? Or should there be only one colon in the second division?

It should be correct, just launch, see if it produces what you need, otherwise use the -help command. There are obviously a lot of spaces missing around your " + "…

When I include this in the sparams, my solver gives different (and incorrect) solutions. Do you have any idea why?