6 Nov
2015
6 Nov
'15
1:01 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. Cheers Stephan