← Back to team overview

ffc team mailing list archive

Re: [DOLFIN-dev] long type for constants

 

ok, good. I've added this fix to FFC and pushed.

-- 
Anders


On Mon, Apr 28, 2008 at 02:39:05PM -0700, Reza Farrahi Moghaddam wrote:
> Thanks Anders, it works. The line 179 is changed from:
> 179:    format_string = "%%.%dg" % eval(options["precision="])
> to
> 179:    format_string = "%%.%de" % eval(options["precision="])
>  
> And, there is no integer error when the Dolfin code is compiled.
>  
> Here is the new-look of the corresponding line in the header file:
>  
>     // Compute element tensor
>     A[0] = 1.462905895716249e+10*G0_0_0_0_0_0_0 -
> 2.925812906734998e+09*G1_0_0_0_0_0_0 - 5.584662360274996e+08*G2_0_0_0_0_0_0 -
> 1.462905895716249e+10*G3_0_0_0_0_0_0 + 2.925812906734998e+09*G4_0_0_0_0_0_0 +
> 5.584662360274996e+08*G5_0_0_0_0_0_0 + 2.803630282331817e+08*G6_0_0_0_0 -
> 9.345437836878791e+07*G7_0_0_0_0 - 8.918383044393992e+06*G8_0_0_0_0 -
> 1.462905338064999e+10*G9_0_0_0_0_0_0 + 2.925810676129998e+09*G10_0_0_0_0_0_0 +
> 5.584628901199995e+08*G11_0_0_0_0_0_0 + 1.462905338064999e+10*G12_0_0_0_0_0_0 -
> 2.925810676129998e+09*G13_0_0_0_0_0_0 - 5.584628901199995e+08*G14_0_0_0_0_0_0 -
> 2.803629213599998e+08*G15_0_0_0_0 + 9.345430711999992e+07*G16_0_0_0_0 +
> 8.918347419999992e+06*G17_0_0_0_0 + 9.950187609699991e+05*G18_0_0 -
> 1.779902668199998e+08*G19_0_0_0_0 + 1.779902668199998e+08*G20_0_0_0_0 +
> 1.114248126199999e+06*G21_0_0_0 - 5.305943499999995e+05*G22_0_0_0 -
> 5.836537761999995e+05*G23_0_0_0 + 1.328916599999999e+08*G24_0_0_0_0_0 -
> 1.013298907499999e+08*G25_0_0_0_0_0 - 1.345528057499999e+08*G26_0_0_0_0_0 +
> 1.013298907499999e+08*G27_0_0_0_0_0 + 1.661145749999999e+06*G28_0_0_0_0_0 -
> 1.328916599999999e+08*G29_0_0_0_0_0 + 1.345528057499999e+08*G30_0_0_0_0_0 -
> 1.661145749999999e+06*G31_0_0_0_0_0 - 1.068731819999999e+02*G32_0_0_0_0 +
> 7.124878799999995e+01*G33_0_0_0_0 + 3.562439399999997e+01*G34_0_0_0_0 -
> 5.576512499999996e+03*G35_0_0_0_0_0_0 + 2.230604999999998e+03*G36_0_0_0_0_0_0 +
> 3.345907499999997e+03*G37_0_0_0_0_0_0 + 5.576512499999996e+03*G38_0_0_0_0_0_0 -
> 2.230604999999998e+03*G39_0_0_0_0_0_0 - 3.345907499999997e+03*G40_0_0_0_0_0_0 -
> 1.114477981439999e+10*G41_0_0_0_0_0_0 +
> 2.137322238309998e+11*G42_0_0_0_0_0_0_0_0 -
> 1.744563734999998e+11*G43_0_0_0_0_0_0_0_0 -
> 3.053317483299997e+10*G44_0_0_0_0_0_0_0_0 -
> 8.742675497999992e+09*G45_0_0_0_0_0_0_0_0 -
> 2.137322238309998e+11*G46_0_0_0_0_0_0_0_0 +
> 1.744563734999998e+11*G47_0_0_0_0_0_0_0_0 +
> 3.053317483299997e+10*G48_0_0_0_0_0_0_0_0 +
> 8.742675497999992e+09*G49_0_0_0_0_0_0_0_0 +
> 2.964340087499997e+09*G50_0_0_0_0_0_0_0 -
> 4.680537124999996e+08*G51_0_0_0_0_0_0_0 -
> 2.496286374999998e+09*G52_0_0_0_0_0_0_0 -
> 2.964340087499997e+09*G53_0_0_0_0_0_0_0 +
> 4.680537124999996e+08*G54_0_0_0_0_0_0_0 +
> 2.496286374999998e+09*G55_0_0_0_0_0_0_0 + 1.114477981439999e+10*G56_0_0_0_0_0_0
> - 3.120357899999997e+09*G57_0_0_0_0_0_0_0 +
> 5.200596499999995e+08*G58_0_0_0_0_0_0_0 +
> 2.600298249999998e+09*G59_0_0_0_0_0_0_0 +
> 3.120357899999997e+09*G60_0_0_0_0_0_0_0 -
> 5.200596499999995e+08*G61_0_0_0_0_0_0_0 -
> 2.600298249999998e+09*G62_0_0_0_0_0_0_0 - 3.156176924999997e+07*G63_0_0_0_0_0 +
> 3.322291499999997e+07*G64_0_0_0_0_0 + 1.560178124999999e+08*G65_0_0_0_0_0_0_0 -
> 5.200593749999996e+07*G66_0_0_0_0_0_0_0 -
> 1.040118749999999e+08*G67_0_0_0_0_0_0_0 -
> 1.560178124999999e+08*G68_0_0_0_0_0_0_0 +
> 5.200593749999996e+07*G69_0_0_0_0_0_0_0 +
> 1.040118749999999e+08*G70_0_0_0_0_0_0_0 + 3.156176924999997e+07*G71_0_0_0_0_0 -
> 3.322291499999997e+07*G72_0_0_0_0_0;
>   }
> 
> ----- Original Message ----
> From: Anders Logg <logg@xxxxxxxxx>
> To: dolfin-dev@xxxxxxxxxx; ffc-dev fenics <ffc-dev@xxxxxxxxxx>
> Sent: Monday, April 28, 2008 3:38:30 AM
> Subject: Re: [FFC-dev] [DOLFIN-dev] long type for constants
> 
> On Sat, Apr 26, 2008 at 07:45:02AM -0700, Reza Farrahi Moghaddam wrote:
> > Here are the two lines in the header file which cause that error.
> > I can manually bypass these errors by adding "LL" to the end of all integer
> > values in these two line.
> > The header file is also attached.
> > 
> > Reza
> 
> There shouldn't really be any integer values in the generated code.
> 
> Can you try experimenting with changing lines 176-177 in
> 
>     src/ffc/compiler/format/ufcformat.py
> 
> in the FFC source code? The "floating point" format string controls
> how floats are written to the generated code. Now, they are written as
> 
>     "%<n>g"
> 
> where <n> is the number of digits of precision. See if it works better
> for you by changing from "g" to "e".
> 
> Then I can change in FFC.
> 

> _______________________________________________
> FFC-dev mailing list
> FFC-dev@xxxxxxxxxx
> http://www.fenics.org/mailman/listinfo/ffc-dev



References