From e63cc43dfae0295b4722b2b490559bbb81e83e89 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Tue, 30 Apr 2019 15:43:38 +0100 Subject: [PATCH] Reverting unnecessary DLB change by HR --- .../finiteVolume/fvSchemes/fvSchemes.C | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/finiteVolume/finiteVolume/fvSchemes/fvSchemes.C b/src/finiteVolume/finiteVolume/fvSchemes/fvSchemes.C index b0533cd44..c9050cd4d 100644 --- a/src/finiteVolume/finiteVolume/fvSchemes/fvSchemes.C +++ b/src/finiteVolume/finiteVolume/fvSchemes/fvSchemes.C @@ -70,12 +70,7 @@ Foam::fvSchemes::fvSchemes(const objectRegistry& obr) "fvSchemes", obr.time().system(), obr, - ( - obr.readOpt() == IOobject::MUST_READ - || obr.readOpt() == IOobject::READ_IF_PRESENT - ? IOobject::MUST_READ_IF_MODIFIED - : obr.readOpt() - ), + IOobject::READ_IF_PRESENT_IF_MODIFIED, // Allow default dictionary creation IOobject::NO_WRITE ) ), @@ -173,17 +168,21 @@ Foam::fvSchemes::fvSchemes(const objectRegistry& obr) fluxRequired_(), // Do not read flux required option defaultFluxRequired_(false) { - // HR 21.12.18 : Writing a default fvSchemes is not useful in PLB. Please - // specify MUST_READ on obr if you need this. - if - ( - readOpt() == IOobject::MUST_READ - || readOpt() == IOobject::MUST_READ_IF_MODIFIED - || (readOpt() == IOobject::READ_IF_PRESENT && headerOk()) - ) + if (!headerOk()) { - read(); + if (debug) + { + InfoIn + ( + "fvSchemes::fvSchemes(const objectRegistry& obr)" + ) << "fvSchemes dictionary not found. Creating default." + << endl; + } + + regIOobject::write(); } + + read(); }