Add a function like under `CTDirect` to build an `OptimalControlSolution` from the solution of the flow.