distribution of matrix and vector

Hong Zhang hzhang at mcs.anl.gov
Mon Feb 16 09:16:17 CST 2009



On Sun, 15 Feb 2009, Yixun Liu wrote:

> Barry Smith wrote:
>>
>> Yes. When you do not provide the local sizes then
>> PetscSplitOwnership() is used to chose a value, thus it matches for
>> different vectors and matrices.
>>
>> Barry
>>
>> On Feb 15, 2009, at 5:07 PM, Yixun Liu wrote:
>>
>>> Hi,
>>> VecSetSizes(vec, PETSC_DECIDE, n);
>>> MatSetSizes(mat, PETSC_DECIDE, PETSC_DECIDE, n,n);
>>>
>>> If the matrix is square can I conclude that the vec and mat have the
>>> same distribution.
>>>
>>> Thanks
>>> Yixun
>>>
>>
> If the matrix is not square, the distribution should be different. Right?

It might be different. The better way is to specify
local size for vectors and matrices, and set
PETSC_DECIDE for global sizes.

Hong

>


More information about the petsc-users mailing list