On Tue, Aug 2, 2011 at 12:53 PM, Clemens Domanig <span dir="ltr">&lt;<a href="mailto:clemens.domanig@uibk.ac.at">clemens.domanig@uibk.ac.at</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Maybe I should describe the hole problem.<br>
I&#39;m using MUMPS to make LDLt decomposition - all from command line.<br>
But sometimes I need the diagonal entries (respectively the number of negative entries) of the D matrix. But there is no way to get this information back from MUMPS via petsc ( as far as I found out). </blockquote><div><br>
</div><div>Yes, we have no access to MUMPS internal data.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">There was the suggestion to use MatGetIntertia but this is only for off-diagonal-information. </blockquote>
<div><br></div><div>I am not sure what you mean by that.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
So I used<br>
PCSetType( prec, PCCHOLESKY);<br>
PCFactorGetMatrix( prec, &amp;M);<br>
MatGetDiagonal( M, z);<br>
It only works without MUMPS and gives me the diagonal entries I want in Matrix M - although the entries are 1/x.<br>
Vector z is full of zeros - only the last entry is the &#39;same&#39; as in M (x instead of 1/x).<br>
<br>
So the idea was to somehow turn off MUMPS if I need the diagonal entries and then turn it on again.<br></blockquote><div><br></div><div>Here is the easiest way to do it. Keep two complete solvers</div><div><br></div><div>
  a) KSP with MUMPS</div><div><br></div><div>  b) KSP with Cholesky, give this one KSPSetOptionsPrefix(ksp, &quot;diag_&quot;);</div><div><br></div><div>That way -diag_pc_type cholesky will work. Then use the solver you want.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
The problem with PCFactorGetMatSolverPackage is I didn&#39;t manage to use it.<br>
<br>
const MatSolverPackage pack;<br>
PCFactorGetMatSolverPackage( prec, &amp;pack);<br>
PetscSynchronizedPrintf( PETSC_COMM_WORLD, &quot;%s\n&quot;, pack);<br>
I expected &#39;mumps&#39; as output but got &#39;H??????tdH3%0&#39;<br></blockquote><div><br></div><div>It would seem its not yet setup.</div><div><br></div><div>   Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Thx<br>
<br>
<br>
<br>
Matthew Knepley wrote:<div><div></div><div class="h5"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Tue, Aug 2, 2011 at 9:28 AM, Clemens Domanig &lt;<a href="mailto:clemens.domanig@uibk.ac.at" target="_blank">clemens.domanig@uibk.ac.at</a> &lt;mailto:<a href="mailto:clemens.domanig@uibk.ac.at" target="_blank">clemens.domanig@uibk.<u></u>ac.at</a>&gt;&gt; wrote:<br>

<br>
    Hi,<br>
<br>
    usually I&#39;m using MUMPS by puting &#39;-pc_factor_mat_solver_package<br>
    mumps&#39; into the .petscrc.<br>
    Now I want to change in runtime between MUMPS and non-MUMPS so I<br>
    tried to turn it on with<br>
    PCFactorSetMatSolverPackage( pre, MAT_SOLVER_MUMPS);<br>
    but I doesn&#39;t have any effect.<br>
<br>
<br>
This is complicated because you have to set this at the right time during the solver setup process.<br>
Command line arguments are much easier. However, you should call this after the preconditioner<br>
type is set, but before it is setup.<br>
 <br>
    I also have a problem with PCFactorGetMatSolverPackage(). How can I<br>
    get back an output as described in the documentation that has the<br>
    type &#39;const&#39;?<br>
<br>
<br>
What is the problem? I do not understand?<br>
<br>
    Matt<br>
 <br>
    Thx - Clemens<br>
<br>
<br>
<br>
<br>
-- <br>
What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener<br>
</blockquote>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener<br>