how to visit the variable "bs" in pmat of preconditioner

Yujie recrusader at gmail.com
Wed Jan 2 13:55:39 CST 2008


Dear Matthew:

Now, in my code, first, I initialize PetSC using PetscInitialize() function.
And then, I set the block size of Mat using MatSetBlockSize(). Finally, I
solve the equation. Regarding your reply. you mean that PetSC is not
reponsible to let all the nodes
know the block size of Mat. Ineed to set this size at each nodes?  In
addition, where will PC and its relevant parameters exist? Because I meet
the following  error when I set the size after I initiliaze the PetSC.
[1]PETSC ERROR: MatSetBlockSize() line 5204 in src/mat/interface/matrix.c
[5]PETSC ERROR: [13]PETSC ERROR: --------------------- Error Message
------------------------------------
[13]PETSC ERROR: Null argument, when expecting valid pointer!
[13]PETSC ERROR: Null Object: Parameter # 1!
[14]PETSC ERROR: --------------------- Error Message
------------------------------------
[14]PETSC ERROR: Null argument, when expecting valid pointer!
[14]PETSC ERROR: Null Object: Parameter # 1!
[14]PETSC ERROR:
------------------------------------------------------------------------
[14]PETSC ERROR: Petsc Release Version 2.3.3, Patch 8, Fri Nov 16 17:03:40
CST 2007 HG revision: 414581156e67e55c761739b0deb119f7590d0f4b
[14]PETSC ERROR: See docs/changes/index.html for recent updates.
[14]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
[14]PETSC ERROR: See docs/index.html for manual pages.

thanks a lot.

Regards,
Yujie

On 1/2/08, Matthew Knepley < knepley at gmail.com> wrote:
>
> On Jan 2, 2008 1:27 PM, Yujie <recrusader at gmail.com> wrote:
> > Dear Barry:
> >
> > Thank you for your reply. Further problem is whether I only set the
> block
> > size of Mat using MatSetBlockSize() in Processor 0 when I run my code on
> > Cluster? thank a lot.
>
> All processors must set the correct block size.
>
>   Matt
>
> > Happy new year:).
> >
> > Regards,
> > Yujie
> >
> > On 12/21/07, Barry Smith <bsmith at mcs.anl.gov> wrote:
> > >
> > >     pmat is the matrix you set with KSPSetOperators() so you just need
>
> > > to set block size of that matrix.
> > >
> > > On Dec 21, 2007, at 1:16 AM, Yujie wrote:
> > >
> > > > hi, everyone
> > > >
> > > > now, I want to use Hypre package via PETSc in third package. I need
> > > > to visit the variable "bs" in Mat struct. In hypre.c, this variable
> > > > may let BoomerAMG know the block size of Mat. The code is as
> follows:
> > > >
> > > > 127: /* special case for BoomerAMG */
> > > > 128: if (jac->setup == HYPRE_BoomerAMGSetup) {
> > > > 129: MatGetBlockSize(pc->pmat,&bs);
> > > > 130: if (bs > 1) {
> > > > 131: HYPRE_BoomerAMGSetNumFunctions(jac->hsolver,bs);
> > > > 132: }
> > > > 133: };
> > > >
> > > > However, I can't visit this variable. Now, I have get the pointer of
>
> > > > PC I use. I can't visit the variable pmat in my code. I can't find
> > > > any function to realize this function from PETSc manual.
> > > > Could you give me some advice about how to do?
> > > >
> > > > Merry X'mas!
> > > >
> > > > Regards,
> > > > Yujie
> > > >
> > >
> > >
> >
> >
>
>
>
> --
> What most experimenters take for granted before they begin their
> experiments is infinitely more interesting than any results to which
> their experiments lead.
> -- Norbert Wiener
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20080102/5ae4e8d9/attachment.htm>


More information about the petsc-users mailing list