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

Umut Tabak u.tabak at tudelft.nl
Sun Sep 8 10:01:05 CDT 2013

On 09/08/2013 04:19 PM, Jed Brown wrote:
> Umut Tabak <u.tabak at tudelft.nl> writes:
Dear Jed and others,

Thanks a lot for your help.

One last question, trying to run with

./ex3 -pc_type fieldsplit -pc_fieldsplit_type schur 
-pc_fieldsplit_schur_factorization_type diag -fieldsplit_1_pc_type icc 
-fieldsplit_1_ksp_type minres -fieldsplit_2_pc_type icc 
-fieldsplit_2_ksp_type minres -ksp_converged_reason -ksp_monitor_short

With this input, I would expect to see a flow of residual information 
even if increasing, but no information is being printed on the screen, 
what could be the reason for this?

>> 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);

More information about the petsc-users mailing list