[petsc-users] MatElemDiv

John-Michael Fischer fischej at umich.edu
Mon Feb 15 09:44:16 CST 2010


On the documentation page for MatGetArray() it says the result is, understandably, dependent on matrix structure. 
My question is if I'm using an MPI Mat then will MatGetArray get the local array on each proc, or will it assemble the whole array?

Thank you,
John-Michael Fischer

On Feb 11, 2010, at 2:36 PM, Barry Smith wrote:

> 
>  If you "know" that the two matrices have the same nonzero pattern you can do this efficiently with a call to MatGetArray() on each matrix.
> 
>   Barry
> 
> On Feb 11, 2010, at 10:06 AM, Matthew Knepley wrote:
> 
>> On Thu, Feb 11, 2010 at 10:01 AM, John-Michael Fischer <fischej at umich.edu> wrote:
>> This seems like a silly question, but is there a reason I cannot find a function for MatrixElementWiseDivide that would accept two matricies, M1 and M2 and perform element wise division?
>> 
>> I can go through the process of getting local rows on each proc, doing the element by element division, etc... but it just seems like a perfect candidate for a built-in.
>> 
>> We do not have any Mat element-wise functions, since with sparse matrices this might
>> be ill-defined with different non-zero patterns, as well as slow since the result might have
>> a third nonzero pattern.
>> 
>>   Matt
>> 
>> Thanks
>> John-Michael Fischer
>> University of Michigan
>> Nuclear Engineering and Radiological Sciences
>> 
>> 
>> 
>> -- 
>> 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
> 
> 
> 



More information about the petsc-users mailing list