CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Number precision format

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 28, 2016, 09:59
Post Number precision format
  #1
New Member
 
Bojan Sekutkovski
Join Date: Oct 2012
Posts: 19
Rep Power: 14
Bojan is on a distinguished road
Hi everybody,

I have a "simple" problem which seems to be unsolvable.

I'm programming some mesh motion solver which is to be time dependent, but I have a problem when try to manipulate with a mesh point coordinate (here is the source of the problem):

movingPoints[curFace[pointI]] = meshPoints_[curFace[pointI]];

meshPoints_[curFace[pointI]] gives me (example line):

(-0.00649239 -0.010524 -0.0217109)

instead of

(-0.006492392086 -0.01052404258 -0.02171094868)

When I try to print the line using:

Info << "Point: " << Foam::setprecision(12) << meshPoints_[curFace[pointI]] << endl;

everything seems to be correct, but how am I going to use the full number length when performing further operations? Simply, I'm not able to proceed with mesh point coordinates which actually do not exist, because I get the Terminal message:

Aborted (core dumped)


Thanks in advance!
Bojan is offline   Reply With Quote

Old   May 30, 2016, 04:44
Cool Solution
  #2
New Member
 
Bojan Sekutkovski
Join Date: Oct 2012
Posts: 19
Rep Power: 14
Bojan is on a distinguished road
It seems that the problem with number precision is caused by some additional preprocessor directive. Quite strange. Simple printing of the mesh points coordinates of turboFvMesh is working right without using Foam::setprecision(12), which here certainly points to the problem with some possibly unnecessary #include directive.
Bojan is offline   Reply With Quote

Reply

Tags
mesh, number, points, read data, setprecision


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
decomposePar problem: Cell 0contains face labels out of range vaina74 OpenFOAM Pre-Processing 37 July 20, 2020 06:38
[snappyHexMesh] Error snappyhexmesh - Multiple outside loops avinashjagdale OpenFOAM Meshing & Mesh Conversion 53 March 8, 2019 10:42
simpleFoam parallel AndrewMortimer OpenFOAM Running, Solving & CFD 12 August 7, 2015 19:45
decomposePar pointfield flying OpenFOAM Running, Solving & CFD 28 December 30, 2013 16:05
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Meshing & Mesh Conversion 2 July 15, 2005 05:15


All times are GMT -4. The time now is 20:43.