add bindTime to split off an argument of a callable and keep it's state via setTime
As discussed we want to support time dependent functions. In particular for boundary conditions we might want to pass in an analytic time dependent lambda function. For efficiency reasons PDELab doesn't pass the time as an additional parameter, but keeps it as state of the function, but a lambda is stateless.
I suggest the following interface
auto lambda = [](Domain & x, double t) { ... };
auto f = Dune::PDELab::bindTime(lambda,_2);
f.setTime(t);
bindTime
is a free function, similar to std::bind
, but it doesn't bin a fixed value to the _2
nd parameter, but it binds a variable, which can be set via .setTime(t)
. It then returns a callable, which wraps the initial callable.