<div dir="ltr">On Tue, May 7, 2013 at 4:49 AM, Frederik Treue <span dir="ltr"><<a href="mailto:frtr@fysik.dtu.dk" target="_blank">frtr@fysik.dtu.dk</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi,<br>
<br>
is there any way of checking which type of PC you are using in the code?<br>
Ie. I want to do something like:<br></blockquote><div><br></div><div><a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscObjectTypeCompare.html">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscObjectTypeCompare.html</a><br>
</div><div><br></div><div style>   Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
...<br>
PCType mytype;<br>
PC pc;<br>
if (PhaseOfTheMoon==waxing) {<br>
        mytype=PCJacobi;<br>
} else {<br>
        mytype=PCMG;<br>
}<br>
...<br>
ierr=PCSetType(pc,mytype);CHKERRQ(ierr);<br>
if (mytype==PCMG) {<br>
  ierr=PCMGSetLevels(pc,levels,PETSC_NULL);CHKERRQ(ierr);<br>
  ...<br>
}<br>
...<br>
<br>
But since mytype is apparently a pointer type, this doesn't work.<br>
<span class=""><font color="#888888"><br>
/Frederik Treue<br>
<br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <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
</div></div>