Good question.
I agree it's probably better to avoid evaluating a function that divides by zero.
In the expression I have a conditional expression that uses less than or equal to something. It occurs to me that if I use only less than (but not equal to) that should do the trick.
I would guess that I should change le to lt but not sure. Do you think this is what I should try?
Cheers,
Francis
------------------
Francis Poulin
Associate Professor
Department of Applied Mathematics
University of Waterloo
email: fpoulin@uwaterloo.ca
Web: https://uwaterloo.ca/poulin-research-group/
Telephone: +1 519 888 4567 x32637
From: firedrake-bounces@imperial.ac.uk [firedrake-bounces@imperial.ac.uk] on behalf of Andrew McRae [A.T.T.McRae@bath.ac.uk]
Sent: Sunday, March 05, 2017 11:15 AM
To: firedrake@imperial.ac.uk
Subject: Re: [firedrake] Nans and infs
Pardon the obvious question, but is there a reason you don't simply rewrite the expression to avoid generating NaN/Inf in the first place?
Replacing Inf with 0 also seems like a strange thing to do!
Andrew