[petsc-users] J^T J p calculation

Jed Brown jed at jedbrown.org
Thu Apr 9 16:20:24 CDT 2020


"Park, Heeho via petsc-users" <petsc-users at mcs.anl.gov> writes:

> 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.

Sounds like you just want to apply J^T J to a vector, not compute it as
a matrix (e.g., for preconditioning).  You can solve such systems with
KSPLSQR, but the preconditioner is normally constructed using J^T J (or
an approximation thereof).

If you wast want to apply the operator to a matrix, use J^T (J p), which
is much more efficient ("it is known" notwithstanding).


More information about the petsc-users mailing list