Skip to content
Snippets Groups Projects
Commit 11752041 authored by Andrew Heather's avatar Andrew Heather
Browse files

Added option to change dictionary in /constant

  - could do with a 'nice' way to treat parent folders - constant, system, time dirs etc
parent 920fa49e
No related merge requests found
......@@ -72,10 +72,12 @@ namespace Foam
int main(int argc, char *argv[])
{
# include "addRegionOption.H"
# include "setRootCase.H"
# include "createTime.H"
# include "createNamedMesh.H"
argList::validOptions.insert("constant", "");
#include "addRegionOption.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createNamedMesh.H"
fileName regionPrefix = "";
if (regionName != fvMesh::defaultRegion)
......@@ -83,6 +85,8 @@ int main(int argc, char *argv[])
regionPrefix = regionName;
}
bool constant = args.options().found("constant");
// Get the replacement rules from a dictionary
IOdictionary dict
(
......@@ -196,12 +200,23 @@ int main(int argc, char *argv[])
Info<< "Loading dictionary " << fieldName << endl;
const word oldTypeName = IOdictionary::typeName;
const_cast<word&>(IOdictionary::typeName) = word::null;
word instance = "";
if (constant)
{
instance = runTime.constant();
}
else
{
instance = runTime.timeName();
}
IOdictionary fieldDict
(
IOobject
(
fieldName,
runTime.timeName(),
instance,
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE,
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment