Problem with simple if-comparison
I'm completely confused ...
This is really embarrassing as it's about a simple if condition ...
Have a look at the code-(sniped):
Don't mind what it's actually doing, concentrate on the bold red if-condition.
It is not satisfied (meaning its Info-line "Components identical !!!" is not displayed while running the program) although the bold black italic Info-line displays the following:
So what's wrong with this?!
Is there any difference between the displayed values and the contents of the vectorField?!
In the further progress of this code I'm writing this faceCenterCoordinates vectorField to a file an it displayed 5-digit-numbers (4 digits after the dot). So there can't be any problem with this ...
Hope for your ideas ...
Values displayed with some tolerance (it means, that difference could be after 6 or N digits after dot)
Try to calculate and output difference between two values, or refomulate condition like inequality:
mag(faceCenterCoordinates.component(2) - faceCenterCoordinates.component(2)) < VSMALL
/// do something
Yes this worked!
The output from
By the way: What is the difference between SMALL and VSMALL and where is it defined?
VSMALL - means Very SMALL.
For single precision:
SMALL = 1e-6, VSMALL = 1e-37
For double precision:
SMALL = 1e-15, VSMALL = 1e-300
this definitions are related with machine word length, and, i think, it's done for independence of platform type
for more information, see file scalar.H
|All times are GMT -4. The time now is 12:17.|