From 3b7451223113d7afa8c4c1b21ff36bcb28c5532a Mon Sep 17 00:00:00 2001
From: Mark Olesen <Mark.Olesen@esi-group.com>
Date: Thu, 18 Oct 2018 12:57:32 +0200
Subject: [PATCH] ENH: cleanup of Enum class

- more dictionary-like methods, enforce keyType::LITERAL for all
  lookups to avoid any spurious keyword matching.

- new readEntry, readIfPresent methods

- The get() method replaces the now deprecate lookup() method.

- Deprecate lookupOrFailsafe()
  Failsafe behaviour is now an optional parameter for lookupOrDefault,
  which makes it easier to tailor behaviour at runtime.

- output of the names is now always flatted without line-breaks.
  Thus,

     os << flatOutput(someEnumNames.names()) << nl;
     os << someEnumNames << nl;

  both generate the same output.

- Constructor now uses C-string (const char*) directly instead of
  Foam::word in its initializer_list.

- Remove special enum + initializer_list constructor form since
  it can create unbounded lookup indices.

- Removd old hasEnum, hasName forms that were provided during initial
  transition from NamedEnum.

- Added static_assert on Enum contents to restrict to enum or
  integral values.  Should not likely be using this class to enumerate
  other things since it internally uses an 'int' for its values.

  Changed volumeType accordingly to enumerate on its type (enum),
  not the class itself.
---
 .../laserDTRM/laserDTRM.C                     |   4 +-
 ...allBoilingWallFunctionFvPatchScalarField.C |   6 +-
 applications/test/Enum/Make/files             |   3 +
 .../test/{NamedEnum => Enum}/Make/options     |   0
 applications/test/Enum/Test-Enum.C            | 166 ++++++++++++
 applications/test/NamedEnum/Make/files        |   3 -
 applications/test/NamedEnum/Test-NamedEnum.C  | 161 ------------
 .../extrude/extrudeMesh/extrudeMesh.C         |   6 +-
 .../extrudeToRegionMesh/extrudeToRegionMesh.C |   2 +-
 .../conformalVoronoiMesh.C                    |   4 +-
 .../indexedCell/indexedCellEnum.C             |   4 +-
 .../indexedVertex/indexedVertexEnum.C         |   4 +-
 .../mesh/manipulation/topoSet/topoSet.C       |   2 +-
 .../miscellaneous/postChannel/channelIndex.C  |  10 +-
 .../createZeroDirectory/solverTemplate.C      |  10 +-
 .../setAlphaField/setAlphaField.C             |   6 +-
 .../tabulatedWallFunction/general/general.C   |   6 +-
 src/OSspecific/POSIX/fileMonitor.C            |   4 +-
 .../algorithms/indexedOctree/volumeType.C     |  14 +-
 .../algorithms/indexedOctree/volumeType.H     |   2 +-
 src/OpenFOAM/db/IOobject/IOobject.C           |   6 +-
 .../db/IOstreams/IOstreams/IOstreamOption.C   |   6 +-
 src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C |  12 +-
 src/OpenFOAM/db/Time/Time.C                   |   8 +-
 src/OpenFOAM/db/Time/TimeIO.C                 |  18 +-
 .../functionEntries/inputMode/inputMode.C     |   6 +-
 .../functionObjects/timeControl/timeControl.C |  14 +-
 .../interpolation2DTable.C                    |   5 +-
 .../interpolationTable/interpolationTable.C   |   5 +-
 .../basic/coupled/coupledPolyPatch.C          |   4 +-
 .../primitiveShapes/triangle/intersection.C   |   8 +-
 src/OpenFOAM/orientedType/orientedType.C      |  18 +-
 src/OpenFOAM/primitives/bools/Switch/Switch.C |   2 +-
 src/OpenFOAM/primitives/bools/Switch/Switch.H |   4 +-
 src/OpenFOAM/primitives/enums/Enum.C          | 244 +++++++-----------
 src/OpenFOAM/primitives/enums/Enum.H          | 185 +++++++------
 src/OpenFOAM/primitives/enums/EnumI.H         |  77 ++++--
 .../functions/Function1/Table/TableBase.C     |   5 +-
 ...allHeatFluxTemperatureFvPatchScalarField.C |   6 +-
 .../temperatureCoupledBase.C                  |   6 +-
 src/combustionModels/EDC/EDCs.C               |   4 +-
 .../meshCut/directions/directions.C           |   4 +-
 .../polyTopoChange/tetDecomposer.C            |   4 +-
 .../slidingInterface/slidingInterface.C       |   8 +-
 src/fileFormats/coordSet/coordSet.C           |   6 +-
 src/fileFormats/fire/FIRECore.C               |   6 +-
 src/fileFormats/nas/NASCore.C                 |   4 +-
 src/fileFormats/starcd/STARCDCore.C           |  12 +-
 src/fileFormats/vtk/core/foamVtkCore.C        |  12 +-
 src/fileFormats/vtk/output/foamVtkOutput.C    |   8 +-
 .../vtk/read/vtkUnstructuredReader.C          |  18 +-
 .../fanPressureFvPatchScalarField.C           |   6 +-
 .../waveSurfacePressureFvPatchScalarField.C   |   4 +-
 .../functionObjects/volRegion/volRegion.C     |   4 +-
 .../fieldAverageItem/fieldAverageItem.C       |   8 +-
 .../fieldAverageItem/fieldAverageItemIO.C     |   5 +-
 .../field/fieldMinMax/fieldMinMax.C           |   4 +-
 .../fieldValueDelta/fieldValueDelta.C         |   6 +-
 .../surfaceFieldValue/surfaceFieldValue.C     |  26 +-
 .../fieldValues/volFieldValue/volFieldValue.C |   8 +-
 .../field/fluxSummary/fluxSummary.C           |   6 +-
 src/functionObjects/field/setFlow/setFlow.C   |   9 +-
 .../field/turbulenceFields/turbulenceFields.C |  12 +-
 .../fieldVisualisationBase.C                  |  15 +-
 .../runTimePostProcessing/geometryBase.C      |  14 +-
 .../graphics/runTimePostProcessing/pathline.C |   6 +-
 .../runTimePostProcessing/pointData.C         |   6 +-
 .../graphics/runTimePostProcessing/surface.C  |   6 +-
 .../utilities/ensightWrite/ensightWrite.C     |   5 +-
 .../equationInitialResidualCondition.C        |   6 +-
 .../minMaxCondition/minMaxCondition.C         |   6 +-
 .../utilities/writeObjects/writeObjects.C     |   8 +-
 ...surfaceDisplacementPointPatchVectorField.C |   6 +-
 ...aceSlipDisplacementPointPatchVectorField.C |   6 +-
 src/fvOptions/cellSetOption/cellSetOption.C   |   9 +-
 .../fixedTemperatureConstraint.C              |   6 +-
 ...irectionalPressureGradientExplicitSource.C |   6 +-
 .../derived/rotorDiskSource/rotorDiskSource.C |  12 +-
 .../solidificationMeltingSource.C             |   8 +-
 .../tabulatedNTUHeatTransfer.C                |   6 +-
 .../phaseProperties/phaseProperties.C         |   4 +-
 .../ConeNozzleInjection/ConeNozzleInjection.C |  16 +-
 src/lumpedPointMotion/lumpedPointMovement.C   |  26 +-
 src/lumpedPointMotion/lumpedPointState.C      |   6 +-
 .../meshRefinement/meshRefinement.C           |  12 +-
 .../refinementSurfaces/surfaceZonesInfo.C     |   8 +-
 .../shellSurfaces/shellSurfaces.C             |   6 +-
 .../AMIInterpolation/AMIInterpolation.C       |   4 +-
 .../faceAreaIntersect/faceAreaIntersect.C     |   6 +-
 .../extendedEdgeMesh/extendedEdgeMesh.C       |  13 +-
 .../mappedPolyPatch/mappedPatchBase.C         |  14 +-
 .../sets/cellSources/faceToCell/faceToCell.C  |   6 +-
 .../faceZoneToCell/faceZoneToCell.C           |   6 +-
 .../cellSources/pointToCell/pointToCell.C     |   6 +-
 .../sets/faceSources/cellToFace/cellToFace.C  |   6 +-
 .../faceSources/pointToFace/pointToFace.C     |   6 +-
 .../pointSources/cellToPoint/cellToPoint.C    |   6 +-
 .../pointSources/faceToPoint/faceToPoint.C    |   6 +-
 .../sets/topoSetSource/topoSetSource.C        |   4 +-
 .../booleanSurface/booleanSurface.C           |   4 +-
 .../surfaceIntersection/surfaceIntersection.C |   4 +-
 .../triSurfaceLoader/triSurfaceLoader.C       |   6 +-
 .../cellCellStencil/cellCellStencil.C         |   4 +-
 .../decompose/kahipDecomp/kahipDecomp.C       |   8 +-
 .../distributedTriSurfaceMesh.C               |   6 +-
 .../energyRegionCoupledFvPatchScalarField.C   |   4 +-
 src/sampling/meshToMesh/meshToMesh.C          |   4 +-
 .../sampledPatchInternalField.C               |  10 +-
 .../sampledTriSurfaceMesh.C                   |   6 +-
 .../writers/ensight/ensightSurfaceWriter.C    |   5 +-
 .../writers/nastran/nastranSurfaceWriter.C    |   4 +-
 .../surface/triSurfaceMesh/discreteSurface.C  |   6 +-
 .../sixDoFRigidBodyState.C                    |   6 +-
 .../boundaryRadiationPropertiesPatch.C        |   8 +-
 .../solarCalculator/solarCalculator.C         |  16 +-
 ...emperatureCoupledMixedFvPatchScalarField.C |   7 +-
 .../alphaContactAngleFvPatchScalarField.C     |   6 +-
 117 files changed, 807 insertions(+), 839 deletions(-)
 create mode 100644 applications/test/Enum/Make/files
 rename applications/test/{NamedEnum => Enum}/Make/options (100%)
 create mode 100644 applications/test/Enum/Test-Enum.C
 delete mode 100644 applications/test/NamedEnum/Make/files
 delete mode 100644 applications/test/NamedEnum/Test-NamedEnum.C

diff --git a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/laserDTRM/laserDTRM.C b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/laserDTRM/laserDTRM.C
index f941743c47a..d57eeefd485 100644
--- a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/laserDTRM/laserDTRM.C
+++ b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/laserDTRM/laserDTRM.C
@@ -322,7 +322,7 @@ void Foam::radiation::laserDTRM::initialise()
 Foam::radiation::laserDTRM::laserDTRM(const volScalarField& T)
 :
     radiationModel(typeName, T),
-    mode_(powerDistNames_.lookup("mode", *this)),
+    mode_(powerDistNames_.get("mode", *this)),
     DTRMCloud_(mesh_, "DTRMCloud", IDLList<DTRMParticle>()),
     nParticles_(0),
     ndTheta_(get<label>("nTheta")),
@@ -432,7 +432,7 @@ Foam::radiation::laserDTRM::laserDTRM
 )
 :
     radiationModel(typeName, dict, T),
-    mode_(powerDistNames_.lookup("mode", *this)),
+    mode_(powerDistNames_.get("mode", *this)),
     DTRMCloud_(mesh_, "DTRMCloud", IDLList<DTRMParticle>()),
     nParticles_(0),
     ndTheta_(get<label>("nTheta")),
diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C
index e10422c800f..cea0280392d 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C
+++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C
@@ -50,10 +50,10 @@ const Foam::Enum
 >
 Foam::compressible::
 alphatWallBoilingWallFunctionFvPatchScalarField::phaseTypeNames_
-{
+({
     { phaseType::vaporPhase, "vapor" },
     { phaseType::liquidPhase, "liquid" },
-};
+});
 
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -102,7 +102,7 @@ alphatWallBoilingWallFunctionFvPatchScalarField
 )
 :
     alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(p, iF, dict),
-    phaseType_(phaseTypeNames_.lookup("phaseType", dict)),
+    phaseType_(phaseTypeNames_.get("phaseType", dict)),
     relax_(dict.lookupOrDefault<scalar>("relax", 0.5)),
     AbyV_(p.size(), 0),
     alphatConv_(p.size(), 0),
diff --git a/applications/test/Enum/Make/files b/applications/test/Enum/Make/files
new file mode 100644
index 00000000000..efc235ca442
--- /dev/null
+++ b/applications/test/Enum/Make/files
@@ -0,0 +1,3 @@
+Test-Enum.C
+
+EXE = $(FOAM_USER_APPBIN)/Test-Enum
diff --git a/applications/test/NamedEnum/Make/options b/applications/test/Enum/Make/options
similarity index 100%
rename from applications/test/NamedEnum/Make/options
rename to applications/test/Enum/Make/options
diff --git a/applications/test/Enum/Test-Enum.C b/applications/test/Enum/Test-Enum.C
new file mode 100644
index 00000000000..c3ee516fd6f
--- /dev/null
+++ b/applications/test/Enum/Test-Enum.C
@@ -0,0 +1,166 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2018 OpenCFD Ltd.
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+License
+    This file is part of OpenFOAM.
+
+    OpenFOAM is free software: you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
+    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+    for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
+
+Description
+    Testing of Enum lookups.
+
+\*---------------------------------------------------------------------------*/
+
+#include "Enum.H"
+#include "dictionary.H"
+#include "FlatOutput.H"
+#include "IOstreams.H"  // For 'Sin'
+
+#include <array>
+
+using namespace Foam;
+
+struct testing
+{
+    enum class option { A, B, C, D };
+
+    static const Foam::Enum<option> option1Names;
+    static const Foam::Enum<option> option2Names;
+};
+
+// All names
+const Foam::Enum<testing::option> testing::option1Names
+({
+    { testing::option::A, "a" },
+    { testing::option::B, "b" },
+    { testing::option::C, "c" },
+    { testing::option::D, "d" },
+});
+
+// Subset of names
+const Foam::Enum<testing::option> testing::option2Names
+({
+    { testing::option::C, "c" },
+    { testing::option::D, "d" },
+});
+
+
+// Can use for integers as well, but not scalar etc.
+const Foam::Enum<int> otherNames1
+({
+    { 0, "a" },
+    { 2, "b" },
+    { 3, "c" },
+    { 3, "d" },
+});
+
+
+// Can use for integers as well, but not scalar etc.
+const Foam::Enum<int> otherNames2
+({
+    { 0, "a" },
+    { 2, "b" },
+    { 3, "c" },
+    { 3, "asdasd" },
+});
+
+
+std::array<const char*, 2> myarray{ "false", "true" };
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+// Main program:
+
+int main(int argc, char *argv[])
+{
+    Info<<"Enum 1" << nl
+        << "    names:  " << testing::option1Names << nl
+        << "    values: " << flatOutput(testing::option1Names.values())
+        << nl << nl;
+
+    Info<<"Enum 2" << nl
+        << "    names:  " << testing::option2Names << nl
+        << "    values: " << flatOutput(testing::option2Names.values())
+        << nl << nl;
+
+    Info<<"Other Enum" << nl
+        << "    names:  " << otherNames2 << nl
+        << "    values: " << flatOutput(otherNames2.values())
+        << nl << nl;
+
+
+    dictionary testDict;
+    testDict.add("lookup1", "c");
+    testDict.add("lookup2", "rubbish");
+
+    Info<< nl
+        << int(testing::option1Names["a"]) << nl
+        << testing::option1Names[testing::option::A] << nl;
+
+    Info<< "--- test dictionary lookup ---" << endl;
+    {
+        Info<< "dict: " << testDict << endl;
+
+        Info<< "lookupOrDefault(notFound) = "
+            <<  int
+                (
+                    testing::option1Names.lookupOrDefault
+                    (
+                        "notFound",
+                        testDict,
+                        testing::option::A
+                    )
+                )
+            << nl;
+
+        Info<< "lookupOrDefault(lookup1) = "
+            <<  int
+                (
+                    testing::option1Names.lookupOrDefault
+                    (
+                        "lookup1",
+                        testDict,
+                        testing::option::A
+                    )
+                )
+            << nl;
+
+        Info<< "lookupOrDefault(lookup1) = "
+            <<  int
+                (
+                    testing::option2Names.lookupOrDefault
+                    (
+                        "lookup1",
+                        testDict,
+                        testing::option::A
+                    )
+                )
+            << nl;
+    }
+
+    Info<< "--- test read ---" << endl;
+
+    testing::option dummy(testing::option1Names.read(Sin));
+    Info<< testing::option1Names[dummy] << endl;
+
+    Info<< "\nEnd\n" << endl;
+
+    return 0;
+}
+
+
+// ************************************************************************* //
diff --git a/applications/test/NamedEnum/Make/files b/applications/test/NamedEnum/Make/files
deleted file mode 100644
index a1a70860418..00000000000
--- a/applications/test/NamedEnum/Make/files
+++ /dev/null
@@ -1,3 +0,0 @@
-Test-NamedEnum.C
-
-EXE = $(FOAM_USER_APPBIN)/Test-NamedEnum
diff --git a/applications/test/NamedEnum/Test-NamedEnum.C b/applications/test/NamedEnum/Test-NamedEnum.C
deleted file mode 100644
index d0b7f58d79d..00000000000
--- a/applications/test/NamedEnum/Test-NamedEnum.C
+++ /dev/null
@@ -1,161 +0,0 @@
-/*---------------------------------------------------------------------------*\
-  =========                 |
-  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
-   \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
-     \\/     M anipulation  |
--------------------------------------------------------------------------------
-License
-    This file is part of OpenFOAM.
-
-    OpenFOAM is free software: you can redistribute it and/or modify it
-    under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
-    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-    for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
-
-Description
-
-\*---------------------------------------------------------------------------*/
-
-#include "NamedEnum.H"
-#include "Enum.H"
-#include "IOstreams.H"
-
-using namespace Foam;
-
-class namedEnumTest
-{
-public:
-
-    enum class option
-    {
-        A,
-        B,
-        C,
-        D
-    };
-
-    enum class otherOption
-    {
-        A,
-        B,
-        C,
-        D
-    };
-
-    static const Foam::NamedEnum<option, 4> optionNamed;
-
-    static const Foam::Enum<otherOption> optionEnum;
-
-    static const Foam::Enum<option> optionEnum2;
-};
-
-
-template<>
-const char* Foam::NamedEnum<namedEnumTest::option, 4>::names[] =
-{
-    "a",
-    "b",
-    "c",
-    "d",
-};
-
-const Foam::NamedEnum<namedEnumTest::option, 4> namedEnumTest::optionNamed;
-
-const Foam::Enum<namedEnumTest::otherOption> namedEnumTest::optionEnum
-{
-    { namedEnumTest::otherOption::A, "a" },
-    { namedEnumTest::otherOption::B, "b" },
-    { namedEnumTest::otherOption::C, "c" },
-    { namedEnumTest::otherOption::D, "d" },
-};
-
-
-const Foam::Enum<namedEnumTest::option> namedEnumTest::optionEnum2
-(
-    namedEnumTest::option::C,
-    { "c", "d" }
-);
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// Main program:
-
-int main(int argc, char *argv[])
-{
-    Info<<"NamedEnum: " << namedEnumTest::optionNamed << nl;
-    Info<<"Enum: " << namedEnumTest::optionEnum << nl;
-    Info<<"Enum: " << namedEnumTest::optionEnum2 << nl;
-
-    dictionary testDict;
-    testDict.add("lookup1", "c");
-
-    Info<< nl
-        << int(namedEnumTest::optionNamed["a"]) << nl
-        << namedEnumTest::optionNamed[namedEnumTest::option::A] << nl;
-
-    Info<< nl
-        << int(namedEnumTest::optionEnum["a"]) << nl
-        << namedEnumTest::optionEnum[namedEnumTest::otherOption::A] << nl;
-
-    Info<< "--- test dictionary lookup ---" << endl;
-    {
-        Info<< "dict: " << testDict << endl;
-
-        Info<< "got: "
-            <<  int
-                (
-                    namedEnumTest::optionNamed.lookupOrDefault
-                    (
-                        "notFound",
-                        testDict,
-                        namedEnumTest::option::A
-                    )
-                )
-            << nl;
-
-        Info<< "got: "
-            <<  int
-                (
-                    namedEnumTest::optionNamed.lookupOrDefault
-                    (
-                        "lookup1",
-                        testDict,
-                        namedEnumTest::option::A
-                    )
-                )
-            << nl;
-
-        Info<< "got: "
-            <<  int
-                (
-                    namedEnumTest::optionEnum2.lookupOrDefault
-                    (
-                        "lookup1",
-                        testDict,
-                        namedEnumTest::option::A
-                    )
-                )
-            << nl;
-    }
-
-    Info<< "--- test read ---" << endl;
-
-    namedEnumTest::option dummy(namedEnumTest::optionNamed.read(Sin));
-    Info<< namedEnumTest::optionNamed[dummy] << endl;
-
-    Info<< "End\n" << endl;
-
-    return 0;
-}
-
-
-// ************************************************************************* //
diff --git a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C
index 1529ce78226..fefdd463cd7 100644
--- a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C
+++ b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C
@@ -300,11 +300,7 @@ int main(int argc, char *argv[])
     const bool flipNormals(dict.get<bool>("flipNormals"));
 
     // What to extrude
-    const ExtrudeMode mode = ExtrudeModeNames.lookup
-    (
-        "constructFrom",
-        dict
-    );
+    const ExtrudeMode mode = ExtrudeModeNames.get("constructFrom", dict);
 
     // Any merging of small edges
     const scalar mergeTol(dict.lookupOrDefault<scalar>("mergeTol", 1e-4));
diff --git a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C
index e5dc81bbdf7..0e84353209f 100644
--- a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C
+++ b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C
@@ -1534,7 +1534,7 @@ int main(int argc, char *argv[])
 
 
     mappedPatchBase::sampleMode sampleMode =
-        mappedPatchBase::sampleModeNames_.lookup("sampleMode", dict);
+        mappedPatchBase::sampleModeNames_.get("sampleMode", dict);
 
     const bool oneD(dict.get<bool>("oneD"));
     bool oneDNonManifoldEdges(false);
diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C
index edb36f528c7..e2a11768e28 100644
--- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C
+++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C
@@ -49,13 +49,13 @@ const Foam::Enum
     Foam::conformalVoronoiMesh::dualMeshPointType
 >
 Foam::conformalVoronoiMesh::dualMeshPointTypeNames_
-{
+({
     { dualMeshPointType::internal, "internal" },
     { dualMeshPointType::surface, "surface" },
     { dualMeshPointType::featureEdge, "featureEdge" },
     { dualMeshPointType::featurePoint, "featurePoint" },
     { dualMeshPointType::constrained, "constrained" },
-};
+});
 
 
 // * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * * //
diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedCell/indexedCellEnum.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedCell/indexedCellEnum.C
index b9542b22ab0..63eb46469f6 100644
--- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedCell/indexedCellEnum.C
+++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedCell/indexedCellEnum.C
@@ -32,14 +32,14 @@ const Foam::Enum
     Foam::indexedCellEnum::cellTypes
 >
 Foam::indexedCellEnum::cellTypesNames_
-{
+({
     { cellTypes::ctUnassigned, "Unassigned" },
     { cellTypes::ctFar, "Far" },
     { cellTypes::ctInternal, "Internal" },
     { cellTypes::ctSurface, "Surface" },
     { cellTypes::ctFeatureEdge, "FeatureEdge" },
     { cellTypes::ctFeaturePoint,"FeaturePoint" },
-};
+});
 
 
 // ************************************************************************* //
diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertexEnum.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertexEnum.C
index 729eea93d20..b5da11a5a1c 100644
--- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertexEnum.C
+++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertexEnum.C
@@ -33,7 +33,7 @@ const Foam::Enum
     Foam::indexedVertexEnum::vertexType
 >
 Foam::indexedVertexEnum::vertexTypeNames_
-{
+({
     { vertexType::vtUnassigned, "Unassigned" },
     { vertexType::vtInternal, "Internal" },
     { vertexType::vtInternalNearBoundary, "InternalNearBoundary" },
@@ -49,7 +49,7 @@ Foam::indexedVertexEnum::vertexTypeNames_
     { vertexType::vtExternalFeaturePoint, "ExternalFeaturePoint" },
     { vertexType::vtFar, "Far" },
     { vertexType::vtConstrained, "Constrained" },
-};
+});
 
 
 const Foam::Enum
diff --git a/applications/utilities/mesh/manipulation/topoSet/topoSet.C b/applications/utilities/mesh/manipulation/topoSet/topoSet.C
index 9878b75b3c5..f08ea751690 100644
--- a/applications/utilities/mesh/manipulation/topoSet/topoSet.C
+++ b/applications/utilities/mesh/manipulation/topoSet/topoSet.C
@@ -242,7 +242,7 @@ int main(int argc, char *argv[])
             const word setType(dict.get<word>("type"));
 
             const topoSetSource::setAction action =
-                topoSetSource::actionNames.lookup("action", dict);
+                topoSetSource::actionNames.get("action", dict);
 
             autoPtr<topoSet> currentSet;
             if
diff --git a/applications/utilities/postProcessing/miscellaneous/postChannel/channelIndex.C b/applications/utilities/postProcessing/miscellaneous/postChannel/channelIndex.C
index ddefd7f7ee4..59199c7bda8 100644
--- a/applications/utilities/postProcessing/miscellaneous/postChannel/channelIndex.C
+++ b/applications/utilities/postProcessing/miscellaneous/postChannel/channelIndex.C
@@ -38,9 +38,11 @@ const Foam::Enum
     Foam::vector::components
 >
 Foam::channelIndex::vectorComponentsNames_
-(
-    Foam::vector::components::X, { "x", "y", "z" }
-);
+({
+    { vector::components::X, "x" },
+    { vector::components::Y, "y" },
+    { vector::components::Z, "z" },
+});
 
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
@@ -224,7 +226,7 @@ Foam::channelIndex::channelIndex
 )
 :
     symmetric_(dict.get<bool>("symmetric")),
-    dir_(vectorComponentsNames_.lookup("component", dict))
+    dir_(vectorComponentsNames_.get("component", dict))
 {
     const polyBoundaryMesh& patches = mesh.boundaryMesh();
 
diff --git a/applications/utilities/preProcessing/createZeroDirectory/solverTemplate.C b/applications/utilities/preProcessing/createZeroDirectory/solverTemplate.C
index 0c85961e7e6..1e07af5e0c5 100644
--- a/applications/utilities/preProcessing/createZeroDirectory/solverTemplate.C
+++ b/applications/utilities/preProcessing/createZeroDirectory/solverTemplate.C
@@ -36,12 +36,12 @@ const Foam::Enum
     Foam::solverTemplate::solverType
 >
 Foam::solverTemplate::solverTypeNames_
-{
+({
     { solverType::stCompressible, "compressible" },
     { solverType::stIncompressible, "incompressible" },
     { solverType::stBuoyant, "buoyant" },
     { solverType::stUnknown, "unknown" },
-};
+});
 
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
@@ -255,10 +255,10 @@ Foam::solverTemplate::solverTemplate
 
     Info<< "Selecting " << solverName << ": ";
 
-    solverType_ = solverTypeNames_.lookup("solverType", solverDict);
-    Info<< solverTypeNames_[solverType_];
-
+    solverType_ = solverTypeNames_.get("solverType", solverDict);
     multiRegion_ = solverDict.get<bool>("multiRegion");
+
+    Info<< solverTypeNames_[solverType_];
     if (multiRegion_)
     {
         Info<< ", multi-region";
diff --git a/applications/utilities/preProcessing/setAlphaField/setAlphaField.C b/applications/utilities/preProcessing/setAlphaField/setAlphaField.C
index 25a226d1427..37bc94df278 100644
--- a/applications/utilities/preProcessing/setAlphaField/setAlphaField.C
+++ b/applications/utilities/preProcessing/setAlphaField/setAlphaField.C
@@ -65,12 +65,12 @@ const Foam::Enum
     shapeSelector::shapeType
 >
 shapeSelector::shapeTypeNames
-{
+({
     { shapeSelector::shapeType::PLANE, "plane" },
     { shapeSelector::shapeType::SPHERE, "sphere" },
     { shapeSelector::shapeType::CYLINDER, "cylinder" },
     { shapeSelector::shapeType::SIN, "sin" },
-};
+});
 
 
 int main(int argc, char *argv[])
@@ -95,7 +95,7 @@ int main(int argc, char *argv[])
 
     const shapeSelector::shapeType surfType
     (
-        shapeSelector::shapeTypeNames.lookup("type", dict)
+        shapeSelector::shapeTypeNames.get("type", dict)
     );
     const vector centre(dict.get<vector>("centre"));
     const word fieldName(dict.get<word>("field"));
diff --git a/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/general/general.C b/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/general/general.C
index eb38f408b28..87df0faa850 100644
--- a/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/general/general.C
+++ b/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/general/general.C
@@ -48,9 +48,9 @@ const Foam::Enum
     Foam::tabulatedWallFunctions::general::interpolationType
 >
 Foam::tabulatedWallFunctions::general::interpolationTypeNames_
-{
+({
     { interpolationType::itLinear, "linear" },
-};
+});
 
 
 // * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * * //
@@ -132,7 +132,7 @@ Foam::tabulatedWallFunctions::general::general
 )
 :
     tabulatedWallFunction(dict, mesh, typeName),
-    interpType_(interpolationTypeNames_.lookup("interpType", coeffDict_)),
+    interpType_(interpolationTypeNames_.get("interpType", coeffDict_)),
     yPlus_(),
     uPlus_(),
     log10YPlus_(coeffDict_.lookup("log10YPlus")),
diff --git a/src/OSspecific/POSIX/fileMonitor.C b/src/OSspecific/POSIX/fileMonitor.C
index 7d642541e06..b3a82edc474 100644
--- a/src/OSspecific/POSIX/fileMonitor.C
+++ b/src/OSspecific/POSIX/fileMonitor.C
@@ -48,11 +48,11 @@ const Foam::Enum
     Foam::fileMonitor::fileState
 >
 Foam::fileMonitor::fileStateNames_
-{
+({
     { fileState::UNMODIFIED, "unmodified" },
     { fileState::MODIFIED, "modified" },
     { fileState::DELETED, "deleted" },
-};
+});
 
 
 namespace Foam
diff --git a/src/OpenFOAM/algorithms/indexedOctree/volumeType.C b/src/OpenFOAM/algorithms/indexedOctree/volumeType.C
index bc6040423c2..e1a8c919a47 100644
--- a/src/OpenFOAM/algorithms/indexedOctree/volumeType.C
+++ b/src/OpenFOAM/algorithms/indexedOctree/volumeType.C
@@ -30,15 +30,15 @@ License
 
 const Foam::Enum
 <
-    Foam::volumeType
+    Foam::volumeType::type
 >
 Foam::volumeType::names
-{
-    { type::UNKNOWN, "unknown" },
-    { type::INSIDE, "inside" },
-    { type::OUTSIDE, "outside" },
-    { type::MIXED, "mixed" },
-};
+({
+    { volumeType::type::UNKNOWN, "unknown" },
+    { volumeType::type::INSIDE, "inside" },
+    { volumeType::type::OUTSIDE, "outside" },
+    { volumeType::type::MIXED, "mixed" },
+});
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
diff --git a/src/OpenFOAM/algorithms/indexedOctree/volumeType.H b/src/OpenFOAM/algorithms/indexedOctree/volumeType.H
index 4e66188fdd3..2559dc4b49e 100644
--- a/src/OpenFOAM/algorithms/indexedOctree/volumeType.H
+++ b/src/OpenFOAM/algorithms/indexedOctree/volumeType.H
@@ -70,7 +70,7 @@ public:
     // Static data
 
     //- Names for the classification enumeration
-    static const Enum<volumeType> names;
+    static const Enum<volumeType::type> names;
 
 
 private:
diff --git a/src/OpenFOAM/db/IOobject/IOobject.C b/src/OpenFOAM/db/IOobject/IOobject.C
index ffb6d42ee24..6b67e982c06 100644
--- a/src/OpenFOAM/db/IOobject/IOobject.C
+++ b/src/OpenFOAM/db/IOobject/IOobject.C
@@ -39,18 +39,18 @@ const Foam::Enum
     Foam::IOobject::fileCheckTypes
 >
 Foam::IOobject::fileCheckTypesNames
-{
+({
     { fileCheckTypes::timeStamp, "timeStamp" },
     { fileCheckTypes::timeStampMaster, "timeStampMaster" },
     { fileCheckTypes::inotify, "inotify" },
     { fileCheckTypes::inotifyMaster, "inotifyMaster" },
-};
+});
 
 
 // Default fileCheck type
 Foam::IOobject::fileCheckTypes Foam::IOobject::fileModificationChecking
 (
-    fileCheckTypesNames.lookup
+    fileCheckTypesNames.get
     (
         "fileModificationChecking",
         debug::optimisationSwitches()
diff --git a/src/OpenFOAM/db/IOstreams/IOstreams/IOstreamOption.C b/src/OpenFOAM/db/IOstreams/IOstreams/IOstreamOption.C
index 0e7b7dd844a..2463ac9ac1c 100644
--- a/src/OpenFOAM/db/IOstreams/IOstreams/IOstreamOption.C
+++ b/src/OpenFOAM/db/IOstreams/IOstreams/IOstreamOption.C
@@ -42,10 +42,10 @@ const Foam::Enum
     Foam::IOstreamOption::streamFormat
 >
 Foam::IOstreamOption::formatNames
-{
+({
     { streamFormat::ASCII, "ascii" },
-    { streamFormat::BINARY, "binary" }
-};
+    { streamFormat::BINARY, "binary" },
+});
 
 
 // * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * * //
diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C
index 9b3bf890fae..e1842eb038b 100644
--- a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C
+++ b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C
@@ -41,11 +41,11 @@ const Foam::Enum
     Foam::UPstream::commsTypes
 >
 Foam::UPstream::commsTypeNames
-{
+({
     { commsTypes::blocking, "blocking" },
     { commsTypes::scheduled, "scheduled" },
     { commsTypes::nonBlocking, "nonBlocking" },
-};
+});
 
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
@@ -411,7 +411,7 @@ registerOptSwitch
 
 Foam::UPstream::commsTypes Foam::UPstream::defaultCommsType
 (
-    commsTypeNames.lookup
+    commsTypeNames.get
     (
         "commsType",
         Foam::debug::optimisationSwitches()
@@ -436,10 +436,8 @@ namespace Foam
 
         virtual void readData(Foam::Istream& is)
         {
-            UPstream::defaultCommsType = UPstream::commsTypeNames.read
-            (
-                is
-            );
+            UPstream::defaultCommsType =
+                UPstream::commsTypeNames.read(is);
         }
 
         virtual void writeData(Foam::Ostream& os) const
diff --git a/src/OpenFOAM/db/Time/Time.C b/src/OpenFOAM/db/Time/Time.C
index 51b3819f88b..6a12ebf000c 100644
--- a/src/OpenFOAM/db/Time/Time.C
+++ b/src/OpenFOAM/db/Time/Time.C
@@ -46,14 +46,14 @@ const Foam::Enum
     Foam::Time::stopAtControls
 >
 Foam::Time::stopAtControlNames
-{
+({
     { stopAtControls::saEndTime, "endTime" },
     { stopAtControls::saNoWriteNow, "noWriteNow" },
     { stopAtControls::saWriteNow, "writeNow" },
     { stopAtControls::saNextWrite, "nextWrite" },
     // NOTE: stopAtControls::saUnknown is left untabulated here so that it can
     // be used as fallback value to flag unknown settings
-};
+});
 
 
 const Foam::Enum
@@ -61,13 +61,13 @@ const Foam::Enum
     Foam::Time::writeControls
 >
 Foam::Time::writeControlNames
-{
+({
     { writeControls::wcTimeStep, "timeStep" },
     { writeControls::wcRunTime, "runTime" },
     { writeControls::wcAdjustableRunTime, "adjustableRunTime" },
     { writeControls::wcClockTime, "clockTime" },
     { writeControls::wcCpuTime, "cpuTime" },
-};
+});
 
 
 Foam::Time::fmtflags Foam::Time::format_(Foam::Time::general);
diff --git a/src/OpenFOAM/db/Time/TimeIO.C b/src/OpenFOAM/db/Time/TimeIO.C
index ea45f1b2f38..ed6252d7eb0 100644
--- a/src/OpenFOAM/db/Time/TimeIO.C
+++ b/src/OpenFOAM/db/Time/TimeIO.C
@@ -347,14 +347,12 @@ void Foam::Time::readDict()
         controlDict_.readEntry("deltaT", deltaT_);
     }
 
-    if (controlDict_.found("writeControl"))
-    {
-        writeControl_ = writeControlNames.lookup
-        (
-            "writeControl",
-            controlDict_
-        );
-    }
+    writeControlNames.readIfPresent
+    (
+        "writeControl",
+        controlDict_,
+        writeControl_
+    );
 
     scalar oldWriteInterval = writeInterval_;
 
@@ -435,10 +433,8 @@ void Foam::Time::readDict()
 
     // stopAt at 'endTime' or a specified value
     // if nothing is specified, the endTime is zero
-    if (controlDict_.found("stopAt"))
+    if (stopAtControlNames.readIfPresent("stopAt", controlDict_, stopAt_))
     {
-        stopAt_ = stopAtControlNames.lookup("stopAt", controlDict_);
-
         if (stopAt_ == saEndTime)
         {
             controlDict_.readEntry("endTime", endTime_);
diff --git a/src/OpenFOAM/db/dictionary/functionEntries/inputMode/inputMode.C b/src/OpenFOAM/db/dictionary/functionEntries/inputMode/inputMode.C
index 960e10e86dc..266714e7d79 100644
--- a/src/OpenFOAM/db/dictionary/functionEntries/inputMode/inputMode.C
+++ b/src/OpenFOAM/db/dictionary/functionEntries/inputMode/inputMode.C
@@ -95,7 +95,7 @@ const Foam::Enum
     Foam::entry::inputMode
 >
 Foam::functionEntries::inputMode::selectableNames
-{
+({
     { entry::inputMode::MERGE,  "merge" },
     { entry::inputMode::OVERWRITE, "overwrite" },
     { entry::inputMode::PROTECT, "protect" },
@@ -103,7 +103,7 @@ Foam::functionEntries::inputMode::selectableNames
     { entry::inputMode::ERROR, "error" },
     // Aliases
     { entry::inputMode::MERGE, "default" },
-};
+});
 
 
 // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
@@ -116,7 +116,7 @@ bool Foam::functionEntries::inputMode::execute
 {
     const word modeName(is);
 
-    // Behaviour like Enum lookupOrFailsafe()
+    // Like Enum::lookupOrDefault() with failsafe behaviour
     if (selectableNames.found(modeName))
     {
         entry::globalInputMode = selectableNames[modeName];
diff --git a/src/OpenFOAM/db/functionObjects/timeControl/timeControl.C b/src/OpenFOAM/db/functionObjects/timeControl/timeControl.C
index 1e68e691dca..18742f521ce 100644
--- a/src/OpenFOAM/db/functionObjects/timeControl/timeControl.C
+++ b/src/OpenFOAM/db/functionObjects/timeControl/timeControl.C
@@ -33,7 +33,7 @@ const Foam::Enum
     Foam::timeControl::timeControls
 >
 Foam::timeControl::timeControlNames_
-{
+({
     { timeControl::ocTimeStep, "timeStep" },
     { timeControl::ocWriteTime, "writeTime" },
     { timeControl::ocOutputTime, "outputTime" },
@@ -43,7 +43,7 @@ Foam::timeControl::timeControlNames_
     { timeControl::ocCpuTime, "cpuTime" },
     { timeControl::ocOnEnd, "onEnd" },
     { timeControl::ocNone, "none" },
-};
+});
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
@@ -110,14 +110,8 @@ void Foam::timeControl::read(const dictionary& dict)
         intervalName = "outputInterval";
     }
 
-    if (dict.found(controlName))
-    {
-        timeControl_ = timeControlNames_.lookup(controlName, dict);
-    }
-    else
-    {
-        timeControl_ = ocTimeStep;
-    }
+    timeControl_ =
+        timeControlNames_.lookupOrDefault(controlName, dict, ocTimeStep);
 
     switch (timeControl_)
     {
diff --git a/src/OpenFOAM/interpolations/interpolation2DTable/interpolation2DTable.C b/src/OpenFOAM/interpolations/interpolation2DTable/interpolation2DTable.C
index b624145aeb5..0ac4876dbae 100644
--- a/src/OpenFOAM/interpolations/interpolation2DTable/interpolation2DTable.C
+++ b/src/OpenFOAM/interpolations/interpolation2DTable/interpolation2DTable.C
@@ -93,11 +93,12 @@ Foam::interpolation2DTable<Type>::interpolation2DTable(const dictionary& dict)
     List<Tuple2<scalar, List<Tuple2<scalar, Type>>>>(),
     bounding_
     (
-        bounds::normalBoundingNames.lookupOrFailsafe
+        bounds::normalBoundingNames.lookupOrDefault
         (
             "outOfBounds",
             dict,
-            bounds::normalBounding::WARN
+            bounds::normalBounding::WARN,
+            true  // Failsafe behaviour
         )
     ),
     fileName_(dict.lookup("file")),
diff --git a/src/OpenFOAM/interpolations/interpolationTable/interpolationTable.C b/src/OpenFOAM/interpolations/interpolationTable/interpolationTable.C
index 8b162427e79..a4c3eceb7c7 100644
--- a/src/OpenFOAM/interpolations/interpolationTable/interpolationTable.C
+++ b/src/OpenFOAM/interpolations/interpolationTable/interpolationTable.C
@@ -97,11 +97,12 @@ Foam::interpolationTable<Type>::interpolationTable(const dictionary& dict)
     List<Tuple2<scalar, Type>>(),
     bounding_
     (
-        bounds::repeatableBoundingNames.lookupOrFailsafe
+        bounds::repeatableBoundingNames.lookupOrDefault
         (
             "outOfBounds",
             dict,
-            bounds::repeatableBounding::WARN
+            bounds::repeatableBounding::WARN,
+            true  // Failsafe behaviour
         )
     ),
     fileName_(dict.lookup("file")),
diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.C
index 4090f6eafa9..beb7188e0d1 100644
--- a/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.C
+++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.C
@@ -43,13 +43,13 @@ const Foam::Enum
     Foam::coupledPolyPatch::transformType
 >
 Foam::coupledPolyPatch::transformTypeNames
-{
+({
     { transformType::UNKNOWN, "unknown" },
     { transformType::ROTATIONAL, "rotational" },
     { transformType::TRANSLATIONAL, "translational" },
     { transformType::COINCIDENTFULLMATCH, "coincidentFullMatch" },
     { transformType::NOORDERING, "noOrdering" },
-};
+});
 
 
 // * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
diff --git a/src/OpenFOAM/meshes/primitiveShapes/triangle/intersection.C b/src/OpenFOAM/meshes/primitiveShapes/triangle/intersection.C
index 11392de2dd4..23179f878d0 100644
--- a/src/OpenFOAM/meshes/primitiveShapes/triangle/intersection.C
+++ b/src/OpenFOAM/meshes/primitiveShapes/triangle/intersection.C
@@ -34,10 +34,10 @@ const Foam::Enum
     Foam::intersection::direction
 >
 Foam::intersection::directionNames_
-{
+({
     { intersection::direction::VECTOR, "vector" },
     { intersection::direction::CONTACT_SPHERE, "contactSphere" },
-};
+});
 
 
 const Foam::Enum
@@ -45,11 +45,11 @@ const Foam::Enum
     Foam::intersection::algorithm
 >
 Foam::intersection::algorithmNames_
-{
+({
     { intersection::algorithm::FULL_RAY, "fullRay" },
     { intersection::algorithm::HALF_RAY, "halfRay" },
     { intersection::algorithm::VISIBLE, "visible" },
-};
+});
 
 
 // ************************************************************************* //
diff --git a/src/OpenFOAM/orientedType/orientedType.C b/src/OpenFOAM/orientedType/orientedType.C
index 71f68726d77..deeddd94124 100644
--- a/src/OpenFOAM/orientedType/orientedType.C
+++ b/src/OpenFOAM/orientedType/orientedType.C
@@ -32,11 +32,11 @@ const Foam::Enum
     Foam::orientedType::orientedOption
 >
 Foam::orientedType::orientedOptionNames
-{
+({
     { orientedOption::ORIENTED, "oriented" },
     { orientedOption::UNORIENTED, "unoriented" },
     { orientedOption::UNKNOWN, "unknown" },
-};
+});
 
 
 bool Foam::orientedType::checkType
@@ -45,19 +45,12 @@ bool Foam::orientedType::checkType
     const orientedType& ot2
 )
 {
-    if
+    return
     (
         (ot1.oriented() == UNKNOWN)
      || (ot2.oriented() == UNKNOWN)
      || (ot1.oriented() == ot2.oriented())
-    )
-    {
-        return true;
-    }
-    else
-    {
-        return false;
-    }
+    );
 }
 
 
@@ -115,7 +108,8 @@ void Foam::orientedType::read(const dictionary& dict)
     (
         "oriented",
         dict,
-        orientedOption::UNKNOWN
+        orientedOption::UNKNOWN,
+        true  // Failsafe behaviour
     );
 }
 
diff --git a/src/OpenFOAM/primitives/bools/Switch/Switch.C b/src/OpenFOAM/primitives/bools/Switch/Switch.C
index 098b7f79a54..71e9c1c818e 100644
--- a/src/OpenFOAM/primitives/bools/Switch/Switch.C
+++ b/src/OpenFOAM/primitives/bools/Switch/Switch.C
@@ -112,7 +112,7 @@ Foam::Switch Foam::Switch::lookupOrAddToDict
 (
     const word& name,
     dictionary& dict,
-    const Switch& defaultValue
+    const Switch defaultValue
 )
 {
     return dict.lookupOrAddDefault<Switch>(name, defaultValue);
diff --git a/src/OpenFOAM/primitives/bools/Switch/Switch.H b/src/OpenFOAM/primitives/bools/Switch/Switch.H
index ab4da782aca..d755b2dc268 100644
--- a/src/OpenFOAM/primitives/bools/Switch/Switch.H
+++ b/src/OpenFOAM/primitives/bools/Switch/Switch.H
@@ -75,7 +75,7 @@ public:
     //  The lower bit is tested for the true/false condition.
     //  The values correspond to an index into the predefined output names
     //  for the c_str() method.
-    enum switchType
+    enum switchType : unsigned char
     {
         FALSE   = 0 /*!< "false" */, TRUE = 1 /*!< "true" */,
         NO      = 2 /*!< "no" */,    YES  = 3 /*!< "yes" */,
@@ -164,7 +164,7 @@ public:
         (
             const word& name,
             dictionary& dict,
-            const Switch& defaultValue = switchType::FALSE
+            const Switch defaultValue = switchType::FALSE
         );
 
 
diff --git a/src/OpenFOAM/primitives/enums/Enum.C b/src/OpenFOAM/primitives/enums/Enum.C
index 9bfc6ad5a54..f74a393a562 100644
--- a/src/OpenFOAM/primitives/enums/Enum.C
+++ b/src/OpenFOAM/primitives/enums/Enum.C
@@ -26,127 +26,54 @@ License
 #include "Enum.H"
 #include "dictionary.H"
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
-
-template<class EnumType>
-Foam::label Foam::Enum<EnumType>::getIndex(const word& enumName) const
-{
-    const label n = size();
-    for (label idx=0; idx < n; ++idx)
-    {
-        if (names_[idx] == enumName)
-        {
-            return idx;
-        }
-    }
-
-    return -1;
-}
-
-
-template<class EnumType>
-Foam::label Foam::Enum<EnumType>::getIndex(const EnumType e) const
-{
-    const int val = int(e);
-
-    const label n = size();
-    for (label idx=0; idx < n; ++idx)
-    {
-        if (values_[idx] == val)
-        {
-            return idx;
-        }
-    }
-
-    return -1;
-}
-
-
-template<class EnumType>
-EnumType Foam::Enum<EnumType>::getEnum(const word& enumName) const
-{
-    const label idx = getIndex(enumName);
-
-    if (idx < 0)
-    {
-        FatalErrorInFunction
-            << enumName << " is not in enumeration: "
-            << names_ << exit(FatalError);
-    }
-
-    return EnumType(values_[idx]);
-}
-
-
-template<class EnumType>
-const Foam::word& Foam::Enum<EnumType>::getName(const EnumType e) const
-{
-    const label idx = getIndex(e);
-
-    if (idx < 0)
-    {
-        return word::null;
-    }
-
-    return names_[idx];
-}
-
-
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
 template<class EnumType>
 Foam::Enum<EnumType>::Enum
 (
-    std::initializer_list<std::pair<EnumType, word>> lst
+    std::initializer_list<std::pair<EnumType, const char*>> list
 )
 :
-    names_(lst.size()),
-    values_(lst.size())
+    keys_(list.size()),
+    vals_(list.size())
 {
-    int idx = 0;
-    for (const auto& pair : lst)
+    label i = 0;
+    for (const auto& pair : list)
     {
-        names_[idx]  = pair.second;
-        values_[idx] = int(pair.first);
+        keys_[i] = pair.second;
+        vals_[i] = int(pair.first);
 
-        ++idx;
+        ++i;
     }
 }
 
 
+// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
+
 template<class EnumType>
-Foam::Enum<EnumType>::Enum
-(
-    const EnumType start,
-    std::initializer_list<word> lst
-)
-:
-    names_(lst.size()),
-    values_(lst.size())
+Foam::List<Foam::word> Foam::Enum<EnumType>::sortedToc() const
 {
-    int val = int(start);
+    List<word> list(keys_);
 
-    int idx = 0;
-    for (const auto& key : lst)
-    {
-        names_[idx]  = key;
-        values_[idx] = val;
+    Foam::sort(list);
 
-        ++val;
-        ++idx;
-    }
+    return list;
 }
 
 
-// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
-
 template<class EnumType>
-Foam::List<Foam::word> Foam::Enum<EnumType>::sortedToc() const
+EnumType Foam::Enum<EnumType>::get(const word& enumName) const
 {
-    wordList lst(names_);
-    Foam::sort(lst);
+    const label idx = find(enumName);
 
-    return lst;
+    if (idx < 0)
+    {
+        FatalErrorInFunction
+            << enumName << " is not in enumeration: " << *this << nl
+            << exit(FatalError);
+    }
+
+    return EnumType(vals_[idx]);
 }
 
 
@@ -154,28 +81,17 @@ template<class EnumType>
 EnumType Foam::Enum<EnumType>::read(Istream& is) const
 {
     const word enumName(is);
-    const label idx = getIndex(enumName);
+
+    const label idx = find(enumName);
 
     if (idx < 0)
     {
         FatalIOErrorInFunction(is)
-            << enumName << " is not in enumeration: "
-            << names_ << nl
+            << enumName << " is not in enumeration: " << *this << nl
             << exit(FatalIOError);
     }
 
-    return EnumType(values_[idx]);
-}
-
-
-template<class EnumType>
-void Foam::Enum<EnumType>::write(const EnumType e, Ostream& os) const
-{
-    const label idx = getIndex(e);
-    if (idx >= 0)
-    {
-        os << names_[idx];
-    }
+    return EnumType(vals_[idx]);
 }
 
 
@@ -186,29 +102,18 @@ EnumType Foam::Enum<EnumType>::get
     const dictionary& dict
 ) const
 {
-    const word enumName(dict.get<word>(key));
-    const label idx = getIndex(enumName);
+    const word enumName(dict.get<word>(key, keyType::LITERAL));
+
+    const label idx = find(enumName);
 
     if (idx < 0)
     {
         FatalIOErrorInFunction(dict)
-            << enumName << " is not in enumeration: "
-            << names_ << nl
+            << enumName << " is not in enumeration: " << *this << nl
             << exit(FatalIOError);
     }
 
-    return EnumType(values_[idx]);
-}
-
-
-template<class EnumType>
-EnumType Foam::Enum<EnumType>::lookup
-(
-    const word& key,
-    const dictionary& dict
-) const
-{
-    return this->get(key, dict);
+    return EnumType(vals_[idx]);
 }
 
 
@@ -217,55 +122,96 @@ EnumType Foam::Enum<EnumType>::lookupOrDefault
 (
     const word& key,
     const dictionary& dict,
-    const EnumType deflt
+    const EnumType defaultValue,
+    const bool failsafe
 ) const
 {
-    if (dict.found(key))
+    const entry* eptr = dict.findEntry(key, keyType::LITERAL);
+
+    if (eptr)
     {
-        return get(key, dict);
+        const word enumName(eptr->get<word>());
+
+        const label idx = find(enumName);
+
+        if (idx >= 0)
+        {
+            return EnumType(vals_[idx]);
+        }
+
+        // Found the entry, but failed the name lookup
+
+        if (failsafe)
+        {
+            IOWarningInFunction(dict)
+                << enumName << " is not in enumeration: " << *this << nl
+                << "using failsafe " << get(defaultValue)
+                << " (value " << int(defaultValue) << ")" << endl;
+        }
+        else
+        {
+            FatalIOErrorInFunction(dict)
+                << enumName << " is not in enumeration: " << *this << nl
+                << exit(FatalIOError);
+        }
     }
 
-    return deflt;
+    return defaultValue;
 }
 
 
 template<class EnumType>
-EnumType Foam::Enum<EnumType>::lookupOrFailsafe
+bool Foam::Enum<EnumType>::readEntry
 (
     const word& key,
     const dictionary& dict,
-    const EnumType deflt
+    EnumType& val,
+    bool mandatory
 ) const
 {
-    if (dict.found(key))
+    const entry* eptr = dict.findEntry(key, keyType::LITERAL);
+
+    if (eptr)
     {
-        const word enumName(dict.get<word>(key));
-        const label idx = getIndex(enumName);
+        const word enumName(eptr->get<word>());
+
+        const label idx = find(enumName);
 
         if (idx >= 0)
         {
-            return EnumType(values_[idx]);
+            val = EnumType(vals_[idx]);
+
+            return true;
         }
 
-        IOWarningInFunction(dict)
-            << "bad " << key <<" specifier " << enumName
-            << " using " << getName(deflt) << endl;
+        if (mandatory)
+        {
+            FatalIOErrorInFunction(dict)
+                << enumName << " is not in enumeration: " << *this << nl
+                << exit(FatalIOError);
+        }
+    }
+    else if (mandatory)
+    {
+        FatalIOErrorInFunction(dict)
+            << "'" << key << "' not found in dictionary " << dict.name() << nl
+            << exit(FatalIOError);
     }
 
-    return deflt;
+    return false;
 }
 
 
-// * * * * * * * * * * * * * * * IOstream Operators  * * * * * * * * * * * * //
-
 template<class EnumType>
-Foam::Ostream& Foam::operator<<
+bool Foam::Enum<EnumType>::readIfPresent
 (
-    Ostream& os,
-    const Enum<EnumType>& wrapped
-)
+    const word& key,
+    const dictionary& dict,
+    EnumType& val
+) const
 {
-    return wrapped.names().writeList(os, 10);
+    // Reading is non-mandatory
+    return readEntry(key, dict, val, false);
 }
 
 
diff --git a/src/OpenFOAM/primitives/enums/Enum.H b/src/OpenFOAM/primitives/enums/Enum.H
index 480ed06908d..f85b8985d89 100644
--- a/src/OpenFOAM/primitives/enums/Enum.H
+++ b/src/OpenFOAM/primitives/enums/Enum.H
@@ -29,8 +29,8 @@ Description
     enumeration values.
 
 SourceFiles
-    EnumI.H
     Enum.C
+    EnumI.H
 
 \*---------------------------------------------------------------------------*/
 
@@ -45,13 +45,11 @@ SourceFiles
 
 namespace Foam
 {
+
 // Forward declarations
 class dictionary;
 template<class EnumType> class Enum;
 
-template<class EnumType>
-Ostream& operator<<(Ostream& os, const Enum<EnumType>& wrapped);
-
 /*---------------------------------------------------------------------------*\
                             Class Enum Declaration
 \*---------------------------------------------------------------------------*/
@@ -62,89 +60,79 @@ class Enum
     // Private Member Data
 
         //- The names for the enum
-        List<word> names_;
+        List<word> keys_;
 
         //- The values for the enum
-        List<int> values_;
-
-
-    // Private Member Functions
-
-        //- The index for the given name. -1 if not found.
-        label getIndex(const word& enumName) const;
-
-        //- The index for the given enumeration. -1 if not found.
-        label getIndex(const EnumType e) const;
-
-        //- Get enumeration corresponding to the given name.
-        //  FatalError if not found.
-        EnumType getEnum(const word& enumName) const;
-
-        //- Get name corresponding to the given enumeration.
-        //  Return empty word if not found.
-        const word& getName(const EnumType e) const;
-
-
-        //- No copy construct
-        Enum(const Enum&) = delete;
-
-        //- No copy assignment
-        void operator=(const Enum&) = delete;
+        List<int> vals_;
 
 
 public:
 
-    //- The type of enumeration wrapped by Enum
+    //- The type of enumeration represented by the Enum
     typedef EnumType value_type;
 
+    // Normally only enum, but be generous and allow integrals as well
+    static_assert
+    (
+        std::is_enum<EnumType>::value || std::is_integral<EnumType>::value,
+        "Enum must be enum or an integral type"
+    );
+
 
     // Constructors
 
         //- Construct from a values/names list.
         //  Duplicate values are permitted (eg, for aliases).
         //  Duplicate names are permitted, but won't make much sense.
-        explicit Enum(std::initializer_list<std::pair<EnumType, word>> lst);
-
-        //- Construct from a list of names with values incremented from the
-        //- specified start value.
-        Enum(const EnumType start, std::initializer_list<word> lst);
+        explicit Enum
+        (
+            std::initializer_list<std::pair<EnumType, const char*>> list
+        );
 
 
     // Member Functions
 
     // Access
 
-        //- The number of enum names for the enumeration
+        //- The number of name/value pairs for the enumeration.
         inline label size() const;
 
-        //- The list of enum names, in construction order
+        //- The list of enum names, in construction order. Same as toc()
         inline const List<word>& names() const;
 
-        //- The list of enum names, in construction order
+        //- The list of enum names, in construction order. Same as names()
         inline const List<word>& toc() const;
 
-        //- The sorted list of enum names
+        //- The sorted list of enum names.
         List<word> sortedToc() const;
 
-        //- The list of enum values, in construction order
+        //- The list of enum values, in construction order.
         inline const List<int>& values() const;
 
 
     // Query
 
+        //- Find the index of the given name.
+        //  \return position in list or -1 if not found.
+        inline label find(const word& enumName) const;
+
+        //- Find the first index of given enumeration.
+        //  \return position in list or -1 if not found.
+        inline label find(const EnumType e) const;
+
         //- Test if there is an enumeration corresponding to the given name.
         inline bool found(const word& enumName) const;
 
         //- Test if there is a name corresponding to the given enumeration.
         inline bool found(const EnumType e) const;
 
-        //- Test if there is an enumeration corresponding to the given name.
-        //  \deprecated Use found() - for compatibility with NamedEnum
-        inline bool hasEnum(const word& enumName) const;
+        //- The enumeration corresponding to the given name.
+        //  FatalError if not found.
+        EnumType get(const word& enumName) const;
 
-        //- Test if there is a name corresponding to the given enumeration.
-        //  \deprecated Use found() - for compatibility with NamedEnum
-        inline bool hasName(const EnumType e) const;
+        //- The name corresponding to the given enumeration.
+        //  Return an empty word if not found.
+        inline const word& get(const EnumType e) const;
 
 
     // Read
@@ -152,32 +140,48 @@ public:
         //- Get the key in the dictionary and return the corresponding
         //- enumeration element based on its name.
         //  FatalError if anything is incorrect.
-        EnumType get(const word& key, const dictionary& dict) const;
-
-        //- Same as get()
-        EnumType lookup(const word& key, const dictionary& dict) const;
+        EnumType get
+        (
+            const word& key,        //!< Lookup key. Uses LITERAL (not REGEX)
+            const dictionary& dict  //!< dictionary
+        ) const;
 
         //- Find the key in the dictionary and return the corresponding
         //- enumeration element based on its name.
-        //  Return the default value if the key was not found in the dictionary.
-        //  FatalError if the enumerated name was incorrect.
+        //
+        //  \return The value found or default if not found in dictionary.
+        //  FatalError (or Warning) if the enumerated name was incorrect.
         EnumType lookupOrDefault
         (
-            const word& key,
-            const dictionary& dict,
-            const EnumType deflt
+            const word& key,        //!< Lookup key. Uses LITERAL (not REGEX)
+            const dictionary& dict, //!< dictionary
+            const EnumType defaultValue, //!< fallback if not found
+            const bool failsafe = false  //!< Warn only on bad enumeration
         ) const;
 
+        //- Find entry and assign to T val.
+        //- FatalIOError if it is found and the number of tokens is incorrect,
+        //- or it is mandatory and not found.
+        //
+        //  \return true if the entry was found.
+        bool readEntry
+        (
+            const word& key,        //!< Lookup key. Uses LITERAL (not REGEX)
+            const dictionary& dict, //!< dictionary
+            EnumType& val,          //!< the value to read into
+            bool mandatory = true   //!< the keyword is mandatory
+        ) const;
 
-        //- Find the key in the dictionary and return the corresponding
-        //- enumeration element based on its name.
-        //  Return the default value if the key was not found in the dictionary
-        //  or if the enumerated name was incorrect (emit warning)
-        EnumType lookupOrFailsafe
+        //- Find an entry if present, and assign to T val.
+        //- FatalIOError if it is found and the number of tokens is incorrect.
+        //  Default search: non-recursive with patterns.
+        //
+        //  \return true if the entry was found.
+        bool readIfPresent
         (
-            const word& key,
-            const dictionary& dict,
-            const EnumType deflt
+            const word& key,        //!< Lookup key. Uses LITERAL (not REGEX)
+            const dictionary& dict, //!< dictionary
+            EnumType& val           //!< the value to read into
         ) const;
 
 
@@ -188,49 +192,64 @@ public:
 
         //- Write the name representation of the enumeration to an Ostream
         //  A noop if the enumeration wasn't found.
-        void write(const EnumType e, Ostream& os) const;
+        inline void write(const EnumType e, Ostream& os) const;
 
-        //- Write the names as a list to an Ostream
-        inline Ostream& writeList
-        (
-            Ostream& os,
-            const label shortListLen=0
-        ) const;
+        //- Write the names as a list to an Ostream.
+        //  Default is without line-breaks.
+        inline Ostream& writeList(Ostream& os, const label shortLen=0) const;
 
 
     // Member Operators
 
         //- Return the enumeration corresponding to the given name
         //  FatalError if the name is not found.
-        //  Identical to getEnum()
+        //  Identical to single parameter get()
         inline EnumType operator[](const word& enumName) const;
 
         //- Return the first name corresponding to the given enumeration.
         //  Returns an empty word on failure.
-        //  Identical to getName()
+        //  Identical to single parameter get()
         inline const word& operator[](const EnumType e) const;
 
-        //- Return the enumeration corresponding to the given name or deflt
-        //- if the name is not found.
+        //- Return the enumeration corresponding to the given name or
+        //- defaultValue if the name is not found.
         inline EnumType operator()
         (
             const word& enumName,
-            const EnumType deflt
+            const EnumType defaultValue
         ) const;
 
 
-    // IOstream operators
+    // Housekeeping
 
-        //- Write names to Ostream, as per writeList() with shortListLen=10
-        friend Ostream& operator<< <EnumType>
-        (
-            Ostream& os,
-            const Enum<EnumType>& wrapped
-        );
+        //- Same as two-parameter get()
+        //  \deprecated Use two-parameter get() instead (OCT-2018)
+        inline EnumType lookup(const word& key, const dictionary& dict) const
+        {
+            return get(key, dict);
+        }
 
+        //- Perform lookupOrDefault with warnings instead of error.
+        //  \deprecated use lookupOrDefault with failsafe option (OCT-2018)
+        EnumType lookupOrFailsafe
+        (
+            const word& key,
+            const dictionary& dict,
+            const EnumType defaultValue
+        ) const
+        {
+            return lookupOrDefault(key, dict, defaultValue, true);
+        }
 };
 
 
+// Ostream Operator
+
+//- Write enumeration names, without line-breaks (ie, FlatOutput)
+template<class EnumType>
+inline Ostream& operator<<(Ostream& os, const Enum<EnumType>& list);
+
+
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 } // End namespace Foam
diff --git a/src/OpenFOAM/primitives/enums/EnumI.H b/src/OpenFOAM/primitives/enums/EnumI.H
index d6e547c4bf1..35937fa6138 100644
--- a/src/OpenFOAM/primitives/enums/EnumI.H
+++ b/src/OpenFOAM/primitives/enums/EnumI.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2017 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2017-2018 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -28,56 +28,70 @@ License
 template<class EnumType>
 inline Foam::label Foam::Enum<EnumType>::size() const
 {
-    return names_.size();
+    return keys_.size();
 }
 
 
 template<class EnumType>
 inline const Foam::wordList& Foam::Enum<EnumType>::names() const
 {
-    return names_;
+    return keys_;
 }
 
 
 template<class EnumType>
 inline const Foam::wordList& Foam::Enum<EnumType>::toc() const
 {
-    return names_;
+    return keys_;
 }
 
 
 template<class EnumType>
 inline const Foam::List<int>& Foam::Enum<EnumType>::values() const
 {
-    return values_;
+    return vals_;
 }
 
 
 template<class EnumType>
-inline bool Foam::Enum<EnumType>::found(const word& enumName) const
+inline Foam::label Foam::Enum<EnumType>::find(const word& enumName) const
 {
-    return getIndex(enumName) >= 0;
+    return keys_.find(enumName);
 }
 
 
 template<class EnumType>
-inline bool Foam::Enum<EnumType>::found(const EnumType e) const
+inline Foam::label Foam::Enum<EnumType>::find(const EnumType e) const
+{
+    return vals_.find(int(e));
+}
+
+
+template<class EnumType>
+inline bool Foam::Enum<EnumType>::found(const word& enumName) const
 {
-    return getIndex(e) >= 0;
+    return keys_.found(enumName);
 }
 
 
 template<class EnumType>
-inline bool Foam::Enum<EnumType>::hasEnum(const word& enumName) const
+inline bool Foam::Enum<EnumType>::found(const EnumType e) const
 {
-    return getIndex(enumName) >= 0;
+    return vals_.found(int(e));
 }
 
 
 template<class EnumType>
-inline bool Foam::Enum<EnumType>::hasName(const EnumType e) const
+inline const Foam::word& Foam::Enum<EnumType>::get(const EnumType e) const
 {
-    return getIndex(e) >= 0;
+    const label idx = find(e);
+
+    if (idx < 0)
+    {
+        return word::null;
+    }
+
+    return keys_[idx];
 }
 
 
@@ -85,10 +99,22 @@ template<class EnumType>
 inline Foam::Ostream& Foam::Enum<EnumType>::writeList
 (
     Ostream& os,
-    const label shortListLen
+    const label shortLen
 ) const
 {
-    return names_.writeList(os, shortListLen);
+    return keys_.writeList(os, shortLen);
+}
+
+
+template<class EnumType>
+inline void Foam::Enum<EnumType>::write(const EnumType e, Ostream& os) const
+{
+    const label idx = find(e);
+
+    if (idx >= 0)
+    {
+        os << keys_[idx];
+    }
 }
 
 
@@ -100,7 +126,7 @@ inline EnumType Foam::Enum<EnumType>::operator[]
     const word& enumName
 ) const
 {
-    return getEnum(enumName);
+    return get(enumName);
 }
 
 
@@ -110,7 +136,7 @@ inline const Foam::word& Foam::Enum<EnumType>::operator[]
     const EnumType e
 ) const
 {
-    return getName(e);
+    return get(e);
 }
 
 
@@ -118,17 +144,26 @@ template<class EnumType>
 inline EnumType Foam::Enum<EnumType>::operator()
 (
     const word& enumName,
-    const EnumType deflt
+    const EnumType defaultValue
 ) const
 {
-    const label idx = getIndex(enumName);
+    const label idx = find(enumName);
 
     if (idx >= 0)
     {
-        return EnumType(values_[idx]);
+        return EnumType(vals_[idx]);
     }
 
-    return deflt;
+    return defaultValue;
+}
+
+
+// * * * * * * * * * * * * * * * IOstream Operators  * * * * * * * * * * * * //
+
+template<class EnumType>
+inline Foam::Ostream& Foam::operator<<(Ostream& os, const Enum<EnumType>& list)
+{
+    return list.names().writeList(os, 0);
 }
 
 
diff --git a/src/OpenFOAM/primitives/functions/Function1/Table/TableBase.C b/src/OpenFOAM/primitives/functions/Function1/Table/TableBase.C
index c068e240c27..cf21e6ecc08 100644
--- a/src/OpenFOAM/primitives/functions/Function1/Table/TableBase.C
+++ b/src/OpenFOAM/primitives/functions/Function1/Table/TableBase.C
@@ -66,11 +66,12 @@ Foam::Function1Types::TableBase<Type>::TableBase
     name_(name),
     bounding_
     (
-        bounds::repeatableBoundingNames.lookupOrFailsafe
+        bounds::repeatableBoundingNames.lookupOrDefault
         (
             "outOfBounds",
             dict,
-            bounds::repeatableBounding::CLAMP
+            bounds::repeatableBounding::CLAMP,
+            true  // Failsafe behaviour
         )
     ),
     interpolationScheme_
diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C
index e0834f3b58a..cdc526810f6 100644
--- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C
+++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C
@@ -38,11 +38,11 @@ const Foam::Enum
     Foam::externalWallHeatFluxTemperatureFvPatchScalarField::operationMode
 >
 Foam::externalWallHeatFluxTemperatureFvPatchScalarField::operationModeNames
-{
+({
     { operationMode::fixedPower, "power" },
     { operationMode::fixedHeatFlux, "flux" },
     { operationMode::fixedHeatTransferCoeff, "coefficient" },
-};
+});
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
@@ -84,7 +84,7 @@ externalWallHeatFluxTemperatureFvPatchScalarField
 :
     mixedFvPatchScalarField(p, iF),
     temperatureCoupledBase(patch(), dict),
-    mode_(operationModeNames.lookup("mode", dict)),
+    mode_(operationModeNames.get("mode", dict)),
     Q_(0),
     q_(),
     h_(),
diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C
index eade488e867..9f38a60eb40 100644
--- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C
+++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C
@@ -36,12 +36,12 @@ const Foam::Enum
     Foam::temperatureCoupledBase::KMethodType
 >
 Foam::temperatureCoupledBase::KMethodTypeNames_
-{
+({
     { KMethodType::mtFluidThermo, "fluidThermo" },
     { KMethodType::mtSolidThermo, "solidThermo" },
     { KMethodType::mtDirectionalSolidThermo, "directionalSolidThermo" },
     { KMethodType::mtLookup, "lookup" },
-};
+});
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
@@ -68,7 +68,7 @@ Foam::temperatureCoupledBase::temperatureCoupledBase
 )
 :
     patch_(patch),
-    method_(KMethodTypeNames_.lookup("kappaMethod", dict)),
+    method_(KMethodTypeNames_.get("kappaMethod", dict)),
     kappaName_(dict.lookupOrDefault<word>("kappa", "none")),
     alphaAniName_(dict.lookupOrDefault<word>("alphaAni","none"))
 {
diff --git a/src/combustionModels/EDC/EDCs.C b/src/combustionModels/EDC/EDCs.C
index 62ad797cb55..3e1cd5d510f 100644
--- a/src/combustionModels/EDC/EDCs.C
+++ b/src/combustionModels/EDC/EDCs.C
@@ -36,12 +36,12 @@ const Foam::Enum
     Foam::combustionModels::EDCversions
 >
 Foam::combustionModels::EDCversionNames
-{
+({
     { EDCversions::v1981, "v1981" },
     { EDCversions::v1996, "v1996" },
     { EDCversions::v2005, "v2005" },
     { EDCversions::v2016, "v2016" },
-};
+});
 
 const Foam::combustionModels::EDCversions
 Foam::combustionModels::EDCdefaultVersion(EDCversions::v2005);
diff --git a/src/dynamicMesh/meshCut/directions/directions.C b/src/dynamicMesh/meshCut/directions/directions.C
index b6a4db66e53..6846e30c4ea 100644
--- a/src/dynamicMesh/meshCut/directions/directions.C
+++ b/src/dynamicMesh/meshCut/directions/directions.C
@@ -40,11 +40,11 @@ const Foam::Enum
     Foam::directions::directionType
 >
 Foam::directions::directionTypeNames_
-{
+({
     { directionType::TAN1, "tan1" },
     { directionType::TAN2, "tan2" },
     { directionType::NORMAL, "normal" },
-};
+});
 
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/tetDecomposer.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/tetDecomposer.C
index dde8008349d..17f0c3d1e60 100644
--- a/src/dynamicMesh/polyTopoChange/polyTopoChange/tetDecomposer.C
+++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/tetDecomposer.C
@@ -45,11 +45,11 @@ const Foam::Enum
     Foam::tetDecomposer::decompositionType
 >
 Foam::tetDecomposer::decompositionTypeNames
-{
+({
     { decompositionType::FACE_CENTRE_TRIS,  "faceCentre" },
     { decompositionType::FACE_DIAG_TRIS, "faceDiagonal" },
     { decompositionType::PYRAMID, "pyramid" },
-};
+});
 
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
diff --git a/src/dynamicMesh/slidingInterface/slidingInterface.C b/src/dynamicMesh/slidingInterface/slidingInterface.C
index 400ce29ec00..0a6b9635510 100644
--- a/src/dynamicMesh/slidingInterface/slidingInterface.C
+++ b/src/dynamicMesh/slidingInterface/slidingInterface.C
@@ -53,10 +53,10 @@ const Foam::Enum
     Foam::slidingInterface::typeOfMatch
 >
 Foam::slidingInterface::typeOfMatchNames
-{
+({
     { typeOfMatch::INTEGRAL, "integral" },
     { typeOfMatch::PARTIAL, "partial" },
-};
+});
 
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
@@ -241,12 +241,12 @@ Foam::slidingInterface::slidingInterface
         dict.lookup("slavePatchName"),
         mme.mesh().boundaryMesh()
     ),
-    matchType_(typeOfMatchNames.lookup("typeOfMatch", dict)),
+    matchType_(typeOfMatchNames.get("typeOfMatch", dict)),
     coupleDecouple_(dict.lookup("coupleDecouple")),
     attached_(dict.lookup("attached")),
     projectionAlgo_
     (
-        intersection::algorithmNames_.read(dict.lookup("projection"))
+        intersection::algorithmNames_.get("projection", dict)
     ),
     trigger_(false),
     cutFaceMasterPtr_(nullptr),
diff --git a/src/fileFormats/coordSet/coordSet.C b/src/fileFormats/coordSet/coordSet.C
index e1ed73bc6ad..1ec1173aebf 100644
--- a/src/fileFormats/coordSet/coordSet.C
+++ b/src/fileFormats/coordSet/coordSet.C
@@ -32,13 +32,13 @@ const Foam::Enum
     Foam::coordSet::coordFormat
 >
 Foam::coordSet::coordFormatNames
-{
+({
     { coordFormat::XYZ, "xyz" },
     { coordFormat::X, "x" },
     { coordFormat::Y, "y" },
     { coordFormat::Z, "z" },
-    { coordFormat::DISTANCE, "distance" }
-};
+    { coordFormat::DISTANCE, "distance" },
+});
 
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
diff --git a/src/fileFormats/fire/FIRECore.C b/src/fileFormats/fire/FIRECore.C
index 02ebc4c3ff0..a8713e8be7e 100644
--- a/src/fileFormats/fire/FIRECore.C
+++ b/src/fileFormats/fire/FIRECore.C
@@ -32,12 +32,12 @@ const Foam::Enum
     Foam::fileFormats::FIRECore::fileExt3d
 >
 Foam::fileFormats::FIRECore::file3dExtensions
-{
+({
     { fileExt3d::POLY_ASCII, "fpma" },
     { fileExt3d::POLY_BINARY, "fpmb" },
     { fileExt3d::POLY_ASCII_Z, "fpmaz" },
-    { fileExt3d::POLY_BINARY_Z, "fpmbz" }
-};
+    { fileExt3d::POLY_BINARY_Z, "fpmbz" },
+});
 
 
 // * * * * * * * * * * *  Protected Member Functions * * * * * * * * * * * * //
diff --git a/src/fileFormats/nas/NASCore.C b/src/fileFormats/nas/NASCore.C
index 59fc99cb51e..610306c17b3 100644
--- a/src/fileFormats/nas/NASCore.C
+++ b/src/fileFormats/nas/NASCore.C
@@ -35,11 +35,11 @@ const Foam::Enum
     Foam::fileFormats::NASCore::fieldFormat
 >
 Foam::fileFormats::NASCore::fieldFormatNames
-{
+({
     { fieldFormat::SHORT, "short" },
     { fieldFormat::LONG,  "long" },
     { fieldFormat::FREE,  "free" },
-};
+});
 
 
 // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
diff --git a/src/fileFormats/starcd/STARCDCore.C b/src/fileFormats/starcd/STARCDCore.C
index c98849dd75d..769b5867606 100644
--- a/src/fileFormats/starcd/STARCDCore.C
+++ b/src/fileFormats/starcd/STARCDCore.C
@@ -39,11 +39,11 @@ const Foam::Enum
     Foam::fileFormats::STARCDCore::fileHeader
 >
 Foam::fileFormats::STARCDCore::fileHeaders_
-{
+({
     { fileHeader::HEADER_CEL, "PROSTAR_CELL" },
     { fileHeader::HEADER_VRT, "PROSTAR_VERTEX" },
-    { fileHeader::HEADER_BND, "PROSTAR_BOUNDARY" }
-};
+    { fileHeader::HEADER_BND, "PROSTAR_BOUNDARY" },
+});
 
 
 const Foam::Enum
@@ -51,12 +51,12 @@ const Foam::Enum
     Foam::fileFormats::STARCDCore::fileExt
 >
 Foam::fileFormats::STARCDCore::fileExtensions_
-{
+({
     { fileExt::CEL_FILE, "cel" },
     { fileExt::VRT_FILE, "vrt" },
     { fileExt::BND_FILE, "bnd" },
-    { fileExt::INP_FILE, "inp" }
-};
+    { fileExt::INP_FILE, "inp" },
+});
 
 
 const char* const Foam::fileFormats::STARCDCore::defaultBoundaryName =
diff --git a/src/fileFormats/vtk/core/foamVtkCore.C b/src/fileFormats/vtk/core/foamVtkCore.C
index 6b8ab91b930..7a61ccb0345 100644
--- a/src/fileFormats/vtk/core/foamVtkCore.C
+++ b/src/fileFormats/vtk/core/foamVtkCore.C
@@ -32,7 +32,7 @@ const Foam::Enum
     Foam::vtk::fileTag
 >
 Foam::vtk::fileTagNames
-{
+({
     { fileTag::VTK_FILE, "VTKFile" },
     { fileTag::DATA_ARRAY, "DataArray" },
     { fileTag::PIECE, "Piece" },
@@ -47,7 +47,7 @@ Foam::vtk::fileTagNames
     { fileTag::POLY_DATA, "PolyData" },
     { fileTag::UNSTRUCTURED_GRID, "UnstructuredGrid" },
     { fileTag::MULTI_BLOCK, "vtkMultiBlockDataSet" },
-};
+});
 
 
 const Foam::Enum
@@ -55,7 +55,7 @@ const Foam::Enum
     Foam::vtk::fileAttr
 >
 Foam::vtk::fileAttrNames
-{
+({
     { fileAttr::OFFSET, "offset" },
     { fileAttr::NUMBER_OF_COMPONENTS, "NumberOfComponents" },
     { fileAttr::NUMBER_OF_POINTS, "NumberOfPoints" },
@@ -63,7 +63,7 @@ Foam::vtk::fileAttrNames
     { fileAttr::NUMBER_OF_POLYS, "NumberOfPolys" },
     { fileAttr::NUMBER_OF_VERTS, "NumberOfVerts" },
     { fileAttr::NUMBER_OF_LINES, "NumberOfLines" },
-};
+});
 
 
 const Foam::Enum
@@ -71,14 +71,14 @@ const Foam::Enum
     Foam::vtk::dataArrayAttr
 >
 Foam::vtk::dataArrayAttrNames
-{
+({
     { dataArrayAttr::POINTS, "Points" },
     { dataArrayAttr::OFFSETS, "offsets" },
     { dataArrayAttr::CONNECTIVITY, "connectivity" },
     { dataArrayAttr::TYPES, "types" },
     { dataArrayAttr::FACES, "faces" },
     { dataArrayAttr::FACEOFFSETS, "faceoffsets" },
-};
+});
 
 
 // ************************************************************************* //
diff --git a/src/fileFormats/vtk/output/foamVtkOutput.C b/src/fileFormats/vtk/output/foamVtkOutput.C
index 2ee7dbd7a57..589537fd286 100644
--- a/src/fileFormats/vtk/output/foamVtkOutput.C
+++ b/src/fileFormats/vtk/output/foamVtkOutput.C
@@ -42,10 +42,10 @@ const Foam::Enum
     Foam::vtk::fileTag
 >
 Foam::vtk::legacy::contentNames
-{
+({
     { vtk::fileTag::POLY_DATA, "POLYDATA" },
     { vtk::fileTag::UNSTRUCTURED_GRID, "UNSTRUCTURED_GRID" },
-};
+});
 
 
 const Foam::Enum
@@ -53,10 +53,10 @@ const Foam::Enum
     Foam::vtk::fileTag
 >
 Foam::vtk::legacy::dataTypeNames
-{
+({
     { vtk::fileTag::CELL_DATA, "CELL_DATA" },
     { vtk::fileTag::POINT_DATA, "POINT_DATA" }
-};
+});
 
 
 // * * * * * * * * * * * * * * Global Functions  * * * * * * * * * * * * * * //
diff --git a/src/fileFormats/vtk/read/vtkUnstructuredReader.C b/src/fileFormats/vtk/read/vtkUnstructuredReader.C
index a79283fb8e3..4bf27446327 100644
--- a/src/fileFormats/vtk/read/vtkUnstructuredReader.C
+++ b/src/fileFormats/vtk/read/vtkUnstructuredReader.C
@@ -43,7 +43,7 @@ const Foam::Enum
     Foam::vtkUnstructuredReader::vtkDataType
 >
 Foam::vtkUnstructuredReader::vtkDataTypeNames
-{
+({
     { vtkDataType::VTK_INT, "int" },
     { vtkDataType::VTK_UINT, "unsigned_int" },
     { vtkDataType::VTK_LONG, "long" },
@@ -51,8 +51,8 @@ Foam::vtkUnstructuredReader::vtkDataTypeNames
     { vtkDataType::VTK_FLOAT, "float" },
     { vtkDataType::VTK_DOUBLE, "double" },
     { vtkDataType::VTK_STRING, "string" },
-    { vtkDataType::VTK_ID, "vtkIdType" }
-};
+    { vtkDataType::VTK_ID, "vtkIdType" },
+});
 
 
 const Foam::Enum
@@ -60,11 +60,11 @@ const Foam::Enum
     Foam::vtkUnstructuredReader::vtkDataSetType
 >
 Foam::vtkUnstructuredReader::vtkDataSetTypeNames
-{
+({
     { vtkDataSetType::VTK_FIELD, "FIELD" },
     { vtkDataSetType::VTK_SCALARS, "SCALARS" },
-    { vtkDataSetType::VTK_VECTORS, "VECTORS" }
-};
+    { vtkDataSetType::VTK_VECTORS, "VECTORS" },
+});
 
 
 const Foam::Enum
@@ -72,13 +72,13 @@ const Foam::Enum
     Foam::vtkUnstructuredReader::parseMode
 >
 Foam::vtkUnstructuredReader::parseModeNames
-{
+({
     { parseMode::NOMODE, "NOMODE" },
     { parseMode::UNSTRUCTURED_GRID, "UNSTRUCTURED_GRID" },
     { parseMode::POLYDATA, "POLYDATA" },
     { parseMode::CELL_DATA, "CELL_DATA" },
-    { parseMode::POINT_DATA, "POINT_DATA" }
-};
+    { parseMode::POINT_DATA, "POINT_DATA" },
+});
 
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fanPressure/fanPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/fanPressure/fanPressureFvPatchScalarField.C
index 15fc6dcaec7..227533bf23e 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/fanPressure/fanPressureFvPatchScalarField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/fanPressure/fanPressureFvPatchScalarField.C
@@ -35,10 +35,10 @@ const Foam::Enum
     Foam::fanPressureFvPatchScalarField::fanFlowDirection
 >
 Foam::fanPressureFvPatchScalarField::fanFlowDirectionNames_
-{
+({
     { fanFlowDirection::ffdIn, "in" },
     { fanFlowDirection::ffdOut, "out" },
-};
+});
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
@@ -84,7 +84,7 @@ Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField
 :
     totalPressureFvPatchScalarField(p, iF, dict),
     fanCurve_(dict),
-    direction_(fanFlowDirectionNames_.lookup("direction", dict)),
+    direction_(fanFlowDirectionNames_.get("direction", dict)),
     nonDimensional_(dict.lookupOrDefault<Switch>("nonDimensional", false)),
     rpm_(dict.lookupOrDefault<scalar>("rpm", 0.0)),
     dm_(dict.lookupOrDefault<scalar>("dm", 0.0))
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C
index 65985dab41c..d032b31af80 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C
@@ -40,7 +40,7 @@ const Foam::Enum
     Foam::waveSurfacePressureFvPatchScalarField::ddtSchemeType
 >
 Foam::waveSurfacePressureFvPatchScalarField::ddtSchemeTypeNames_
-{
+({
     {
         ddtSchemeType::tsEuler,
         fv::EulerDdtScheme<scalar>::typeName_()
@@ -53,7 +53,7 @@ Foam::waveSurfacePressureFvPatchScalarField::ddtSchemeTypeNames_
         ddtSchemeType::tsBackward,
         fv::backwardDdtScheme<scalar>::typeName_()
     },
-};
+});
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
diff --git a/src/finiteVolume/functionObjects/volRegion/volRegion.C b/src/finiteVolume/functionObjects/volRegion/volRegion.C
index 5071085ec80..1f4779afebd 100644
--- a/src/finiteVolume/functionObjects/volRegion/volRegion.C
+++ b/src/finiteVolume/functionObjects/volRegion/volRegion.C
@@ -43,10 +43,10 @@ const Foam::Enum
     Foam::functionObjects::volRegion::regionTypes
 >
 Foam::functionObjects::volRegion::regionTypeNames_
-{
+({
     { regionTypes::vrtCellZone, "cellZone" },
     { regionTypes::vrtAll, "all" },
-};
+});
 
 
 // * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
diff --git a/src/functionObjects/field/fieldAverage/fieldAverageItem/fieldAverageItem.C b/src/functionObjects/field/fieldAverage/fieldAverageItem/fieldAverageItem.C
index 134a49ef364..aecb0973d5e 100644
--- a/src/functionObjects/field/fieldAverage/fieldAverageItem/fieldAverageItem.C
+++ b/src/functionObjects/field/fieldAverage/fieldAverageItem/fieldAverageItem.C
@@ -44,10 +44,10 @@ const Foam::Enum
     Foam::functionObjects::fieldAverageItem::baseType
 >
 Foam::functionObjects::fieldAverageItem::baseTypeNames_
-{
+({
     { baseType::ITER, "iteration" },
     { baseType::TIME, "time" },
-};
+});
 
 
 const Foam::Enum
@@ -55,11 +55,11 @@ const Foam::Enum
     Foam::functionObjects::fieldAverageItem::windowType
 >
 Foam::functionObjects::fieldAverageItem::windowTypeNames_
-{
+({
     { windowType::NONE, "none" },
     { windowType::APPROXIMATE, "approximate" },
     { windowType::EXACT, "exact" },
-};
+});
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
diff --git a/src/functionObjects/field/fieldAverage/fieldAverageItem/fieldAverageItemIO.C b/src/functionObjects/field/fieldAverage/fieldAverageItem/fieldAverageItemIO.C
index 80d11c3fdbd..03677d232d5 100644
--- a/src/functionObjects/field/fieldAverage/fieldAverageItem/fieldAverageItemIO.C
+++ b/src/functionObjects/field/fieldAverage/fieldAverageItem/fieldAverageItemIO.C
@@ -69,13 +69,12 @@ Foam::Istream& Foam::functionObjects::operator>>
     faItem.fieldName_ = dictEntry.keyword();
     faItem.mean_ = dict.get<bool>("mean");
     faItem.prime2Mean_ = dict.get<bool>("prime2Mean");
-    faItem.base_ = faItem.baseTypeNames_.lookup("base", dict);
+    faItem.base_ = faItem.baseTypeNames_.get("base", dict);
     faItem.window_ = dict.lookupOrDefault<scalar>("window", -1.0);
 
     if (faItem.window_ > 0)
     {
-        faItem.windowType_ =
-            faItem.windowTypeNames_.lookup("windowType", dict);
+        faItem.windowType_ = faItem.windowTypeNames_.get("windowType", dict);
 
         if (faItem.windowType_ != fieldAverageItem::windowType::NONE)
         {
diff --git a/src/functionObjects/field/fieldMinMax/fieldMinMax.C b/src/functionObjects/field/fieldMinMax/fieldMinMax.C
index ff81147a1d6..e217e58b7f8 100644
--- a/src/functionObjects/field/fieldMinMax/fieldMinMax.C
+++ b/src/functionObjects/field/fieldMinMax/fieldMinMax.C
@@ -43,10 +43,10 @@ const Foam::Enum
     Foam::functionObjects::fieldMinMax::modeType
 >
 Foam::functionObjects::fieldMinMax::modeTypeNames_
-{
+({
     { modeType::mdMag,  "magnitude" },
     { modeType::mdCmpt, "component" },
-};
+});
 
 
 // * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
diff --git a/src/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.C b/src/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.C
index 21c2cc459c9..6768d069bb1 100644
--- a/src/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.C
+++ b/src/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.C
@@ -46,13 +46,13 @@ const Foam::Enum
     Foam::functionObjects::fieldValues::fieldValueDelta::operationType
 >
 Foam::functionObjects::fieldValues::fieldValueDelta::operationTypeNames_
-{
+({
     { operationType::opAdd, "add" },
     { operationType::opSubtract, "subtract" },
     { operationType::opMin, "min" },
     { operationType::opMax, "max" },
     { operationType::opAverage, "average" },
-};
+});
 
 
 // * * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * //
@@ -146,7 +146,7 @@ bool Foam::functionObjects::fieldValues::fieldValueDelta::read
         ).ptr()
     );
 
-    operation_ = operationTypeNames_.lookup("operation", dict);
+    operation_ = operationTypeNames_.get("operation", dict);
 
     return true;
 }
diff --git a/src/functionObjects/field/fieldValues/surfaceFieldValue/surfaceFieldValue.C b/src/functionObjects/field/fieldValues/surfaceFieldValue/surfaceFieldValue.C
index 4da57d8516b..a398e7204ca 100644
--- a/src/functionObjects/field/fieldValues/surfaceFieldValue/surfaceFieldValue.C
+++ b/src/functionObjects/field/fieldValues/surfaceFieldValue/surfaceFieldValue.C
@@ -55,12 +55,12 @@ const Foam::Enum
     Foam::functionObjects::fieldValues::surfaceFieldValue::regionTypes
 >
 Foam::functionObjects::fieldValues::surfaceFieldValue::regionTypeNames_
-{
+({
     { regionTypes::stFaceZone, "faceZone" },
     { regionTypes::stPatch, "patch" },
     { regionTypes::stSurface, "surface" },
     { regionTypes::stSampledSurface, "sampledSurface" },
-};
+});
 
 
 const Foam::Enum
@@ -68,7 +68,7 @@ const Foam::Enum
     Foam::functionObjects::fieldValues::surfaceFieldValue::operationType
 >
 Foam::functionObjects::fieldValues::surfaceFieldValue::operationTypeNames_
-{
+({
     // Normal operations
     { operationType::opNone, "none" },
     { operationType::opMin, "min" },
@@ -98,17 +98,17 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::operationTypeNames_
     { operationType::opAbsWeightedAreaAverage, "absWeightedAreaAverage" },
     { operationType::opAbsWeightedAreaIntegrate, "absWeightedAreaIntegrate" },
     { operationType::opAbsWeightedUniformity, "absWeightedUniformity" },
-};
+});
 
 const Foam::Enum
 <
     Foam::functionObjects::fieldValues::surfaceFieldValue::postOperationType
 >
 Foam::functionObjects::fieldValues::surfaceFieldValue::postOperationTypeNames_
-{
+({
     { postOperationType::postOpNone, "none" },
     { postOperationType::postOpSqrt, "sqrt" },
-};
+});
 
 
 // * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
@@ -901,15 +901,16 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::surfaceFieldValue
 )
 :
     fieldValue(name, runTime, dict, typeName),
-    regionType_(regionTypeNames_.lookup("regionType", dict)),
-    operation_(operationTypeNames_.lookup("operation", dict)),
+    regionType_(regionTypeNames_.get("regionType", dict)),
+    operation_(operationTypeNames_.get("operation", dict)),
     postOperation_
     (
         postOperationTypeNames_.lookupOrDefault
         (
             "postOperation",
             dict,
-            postOperationType::postOpNone
+            postOperationType::postOpNone,
+            true  // Failsafe behaviour
         )
     ),
     weightFieldName_("none"),
@@ -932,15 +933,16 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::surfaceFieldValue
 )
 :
     fieldValue(name, obr, dict, typeName),
-    regionType_(regionTypeNames_.lookup("regionType", dict)),
-    operation_(operationTypeNames_.lookup("operation", dict)),
+    regionType_(regionTypeNames_.get("regionType", dict)),
+    operation_(operationTypeNames_.get("operation", dict)),
     postOperation_
     (
         postOperationTypeNames_.lookupOrDefault
         (
             "postOperation",
             dict,
-            postOperationType::postOpNone
+            postOperationType::postOpNone,
+            true  // Failsafe behaviour
         )
     ),
     weightFieldName_("none"),
diff --git a/src/functionObjects/field/fieldValues/volFieldValue/volFieldValue.C b/src/functionObjects/field/fieldValues/volFieldValue/volFieldValue.C
index fb72fcadee1..9a356559dba 100644
--- a/src/functionObjects/field/fieldValues/volFieldValue/volFieldValue.C
+++ b/src/functionObjects/field/fieldValues/volFieldValue/volFieldValue.C
@@ -48,7 +48,7 @@ const Foam::Enum
     Foam::functionObjects::fieldValues::volFieldValue::operationType
 >
 Foam::functionObjects::fieldValues::volFieldValue::operationTypeNames_
-{
+({
     // Normal operations
     { operationType::opNone, "none" },
     { operationType::opMin, "min" },
@@ -65,7 +65,7 @@ Foam::functionObjects::fieldValues::volFieldValue::operationTypeNames_
     { operationType::opWeightedAverage, "weightedAverage" },
     { operationType::opWeightedVolAverage, "weightedVolAverage" },
     { operationType::opWeightedVolIntegrate, "weightedVolIntegrate" },
-};
+});
 
 
 // * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
@@ -205,7 +205,7 @@ Foam::functionObjects::fieldValues::volFieldValue::volFieldValue
 :
     fieldValue(name, runTime, dict, typeName),
     volRegion(fieldValue::mesh_, dict),
-    operation_(operationTypeNames_.lookup("operation", dict)),
+    operation_(operationTypeNames_.get("operation", dict)),
     weightFieldName_("none")
 {
     read(dict);
@@ -222,7 +222,7 @@ Foam::functionObjects::fieldValues::volFieldValue::volFieldValue
 :
     fieldValue(name, obr, dict, typeName),
     volRegion(fieldValue::mesh_, dict),
-    operation_(operationTypeNames_.lookup("operation", dict)),
+    operation_(operationTypeNames_.get("operation", dict)),
     weightFieldName_("none")
 {
     read(dict);
diff --git a/src/functionObjects/field/fluxSummary/fluxSummary.C b/src/functionObjects/field/fluxSummary/fluxSummary.C
index a001f9b2b7f..9de8b634ddd 100644
--- a/src/functionObjects/field/fluxSummary/fluxSummary.C
+++ b/src/functionObjects/field/fluxSummary/fluxSummary.C
@@ -59,13 +59,13 @@ const Foam::Enum
     Foam::functionObjects::fluxSummary::modeType
 >
 Foam::functionObjects::fluxSummary::modeTypeNames_
-{
+({
     { modeType::mdFaceZone , "faceZone" },
     { modeType::mdFaceZoneAndDirection, "faceZoneAndDirection" },
     { modeType::mdCellZoneAndDirection, "cellZoneAndDirection" },
     { modeType::mdSurface, "surface" },
     { modeType::mdSurfaceAndDirection, "surfaceAndDirection" },
-};
+});
 
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
@@ -817,7 +817,7 @@ bool Foam::functionObjects::fluxSummary::read(const dictionary& dict)
     fvMeshFunctionObject::read(dict);
     writeFile::read(dict);
 
-    mode_ = modeTypeNames_.lookup("mode", dict);
+    mode_ = modeTypeNames_.get("mode", dict);
     phiName_ = dict.lookupOrDefault<word>("phi", "phi");
     scaleFactor_ = dict.lookupOrDefault<scalar>("scaleFactor", 1.0);
     tolerance_   = dict.lookupOrDefault<scalar>("tolerance", 0.8);
diff --git a/src/functionObjects/field/setFlow/setFlow.C b/src/functionObjects/field/setFlow/setFlow.C
index 2f89e687f60..c294d216fb9 100644
--- a/src/functionObjects/field/setFlow/setFlow.C
+++ b/src/functionObjects/field/setFlow/setFlow.C
@@ -53,12 +53,12 @@ const Foam::Enum
     Foam::functionObjects::setFlow::modeType
 >
 Foam::functionObjects::setFlow::modeTypeNames
-{
+({
     { functionObjects::setFlow::modeType::FUNCTION, "function" },
     { functionObjects::setFlow::modeType::ROTATION, "rotation" },
     { functionObjects::setFlow::modeType::VORTEX2D, "vortex2D" },
-    { functionObjects::setFlow::modeType::VORTEX3D, "vortex3D" }
-};
+    { functionObjects::setFlow::modeType::VORTEX3D, "vortex3D" },
+});
 
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
@@ -137,7 +137,8 @@ bool Foam::functionObjects::setFlow::read(const dictionary& dict)
     if (fvMeshFunctionObject::read(dict))
     {
         Info<< name() << ":" << endl;
-        mode_ = modeTypeNames.lookup("mode", dict);
+
+        modeTypeNames.readEntry("mode", dict, mode_);
 
         Info<< "    operating mode: " << modeTypeNames[mode_] << endl;
 
diff --git a/src/functionObjects/field/turbulenceFields/turbulenceFields.C b/src/functionObjects/field/turbulenceFields/turbulenceFields.C
index 3a257d5da6c..b06c98315ec 100644
--- a/src/functionObjects/field/turbulenceFields/turbulenceFields.C
+++ b/src/functionObjects/field/turbulenceFields/turbulenceFields.C
@@ -50,7 +50,7 @@ const Foam::Enum
     Foam::functionObjects::turbulenceFields::compressibleField
 >
 Foam::functionObjects::turbulenceFields::compressibleFieldNames_
-{
+({
     { compressibleField::cfK, "k" },
     { compressibleField::cfEpsilon, "epsilon" },
     { compressibleField::cfOmega, "omega" },
@@ -62,8 +62,8 @@ Foam::functionObjects::turbulenceFields::compressibleFieldNames_
     { compressibleField::cfR, "R" },
     { compressibleField::cfDevRhoReff, "devRhoReff" },
     { compressibleField::cfL, "L" },
-    { compressibleField::cfI, "I" }
-};
+    { compressibleField::cfI, "I" },
+});
 
 
 const Foam::Enum
@@ -71,7 +71,7 @@ const Foam::Enum
     Foam::functionObjects::turbulenceFields::incompressibleField
 >
 Foam::functionObjects::turbulenceFields::incompressibleFieldNames_
-{
+({
     { incompressibleField::ifK, "k" },
     { incompressibleField::ifEpsilon, "epsilon" },
     { incompressibleField::ifOmega, "omega" },
@@ -81,8 +81,8 @@ Foam::functionObjects::turbulenceFields::incompressibleFieldNames_
     { incompressibleField::ifR, "R" },
     { incompressibleField::ifDevReff, "devReff" },
     { incompressibleField::ifL, "L" },
-    { incompressibleField::ifI, "I" }
-};
+    { incompressibleField::ifI, "I" },
+});
 
 
 const Foam::word Foam::functionObjects::turbulenceFields::modelName
diff --git a/src/functionObjects/graphics/runTimePostProcessing/fieldVisualisationBase.C b/src/functionObjects/graphics/runTimePostProcessing/fieldVisualisationBase.C
index a7e6ba9db30..1a804abc4e5 100644
--- a/src/functionObjects/graphics/runTimePostProcessing/fieldVisualisationBase.C
+++ b/src/functionObjects/graphics/runTimePostProcessing/fieldVisualisationBase.C
@@ -52,22 +52,22 @@ const Foam::Enum
     Foam::functionObjects::fieldVisualisationBase::colourByType
 >
 Foam::functionObjects::fieldVisualisationBase::colourByTypeNames
-{
+({
     { colourByType::cbColour, "colour" },
     { colourByType::cbField, "field" },
-};
+});
 
 const Foam::Enum
 <
     Foam::functionObjects::fieldVisualisationBase::colourMapType
 >
 Foam::functionObjects::fieldVisualisationBase::colourMapTypeNames
-{
+({
     { colourMapType::cmRainbow, "rainbow" },
     { colourMapType::cmBlueWhiteRed, "blueWhiteRed" },
     { colourMapType::cmFire, "fire" },
     { colourMapType::cmGreyscale, "greyscale" },
-};
+});
 
 
 // * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
@@ -489,7 +489,7 @@ Foam::functionObjects::fieldVisualisationBase::fieldVisualisationBase
     colourMap_(cmRainbow),
     range_()
 {
-    colourBy_ = colourByTypeNames.lookup("colourBy", dict);
+    colourByTypeNames.readEntry("colourBy", dict, colourBy_);
 
     switch (colourBy_)
     {
@@ -502,10 +502,7 @@ Foam::functionObjects::fieldVisualisationBase::fieldVisualisationBase
         {
             dict.readEntry("range", range_);
 
-            if (dict.found("colourMap"))
-            {
-                colourMap_ = colourMapTypeNames.lookup("colourMap", dict);
-            }
+            colourMapTypeNames.readIfPresent("colourMap", dict, colourMap_);
 
             const dictionary& sbarDict = dict.subDict("scalarBar");
             sbarDict.readEntry("visible", scalarBar_.visible_);
diff --git a/src/functionObjects/graphics/runTimePostProcessing/geometryBase.C b/src/functionObjects/graphics/runTimePostProcessing/geometryBase.C
index 2be283ba58a..7edb7f1748d 100644
--- a/src/functionObjects/graphics/runTimePostProcessing/geometryBase.C
+++ b/src/functionObjects/graphics/runTimePostProcessing/geometryBase.C
@@ -37,11 +37,11 @@ const Foam::Enum
     Foam::functionObjects::runTimePostPro::geometryBase::renderModeType
 >
 Foam::functionObjects::runTimePostPro::geometryBase::renderModeTypeNames
-{
+({
     { renderModeType::rmFlat, "flat" },
     { renderModeType::rmGouraud, "gouraud" },
     { renderModeType::rmPhong, "phong" },
-};
+});
 
 
 // * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
@@ -87,15 +87,13 @@ Foam::functionObjects::runTimePostPro::geometryBase::geometryBase
     parent_(parent),
     name_(dict.dictName()),
     visible_(dict.get<bool>("visible")),
-    renderMode_(rmGouraud),
+    renderMode_
+    (
+        renderModeTypeNames.lookupOrDefault("renderMode", dict, rmGouraud)
+    ),
     opacity_(nullptr),
     colours_(colours)
 {
-    if (dict.found("renderMode"))
-    {
-        renderMode_ = renderModeTypeNames.lookup("renderMode", dict);
-    }
-
     if (dict.found("opacity"))
     {
         opacity_.reset(Function1<scalar>::New("opacity", dict).ptr());
diff --git a/src/functionObjects/graphics/runTimePostProcessing/pathline.C b/src/functionObjects/graphics/runTimePostProcessing/pathline.C
index 8f59b9d8879..f85cbd8a2aa 100644
--- a/src/functionObjects/graphics/runTimePostProcessing/pathline.C
+++ b/src/functionObjects/graphics/runTimePostProcessing/pathline.C
@@ -55,12 +55,12 @@ const Foam::Enum
     Foam::functionObjects::runTimePostPro::pathline::representationType
 >
 Foam::functionObjects::runTimePostPro::pathline::representationTypeNames
-{
+({
     { representationType::rtNone, "none" },
     { representationType::rtLine, "line" },
     { representationType::rtTube, "tube" },
     { representationType::rtVector, "vector" },
-};
+});
 
 
 // * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
@@ -129,7 +129,7 @@ Foam::functionObjects::runTimePostPro::pathline::pathline
     geometryBase(parent, dict, colours),
     representation_
     (
-        representationTypeNames.lookup("representation", dict)
+        representationTypeNames.get("representation", dict)
     ),
     tubeRadius_(0.0),
     lineColour_(nullptr)
diff --git a/src/functionObjects/graphics/runTimePostProcessing/pointData.C b/src/functionObjects/graphics/runTimePostProcessing/pointData.C
index 58bafbdd026..ce4e9bd6924 100644
--- a/src/functionObjects/graphics/runTimePostProcessing/pointData.C
+++ b/src/functionObjects/graphics/runTimePostProcessing/pointData.C
@@ -55,10 +55,10 @@ const Foam::Enum
     Foam::functionObjects::runTimePostPro::pointData::representationType
 >
 Foam::functionObjects::runTimePostPro::pointData::representationTypeNames
-{
+({
     { representationType::rtSphere, "sphere" },
     { representationType::rtVector, "vector" },
-};
+});
 
 
 // * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
@@ -99,7 +99,7 @@ Foam::functionObjects::runTimePostPro::pointData::pointData
     geometryBase(parent, dict, colours),
     representation_
     (
-        representationTypeNames.lookup("representation", dict)
+        representationTypeNames.get("representation", dict)
     ),
     maxGlyphLength_(dict.get<scalar>("maxGlyphLength")),
     pointColour_(nullptr)
diff --git a/src/functionObjects/graphics/runTimePostProcessing/surface.C b/src/functionObjects/graphics/runTimePostProcessing/surface.C
index f2d075df92c..8449b5f327a 100644
--- a/src/functionObjects/graphics/runTimePostProcessing/surface.C
+++ b/src/functionObjects/graphics/runTimePostProcessing/surface.C
@@ -56,13 +56,13 @@ const Foam::Enum
     Foam::functionObjects::runTimePostPro::surface::representationType
 >
 Foam::functionObjects::runTimePostPro::surface::representationTypeNames
-{
+({
     { representationType::rtNone, "none" },
     { representationType::rtWireframe, "wireframe" },
     { representationType::rtSurface, "surface" },
     { representationType::rtSurfaceWithEdges, "surfaceWithEdges" },
     { representationType::rtGlyph, "glyph" },
-};
+});
 
 
 // * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
@@ -149,7 +149,7 @@ Foam::functionObjects::runTimePostPro::surface::surface
     geometryBase(parent, dict, colours),
     representation_
     (
-        representationTypeNames.lookup("representation", dict)
+        representationTypeNames.get("representation", dict)
     ),
     featureEdges_(false),
     surfaceColour_(nullptr),
diff --git a/src/functionObjects/utilities/ensightWrite/ensightWrite.C b/src/functionObjects/utilities/ensightWrite/ensightWrite.C
index 710bee74fe9..06bbd0307d6 100644
--- a/src/functionObjects/utilities/ensightWrite/ensightWrite.C
+++ b/src/functionObjects/utilities/ensightWrite/ensightWrite.C
@@ -106,11 +106,12 @@ Foam::functionObjects::ensightWrite::ensightWrite
     fvMeshFunctionObject(name, runTime, dict),
     writeOpts_
     (
-        IOstreamOption::formatNames.lookupOrFailsafe
+        IOstreamOption::formatNames.lookupOrDefault
         (
             "format",
             dict,
-            runTime.writeFormat()
+            runTime.writeFormat(),
+            true  // Failsafe behaviour
         )
     ),
     caseOpts_(writeOpts_.format()),
diff --git a/src/functionObjects/utilities/runTimeControl/runTimeCondition/equationInitialResidualCondition/equationInitialResidualCondition.C b/src/functionObjects/utilities/runTimeControl/runTimeCondition/equationInitialResidualCondition/equationInitialResidualCondition.C
index 1f77eb09d81..ac86c8313ed 100644
--- a/src/functionObjects/utilities/runTimeControl/runTimeCondition/equationInitialResidualCondition/equationInitialResidualCondition.C
+++ b/src/functionObjects/utilities/runTimeControl/runTimeCondition/equationInitialResidualCondition/equationInitialResidualCondition.C
@@ -58,10 +58,10 @@ const Foam::Enum
 >
 Foam::functionObjects::runTimeControls::equationInitialResidualCondition::
 operatingModeNames
-{
+({
     { operatingMode::omMin, "minimum" },
     { operatingMode::omMax, "maximum" },
-};
+});
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
@@ -79,7 +79,7 @@ equationInitialResidualCondition
     fieldNames_(dict.get<wordList>("fields")),
     value_(dict.get<scalar>("value")),
     timeStart_(dict.lookupOrDefault("timeStart", -GREAT)),
-    mode_(operatingModeNames.lookup("mode", dict))
+    mode_(operatingModeNames.get("mode", dict))
 {
     if (fieldNames_.size())
     {
diff --git a/src/functionObjects/utilities/runTimeControl/runTimeCondition/minMaxCondition/minMaxCondition.C b/src/functionObjects/utilities/runTimeControl/runTimeCondition/minMaxCondition/minMaxCondition.C
index d87644e931e..9042fcc4d76 100644
--- a/src/functionObjects/utilities/runTimeControl/runTimeCondition/minMaxCondition/minMaxCondition.C
+++ b/src/functionObjects/utilities/runTimeControl/runTimeCondition/minMaxCondition/minMaxCondition.C
@@ -66,10 +66,10 @@ const Foam::Enum
   ::modeType
 >
 Foam::functionObjects::runTimeControls::minMaxCondition::modeTypeNames_
-{
+({
     { modeType::mdMin, "minimum" },
     { modeType::mdMax, "maximum" },
-};
+});
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
@@ -84,7 +84,7 @@ Foam::functionObjects::runTimeControls::minMaxCondition::minMaxCondition
 :
     runTimeCondition(name, obr, dict, state),
     functionObjectName_(dict.get<word>("functionObject")),
-    mode_(modeTypeNames_.lookup("mode", dict)),
+    mode_(modeTypeNames_.get("mode", dict)),
     fieldNames_(dict.get<wordList>("fields")),
     value_(dict.get<scalar>("value"))
 {}
diff --git a/src/functionObjects/utilities/writeObjects/writeObjects.C b/src/functionObjects/utilities/writeObjects/writeObjects.C
index 96579eb3d47..236fa10f988 100644
--- a/src/functionObjects/utilities/writeObjects/writeObjects.C
+++ b/src/functionObjects/utilities/writeObjects/writeObjects.C
@@ -50,11 +50,11 @@ const Foam::Enum
     Foam::functionObjects::writeObjects::writeOption
 >
 Foam::functionObjects::writeObjects::writeOptionNames_
-{
+({
     { writeOption::AUTO_WRITE, "autoWrite" },
     { writeOption::NO_WRITE, "noWrite" },
     { writeOption::ANY_WRITE, "anyWrite" },
-};
+});
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
@@ -89,8 +89,8 @@ bool Foam::functionObjects::writeObjects::read(const dictionary& dict)
 
     if (dict.found("field"))
     {
-        objectNames_.setSize(1);
-        dict.readEntry("field", objectNames_[0]);
+        objectNames_.resize(1);
+        dict.readEntry("field", objectNames_.first());
     }
     else if (dict.found("fields"))
     {
diff --git a/src/fvMotionSolver/pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.C b/src/fvMotionSolver/pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.C
index 3d0f31a4462..1eb531470ee 100644
--- a/src/fvMotionSolver/pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.C
+++ b/src/fvMotionSolver/pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.C
@@ -37,11 +37,11 @@ const Foam::Enum
     Foam::surfaceDisplacementPointPatchVectorField::projectMode
 >
 Foam::surfaceDisplacementPointPatchVectorField::projectModeNames_
-{
+({
     { projectMode::NEAREST, "nearest" },
     { projectMode::POINTNORMAL, "pointNormal" },
     { projectMode::FIXEDNORMAL, "fixedNormal" },
-};
+});
 
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
@@ -318,7 +318,7 @@ surfaceDisplacementPointPatchVectorField
     fixedValuePointPatchVectorField(p, iF, dict),
     velocity_(dict.lookup("velocity")),
     surfacesDict_(dict.subDict("geometry")),
-    projectMode_(projectModeNames_.lookup("projectMode", dict)),
+    projectMode_(projectModeNames_.get("projectMode", dict)),
     projectDir_(dict.lookup("projectDirection")),
     wedgePlane_(dict.lookupOrDefault("wedgePlane", -1)),
     frozenPointsZone_(dict.lookupOrDefault("frozenPointsZone", word::null))
diff --git a/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C b/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C
index 2f3de5ce6a8..0be591f508c 100644
--- a/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C
+++ b/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C
@@ -37,11 +37,11 @@ const Foam::Enum
     Foam::surfaceSlipDisplacementPointPatchVectorField::projectMode
 >
 Foam::surfaceSlipDisplacementPointPatchVectorField::projectModeNames_
-{
+({
     { projectMode::NEAREST, "nearest" },
     { projectMode::POINTNORMAL, "pointNormal" },
     { projectMode::FIXEDNORMAL, "fixedNormal" },
-};
+});
 
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
@@ -316,7 +316,7 @@ surfaceSlipDisplacementPointPatchVectorField
 :
     pointPatchVectorField(p, iF, dict),
     surfacesDict_(dict.subDict("geometry")),
-    projectMode_(projectModeNames_.lookup("projectMode", dict)),
+    projectMode_(projectModeNames_.get("projectMode", dict)),
     projectDir_(dict.lookup("projectDirection")),
     wedgePlane_(dict.lookupOrDefault("wedgePlane", -1)),
     frozenPointsZone_(dict.lookupOrDefault("frozenPointsZone", word::null))
diff --git a/src/fvOptions/cellSetOption/cellSetOption.C b/src/fvOptions/cellSetOption/cellSetOption.C
index 6cc034a5969..90b7224284b 100644
--- a/src/fvOptions/cellSetOption/cellSetOption.C
+++ b/src/fvOptions/cellSetOption/cellSetOption.C
@@ -42,12 +42,12 @@ const Foam::Enum
     Foam::fv::cellSetOption::selectionModeType
 >
 Foam::fv::cellSetOption::selectionModeTypeNames_
-{
+({
     { selectionModeType::smPoints, "points" },
     { selectionModeType::smCellSet, "cellSet" },
     { selectionModeType::smCellZone, "cellZone" },
     { selectionModeType::smAll, "all" },
-};
+});
 
 
 // * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
@@ -204,10 +204,7 @@ Foam::fv::cellSetOption::cellSetOption
     option(name, modelType, dict, mesh),
     timeStart_(-1.0),
     duration_(0.0),
-    selectionMode_
-    (
-        selectionModeTypeNames_.lookup("selectionMode", coeffs_)
-    ),
+    selectionMode_(selectionModeTypeNames_.get("selectionMode", coeffs_)),
     cellSetName_("none"),
     V_(0.0)
 {
diff --git a/src/fvOptions/constraints/derived/fixedTemperatureConstraint/fixedTemperatureConstraint.C b/src/fvOptions/constraints/derived/fixedTemperatureConstraint/fixedTemperatureConstraint.C
index cdec55ac523..46ee6bc10ea 100644
--- a/src/fvOptions/constraints/derived/fixedTemperatureConstraint/fixedTemperatureConstraint.C
+++ b/src/fvOptions/constraints/derived/fixedTemperatureConstraint/fixedTemperatureConstraint.C
@@ -50,10 +50,10 @@ const Foam::Enum
     Foam::fv::fixedTemperatureConstraint::temperatureMode
 >
 Foam::fv::fixedTemperatureConstraint::temperatureModeNames_
-{
+({
     { temperatureMode::tmUniform, "uniform" },
     { temperatureMode::tmLookup, "lookup" },
-};
+});
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
@@ -67,7 +67,7 @@ Foam::fv::fixedTemperatureConstraint::fixedTemperatureConstraint
 )
 :
     cellSetOption(name, modelType, dict, mesh),
-    mode_(temperatureModeNames_.lookup("mode", coeffs_)),
+    mode_(temperatureModeNames_.get("mode", coeffs_)),
     Tuniform_(nullptr),
     TName_("T")
 {
diff --git a/src/fvOptions/sources/derived/directionalPressureGradientExplicitSource/directionalPressureGradientExplicitSource.C b/src/fvOptions/sources/derived/directionalPressureGradientExplicitSource/directionalPressureGradientExplicitSource.C
index 697ff1e72a5..9d6adf3027a 100644
--- a/src/fvOptions/sources/derived/directionalPressureGradientExplicitSource/directionalPressureGradientExplicitSource.C
+++ b/src/fvOptions/sources/derived/directionalPressureGradientExplicitSource/directionalPressureGradientExplicitSource.C
@@ -62,11 +62,11 @@ const Foam::Enum
     Foam::fv::directionalPressureGradientExplicitSource::pressureDropModel
 >
 Foam::fv::directionalPressureGradientExplicitSource::pressureDropModelNames_
-{
+({
     { pressureDropModel::pVolumetricFlowRateTable, "volumetricFlowRateTable" },
     { pressureDropModel::pConstant, "constant" },
     { pressureDropModel::pDarcyForchheimer, "DarcyForchheimer" },
-};
+});
 
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
@@ -166,7 +166,7 @@ directionalPressureGradientExplicitSource
 )
 :
     cellSetOption(sourceName, modelType, dict, mesh),
-    model_(pressureDropModelNames_.lookup("model", coeffs_)),
+    model_(pressureDropModelNames_.get("model", coeffs_)),
     gradP0_(cells_.size(), Zero),
     dGradP_(cells_.size(), Zero),
     gradPporous_(cells_.size(), Zero),
diff --git a/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.C b/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.C
index 77c13c70d9b..8f41463545c 100644
--- a/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.C
+++ b/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.C
@@ -50,10 +50,10 @@ const Foam::Enum
     Foam::fv::rotorDiskSource::geometryModeType
 >
 Foam::fv::rotorDiskSource::geometryModeTypeNames_
-{
+({
     { geometryModeType::gmAuto, "auto" },
     { geometryModeType::gmSpecified, "specified" },
-};
+});
 
 
 const Foam::Enum
@@ -61,11 +61,11 @@ const Foam::Enum
     Foam::fv::rotorDiskSource::inletFlowType
 >
 Foam::fv::rotorDiskSource::inletFlowTypeNames_
-{
+({
     { inletFlowType::ifFixed, "fixed" },
     { inletFlowType::ifSurfaceNormal, "surfaceNormal" },
     { inletFlowType::ifLocal, "local" },
-};
+});
 
 
 // * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
@@ -267,7 +267,7 @@ void Foam::fv::rotorDiskSource::createCoordinateSystem()
     vector refDir(Zero);
 
     geometryModeType gm =
-        geometryModeTypeNames_.lookup("geometryMode", coeffs_);
+        geometryModeTypeNames_.get("geometryMode", coeffs_);
 
     switch (gm)
     {
@@ -558,7 +558,7 @@ bool Foam::fv::rotorDiskSource::read(const dictionary& dict)
 
         coeffs_.readEntry("nBlades", nBlades_);
 
-        inletFlow_ = inletFlowTypeNames_.lookup("inletFlowType", coeffs_);
+        inletFlowTypeNames_.readEntry("inletFlowType", coeffs_, inletFlow_);
 
         coeffs_.readEntry("tipEffect", tipEffect_);
 
diff --git a/src/fvOptions/sources/derived/solidificationMeltingSource/solidificationMeltingSource.C b/src/fvOptions/sources/derived/solidificationMeltingSource/solidificationMeltingSource.C
index 5fc0c9695ef..f332f4d2b9f 100644
--- a/src/fvOptions/sources/derived/solidificationMeltingSource/solidificationMeltingSource.C
+++ b/src/fvOptions/sources/derived/solidificationMeltingSource/solidificationMeltingSource.C
@@ -54,10 +54,10 @@ const Foam::Enum
     Foam::fv::solidificationMeltingSource::thermoMode
 >
 Foam::fv::solidificationMeltingSource::thermoModeTypeNames_
-{
+({
     { thermoMode::mdThermo, "thermo" },
     { thermoMode::mdLookup, "lookup" },
-};
+});
 
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
@@ -182,7 +182,7 @@ Foam::fv::solidificationMeltingSource::solidificationMeltingSource
     Tmelt_(coeffs_.get<scalar>("Tmelt")),
     L_(coeffs_.get<scalar>("L")),
     relax_(coeffs_.lookupOrDefault("relax", 0.9)),
-    mode_(thermoModeTypeNames_.lookup("thermoMode", coeffs_)),
+    mode_(thermoModeTypeNames_.get("thermoMode", coeffs_)),
     rhoRef_(coeffs_.get<scalar>("rhoRef")),
     TName_(coeffs_.lookupOrDefault<word>("T", "T")),
     CpName_(coeffs_.lookupOrDefault<word>("Cp", "Cp")),
@@ -319,7 +319,7 @@ bool Foam::fv::solidificationMeltingSource::read(const dictionary& dict)
 
         coeffs_.readIfPresent("relax", relax_);
 
-        mode_ = thermoModeTypeNames_.lookup("thermoMode", coeffs_);
+        thermoModeTypeNames_.readEntry("thermoMode", coeffs_, mode_);
 
         coeffs_.readEntry("rhoRef", rhoRef_);
         coeffs_.readIfPresent("T", TName_);
diff --git a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/tabulatedNTUHeatTransfer/tabulatedNTUHeatTransfer.C b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/tabulatedNTUHeatTransfer/tabulatedNTUHeatTransfer.C
index 90d34365e7b..2823572efe6 100644
--- a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/tabulatedNTUHeatTransfer/tabulatedNTUHeatTransfer.C
+++ b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/tabulatedNTUHeatTransfer/tabulatedNTUHeatTransfer.C
@@ -48,10 +48,10 @@ const Foam::Enum
     Foam::fv::tabulatedNTUHeatTransfer::geometryModeType
 >
 Foam::fv::tabulatedNTUHeatTransfer::geometryModelNames_
-{
+({
     { geometryModeType::gmCalculated, "calculated" },
     { geometryModeType::gmUser, "user" },
-};
+});
 
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
@@ -89,7 +89,7 @@ void Foam::fv::tabulatedNTUHeatTransfer::initialiseGeometry()
 {
     if (Ain_ < 0)
     {
-        geometryMode_ = geometryModelNames_.lookup("geometryMode", coeffs_);
+        geometryMode_ = geometryModelNames_.get("geometryMode", coeffs_);
 
         Info<< "Region " << mesh_.name() << " " << type() << " " << name_
             << " " << geometryModelNames_[geometryMode_] << " geometry:" << nl;
diff --git a/src/lagrangian/intermediate/phaseProperties/phaseProperties/phaseProperties.C b/src/lagrangian/intermediate/phaseProperties/phaseProperties/phaseProperties.C
index 6ed39e470ca..146c912221c 100644
--- a/src/lagrangian/intermediate/phaseProperties/phaseProperties/phaseProperties.C
+++ b/src/lagrangian/intermediate/phaseProperties/phaseProperties/phaseProperties.C
@@ -32,12 +32,12 @@ const Foam::Enum
     Foam::phaseProperties::phaseType
 >
 Foam::phaseProperties::phaseTypeNames
-{
+({
     { phaseType::GAS, "gas" },
     { phaseType::LIQUID, "liquid" },
     { phaseType::SOLID, "solid" },
     { phaseType::UNKNOWN, "unknown" },
-};
+});
 
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeNozzleInjection/ConeNozzleInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeNozzleInjection/ConeNozzleInjection.C
index e8613476c33..c3e53ca67ce 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeNozzleInjection/ConeNozzleInjection.C
+++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeNozzleInjection/ConeNozzleInjection.C
@@ -37,11 +37,11 @@ const Foam::Enum
     typename Foam::ConeNozzleInjection<CloudType>::injectionMethod
 >
 Foam::ConeNozzleInjection<CloudType>::injectionMethodNames
-{
+({
     { injectionMethod::imPoint, "point" },
     { injectionMethod::imDisc, "disc" },
-    { injectionMethod::imMovingPoint, "movingPoint" }
-};
+    { injectionMethod::imMovingPoint, "movingPoint" },
+});
 
 template<class CloudType>
 const Foam::Enum
@@ -49,11 +49,11 @@ const Foam::Enum
     typename Foam::ConeNozzleInjection<CloudType>::flowType
 >
 Foam::ConeNozzleInjection<CloudType>::flowTypeNames
-{
+({
     { flowType::ftConstantVelocity, "constantVelocity" },
     { flowType::ftPressureDrivenVelocity, "pressureDrivenVelocity" },
-    { flowType::ftFlowRateAndDischarge, "flowRateAndDischarge" }
-};
+    { flowType::ftFlowRateAndDischarge, "flowRateAndDischarge" },
+});
 
 
 // * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * * * //
@@ -129,9 +129,9 @@ Foam::ConeNozzleInjection<CloudType>::ConeNozzleInjection
     InjectionModel<CloudType>(dict, owner, modelName, typeName),
     injectionMethod_
     (
-        injectionMethodNames.lookup("injectionMethod", this->coeffDict())
+        injectionMethodNames.get("injectionMethod", this->coeffDict())
     ),
-    flowType_(flowTypeNames.lookup("flowType", this->coeffDict())),
+    flowType_(flowTypeNames.get("flowType", this->coeffDict())),
     outerDiameter_(this->coeffDict().getScalar("outerDiameter")),
     innerDiameter_(this->coeffDict().getScalar("innerDiameter")),
     duration_(this->coeffDict().getScalar("duration")),
diff --git a/src/lumpedPointMotion/lumpedPointMovement.C b/src/lumpedPointMotion/lumpedPointMovement.C
index 8ecbe7e3c83..99fc9bc9804 100644
--- a/src/lumpedPointMotion/lumpedPointMovement.C
+++ b/src/lumpedPointMotion/lumpedPointMovement.C
@@ -42,10 +42,10 @@ const Foam::Enum
     Foam::lumpedPointMovement::outputFormatType
 >
 Foam::lumpedPointMovement::formatNames
-{
+({
     { outputFormatType::PLAIN, "plain" },
-    { outputFormatType::DICTIONARY, "dictionary" }
-};
+    { outputFormatType::DICTIONARY, "dictionary" },
+});
 
 
 const Foam::Enum
@@ -53,11 +53,11 @@ const Foam::Enum
     Foam::lumpedPointMovement::scalingType
 >
 Foam::lumpedPointMovement::scalingNames
-{
+({
     { scalingType::LENGTH, "length" },
     { scalingType::FORCE, "force" },
-    { scalingType::MOMENT, "moment" }
-};
+    { scalingType::MOMENT, "moment" },
+});
 
 
 const Foam::word
@@ -283,17 +283,11 @@ void Foam::lumpedPointMovement::readDict(const dictionary& dict)
     commDict.readEntry("outputName", outputName_);
     commDict.readIfPresent("logName", logName_);
 
-    inputFormat_ = lumpedPointState::formatNames.lookup
-    (
-        "inputFormat",
-        commDict
-    );
+    inputFormat_ =
+        lumpedPointState::formatNames.get("inputFormat", commDict);
 
-    outputFormat_ = lumpedPointMovement::formatNames.lookup
-    (
-        "outputFormat",
-        commDict
-    );
+    outputFormat_ =
+        lumpedPointMovement::formatNames.get("outputFormat", commDict);
 
     scaleInput_  = -1;
     scaleOutput_ = -1;
diff --git a/src/lumpedPointMotion/lumpedPointState.C b/src/lumpedPointMotion/lumpedPointState.C
index ac9c4351aac..1d38c4ad22a 100644
--- a/src/lumpedPointMotion/lumpedPointState.C
+++ b/src/lumpedPointMotion/lumpedPointState.C
@@ -38,10 +38,10 @@ const Foam::Enum
     Foam::lumpedPointState::inputFormatType
 >
 Foam::lumpedPointState::formatNames
-{
+({
     { inputFormatType::PLAIN, "plain" },
-    { inputFormatType::DICTIONARY, "dictionary" }
-};
+    { inputFormatType::DICTIONARY, "dictionary" },
+});
 
 
 // * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
diff --git a/src/mesh/snappyHexMesh/meshRefinement/meshRefinement.C b/src/mesh/snappyHexMesh/meshRefinement/meshRefinement.C
index a54f1e4fa20..2f7fb70d989 100644
--- a/src/mesh/snappyHexMesh/meshRefinement/meshRefinement.C
+++ b/src/mesh/snappyHexMesh/meshRefinement/meshRefinement.C
@@ -71,13 +71,13 @@ const Foam::Enum
     Foam::meshRefinement::debugType
 >
 Foam::meshRefinement::debugTypeNames
-{
+({
     { debugType::MESH, "mesh" },
     { debugType::OBJINTERSECTIONS, "intersections" },
     { debugType::FEATURESEEDS, "featureSeeds" },
     { debugType::ATTRACTION, "attraction" },
     { debugType::LAYERINFO, "layerInfo" },
-};
+});
 
 
 //const Foam::Enum
@@ -85,9 +85,9 @@ Foam::meshRefinement::debugTypeNames
 //    Foam::meshRefinement::outputType
 //>
 //Foam::meshRefinement::outputTypeNames
-//{
+//({
 //    { outputType::OUTPUTLAYERINFO, "layerInfo" }
-//};
+//});
 
 
 const Foam::Enum
@@ -95,13 +95,13 @@ const Foam::Enum
     Foam::meshRefinement::writeType
 >
 Foam::meshRefinement::writeTypeNames
-{
+({
     { writeType::WRITEMESH, "mesh" },
     { writeType::NOWRITEREFINEMENT, "noRefinement" },
     { writeType::WRITELEVELS, "scalarLevels" },
     { writeType::WRITELAYERSETS, "layerSets" },
     { writeType::WRITELAYERFIELDS, "layerFields" },
-};
+});
 
 
 Foam::meshRefinement::writeType Foam::meshRefinement::writeLevel_;
diff --git a/src/mesh/snappyHexMesh/refinementSurfaces/surfaceZonesInfo.C b/src/mesh/snappyHexMesh/refinementSurfaces/surfaceZonesInfo.C
index 647c8dd6148..ccf8cf9155d 100644
--- a/src/mesh/snappyHexMesh/refinementSurfaces/surfaceZonesInfo.C
+++ b/src/mesh/snappyHexMesh/refinementSurfaces/surfaceZonesInfo.C
@@ -36,12 +36,12 @@ const Foam::Enum
     Foam::surfaceZonesInfo::areaSelectionAlgo
 >
 Foam::surfaceZonesInfo::areaSelectionAlgoNames
-{
+({
     { areaSelectionAlgo::INSIDE, "inside" },
     { areaSelectionAlgo::OUTSIDE, "outside" },
     { areaSelectionAlgo::INSIDEPOINT, "insidePoint" },
     { areaSelectionAlgo::NONE, "none" },
-};
+});
 
 
 const Foam::Enum
@@ -49,11 +49,11 @@ const Foam::Enum
     Foam::surfaceZonesInfo::faceZoneType
 >
 Foam::surfaceZonesInfo::faceZoneTypeNames
-{
+({
     { faceZoneType::INTERNAL, "internal" },
     { faceZoneType::BAFFLE, "baffle" },
     { faceZoneType::BOUNDARY, "boundary" },
-};
+});
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
diff --git a/src/mesh/snappyHexMesh/shellSurfaces/shellSurfaces.C b/src/mesh/snappyHexMesh/shellSurfaces/shellSurfaces.C
index 8de4a57b4d9..56d263c3fa1 100644
--- a/src/mesh/snappyHexMesh/shellSurfaces/shellSurfaces.C
+++ b/src/mesh/snappyHexMesh/shellSurfaces/shellSurfaces.C
@@ -40,11 +40,11 @@ const Foam::Enum
     Foam::shellSurfaces::refineMode
 >
 Foam::shellSurfaces::refineModeNames_
-{
+({
     { refineMode::INSIDE, "inside" },
     { refineMode::OUTSIDE, "outside" },
     { refineMode::DISTANCE, "distance" },
-};
+});
 
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
@@ -621,7 +621,7 @@ Foam::shellSurfaces::shellSurfaces
             unmatchedKeys.erase(eptr->keyword());
 
             shells_[shellI] = geomI;
-            modes_[shellI] = refineModeNames_.lookup("mode", dict);
+            modes_[shellI] = refineModeNames_.get("mode", dict);
 
             // Read pairs of distance+level
             setAndCheckLevels(shellI, dict.lookup("levels"));
diff --git a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C
index 6d93d803db0..2a76bc90dce 100644
--- a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C
+++ b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C
@@ -39,12 +39,12 @@ const Foam::Enum
     interpolationMethod
 >
 Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolationMethodNames_
-{
+({
     { interpolationMethod::imDirect, "directAMI" },
     { interpolationMethod::imMapNearest, "mapNearestAMI" },
     { interpolationMethod::imFaceAreaWeight, "faceAreaWeightAMI" },
     { interpolationMethod::imPartialFaceAreaWeight, "partialFaceAreaWeightAMI" }
-};
+});
 
 template<class SourcePatch, class TargetPatch>
 bool Foam::AMIInterpolation<SourcePatch, TargetPatch>::cacheIntersections_ =
diff --git a/src/meshTools/AMIInterpolation/faceAreaIntersect/faceAreaIntersect.C b/src/meshTools/AMIInterpolation/faceAreaIntersect/faceAreaIntersect.C
index 97e8b1a00e6..e70c6a3e144 100644
--- a/src/meshTools/AMIInterpolation/faceAreaIntersect/faceAreaIntersect.C
+++ b/src/meshTools/AMIInterpolation/faceAreaIntersect/faceAreaIntersect.C
@@ -32,10 +32,10 @@ const Foam::Enum
     Foam::faceAreaIntersect::triangulationMode
 >
 Foam::faceAreaIntersect::triangulationModeNames_
-{
+({
     { triangulationMode::tmFan, "fan" },
-    { triangulationMode::tmMesh, "mesh" }
-};
+    { triangulationMode::tmMesh, "mesh" },
+});
 
 Foam::scalar Foam::faceAreaIntersect::tol = 1e-6;
 
diff --git a/src/meshTools/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.C b/src/meshTools/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.C
index 0baeaef92a0..cbde8cb0533 100644
--- a/src/meshTools/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.C
+++ b/src/meshTools/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.C
@@ -48,12 +48,12 @@ const Foam::Enum
     Foam::extendedEdgeMesh::pointStatus
 >
 Foam::extendedEdgeMesh::pointStatusNames_
-{
+({
     { pointStatus::CONVEX, "convex" },
     { pointStatus::CONCAVE, "concave" },
     { pointStatus::MIXED, "mixed" },
     { pointStatus::NONFEATURE, "nonFeature" },
-};
+});
 
 
 const Foam::Enum
@@ -61,15 +61,14 @@ const Foam::Enum
     Foam::extendedEdgeMesh::edgeStatus
 >
 Foam::extendedEdgeMesh::edgeStatusNames_
-{
+({
     { edgeStatus::EXTERNAL, "external" },
     { edgeStatus::INTERNAL, "internal" },
     { edgeStatus::FLAT, "flat" },
     { edgeStatus::OPEN, "open" },
     { edgeStatus::MULTIPLE, "multiple" },
     { edgeStatus::NONE, "none" },
-
-};
+});
 
 
 const Foam::Enum
@@ -77,12 +76,12 @@ const Foam::Enum
     Foam::extendedEdgeMesh::sideVolumeType
 >
 Foam::extendedEdgeMesh::sideVolumeTypeNames_
-{
+({
     { sideVolumeType::INSIDE, "inside" },
     { sideVolumeType::OUTSIDE, "outside" },
     { sideVolumeType::BOTH, "both" },
     { sideVolumeType::NEITHER, "neither" },
-};
+});
 
 
 Foam::scalar Foam::extendedEdgeMesh::cosNormalAngleTol_ =
diff --git a/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.C b/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.C
index cfa8e9fbdcc..894a730f60f 100644
--- a/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.C
+++ b/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.C
@@ -56,14 +56,14 @@ const Foam::Enum
     Foam::mappedPatchBase::sampleMode
 >
 Foam::mappedPatchBase::sampleModeNames_
-{
+({
     { sampleMode::NEARESTCELL, "nearestCell" },
     { sampleMode::NEARESTPATCHFACE, "nearestPatchFace" },
     { sampleMode::NEARESTPATCHFACEAMI, "nearestPatchFaceAMI" },
     { sampleMode::NEARESTPATCHPOINT, "nearestPatchPoint" },
     { sampleMode::NEARESTFACE, "nearestFace" },
     { sampleMode::NEARESTONLYCELL, "nearestOnlyCell" },
-};
+});
 
 
 const Foam::Enum
@@ -71,11 +71,11 @@ const Foam::Enum
     Foam::mappedPatchBase::offsetMode
 >
 Foam::mappedPatchBase::offsetModeNames_
-{
+({
     { offsetMode::UNIFORM, "uniform" },
     { offsetMode::NONUNIFORM, "nonuniform" },
     { offsetMode::NORMAL, "normal" },
-};
+});
 
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
@@ -1018,7 +1018,7 @@ Foam::mappedPatchBase::mappedPatchBase
 :
     patch_(pp),
     sampleRegion_(dict.lookupOrDefault<word>("sampleRegion", "")),
-    mode_(sampleModeNames_.lookup("sampleMode", dict)),
+    mode_(sampleModeNames_.get("sampleMode", dict)),
     samplePatch_(dict.lookupOrDefault<word>("samplePatch", "")),
     coupleGroup_(dict),
     offsetMode_(UNIFORM),
@@ -1042,10 +1042,8 @@ Foam::mappedPatchBase::mappedPatchBase
         }
     }
 
-    if (dict.found("offsetMode"))
+    if (offsetModeNames_.readIfPresent("offsetMode", dict, offsetMode_))
     {
-        offsetMode_ = offsetModeNames_.lookup("offsetMode", dict);
-
         switch (offsetMode_)
         {
             case UNIFORM:
diff --git a/src/meshTools/sets/cellSources/faceToCell/faceToCell.C b/src/meshTools/sets/cellSources/faceToCell/faceToCell.C
index 9142f32ae0a..5499aaa9636 100644
--- a/src/meshTools/sets/cellSources/faceToCell/faceToCell.C
+++ b/src/meshTools/sets/cellSources/faceToCell/faceToCell.C
@@ -51,12 +51,12 @@ const Foam::Enum
     Foam::faceToCell::faceAction
 >
 Foam::faceToCell::faceActionNames_
-{
+({
     { faceAction::ANY, "any" },
     { faceAction::ALL, "all" },
     { faceAction::OWNER, "owner" },
     { faceAction::NEIGHBOUR, "neighbour" },
-};
+});
 
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
@@ -147,7 +147,7 @@ Foam::faceToCell::faceToCell
 :
     topoSetSource(mesh),
     setName_(dict.get<word>("set")),
-    option_(faceActionNames_.lookup("option", dict))
+    option_(faceActionNames_.get("option", dict))
 {}
 
 
diff --git a/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.C b/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.C
index 8453e1a3876..8b10efb06a8 100644
--- a/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.C
+++ b/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.C
@@ -51,10 +51,10 @@ const Foam::Enum
     Foam::faceZoneToCell::faceAction
 >
 Foam::faceZoneToCell::faceActionNames_
-{
+({
     { faceAction::MASTER, "master" },
     { faceAction::SLAVE, "slave" },
-};
+});
 
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
@@ -124,7 +124,7 @@ Foam::faceZoneToCell::faceZoneToCell
 :
     topoSetSource(mesh),
     zoneName_(dict.get<wordRe>("name")),
-    option_(faceActionNames_.lookup("option", dict))
+    option_(faceActionNames_.get("option", dict))
 {}
 
 
diff --git a/src/meshTools/sets/cellSources/pointToCell/pointToCell.C b/src/meshTools/sets/cellSources/pointToCell/pointToCell.C
index a11c7d739a3..90e99bc1120 100644
--- a/src/meshTools/sets/cellSources/pointToCell/pointToCell.C
+++ b/src/meshTools/sets/cellSources/pointToCell/pointToCell.C
@@ -51,10 +51,10 @@ const Foam::Enum
     Foam::pointToCell::pointAction
 >
 Foam::pointToCell::pointActionNames_
-{
+({
     { pointAction::ANY, "any" },
     { pointAction::EDGE, "edge" },
-};
+});
 
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
@@ -130,7 +130,7 @@ Foam::pointToCell::pointToCell
 :
     topoSetSource(mesh),
     setName_(dict.get<word>("set")),
-    option_(pointActionNames_.lookup("option", dict))
+    option_(pointActionNames_.get("option", dict))
 {}
 
 
diff --git a/src/meshTools/sets/faceSources/cellToFace/cellToFace.C b/src/meshTools/sets/faceSources/cellToFace/cellToFace.C
index e36dd88c1d4..5b271c8e0da 100644
--- a/src/meshTools/sets/faceSources/cellToFace/cellToFace.C
+++ b/src/meshTools/sets/faceSources/cellToFace/cellToFace.C
@@ -53,10 +53,10 @@ const Foam::Enum
     Foam::cellToFace::cellAction
 >
 Foam::cellToFace::cellActionNames_
-{
+({
     { cellAction::ALL, "all" },
     { cellAction::BOTH, "both" },
-};
+});
 
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
@@ -167,7 +167,7 @@ Foam::cellToFace::cellToFace
 :
     topoSetSource(mesh),
     setName_(dict.get<word>("set")),
-    option_(cellActionNames_.lookup("option", dict))
+    option_(cellActionNames_.get("option", dict))
 {}
 
 
diff --git a/src/meshTools/sets/faceSources/pointToFace/pointToFace.C b/src/meshTools/sets/faceSources/pointToFace/pointToFace.C
index 6da05cd6360..21a1953cf8c 100644
--- a/src/meshTools/sets/faceSources/pointToFace/pointToFace.C
+++ b/src/meshTools/sets/faceSources/pointToFace/pointToFace.C
@@ -53,11 +53,11 @@ const Foam::Enum
     Foam::pointToFace::pointAction
 >
 Foam::pointToFace::pointActionNames_
-{
+({
     { pointAction::ANY, "any" },
     { pointAction::ALL, "all" },
     { pointAction::EDGE, "edge" },
-};
+});
 
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
@@ -161,7 +161,7 @@ Foam::pointToFace::pointToFace
 :
     topoSetSource(mesh),
     setName_(dict.get<word>("set")),
-    option_(pointActionNames_.lookup("option", dict))
+    option_(pointActionNames_.get("option", dict))
 {}
 
 
diff --git a/src/meshTools/sets/pointSources/cellToPoint/cellToPoint.C b/src/meshTools/sets/pointSources/cellToPoint/cellToPoint.C
index 9db7bedc5cc..8ef233ec156 100644
--- a/src/meshTools/sets/pointSources/cellToPoint/cellToPoint.C
+++ b/src/meshTools/sets/pointSources/cellToPoint/cellToPoint.C
@@ -50,9 +50,9 @@ const Foam::Enum
     Foam::cellToPoint::cellAction
 >
 Foam::cellToPoint::cellActionNames_
-{
+({
     { cellAction::ALL, "all" },
-};
+});
 
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
@@ -104,7 +104,7 @@ Foam::cellToPoint::cellToPoint
 :
     topoSetSource(mesh),
     setName_(dict.get<word>("set")),
-    option_(cellActionNames_.lookup("option", dict))
+    option_(cellActionNames_.get("option", dict))
 {}
 
 
diff --git a/src/meshTools/sets/pointSources/faceToPoint/faceToPoint.C b/src/meshTools/sets/pointSources/faceToPoint/faceToPoint.C
index 72e93bdb78e..9f6583eb164 100644
--- a/src/meshTools/sets/pointSources/faceToPoint/faceToPoint.C
+++ b/src/meshTools/sets/pointSources/faceToPoint/faceToPoint.C
@@ -49,9 +49,9 @@ const Foam::Enum
     Foam::faceToPoint::faceAction
 >
 Foam::faceToPoint::faceActionNames_
-{
+({
     { faceAction::ALL, "all" },
-};
+});
 
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
@@ -98,7 +98,7 @@ Foam::faceToPoint::faceToPoint
 :
     topoSetSource(mesh),
     setName_(dict.get<word>("set")),
-    option_(faceActionNames_.lookup("option", dict))
+    option_(faceActionNames_.get("option", dict))
 {}
 
 
diff --git a/src/meshTools/sets/topoSetSource/topoSetSource.C b/src/meshTools/sets/topoSetSource/topoSetSource.C
index 801190f5217..2bd6225e198 100644
--- a/src/meshTools/sets/topoSetSource/topoSetSource.C
+++ b/src/meshTools/sets/topoSetSource/topoSetSource.C
@@ -45,7 +45,7 @@ const Foam::Enum
     Foam::topoSetSource::setAction
 >
 Foam::topoSetSource::actionNames
-{
+({
     { setAction::CLEAR, "clear" },
     { setAction::NEW, "new" },
     { setAction::INVERT, "invert" },
@@ -54,7 +54,7 @@ Foam::topoSetSource::actionNames
     { setAction::SUBSET, "subset" },
     { setAction::LIST, "list" },
     { setAction::REMOVE, "remove" },
-};
+});
 
 
 const Foam::string Foam::topoSetSource::illegalSource_
diff --git a/src/meshTools/triSurface/booleanOps/booleanSurface/booleanSurface.C b/src/meshTools/triSurface/booleanOps/booleanSurface/booleanSurface.C
index b8cc1834247..53981a2596b 100644
--- a/src/meshTools/triSurface/booleanOps/booleanSurface/booleanSurface.C
+++ b/src/meshTools/triSurface/booleanOps/booleanSurface/booleanSurface.C
@@ -43,12 +43,12 @@ const Foam::Enum
     Foam::booleanSurface::booleanOpType
 >
 Foam::booleanSurface::booleanOpTypeNames
-{
+({
     { booleanOpType::UNION, "union" },
     { booleanOpType::INTERSECTION, "intersection" },
     { booleanOpType::DIFFERENCE, "difference" },
     { booleanOpType::ALL, "all" },
-};
+});
 
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
diff --git a/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersection.C b/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersection.C
index 1a067714c2b..8eb4827f684 100644
--- a/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersection.C
+++ b/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersection.C
@@ -46,11 +46,11 @@ const Foam::Enum
     Foam::surfaceIntersection::intersectionType
 >
 Foam::surfaceIntersection::selfIntersectionNames
-{
+({
     { intersectionType::SELF, "self" },
     { intersectionType::SELF_REGION, "region" },
     { intersectionType::NONE, "none" },
-};
+});
 
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
diff --git a/src/meshTools/triSurface/triSurfaceLoader/triSurfaceLoader.C b/src/meshTools/triSurface/triSurfaceLoader/triSurfaceLoader.C
index a5f2a817acf..acc8ee270ce 100644
--- a/src/meshTools/triSurface/triSurfaceLoader/triSurfaceLoader.C
+++ b/src/meshTools/triSurface/triSurfaceLoader/triSurfaceLoader.C
@@ -35,12 +35,12 @@ const Foam::Enum
     Foam::triSurfaceLoader::loadingOption
 >
 Foam::triSurfaceLoader::loadingOptionNames
-{
+({
     { loadingOption::SINGLE_REGION, "single" },
     { loadingOption::FILE_REGION, "file" },
     { loadingOption::OFFSET_REGION, "offset" },
-    { loadingOption::MERGE_REGION, "merge" }
-};
+    { loadingOption::MERGE_REGION, "merge" },
+});
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
diff --git a/src/overset/cellCellStencil/cellCellStencil/cellCellStencil.C b/src/overset/cellCellStencil/cellCellStencil/cellCellStencil.C
index d8fc0620172..afb63ccaac2 100644
--- a/src/overset/cellCellStencil/cellCellStencil/cellCellStencil.C
+++ b/src/overset/cellCellStencil/cellCellStencil/cellCellStencil.C
@@ -42,11 +42,11 @@ const Foam::Enum
     Foam::cellCellStencil::cellType
 >
 Foam::cellCellStencil::cellTypeNames_
-{
+({
     { cellType::CALCULATED, "calculated" },
     { cellType::INTERPOLATED, "interpolated" },
     { cellType::HOLE, "hole" },
-};
+});
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
diff --git a/src/parallel/decompose/kahipDecomp/kahipDecomp.C b/src/parallel/decompose/kahipDecomp/kahipDecomp.C
index 6177e90a7f8..f9839f391c1 100644
--- a/src/parallel/decompose/kahipDecomp/kahipDecomp.C
+++ b/src/parallel/decompose/kahipDecomp/kahipDecomp.C
@@ -60,14 +60,14 @@ const Foam::Enum
     Foam::kahipDecomp::configs
 >
 Foam::kahipDecomp::configNames
-{
+({
     { kahipDecomp::configs::FAST, "fast" },
     { kahipDecomp::configs::ECO, "eco" },
     { kahipDecomp::configs::STRONG, "strong" },
     { kahipDecomp::configs::FASTSOCIAL, "fast-social" },
     { kahipDecomp::configs::ECOSOCIAL, "eco-social" },
     { kahipDecomp::configs::STRONGSOCIAL, "strong-social" },
-};
+});
 
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
@@ -130,9 +130,7 @@ Foam::label Foam::kahipDecomp::decomposeSerial
         }
     }
 
-    kahipConfig =
-        configNames.lookupOrDefault("config", coeffsDict_, kahipConfig);
-
+    configNames.readIfPresent("config", coeffsDict_, kahipConfig);
     coeffsDict_.readIfPresent("imbalance", imbalance);
     coeffsDict_.readIfPresent("verbose", verbose);
 
diff --git a/src/parallel/distributed/distributedTriSurfaceMesh/distributedTriSurfaceMesh.C b/src/parallel/distributed/distributedTriSurfaceMesh/distributedTriSurfaceMesh.C
index 7da8ce27f46..665cf0ce85b 100644
--- a/src/parallel/distributed/distributedTriSurfaceMesh/distributedTriSurfaceMesh.C
+++ b/src/parallel/distributed/distributedTriSurfaceMesh/distributedTriSurfaceMesh.C
@@ -59,11 +59,11 @@ const Foam::Enum
     Foam::distributedTriSurfaceMesh::distributionType
 >
 Foam::distributedTriSurfaceMesh::distributionTypeNames_
-{
+({
     { distributionType::FOLLOW, "follow" },
     { distributionType::INDEPENDENT, "independent" },
     { distributionType::FROZEN, "frozen" },
-};
+});
 
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
@@ -79,7 +79,7 @@ bool Foam::distributedTriSurfaceMesh::read()
     Pstream::scatterList(procBb_);
 
     // Distribution type
-    distType_ = distributionTypeNames_.lookup("distributionType", dict_);
+    distType_ = distributionTypeNames_.get("distributionType", dict_);
 
     // Merge distance
     dict_.readEntry("mergeDistance", mergeDist_);
diff --git a/src/regionCoupled/derivedFvPatchFields/energyRegionCoupled/energyRegionCoupledFvPatchScalarField.C b/src/regionCoupled/derivedFvPatchFields/energyRegionCoupled/energyRegionCoupledFvPatchScalarField.C
index 0c751ec61eb..a750f40d8ed 100644
--- a/src/regionCoupled/derivedFvPatchFields/energyRegionCoupled/energyRegionCoupledFvPatchScalarField.C
+++ b/src/regionCoupled/derivedFvPatchFields/energyRegionCoupled/energyRegionCoupledFvPatchScalarField.C
@@ -35,11 +35,11 @@ const Foam::Enum
     Foam::energyRegionCoupledFvPatchScalarField::kappaMethodType
 >
 Foam::energyRegionCoupledFvPatchScalarField::methodTypeNames_
-{
+({
     { kappaMethodType::SOLID, "solid" },
     { kappaMethodType::FLUID, "fluid" },
     { kappaMethodType::UNDEFINED, "undefined" },
-};
+});
 
 
 // * * * * * * * * * * * * * * * * Private members  * * * * * * * * * * * * *//
diff --git a/src/sampling/meshToMesh/meshToMesh.C b/src/sampling/meshToMesh/meshToMesh.C
index f904480f00e..b141f3ada8b 100644
--- a/src/sampling/meshToMesh/meshToMesh.C
+++ b/src/sampling/meshToMesh/meshToMesh.C
@@ -41,7 +41,7 @@ const Foam::Enum
     Foam::meshToMesh::interpolationMethod
 >
 Foam::meshToMesh::interpolationMethodNames_
-{
+({
     { interpolationMethod::imDirect, "direct" },
     { interpolationMethod::imMapNearest, "mapNearest" },
     { interpolationMethod::imCellVolumeWeight, "cellVolumeWeight" },
@@ -49,7 +49,7 @@ Foam::meshToMesh::interpolationMethodNames_
         interpolationMethod::imCorrectedCellVolumeWeight,
         "correctedCellVolumeWeight"
     },
-};
+});
 
 
 const Foam::Enum
diff --git a/src/sampling/sampledSurface/sampledPatchInternalField/sampledPatchInternalField.C b/src/sampling/sampledSurface/sampledPatchInternalField/sampledPatchInternalField.C
index 7ebff4e1b28..2b6147f74f3 100644
--- a/src/sampling/sampledSurface/sampledPatchInternalField/sampledPatchInternalField.C
+++ b/src/sampling/sampledSurface/sampledPatchInternalField/sampledPatchInternalField.C
@@ -58,11 +58,11 @@ Foam::sampledPatchInternalField::sampledPatchInternalField
     sampledPatch(name, mesh, dict),
     mappers_(patchIDs().size())
 {
-    mappedPatchBase::offsetMode mode = mappedPatchBase::NORMAL;
-    if (dict.found("offsetMode"))
-    {
-        mode = mappedPatchBase::offsetModeNames_.lookup("offsetMode", dict);
-    }
+    mappedPatchBase::offsetMode mode =
+        mappedPatchBase::offsetModeNames_.lookupOrDefault
+        (
+            "offsetMode", dict, mappedPatchBase::NORMAL
+        );
 
     switch (mode)
     {
diff --git a/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C b/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C
index 83db3ec3252..505d75a0b8f 100644
--- a/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C
+++ b/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C
@@ -40,11 +40,11 @@ const Foam::Enum
     Foam::sampledTriSurfaceMesh::samplingSource
 >
 Foam::sampledTriSurfaceMesh::samplingSourceNames_
-{
+({
     { samplingSource::cells, "cells" },
     { samplingSource::insideCells, "insideCells" },
     { samplingSource::boundaryFaces, "boundaryFaces" },
-};
+});
 
 
 namespace Foam
@@ -678,7 +678,7 @@ Foam::sampledTriSurfaceMesh::sampledTriSurfaceMesh
         ),
         dict
     ),
-    sampleSource_(samplingSourceNames_.lookup("source", dict)),
+    sampleSource_(samplingSourceNames_.get("source", dict)),
     needsUpdate_(true),
     keepIds_(dict.lookupOrDefault("keepIds", false)),
     originalIds_(),
diff --git a/src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriter.C b/src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriter.C
index 8709c0a8412..c988f6a10d0 100644
--- a/src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriter.C
+++ b/src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriter.C
@@ -106,11 +106,12 @@ Foam::ensightSurfaceWriter::ensightSurfaceWriter(const dictionary& options)
     surfaceWriter(),
     writeFormat_
     (
-        IOstreamOption::formatNames.lookupOrFailsafe
+        IOstreamOption::formatNames.lookupOrDefault
         (
             "format",
             options,
-            IOstreamOption::ASCII
+            IOstreamOption::ASCII,
+            true  // Failsafe behaviour
         )
     ),
     collateTimes_(options.lookupOrDefault("collateTimes", true))
diff --git a/src/sampling/sampledSurface/writers/nastran/nastranSurfaceWriter.C b/src/sampling/sampledSurface/writers/nastran/nastranSurfaceWriter.C
index 138ab05cd31..e441a10ba97 100644
--- a/src/sampling/sampledSurface/writers/nastran/nastranSurfaceWriter.C
+++ b/src/sampling/sampledSurface/writers/nastran/nastranSurfaceWriter.C
@@ -45,10 +45,10 @@ const Foam::Enum
     Foam::nastranSurfaceWriter::loadFormat
 >
 Foam::nastranSurfaceWriter::loadFormatNames_
-{
+({
     { loadFormat::PLOAD2, "PLOAD2" },
     { loadFormat::PLOAD4, "PLOAD4" },
-};
+});
 
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
diff --git a/src/sampling/surface/triSurfaceMesh/discreteSurface.C b/src/sampling/surface/triSurfaceMesh/discreteSurface.C
index 5df8594ae74..1e0dccc66fc 100644
--- a/src/sampling/surface/triSurfaceMesh/discreteSurface.C
+++ b/src/sampling/surface/triSurfaceMesh/discreteSurface.C
@@ -40,11 +40,11 @@ const Foam::Enum
     Foam::discreteSurface::samplingSource
 >
 Foam::discreteSurface::samplingSourceNames_
-{
+({
     { samplingSource::cells, "cells" },
     { samplingSource::insideCells, "insideCells" },
     { samplingSource::boundaryFaces, "boundaryFaces" },
-};
+});
 
 
 namespace Foam
@@ -684,7 +684,7 @@ Foam::discreteSurface::discreteSurface
             false
         )
     ),
-    sampleSource_(samplingSourceNames_.lookup("source", dict)),
+    sampleSource_(samplingSourceNames_.get("source", dict)),
     needsUpdate_(true),
     keepIds_(dict.lookupOrDefault("keepIds", false)),
     originalIds_(),
diff --git a/src/sixDoFRigidBodyState/sixDoFRigidBodyState.C b/src/sixDoFRigidBodyState/sixDoFRigidBodyState.C
index 7a88136a8e1..0a621590a1f 100644
--- a/src/sixDoFRigidBodyState/sixDoFRigidBodyState.C
+++ b/src/sixDoFRigidBodyState/sixDoFRigidBodyState.C
@@ -51,10 +51,10 @@ const Foam::Enum
     Foam::functionObjects::sixDoFRigidBodyState::angleTypes
 >
 Foam::functionObjects::sixDoFRigidBodyState::angleTypeNames_
-{
+({
     { angleTypes::RADIANS, "radians" },
-    { angleTypes::DEGREES, "degrees" }
-};
+    { angleTypes::DEGREES, "degrees" },
+});
 
 
 // * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
diff --git a/src/thermophysicalModels/radiation/submodels/boundaryRadiationProperties/boundaryRadiationPropertiesPatch.C b/src/thermophysicalModels/radiation/submodels/boundaryRadiationProperties/boundaryRadiationPropertiesPatch.C
index 5d68a5c9c9d..f0df9e2658c 100644
--- a/src/thermophysicalModels/radiation/submodels/boundaryRadiationProperties/boundaryRadiationPropertiesPatch.C
+++ b/src/thermophysicalModels/radiation/submodels/boundaryRadiationProperties/boundaryRadiationPropertiesPatch.C
@@ -35,11 +35,11 @@ const Foam::Enum
     Foam::radiation::boundaryRadiationPropertiesPatch::methodType
 >
 Foam::radiation::boundaryRadiationPropertiesPatch::methodTypeNames_
-{
+({
     { methodType::SOLIDRADIATION, "solidRadiation" },
     { methodType::LOOKUP, "lookup" },
-    { methodType::MODEL, "model" }
-};
+    { methodType::MODEL, "model" },
+});
 
 
 // * * * * * * * * * * * * * * * * Private functions * * * * * * * * * * * * //
@@ -74,7 +74,7 @@ boundaryRadiationPropertiesPatch
     const dictionary& dict
 )
 :
-    method_(methodTypeNames_.lookup("mode", dict)),
+    method_(methodTypeNames_.get("mode", dict)),
     dict_(dict),
     absorptionEmission_(nullptr),
     transmissivity_(nullptr),
diff --git a/src/thermophysicalModels/radiation/submodels/solarCalculator/solarCalculator.C b/src/thermophysicalModels/radiation/submodels/solarCalculator/solarCalculator.C
index 70a8df2ad8d..fca3d56aa25 100644
--- a/src/thermophysicalModels/radiation/submodels/solarCalculator/solarCalculator.C
+++ b/src/thermophysicalModels/radiation/submodels/solarCalculator/solarCalculator.C
@@ -43,10 +43,10 @@ const Foam::Enum
     Foam::solarCalculator::sunDirModel
 >
 Foam::solarCalculator::sunDirectionModelTypeNames_
-{
+({
     { sunDirModel::mSunDirConstant, "sunDirConstant" },
     { sunDirModel::mSunDirTracking, "sunDirTracking" },
-};
+});
 
 
 const Foam::Enum
@@ -54,14 +54,14 @@ const Foam::Enum
     Foam::solarCalculator::sunLModel
 >
 Foam::solarCalculator::sunLoadModelTypeNames_
-{
+({
     { sunLModel::mSunLoadConstant, "sunLoadConstant" },
     {
         sunLModel::mSunLoadFairWeatherConditions,
         "sunLoadFairWeatherConditions"
     },
     { sunLModel::mSunLoadTheoreticalMaximum, "sunLoadTheoreticalMaximum" },
-};
+});
 
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
@@ -261,19 +261,15 @@ Foam::solarCalculator::solarCalculator
     C_(dict.get<scalar>("C")),
     sunDirectionModel_
     (
-        sunDirectionModelTypeNames_.lookup("sunDirectionModel", dict)
-    ),
-    sunLoadModel_
-    (
-        sunLoadModelTypeNames_.lookup("sunLoadModel", dict)
+        sunDirectionModelTypeNames_.get("sunDirectionModel", dict)
     ),
+    sunLoadModel_(sunLoadModelTypeNames_.get("sunLoadModel", dict)),
     coord_()
 {
     init();
 }
 
 
-
 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
 
 Foam::solarCalculator::~solarCalculator()
diff --git a/src/thermophysicalModels/thermophysicalPropertiesFvPatchFields/liquidProperties/humidityTemperatureCoupledMixed/humidityTemperatureCoupledMixedFvPatchScalarField.C b/src/thermophysicalModels/thermophysicalPropertiesFvPatchFields/liquidProperties/humidityTemperatureCoupledMixed/humidityTemperatureCoupledMixedFvPatchScalarField.C
index 316e1367e07..0175bbc9415 100644
--- a/src/thermophysicalModels/thermophysicalPropertiesFvPatchFields/liquidProperties/humidityTemperatureCoupledMixed/humidityTemperatureCoupledMixedFvPatchScalarField.C
+++ b/src/thermophysicalModels/thermophysicalPropertiesFvPatchFields/liquidProperties/humidityTemperatureCoupledMixed/humidityTemperatureCoupledMixedFvPatchScalarField.C
@@ -38,7 +38,7 @@ const Foam::Enum
     Foam::humidityTemperatureCoupledMixedFvPatchScalarField::massTransferMode
 >
 Foam::humidityTemperatureCoupledMixedFvPatchScalarField::massModeTypeNames_
-{
+({
     { massTransferMode::mtConstantMass, "constantMass" },
     { massTransferMode::mtCondensation, "condensation" },
     { massTransferMode::mtEvaporation, "evaporation" },
@@ -46,7 +46,7 @@ Foam::humidityTemperatureCoupledMixedFvPatchScalarField::massModeTypeNames_
         massTransferMode::mtCondensationAndEvaporation,
         "condensationAndEvaporation"
     },
-};
+});
 
 
 // * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * * //
@@ -240,9 +240,8 @@ humidityTemperatureCoupledMixedFvPatchScalarField
 
     fvPatchScalarField::operator=(scalarField("value", dict, p.size()));
 
-    if (dict.found("mode"))
+    if (massModeTypeNames_.readIfPresent("mode", dict, mode_))
     {
-        mode_ = massModeTypeNames_.lookup("mode", dict);
         fluid_ = true;
     }
 
diff --git a/src/transportModels/twoPhaseProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C b/src/transportModels/twoPhaseProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C
index 75763c8301c..32f2da49629 100644
--- a/src/transportModels/twoPhaseProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C
+++ b/src/transportModels/twoPhaseProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C
@@ -40,12 +40,12 @@ const Foam::Enum
     Foam::alphaContactAngleFvPatchScalarField::limitControls
 >
 Foam::alphaContactAngleFvPatchScalarField::limitControlNames_
-{
+({
     { limitControls::lcNone, "none" },
     { limitControls::lcGradient, "gradient" },
     { limitControls::lcZeroGradient, "zeroGradient" },
     { limitControls::lcAlpha, "alpha" },
-};
+});
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
@@ -69,7 +69,7 @@ Foam::alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
 )
 :
     fixedGradientFvPatchScalarField(p, iF),
-    limit_(limitControlNames_.lookup("limit", dict))
+    limit_(limitControlNames_.get("limit", dict))
 {
     if (dict.found("gradient"))
     {
-- 
GitLab