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 \\ / 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-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -37,7 +37,7 @@ Foam::IOobject Foam::fv::IOoptionList::createIOobject
IOobject io IOobject io
( (
"fvOptions", "fvOptions",
mesh.time().system(), mesh.time().constant(),
mesh, mesh,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE IOobject::NO_WRITE
@ -45,7 +45,8 @@ Foam::IOobject Foam::fv::IOoptionList::createIOobject
if (io.headerOk()) if (io.headerOk())
{ {
Info<< "Creating finite volume options from " << io.name() << nl Info<< "Creating finite volume options from "
<< io.instance()/io.name() << nl
<< endl; << endl;
io.readOpt() = IOobject::MUST_READ_IF_MODIFIED; io.readOpt() = IOobject::MUST_READ_IF_MODIFIED;
@ -53,10 +54,25 @@ Foam::IOobject Foam::fv::IOoptionList::createIOobject
} }
else else
{ {
Info<< "No finite volume options present" << nl << endl; // Check if the fvOptions file is in system
io.instance() = mesh.time().system();
io.readOpt() = IOobject::NO_READ; if (io.headerOk())
return io; {
Info<< "Creating finite volume options from "
<< io.instance()/io.name() << nl
<< endl;
io.readOpt() = IOobject::MUST_READ_IF_MODIFIED;
return io;
}
else
{
Info<< "No finite volume options present" << nl << endl;
io.readOpt() = IOobject::NO_READ;
return io;
}
} }
} }