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