How can I define functions with m4?
Dear OF-Users,
I'm trying to create a blockMeshDict with m4. I need to define all coordinates on the Z-axis as functions of coordinates on the X-axis. So far my m4-code looks like this: define (x1, 7) define (x2, 5) ... define (x20, 4) define (z1, calc(x1*2+1)) define (z2, calc(x2*2+1)) ... define (z20, calc(x20*2+1)) etc. And the problem is, I have about 100 coordinates and it is a bit awkward to define all 100 coordinates one by one. Maybe can somebody tell me how can I just once define a function for all Z-coordinates, if it's possible? Best regards, Olivia |
Hi,
you could use any scripting or programming language to write the contents of the blockMeshDict. For example the following Python script Code:
#!/usr/bin/env python Code:
x0 0.0; |
The above post was just a workaround for your problem. Regarding your initial question on m4, maybe the following link helps:
http://www.slac.stanford.edu/comp/un...nfo/m4_11.html |
All times are GMT -4. The time now is 03:37. |