initial commit for version 1.5.x patch release
[OpenFOAM-1.5.x.git] / applications / test / nearWallDist-wave / testWallDist.C
blob8c600886cdbc6536909eb5038c10efe646028ad1
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2008 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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
25 Description
26     Calculate distance to wall.
28 \*---------------------------------------------------------------------------*/
30 #include "fvCFD.H"
31 #include "wallDist.H"
33 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34 // Main program:
36 int main(int argc, char *argv[])
38 #   include "setRootCase.H"
39 #   include "createTime.H"
40 #   include "createMesh.H"
42     Info<< "Mesh read in = "
43         << runTime.cpuTimeIncrement()
44         << " s\n" << endl << endl;
47     Info<< "Time now = " << runTime.timeName() << endl;
49     // Wall distance
51     wallDist y(mesh, true);
53     if (y.nUnset() != 0)
54     {
55         WarningIn(args.executable())
56             << "There are " << y.nUnset()
57             << " remaining unset cells and/or boundary values" << endl;
58     }
62     y.write();
65     runTime++;
67     Info<< "Time now = " << runTime.timeName() << endl;
70     // Move points
72     boundBox meshBb(mesh.points());
74     pointField newPoints(mesh.points());
76     const point half(0.5*(meshBb.min() + meshBb.max()));
78     forAll(newPoints, pointI)
79     {
80         point& pt = newPoints[pointI];
82         // expand around half
83         pt.y() +=  pt.y() - half.y();
84     }
86     mesh.movePoints(newPoints);
88     mesh.write();
90     y.correct();
92     y.write();
93     
95     Info<< "End\n" << endl;
97     return 0;
104 // ************************************************************************* //