Hi Francis, 
   If you can predict the situations under which you get divide by zero, then you can use the ?: operator in an Expression string or Condition in ufl.
All the best
Cjc

On Friday, 17 June 2016, Francis Poulin <fpoulin@uwaterloo.ca> wrote:
Hello,

I want to define an initial condition for a field that I am pretty sure will have nan's.  It does in python so I'm pretty sure that it will in firedrake as well.

In python I know how to remove that nan's by doing the following.

qb[np.isnan(qb)] = 0.

Is there a way of doing this in firedrake?

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



--
http://www.imperial.ac.uk/people/colin.cotter

www.cambridge.org/9781107663916