mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
fvOptions: Support reading the fvOptions file from constant or system directories
This commit is contained in:
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user