|
[Sponsors] |
macro expansion within codeStream for boundary.findPatchID() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 19, 2018, 04:33 |
macro expansion within codeStream for boundary.findPatchID()
|
#1 |
Member
Fynn
Join Date: Feb 2016
Posts: 48
Rep Power: 10 |
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; } 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"); ...}# |
|
December 15, 2022, 22:17 |
|
#2 |
Member
Ali B.
Join Date: Mar 2020
Location: abzrg.github.io
Posts: 44
Rep Power: 6 |
It is probably late...
You can access a dictionary name by simply using the dictName member function Code:
const word patchName = dict.dictName(); ... const label id = mesh.boundary().findPatchID(patchName); Code:
... //- The dictionary name inline const fileName& name() const noexcept; //- The dictionary name for modification (use with caution). inline fileName& name() noexcept; //- The local dictionary name (final part of scoped name) inline word dictName() const; ... Code:
"/Volumes/SourceCode/projects/foam/3-weeks-training/week_3/day_11/1_bc_with_codeStream/codeStream_BC/2Delbow_UparabolicInlet/0/U.boundaryField.velocity-inlet-5" Code:
"velocity-inlet-5" |
|
Tags |
code stream, macro expansion |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[blockMesh] Create internal faces as patch in blockMesh | m.delta68 | OpenFOAM Meshing & Mesh Conversion | 14 | July 12, 2018 15:43 |
timestep extraction for macro | manuc | Tecplot | 0 | August 10, 2016 13:20 |
Error in compiling new drag model | k.farnagh | OpenFOAM Programming & Development | 13 | May 21, 2016 04:08 |
Add New Pyrolysis Chemistry Type | LWhitson2 | OpenFOAM Programming & Development | 0 | April 30, 2015 19:54 |
Macro problem | cfddummy | Siemens | 1 | April 9, 2007 13:37 |