mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Added option to change dictionary in /constant
- could do with a 'nice' way to treat parent folders - constant, system, time dirs etc
This commit is contained in:
@ -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,
|
||||
|
||||
Reference in New Issue
Block a user