[petsc-users] J^T J p calculation
Isaac, Tobin G
tisaac at cc.gatech.edu
Thu Apr 9 15:45:58 CDT 2020
I don't understand, why don't you just take the dot product of w with itself?
Toby Isaac, Assistant Professor, GTCSE
________________________________
From: petsc-users <petsc-users-bounces at mcs.anl.gov> on behalf of Park, Heeho via petsc-users <petsc-users at mcs.anl.gov>
Sent: Thursday, April 9, 2020 3:39:19 PM
To: petsc-users at mcs.anl.gov <petsc-users at mcs.anl.gov>
Subject: [petsc-users] J^T J p calculation
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/f184a9e9/attachment.html>
More information about the petsc-users
mailing list