[petsc-users] MatElemDiv

Barry Smith bsmith at mcs.anl.gov
Thu Feb 11 13:36:27 CST 2010

   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.


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