dolfin-adjoint / pyadjoint

The algorithmic differentation tool pyadjoint and add-ons.
GNU Lesser General Public License v3.0
91 stars 37 forks source link

Bound constraint possibly incorrect for higher order discretization #145

Open APaganini opened 6 months ago

APaganini commented 6 months ago

The code here: https://github.com/dolfin-adjoint/pyadjoint/blob/908b6364e402a6776f2a378297beecaf2bebfb87/pyadjoint/optimization/optimization.py#L25

creates bound constraints on the coefficients of the control, but these do not correspond to bound constraints on the control itself if this is discretized with, e.g., quadratic finite elements. Setting mesh-independent control-constraints in such instances may be challenging. I suggest printing a warning error if the control is not a piecewise continuous or piecewise linear function.