CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Native Meshers: blockMesh (http://www.cfd-online.com/Forums/openfoam-meshing-blockmesh/)
-   -   M4 / blockMesh (http://www.cfd-online.com/Forums/openfoam-meshing-blockmesh/109681-m4-blockmesh.html)

pythag0ra5 November 23, 2012 10:01

M4 / blockMesh
 
Hi there,

can someone tell me if it is possible to calculate the arctan of some value in the M4 Preproccesor?

Code:

define(height_step, 1.5)
define(length_step, 3)
define(alpha, calc(atan(height_step/length_step)))

If i compile my m4-file with

Code:

m4 blockMeshDict.m4 > blockMeshDict
an error occurs:

Code:

Undefined subroutine &main::atan called at -e line 1.
In the final blockmeshdict nothing is calculated.

Can someone help?

Thanks a lot in advance!

pythag0ra5 November 23, 2012 10:24

Thanks a lot to startingwithCFD who gave the right hint, some perl-information was missing in the header:

Code:

define(calc, [esyscmd(perl -e 'use Math::Trig; print ($1)')]) dnl>


All times are GMT -4. The time now is 04:59.