|
[Sponsors] |
August 26, 2010, 17:42 |
OpenFOAM file syntax
|
#1 |
New Member
Join Date: Aug 2010
Posts: 15
Rep Power: 16 |
Hello,
I am trying to understand the OpenFOAM file syntax. I ran into an example (motorBike), where the polyMesh/boundary file has several boundaries named, e.g., motorBike_engine%56, motorBike_chain%40, etc. There are NO boundary entries named motorBike_.AAA where AAA can be anything. In other words, there are no entries where there is a period "." after the underscore character "_". However, looking at the initial conditions, I see an entry as follows: "motorBike_.*" Note the period after the underscore. I can only suspect that these initial conditions apply to all boundaries named motorBike_* (without the period). If that's indeed the case, can anybody help me understand this syntax? If I had a list of files named as the boundaries and did a "ls motorBike_.*" I would find nothing. So there must be something more to this. Pointing me to some point in the documentation where this syntax is explained is also appreciated. I couldn't find it. Thanks. |
|
August 27, 2010, 08:06 |
|
#2 |
Senior Member
Dave
Join Date: Jul 2010
Posts: 100
Rep Power: 16 |
If I recall correctly each of those "motorBike_engine%56" like objects is actually a surface from the .stl file of the motor bike. Since they are not all one surface (patch) the boundary conditions of each must be specified, since listing ALL of those surface would be a real pain you can use the wildcard "*" to specify all of the patches with that motorBike_ beginning to their name. I believe the "." has a symbolic meaning of relative to the current working directory. Hope this helps.
-Dave |
|
August 27, 2010, 08:16 |
|
#3 |
New Member
Andreas_F
Join Date: Feb 2010
Posts: 3
Rep Power: 16 |
. Matches any single character (many applications exclude newlines, and exactly which characters are considered newlines is flavor, character encoding, and platform specific, but it is safe to assume that the line feed character is included). Within POSIX bracket expressions, the dot character matches a literal dot. For example, a.c matches "abc", etc., but [a.c] matches only "a", ".", or "c".
* Matches the preceding element zero or more times. For example, ab*c matches "ac", "abc", "abbbc", etc. [xyz]* matches "", "x", "y", "z", "zx", "zyx", "xyzzy", and so on. \(ab\)* matches "", "ab", "abab", "ababab", and so on. It is regular expressions. For further information see: http://en.wikipedia.org/wiki/Regular_expression |
|
August 27, 2010, 10:27 |
|
#4 |
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22 |
.* is unix for * in windows.
|
|
August 27, 2010, 11:56 |
Thanks
|
#5 |
New Member
Join Date: Aug 2010
Posts: 15
Rep Power: 16 |
Thanks to all who responded. I guess I was confused by the syntax of regular expressions. In unix, if I have files a.a, a.b, a.c, and ac, if I do
% ls I get a.a a.b ac a.c But if I do % ls a.* I get a.a a.b a.c I'll take a look at regular expressions. Thanks again to all! |
|
August 28, 2010, 08:19 |
|
#6 |
New Member
Andreas_F
Join Date: Feb 2010
Posts: 3
Rep Power: 16 |
It doesn' t have to do with windows or unix.
It is simply regular expressions. "motorBike_.*" means all the boundaries starting with "motorBike_" (e.g. "motorBike_", "motorBike_aaa" , "motorBike_bdccccc", "motorBike_bdccccc" , "motorBike_.bd", "motorBike_engine%56", "motorBike_chain%40") . Matches any single character * Matches the preceding element zero or more times "motorBike_*" means all the boundaries starting with "motorBike" and having " _" zero or more times. (e.g. "motorBike", "motorBike_", "motorBike__", "motorBike___") |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
tecio compilation errors in latest 1.6.x | rsamuel | OpenFOAM Bugs | 2 | June 25, 2021 09:10 |
Problem installing on Ubuntu 9.10 -> 'Cannot open : No such file or directory' | mfiandor | OpenFOAM Installation | 2 | January 25, 2010 10:50 |
OpenFOAM Install Script | ljsh | OpenFOAM Installation | 82 | October 12, 2009 12:47 |
Problem with rhoSimpleFoam | matteo_gautero | OpenFOAM Running, Solving & CFD | 0 | February 28, 2008 07:51 |
gcc and executable file from Mac to Linux | simone Marras | Main CFD Forum | 0 | April 8, 2007 16:49 |