[petsc-users] [PATCH 2/2] Call KSPSetFromOptions before setting fieldsplit-specific options

Jed Brown jedbrown at mcs.anl.gov
Sun Sep 8 09:19:07 CDT 2013


Umut Tabak <u.tabak at tudelft.nl> writes:

> On 09/08/2013 03:57 PM, Jed Brown wrote:
>>
>> In the second call, ISCreateBlock looks at the array of block indices of
>> length n2 starting from inputindices+n1.  That references
>> inputindices[n1], which is off the end of the array you created above.
>> Simply extending that array won't work either because you can't describe
>> the starting point correctly for one "block" of different length.  I.e.,
>> if inputindices[1] == 1, then the second call above would be creating
>> the index set
>>
>>    {sz2, sz2+1,..., 2*sz2-1}
>>
>> This should be obvious if you look at ISView().
> Yes, but then there is a problem with my understanding of the block 
> structure.
>
> What I would like to do at the end is to create a first block of size 
> 1490 and then create a block of size 2432 and stack these. This is how 
> the original system is built up.

Then use the code I sent.

> Of what if I use the below code,
>
> PetscInt sz1 = 1490, sz2 = 2432;
>
>    /* ----- */
>
>    PetscInt n1=1, n2=1,
>        inputindices1[]={0}, inputindices2[]={1}; /* block size is 2 */
>
>    ISCreateBlock(PETSC_COMM_SELF,sz1,n1,inputindices1,
>                  PETSC_COPY_VALUES,&is_row1);
>    ISCreateBlock(PETSC_COMM_SELF,sz2,n2,inputindices2,
>                  PETSC_COPY_VALUES,&is_row2);
>
> Because if I look at
>
> http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/IS/ISCreateBlock.html
>
> I am getting the impression that bs and n are the same and on top idx is 
> the global block number of the large matrix blocks.

What gives you this impression?

ISCreateBlock is meant to describe index sets like the following (bs=2):

  {0,1,8,9,10,11,16,17,20,21}

via

  ISCreateBlock(comm,2,5,[0,4,5,8,10],&is);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130908/9a872811/attachment.pgp>


More information about the petsc-users mailing list