Calculus of variations problems are generally cast in in the following simple form: find $u(t)$ that satisfies some boundary conditions and minimises
$$ F[u] = \int_{t=0}^{t=t_f} f(u(t),u'(t),t) dt. $$
I have run into a far more general problem. I have a functional $F[u]$ that is substantially more complicated. Given $u$ (or in this case the set of functions $u^i(\mathbf{x})$ where $\mathbf{x}\in\mathbb{R}^n$) I solve a pde which depends on these functions, and the solution is analysed to give the value of the functional $F$. Given a set of functions $u^i(\mathbf{x})$, I can numerically evaluate $F[u^i]$ very efficiently. However, I want to explore the function space to find the set of $u^i$ that maximises $F$. To complicate matters, I have further constraints on the $u^i$ I can choose: for instance, I require a particular path integral of $u^i$ to equal a certain value.
All the methods I have found in the calculus of variations seem to assume, in one way or another, that the functional $F$ is of the simple form outlined above. Do more general numerical methods exist? I'm looking for a method or algorithm that requires nothing more than the ability to numerically evaluate the functional for any given function, and from that will search the function space and converge on an optimal solution. The ability to place (ideally arbitrary) constrains on $u^i$ would be an added bonus.
Perhaps I ask for too much. I'd appreciate any help or advice.
Thanks