<div class="gmail_quote">On Thu, Oct 20, 2011 at 10:29, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Thu, Oct 20, 2011 at 3:15 PM, Klaij, Christiaan <span dir="ltr"><<a href="mailto:C.Klaij@marin.nl" target="_blank">C.Klaij@marin.nl</a>></span> wrote:<br></div><div class="gmail_quote"><div class="im">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks for all the answers!<br>
<br>
First, I would like to see something printed to stdout, right now I don't.<br>
Assuming my KSPMonitorSet call is correct, could it be that I don't<br>
see anything because I'm using FGMRES? Should I get a warning<br>
when using this monitor with any other KSP beside CG and GMRES?<br></blockquote><div><br></div></div><div>If you just want to see the monitor, why not use the command line or PetscOptionsSetValue()?</div></div></blockquote>
<div><br></div><div><br></div><div>This is the code for setting up the monitor, you can call the part inside the if statement yourself if you like.</div><div><br></div><div><div> ierr = PetscOptionsString("-ksp_monitor_singular_value","Monitor singular values","KSPMonitorSet","stdout",monfilename,PETSC_MAX_PATH_LEN,&flg);CHKERRQ(ierr);</div>
<div> if (flg) {</div><div> ierr = KSPSetComputeSingularValues(ksp,PETSC_TRUE);CHKERRQ(ierr);</div><div> ierr = PetscViewerASCIIOpen(((PetscObject)ksp)->comm,monfilename,&monviewer);CHKERRQ(ierr);</div>
<div> ierr = KSPMonitorSet(ksp,KSPMonitorSingularValue,monviewer,(PetscErrorCode (*)(void**))PetscViewerDestroy);CHKERRQ(ierr);</div><div> }</div></div><div><br></div></div>