Simulation of shape optimisation of components under mechanical stress