<div class="gmail_quote">On Mon, May 28, 2012 at 8:40 AM, Hui Zhang <span dir="ltr"><<a href="mailto:mike.hui.zhang@hotmail.com" target="_blank">mike.hui.zhang@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><br><div><div class="im"><div>On May 28, 2012, at 3:20 PM, Jed Brown wrote:</div><br><blockquote type="cite"><div class="gmail_quote">On Mon, May 28, 2012 at 5:19 AM, Hui Zhang <span dir="ltr"><<a href="mailto:mike.hui.zhang@hotmail.com" target="_blank">mike.hui.zhang@hotmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Sorry for repost the following question, but after reading composite.c and asm.c,<br>
I can not understand. I observed that my subroutine for modifying submatrices of PCASM was<br>
called twice. In composite.c it seems there is no calling of PCSetUp on its componential PC's.<br>
In asm.c, the PCSetUp_ASM first determines whether pc->setupcalled is true.<br>
<br>
I think this is a general question for PCComposite say pc. If it consists of two pc's pc0, pc1<br>
and I have PCSetUp(pc0), I would not expect pc0 to be SetUp again. I can not understand<br>
in my case why PCASM seems SetUp twice.<br></blockquote><div><br></div><div>Does the routine do anything or just return immediately? If nothing has been changed since the last time a PC was set up, it should return immediately. If you have changed some configuration, it may need to be set up again.</div>
</div></blockquote><div><br></div></div><div>Thanks. But I said something wrong. The source code asm.c does call the ModifySubMatrices</div><div>whenever PCSetUp is called on PCASM, no matter whether it was called before. So this </div>
<div>explains my observation (two calls of ModifySubMatrices). My new question is: can you</div><div>add a user control to determine whether <span style="font-family:Menlo;font-size:11px">MatGetSubMatrices and </span><span style="font-family:Menlo;font-size:11px">PCModifySubMatrices </span></div>
<div><font face="Menlo"><span style="font-size:11px">should be called inside PCSetUp_ASM ? But maybe this is too invasive and not</span></font></div><div><font face="Menlo"><span style="font-size:11px">very useful to most people (although useful to me).</span></font></div>
</div></div></blockquote><div><br></div><div>It does not reach PCSetUp_ASM unless something has changed. Run with -info and/or in a debugger to see why.</div><div><br></div><div><div>PetscErrorCode PCSetUp(PC pc)</div><div>
{</div><div> PetscErrorCode ierr;</div><div> const char *def;</div><div><br></div><div> PetscFunctionBegin;</div><div> PetscValidHeaderSpecific(pc,PC_CLASSID,1);</div><div> if (!pc->mat) SETERRQ(((PetscObject)pc)->comm,PETSC_ERR_ARG_WRONGSTATE,"Matrix must be set first");</div>
<div><br></div><div> if (pc->setupcalled > 1) {</div><div> ierr = PetscInfo(pc,"Setting PC with identical preconditioner\n");CHKERRQ(ierr);</div><div> PetscFunctionReturn(0);</div></div><div><br></div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div class="im"><div><br></div><br><blockquote type="cite"><div class="gmail_quote">
<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thanks!<br>
Hui<br>
<br>
<br>
> I have got a new question. I'm now constructing a PCComposite from PCASM and another PCKSP (coarse<br>
> problem). And construction of PCKSP needs to use the subksp's of PCASM. So I need to PCSetUp on the<br>
> PCASM, right? But the KSP using PCComposite would setup PCASM again. How can I avoid twice setup<br>
> of PCASM ?<br>
<br>
</blockquote></div><br>
</blockquote></div></div><br></div></blockquote></div><br>