1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
27 \*---------------------------------------------------------------------------*/
32 #include "pointMesh.H"
33 #include "OSspecific.H"
35 #include "pointEdgePoint.H"
36 #include "PointEdgeWave.H"
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 int main(int argc, char *argv[])
44 argList::validArgs.append("patch");
46 # include "setRootCase.H"
47 # include "createTime.H"
48 # include "createPolyMesh.H"
50 const polyBoundaryMesh& patches = mesh.boundaryMesh();
53 word patchName(args.additionalArgs()[0]);
55 // Find the label in patches by name.
56 label patchI = patches.findPatchID(patchName);
59 // Test whether any processor has patch
60 label maxPatchI = patchI;
62 reduce(maxPatchI, maxOp<label>());
66 FatalErrorIn(args.executable())
67 << "Cannot find patch named " << patchName << exit(FatalError);
72 // Set initial changed points to all the patch points(if patch present)
73 List<pointEdgePoint> wallInfo;
78 // Retrieve the patch now we have its index in patches.
79 const polyPatch& pp = mesh.boundaryMesh()[patchI];
81 wallPoints = pp.meshPoints();
83 wallInfo.setSize(pp.nPoints());
85 forAll(pp.localPoints(), ppI)
87 wallInfo[ppI] = pointEdgePoint(pp.localPoints()[ppI], 0.0);
91 // Current info on points
92 List<pointEdgePoint> allPointInfo(mesh.nPoints());
94 // Current info on edges
95 List<pointEdgePoint> allEdgeInfo(mesh.nEdges());
97 PointEdgeWave<pointEdgePoint> wallCalc
105 mesh.nPoints() // max iterations
119 pointMesh::New(mesh),
120 dimensionedScalar("wallDist", dimLength, 0.0)
123 forAll(allPointInfo, pointI)
125 psf[pointI] = Foam::sqrt(allPointInfo[pointI].distSqr());
128 Info<< "Writing wallDist pointScalarField to " << runTime.value()
133 Info << nl << "End" << endl;
139 // ************************************************************************* //