simpleFoam: Added experimental "-postProcess" option

Executes application functionObjects to post-process existing results.

    If the "dict" argument is specified the functionObjectList is constructed
    from that dictionary otherwise the functionObjectList is constructed from
    the "functions" sub-dictionary of "system/controlDict"

    Multiple time-steps may be processed and the standard utility time
    controls are provided.

This functionality is equivalent to execFlowFunctionObjects but in a
more efficient and general manner and will be included in all the
OpenFOAM solvers if it proves effective and maintainable.

The command-line options available with the "-postProcess" option may be
obtained by

simpleFoam -help -postProcess

Usage: simpleFoam [OPTIONS]
options:
  -case <dir>       specify alternate case directory, default is the cwd
  -constant         include the 'constant/' dir in the times list
  -dict <file>      read control dictionary from specified location
  -latestTime       select the latest time
  -newTimes         select the new times
  -noFunctionObjects
                    do not execute functionObjects
  -noZero           exclude the '0/' dir from the times list, has precedence
                    over the -withZero option
  -parallel         run in parallel
  -postProcess      Execute functionObjects only
  -region <name>    specify alternative mesh region
  -roots <(dir1 .. dirN)>
                    slave root directories for distributed running
  -time <ranges>    comma-separated time ranges - eg, ':10,20,40:70,1000:'
  -srcDoc           display source code in browser
  -doc              display application documentation in browser
  -help             print the usage

Henry G. Weller
CFD Direct Ltd.
This commit is contained in:
Henry Weller
2016-05-08 09:33:46 +01:00
parent c1a89ad040
commit 30e2f912e5
15 changed files with 277 additions and 102 deletions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -41,12 +41,12 @@ Description
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
#include "postProcess.H"
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
#include "createMesh.H" #include "createMesh.H"
#include "createControls.H"
simpleControl simple(mesh);
#include "createFields.H" #include "createFields.H"
#include "createFvOptions.H" #include "createFvOptions.H"
#include "initContinuityErrs.H" #include "initContinuityErrs.H"

View File

@ -0,0 +1 @@
simpleControl simple(mesh);

View File

@ -41,3 +41,5 @@ autoPtr<incompressible::turbulenceModel> turbulence
( (
incompressible::turbulenceModel::New(U, phi, laminarTransport) incompressible::turbulenceModel::New(U, phi, laminarTransport)
); );
#include "createMRF.H"

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -42,14 +42,14 @@ Description
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
#define CREATE_FIELDS_2 createPorousZones.H
#include "postProcess.H"
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
#include "createMesh.H" #include "createMesh.H"
#include "createControls.H"
simpleControl simple(mesh);
#include "createFields.H" #include "createFields.H"
#include "createMRF.H"
#include "createPorousZones.H" #include "createPorousZones.H"
#include "createFvOptions.H" #include "createFvOptions.H"
#include "initContinuityErrs.H" #include "initContinuityErrs.H"

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -39,14 +39,13 @@ Description
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
#include "postProcess.H"
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
#include "createMesh.H" #include "createMesh.H"
#include "createControls.H"
simpleControl simple(mesh);
#include "createFields.H" #include "createFields.H"
#include "createMRF.H"
#include "createFvOptions.H" #include "createFvOptions.H"
#include "initContinuityErrs.H" #include "initContinuityErrs.H"

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -26,6 +26,7 @@ License
#include "functionObjectList.H" #include "functionObjectList.H"
#include "Time.H" #include "Time.H"
#include "mapPolyMesh.H" #include "mapPolyMesh.H"
#include "argList.H"
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
@ -92,6 +93,42 @@ Foam::functionObjectList::functionObjectList
{} {}
Foam::autoPtr<Foam::functionObjectList> Foam::functionObjectList::New
(
const argList& args,
const Time& runTime,
dictionary& functionObjectsDict
)
{
autoPtr<functionObjectList> functionObjectsPtr;
if (args.optionFound("dict"))
{
functionObjectsDict = IOdictionary
(
IOobject
(
args["dict"],
runTime,
IOobject::MUST_READ_IF_MODIFIED
)
);
functionObjectsPtr.reset
(
new functionObjectList(runTime, functionObjectsDict)
);
}
else
{
functionObjectsPtr.reset(new functionObjectList(runTime));
}
functionObjectsPtr->start();
return functionObjectsPtr;
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjectList::~functionObjectList() Foam::functionObjectList::~functionObjectList()

View File

@ -50,6 +50,7 @@ namespace Foam
{ {
class mapPolyMesh; class mapPolyMesh;
class argList;
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class functionObjectList Declaration Class functionObjectList Declaration
@ -107,7 +108,6 @@ public:
const bool execution=true const bool execution=true
); );
//- Construct from Time, a dictionary with "functions" entry //- Construct from Time, a dictionary with "functions" entry
// and the execution setting. // and the execution setting.
// \param[in] t - the other Time instance to construct from // \param[in] t - the other Time instance to construct from
@ -123,6 +123,19 @@ public:
const bool execution=true const bool execution=true
); );
//- Construct and return a functionObjectList for an application.
//
// If the "dict" argument is specified the functionObjectList is
// constructed from that dictionary which is returned as
// functionObjectsDict otherwise the functionObjectList is constructed
// from the "functions" sub-dictionary of "system/controlDict"
static autoPtr<functionObjectList> New
(
const argList& args,
const Time& runTime,
dictionary& functionObjectsDict
);
//- Destructor //- Destructor
virtual ~functionObjectList(); virtual ~functionObjectList();

View File

@ -0,0 +1,138 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Global
postProcess
Description
Execute application functionObjects to post-process existing results.
If the "dict" argument is specified the functionObjectList is constructed
from that dictionary otherwise the functionObjectList is constructed from
the "functions" sub-dictionary of "system/controlDict"
Multiple time-steps may be processed and the standard utility time
controls are provided.
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifndef CREATE_MESH
#define CREATE_MESH createMesh.H
#endif
#ifndef CREATE_FIELDS_1
#define CREATE_FIELDS_1 createFields.H
#endif
#ifndef CREATE_CONTROLS
#define CREATE_CONTROLS createControls.H
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define INCLUDE_FILE(X) INCLUDE_FILE2(X)
#define INCLUDE_FILE2(X) #X
Foam::argList::addBoolOption
(
argList::postProcessOptionName,
"Execute functionObjects only"
);
if (argList::postProcess(argc, argv))
{
Foam::timeSelector::addOptions();
#include "addRegionOption.H"
#include "addDictOption.H"
#include "setRootCase.H"
#include "createTime.H"
Foam::instantList timeDirs = Foam::timeSelector::select0(runTime, args);
#include INCLUDE_FILE(CREATE_MESH)
#include INCLUDE_FILE(CREATE_CONTROLS)
// Externally stored dictionary for functionObjectList
// if not constructed from runTime
dictionary functionObjectsDict;
// Construct functionObjectList
autoPtr<functionObjectList> functionObjectsPtr
(
functionObjectList::New(args, runTime, functionObjectsDict)
);
forAll(timeDirs, timeI)
{
runTime.setTime(timeDirs[timeI], timeI);
Info<< "Time = " << runTime.timeName() << endl;
if (mesh.readUpdate() != polyMesh::UNCHANGED)
{
// Update functionObjects if mesh changes
functionObjectsPtr =
functionObjectList::New(args, runTime, functionObjectsDict);
}
#include INCLUDE_FILE(CREATE_FIELDS_1)
#ifdef CREATE_FIELDS_2
#include INCLUDE_FILE(CREATE_FIELDS_2)
#endif
#ifdef CREATE_FIELDS_3
#include INCLUDE_FILE(CREATE_FIELDS_3)
#endif
FatalIOError.throwExceptions();
try
{
functionObjectsPtr->execute(true);
}
catch (IOerror& err)
{
Warning<< err << endl;
}
Info<< endl;
}
Info<< "End\n" << endl;
return 0;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#undef INCLUDE_FILE
#undef INCLUDE_FILE2
#undef CREATE_MESH
#undef CREATE_FIELDS_1
#undef CREATE_CONTROLS
// ************************************************************************* //

View File

@ -46,7 +46,7 @@ Foam::HashTable<Foam::string> Foam::argList::optionUsage;
Foam::SLList<Foam::string> Foam::argList::notes; Foam::SLList<Foam::string> Foam::argList::notes;
Foam::string::size_type Foam::argList::usageMin = 20; Foam::string::size_type Foam::argList::usageMin = 20;
Foam::string::size_type Foam::argList::usageMax = 80; Foam::string::size_type Foam::argList::usageMax = 80;
Foam::word Foam::argList::postProcessOptionName("postProcess");
Foam::argList::initValidTables::initValidTables() Foam::argList::initValidTables::initValidTables()
{ {
@ -162,7 +162,7 @@ void Foam::argList::printOptionUsage
if (strLen) if (strLen)
{ {
// minimum of 2 spaces between option and usage: // Minimum of 2 spaces between option and usage:
if (string::size_type(location) + 2 <= usageMin) if (string::size_type(location) + 2 <= usageMin)
{ {
for (string::size_type i = location; i < usageMin; ++i) for (string::size_type i = location; i < usageMin; ++i)
@ -180,31 +180,31 @@ void Foam::argList::printOptionUsage
} }
} }
// text wrap // Text wrap
string::size_type pos = 0; string::size_type pos = 0;
while (pos != string::npos && pos + textWidth < strLen) while (pos != string::npos && pos + textWidth < strLen)
{ {
// potential end point and next point // Potential end point and next point
string::size_type curr = pos + textWidth - 1; string::size_type curr = pos + textWidth - 1;
string::size_type next = string::npos; string::size_type next = string::npos;
if (isspace(str[curr])) if (isspace(str[curr]))
{ {
// we were lucky: ended on a space // We were lucky: ended on a space
next = str.find_first_not_of(" \t\n", curr); next = str.find_first_not_of(" \t\n", curr);
} }
else if (isspace(str[curr+1])) else if (isspace(str[curr+1]))
{ {
// the next one is a space - so we are okay // The next one is a space - so we are okay
curr++; // otherwise the length is wrong curr++; // otherwise the length is wrong
next = str.find_first_not_of(" \t\n", curr); next = str.find_first_not_of(" \t\n", curr);
} }
else else
{ {
// search for end of a previous word break // Search for end of a previous word break
string::size_type prev = str.find_last_of(" \t\n", curr); string::size_type prev = str.find_last_of(" \t\n", curr);
// reposition to the end of previous word if possible // Reposition to the end of previous word if possible
if (prev != string::npos && prev > pos) if (prev != string::npos && prev > pos)
{ {
curr = prev; curr = prev;
@ -216,7 +216,7 @@ void Foam::argList::printOptionUsage
next = curr + 1; next = curr + 1;
} }
// indent following lines (not the first one) // Indent following lines (not the first one)
if (pos) if (pos)
{ {
for (string::size_type i = 0; i < usageMin; ++i) for (string::size_type i = 0; i < usageMin; ++i)
@ -229,10 +229,10 @@ void Foam::argList::printOptionUsage
pos = next; pos = next;
} }
// output the remainder of the string // Output the remainder of the string
if (pos != string::npos) if (pos != string::npos)
{ {
// indent following lines (not the first one) // Indent following lines (not the first one)
if (pos) if (pos)
{ {
for (string::size_type i = 0; i < usageMin; ++i) for (string::size_type i = 0; i < usageMin; ++i)
@ -251,17 +251,31 @@ void Foam::argList::printOptionUsage
} }
bool Foam::argList::postProcess(int argc, char *argv[])
{
bool postProcessOption = false;
for (int i=1; i<argc; i++)
{
postProcessOption = argv[i] == '-' + postProcessOptionName;
if (postProcessOption) break;
}
return postProcessOption;
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// convert argv -> args_ // Convert argv -> args_
// transform sequences with "(" ... ")" into string lists in the process // Transform sequences with "(" ... ")" into string lists in the process
bool Foam::argList::regroupArgv(int& argc, char**& argv) bool Foam::argList::regroupArgv(int& argc, char**& argv)
{ {
int nArgs = 0; int nArgs = 0;
int listDepth = 0; int listDepth = 0;
string tmpString; string tmpString;
// note: we also re-write directly into args_ // Note: we also re-write directly into args_
// and use a second pass to sort out args/options // and use a second pass to sort out args/options
for (int argI = 0; argI < argc; ++argI) for (int argI = 0; argI < argc; ++argI)
{ {
@ -289,7 +303,7 @@ bool Foam::argList::regroupArgv(int& argc, char**& argv)
} }
else if (listDepth) else if (listDepth)
{ {
// quote each string element // Quote each string element
tmpString += "\""; tmpString += "\"";
tmpString += argv[argI]; tmpString += argv[argI];
tmpString += "\""; tmpString += "\"";
@ -325,20 +339,20 @@ void Foam::argList::getRootCase()
if (casePath.empty() || casePath == ".") if (casePath.empty() || casePath == ".")
{ {
// handle degenerate form and '-case .' like no -case specified // Handle degenerate form and '-case .' like no -case specified
casePath = cwd(); casePath = cwd();
options_.erase("case"); options_.erase("case");
} }
else if (!casePath.isAbsolute() && casePath.name() == "..") else if (!casePath.isAbsolute() && casePath.name() == "..")
{ {
// avoid relative cases ending in '..' - makes for very ugly names // Avoid relative cases ending in '..' - makes for very ugly names
casePath = cwd()/casePath; casePath = cwd()/casePath;
casePath.clean(); casePath.clean();
} }
} }
else else
{ {
// nothing specified, use the current dir // Nothing specified, use the current dir
casePath = cwd(); casePath = cwd();
} }
@ -350,13 +364,13 @@ void Foam::argList::getRootCase()
// Set the case and case-name as an environment variable // Set the case and case-name as an environment variable
if (rootPath_.isAbsolute()) if (rootPath_.isAbsolute())
{ {
// absolute path - use as-is // Absolute path - use as-is
setEnv("FOAM_CASE", rootPath_/globalCase_, true); setEnv("FOAM_CASE", rootPath_/globalCase_, true);
setEnv("FOAM_CASENAME", globalCase_, true); setEnv("FOAM_CASENAME", globalCase_, true);
} }
else else
{ {
// qualify relative path // Qualify relative path
casePath = cwd()/rootPath_/globalCase_; casePath = cwd()/rootPath_/globalCase_;
casePath.clean(); casePath.clean();
@ -396,7 +410,7 @@ Foam::argList::argList
} }
} }
// convert argv -> args_ and capture ( ... ) lists // Convert argv -> args_ and capture ( ... ) lists
// for normal arguments and for options // for normal arguments and for options
regroupArgv(argc, argv); regroupArgv(argc, argv);
@ -509,7 +523,7 @@ void Foam::argList::parse
printUsage(); printUsage();
} }
// only display one or the other // Only display one or the other
if (options_.found("srcDoc")) if (options_.found("srcDoc"))
{ {
displayDoc(true); displayDoc(true);
@ -556,7 +570,7 @@ void Foam::argList::parse
jobInfo.add("PPID", ppid()); jobInfo.add("PPID", ppid());
jobInfo.add("PGID", pgid()); jobInfo.add("PGID", pgid());
// add build information - only use the first word // Add build information - only use the first word
{ {
std::string build(Foam::FOAMbuild); std::string build(Foam::FOAMbuild);
std::string::size_type found = build.find(' '); std::string::size_type found = build.find(' ');
@ -581,7 +595,7 @@ void Foam::argList::parse
// For the master // For the master
if (Pstream::master()) if (Pstream::master())
{ {
// establish rootPath_/globalCase_/case_ for master // Establish rootPath_/globalCase_/case_ for master
getRootCase(); getRootCase();
// See if running distributed (different roots for different procs) // See if running distributed (different roots for different procs)
@ -625,7 +639,7 @@ void Foam::argList::parse
} }
} }
// convenience: // Convenience:
// when a single root is specified, use it for all processes // when a single root is specified, use it for all processes
if (roots.size() == 1) if (roots.size() == 1)
{ {
@ -660,7 +674,7 @@ void Foam::argList::parse
} }
// distributed data // Distributed data
if (roots.size()) if (roots.size())
{ {
if (roots.size() != Pstream::nProcs()-1) if (roots.size() != Pstream::nProcs()-1)
@ -694,7 +708,7 @@ void Foam::argList::parse
} }
options_.erase("case"); options_.erase("case");
// restore [-case dir] // Restore [-case dir]
if (hadCaseOpt) if (hadCaseOpt)
{ {
options_.set("case", rootPath_/globalCase_); options_.set("case", rootPath_/globalCase_);
@ -747,7 +761,7 @@ void Foam::argList::parse
IPstream fromMaster(Pstream::scheduled, Pstream::masterNo()); IPstream fromMaster(Pstream::scheduled, Pstream::masterNo());
fromMaster >> args_ >> options_; fromMaster >> args_ >> options_;
// establish rootPath_/globalCase_/case_ for slave // Establish rootPath_/globalCase_/case_ for slave
getRootCase(); getRootCase();
} }
@ -756,7 +770,7 @@ void Foam::argList::parse
} }
else else
{ {
// establish rootPath_/globalCase_/case_ // Establish rootPath_/globalCase_/case_
getRootCase(); getRootCase();
case_ = globalCase_; case_ = globalCase_;
} }
@ -764,7 +778,7 @@ void Foam::argList::parse
stringList slaveProcs; stringList slaveProcs;
// collect slave machine/pid // Collect slave machine/pid
if (parRunControl_.parRun()) if (parRunControl_.parRun())
{ {
if (Pstream::master()) if (Pstream::master())
@ -884,10 +898,10 @@ bool Foam::argList::setOption(const word& opt, const string& param)
{ {
bool changed = false; bool changed = false;
// only allow valid options // Only allow valid options
if (validOptions.found(opt)) if (validOptions.found(opt))
{ {
// some options are to be protected // Some options are to be protected
if if
( (
opt == "case" opt == "case"
@ -903,10 +917,10 @@ bool Foam::argList::setOption(const word& opt, const string& param)
if (validOptions[opt].empty()) if (validOptions[opt].empty())
{ {
// bool option // Bool option
if (!param.empty()) if (!param.empty())
{ {
// disallow change of type // Disallow change of type
FatalError FatalError
<<"used argList::setOption to change bool to non-bool: '" <<"used argList::setOption to change bool to non-bool: '"
<< opt << "'" << endl; << opt << "'" << endl;
@ -914,16 +928,16 @@ bool Foam::argList::setOption(const word& opt, const string& param)
} }
else else
{ {
// did not previously exist // Did not previously exist
changed = !options_.found(opt); changed = !options_.found(opt);
} }
} }
else else
{ {
// non-bool option // Non-bool option
if (param.empty()) if (param.empty())
{ {
// disallow change of type // Disallow change of type
FatalError FatalError
<<"used argList::setOption to change non-bool to bool: '" <<"used argList::setOption to change non-bool to bool: '"
<< opt << "'" << endl; << opt << "'" << endl;
@ -931,7 +945,7 @@ bool Foam::argList::setOption(const word& opt, const string& param)
} }
else else
{ {
// existing value needs changing, or did not previously exist // Existing value needs changing, or did not previously exist
changed = options_.found(opt) ? options_[opt] != param : true; changed = options_.found(opt) ? options_[opt] != param : true;
} }
} }
@ -945,7 +959,7 @@ bool Foam::argList::setOption(const word& opt, const string& param)
FatalError.exit(); FatalError.exit();
} }
// set/change the option as required // Set/change the option as required
if (changed) if (changed)
{ {
options_.set(opt, param); options_.set(opt, param);
@ -957,10 +971,10 @@ bool Foam::argList::setOption(const word& opt, const string& param)
bool Foam::argList::unsetOption(const word& opt) bool Foam::argList::unsetOption(const word& opt)
{ {
// only allow valid options // Only allow valid options
if (validOptions.found(opt)) if (validOptions.found(opt))
{ {
// some options are to be protected // Some options are to be protected
if if
( (
opt == "case" opt == "case"
@ -974,7 +988,7 @@ bool Foam::argList::unsetOption(const word& opt)
FatalError.exit(); FatalError.exit();
} }
// remove the option, return true if state changed // Remove the option, return true if state changed
return options_.erase(opt); return options_.erase(opt);
} }
else else
@ -992,7 +1006,7 @@ bool Foam::argList::unsetOption(const word& opt)
void Foam::argList::printNotes() const void Foam::argList::printNotes() const
{ {
// output notes directly - no automatic text wrapping // Output notes directly - no automatic text wrapping
if (!notes.empty()) if (!notes.empty())
{ {
Info<< nl; Info<< nl;
@ -1022,11 +1036,11 @@ void Foam::argList::printUsage() const
HashTable<string>::const_iterator iter = validOptions.find(optionName); HashTable<string>::const_iterator iter = validOptions.find(optionName);
Info<< " -" << optionName; Info<< " -" << optionName;
label len = optionName.size() + 3; // length includes leading ' -' label len = optionName.size() + 3; // Length includes leading ' -'
if (iter().size()) if (iter().size())
{ {
// length includes space and between option/param and '<>' // Length includes space and between option/param and '<>'
len += iter().size() + 3; len += iter().size() + 3;
Info<< " <" << iter().c_str() << '>'; Info<< " <" << iter().c_str() << '>';
} }
@ -1048,9 +1062,7 @@ void Foam::argList::printUsage() const
} }
} }
// // Place srcDoc/doc/help options at the end
// place srcDoc/doc/help options at the end
//
Info<< " -srcDoc"; Info<< " -srcDoc";
printOptionUsage printOptionUsage
( (
@ -1089,7 +1101,7 @@ void Foam::argList::displayDoc(bool source) const
List<fileName> docDirs(docDict.lookup("doxyDocDirs")); List<fileName> docDirs(docDict.lookup("doxyDocDirs"));
List<fileName> docExts(docDict.lookup("doxySourceFileExts")); List<fileName> docExts(docDict.lookup("doxySourceFileExts"));
// for source code: change foo_8C.html to foo_8C_source.html // For source code: change foo_8C.html to foo_8C_source.html
if (source) if (source)
{ {
forAll(docExts, extI) forAll(docExts, extI)
@ -1127,7 +1139,7 @@ void Foam::argList::displayDoc(bool source) const
{ {
docDict.lookup("docBrowser") >> docBrowser; docDict.lookup("docBrowser") >> docBrowser;
} }
// can use FOAM_DOC_BROWSER='application file://%f' if required // Can use FOAM_DOC_BROWSER='application file://%f' if required
docBrowser.replaceAll("%f", docFile); docBrowser.replaceAll("%f", docFile);
Info<< "Show documentation: " << docBrowser.c_str() << endl; Info<< "Show documentation: " << docBrowser.c_str() << endl;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -172,6 +172,9 @@ public:
//- Max screen width for displaying usage (default: 80) //- Max screen width for displaying usage (default: 80)
static string::size_type usageMax; static string::size_type usageMax;
//- Standard name for the post-processing option
static word postProcessOptionName;
//! \cond internalClass //! \cond internalClass
class initValidTables class initValidTables
{ {
@ -367,6 +370,8 @@ public:
//- Remove the parallel options //- Remove the parallel options
static void noParallel(); static void noParallel();
//- Return true if the post-processing option is specified
static bool postProcess(int argc, char *argv[]);
//- Set option directly (use with caution) //- Set option directly (use with caution)
// An option with an empty param is a bool option. // An option with an empty param is a bool option.

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -29,9 +29,6 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef compressibleCreatePhi_H
#define compressibleCreatePhi_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "Reading/calculating face flux field phi\n" << endl; Info<< "Reading/calculating face flux field phi\n" << endl;
@ -49,8 +46,5 @@ surfaceScalarField phi
linearInterpolate(rho*U) & mesh.Sf() linearInterpolate(rho*U) & mesh.Sf()
); );
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -29,9 +29,6 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef createRhoUf_H
#define createRhoUf_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "Reading/calculating face velocity rhoUf\n" << endl; Info<< "Reading/calculating face velocity rhoUf\n" << endl;
@ -50,8 +47,4 @@ surfaceVectorField rhoUf
); );
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* // // ************************************************************************* //

View File

@ -29,9 +29,6 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef createPhi_H
#define createPhi_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "Reading/calculating face flux field phi\n" << endl; Info<< "Reading/calculating face flux field phi\n" << endl;
@ -49,8 +46,5 @@ surfaceScalarField phi
fvc::flux(U) fvc::flux(U)
); );
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* // // ************************************************************************* //

View File

@ -29,9 +29,6 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef createPhiv_H
#define createPhiv_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "Reading/calculating face flux field phiv\n" << endl; Info<< "Reading/calculating face flux field phiv\n" << endl;
@ -49,8 +46,5 @@ surfaceScalarField phiv
flux(U) flux(U)
); );
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -29,9 +29,6 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef createUf_H
#define createUf_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "Reading/calculating face velocity Uf\n" << endl; Info<< "Reading/calculating face velocity Uf\n" << endl;
@ -50,8 +47,4 @@ surfaceVectorField Uf
); );
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* // // ************************************************************************* //