6 Nov
2015
6 Nov
'15
2:23 p.m.
On 06/11/15 12:40, Buesing, Henrik wrote:
Are you sure the problem isn't that he needs bounds for his solve? AFAICS dS/dh=0 for h<hw or h>hn. Otherwise shouldn't rewriting this with conditionals have worked?
@Stephan: So how can I rewrite the attached saturation.py with conditionals?
Sw=conditional(hin>hn, Constant(0.0), conditional(hin<hw, Constant(1.0), (hin-hn)/(hw-hn)))
This gives you a UFL expression that you can use in a larger system, or project to some function space.
@Stephan: Thank you! Is there also a way to write the attached enthn.py in UFL notation? Basically I failed to do the int(dm), if dm is a UFL expression. And probably the array access might be a problem? Thank you! Henrik