From c3457b51526d4c6fd8b278b95f0a3b61296429f1 Mon Sep 17 00:00:00 2001
From: Mark Olesen <Mark.Olesen@Germany>
Date: Wed, 2 Dec 2009 13:45:11 +0100
Subject: [PATCH] argList - specializations for optionRead<string> etc.

- new optionLookupOrDefault and additional form of optionReadIfPresent
  with a default value
---
 .../test/fileNameClean/fileNameCleanTest.C    |   6 +-
 applications/test/tokenizeTest/tokenizeTest.C |   4 +-
 .../combinePatchFaces/combinePatchFaces.C     |  15 +-
 .../mesh/advanced/splitCells/splitCells.C     |   3 +-
 .../fluent3DMeshToFoam/fluent3DMeshToFoam.L   |  14 +-
 .../mesh/conversion/sammToFoam/sammToFoam.C   |   3 +-
 .../mesh/conversion/star4ToFoam/star4ToFoam.C |  14 +-
 .../mesh/conversion/starToFoam/starToFoam.C   |   3 +-
 .../mesh/generation/blockMesh/blockMeshApp.C  |   4 +-
 .../dataConversion/foamToVTK/foamToVTK.C      |   8 +-
 .../surfaceMeshExport/surfaceMeshExport.C     |   3 +-
 .../surface/surfaceToPatch/surfaceToPatch.C   |   9 +-
 src/OpenFOAM/global/argList/argList.H         |  95 ++++-----
 src/OpenFOAM/global/argList/argListI.H        | 193 ++++++++++++++++++
 .../global/argList/argListTemplates.C         |  63 ------
 15 files changed, 263 insertions(+), 174 deletions(-)
 create mode 100644 src/OpenFOAM/global/argList/argListI.H
 delete mode 100644 src/OpenFOAM/global/argList/argListTemplates.C

diff --git a/applications/test/fileNameClean/fileNameCleanTest.C b/applications/test/fileNameClean/fileNameCleanTest.C
index 2d791439e99..70317e61ede 100644
--- a/applications/test/fileNameClean/fileNameCleanTest.C
+++ b/applications/test/fileNameClean/fileNameCleanTest.C
@@ -74,9 +74,9 @@ int main(int argc, char *argv[])
         args.printUsage();
     }
 
-    if (args.optionFound("case"))
+    fileName pathName;
+    if (args.optionReadIfPresent("case", pathName))
     {
-        fileName pathName = args.option("case");
         Info<< nl
             << "-case" << nl
             << "path = " << args.path() << nl
@@ -91,7 +91,7 @@ int main(int argc, char *argv[])
 
     forAll(args.additionalArgs(), argI)
     {
-        fileName pathName = args.additionalArgs()[argI];
+        pathName = args.additionalArgs()[argI];
         printCleaning(pathName);
     }
 
diff --git a/applications/test/tokenizeTest/tokenizeTest.C b/applications/test/tokenizeTest/tokenizeTest.C
index 99bc5999845..decafd7fc42 100644
--- a/applications/test/tokenizeTest/tokenizeTest.C
+++ b/applications/test/tokenizeTest/tokenizeTest.C
@@ -49,11 +49,9 @@ int main(int argc, char *argv[])
 
     argList args(argc, argv, false, true);
 
-    label repeat = 1;
-    args.optionReadIfPresent<label>("repeat", repeat);
+    const label repeat = args.optionLookupOrDefault<label>("repeat", 1);
 
     cpuTime timer;
-
     for (label count = 0; count < repeat; ++count)
     {
         forAll(args.additionalArgs(), argI)
diff --git a/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C b/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C
index 5fc2803c8d8..b0d0ab313b5 100644
--- a/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C
+++ b/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C
@@ -59,10 +59,6 @@ using namespace Foam;
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-// Sin of angle between two consecutive edges on a face. If sin(angle) larger
-// than this the face will be considered concave.
-const scalar defaultConcaveAngle = 30;
-
 
 // Same check as snapMesh
 void checkSnapMesh
@@ -447,8 +443,9 @@ int main(int argc, char *argv[])
 
     scalar minCos = Foam::cos(degToRad(featureAngle));
 
-    scalar concaveAngle = defaultConcaveAngle;
-    args.optionReadIfPresent("concaveAngle", concaveAngle);
+    // Sin of angle between two consecutive edges on a face.
+    // If sin(angle) larger than this the face will be considered concave.
+    scalar concaveAngle = args.optionLookupOrDefault("concaveAngle", 30.0);
 
     scalar concaveSin = Foam::sin(degToRad(concaveAngle));
 
@@ -483,8 +480,8 @@ int main(int argc, char *argv[])
     // Merge points on straight edges and remove unused points
     if (snapMeshDict)
     {
-        Info<< "Merging all 'loose' points on surface edges"
-            << ", regardless of the angle they make." << endl;
+        Info<< "Merging all 'loose' points on surface edges, "
+            << "regardless of the angle they make." << endl;
 
         // Surface bnound to be used to extrude. Merge all loose points.
         nChanged += mergeEdges(-1, mesh);
@@ -510,7 +507,7 @@ int main(int argc, char *argv[])
         Info<< "Mesh unchanged." << endl;
     }
 
-    Info<< "End\n" << endl;
+    Info<< "\nEnd\n" << endl;
 
     return 0;
 }
diff --git a/applications/utilities/mesh/advanced/splitCells/splitCells.C b/applications/utilities/mesh/advanced/splitCells/splitCells.C
index 6cad468c2c3..b2851345b87 100644
--- a/applications/utilities/mesh/advanced/splitCells/splitCells.C
+++ b/applications/utilities/mesh/advanced/splitCells/splitCells.C
@@ -546,8 +546,7 @@ int main(int argc, char *argv[])
     bool geometry  = args.optionFound("geometry");
     bool overwrite = args.optionFound("overwrite");
 
-    scalar edgeTol = 0.2;
-    args.optionReadIfPresent("tol", edgeTol);
+    scalar edgeTol = args.optionLookupOrDefault("tol", 0.2);
 
     Info<< "Trying to split cells with internal angles > feature angle\n" << nl
         << "featureAngle      : " << featureAngle << nl
diff --git a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L
index cf46939eaeb..58523bc1647 100644
--- a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L
+++ b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L
@@ -776,17 +776,11 @@ int main(int argc, char *argv[])
 
     args.optionReadIfPresent("scale", scaleFactor);
 
-    HashSet<word> ignoreCellGroups;
-    if (args.optionFound("ignoreCellGroups"))
-    {
-        args.optionLookup("ignoreCellGroups")() >> ignoreCellGroups;
-    }
+    wordHashSet ignoreCellGroups;
+    wordHashSet ignoreFaceGroups;
 
-    HashSet<word> ignoreFaceGroups;
-    if (args.optionFound("ignoreFaceGroups"))
-    {
-        args.optionLookup("ignoreFaceGroups")() >> ignoreFaceGroups;
-    }
+    args.optionReadIfPresent("ignoreCellGroups", ignoreCellGroups);
+    args.optionReadIfPresent("ignoreFaceGroups", ignoreFaceGroups);
 
     cubitFile = args.options().found("cubit");
 
diff --git a/applications/utilities/mesh/conversion/sammToFoam/sammToFoam.C b/applications/utilities/mesh/conversion/sammToFoam/sammToFoam.C
index 0f5f2a2eb83..012382560d5 100644
--- a/applications/utilities/mesh/conversion/sammToFoam/sammToFoam.C
+++ b/applications/utilities/mesh/conversion/sammToFoam/sammToFoam.C
@@ -50,8 +50,7 @@ int main(int argc, char *argv[])
         FatalError.exit();
     }
 
-    scalar scaleFactor = 1.0;
-    args.optionReadIfPresent("scale", scaleFactor);
+    scalar scaleFactor = args.optionLookupOrDefault("scale", 1.0);
 
 #   include "createTime.H"
 
diff --git a/applications/utilities/mesh/conversion/star4ToFoam/star4ToFoam.C b/applications/utilities/mesh/conversion/star4ToFoam/star4ToFoam.C
index 699ecaa49db..390f2bd4ebd 100644
--- a/applications/utilities/mesh/conversion/star4ToFoam/star4ToFoam.C
+++ b/applications/utilities/mesh/conversion/star4ToFoam/star4ToFoam.C
@@ -71,19 +71,13 @@ int main(int argc, char *argv[])
     const stringList& params = args.additionalArgs();
 
     // default rescale from [mm] to [m]
-    scalar scaleFactor = 0.001;
-    if (args.optionReadIfPresent("scale", scaleFactor))
+    scalar scaleFactor = args.optionLookupOrDefault("scale", 0.001);
+    if (scaleFactor <= 0)
     {
-        if (scaleFactor <= 0)
-        {
-            scaleFactor = 1;
-        }
+        scaleFactor = 1;
     }
 
-    if (args.optionFound("solids"))
-    {
-        meshReaders::STARCD::keepSolids = true;
-    }
+    meshReaders::STARCD::keepSolids = args.optionFound("solids");
 
     // default to binary output, unless otherwise specified
     IOstream::streamFormat format = IOstream::BINARY;
diff --git a/applications/utilities/mesh/conversion/starToFoam/starToFoam.C b/applications/utilities/mesh/conversion/starToFoam/starToFoam.C
index 7ed1cddd368..24da39c9a17 100644
--- a/applications/utilities/mesh/conversion/starToFoam/starToFoam.C
+++ b/applications/utilities/mesh/conversion/starToFoam/starToFoam.C
@@ -50,8 +50,7 @@ int main(int argc, char *argv[])
         FatalError.exit();
     }
 
-    scalar scaleFactor = 1.0;
-    args.optionReadIfPresent("scale", scaleFactor);
+    scalar scaleFactor = args.optionLookupOrDefault("scale", 1.0);
 
 #   include "createTime.H"
 
diff --git a/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C b/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C
index bb30cfd4a56..717f36b5378 100644
--- a/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C
+++ b/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C
@@ -83,10 +83,9 @@ int main(int argc, char *argv[])
     word regionName;
     fileName polyMeshDir;
 
-    if (args.optionFound("region"))
+    if (args.optionReadIfPresent("region", regionName, polyMesh::defaultRegion))
     {
         // constant/<region>/polyMesh/blockMeshDict
-        regionName  = args.option("region");
         polyMeshDir = regionName/polyMesh::meshSubDir;
 
         Info<< nl << "Generating mesh for region " << regionName << endl;
@@ -94,7 +93,6 @@ int main(int argc, char *argv[])
     else
     {
         // constant/polyMesh/blockMeshDict
-        regionName  = polyMesh::defaultRegion;
         polyMeshDir = polyMesh::meshSubDir;
     }
 
diff --git a/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK.C b/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK.C
index fee07515ee5..5743bda34bf 100644
--- a/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK.C
+++ b/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK.C
@@ -301,7 +301,7 @@ int main(int argc, char *argv[])
     }
 
     word cellSetName;
-    string vtkName;
+    string vtkName = runTime.caseName();
 
     if (args.optionFound("cellSet"))
     {
@@ -311,8 +311,6 @@ int main(int argc, char *argv[])
     else if (Pstream::parRun())
     {
         // Strip off leading casename, leaving just processor_DDD ending.
-        vtkName = runTime.caseName();
-
         string::size_type i = vtkName.rfind("processor");
 
         if (i != string::npos)
@@ -320,10 +318,6 @@ int main(int argc, char *argv[])
             vtkName = vtkName.substr(i);
         }
     }
-    else
-    {
-        vtkName = runTime.caseName();
-    }
 
 
     instantList timeDirs = timeSelector::select0(runTime, args);
diff --git a/applications/utilities/surface/surfaceMeshExport/surfaceMeshExport.C b/applications/utilities/surface/surfaceMeshExport/surfaceMeshExport.C
index b6538d0bc17..40a1a398206 100644
--- a/applications/utilities/surface/surfaceMeshExport/surfaceMeshExport.C
+++ b/applications/utilities/surface/surfaceMeshExport/surfaceMeshExport.C
@@ -88,8 +88,7 @@ int main(int argc, char *argv[])
     const stringList& params = args.additionalArgs();
 
     fileName exportName(params[0]);
-    word importName("default");
-    args.optionReadIfPresent("name", importName);
+    word importName = args.optionLookupOrDefault<word>("name", "default");
 
     // check that writing is supported
     if (!MeshedSurface<face>::canWriteType(exportName.ext(), true))
diff --git a/applications/utilities/surface/surfaceToPatch/surfaceToPatch.C b/applications/utilities/surface/surfaceToPatch/surfaceToPatch.C
index f602fa47b01..dd5a2e2edf7 100644
--- a/applications/utilities/surface/surfaceToPatch/surfaceToPatch.C
+++ b/applications/utilities/surface/surfaceToPatch/surfaceToPatch.C
@@ -177,13 +177,11 @@ int main(int argc, char *argv[])
 
     Info<< "Reading surface from " << surfName << " ..." << endl;
 
-    bool readSet = args.optionFound("faceSet");
     word setName;
+    bool readSet = args.optionReadIfPresent("faceSet", setName);
 
     if (readSet)
     {
-        setName = args.option("faceSet");
-
         Info<< "Repatching only the faces in faceSet " << setName
             << " according to nearest surface triangle ..." << endl;
     }
@@ -193,8 +191,7 @@ int main(int argc, char *argv[])
             << " triangle ..." << endl;
     }
 
-    scalar searchTol = 1E-3;
-    args.optionReadIfPresent("tol", searchTol);
+    scalar searchTol = args.optionLookupOrDefault("tol", 1e-3);
 
     // Get search box. Anything not within this box will not be considered.
     const boundBox& meshBb = mesh.globalData().bb();
@@ -211,7 +208,7 @@ int main(int argc, char *argv[])
     forAll(mesh.boundaryMesh(), patchI)
     {
         Info<< "    " << mesh.boundaryMesh()[patchI].name() << '\t'
-            << mesh.boundaryMesh()[patchI].size() << endl;
+            << mesh.boundaryMesh()[patchI].size() << nl;
     }
     Info<< endl;
 
diff --git a/src/OpenFOAM/global/argList/argList.H b/src/OpenFOAM/global/argList/argList.H
index 2682803807c..78762139685 100644
--- a/src/OpenFOAM/global/argList/argList.H
+++ b/src/OpenFOAM/global/argList/argList.H
@@ -159,8 +159,7 @@ public:
         );
 
 
-    // Destructor
-
+        //- Destructor
         virtual ~argList();
 
 
@@ -169,81 +168,75 @@ public:
         // Access
 
             //- Name of executable
-            const word& executable() const
-            {
-                return executable_;
-            }
+            inline const word& executable() const;
 
             //- Return root path
-            const fileName& rootPath() const
-            {
-                return rootPath_;
-            }
-
-            //- Return case name
-            const fileName& globalCaseName() const
-            {
-                return globalCase_;
-            }
+            inline const fileName& rootPath() const;
 
             //- Return case name (parallel run) or global case (serial run)
-            const fileName& caseName() const
-            {
-                return case_;
-            }
+            inline const fileName& caseName() const;
 
-            //- Return the path
-            fileName path() const
-            {
-                return rootPath()/caseName();
-            }
+            //- Return case name
+            inline const fileName& globalCaseName() const;
+
+            //- Return the path to the caseName
+            inline fileName path() const;
 
             //- Return arguments
-            const stringList& args() const
-            {
-                return args_;
-            }
+            inline const stringList& args() const;
 
             //- Return additionl arguments,
             //  i.e. those additional to the executable itself
             stringList::subList additionalArgs() const;
 
             //- Return options
-            const Foam::HashTable<string>& options() const
-            {
-                return options_;
-            }
+            inline const Foam::HashTable<string>& options() const;
 
             //- Return the argument string associated with the named option
-            const string& option(const word& opt) const
-            {
-                return options_.operator[](opt);
-            }
+            inline const string& option(const word& opt) const;
 
             //- Return true if the named option is found
-            bool optionFound(const word& opt) const
-            {
-                return options_.found(opt);
-            }
+            inline bool optionFound(const word& opt) const;
 
-            //- Return an IStringStream to the named option
-            IStringStream optionLookup(const word& opt) const
-            {
-                return IStringStream(option(opt));
-            }
+            //- Return an IStringStream from the named option
+            inline IStringStream optionLookup(const word& opt) const;
 
             //- Read a value from the named option
             template<class T>
-            T optionRead(const word& opt) const;
+            inline T optionRead(const word& opt) const;
+
+            //- Read a value from the named option if present.
+            //  Return true if the named option was found.
+            template<class T>
+            inline bool optionReadIfPresent(const word& opt, T&) const;
+
+            //- Read a value from the named option if present.
+            //  Return true if the named option was found, otherwise
+            //  use the supplied default and return false.
+            template<class T>
+            inline bool optionReadIfPresent
+            (
+                const word& opt,
+                T&,
+                const T& deflt
+            ) const;
 
             //- Read a value from the named option if present.
             //  Return true if the named option was found.
             template<class T>
-            bool optionReadIfPresent(const word& opt, T& val) const;
+            inline T optionLookupOrDefault
+            (
+                const word& opt,
+                const T& deflt
+            ) const;
 
             //- Read a List of values from the named option
             template<class T>
-            List<T> optionReadList(const word& opt) const;
+            List<T> optionReadList(const word& opt) const
+            {
+                return readList<T>(optionLookup(opt)());
+            }
+
 
 
         // Edit
@@ -281,9 +274,7 @@ public:
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-#ifdef NoRepository
-#   include "argListTemplates.C"
-#endif
+#include "argListI.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/src/OpenFOAM/global/argList/argListI.H b/src/OpenFOAM/global/argList/argListI.H
new file mode 100644
index 00000000000..8a9e360c5ac
--- /dev/null
+++ b/src/OpenFOAM/global/argList/argListI.H
@@ -0,0 +1,193 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2009-2009 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 2 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, write to the Free Software Foundation,
+    Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+\*---------------------------------------------------------------------------*/
+
+#include "argList.H"
+
+// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
+
+inline const Foam::word& Foam::argList::executable() const
+{
+    return executable_;
+}
+
+
+inline const Foam::fileName& Foam::argList::rootPath() const
+{
+    return rootPath_;
+}
+
+
+inline const Foam::fileName& Foam::argList::caseName() const
+{
+    return case_;
+}
+
+
+inline const Foam::fileName& Foam::argList::globalCaseName() const
+{
+    return globalCase_;
+}
+
+
+inline Foam::fileName Foam::argList::path() const
+{
+    return rootPath()/caseName();
+}
+
+
+inline const Foam::stringList& Foam::argList::args() const
+{
+    return args_;
+}
+
+
+inline const Foam::HashTable<Foam::string>& Foam::argList::options() const
+{
+    return options_;
+}
+
+
+inline const Foam::string& Foam::argList::option(const word& opt) const
+{
+    return options_.operator[](opt);
+}
+
+
+inline bool Foam::argList::optionFound(const word& opt) const
+{
+    return options_.found(opt);
+}
+
+
+inline Foam::IStringStream Foam::argList::optionLookup(const word& opt) const
+{
+    return IStringStream(option(opt));
+}
+
+
+// * * * * * * * * * * * * Template Specializations  * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+    // Template specialization for string
+    template<>
+    inline Foam::string
+    Foam::argList::optionRead<Foam::string>(const word& opt) const
+    {
+        return option(opt);
+    }
+
+    // Template specialization for word
+    template<>
+    inline Foam::word
+    Foam::argList::optionRead<Foam::word>(const word& opt) const
+    {
+        return option(opt);
+    }
+
+    // Template specialization for fileName
+    template<>
+    inline Foam::fileName
+    Foam::argList::optionRead<Foam::fileName>(const word& opt) const
+    {
+        return option(opt);
+    }
+
+
+} // End namespace Foam
+
+
+// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
+
+template<class T>
+inline T Foam::argList::optionRead(const word& opt) const
+{
+    T val;
+
+    optionLookup(opt)() >> val;
+    return val;
+}
+
+
+template<class T>
+inline bool Foam::argList::optionReadIfPresent
+(
+    const word& opt,
+    T& val
+) const
+{
+    if (optionFound(opt))
+    {
+        val = optionRead<T>(opt);
+        return true;
+    }
+    else
+    {
+        return false;
+    }
+}
+
+
+template<class T>
+inline bool Foam::argList::optionReadIfPresent
+(
+    const word& opt,
+    T& val,
+    const T& deflt
+) const
+{
+    if (optionReadIfPresent<T>(opt, val))
+    {
+        return true;
+    }
+    else
+    {
+        val = deflt;
+        return false;
+    }
+}
+
+
+template<class T>
+inline T Foam::argList::optionLookupOrDefault
+(
+    const word& opt,
+    const T& deflt
+) const
+{
+    if (optionFound(opt))
+    {
+        return optionRead<T>(opt);
+    }
+    else
+    {
+        return deflt;
+    }
+}
+
+
+// ************************************************************************* //
diff --git a/src/OpenFOAM/global/argList/argListTemplates.C b/src/OpenFOAM/global/argList/argListTemplates.C
deleted file mode 100644
index 8bc3da3469c..00000000000
--- a/src/OpenFOAM/global/argList/argListTemplates.C
+++ /dev/null
@@ -1,63 +0,0 @@
-/*---------------------------------------------------------------------------*\
-  =========                 |
-  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
-   \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2009-2009 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 2 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, write to the Free Software Foundation,
-    Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-\*---------------------------------------------------------------------------*/
-
-#include "argList.H"
-
-// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
-
-template<class T>
-T Foam::argList::optionRead(const word& opt) const
-{
-    T val;
-
-    optionLookup(opt)() >> val;
-    return val;
-}
-
-
-template<class T>
-bool Foam::argList::optionReadIfPresent(const word& opt, T& val) const
-{
-    if (optionFound(opt))
-    {
-        val = optionRead<T>(opt);
-        return true;
-    }
-    else
-    {
-        return false;
-    }
-}
-
-
-template<class T>
-Foam::List<T> Foam::argList::optionReadList(const word& opt) const
-{
-    return readList<T>(optionLookup(opt)());
-}
-
-
-// ************************************************************************* //
-- 
GitLab