1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2008 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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 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, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 \*---------------------------------------------------------------------------*/
33 #include "pointMesh.H"
34 #include "OSspecific.H"
36 #include "pointEdgePoint.H"
37 #include "PointEdgeWave.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 int main(int argc, char *argv[])
45 argList::validArgs.append("patch");
47 # include "setRootCase.H"
48 # include "createTime.H"
49 # include "createPolyMesh.H"
51 pointMesh pMesh(mesh);
53 const polyBoundaryMesh& patches = mesh.boundaryMesh();
56 word patchName(args.additionalArgs()[0]);
58 // Find the label in patches by name.
59 label patchI = patches.findPatchID(patchName);
62 // Test whether any processor has patch
63 label maxPatchI = patchI;
65 reduce(maxPatchI, maxOp<label>());
69 FatalErrorIn(args.executable())
70 << "Cannot find patch named " << patchName << exit(FatalError);
75 // Set initial changed points to all the patch points(if patch present)
76 List<pointEdgePoint> wallInfo;
81 // Retrieve the patch now we have its index in patches.
82 const polyPatch& pp = mesh.boundaryMesh()[patchI];
84 wallPoints = pp.meshPoints();
86 wallInfo.setSize(pp.nPoints());
88 forAll(pp.localPoints(), ppI)
90 wallInfo[ppI] = pointEdgePoint(pp.localPoints()[ppI], 0.0);
94 // Current info on points
95 List<pointEdgePoint> allPointInfo(mesh.nPoints());
97 // Current info on edges
98 List<pointEdgePoint> allEdgeInfo(mesh.nEdges());
100 PointEdgeWave<pointEdgePoint> wallCalc
108 mesh.nPoints() // max iterations
123 dimensionedScalar("wallDist", dimLength, 0.0)
126 forAll(allPointInfo, pointI)
128 psf[pointI] = Foam::sqrt(allPointInfo[pointI].distSqr());
131 Info<< "Writing wallDist pointScalarField to " << runTime.value()
136 Info << nl << "End" << endl;
142 // ************************************************************************* //