CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   surfacescalarfield (https://www.cfd-online.com/Forums/openfoam-programming-development/169429-surfacescalarfield.html)

milad653279 April 10, 2016 04:14

surfacescalarfield
 
Dear my friends,

I wanna take surfacescalarfield object. I use
cout<<name of my parameter [patchi]:

but it doesn't work. could anyone help me. I want to write components of surfacescalarfield object in a file.txt

Best regards

hk318i April 11, 2016 07:25

std::cout<< stream cannot handle objects of type surfacescalarfield. Generally, it is better to use OF library instead of standard c++, such as Info <<.
In your case, you want to right to a file therefore, you are looking for something like standard fstream. Fortunately, OF has its implementation of this class which called OFstrram, you can find it here [LINK] and I'm sure this forum has many threads about this topic.

Bw,
Hassan


All times are GMT -4. The time now is 18:21.