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/>.
28 Simple tool to upgrade the syntax of system/fvSolution::solvers
32 - foamUpgradeFvSolution [OPTION]
35 Suppress writing the updated fvSolution file
37 \*---------------------------------------------------------------------------*/
41 #include "IOdictionary.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 int main(int argc, char *argv[])
51 argList::noParallel();
52 argList::validOptions.insert("test", "");
54 # include "setRootCase.H"
55 # include "createTime.H"
57 IOdictionary solutionDict
71 entry* e = solutionDict.lookupEntryPtr("solvers", false, false);
74 nChanged = solution::upgradeSolverDict(e->dict(), true);
77 Info<< nChanged << " solver settings changed" << nl << endl;
80 if (args.optionFound("test"))
82 Info<< "-test option: no changes made" << nl << endl;
88 solutionDict.objectPath(),
89 solutionDict.objectPath() + ".old"
92 solutionDict.writeObject
95 IOstream::currentVersion,
96 IOstream::UNCOMPRESSED
99 Info<< "Backup to " << (solutionDict.objectPath() + ".old") << nl
100 << "Write to " << solutionDict.objectPath() << nl << endl;
108 // ************************************************************************* //