CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (http://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   Version sniffing in sampleDict (http://www.cfd-online.com/Forums/openfoam-post-processing/99847-version-sniffing-sampledict.html)

hugo17 April 13, 2012 05:03

Version sniffing in sampleDict
 
Hi,

I'm working with OF 1.7.1 and 2.0 on different machines and having the problem that the old version demands "patchName mypatch" in the definition for the sample surface while the code is "patches (mypatch)" in OF 2.0. Is there any possibility to include a switch into sampleDict which makes each version reading the appropriate definition?

Best regards
Hugo

wyldckat April 13, 2012 16:52

Hi Hugo,

You'll have to think the other way around, namely having two separate sampleDict files and then call depending on the version of OpenFOAM:
Code:

case $WM_PROJECT_VERSION in
 1.7.*)
  sampleDict -dict sampleDict.17
  ;;
  2.*)
  sampleDict -dict sampleDict.2
  ;;
esac

In case you can re-use most of the file, then you can try the "#include" capability that OpenFOAM has, but I can't remember if 1.7.* had it already :(

Best regards,
Bruno

hugo17 April 16, 2012 07:05

Thank you very much, Bruno - this way is a good idea.

Best regards
Hugo


All times are GMT -4. The time now is 16:41.