From 8431964bcbefbdf6f12ffad7f07eeda875bd5cac Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Thu, 5 Jul 2018 10:41:27 +0200 Subject: [PATCH] STYLE: mark compatibility level for keyword functionObjectLibs (issue #912) - was superseded by "libs" in 1612 --- .../functionObject/functionObject.C | 37 +++++++++++-------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C index da90401515..0b1fc37250 100644 --- a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C +++ b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C @@ -73,25 +73,30 @@ Foam::autoPtr Foam::functionObject::New Info<< "Selecting function " << functionType << endl; } - if (dict.found("functionObjectLibs")) + // Load any additional libraries { - const_cast(runTime).libs().open - ( - dict, - "functionObjectLibs", - dictionaryConstructorTablePtr_ - ); - } - else - { - const_cast(runTime).libs().open - ( - dict, - "libs", - dictionaryConstructorTablePtr_ - ); + const auto finder = + dict.csearchCompat("libs", {{"functionObjectLibs", 1612}}); + + if (finder.found()) + { + const_cast(runTime).libs().open + ( + dict, + finder.ref().keyword(), + dictionaryConstructorTablePtr_ + ); + } } + // This is the simplified version without compatibility messages + // const_cast(runTime).libs().open + // ( + // dict, + // "libs", + // dictionaryConstructorTablePtr_ + // ); + if (!dictionaryConstructorTablePtr_) { FatalErrorInFunction