CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   macro expansion within codeStream for boundary.findPatchID() (https://www.cfd-online.com/Forums/openfoam-pre-processing/197852-macro-expansion-within-codestream-boundary-findpatchid.html)

PanPeter January 19, 2018 03:33

macro expansion within codeStream for boundary.findPatchID()
 
Hello together,

I am using the macro expansion functionality to dynamically set the names for my boundary patches. Now I implement a code stream on a boundary patch. To access the mesh data on the respective patch I use mesh.boundary.findPatchID("patchName"). And here I don't find a way to replace patchName with my marco expansion. It seems the parentheses are not compatible with the macro expansion.

Does anybody have an idea as how to solve this or could suggest a work-around?

patchNames.h
Code:

boundary_names
{
    OUTLET_NAME                outlet;
}

0/p
Code:

#inlcude "../patchNames.h"
$boundary_names.OUTLET_NAME
{

type                fixedValue;
value                  #codeStream
{
...
...
code
#{
...
...
...
// this is where I want to use my macro expansion instead of writing "outlet" out:
const label id = mesh.boundary().findPatchID("outlet");
...
}#
}
}



All times are GMT -4. The time now is 05:49.