From 3a6e4274097862cb8da26fe804ee7a500dd761d6 Mon Sep 17 00:00:00 2001
From: Mark Olesen <Mark.Olesen@esi-group.com>
Date: Wed, 28 Sep 2022 09:24:46 +0200
Subject: [PATCH] ENH: simplify dictionary search for value/refValue in BCs

- in expressions BCs in particular, there is various logic handling
  for if value/refValue/refGradient etc are found or not.

  Handle the lookups as findEntry and branch to use Field assign
  or other handling, depending on its existence.

STYLE: use wordList instead of wordRes for copy/filter dictionary
---
 .../db/IOstreams/IOstreams/IOstreamOption.H   |  4 +-
 .../dictionaryContent/dictionaryContent.H     |  5 ++-
 .../expressions/exprResult/exprResult.C       | 17 ++++----
 .../expressions/exprResult/exprResult.H       | 11 +++---
 .../expressions/exprResult/exprResultI.H      |  9 ++---
 .../basic/value/valuePointPatchField.C        |  6 +--
 .../uniformInterpolationTable.H               |  8 ++--
 .../uniformInterpolationTableI.H              |  8 ++--
 src/OpenFOAM/primitives/bools/Switch/Switch.C |  4 +-
 src/OpenFOAM/primitives/bools/Switch/Switch.H | 14 +++----
 .../faPatchFields/faPatchField/faPatchField.C |  6 +--
 .../faePatchField/faePatchField.C             |  6 +--
 .../exprFixedValueFvPatchField.C              | 15 ++++---
 .../fvPatchFields/exprMixedFvPatchField.C     | 39 +++++++++++--------
 .../exprValuePointPatchField.C                | 23 +++++------
 .../exprValuePointPatchField.H                |  4 +-
 .../fvPatchFields/fvPatchField/fvPatchField.C |  6 +--
 .../fvsPatchField/fvsPatchField.C             |  8 ++--
 .../velocityFilmShellFvPatchVectorField.C     |  4 +-
 .../thermalShellFvPatchScalarField.C          |  4 +-
 .../vibrationShellFvPatchScalarField.C        |  4 +-
 21 files changed, 106 insertions(+), 99 deletions(-)

diff --git a/src/OpenFOAM/db/IOstreams/IOstreams/IOstreamOption.H b/src/OpenFOAM/db/IOstreams/IOstreams/IOstreamOption.H
index b1ae05ac4fa..e952058dc46 100644
--- a/src/OpenFOAM/db/IOstreams/IOstreams/IOstreamOption.H
+++ b/src/OpenFOAM/db/IOstreams/IOstreams/IOstreamOption.H
@@ -42,8 +42,8 @@ SourceFiles
 
 \*---------------------------------------------------------------------------*/
 
-#ifndef IOstreamOption_H
-#define IOstreamOption_H
+#ifndef Foam_IOstreamOption_H
+#define Foam_IOstreamOption_H
 
 #include "word.H"
 
diff --git a/src/OpenFOAM/db/dictionary/dictionaryContent/dictionaryContent.H b/src/OpenFOAM/db/dictionary/dictionaryContent/dictionaryContent.H
index c1137f1eef1..2d5ed67ea17 100644
--- a/src/OpenFOAM/db/dictionary/dictionaryContent/dictionaryContent.H
+++ b/src/OpenFOAM/db/dictionary/dictionaryContent/dictionaryContent.H
@@ -32,10 +32,11 @@ Description
 
 \*---------------------------------------------------------------------------*/
 
-#ifndef dictionaryContent_H
-#define dictionaryContent_H
+#ifndef Foam_dictionaryContent_H
+#define Foam_dictionaryContent_H
 
 #include "dictionary.H"
+#include "wordList.H"
 #include "wordRes.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/OpenFOAM/expressions/exprResult/exprResult.C b/src/OpenFOAM/expressions/exprResult/exprResult.C
index 296cb3f7b9d..5b013566ed0 100644
--- a/src/OpenFOAM/expressions/exprResult/exprResult.C
+++ b/src/OpenFOAM/expressions/exprResult/exprResult.C
@@ -254,8 +254,11 @@ Foam::expressions::exprResult::exprResult
 {
     DebugInFunction << nl;
 
-    if (dict.found("value"))
+    const auto* hasValue = dict.findEntry("value", keyType::LITERAL);
+
+    if (hasValue)
     {
+        const auto& valueEntry = *hasValue;
         const bool uniform = isUniform_;
 
         const label len =
@@ -268,12 +271,12 @@ Foam::expressions::exprResult::exprResult
         const bool ok =
         (
             // Just use <scalar> for <label>?
-            readChecked<scalar>("value", dict, len, uniform)
-         || readChecked<vector>("value", dict, len, uniform)
-         || readChecked<tensor>("value", dict, len, uniform)
-         || readChecked<symmTensor>("value", dict, len, uniform)
-         || readChecked<sphericalTensor>("value", dict, len, uniform)
-         || readChecked<bool>("value", dict, len, uniform)
+            readChecked<scalar>(valueEntry, len, uniform)
+         || readChecked<vector>(valueEntry, len, uniform)
+         || readChecked<tensor>(valueEntry, len, uniform)
+         || readChecked<symmTensor>(valueEntry, len, uniform)
+         || readChecked<sphericalTensor>(valueEntry, len, uniform)
+         || readChecked<bool>(valueEntry, len, uniform)
         );
 
         if (!ok)
diff --git a/src/OpenFOAM/expressions/exprResult/exprResult.H b/src/OpenFOAM/expressions/exprResult/exprResult.H
index 793381351fd..c570f1569e6 100644
--- a/src/OpenFOAM/expressions/exprResult/exprResult.H
+++ b/src/OpenFOAM/expressions/exprResult/exprResult.H
@@ -6,7 +6,7 @@
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
     Copyright (C) 2012-2018 Bernhard Gschaider
-    Copyright (C) 2019-2021 OpenCFD Ltd.
+    Copyright (C) 2019-2022 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -54,8 +54,8 @@ SourceFiles
 
 \*---------------------------------------------------------------------------*/
 
-#ifndef expressions_exprResult_H
-#define expressions_exprResult_H
+#ifndef Foam_expressions_exprResult_H
+#define Foam_expressions_exprResult_H
 
 #include "exprTraits.H"
 #include "dimensionedType.H"
@@ -156,13 +156,12 @@ class exprResult
         //- Dispatch to type-checked pointer deletion
         void uglyDelete();
 
-        //- Type-checked creation of field from dictionary
+        //- Type-checked creation of field from dictionary (primitive) entry
         //  \return True if the type check was satisfied
         template<class Type>
         inline bool readChecked
         (
-            const word& key,
-            const dictionary& dict,
+            const entry& e,
             const label len,
             const bool uniform
         );
diff --git a/src/OpenFOAM/expressions/exprResult/exprResultI.H b/src/OpenFOAM/expressions/exprResult/exprResultI.H
index eb771176f67..64eb52c70ea 100644
--- a/src/OpenFOAM/expressions/exprResult/exprResultI.H
+++ b/src/OpenFOAM/expressions/exprResult/exprResultI.H
@@ -6,7 +6,7 @@
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
     Copyright (C) 2012-2018 Bernhard Gschaider
-    Copyright (C) 2019-2021 OpenCFD Ltd.
+    Copyright (C) 2019-2022 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -82,8 +82,7 @@ inline bool Foam::expressions::exprResult::deleteChecked()
 template<class Type>
 inline bool Foam::expressions::exprResult::readChecked
 (
-    const word& key,
-    const dictionary& dict,
+    const entry& e,
     const label len,
     const bool uniform
 )
@@ -96,7 +95,7 @@ inline bool Foam::expressions::exprResult::readChecked
 
         if (uniform)
         {
-            const Type val(dict.get<Type>(key));
+            const Type val(e.get<Type>());
 
             size_ = len;
             fieldPtr_ = new Field<Type>(size_, val);
@@ -106,7 +105,7 @@ inline bool Foam::expressions::exprResult::readChecked
         else
         {
             size_ = len;
-            fieldPtr_ = new Field<Type>(key, dict, size_);
+            fieldPtr_ = new Field<Type>(e, size_);
         }
 
         isUniform_ = uniform;
diff --git a/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.C
index 775710af154..f9eacfb3bef 100644
--- a/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.C
+++ b/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.C
@@ -55,11 +55,11 @@ Foam::valuePointPatchField<Type>::valuePointPatchField
     pointPatchField<Type>(p, iF, dict),
     Field<Type>(p.size())
 {
-    const auto* eptr = dict.findEntry("value", keyType::LITERAL);
+    const auto* hasValue = dict.findEntry("value", keyType::LITERAL);
 
-    if (eptr)
+    if (hasValue)
     {
-        Field<Type>::assign(*eptr, p.size());
+        Field<Type>::assign(*hasValue, p.size());
     }
     else if (!valueRequired)
     {
diff --git a/src/OpenFOAM/interpolations/uniformInterpolationTable/uniformInterpolationTable.H b/src/OpenFOAM/interpolations/uniformInterpolationTable/uniformInterpolationTable.H
index 09e2275b4a1..cc50083452f 100644
--- a/src/OpenFOAM/interpolations/uniformInterpolationTable/uniformInterpolationTable.H
+++ b/src/OpenFOAM/interpolations/uniformInterpolationTable/uniformInterpolationTable.H
@@ -139,10 +139,10 @@ public:
             inline scalar dx() const;
 
             //- Return the log10(x) flag
-            inline const Switch& log10() const;
+            inline Switch log10() const noexcept;
 
             //- Return the bound flag
-            inline const Switch& bound() const;
+            inline Switch bound() const noexcept;
 
 
         // Edit
@@ -154,10 +154,10 @@ public:
             inline scalar& dx();
 
             //- Return the log10(x) flag
-            inline Switch& log10();
+            inline Switch& log10() noexcept;
 
             //- Return the bound flag
-            inline Switch& bound();
+            inline Switch& bound() noexcept;
 
 
         // Evaluation
diff --git a/src/OpenFOAM/interpolations/uniformInterpolationTable/uniformInterpolationTableI.H b/src/OpenFOAM/interpolations/uniformInterpolationTable/uniformInterpolationTableI.H
index 66aff95bee5..032a2a86cfe 100644
--- a/src/OpenFOAM/interpolations/uniformInterpolationTable/uniformInterpolationTableI.H
+++ b/src/OpenFOAM/interpolations/uniformInterpolationTable/uniformInterpolationTableI.H
@@ -40,14 +40,14 @@ Foam::scalar Foam::uniformInterpolationTable<Type>::dx() const
 
 
 template<class Type>
-const Foam::Switch& Foam::uniformInterpolationTable<Type>::log10() const
+Foam::Switch Foam::uniformInterpolationTable<Type>::log10() const noexcept
 {
     return log10_;
 }
 
 
 template<class Type>
-const Foam::Switch& Foam::uniformInterpolationTable<Type>::bound() const
+Foam::Switch Foam::uniformInterpolationTable<Type>::bound() const noexcept
 {
     return bound_;
 }
@@ -68,14 +68,14 @@ Foam::scalar& Foam::uniformInterpolationTable<Type>::dx()
 
 
 template<class Type>
-Foam::Switch& Foam::uniformInterpolationTable<Type>::log10()
+Foam::Switch& Foam::uniformInterpolationTable<Type>::log10() noexcept
 {
     return log10_;
 }
 
 
 template<class Type>
-Foam::Switch& Foam::uniformInterpolationTable<Type>::bound()
+Foam::Switch& Foam::uniformInterpolationTable<Type>::bound() noexcept
 {
     return bound_;
 }
diff --git a/src/OpenFOAM/primitives/bools/Switch/Switch.C b/src/OpenFOAM/primitives/bools/Switch/Switch.C
index e8bac8c15ea..36a4647b3d8 100644
--- a/src/OpenFOAM/primitives/bools/Switch/Switch.C
+++ b/src/OpenFOAM/primitives/bools/Switch/Switch.C
@@ -6,7 +6,7 @@
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
     Copyright (C) 2011-2016 OpenFOAM Foundation
-    Copyright (C) 2017-2020 OpenCFD Ltd.
+    Copyright (C) 2017-2022 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -364,7 +364,7 @@ Foam::Istream& Foam::operator>>(Istream& is, Switch& sw)
 }
 
 
-Foam::Ostream& Foam::operator<<(Ostream& os, const Switch& sw)
+Foam::Ostream& Foam::operator<<(Ostream& os, const Switch sw)
 {
     os << sw.c_str();
     return os;
diff --git a/src/OpenFOAM/primitives/bools/Switch/Switch.H b/src/OpenFOAM/primitives/bools/Switch/Switch.H
index 067e208d88d..b6e44fe89be 100644
--- a/src/OpenFOAM/primitives/bools/Switch/Switch.H
+++ b/src/OpenFOAM/primitives/bools/Switch/Switch.H
@@ -6,7 +6,7 @@
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
     Copyright (C) 2011-2016 OpenFOAM Foundation
-    Copyright (C) 2017-2020 OpenCFD Ltd.
+    Copyright (C) 2017-2022 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -37,8 +37,8 @@ SourceFiles
 
 \*---------------------------------------------------------------------------*/
 
-#ifndef Switch_H
-#define Switch_H
+#ifndef Foam_Switch_H
+#define Foam_Switch_H
 
 #include "bool.H"
 #include "stdFoam.H"
@@ -69,7 +69,7 @@ class Switch;
 Istream& operator>>(Istream& is, Switch& sw);
 
 //- Write Switch to stream as its text value (eg, "true", "false")
-Ostream& operator<<(Ostream& is, const Switch& sw);
+Ostream& operator<<(Ostream& is, const Switch sw);
 
 /*---------------------------------------------------------------------------*\
                            Class Switch Declaration
@@ -130,19 +130,19 @@ public:
             value_(switchType::FALSE)
         {}
 
-        //- Construct from enumerated value
+        //- Implicit construct from enumerated value
         constexpr Switch(const switchType sw) noexcept
         :
             value_(sw)
         {}
 
-        //- Construct from bool
+        //- Implicit construct from bool
         constexpr Switch(const bool b) noexcept
         :
             value_(b ? switchType::TRUE : switchType::FALSE)
         {}
 
-        //- Construct from int (treat integer as bool value)
+        //- Implicit construct from int (treat integer as bool value)
         constexpr Switch(const int i) noexcept
         :
             value_(i ? switchType::TRUE : switchType::FALSE)
diff --git a/src/finiteArea/fields/faPatchFields/faPatchField/faPatchField.C b/src/finiteArea/fields/faPatchFields/faPatchField/faPatchField.C
index dc7a42400de..60f7368ed85 100644
--- a/src/finiteArea/fields/faPatchFields/faPatchField/faPatchField.C
+++ b/src/finiteArea/fields/faPatchFields/faPatchField/faPatchField.C
@@ -88,11 +88,11 @@ Foam::faPatchField<Type>::faPatchField
 {
     /// if (valueRequired) - not yet needed. Already a lazy evaluation
 
-    const auto* eptr = dict.findEntry("value", keyType::LITERAL);
+    const auto* hasValue = dict.findEntry("value", keyType::LITERAL);
 
-    if (eptr)
+    if (hasValue)
     {
-        Field<Type>::assign(*eptr, p.size());
+        Field<Type>::assign(*hasValue, p.size());
     }
     else
     {
diff --git a/src/finiteArea/fields/faePatchFields/faePatchField/faePatchField.C b/src/finiteArea/fields/faePatchFields/faePatchField/faePatchField.C
index 2c84b4ed5b4..c9c93d5af22 100644
--- a/src/finiteArea/fields/faePatchFields/faePatchField/faePatchField.C
+++ b/src/finiteArea/fields/faePatchFields/faePatchField/faePatchField.C
@@ -85,11 +85,11 @@ Foam::faePatchField<Type>::faePatchField
     Field<Type>(p.size()),
     internalField_(iF)
 {
-    const auto* eptr = dict.findEntry("value", keyType::LITERAL);
+    const auto* hasValue = dict.findEntry("value", keyType::LITERAL);
 
-    if (eptr)
+    if (hasValue)
     {
-        Field<Type>::assign(*eptr, p.size());
+        Field<Type>::assign(*hasValue, p.size());
     }
     else
     {
diff --git a/src/finiteVolume/expressions/fields/fvPatchFields/exprFixedValueFvPatchField.C b/src/finiteVolume/expressions/fields/fvPatchFields/exprFixedValueFvPatchField.C
index 71fa7dc3916..97320176f17 100644
--- a/src/finiteVolume/expressions/fields/fvPatchFields/exprFixedValueFvPatchField.C
+++ b/src/finiteVolume/expressions/fields/fvPatchFields/exprFixedValueFvPatchField.C
@@ -85,7 +85,7 @@ Foam::exprFixedValueFvPatchField<Type>::exprFixedValueFvPatchField
     const bool valueRequired
 )
 :
-    parent_bctype(p, iF),
+    parent_bctype(p, iF), // bypass dictionary constructor
     expressions::patchExprFieldBase
     (
         dict,
@@ -121,12 +121,15 @@ Foam::exprFixedValueFvPatchField<Type>::exprFixedValueFvPatchField
 
     driver_.readDict(dict_);
 
-    if (dict.found("value"))
+    // Similar to fvPatchField constructor, which we have bypassed
+    dict.readIfPresent("patchType", this->patchType(), keyType::LITERAL);
+
+
+    const auto* hasValue = dict.findEntry("value", keyType::LITERAL);
+
+    if (hasValue)
     {
-        fvPatchField<Type>::operator=
-        (
-            Field<Type>("value", dict, p.size())
-        );
+        Field<Type>::assign(*hasValue, p.size());
     }
     else
     {
diff --git a/src/finiteVolume/expressions/fields/fvPatchFields/exprMixedFvPatchField.C b/src/finiteVolume/expressions/fields/fvPatchFields/exprMixedFvPatchField.C
index 473b930cb91..45837a762a0 100644
--- a/src/finiteVolume/expressions/fields/fvPatchFields/exprMixedFvPatchField.C
+++ b/src/finiteVolume/expressions/fields/fvPatchFields/exprMixedFvPatchField.C
@@ -87,7 +87,7 @@ Foam::exprMixedFvPatchField<Type>::exprMixedFvPatchField
     const dictionary& dict
 )
 :
-    parent_bctype(p, iF),
+    parent_bctype(p, iF), // bypass dictionary constructor
     expressions::patchExprFieldBase
     (
         dict,
@@ -160,27 +160,32 @@ Foam::exprMixedFvPatchField<Type>::exprMixedFvPatchField
         }
     }
 
-
     driver_.readDict(dict_);
 
     // Similar to fvPatchField constructor, which we have bypassed
     dict.readIfPresent("patchType", this->patchType(), keyType::LITERAL);
 
-    bool needsRefValue = true;
-    if (dict.found("refValue"))
+
+    const auto* hasValue = dict.findEntry("value", keyType::LITERAL);
+    const auto* hasRefValue = dict.findEntry("refValue", keyType::LITERAL);
+
+    const auto* hasRefGradient
+        = dict.findEntry("refGradient", keyType::LITERAL);
+
+    const auto* hasValueFraction
+        = dict.findEntry("valueFraction", keyType::LITERAL);
+
+
+    if (hasRefValue)
     {
-        needsRefValue = false;
-        this->refValue() = Field<Type>("refValue", dict, p.size());
+        this->refValue().assign(*hasRefValue, p.size());
     }
 
-    if (dict.found("value"))
+    if (hasValue)
     {
-        fvPatchField<Type>::operator=
-        (
-            Field<Type>("value", dict, p.size())
-        );
+        Field<Type>::assign(*hasValue, p.size());
 
-        if (needsRefValue)
+        if (!hasRefValue)
         {
             // Ensure refValue has a sensible value for the "update" below
             this->refValue() = static_cast<const Field<Type>&>(*this);
@@ -188,7 +193,7 @@ Foam::exprMixedFvPatchField<Type>::exprMixedFvPatchField
     }
     else
     {
-        if (needsRefValue)
+        if (!hasRefValue)
         {
             this->refValue() = this->patchInternalField();
         }
@@ -204,18 +209,18 @@ Foam::exprMixedFvPatchField<Type>::exprMixedFvPatchField
     }
 
 
-    if (dict.found("refGradient"))
+    if (hasRefGradient)
     {
-        this->refGrad() = Field<Type>("refGradient", dict, p.size());
+        this->refGrad().assign(*hasRefGradient, p.size());
     }
     else
     {
         this->refGrad() = Zero;
     }
 
-    if (dict.found("valueFraction"))
+    if (hasValueFraction)
     {
-        this->valueFraction() = Field<scalar>("valueFraction", dict, p.size());
+        this->valueFraction().assign(*hasValueFraction, p.size());
     }
     else
     {
diff --git a/src/finiteVolume/expressions/fields/pointPatchFields/exprValuePointPatchField.C b/src/finiteVolume/expressions/fields/pointPatchFields/exprValuePointPatchField.C
index e813a07f1ec..6551b09b7aa 100644
--- a/src/finiteVolume/expressions/fields/pointPatchFields/exprValuePointPatchField.C
+++ b/src/finiteVolume/expressions/fields/pointPatchFields/exprValuePointPatchField.C
@@ -6,7 +6,7 @@
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
     Copyright (C) 2010-2018 Bernhard Gschaider
-    Copyright (C) 2019-2021 OpenCFD Ltd.
+    Copyright (C) 2019-2022 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -85,7 +85,7 @@ Foam::exprValuePointPatchField<Type>::exprValuePointPatchField
     const dictionary& dict
 )
 :
-    parent_bctype(p, iF),
+    parent_bctype(p, iF),  // bypass dictionary constructor
     expressions::patchExprFieldBase
     (
         dict,
@@ -123,23 +123,20 @@ Foam::exprValuePointPatchField<Type>::exprValuePointPatchField
             << exit(FatalIOError);
     }
 
-
     driver_.readDict(dict_);
 
-    if (dict.found("value"))
+    const auto* hasValue = dict.findEntry("value", keyType::LITERAL);
+
+    if (hasValue)
     {
-        Field<Type>::operator=
-        (
-            Field<Type>("value", dict, p.size())
-        );
+        Field<Type>::assign(*hasValue, p.size());
     }
     else
     {
-        WarningInFunction
-            << "No value defined for "
-            << this->internalField().name()
-            << " on " << this->patch().name()
-            << endl;
+        // Note: valuePointPatchField defaults to Zero
+        // but internalField might be better
+
+        Field<Type>::operator=(Zero);
     }
 
     if (this->evalOnConstruct_)
diff --git a/src/finiteVolume/expressions/fields/pointPatchFields/exprValuePointPatchField.H b/src/finiteVolume/expressions/fields/pointPatchFields/exprValuePointPatchField.H
index 4ab37195de6..0c286e2028b 100644
--- a/src/finiteVolume/expressions/fields/pointPatchFields/exprValuePointPatchField.H
+++ b/src/finiteVolume/expressions/fields/pointPatchFields/exprValuePointPatchField.H
@@ -41,8 +41,8 @@ SourceFiles
 
 \*---------------------------------------------------------------------------*/
 
-#ifndef exprValuePointPatchField_H
-#define exprValuePointPatchField_H
+#ifndef Foam_exprValuePointPatchField_H
+#define Foam_exprValuePointPatchField_H
 
 #include "valuePointPatchField.H"
 #include "patchExprFieldBase.H"
diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C
index 29eca05a696..33d7d5fc30a 100644
--- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C
+++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C
@@ -104,11 +104,11 @@ Foam::fvPatchField<Type>::fvPatchField
 {
     if (valueRequired)
     {
-        const auto* eptr = dict.findEntry("value", keyType::LITERAL);
+        const auto* hasValue = dict.findEntry("value", keyType::LITERAL);
 
-        if (eptr)
+        if (hasValue)
         {
-            Field<Type>::assign(*eptr, p.size());
+            Field<Type>::assign(*hasValue, p.size());
         }
         else
         {
diff --git a/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.C b/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.C
index 5a3cbf105a1..acb52ae74fa 100644
--- a/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.C
+++ b/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.C
@@ -6,7 +6,7 @@
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
     Copyright (C) 2011-2015 OpenFOAM Foundation
-    Copyright (C) 2017 OpenCFD Ltd.
+    Copyright (C) 2017-2022 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -91,11 +91,11 @@ Foam::fvsPatchField<Type>::fvsPatchField
 {
     if (valueRequired)
     {
-        const auto* eptr = dict.findEntry("value", keyType::LITERAL);
+        const auto* hasValue = dict.findEntry("value", keyType::LITERAL);
 
-        if (eptr)
+        if (hasValue)
         {
-            Field<Type>::assign(*eptr, p.size());
+            Field<Type>::assign(*hasValue, p.size());
         }
         else
         {
diff --git a/src/regionFaModels/derivedFvPatchFields/filmShell/velocityFilmShellFvPatchVectorField.C b/src/regionFaModels/derivedFvPatchFields/filmShell/velocityFilmShellFvPatchVectorField.C
index f4923c44698..c5c8ace431f 100644
--- a/src/regionFaModels/derivedFvPatchFields/filmShell/velocityFilmShellFvPatchVectorField.C
+++ b/src/regionFaModels/derivedFvPatchFields/filmShell/velocityFilmShellFvPatchVectorField.C
@@ -91,8 +91,8 @@ velocityFilmShellFvPatchVectorField::velocityFilmShellFvPatchVectorField
         dictionaryContent::copyDict
         (
             dict,
-            wordRes(),  // allow
-            wordRes     // deny
+            wordList(),  // allow
+            wordList     // deny
             ({
                 "type",  // redundant
                 "value", "refValue", "refGradient", "valueFraction"
diff --git a/src/regionFaModels/derivedFvPatchFields/thermalShell/thermalShellFvPatchScalarField.C b/src/regionFaModels/derivedFvPatchFields/thermalShell/thermalShellFvPatchScalarField.C
index 03dee9ea2e3..f778792db8c 100644
--- a/src/regionFaModels/derivedFvPatchFields/thermalShell/thermalShellFvPatchScalarField.C
+++ b/src/regionFaModels/derivedFvPatchFields/thermalShell/thermalShellFvPatchScalarField.C
@@ -85,8 +85,8 @@ thermalShellFvPatchScalarField::thermalShellFvPatchScalarField
         dictionaryContent::copyDict
         (
             dict,
-            wordRes(),  // allow
-            wordRes     // deny
+            wordList(),  // allow
+            wordList     // deny
             ({
                 "type",  // redundant
                 "value"
diff --git a/src/regionFaModels/derivedFvPatchFields/vibrationShell/vibrationShellFvPatchScalarField.C b/src/regionFaModels/derivedFvPatchFields/vibrationShell/vibrationShellFvPatchScalarField.C
index 71ca05eca46..508bdbfa960 100644
--- a/src/regionFaModels/derivedFvPatchFields/vibrationShell/vibrationShellFvPatchScalarField.C
+++ b/src/regionFaModels/derivedFvPatchFields/vibrationShell/vibrationShellFvPatchScalarField.C
@@ -87,8 +87,8 @@ vibrationShellFvPatchScalarField::vibrationShellFvPatchScalarField
         dictionaryContent::copyDict
         (
             dict,
-            wordRes(),  // allow
-            wordRes     // deny
+            wordList(),  // allow
+            wordList     // deny
             ({
                 "type",  // redundant
                 "value", "refValue", "refGradient", "valueFraction"
-- 
GitLab