ffc team mailing list archive
-
ffc team
-
Mailing list archive
-
Message #01293
Re: Absolute value difficulties.
Quoting Marie Rognes <meg@xxxxxxxxxxx>:
>
>
> We seem to have the following slightly suboptimal solution:
>
> Python 2.4.3 (#1, Feb 6 2007, 22:40:17)
> [GCC 3.4.6 (Gentoo 3.4.6-r1, ssp-3.4.5-1.0, pie-8.7.9)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import ffc
> >>> ffc.abs(-1)
> -1.0
>
> This is relatively easy to fix.
yes
> The next problem is
>
> >>> ffc.abs(1) < 0.001
> True
>
>
> which is a bit more puzzling for me in itself and in how to fix.
>
> Anyone want to take a look?
ffc.abs(1)
returns a Form
try
ffc.abs(1).__doc__
what you could do is
f = ffc.Form(1)
f.monomials[0].numeric < 0.001
which will be false
Kristian
> --
> Marie, who just spent a couple of hours puzzled over boundary conditions ;)
> _______________________________________________
> FFC-dev mailing list
> FFC-dev@xxxxxxxxxx
> http://www.fenics.org/mailman/listinfo/ffc-dev
>
Follow ups
References