|
[Sponsors] |
February 23, 2015, 05:51 |
macro substitution with negative symbol
|
#1 |
Senior Member
Robert Castilla
Join Date: Apr 2009
Location: Spain
Posts: 109
Rep Power: 17 |
Hi,
when I try to make a macro susbtitution in blockMeshDict, like a 10; vertices ( ... ($a -$a 0) ... ) it is not working. It gives the error wrong token type - expected Scalar, found on line 37 the punctuation token '-' It works with a code like ($a #calc "-$a" 0) but I find it very anoying. I am not able to find an easy way to do that. Any suggestion? Thanks Robert |
|
September 1, 2020, 11:06 |
|
#2 |
New Member
Giorgio Negrini
Join Date: Feb 2020
Location: Milan
Posts: 13
Rep Power: 6 |
Very old post, but may be useful to give an answer for who will read.
To make a negative macro you can easily write: a 1; ma #neg $a; and it doesn't need compilation! |
|
September 2, 2020, 09:53 |
|
#3 | |
Member
Rodrigo
Join Date: Mar 2010
Posts: 98
Rep Power: 16 |
Quote:
In case you are dealing with an older version you may need to do something like this instead (needs runtime compilation): Code:
a 1; ma #calc "-$a"; Last edited by guin; September 3, 2020 at 03:49. Reason: EDIT: ensuring correctness in the answer thanks to Giorgio's feedback. |
||
September 2, 2020, 10:04 |
|
#4 |
New Member
Giorgio Negrini
Join Date: Feb 2020
Location: Milan
Posts: 13
Rep Power: 6 |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] mesh airfoil NACA0012 | anand_30 | OpenFOAM Meshing & Mesh Conversion | 13 | March 7, 2022 17:22 |
using METIS functions in fortran | dokeun | Main CFD Forum | 7 | January 29, 2013 04:06 |
POSDAT problem | piotka | STAR-CD | 4 | June 12, 2009 08:43 |
Errors running allwmake in OpenFOAM141dev with WM_COMPILE_OPTION%3ddebug | unoder | OpenFOAM Installation | 11 | January 30, 2008 20:30 |
[blockMesh] Axisymmetrical mesh | Rasmus Gjesing (Gjesing) | OpenFOAM Meshing & Mesh Conversion | 10 | April 2, 2007 14:00 |