Hi,
I need to update my expression at each time step.
The expression is similar to this one:
class MyExpression(Expression):
def __init__(self, t=0):
self._t = t
def eval(self, value, x):
tmax = 100.
tt = self._t - x[0]
value[0] = tt * (conditional(lt(tt,0),0,1)) * (conditional(gt(tt,tmax),0,1))
And since it is not a JIT-compiled expression, my simulations are supeeer slow. I tried to rewrite it using a cppcode but I did not succeed.
Please help =)
Thank you!
upd:
Ok, I rewrote it using cppcode. It does not help. It is still slow =((