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

Umut Tabak u.tabak at tudelft.nl
Sun Sep 8 01:54:55 CDT 2013


On 09/08/2013 08:43 AM, Jed Brown wrote:
> Umut Tabak <u.tabak at tudelft.nl> writes:
>
> Your splits were both the same,
Some questions:

+ Splits represent different row and column blocks, right?
+ And as far as I understand from you(maybe this is in the manual, I am 
not sure) and they should differ in size, right?

Thanks for the help.
Umut

>   so the preconditioner was applied twice
> to the first block and zero to the second block.  That made the
> preconditioner singular.
>
>    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);



More information about the petsc-users mailing list