Subject: [FEniCS-dev] double precision of single precision?

From: Chong Luo <[email-masked]>
Date: Sat, 7 Jun 2008 09:17:03 -0700 (PDT)

What is the default precision of FEniCS, is it double precision or single precision? 

I have this question, because for exact solution in P(2), using P(2) element gave me an error of order 1E-7 instead of 1E-14. 

Thanks,
Chong Luo

---

From: Anders Logg <[email-masked]>
Date: Sat, 7 Jun 2008 19:40:46 +0200

On Sat, Jun 07, 2008 at 09:17:03AM -0700, Chong Luo wrote:
> I have this question, because for exact solution in P(2), using P(2) element
> gave me an error of order 1E-7 instead of 1E-14.

It doesn't work that way (unfortunately). The error depends on the
mesh size. Or did you refine until convergence?

Maybe in a few years, you can ask again and we can answer that yes,
FEniCS solves all problems to within double precision. :-)

-- 
Anders

---

From: Jed Brown <[email-masked]>
Date: Sat, 7 Jun 2008 19:48:22 +0200

> mesh size. Or did you refine until convergence?

If the exact solution is really in P_2 then it can be represented exactly in the
finite element space.  Is it possible that the quadrature rule was inexact in
this case?  If an iterative method was used, were the tolerances cranked way up?

Jed

---

From: "Garth N. Wells" <[email-masked]>
Date: Sat, 07 Jun 2008 18:51:00 +0100

Jed Brown wrote:
> this case?  

Yes, because FFC writes C++ code with finite precision. It can be 
controlled through an FFC flag (or at least it used to be).

Garth

If an iterative method was used, were the tolerances cranked way up?
> 
> Jed
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> FEniCS-dev mailing list
> [email-masked]
> http://www.fenics.org/mailman/listinfo/fenics-dev

---

From: Anders Logg <[email-masked]>
Date: Sat, 7 Jun 2008 22:59:47 +0200

> > finite element space.  Is it possible that the quadrature rule was inexact in

I missed that part.

> controlled through an FFC flag (or at least it used to be).

By default, FFC writes floating point as

  %.15g

so that shouldn't be the problem. There are 3 other sources I can
think of:

1. The precision of the basis functions generated by FIAT. I don't
know what precision FIAT uses, but presumably close to full precision
for P2.

2. The solution of the linear system. Which method was used to solve
the linear system?

3. Postprocessing. How did you measure the error? By writing the
solution to file? How many digits are stored in the output?

-- 
Anders