← Back to team overview

dolfin team mailing list archive

Re: Introduce a global Time class

 

On 15 February 2013 13:06, Johan Hake <hake.dev@xxxxxxxxx> wrote:

> However, I just realized that we need to store a shared_ptr in the sub
> classed expression for the update to propagate. Then we need to grep and
> replace in the generated code such that the first eval become one of the
> following:
>
>     values[0] = sin(*t);
>     values[0] = sin(((float)*t));
>
> The second is more explicit and should be more robust in a more complex
> expression.
>
> If you have a suggestion on how to regexp->replace all t variables in an
> expression with something I sketched above I am all ears.


There is already regexp code in place for finding all variables, right? So
that shouldn't be hard.


> Anyway, I think I like it. I want to introduce full ufl-to-Expression
> > compilation officially at some point as well (already available in
> uflacs).
> > Then it could just be
> >   time = Constant(0.0)
> >   time_dep_expression = Expression(sin(time))
> > and there would be no way to access 'time' through time_dep_expression.
>
> Nice! I have heard uflacs will eventually replace all of FEniCS :)
>

Exactly.

Martin

Follow ups

References