CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Formatting with Info (http://www.cfd-online.com/Forums/openfoam-programming-development/107657-formatting-info.html)

Sune October 3, 2012 07:51

Formatting with Info
 
Hello all

I would like to know if it is possible to include some kind of string formatting (like with printf, sprintf etc.) into the OpenFOAM standard output stream Info.

For the specific case I work on, I have some doubles I output with Info, with tabs to align the values. But due to the way Info works, the number of decimals shown is not constant, and once in a while if a long negative number is displayed everything shifts around due to the tabs.

I know it is cosmetics, but I would like the numbers to be aligned throughout the whole simulation.

I don't use printf since I've read Info is specially suited for parallel runs, and also fprintf(Info,"some str",values) is not possible.


Sune


All times are GMT -4. The time now is 04:02.