[petsc-users] Elementwise pow/exponential-function on PETSc-vectors and matrices
Pierre Seize
pierre.seize at onera.fr
Tue Jan 5 09:30:04 CST 2021
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
>
More information about the petsc-users
mailing list