fvOptions: Support reading the fvOptions file from constant or system directories

This commit is contained in:
Henry
2014-05-01 14:58:18 +01:00
committed by Andrew Heather
parent 17162a96cb
commit 1878a019db
4 changed files with 22 additions and 6 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -37,7 +37,7 @@ Foam::IOobject Foam::fv::IOoptionList::createIOobject
IOobject io
(
"fvOptions",
mesh.time().system(),
mesh.time().constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
@ -45,7 +45,22 @@ Foam::IOobject Foam::fv::IOoptionList::createIOobject
if (io.headerOk())
{
Info<< "Creating finite volume options from " << io.name() << nl
Info<< "Creating finite volume options from "
<< io.instance()/io.name() << nl
<< endl;
io.readOpt() = IOobject::MUST_READ_IF_MODIFIED;
return io;
}
else
{
// Check if the fvOptions file is in system
io.instance() = mesh.time().system();
if (io.headerOk())
{
Info<< "Creating finite volume options from "
<< io.instance()/io.name() << nl
<< endl;
io.readOpt() = IOobject::MUST_READ_IF_MODIFIED;
@ -58,6 +73,7 @@ Foam::IOobject Foam::fv::IOoptionList::createIOobject
io.readOpt() = IOobject::NO_READ;
return io;
}
}
}