From 976035d5025ea9d5fe43f7af839156a96118e344 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 3 Jun 2011 12:57:54 +0100 Subject: [PATCH] ENH: potentialFoam/cylinder: added #codeStream for blockMeshDict --- .../cylinder/constant/polyMesh/blockMeshDict | 84 ++++++++++--------- .../potentialFoam/cylinder/system/controlDict | 2 + 2 files changed, 45 insertions(+), 41 deletions(-) diff --git a/tutorials/basic/potentialFoam/cylinder/constant/polyMesh/blockMeshDict b/tutorials/basic/potentialFoam/cylinder/constant/polyMesh/blockMeshDict index 70cdc45711..6d12dbbff6 100644 --- a/tutorials/basic/potentialFoam/cylinder/constant/polyMesh/blockMeshDict +++ b/tutorials/basic/potentialFoam/cylinder/constant/polyMesh/blockMeshDict @@ -16,47 +16,49 @@ FoamFile convertToMeters 1; -vertices -( - (0.5 0 -0.5) - (1 0 -0.5) - (2 0 -0.5) - (2 0.707107 -0.5) - (0.707107 0.707107 -0.5) - (0.353553 0.353553 -0.5) - (2 2 -0.5) - (0.707107 2 -0.5) - (0 2 -0.5) - (0 1 -0.5) - (0 0.5 -0.5) - (-0.5 0 -0.5) - (-1 0 -0.5) - (-2 0 -0.5) - (-2 0.707107 -0.5) - (-0.707107 0.707107 -0.5) - (-0.353553 0.353553 -0.5) - (-2 2 -0.5) - (-0.707107 2 -0.5) - (0.5 0 0.5) - (1 0 0.5) - (2 0 0.5) - (2 0.707107 0.5) - (0.707107 0.707107 0.5) - (0.353553 0.353553 0.5) - (2 2 0.5) - (0.707107 2 0.5) - (0 2 0.5) - (0 1 0.5) - (0 0.5 0.5) - (-0.5 0 0.5) - (-1 0 0.5) - (-2 0 0.5) - (-2 0.707107 0.5) - (-0.707107 0.707107 0.5) - (-0.353553 0.353553 0.5) - (-2 2 0.5) - (-0.707107 2 0.5) -); +vertices #codeStream +{ + codeInclude + #{ + #include "pointField.H" + #}; + + code + #{ + pointField points(19); + points[0] = point(0.5, 0, -0.5); + points[1] = point(1, 0, -0.5); + points[2] = point(2, 0, -0.5); + points[3] = point(2, 0.707107, -0.5); + points[4] = point(0.707107, 0.707107, -0.5); + points[5] = point(0.353553, 0.353553, -0.5); + points[6] = point(2, 2, -0.5); + points[7] = point(0.707107, 2, -0.5); + points[8] = point(0, 2, -0.5); + points[9] = point(0, 1, -0.5); + points[10] = point(0, 0.5, -0.5); + points[11] = point(-0.5, 0, -0.5); + points[12] = point(-1, 0, -0.5); + points[13] = point(-2, 0, -0.5); + points[14] = point(-2, 0.707107, -0.5); + points[15] = point(-0.707107, 0.707107, -0.5); + points[16] = point(-0.353553, 0.353553, -0.5); + points[17] = point(-2, 2, -0.5); + points[18] = point(-0.707107, 2, -0.5); + + // Duplicate z points + label sz = points.size(); + points.setSize(2*sz); + for (label i = 0; i < sz; i++) + { + const point& pt = points[i]; + points[i+sz] = point(pt.x(), pt.y(), -pt.z()); + } + + os << points; + #}; +}; + blocks ( diff --git a/tutorials/basic/potentialFoam/cylinder/system/controlDict b/tutorials/basic/potentialFoam/cylinder/system/controlDict index 39199914b4..8f10f1fc76 100644 --- a/tutorials/basic/potentialFoam/cylinder/system/controlDict +++ b/tutorials/basic/potentialFoam/cylinder/system/controlDict @@ -49,8 +49,10 @@ functions { difference { + // Load the library containing the 'coded' functionObject functionObjectLibs ("libutilityFunctionObjects.so"); type coded; + // Name of on-the-fly generated functionObject redirectType error; code #{