From c91712fbc3c47b6b27573374301b0c6882b7d949 Mon Sep 17 00:00:00 2001 From: Andrew Heather Date: Fri, 29 Apr 2016 16:05:47 +0100 Subject: [PATCH] ENH: foamHelp solver - added option to read solver type from the system/controlDict. Fixes #37 --- .../foamHelp/helpTypes/helpSolver/helpSolver.C | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/applications/utilities/miscellaneous/foamHelp/helpTypes/helpSolver/helpSolver.C b/applications/utilities/miscellaneous/foamHelp/helpTypes/helpSolver/helpSolver.C index 116be3f552..cac59967c3 100644 --- a/applications/utilities/miscellaneous/foamHelp/helpTypes/helpSolver/helpSolver.C +++ b/applications/utilities/miscellaneous/foamHelp/helpTypes/helpSolver/helpSolver.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -25,6 +25,7 @@ License #include "helpSolver.H" #include "addToRunTimeSelectionTable.H" +#include "fvMesh.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -63,6 +64,11 @@ void Foam::helpTypes::helpSolver::init() helpType::init(); argList::validArgs.append("solver"); + argList::addBoolOption + ( + "read", + "read solver type from the system/controlDict" + ); } @@ -78,6 +84,11 @@ void Foam::helpTypes::helpSolver::execute { displayDoc(solver, ".*solvers/.*Foam/", true, "C"); } + else if (args.optionFound("read")) + { + mesh.time().controlDict().lookup("application") >> solver; + displayDoc(solver, ".*solvers/.*Foam/", true, "C"); + } else { displayDocOptions(".*solvers/.*Foam/", true, "C");