Grid adaptation for functional outputs: Application to two-dimensional inviscid flows