|
[Sponsors] |
April 12, 2022, 01:15 |
output stream file in scientific notation
|
#1 |
Member
Join Date: Jun 2019
Posts: 41
Rep Power: 6 |
Hello. I didn't find any relevant post while googling this thus for future generation here is how to output some values in scientific notation. The key here is the following line :
mySuperStream.setf(ios_base::scientific, ios_base::floatfield); Code:
// near your CreateField outside main loops OFstream mySuperStream((string("Coucou"))); mySuperStream.precision(5); mySuperStream.setf(ios_base::scientific, ios_base::floatfield); mySuperStream << "Time" << tab << "sumMatter" << tab << "Pthermique" << tab << "diff_pression"<< tab << "Joth"<< tab << endl; // inside your loop if (Pstream::master()) { mySuperStream << U.db().time().value() << tab << sumMatter << tab << Pthermique << tab << diff_pression << tab << Joth << tab << endl; } Happy foaming.
__________________
« Debugging is what CFD is about. 5 minutes to modify your code, 5 months to find why it does not work anymore. » |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
OpenFoam "Permission denied" and "command not found" problems. | iyidaniel@yahoo.co.uk | OpenFOAM Running, Solving & CFD | 11 | January 2, 2018 06:47 |
[foam-extend.org] problem when installing foam-extend-1.6 | Thomas pan | OpenFOAM Installation | 7 | September 9, 2015 21:53 |
[swak4Foam] Problem installing swak_2.x for OpenFoam-2.4.0 | towanda | OpenFOAM Community Contributions | 6 | September 5, 2015 21:03 |
SparceImage v1.7.x Issue on MAC OS X | rcarmi | OpenFOAM Installation | 4 | August 14, 2014 06:42 |
DecomposePar links against liblamso0 with OpenMPI | jens_klostermann | OpenFOAM Bugs | 11 | June 28, 2007 17:51 |