CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

OpenFOAM file syntax

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Andreas_F

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 26, 2010, 16:42
Default OpenFOAM file syntax
  #1
New Member
 
Join Date: Aug 2010
Posts: 15
Rep Power: 15
amtri is on a distinguished road
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.
amtri is offline   Reply With Quote

Old   August 27, 2010, 07:06
Default
  #2
Senior Member
 
Dave
Join Date: Jul 2010
Posts: 100
Rep Power: 15
daveatstyacht is on a distinguished road
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
daveatstyacht is offline   Reply With Quote

Old   August 27, 2010, 07:16
Default
  #3
New Member
 
Andreas_F
Join Date: Feb 2010
Posts: 3
Rep Power: 16
Andreas_F is on a distinguished road
. 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
Andreas_F is offline   Reply With Quote

Old   August 27, 2010, 09:27
Default
  #4
Senior Member
 
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 21
marupio is on a distinguished road
.* is unix for * in windows.
marupio is offline   Reply With Quote

Old   August 27, 2010, 10:56
Default Thanks
  #5
New Member
 
Join Date: Aug 2010
Posts: 15
Rep Power: 15
amtri is on a distinguished road
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!
amtri is offline   Reply With Quote

Old   August 28, 2010, 07:19
Default
  #6
New Member
 
Andreas_F
Join Date: Feb 2010
Posts: 3
Rep Power: 16
Andreas_F is on a distinguished road
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___")
vscalon likes this.
Andreas_F is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
tecio compilation errors in latest 1.6.x rsamuel OpenFOAM Bugs 2 June 25, 2021 08:10
Problem installing on Ubuntu 9.10 -> 'Cannot open : No such file or directory' mfiandor OpenFOAM Installation 2 January 25, 2010 09:50
OpenFOAM Install Script ljsh OpenFOAM Installation 82 October 12, 2009 11:47
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 06:51
gcc and executable file from Mac to Linux simone Marras Main CFD Forum 0 April 8, 2007 15:49


All times are GMT -4. The time now is 01:08.