[petsc-users] Mat-Mat element wise multiplication

Barry Smith bsmith at petsc.dev
Sun Apr 25 12:30:03 CDT 2021


> On Apr 25, 2021, at 12:09 PM, Rui Silva <ruiefdasilva at gmail.com> wrote:
> I am writing to you, to ask if there is any simple way to perform element-wise multiplication of 2 mpiaij matrices in Petsc?

 You can imitate MatAXPY_SeqAIJ() on each of the two parts of the MPIAIJ matrix. 

> Furthermore is there any way to reassemble a matrix that has some zeros stored, to reduce the sparsity of the matrix?

> Thanks a lot in advance,
> R
> -- 
> Dr. Rui Emanuel Ferreira da Silva
> Departamento de Física Teórica de la Materia Condensada
> Universidad Autónoma de Madrid, Spain
> Max Born Institute, Berlin, Germany
> https://ruiefdasilva.wixsite.com/ruiefdasilva
> https://mmuscles.eu/
> https://www.mbi-berlin.de/index_en.html

More information about the petsc-users mailing list