<div class="gmail_quote">On Sun, May 6, 2012 at 11:38 AM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div id=":46v">PetscErrorCode PCSetUp(PC pc)<br>
{<br>
PetscErrorCode ierr;<br>
const char *def;<br>
<br>
PetscFunctionBegin;<br>
PetscValidHeaderSpecific(pc,PC_CLASSID,1);<br>
if (!pc->mat) SETERRQ(((PetscObject)pc)->comm,PETSC_ERR_ARG_WRONGSTATE,"Matrix must be set first");<br>
<br>
How can it be in there without a Mat? The Mat must be set before PCSetUp().</div></blockquote></div><br><div><div>PetscErrorCode PCSetFromOptions(PC pc)</div><div>{</div><div> PetscErrorCode ierr;</div><div> char type[256];</div>
<div> const char *def;</div><div> PetscBool flg;</div><div><br></div><div> PetscFunctionBegin;</div><div> PetscValidHeaderSpecific(pc,PC_CLASSID,1);</div><div><br></div><div> if (!PCRegisterAllCalled) {ierr = PCRegisterAll(PETSC_NULL);CHKERRQ(ierr);}</div>
<div> ierr = PetscObjectOptionsBegin((PetscObject)pc);CHKERRQ(ierr);</div><div> if (!((PetscObject)pc)->type_name) {</div><div> ierr = PCGetDefaultType_Private(pc,&def);CHKERRQ(ierr);</div></div><div><br></div>
<div><br></div><div><br></div><div><br></div><div><div>PetscErrorCode PCGetDefaultType_Private(PC pc,const char* type[])</div><div>{</div><div> PetscErrorCode ierr;</div><div> PetscMPIInt size;</div><div> PetscBool flg1,flg2,set,flg3;</div>
<div><br></div><div> PetscFunctionBegin;</div><div> ierr = MPI_Comm_size(((PetscObject)pc)->comm,&size);CHKERRQ(ierr);</div><div> if (pc->pmat) {</div><div> PetscErrorCode (*f)(Mat,MatReuse,Mat*);</div><div>
ierr = PetscObjectQueryFunction((PetscObject)pc->pmat,"MatGetDiagonalBlock_C",(void (**)(void))&f);CHKERRQ(ierr);</div></div><div><br></div>