> It is binary and so outputs as many digits as there are in a 32-bit floating point number.
@WB Which is equivalent to "deal.ii outputs the solution vector values upto 7 decimal" if I am not mistaken. To be able to switch between double and single precision would be nice. It's not the first time I heard someone wanting this feature. If you would be willing to implement this would be great. But for the time being, you could also quickly change some floats (e.g. https://github.com/dealii/dealii/blob/a95f7e5f2e7d15c10670ee93313dd357178a18b3/source/base/data_out_base.cc#L1547-L1548) to doubles. Peter On Monday, 10 October 2022 at 15:48:11 UTC+2 [email protected] wrote: > Thank you. > > I used the setprecision function to output the result to desired accuracy. > However, I noticed that deal.ii writes the output to vtk file only upto > certain precision(6). > Is there a way to write output to the vtk file according to required > precision? > > Thank you > > On Thursday, September 29, 2022 at 6:13:28 PM UTC+5:30 > [email protected] wrote: > >> Hello, >> >> What do you mean exactly by "deal.ii outputs the solution vector values >> upto 7 decimal"? Which function are you using? If you are using a function >> like std::cout to inspect the values in the vector, the default precision >> is 6 (I think) but it can be changed using std::setprecision (see >> https://en.cppreference.com/w/cpp/io/manip/setprecision) >> >> Best, >> >> Bruno >> >> On Thursday, September 29, 2022 at 4:24:49 AM UTC-4 >> [email protected] wrote: >> >>> Hello everyone. >>> Is there a way to increase precision of floating point values in >>> deal.ii? I am modifying step3 and checking my solution against a linear >>> exact solution. I am getting machine precision (around 10^-16 ) for >>> 4,16...4096 elements. However, when I refine further, I am getting an error >>> of 10^-6 and 10^-5 for 16384 and 65536 elements. What I realized is that >>> deal.ii outputs the solution vector values upto 7 decimal places only and >>> hence the error begins to show up for very fine meshes. >>> Is there a way to increase my precision to say upto 14 decimal places? >>> I tried using long double instead of double for my various variables but >>> it gives the following error: >>> error: no matching function for call to >>> ‘interpolate_boundary_values(dealii::DoFHandler<2, 2>&, int, >>> dealii::Functions::ConstantFunction<2>, std::map<unsigned int, long >>> double>&)’ >>> 296 | boundary_values); >>> >>> Thank You! >>> >> -- The deal.II project is located at http://www.dealii.org/ For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en --- You received this message because you are subscribed to the Google Groups "deal.II User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/bb6f50fc-7339-4132-a1c8-2758dd58fc66n%40googlegroups.com.
