[PETSC #15433] RE: General matrix interative solver

Satish Balay petsc-maint at mcs.anl.gov
Fri Oct 13 11:16:29 CDT 2006


On Fri, 13 Oct 2006, Julian wrote:

> > 
> > > I am now using MatCreateSeqSBAIJ() - I am assuming the second 
> > > parameter bs=1 in my case because I am using one processor. Is that 
> > > correct ?
> > 
> > No - it refers to a blocksize. The matrix could have a block 
> > structure.  In this case - the correct blocksize can be 
> > specified. The matrix operations will exploit this block 
> > structure for better performance.
> > 
> > bs=1 is a fine [This is the equivalent of AIJ type in the 
> > block notation]
> 
> I don't fully understand the thing about the block structure.. Can you point
> me to some documentation that explains this ?


Block matrices will occur in multicomponent problems [where each node
of a grid has multiple unknowns - like pressure,density,velocity
etc..]

For eg: - if you have the following 6x6 matrix:

1 1 0 0 0 0
1 1 0 0 0 0
0 0 0 0 2 2
0 0 0 0 2 2
3 3 4 4 0 0
3 3 4 4 0 0

It has a block structure of 2. In the block notation could be:

a 0 0
0 0 b
c d 0

where a,b,c,d are 2x2 blocks

a = 1 1
    1 1
b = 2 2
    2 2
c = 3 3
    3 3
d = 4 4
    4 4

So the regular sparse notation would be (i,j,val): [Which can be used
with MatSetValues()]

(0,0,1) (0,1,1) (1,0,1) (1,1,1) (2,4,2) (2,5,2) ......

The block noatation would be (block-i,block-j,block-val) [Which can be
used with MatSetValuesBlocked()]

(0,0,1 1 1 1) (1,2,2 2 2 2) (2,0,3,3,3) (2,1,4 4 4 4)

I'm cc:ing petsc-users - as others also may find this info useful.

Hope this helps,
Satish




More information about the petsc-users mailing list