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

Matthew Knepley knepley at gmail.com
Sun Sep 8 08:00:38 CDT 2013


On Sun, Sep 8, 2013 at 4:23 AM, Umut Tabak <u.tabak at tudelft.nl> wrote:

>
>  Your splits were both the same, so the preconditioner was applied twice
>> to the first block and zero to the second block.  That made the
>> preconditioner singular.
>>
>
> Dear Jed,
>
> Thanks a lot for your time and help, attached you can find a very
> challenging ill-conditioned problem:
>
> The first block comes from a structural problem and its size is 1490. The
> second block results from a fluid discretization and its size is 2432. So
> in total the coupled system is of size 3922. I created the blocks as given
> in the simple problem. However, with
>
> ./ex3 -pc_type fieldsplit -pc_fieldsplit_type schur -fieldsplit_1_pc_type
> icc -fieldsplit_1_ksp_type cg -fieldsplit_1_pc_type icc
> -fieldsplit_1_ksp_type minres -pc_fieldsplit_schur_**factorization_type
> upper -ksp_monitor_true_residual
>
> The solver just hangs.
>

If you want to solve hard systems, you must learn to debug a solver
yourself. What does "just hangs" mean? Start with a full
Schur complement factorization with LU on block 1 and a tiny tolerance on
block 2. This will converge in 1 iterate. Then
start slowly making the preconditioner weaker.

   Matt


> The system is a symmetric system in this case given as
>
> A =
> A11 C
> C^T A22
>
> C is of size 1490X2432
>
> Could you please comment on this point for me, do I still have an error on
> the problem setup or on the usage of the options?
>
> BR,
> Umut
>
>
>>    ISCreateBlock(PETSC_COMM_SELF,**bs,n1,inputindices,PETSC_COPY_**
>> VALUES,&is_row1);
>>    ISCreateBlock(PETSC_COMM_SELF,**bs,n2,inputindices,PETSC_COPY_**
>> VALUES,&is_row2);
>>
>> We could check for this case, but it would require a little code and
>> isn't currently done.  This is probably what you wanted:
>>
>> diff --git i/ex2.c w/ex2.c
>> index 94cea2c..0cce3e6 100644
>> --- i/ex2.c
>> +++ w/ex2.c
>> @@ -45,7 +45,7 @@ int main(int argc,char **args)
>>     PetscInt bs = 2, n1=1, n2=1, inputindices[]={0,1}; /* block size is 2
>> */
>>           ISCreateBlock(PETSC_COMM_SELF,**bs,n1,inputindices,PETSC_COPY_*
>> *VALUES,&is_row1);
>> -  ISCreateBlock(PETSC_COMM_SELF,**bs,n2,inputindices,PETSC_COPY_**
>> VALUES,&is_row2);
>> +  ISCreateBlock(PETSC_COMM_SELF,**bs,n2,inputindices+n1,PETSC_**
>> COPY_VALUES,&is_row2);
>>       ISView(is_row1,PETSC_VIEWER_**STDOUT_SELF);
>>     ISView(is_row2,PETSC_VIEWER_**STDOUT_SELF);
>>
>
>


-- 
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/20130908/b379ef69/attachment.html>


More information about the petsc-users mailing list