“…As mentioned above, we need to compute the shape derivative of the cost function, dj dω (Ω), and the shape derivative of the constraint, dc dω (Ω). This is done using the optimal shape design method, see [15,6,11]; definitions of [7,12] are used. Three approaches are possible: i) we differentiate the equations then we discretize them, thus obtaining the discretized continuous gradient; ii) we discretize the equations then we differentiate them, thus obtaining the discrete gradient; iii) we differentiate directly the direct code (typically, using automatic differentiation).…”