|
[Sponsors] |
October 15, 2009, 11:40 |
Compiling modified patchAverage tool
|
#1 |
New Member
Björn Westendorf
Join Date: Oct 2009
Location: Stuttgart, Germany
Posts: 9
Rep Power: 17 |
I'm trying to modify the patchAverage tool, so that the calculation result will be written into a simple text file. In a simple C++ app, including
Code:
#include <iostream> #include <fstream> Code:
ofstream results; results.open ("results.dat", ios::out | ios::app); results<< sumField << endl; results.close; Code:
Making dependency list for source file patchAverageToFile.C SOURCE=patchAverageToFile.C ; g++ -m64 -Dlinux64 -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -DNoRepository -ftemplate-depth-40 -I/home/stss2/OpenFOAM/OpenFOAM-1.5.x/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/stss2/OpenFOAM/OpenFOAM-1.5.x/src/OpenFOAM/lnInclude -I/home/stss2/OpenFOAM/OpenFOAM-1.5.x/src/OSspecific/Unix/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/patchAverageToFile.o patchAverageToFile.C: In function ‘int main(int, char**)’: patchAverageToFile.C:96: error: ‘ofstream’ was not declared in this scope patchAverageToFile.C:96: error: expected `;' before ‘results’ patchAverageToFile.C:97: error: ‘results’ was not declared in this scope patchAverageToFile.C:97: error: ‘ios’ has not been declared patchAverageToFile.C:97: error: ‘ios’ has not been declared make: *** [Make/linux64GccDPOpt/patchAverageToFile.o] Fehler 1 Thanks, Björn |
|
October 16, 2009, 01:10 |
what's your object ?
|
#2 |
Member
jingjing
Join Date: Mar 2009
Location: shanghai,China
Posts: 30
Rep Power: 17 |
what's the object of your modified patchAverage file? the original patchAverage tool already has the ability to produce data.If you want to get a data file,you just run the tool,
just like this: patchAverage fieldName patchName > dataFileName then you can get the data file So I don't know your real object.If the object is just to get a data file,you can do as above, jingjing |
|
October 16, 2009, 05:37 |
|
#3 |
New Member
Björn Westendorf
Join Date: Oct 2009
Location: Stuttgart, Germany
Posts: 9
Rep Power: 17 |
Well, I need to parse the calculation result with another application for automated post-processing. So it would be nice to just write out the result rather than writing the whole screen output to file.
|
|
October 16, 2009, 06:31 |
|
#5 |
New Member
Björn Westendorf
Join Date: Oct 2009
Location: Stuttgart, Germany
Posts: 9
Rep Power: 17 |
Great, that worked, thank you very much! ofstream and ios are obviously not declared in the foam namespace.
|
|
Tags |
compile, patchaverage |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problems while using the sample post-procesing tool | svens | OpenFOAM Post-Processing | 5 | September 2, 2010 12:13 |
[mesh manipulation] ScalePoints tool | cedric_duprat | OpenFOAM Meshing & Mesh Conversion | 6 | September 19, 2008 04:15 |
tool for approximation of condition number | rt | Main CFD Forum | 6 | June 24, 2006 03:42 |
Parametrical tool? | Renaud | FLUENT | 0 | May 25, 2006 05:51 |
Modified Equation for CFX algorithm | Craig Johansen | CFX | 0 | August 28, 2004 00:02 |