Dear Matthew:<br><br>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.
<br>[1]PETSC ERROR: MatSetBlockSize() line 5204 in src/mat/interface/matrix.c<br>[5]PETSC ERROR: [13]PETSC ERROR: --------------------- Error Message ------------------------------------<br>[13]PETSC ERROR: Null argument, when expecting valid pointer!
<br>[13]PETSC ERROR: Null Object: Parameter # 1!<br>[14]PETSC ERROR: --------------------- Error Message ------------------------------------<br>[14]PETSC ERROR: Null argument, when expecting valid pointer!<br>[14]PETSC ERROR: Null Object: Parameter # 1!
<br>[14]PETSC ERROR: ------------------------------------------------------------------------<br>[14]PETSC ERROR: Petsc Release Version 2.3.3, Patch 8, Fri Nov 16 17:03:40 CST 2007 HG revision: 414581156e67e55c761739b0deb119f7590d0f4b
<br>[14]PETSC ERROR: See docs/changes/index.html for recent updates.<br>[14]PETSC ERROR: See docs/faq.html for hints about trouble shooting.<br>[14]PETSC ERROR: See docs/index.html for manual pages.<br><br>thanks a lot.
<br><br>Regards,<br>Yujie<br><br><div><span class="gmail_quote">On 1/2/08, <b class="gmail_sendername">Matthew Knepley</b> <<a href="mailto:knepley@gmail.com" target="_blank">
knepley@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Jan 2, 2008 1:27 PM, Yujie <<a href="mailto:recrusader@gmail.com" target="_blank">recrusader@gmail.com</a>> wrote:<br>> Dear Barry:<br>><br>> Thank you for your reply. Further problem is whether I only set the block
<br> > size of Mat using MatSetBlockSize() in Processor 0 when I run my code on<br>> Cluster? thank a lot.<br><br>All processors must set the correct block size.<br><br> Matt<br><br>> Happy new year:).<br>><br>
> Regards, <br>> Yujie<br>><br>> On 12/21/07, Barry Smith <<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>> wrote:<br>> >
<br>> > pmat is the matrix you set with KSPSetOperators() so you just need <br>> > to set block size of that matrix.<br>> ><br>> > On Dec 21, 2007, at 1:16 AM, Yujie wrote:<br>> ><br>> > > hi, everyone
<br>> > ><br>> > > now, I want to use Hypre package via PETSc in third package. I need <br>> > > to visit the variable "bs" in Mat struct. In hypre.c, this variable<br>> > > may let BoomerAMG know the block size of Mat. The code is as follows:
<br>> > ><br>> > > 127: /* special case for BoomerAMG */ <br>> > > 128: if (jac->setup == HYPRE_BoomerAMGSetup) {<br>> > > 129: MatGetBlockSize(pc->pmat,&bs);<br>> > > 130: if (bs > 1) {
<br>> > > 131: HYPRE_BoomerAMGSetNumFunctions(jac->hsolver,bs); <br>> > > 132: }<br>> > > 133: };<br>> > ><br>> > > However, I can't visit this variable. Now, I have get the pointer of
<br>> > > PC I use. I can't visit the variable pmat in my code. I can't find <br>> > > any function to realize this function from PETSc manual.<br>> > > Could you give me some advice about how to do?
<br>> > ><br>> > > Merry X'mas!<br>> > ><br>> > > Regards, <br>> > > Yujie<br>> > ><br>> ><br>> ><br>><br>><br><br><br><br>--<br>What most experimenters take for granted before they begin their
<br>experiments is infinitely more interesting than any results to which <br>their experiments lead.<br>-- Norbert Wiener<br><br></blockquote></div><br>