Speed difference of "scalar, label" with"double, int"
Hi guys,
We know that in OpenFOAM we can use label instead of int and scalar instead of double. If we just wanna to use the simple mathematical manipulation. Is the code using double or int faster than scalar of label? Or...std::cout is faster than Info? Cause for now Im solving population balance model. For a mesh with 17m cells. It uses 3.12s to calculate the source term(only some tedious algebraic manipulation). 1.29 to solve NS equations. 0.29s to solve moments equations. Thanks, |
Hey did you ever find out more about this? Label/Scalar vs Int/Double?
|
Quote:
The data type scalar is a floating point number, depending on your compiler settings, either a float (32bit) or double (64bit). Study the source code in $FOAM_SRC/OpenFOAM/primitives/ints and $FOAM_SRC/OpenFOAM/primitives/Scalar The Info keyword, widely used in OpenFOAM, at some point will use std::cout. So, label, scalar and Info is there for our convenience. There should be no performance penalty. |
All times are GMT -4. The time now is 14:46. |