1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
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
26 Write out all library debug switches
28 \*---------------------------------------------------------------------------*/
31 #include "dictionary.H"
38 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 int main(int argc, char *argv[])
43 argList::noParallel();
44 argList::validOptions.insert("new", "");
45 argList::validOptions.insert("old", "");
47 Foam::argList args(argc, argv);
49 wordList currDebug(debug::debugSwitches().toc());
50 wordList currInfo(debug::infoSwitches().toc());
51 wordList currOpt(debug::optimisationSwitches().toc());
53 if (args.optionFound("old") || args.optionFound("new"))
55 dictionary controlDict(IFstream(findEtcFile("controlDict", true))());
59 controlDict.subDict("DebugSwitches").toc()
64 controlDict.subDict("InfoSwitches").toc()
69 controlDict.subDict("OptimisationSwitches").toc()
77 // list old switches - but this can't work since the (old) inserted
78 // switches are in both sets
80 // 1. run without any options (get complete list)
81 // 2. comment out DebugSwitches, run again with -new to find new ones
83 if (args.optionFound("old"))
85 IOobject::writeDivider(Info);
87 hashset = wordHashSet(oldDebug);
88 hashset -= wordHashSet(currDebug);
89 listing = hashset.toc();
91 Info<< "old DebugSwitches: " << listing << endl;
93 hashset = wordHashSet(oldInfo);
94 hashset -= wordHashSet(currInfo);
95 listing = hashset.toc();
97 Info<< "old InfoSwitches: " << listing << endl;
99 hashset = wordHashSet(oldOpt);
100 hashset -= wordHashSet(currOpt);
101 listing = hashset.toc();
103 Info<< "old OptimisationSwitches: " << listing << endl;
107 if (args.optionFound("new"))
109 IOobject::writeDivider(Info);
111 hashset = wordHashSet(currDebug);
112 hashset -= wordHashSet(oldDebug);
114 listing = hashset.toc();
116 Info<< "new DebugSwitches: " << listing << endl;
118 hashset = wordHashSet(currInfo);
119 hashset -= wordHashSet(oldInfo);
120 listing = hashset.toc();
122 Info<< "new InfoSwitches: " << listing << endl;
124 hashset = wordHashSet(currOpt);
125 hashset -= wordHashSet(oldOpt);
126 listing = hashset.toc();
128 Info<< "new OptimisationSwitches: " << listing << endl;
133 IOobject::writeDivider(Info);
136 Info<< "DebugSwitches: " << currDebug << endl;
139 Info<< "InfoSwitches: " << currInfo << endl;
142 Info<< "OptimisationSwitches: " << currOpt << endl;
147 Info<< "done" << endl;
153 // ************************************************************************* //