[petsc-users] J^T J p calculation

Park, Heeho heepark at sandia.gov
Thu Apr 9 14:39:19 CDT 2020


Hi PETSc developers,


I am trying to formulate


p^T J^T J p


where p is a solution vector length n, J is Jacobian n-by-n matrix.


Ref: https://en.wikipedia.org/wiki/Gauss%E2%80%93Newton_algorithm under Large-scale optimization


It is known that for parallel computations, the best way to perform this computation (with csr matrix) is


J^T J p = SUM_i [ c_i ( c_i dot p) ] which results in a vector.


In PFLOTRAN, we use mpibaij matrix. I could not find a PETSc command to perform this with one command.

Is there one I couldn't find? if not, is using MATGETROW with C for-loop a good way to do this?

?

I currently use, MatMult(J,p,w); MatMultTranspose(J,w,w2); VecDotRealPart(p,w2);


Best,


Heeho Daniel Park

! ------------------------------------ !
Sandia National Laboratories
Org: 08844, R&D
Work: 505-844-1319
! ------------------------------------ !
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200409/4278bd6c/attachment.html>


More information about the petsc-users mailing list