← Back to team overview

fenics team mailing list archive

Re: double precision of single precision?

 

On Sat, Jun 07, 2008 at 05:04:59PM -0700, Chong Luo wrote:
> I might have found out what the problem is, in my main.cpp, I used the
> following code to get L2 error
> 
> ---------------------part of Darcyflow.form-----------------------------
> # for the error estimates of p
> Me  = FiniteElement("Lagrange", "triangle", k+5)
> pe = Function(Me)
> ph = Function(Mh)
> M = dot(ph-pe, ph-pe)*dx
> ---------------------part of main.cpp----------------------------------------
>     DarcyflowFunctional M(ep,p);
>     real e0 = sqrt(assemble(M, mesh));
>     cout << "L2 error of pressure is " << e0 << endl;
> -----------------------------------------------------------------------------------------
> 
> There is a "sqrt" there, thus reducing the round off error 1E-14 to 1E-7.
> 
> That is my bad. Sorry about the confusion.
> 
> Best,
> Chong Luo

But there is also a square in dot(ph-pe, ph-pe) so I still think you
should get much better precision.

-- 
Anders

Attachment: signature.asc
Description: Digital signature


References