Is there a way to relate the variational problem where one specifies $x$ initially and finally to the initial value (Cauchy) problem where one specifies both $x$ and $p$ initially? As an example, consider an incompressible fluid filling some domain $\Omega\subset\mathbb{R}^n$. Define the action as $$ \mathcal{S}[\varphi]= \frac{1}{2}\int_0^t \| \partial_s \varphi\|^2_{L^2(\Omega)} d s $$ for $\varphi$ a volume preserving diffeomorphism. Then the following is true:

$\textbf{Proposition:}$ The variation of the action $\delta \mathcal{S}[\varphi]=0$ for all variations $\delta \varphi$ (vanishing at the $0$ and $t$) if and only if there exists a scalar function $p$ such that the velocity field $\bf{u}$ construced by $\bf{u}=\partial_s\varphi \circ \varphi^{-1}$ solves the equations $$ \partial_t {\bf{u}} +{\bf{u}}\cdot \nabla {\bf{u}}=-\nabla p, \ \ \nabla\cdot {\bf{u}}=0. $$ My issue is that typically one would like to specify (i.w. an inital velocity ${\bf{u}}_0({\bf{x}})={\bf{u}}({\bf{x}},0)$ and I don't see how to incorporate this into a variational approach but I would hope that it is possible.