[petsc-users] PCComposite

Hui Zhang mike.hui.zhang at hotmail.com
Mon May 28 08:40:58 CDT 2012


On May 28, 2012, at 3:20 PM, Jed Brown wrote:

> On Mon, May 28, 2012 at 5:19 AM, Hui Zhang <mike.hui.zhang at hotmail.com> wrote:
> Sorry for repost the following question, but after reading composite.c and asm.c,
> I can not understand.  I observed that my subroutine for modifying submatrices of PCASM was
> called twice.  In composite.c it seems there is no calling of PCSetUp on its componential PC's.
> In asm.c, the PCSetUp_ASM first determines whether pc->setupcalled is true.
> 
> I think this is a general question for PCComposite say pc. If it consists of two pc's  pc0, pc1
> and I have PCSetUp(pc0), I would not expect pc0 to be SetUp again.  I can not understand
> in my case why PCASM seems SetUp twice.
> 
> 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.

Thanks. But I said something wrong.  The source code asm.c does call the ModifySubMatrices
whenever PCSetUp is called on PCASM, no matter whether it was called before.  So this 
explains my observation (two calls of ModifySubMatrices).  My new question is:  can you
add a user control to determine whether MatGetSubMatrices and PCModifySubMatrices 
should be called inside PCSetUp_ASM ?  But maybe this is too invasive and not
very useful to most people (although useful to me).


> 
>  
> 
> Thanks!
> Hui
> 
> 
> > I have got a new question.  I'm now constructing a PCComposite from PCASM and another PCKSP (coarse
> > problem). And construction of PCKSP needs to use the subksp's of PCASM. So I need to PCSetUp on the
> > PCASM, right?  But the KSP using PCComposite would setup PCASM again.  How can I avoid twice setup
> > of PCASM ?
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120528/3fed6c2b/attachment.html>


More information about the petsc-users mailing list