helpSolver.C
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2015 OpenFOAM Foundation
9 Copyright (C) 2016 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27\*---------------------------------------------------------------------------*/
28
29#include "helpSolver.H"
31#include "fvMesh.H"
32
33// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34
35namespace Foam
36{
37 namespace helpTypes
38 {
41 (
42 helpType,
44 dictionary,
45 solver
46 );
47 }
48}
49
50
51// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
52
54{}
55
56
57// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
58
60{}
61
62
63// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
64
66{
68
70 (
71 "read",
72 "Read solver type from the system/controlDict"
73 );
74}
75
76
78(
79 const argList& args,
80 const fvMesh& mesh
81)
82{
83 word solver(word::null);
84
85 if (args.readIfPresent("browse", solver))
86 {
87 displayDoc(solver, ".*solvers/.*Foam/", true, "C");
88 }
89 else if (args.found("read"))
90 {
91 mesh.time().controlDict().readEntry("application", solver);
92 displayDoc(solver, ".*solvers/.*Foam/", true, "C");
93 }
94 else
95 {
96 displayDocOptions(".*solvers/.*Foam/", true, "C");
97 }
98}
99
100
101// ************************************************************************* //
Macros for easy insertion into run-time selection tables.
#define addNamedToRunTimeSelectionTable(baseType, thisType, argNames, lookupName)
Add to construction table with 'lookupName' as the key.
bool found(const word &optName) const
Return true if the named option is found.
Definition: argListI.H:178
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
Add a bool option to validOptions with usage information.
Definition: argList.C:324
bool readIfPresent(const word &optName, T &val) const
Read a value from the named option if present.
Definition: argListI.H:323
virtual bool execute()
Calculate the output fields.
This class provides help for solvers. When no additional arguments are given, the utility outputs all...
virtual void init()
Initialise - typically setting static variables,.
virtual ~helpSolver()
Destructor.
virtual void init()
Initialise - typically setting static variables,.
static const word null
An empty word.
Definition: word.H:80
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition: className.H:121
dynamicFvMesh & mesh
Namespace for OpenFOAM.
Foam::argList args(argc, argv)