[petsc-users] About the "PetscOptionsSetValue" usage

Filippo Spiga filippo.spiga at disco.unimib.it
Fri Dec 10 12:22:33 CST 2010


(sorry in advance for the cross-posting)

Dear all,
    I recently decided to use in my program the
routine "PetscOptionsSetValue" to allow to change at runtime the parameter
of KSP/SNES. Of course, my code performs several operations on different KSP
and SNES objects. Every object should have its own set of options (different
tollerancies, different preconditioner) and I want to tune it at runtime. So
"PetscOptionsSetValue" it is great. But I have a question: when I set an
option, this option is still valid for all the program.

Let's assume this situation (it is an example, I use fake options):

PetscOptionsSetValue("A", "1");
PetscOptionsSetValue("B", "2");
PetscOptionsSetValue("C", "3");

ierr = KSPSolve();

PetscOptionsSetValue("A", "10");
PetscOptionsSetValue("B", "20");

ierr = SNESSolve();


This is what happens (if I correcly understood):
- KSP runs with this presets {A=1, B=2, C=3} that are different than
the defaults.
- SNES runs with this presets {A=10, B=20, C=3}.
So SNES runs with C=3 that is different from the default. But I would like
to use the default because C=3 produces wrong errors. How I can easily reset
the options' database?

Thanks in advance,
Cheers

--
Filippo SPIGA, MSc Computer Science

«Nobody will drive us out of Cantor's paradise.»
    -- David Hilbert

*****
Disclaimer: "Please note this message and any attachment are CONFIDENTIAL an
may be privileged or otherwise protected from disclosure. The contents are
not to be disclosed to anyone other than the addressee. Unauthorized
recipients are requested to preserve this confidentiality and to advise the
sender immediately of any error in transmission."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20101210/655678e9/attachment.htm>


More information about the petsc-users mailing list