1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend 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 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
28 Calculates and writes the scalar magnitude of the levelSet variable
31 Hrvoje Jasak, Wikki Ltd. All rights reserved.
33 \*---------------------------------------------------------------------------*/
37 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 int main(int argc, char *argv[])
41 argList::validOptions.insert("normal", "vector");
42 # include "addTimeOptions.H"
43 # include "setRootCase.H"
45 # include "createTime.H"
48 vector normal(0, 0, 1);
50 if (args.options().found("normal"))
52 normal = vector(IStringStream(args.options()["normal"])());
54 if (mag(normal) > SMALL)
56 normal /= mag(normal);
60 FatalErrorIn(args.executable())
61 << "Invalid normal given: " << normal
67 Info << "Normal vector for height field: " << normal << endl;
70 instantList Times = runTime.times();
72 // set startTime and endTime depending on -time and -latestTime options
73 # include "checkTimeOptions.H"
75 runTime.setTime(Times[startTime], startTime);
77 # include "createMesh.H"
79 for (label i=startTime; i<endTime; i++)
81 runTime.setTime(Times[i], i);
83 Info<< "Time = " << runTime.timeName() << endl;
87 Info<< " Calculating height" << endl;
103 Info<< "End\n" << endl;
109 // ************************************************************************* //