Hi,

For Vec there is https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecSqrtAbs.html and https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecPointwiseMult.html, I think it's what you're looking for. I don't know if there is the same for Mat.

Pierre

On 05/01/21 16:24, Roland Richter wrote:
Hei,

is there a function to square/cube etc. each element of a matrix or
vector in PETSc? It is rather useful for things like intensity
calculations (I = |E|^2), and should work also for distributed matrices.

Thanks!

Regards,

Roland Richter


Reply via email to