mdolab / pygeo

pyGeo provides geometric design variables and constraints suitable for gradient-based optimization.
https://mdolab-pygeo.readthedocs-hosted.com/en/latest/?badge=latest
Apache License 2.0
124 stars 55 forks source link

MPhys wrapper: Move dvcon to a matrix-based API for partials #123

Open anilyil opened 2 years ago

anilyil commented 2 years ago

Description of feature

With DVConstraints, and possibly with DVGeometry wrapper as well, we compute and store a full Jacobian internally using complex step or parallel finite differences. However, we have been using the matrix-free Jacobian vector product API in OpenMDAO instead of the matrix-based API.

Our approach is not well suited with the mat-free API; we end up either needing to do full jacobian computations each time mat-free API is called, or we need to keep track of design changes and update the Jacobians once and re-use them for subsequent mat-free API calls.

Matrix-based API is the way to go here: OpenMDAO would automatically update the matrix-based Jacobians when the design is changed. The only work we need to do here is to expose our Jacobians to OpenMDAO in the correct format for each DV and output/constraint.

Moved from the MPhys repo: https://github.com/OpenMDAO/mphys/issues/69