OpenFOAM file syntax
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.
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.
. 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:
.* is unix for * in windows.
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
a.a a.b ac a.c
But if I do
% ls a.*
a.a a.b a.c
I'll take a look at regular expressions. Thanks again to all!
It doesn' t have to do with windows or unix.
It is simply regular expressions. "motorBike_.*" means all the boundaries starting with "motorBike_"
. 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.
|All times are GMT -4. The time now is 13:05.|