Controlling the precision
Hi all,
I am having a problem that I think is related to precision but I can't resolve it by changing the form_compiler-
I am setting a variable u that is always 0<= u <=1 . I define another variable p(u) which is also 0<= p <=1 for the same range of u values.
I test the values of u and p by projecting a function including the ln of the values. u passes but p fails *unless, you insert an abs in the test of p (as below. Remove it to see the NaN error I get).
It looks to me like a problem with precision / truncation error but I'm not sure how to fix it. Does anyone have any advice please?
Thanks,
Mike
~~~~~~~~~~~~~~~
from dolfin import *
parameters[
parameters[
mesh = UnitSquare(50,2)
V = FunctionSpace(mesh, "Lagrange", 1) # Order 1 function space
u = Function(V)
uIC = Expression(
u.interpolate(uIC) # Set values
p = pow(u,3)
up = project(p,V)
test1 = project(
test2 = project(
~~~~~~~
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Anders Logg
- Solved:
- Last query:
- Last reply: