> > It'd have to be TSAddObjective if you're building a list. Convention is > that Set replaces what might have been there before. > > Fair enough
> In case of multiple objectives, there may be a performance reason to > amortize evaluation of several at once, though the list interface is > convenient. Consider common objectives being quantities like lift and > drag on different surfaces of a fluids simulation or stress/strain at > certain critical joints in a structure. Although these have some > locality, it's reasonable to assume that state dependence will have > quickly become global, thus make no attempt to handle sparse > representations of the adjoint vectors lambda. > > I don't get this comment. Is it related with multi-objective optimization (e.g. Pareto)? > > How are parameters accessed in TSComputeRHSFunction? It looks like > they're coming out of the context. Why should this be different? (If > parameters need to go into a Vec, we could do that, but it comes at a > readability and possibly parallel cost if the global Vec needs to be > communicated to local vectors.) > > design paramaters are fixed troughout an adjoint/tlm run. They can be communicated locally once at the beginning of the run. This is what TSSetUpFromDesign and TSSetSetUpFromDesign are supposed to handle, if I get your comment. https://bitbucket.org/petsc/petsc/src/c2e9112e7fdfd89985f9ffc4d68b0d46cf7cad52/src/ts/interface/tspdeconstrainedutils.c?at=stefano_zampini%2Ffeature-continuousadjoint&fileviewer=file-view-default#tspdeconstrainedutils.c-579 Here is how ex23.c uses it https://bitbucket.org/petsc/petsc/src/c2e9112e7fdfd89985f9ffc4d68b0d46cf7cad52/src/ts/examples/tutorials/ex23.c?at=stefano_zampini%2Ffeature-continuousadjoint&fileviewer=file-view-default#ex23.c-677 > > Both methods need the Jacobian of the DAE wrt the parameters: H > > TSAdjointSetRHSJacobian(), S TSSetGradientDAE() > > > > Initial condition dependence on the parameters is implicitly computed in > > Hong's code (limited to linear dependence on all the variables); > > How so? Once the user gets \lambda(time=0), they can apply the chain > rule to produce any dependency on the parameter vector? > > Yes, the chain rule is implemented here https://bitbucket.org/petsc/petsc/src/c2e9112e7fdfd89985f9ffc4d68b0d46cf7cad52/src/ts/interface/tspdeconstrainedutils.c?at=stefano_zampini%2Ffeature-continuousadjoint&fileviewer=file-view-default#tspdeconstrainedutils.c-254 -- Stefano
