|
[Sponsors] |
[blockMesh] error in using #codeStream for making blockMeshDict |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 9, 2016, 18:12 |
error in using #codeStream for making blockMeshDict
|
#1 |
Senior Member
Bobby
Join Date: Oct 2012
Location: Michigan
Posts: 454
Rep Power: 15 |
Dear Fellows
I am trying to use #codeStream in blockMeshDict file to create a simple grid. The following is my blockMeshDict file initial lines: Code:
convertToMeters 1; vertices #codeStream { codeInclude #{ #include "pointField.H" #}; code #{ pointField points(8); points[0] = point(0 0 0); points[1] = point(2 0 0); points[2] = point(2 0.05 0); points[3] = point(0 0.05 0); points[4] = point(0 0 0.05); points[5] = point(2 0 0.05); points[6] = point(2 0.05 0.05); points[7] = point(0 0.05 0.05); os << points; #}; }; blocks ( hex (0 1 2 3 4 5 6 7) (280 7 1) simpleGrading (1 1 1) ); Code:
home/babak/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/Vector.H:58:7: note: no known conversion for argument 1 from ‘int’ to ‘const Foam::Vector<double>&’ /home/babak/Desktop/second_version_simulations/Coarse_Grid/X_10/j0_1/constant/polyMesh/blockMeshDict::#codeStream:34:20: error: expected primary-expression before ‘(’ token /home/babak/Desktop/second_version_simulations/Coarse_Grid/X_10/j0_1/constant/polyMesh/blockMeshDict::#codeStream:34:23: error: expected ‘)’ before numeric constant make: *** [Make/linux64GccDPOpt/codeStreamTemplate.o] Error 1 The full blockMeshDict file is attached as well. The above grid compiles with removing code stream and defining vertices normally Regards |
|
October 9, 2016, 18:24 |
|
#2 |
Senior Member
Bobby
Join Date: Oct 2012
Location: Michigan
Posts: 454
Rep Power: 15 |
Oh Gosh. Problem Solved.
points Should be defined like this: Code:
code #{ pointField points(8); points[0] = point(0, 0, 0); points[1] = point(2, 0, 0); points[2] = point(2, 0.05, 0); points[3] = point(0, 0.05, 0); points[4] = point(0, 0, 0.05); points[5] = point(2, 0, 0.05); points[6] = point(2, 0.05, 0.05); points[7] = point(0, 0.05, 0.05); os << points; #}; |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[blockMesh] #codeStream loop inside a blockMeshDict | francois | OpenFOAM Meshing & Mesh Conversion | 31 | March 13, 2021 12:29 |
[blockMesh] Creating an axisymmetric piston cylinder in blockMeshDict | foadsf | OpenFOAM Meshing & Mesh Conversion | 9 | August 23, 2018 07:54 |
How to create the internalField with #codeStream | chun | OpenFOAM Running, Solving & CFD | 3 | May 6, 2017 10:35 |
[blockMesh] 2:1 refined 2D blockMeshDict with mergePatchPairs? | chrisb2244 | OpenFOAM Meshing & Mesh Conversion | 0 | December 1, 2014 23:52 |
[Other] blockMeshDict not Matching Boundary | HassanDarian | OpenFOAM Meshing & Mesh Conversion | 0 | March 19, 2014 13:30 |