|
[Sponsors] |
June 17, 2013, 11:10 |
Check if a file is a valid foamFile
|
#1 |
New Member
Marcel Vonlanthen
Join Date: Nov 2012
Location: Zurich, Switzerland
Posts: 28
Rep Power: 13 |
Dear Foamer,
Is there a function/method to check if a file is a well formatted foamFile? Namely, if it start by a valid header? I'm looking for something, which return a bool, then I can handle the different cases... For example: example 1: well formatted Code:
FoamFile { version 2.0; format ascii; class vectorField; object values; } Code:
// blah blah blah FoamFile { version 2.0; format ascii; class vectorField; object values; } Code:
//blah blah blah 324 456.8 5.7 34 |
|
June 17, 2013, 17:43 |
|
#2 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Greetings Marcel,
In OpenFOAM's source code applications folder, you should be able to find several examples like the following, which can be seen online here: Quote:
Best regards, Bruno
__________________
|
||
June 18, 2013, 05:31 |
|
#3 |
New Member
Marcel Vonlanthen
Join Date: Nov 2012
Location: Zurich, Switzerland
Posts: 28
Rep Power: 13 |
Hello Bruno,
Thank you for the tip, it works! Regards, Marcel |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] swak4foam building problem | GGerber | OpenFOAM Community Contributions | 54 | April 24, 2015 16:02 |
[swak4Foam] swak4Foam-groovyBC build problem | zxj160 | OpenFOAM Community Contributions | 18 | July 30, 2013 13:14 |
which tutorial can find that include Riemann boundary condition? | immortality | OpenFOAM Running, Solving & CFD | 12 | May 3, 2013 18:21 |
friction forces icoFoam | ofslcm | OpenFOAM | 3 | April 7, 2012 10:57 |
[blockMesh] error message with modeling a cube with a hold at the center | hsingtzu | OpenFOAM Meshing & Mesh Conversion | 2 | March 14, 2012 09:56 |