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/>.
25 Interrogates a case and prints information to screen
27 \*---------------------------------------------------------------------------*/
30 #include "objectRegistry.H"
32 #include "dictionary.H"
37 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40 int main(int argc, char *argv[])
42 argList::noParallel();
43 argList::validOptions.insert("times", "");
44 argList::validOptions.insert("dictionary", "dictionary name");
45 argList::validOptions.insert("keywords", "");
46 argList::validOptions.insert("entry", "entry name");
48 # include "setRootCase.H"
52 if (args.optionFound("times"))
56 Foam::Time::findTimes(args.rootPath()/args.caseName())
61 Info<< times[i].name() << endl;
65 if (args.optionFound("dictionary"))
69 args.rootPath()/args.caseName()/args.option("dictionary")
72 IFstream dictFile(dictFileName);
76 dictionary dict(dictFile);
78 if (args.optionFound("keywords") && !args.optionFound("entry"))
82 IDLList<entry>::iterator iter = dict.begin();
87 Info<< iter().keyword() << endl;
90 else if (args.optionFound("entry"))
94 fileName(args.option("entry")).components(':')
97 if (dict.found(entryNames[0]))
99 const entry* entPtr = &dict.lookupEntry
106 for (int i=1; i<entryNames.size(); i++)
108 if (entPtr->dict().found(entryNames[i]))
110 entPtr = &entPtr->dict().lookupEntry
119 FatalErrorIn(args.executable())
120 << "Cannot find sub-entry " << entryNames[i]
121 << " in entry " << args.option("entry")
122 << " in dictionary " << dictFileName;
127 if (args.optionFound("keywords"))
130 if (ent[1] != token::BEGIN_BLOCK)
132 FatalErrorIn(args.executable())
133 << "Cannot find entry "
134 << args.option("entry")
135 << " in dictionary " << dictFileName
136 << " is not a sub-dictionary";
141 const dictionary& dict(entPtr->dict());
144 IDLList<entry>::const_iterator iter = dict.begin();
149 Info<< iter().keyword() << endl;
154 Info<< *entPtr << endl;
159 FatalErrorIn(args.executable())
160 << "Cannot find entry "
162 << " in dictionary " << dictFileName;
173 FatalErrorIn(args.executable())
174 << "Cannot open file " << dictFileName;
183 // ************************************************************************* //