smdogroup / tacs

Finite-element library for analysis and adjoint-based gradient evaluation
Apache License 2.0
108 stars 75 forks source link

Mphys tweaks #282

Closed A-CGray closed 11 months ago

A-CGray commented 11 months ago

Adds two things to the TACS MPhys wrapper:

  1. A res_ref input argument to the TACSBuilder to specify a reference residual value that will be used by OpenMDAO to scale the residual
  2. Adds write_solution method to the mphys wrapper to allow users to write out solutions. This is useful when you want to be able to write out solution files but not necessarily after every solve. Can be called through either the postcoupling group or the functions group:
scenario.struct_post.writeSolution()

Warning: as explained in https://github.com/OpenMDAO/OpenMDAO/issues/3072 OpenMDAO doesn't currently apply the residual scaling correctly to matrix-free partial derivatives, so any check_partials currently fails if you do any residual scaling. The total derivatives are fine though.