ENH: upgrade from NamedEnum to Enum (issue #515)

This commit is contained in:
Mark Olesen
2017-07-03 21:43:33 +02:00
parent 575073890f
commit f55c568f13
179 changed files with 1595 additions and 2035 deletions

View File

@ -43,26 +43,17 @@ using namespace Foam::constant::mathematical;
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template<> const Foam::Enum
const char* Foam::NamedEnum
< <
Foam::compressible:: Foam::compressible::
alphatWallBoilingWallFunctionFvPatchScalarField::phaseType, alphatWallBoilingWallFunctionFvPatchScalarField::phaseType
2
>::names[] =
{
"vapor",
"liquid"
};
const Foam::NamedEnum
<
Foam::compressible::
alphatWallBoilingWallFunctionFvPatchScalarField::phaseType,
2
> >
Foam::compressible:: Foam::compressible::
alphatWallBoilingWallFunctionFvPatchScalarField::phaseTypeNames_; alphatWallBoilingWallFunctionFvPatchScalarField::phaseTypeNames_
{
{ phaseType::vaporPhase, "vapor" },
{ phaseType::liquidPhase, "liquid" },
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -111,7 +102,7 @@ alphatWallBoilingWallFunctionFvPatchScalarField
) )
: :
alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(p, iF, dict), alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(p, iF, dict),
phaseType_(phaseTypeNames_.read(dict.lookup("phaseType"))), phaseType_(phaseTypeNames_.lookup("phaseType", dict)),
relax_(dict.lookupOrDefault<scalar>("relax", 0.5)), relax_(dict.lookupOrDefault<scalar>("relax", 0.5)),
AbyV_(p.size(), 0), AbyV_(p.size(), 0),
alphatConv_(p.size(), 0), alphatConv_(p.size(), 0),

View File

@ -164,7 +164,7 @@ private:
// Private data // Private data
//- Heat source type names //- Heat source type names
static const NamedEnum<phaseType, 2> phaseTypeNames_; static const Enum<phaseType> phaseTypeNames_;
//- Heat source type //- Heat source type
phaseType phaseType_; phaseType phaseType_;

View File

@ -69,18 +69,12 @@ enum ExtrudeMode
SURFACE SURFACE
}; };
namespace Foam static const Enum<ExtrudeMode> ExtrudeModeNames
{ {
template<> { ExtrudeMode::MESH, "mesh" },
const char* NamedEnum<ExtrudeMode, 3>::names[] = { ExtrudeMode::PATCH, "patch" },
{ { ExtrudeMode::SURFACE, "surface" },
"mesh",
"patch",
"surface"
}; };
}
static const NamedEnum<ExtrudeMode, 3> ExtrudeModeNames;
void createDummyFvMeshFiles(const polyMesh& mesh, const word& regionName) void createDummyFvMeshFiles(const polyMesh& mesh, const word& regionName)
@ -305,9 +299,10 @@ int main(int argc, char *argv[])
const Switch flipNormals(dict.lookup("flipNormals")); const Switch flipNormals(dict.lookup("flipNormals"));
// What to extrude // What to extrude
const ExtrudeMode mode = ExtrudeModeNames.read const ExtrudeMode mode = ExtrudeModeNames.lookup
( (
dict.lookup("constructFrom") "constructFrom",
dict
); );
// Any merging of small edges // Any merging of small edges

View File

@ -60,17 +60,11 @@ enum ExtrudeMode
MESHEDSURFACE MESHEDSURFACE
}; };
namespace Foam static const Enum<ExtrudeMode> ExtrudeModeNames
{ {
template<> { ExtrudeMode::POLYMESH2D, "polyMesh2D" },
const char* NamedEnum<ExtrudeMode, 2>::names[] = { ExtrudeMode::MESHEDSURFACE, "MeshedSurface" },
{
"polyMesh2D",
"MeshedSurface"
}; };
}
static const NamedEnum<ExtrudeMode, 2> ExtrudeModeNames;
//pointField moveInitialPoints //pointField moveInitialPoints

View File

@ -42,24 +42,20 @@ License
namespace Foam namespace Foam
{ {
defineTypeNameAndDebug(conformalVoronoiMesh, 0); defineTypeNameAndDebug(conformalVoronoiMesh, 0);
template<>
const char* NamedEnum
<
conformalVoronoiMesh::dualMeshPointType,
5
>::names[] =
{
"internal",
"surface",
"featureEdge",
"featurePoint",
"constrained"
};
} }
const Foam::NamedEnum<Foam::conformalVoronoiMesh::dualMeshPointType, 5> const Foam::Enum
Foam::conformalVoronoiMesh::dualMeshPointTypeNames_; <
Foam::conformalVoronoiMesh::dualMeshPointType
>
Foam::conformalVoronoiMesh::dualMeshPointTypeNames_
{
{ dualMeshPointType::internal, "internal" },
{ dualMeshPointType::surface, "surface" },
{ dualMeshPointType::featureEdge, "featureEdge" },
{ dualMeshPointType::featurePoint, "featurePoint" },
{ dualMeshPointType::constrained, "constrained" },
};
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //

View File

@ -122,7 +122,7 @@ public:
constrained = 4 constrained = 4
}; };
static const NamedEnum<dualMeshPointType, 5> dualMeshPointTypeNames_; static const Enum<dualMeshPointType> dualMeshPointTypeNames_;
private: private:

View File

@ -27,20 +27,19 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template<> const Foam::Enum
const char* <
Foam::NamedEnum<Foam::indexedCellEnum::cellTypes, 6>::names[] = Foam::indexedCellEnum::cellTypes
>
Foam::indexedCellEnum::cellTypesNames_
{ {
"Unassigned", { cellTypes::ctUnassigned, "Unassigned" },
"Internal", { cellTypes::ctFar, "Far" },
"Surface", { cellTypes::ctInternal, "Internal" },
"FeatureEdge", { cellTypes::ctSurface, "Surface" },
"FeaturePoint", { cellTypes::ctFeatureEdge, "FeatureEdge" },
"Far" { cellTypes::ctFeaturePoint,"FeaturePoint" },
}; };
const Foam::NamedEnum<Foam::indexedCellEnum::cellTypes, 6>
cellTypesNames_;
// ************************************************************************* // // ************************************************************************* //

View File

@ -34,7 +34,7 @@ SourceFiles
#ifndef indexedCellEnum_H #ifndef indexedCellEnum_H
#define indexedCellEnum_H #define indexedCellEnum_H
#include "NamedEnum.H" #include "Enum.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -47,7 +47,6 @@ class indexedCellEnum
{ {
public: public:
enum cellTypes enum cellTypes
{ {
ctUnassigned = INT_MIN, ctUnassigned = INT_MIN,
@ -58,7 +57,7 @@ public:
ctFeaturePoint = INT_MIN + 5 ctFeaturePoint = INT_MIN + 5
}; };
static const Foam::NamedEnum<cellTypes, 6> cellTypesNames_; static const Enum<cellTypes> cellTypesNames_;
}; };

View File

@ -28,42 +28,42 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template<> const Foam::Enum
const char* <
Foam::NamedEnum<Foam::indexedVertexEnum::vertexType, 15>::names[] = Foam::indexedVertexEnum::vertexType
>
Foam::indexedVertexEnum::vertexTypeNames_
{ {
"Unassigned", { vertexType::vtUnassigned, "Unassigned" },
"Internal", { vertexType::vtInternal, "Internal" },
"InternalNearBoundary", { vertexType::vtInternalNearBoundary, "InternalNearBoundary" },
"InternalSurface", { vertexType::vtInternalSurface, "InternalSurface" },
"InternalSurfaceBaffle", { vertexType::vtInternalSurfaceBaffle, "InternalSurfaceBaffle" },
"ExternalSurfaceBaffle", { vertexType::vtExternalSurfaceBaffle, "ExternalSurfaceBaffle" },
"InternalFeatureEdge", { vertexType::vtInternalFeatureEdge, "InternalFeatureEdge" },
"InternalFeatureEdgeBaffle", { vertexType::vtInternalFeatureEdgeBaffle, "InternalFeatureEdgeBaffle" },
"ExternalFeatureEdgeBaffle", { vertexType::vtExternalFeatureEdgeBaffle, "ExternalFeatureEdgeBaffle" },
"InternalFeaturePoint", { vertexType::vtInternalFeaturePoint, "InternalFeaturePoint" },
"ExternalSurface", { vertexType::vtExternalSurface, "ExternalSurface" },
"ExternalFeatureEdge", { vertexType::vtExternalFeatureEdge, "ExternalFeatureEdge" },
"ExternalFeaturePoint", { vertexType::vtExternalFeaturePoint, "ExternalFeaturePoint" },
"Far", { vertexType::vtFar, "Far" },
"Constrained" { vertexType::vtConstrained, "Constrained" },
}; };
const Foam::NamedEnum<Foam::indexedVertexEnum::vertexType, 15>
Foam::indexedVertexEnum::vertexTypeNames_;
const Foam::Enum
template<> <
const char* Foam::indexedVertexEnum::vertexMotion
Foam::NamedEnum<Foam::indexedVertexEnum::vertexMotion, 2>::names[] = >
Foam::indexedVertexEnum::vertexMotionNames_
{ {
"fixed", { vertexMotion::fixed, "fixed" },
"movable" { vertexMotion::movable, "movable" },
}; };
const Foam::NamedEnum<Foam::indexedVertexEnum::vertexMotion, 2>
vertexMotionNames_;
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<< Foam::Ostream& Foam::operator<<
( (

View File

@ -34,7 +34,7 @@ SourceFiles
#ifndef indexedVertexEnum_H #ifndef indexedVertexEnum_H
#define indexedVertexEnum_H #define indexedVertexEnum_H
#include "NamedEnum.H" #include "Enum.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -72,9 +72,9 @@ public:
movable = 1 movable = 1
}; };
static const Foam::NamedEnum<vertexType, 15> vertexTypeNames_; static const Enum<vertexType> vertexTypeNames_;
static const Foam::NamedEnum<vertexMotion, 2> vertexMotionNames_; static const Enum<vertexMotion> vertexMotionNames_;
friend Ostream& operator<<(Foam::Ostream&, const vertexType&); friend Ostream& operator<<(Foam::Ostream&, const vertexType&);

View File

@ -848,7 +848,7 @@ int main(int argc, char *argv[])
( (
meshRefinement::readFlags meshRefinement::readFlags
( (
meshRefinement::IOdebugTypeNames, meshRefinement::debugTypeNames,
flags flags
) )
); );
@ -873,7 +873,7 @@ int main(int argc, char *argv[])
( (
meshRefinement::readFlags meshRefinement::readFlags
( (
meshRefinement::IOwriteTypeNames, meshRefinement::writeTypeNames,
flags flags
) )
) )
@ -892,7 +892,7 @@ int main(int argc, char *argv[])
( (
meshRefinement::readFlags meshRefinement::readFlags
( (
meshRefinement::IOoutputTypeNames, meshRefinement::outputTypeNames,
flags flags
) )
) )

View File

@ -33,23 +33,14 @@ License
// * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * // // * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * //
namespace Foam const Foam::Enum
{
template<>
const char* Foam::NamedEnum
< <
Foam::vector::components, Foam::vector::components
3 >
>::names[] = Foam::channelIndex::vectorComponentsNames_
{ (
"x", Foam::vector::components::X, { "x", "y", "z" }
"y", );
"z"
};
}
const Foam::NamedEnum<Foam::vector::components, 3>
Foam::channelIndex::vectorComponentsNames_;
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -233,7 +224,7 @@ Foam::channelIndex::channelIndex
) )
: :
symmetric_(readBool(dict.lookup("symmetric"))), symmetric_(readBool(dict.lookup("symmetric"))),
dir_(vectorComponentsNames_.read(dict.lookup("component"))) dir_(vectorComponentsNames_.lookup("component", dict))
{ {
const polyBoundaryMesh& patches = mesh.boundaryMesh(); const polyBoundaryMesh& patches = mesh.boundaryMesh();

View File

@ -55,7 +55,7 @@ class channelIndex
// Private data // Private data
static const NamedEnum<vector::components, 3> vectorComponentsNames_; static const Enum<vector::components> vectorComponentsNames_;
//- Is mesh symmetric //- Is mesh symmetric
const bool symmetric_; const bool symmetric_;

View File

@ -29,24 +29,19 @@ License
#include "polyMesh.H" #include "polyMesh.H"
#include "regionProperties.H" #include "regionProperties.H"
using namespace Foam;
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam const Foam::Enum
<
Foam::solverTemplate::solverType
>
Foam::solverTemplate::solverTypeNames_
{ {
template<> { solverType::stCompressible, "compressible" },
const char* Foam::NamedEnum<Foam::solverTemplate::solverType, 4>::names[] = { solverType::stIncompressible, "incompressible" },
{ { solverType::stBuoyant, "buoyant" },
"compressible", { solverType::stUnknown, "unknown" },
"incompressible",
"buoyant",
"unknown"
}; };
}
const Foam::NamedEnum<Foam::solverTemplate::solverType, 4>
Foam::solverTemplate::solverTypeNames_;
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -261,7 +256,7 @@ Foam::solverTemplate::solverTemplate
Info<< "Selecting " << solverName << ": "; Info<< "Selecting " << solverName << ": ";
solverType_ = solverTypeNames_.read(solverDict.lookup("solverType")); solverType_ = solverTypeNames_.lookup("solverType", solverDict);
Info<< solverTypeNames_[solverType_]; Info<< solverTypeNames_[solverType_];
multiRegion_ = readBool(solverDict.lookup("multiRegion")); multiRegion_ = readBool(solverDict.lookup("multiRegion"));
@ -366,7 +361,7 @@ bool Foam::solverTemplate::multiRegion() const
} }
label Foam::solverTemplate::nRegion() const Foam::label Foam::solverTemplate::nRegion() const
{ {
return regionTypes_.size(); return regionTypes_.size();
} }

View File

@ -36,7 +36,7 @@ Description
#include "wordList.H" #include "wordList.H"
#include "dimensionSet.H" #include "dimensionSet.H"
#include "IOobject.H" #include "IOobject.H"
#include "NamedEnum.H" #include "Enum.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -65,7 +65,7 @@ public:
}; };
//- Solver type names //- Solver type names
static const NamedEnum<solverType, 4> solverTypeNames_; static const Enum<solverType> solverTypeNames_;
private: private:

View File

@ -59,7 +59,12 @@ class shapeSelector
static const Foam::Enum<shapeType> shapeTypeNames; static const Foam::Enum<shapeType> shapeTypeNames;
}; };
const Foam::Enum<shapeSelector::shapeType> shapeSelector::shapeTypeNames
const Foam::Enum
<
shapeSelector::shapeType
>
shapeSelector::shapeTypeNames
{ {
{ shapeSelector::shapeType::PLANE, "plane" }, { shapeSelector::shapeType::PLANE, "plane" },
{ shapeSelector::shapeType::SPHERE, "sphere" }, { shapeSelector::shapeType::SPHERE, "sphere" },

View File

@ -41,22 +41,16 @@ namespace Foam
dictionary dictionary
); );
} }
template<>
const char* Foam::NamedEnum
<
Foam::tabulatedWallFunctions::general::interpolationType,
1
>::names[] =
{
"linear"
};
} }
const const Foam::Enum
Foam::NamedEnum<Foam::tabulatedWallFunctions::general::interpolationType, 1> <
Foam::tabulatedWallFunctions::general::interpolationTypeNames_; Foam::tabulatedWallFunctions::general::interpolationType
>
Foam::tabulatedWallFunctions::general::interpolationTypeNames_
{
{ interpolationType::itLinear, "linear" },
};
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
@ -138,7 +132,7 @@ Foam::tabulatedWallFunctions::general::general
) )
: :
tabulatedWallFunction(dict, mesh, typeName), tabulatedWallFunction(dict, mesh, typeName),
interpType_(interpolationTypeNames_[coeffDict_.lookup("interpType")]), interpType_(interpolationTypeNames_.lookup("interpType", coeffDict_)),
yPlus_(), yPlus_(),
uPlus_(), uPlus_(),
log10YPlus_(coeffDict_.lookup("log10YPlus")), log10YPlus_(coeffDict_.lookup("log10YPlus")),

View File

@ -63,7 +63,7 @@ SourceFiles
#define general_H #define general_H
#include "tabulatedWallFunction.H" #include "tabulatedWallFunction.H"
#include "NamedEnum.H" #include "Enum.H"
#include "Switch.H" #include "Switch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -91,7 +91,7 @@ public:
itLinear itLinear
}; };
static const NamedEnum<interpolationType, 1> interpolationTypeNames_; static const Enum<interpolationType> interpolationTypeNames_;
protected: protected:

View File

@ -45,25 +45,22 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
const Foam::NamedEnum<Foam::fileMonitor::fileState, 3> const Foam::Enum
Foam::fileMonitor::fileStateNames_; <
Foam::fileMonitor::fileState
>
Foam::fileMonitor::fileStateNames_
{
{ fileState::UNMODIFIED, "unmodified" },
{ fileState::MODIFIED, "modified" },
{ fileState::DELETED, "deleted" },
};
namespace Foam namespace Foam
{ {
defineTypeNameAndDebug(fileMonitor, 0); defineTypeNameAndDebug(fileMonitor, 0);
template<>
const char* Foam::NamedEnum
<
Foam::fileMonitor::fileState,
3
>::names[] =
{
"unmodified",
"modified",
"deleted"
};
//- Reduction operator for PackedList of fileState //- Reduction operator for PackedList of fileState
class reduceFileStates class reduceFileStates
{ {

View File

@ -43,7 +43,7 @@ SourceFiles
#define fileMonitor_H #define fileMonitor_H
#include <sys/types.h> #include <sys/types.h>
#include "NamedEnum.H" #include "Enum.H"
#include "className.H" #include "className.H"
#include "DynamicList.H" #include "DynamicList.H"
@ -74,7 +74,7 @@ public:
DELETED = 2 DELETED = 2
}; };
static const NamedEnum<fileState, 3> fileStateNames_; static const Enum<fileState> fileStateNames_;
private: private:
// Private data // Private data

View File

@ -27,23 +27,17 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam const Foam::Enum
{
template<>
const char* Foam::NamedEnum
< <
Foam::volumeType, Foam::volumeType
4 >
>::names[] = Foam::volumeType::names
{ {
"unknown", { type::UNKNOWN, "unknown" },
"mixed", { type::MIXED, "mixed" },
"inside", { type::INSIDE, "inside" },
"outside" { type::OUTSIDE, "outside" },
}; };
}
const Foam::NamedEnum<Foam::volumeType, 4> Foam::volumeType::names;
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //

View File

@ -34,7 +34,7 @@ SourceFiles
#ifndef volumeType_H #ifndef volumeType_H
#define volumeType_H #define volumeType_H
#include "NamedEnum.H" #include "Enum.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -44,8 +44,8 @@ namespace Foam
// Forward declaration of friend functions and operators // Forward declaration of friend functions and operators
class volumeType; class volumeType;
Istream& operator>>(Istream& is, volumeType&); Istream& operator>>(Istream& is, volumeType& vt);
Ostream& operator<<(Ostream& os, const volumeType& C); Ostream& operator<<(Ostream& os, const volumeType& vt);
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
@ -65,6 +65,9 @@ public:
OUTSIDE = 3 OUTSIDE = 3
}; };
// Static data
static const Enum<volumeType> names;
private: private:
@ -76,11 +79,6 @@ private:
public: public:
// Static data
static const NamedEnum<volumeType, 4> names;
// Constructors // Constructors
//- Construct null //- Construct null

View File

@ -32,37 +32,32 @@ License
namespace Foam namespace Foam
{ {
defineTypeNameAndDebug(IOobject, 0); defineTypeNameAndDebug(IOobject, 0);
template<>
const char* NamedEnum
<
IOobject::fileCheckTypes,
4
>::names[] =
{
"timeStamp",
"timeStampMaster",
"inotify",
"inotifyMaster"
};
} }
const Foam::Enum
<
Foam::IOobject::fileCheckTypes
>
Foam::IOobject::fileCheckTypesNames
{
{ fileCheckTypes::timeStamp, "timeStamp" },
{ fileCheckTypes::timeStampMaster, "timeStampMaster" },
{ fileCheckTypes::inotify, "inotify" },
{ fileCheckTypes::inotifyMaster, "inotifyMaster" },
};
const Foam::NamedEnum<Foam::IOobject::fileCheckTypes, 4>
Foam::IOobject::fileCheckTypesNames;
// Default fileCheck type // Default fileCheck type
Foam::IOobject::fileCheckTypes Foam::IOobject::fileModificationChecking Foam::IOobject::fileCheckTypes Foam::IOobject::fileModificationChecking
( (
fileCheckTypesNames.read fileCheckTypesNames.lookup
( (
debug::optimisationSwitches().lookup "fileModificationChecking",
( debug::optimisationSwitches()
"fileModificationChecking"
)
) )
); );
namespace Foam namespace Foam
{ {
// Register re-reader // Register re-reader

View File

@ -76,7 +76,7 @@ SourceFiles
#include "typeInfo.H" #include "typeInfo.H"
#include "autoPtr.H" #include "autoPtr.H"
#include "InfoProxy.H" #include "InfoProxy.H"
#include "NamedEnum.H" #include "Enum.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -129,7 +129,7 @@ public:
inotifyMaster inotifyMaster
}; };
static const NamedEnum<fileCheckTypes, 4> fileCheckTypesNames; static const Enum<fileCheckTypes> fileCheckTypesNames;
private: private:

View File

@ -34,23 +34,18 @@ License
namespace Foam namespace Foam
{ {
defineTypeNameAndDebug(UPstream, 0); defineTypeNameAndDebug(UPstream, 0);
template<>
const char* Foam::NamedEnum
<
Foam::UPstream::commsTypes,
3
>::names[] =
{
"blocking",
"scheduled",
"nonBlocking"
};
} }
const Foam::Enum
const Foam::NamedEnum<Foam::UPstream::commsTypes, 3> <
Foam::UPstream::commsTypeNames; Foam::UPstream::commsTypes
>
Foam::UPstream::commsTypeNames
{
{ commsTypes::blocking, "blocking" },
{ commsTypes::scheduled, "scheduled" },
{ commsTypes::nonBlocking, "nonBlocking" },
};
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -411,7 +406,11 @@ registerOptSwitch
Foam::UPstream::commsTypes Foam::UPstream::defaultCommsType Foam::UPstream::commsTypes Foam::UPstream::defaultCommsType
( (
commsTypeNames.read(Foam::debug::optimisationSwitches().lookup("commsType")) commsTypeNames.lookup
(
"commsType",
Foam::debug::optimisationSwitches()
)
); );
namespace Foam namespace Foam

View File

@ -43,7 +43,7 @@ SourceFiles
#include "DynamicList.H" #include "DynamicList.H"
#include "HashTable.H" #include "HashTable.H"
#include "string.H" #include "string.H"
#include "NamedEnum.H" #include "Enum.H"
#include "ListOps.H" #include "ListOps.H"
#include "LIFOStack.H" #include "LIFOStack.H"
@ -69,7 +69,7 @@ public:
nonBlocking nonBlocking
}; };
static const NamedEnum<commsTypes, 3> commsTypeNames; static const Enum<commsTypes> commsTypeNames;
// Public classes // Public classes

View File

@ -37,40 +37,34 @@ License
namespace Foam namespace Foam
{ {
defineTypeNameAndDebug(Time, 0); defineTypeNameAndDebug(Time, 0);
template<>
const char* Foam::NamedEnum
<
Foam::Time::stopAtControls,
4
>::names[] =
{
"endTime",
"noWriteNow",
"writeNow",
"nextWrite"
};
template<>
const char* Foam::NamedEnum
<
Foam::Time::writeControls,
5
>::names[] =
{
"timeStep",
"runTime",
"adjustableRunTime",
"clockTime",
"cpuTime"
};
} }
const Foam::NamedEnum<Foam::Time::stopAtControls, 4> const Foam::Enum
Foam::Time::stopAtControlNames_; <
Foam::Time::stopAtControls
>
Foam::Time::stopAtControlNames_
{
{ stopAtControls::saEndTime, "endTime" },
{ stopAtControls::saNoWriteNow, "noWriteNow" },
{ stopAtControls::saWriteNow, "writeNow" },
{ stopAtControls::saNextWrite, "nextWrite" },
};
const Foam::Enum
<
Foam::Time::writeControls
>
Foam::Time::writeControlNames_
{
{ writeControls::wcTimeStep, "timeStep" },
{ writeControls::wcRunTime, "runTime" },
{ writeControls::wcAdjustableRunTime, "adjustableRunTime" },
{ writeControls::wcClockTime, "clockTime" },
{ writeControls::wcCpuTime, "cpuTime" },
};
const Foam::NamedEnum<Foam::Time::writeControls, 5>
Foam::Time::writeControlNames_;
Foam::Time::fmtflags Foam::Time::format_(Foam::Time::general); Foam::Time::fmtflags Foam::Time::format_(Foam::Time::general);

View File

@ -47,7 +47,7 @@ SourceFiles
#include "TimeState.H" #include "TimeState.H"
#include "Switch.H" #include "Switch.H"
#include "instantList.H" #include "instantList.H"
#include "NamedEnum.H" #include "Enum.H"
#include "typeInfo.H" #include "typeInfo.H"
#include "dlLibraryTable.H" #include "dlLibraryTable.H"
#include "functionObjectList.H" #include "functionObjectList.H"
@ -130,10 +130,10 @@ protected:
scalar startTime_; scalar startTime_;
mutable scalar endTime_; mutable scalar endTime_;
static const NamedEnum<stopAtControls, 4> stopAtControlNames_; static const Enum<stopAtControls> stopAtControlNames_;
mutable stopAtControls stopAt_; mutable stopAtControls stopAt_;
static const NamedEnum<writeControls, 5> writeControlNames_; static const Enum<writeControls> writeControlNames_;
writeControls writeControl_; writeControls writeControl_;
scalar writeInterval_; scalar writeInterval_;

View File

@ -201,9 +201,10 @@ void Foam::Time::readDict()
if (controlDict_.found("writeControl")) if (controlDict_.found("writeControl"))
{ {
writeControl_ = writeControlNames_.read writeControl_ = writeControlNames_.lookup
( (
controlDict_.lookup("writeControl") "writeControl",
controlDict_
); );
} }
@ -288,7 +289,7 @@ void Foam::Time::readDict()
// if nothing is specified, the endTime is zero // if nothing is specified, the endTime is zero
if (controlDict_.found("stopAt")) if (controlDict_.found("stopAt"))
{ {
stopAt_ = stopAtControlNames_.read(controlDict_.lookup("stopAt")); stopAt_ = stopAtControlNames_.lookup("stopAt", controlDict_);
if (stopAt_ == saEndTime) if (stopAt_ == saEndTime)
{ {

View File

@ -28,27 +28,22 @@ License
// * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * // // * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * //
namespace Foam const Foam::Enum
<
Foam::timeControl::timeControls
>
Foam::timeControl::timeControlNames_
{ {
template<> { timeControl::ocTimeStep, "timeStep" },
const char* NamedEnum<timeControl::timeControls, 9>:: { timeControl::ocWriteTime, "writeTime" },
names[] = { timeControl::ocOutputTime, "outputTime" },
{ { timeControl::ocAdjustableRunTime, "adjustableRunTime" },
"timeStep", { timeControl::ocRunTime, "runTime" },
"writeTime", { timeControl::ocClockTime, "clockTime" },
"outputTime", { timeControl::ocCpuTime, "cpuTime" },
"adjustableRunTime", { timeControl::ocOnEnd, "onEnd" },
"runTime", { timeControl::ocNone, "none" },
"clockTime",
"cpuTime",
"onEnd",
"none"
}; };
}
const Foam::NamedEnum<Foam::timeControl::timeControls, 9>
Foam::timeControl::timeControlNames_;
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -117,7 +112,7 @@ void Foam::timeControl::read(const dictionary& dict)
if (dict.found(controlName)) if (dict.found(controlName))
{ {
timeControl_ = timeControlNames_.read(dict.lookup(controlName)); timeControl_ = timeControlNames_.lookup(controlName, dict);
} }
else else
{ {

View File

@ -77,7 +77,7 @@ private:
const word prefix_; const word prefix_;
//- String representation of timeControls enums //- String representation of timeControls enums
static const NamedEnum<timeControls, 9> timeControlNames_; static const Enum<timeControls> timeControlNames_;
//- Type of time control //- Type of time control
timeControls timeControl_; timeControls timeControl_;

View File

@ -35,22 +35,23 @@ namespace Foam
defineTypeNameAndDebug(coupledPolyPatch, 0); defineTypeNameAndDebug(coupledPolyPatch, 0);
const scalar coupledPolyPatch::defaultMatchTol_ = 1e-4; const scalar coupledPolyPatch::defaultMatchTol_ = 1e-4;
template<>
const char* NamedEnum<coupledPolyPatch::transformType, 5>::names[] =
{
"unknown",
"rotational",
"translational",
"coincidentFullMatch",
"noOrdering"
};
const NamedEnum<coupledPolyPatch::transformType, 5>
coupledPolyPatch::transformTypeNames;
} }
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 * * * * * * * * * * * // // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void Foam::coupledPolyPatch::writeOBJ(Ostream& os, const point& pt) void Foam::coupledPolyPatch::writeOBJ(Ostream& os, const point& pt)
@ -500,9 +501,12 @@ Foam::coupledPolyPatch::coupledPolyPatch
matchTolerance_(dict.lookupOrDefault("matchTolerance", defaultMatchTol_)), matchTolerance_(dict.lookupOrDefault("matchTolerance", defaultMatchTol_)),
transform_ transform_
( (
dict.found("transform") transformTypeNames.lookupOrDefault
? transformTypeNames.read(dict.lookup("transform")) (
: UNKNOWN "transform",
dict,
transformType::UNKNOWN
)
) )
{} {}
@ -562,10 +566,8 @@ void Foam::coupledPolyPatch::write(Ostream& os) const
polyPatch::write(os); polyPatch::write(os);
//if (matchTolerance_ != defaultMatchTol_) //if (matchTolerance_ != defaultMatchTol_)
{ {
os.writeKeyword("matchTolerance") << matchTolerance_ os.writeEntry("matchTolerance", matchTolerance_);
<< token::END_STATEMENT << nl; os.writeEntry("transform", transformTypeNames[transform_]);
os.writeKeyword("transform") << transformTypeNames[transform_]
<< token::END_STATEMENT << nl;
} }
} }

View File

@ -65,7 +65,7 @@ public:
NOORDERING // unspecified, no automatic ordering NOORDERING // unspecified, no automatic ordering
}; };
static const NamedEnum<transformType, 5> transformTypeNames; static const Enum<transformType> transformTypeNames;
private: private:

View File

@ -29,37 +29,27 @@ License
Foam::scalar Foam::intersection::planarTol_ = 0.2; Foam::scalar Foam::intersection::planarTol_ = 0.2;
namespace Foam const Foam::Enum
{
template<>
const char* Foam::NamedEnum
< <
Foam::intersection::direction, Foam::intersection::direction
2 >
>::names[] = Foam::intersection::directionNames_
{ {
"vector", { intersection::direction::VECTOR, "vector" },
"contactSphere" { intersection::direction::CONTACT_SPHERE, "contactSphere" },
}; };
template<>
const char* Foam::NamedEnum const Foam::Enum
< <
Foam::intersection::algorithm, Foam::intersection::algorithm
3 >
>::names[] = Foam::intersection::algorithmNames_
{ {
"fullRay", { intersection::algorithm::FULL_RAY, "fullRay" },
"halfRay", { intersection::algorithm::HALF_RAY, "halfRay" },
"visible" { intersection::algorithm::VISIBLE, "visible" },
}; };
}
const Foam::NamedEnum<Foam::intersection::direction, 2>
Foam::intersection::directionNames_;
const Foam::NamedEnum<Foam::intersection::algorithm, 3>
Foam::intersection::algorithmNames_;
// ************************************************************************* // // ************************************************************************* //

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -36,7 +36,7 @@ SourceFiles
#define intersection_H #define intersection_H
#include "scalar.H" #include "scalar.H"
#include "NamedEnum.H" #include "Enum.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -77,10 +77,10 @@ public:
// Static Member Functions // Static Member Functions
//- Direction names //- Direction names
static const NamedEnum<direction, 2> directionNames_; static const Enum<direction> directionNames_;
//- Projection algorithm names //- Projection algorithm names
static const NamedEnum<algorithm, 3> algorithmNames_; static const Enum<algorithm> algorithmNames_;
//- Return planar tolerance //- Return planar tolerance
static scalar planarTol() static scalar planarTol()

View File

@ -27,23 +27,16 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam const Foam::Enum
{
template<>
const char* NamedEnum
< <
orientedType::orientedOption, Foam::orientedType::orientedOption
3 >
>::names[] = Foam::orientedType::orientedOptionNames
{ {
"oriented", { orientedOption::ORIENTED, "oriented" },
"unoriented", { orientedOption::UNORIENTED, "unoriented" },
"unknown" { orientedOption::UNKNOWN, "unknown" },
}; };
}
const Foam::NamedEnum<Foam::orientedType::orientedOption, 3>
Foam::orientedType::orientedOptionNames;
bool Foam::orientedType::checkType bool Foam::orientedType::checkType
@ -118,14 +111,12 @@ void Foam::orientedType::setOriented(const bool oriented)
void Foam::orientedType::read(const dictionary& dict) void Foam::orientedType::read(const dictionary& dict)
{ {
if (dict.found("oriented")) oriented_ = orientedOptionNames.lookupOrDefault
{ (
oriented_ = orientedOptionNames.read(dict.lookup("oriented")); "oriented",
} dict,
else orientedOption::UNKNOWN
{ );
oriented_ = UNKNOWN;
}
} }

View File

@ -38,7 +38,7 @@ SourceFiles
#include "Istream.H" #include "Istream.H"
#include "Ostream.H" #include "Ostream.H"
#include "dictionary.H" #include "dictionary.H"
#include "NamedEnum.H" #include "Enum.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -49,9 +49,9 @@ namespace Foam
class orientedType; class orientedType;
Istream& operator>>(Istream&, orientedType&); Istream& operator>>(Istream& is, orientedType& ot);
Ostream& operator<<(Ostream&, const orientedType&); Ostream& operator<<(Ostream& os, const orientedType& ot);
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class orientedType Declaration Class orientedType Declaration
@ -71,7 +71,7 @@ public:
UNKNOWN UNKNOWN
}; };
static const NamedEnum<orientedOption, 3> orientedOptionNames; static const Enum<orientedOption> orientedOptionNames;
private: private:

View File

@ -33,27 +33,16 @@ using Foam::constant::physicoChemical::sigma;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam const Foam::Enum
{
template<>
const char*
NamedEnum
< <
externalWallHeatFluxTemperatureFvPatchScalarField::operationMode, Foam::externalWallHeatFluxTemperatureFvPatchScalarField::operationMode
3 >
>::names[] = Foam::externalWallHeatFluxTemperatureFvPatchScalarField::operationModeNames
{ {
"power", { operationMode::fixedPower, "power" },
"flux", { operationMode::fixedHeatFlux, "flux" },
"coefficient" { operationMode::fixedHeatTransferCoeff, "coefficient" },
}; };
}
const Foam::NamedEnum
<
Foam::externalWallHeatFluxTemperatureFvPatchScalarField::operationMode,
3
> Foam::externalWallHeatFluxTemperatureFvPatchScalarField::operationModeNames;
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -92,7 +81,7 @@ externalWallHeatFluxTemperatureFvPatchScalarField
: :
mixedFvPatchScalarField(p, iF), mixedFvPatchScalarField(p, iF),
temperatureCoupledBase(patch(), dict), temperatureCoupledBase(patch(), dict),
mode_(operationModeNames.read(dict.lookup("mode"))), mode_(operationModeNames.lookup("mode", dict)),
Q_(0), Q_(0),
relaxation_(dict.lookupOrDefault<scalar>("relaxation", 1)), relaxation_(dict.lookupOrDefault<scalar>("relaxation", 1)),
emissivity_(dict.lookupOrDefault<scalar>("emissivity", 0)), emissivity_(dict.lookupOrDefault<scalar>("emissivity", 0)),
@ -457,17 +446,14 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::write
{ {
fvPatchScalarField::write(os); fvPatchScalarField::write(os);
os.writeKeyword("mode") os.writeEntry("mode", operationModeNames[mode_]);
<< operationModeNames[mode_] << token::END_STATEMENT << nl;
temperatureCoupledBase::write(os); temperatureCoupledBase::write(os);
switch (mode_) switch (mode_)
{ {
case fixedPower: case fixedPower:
{ {
os.writeKeyword("Q") os.writeEntry("Q", Q_);
<< Q_ << token::END_STATEMENT << nl;
break; break;
} }
case fixedHeatFlux: case fixedHeatFlux:
@ -483,14 +469,12 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::write
if (relaxation_ < 1) if (relaxation_ < 1)
{ {
os.writeKeyword("relaxation") os.writeEntry("relaxation", relaxation_);
<< relaxation_ << token::END_STATEMENT << nl;
} }
if (emissivity_ > 0) if (emissivity_ > 0)
{ {
os.writeKeyword("emissivity") os.writeEntry("emissivity", emissivity_);
<< emissivity_ << token::END_STATEMENT << nl;
} }
if (thicknessLayers_.size()) if (thicknessLayers_.size())
@ -503,12 +487,11 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::write
} }
} }
os.writeKeyword("qr")<< qrName_ << token::END_STATEMENT << nl; os.writeEntry("qr", qrName_);
if (qrName_ != "none") if (qrName_ != "none")
{ {
os.writeKeyword("qrRelaxation") os.writeEntry("qrRelaxation", qrRelaxation_);
<< qrRelaxation_ << token::END_STATEMENT << nl;
qrPrevious_.writeEntry("qrPrevious", os); qrPrevious_.writeEntry("qrPrevious", os);
} }

View File

@ -127,7 +127,7 @@ public:
fixedHeatTransferCoeff, //!< Fixed heat transfer coefficient fixedHeatTransferCoeff, //!< Fixed heat transfer coefficient
}; };
static const NamedEnum<operationMode, 3> operationModeNames; static const Enum<operationMode> operationModeNames;
private: private:

View File

@ -31,25 +31,17 @@ License
// * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * // // * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * //
namespace Foam const Foam::Enum
{
template<>
const char* Foam::NamedEnum
< <
Foam::temperatureCoupledBase::KMethodType, Foam::temperatureCoupledBase::KMethodType
4 >
>::names[] = Foam::temperatureCoupledBase::KMethodTypeNames_
{ {
"fluidThermo", { KMethodType::mtFluidThermo, "fluidThermo" },
"solidThermo", { KMethodType::mtSolidThermo, "solidThermo" },
"directionalSolidThermo", { KMethodType::mtDirectionalSolidThermo, "directionalSolidThermo" },
"lookup" { KMethodType::mtLookup, "lookup" },
}; };
}
const Foam::NamedEnum<Foam::temperatureCoupledBase::KMethodType, 4>
Foam::temperatureCoupledBase::KMethodTypeNames_;
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -76,7 +68,7 @@ Foam::temperatureCoupledBase::temperatureCoupledBase
) )
: :
patch_(patch), patch_(patch),
method_(KMethodTypeNames_.read(dict.lookup("kappaMethod"))), method_(KMethodTypeNames_.lookup("kappaMethod", dict)),
kappaName_(dict.lookupOrDefault<word>("kappa", "none")), kappaName_(dict.lookupOrDefault<word>("kappa", "none")),
alphaAniName_(dict.lookupOrDefault<word>("alphaAni","none")) alphaAniName_(dict.lookupOrDefault<word>("alphaAni","none"))
{} {}
@ -232,10 +224,9 @@ Foam::tmp<Foam::scalarField> Foam::temperatureCoupledBase::kappa
void Foam::temperatureCoupledBase::write(Ostream& os) const void Foam::temperatureCoupledBase::write(Ostream& os) const
{ {
os.writeKeyword("kappaMethod") << KMethodTypeNames_[method_] os.writeEntry("kappaMethod", KMethodTypeNames_[method_]);
<< token::END_STATEMENT << nl; os.writeEntry("kappa", kappaName_);
os.writeKeyword("kappa") << kappaName_ << token::END_STATEMENT << nl; os.writeEntry("alphaAni", alphaAniName_);
os.writeKeyword("alphaAni") << alphaAniName_ << token::END_STATEMENT << nl;
} }

View File

@ -66,7 +66,7 @@ SourceFiles
#define temperatureCoupledBase_H #define temperatureCoupledBase_H
#include "scalarField.H" #include "scalarField.H"
#include "NamedEnum.H" #include "Enum.H"
#include "fvPatch.H" #include "fvPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -98,7 +98,7 @@ protected:
// Protected data // Protected data
static const NamedEnum<KMethodType, 4> KMethodTypeNames_; static const Enum<KMethodType> KMethodTypeNames_;
//- Underlying patch //- Underlying patch
const fvPatch& patch_; const fvPatch& patch_;

View File

@ -39,14 +39,12 @@ Foam::combustionModels::EDC<Type>::EDC
laminar<Type>(modelType, mesh, combustionProperties, phaseName), laminar<Type>(modelType, mesh, combustionProperties, phaseName),
version_ version_
( (
EDCversionNames EDCversionNames.lookupOrDefault
[
this->coeffs().lookupOrDefault
( (
"version", "version",
word(EDCversionNames[EDCdefaultVersion]) this->coeffs(),
EDCdefaultVersion
) )
]
), ),
C1_(this->coeffs().lookupOrDefault("C1", 0.05774)), C1_(this->coeffs().lookupOrDefault("C1", 0.05774)),
C2_(this->coeffs().lookupOrDefault("C2", 0.5)), C2_(this->coeffs().lookupOrDefault("C2", 0.5)),
@ -220,14 +218,12 @@ bool Foam::combustionModels::EDC<Type>::read()
{ {
version_ = version_ =
( (
EDCversionNames EDCversionNames.lookupOrDefault
[
this->coeffs().lookupOrDefault
( (
"version", "version",
word(EDCversionNames[EDCdefaultVersion]) this->coeffs(),
EDCdefaultVersion
) )
]
); );
C1_ = this->coeffs().lookupOrDefault("C1", 0.05774); C1_ = this->coeffs().lookupOrDefault("C1", 0.05774);
C2_ = this->coeffs().lookupOrDefault("C2", 0.5); C2_ = this->coeffs().lookupOrDefault("C2", 0.5);

View File

@ -100,7 +100,7 @@ SourceFiles
#define EDC_H #define EDC_H
#include "../laminar/laminar.H" #include "../laminar/laminar.H"
#include "NamedEnum.H" #include "Enum.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -118,7 +118,7 @@ enum class EDCversions
v2016 v2016
}; };
extern const NamedEnum<EDCversions, 4> EDCversionNames; extern const Enum<EDCversions> EDCversionNames;
extern const EDCversions EDCdefaultVersion; extern const EDCversions EDCdefaultVersion;
const scalar EDCexp1[] = {3, 2, 2, 2}; const scalar EDCexp1[] = {3, 2, 2, 2};

View File

@ -31,31 +31,26 @@ License
// * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * // // * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * //
template<> const Foam::Enum
const char* Foam::NamedEnum
< <
Foam::combustionModels::EDCversions, Foam::combustionModels::EDCversions
4 >
>::names[] = Foam::combustionModels::EDCversionNames
{ {
"v1981", { EDCversions::v1981, "v1981" },
"v1996", { EDCversions::v1996, "v1996" },
"v2005", { EDCversions::v2005, "v2005" },
"v2016" { EDCversions::v2016, "v2016" },
}; };
const Foam::NamedEnum<Foam::combustionModels::EDCversions, 4>
Foam::combustionModels::EDCversionNames;
const Foam::combustionModels::EDCversions const Foam::combustionModels::EDCversions
Foam::combustionModels::EDCdefaultVersion Foam::combustionModels::EDCdefaultVersion(EDCversions::v2005);
(
Foam::combustionModels::EDCversions::v2005
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makeCombustionTypes(EDC, psiChemistryCombustion, psiCombustionModel); makeCombustionTypes(EDC, psiChemistryCombustion, psiCombustionModel);
makeCombustionTypes(EDC, rhoChemistryCombustion, rhoCombustionModel); makeCombustionTypes(EDC, rhoChemistryCombustion, rhoCombustionModel);
// ************************************************************************* // // ************************************************************************* //

View File

@ -36,23 +36,16 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam const Foam::Enum
{
template<>
const char* Foam::NamedEnum
< <
Foam::directions::directionType, Foam::directions::directionType
3 >
>::names[] = Foam::directions::directionTypeNames_
{ {
"tan1", { directionType::TAN1, "tan1" },
"tan2", { directionType::TAN2, "tan2" },
"normal" { directionType::NORMAL, "normal" },
}; };
}
const Foam::NamedEnum<Foam::directions::directionType, 3>
Foam::directions::directionTypeNames_;
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -289,9 +282,9 @@ Foam::directions::directions
if (coordSystem != "fieldBased") if (coordSystem != "fieldBased")
{ {
forAll(wantedDirs, i) for (const word& wantedName : wantedDirs)
{ {
directionType wantedDir = directionTypeNames_[wantedDirs[i]]; directionType wantedDir = directionTypeNames_[wantedName];
if (wantedDir == NORMAL) if (wantedDir == NORMAL)
{ {

View File

@ -43,7 +43,7 @@ SourceFiles
#include "List.H" #include "List.H"
#include "vectorField.H" #include "vectorField.H"
#include "NamedEnum.H" #include "Enum.H"
#include "point.H" #include "point.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -82,7 +82,7 @@ public:
private: private:
static const NamedEnum<directionType, 3> directionTypeNames_; static const Enum<directionType> directionTypeNames_;
// Private Member Functions // Private Member Functions

View File

@ -36,17 +36,18 @@ License
namespace Foam namespace Foam
{ {
defineTypeNameAndDebug(tetDecomposer, 0); defineTypeNameAndDebug(tetDecomposer, 0);
}
template<> const Foam::Enum
const char* NamedEnum<tetDecomposer::decompositionType, 2>::names[] = <
Foam::tetDecomposer::decompositionType
>
Foam::tetDecomposer::decompositionTypeNames
{ {
"faceCentre", { decompositionType::FACE_CENTRE_TRIS, "faceCentre" },
"faceDiagonal" { decompositionType::FACE_DIAG_TRIS, "faceDiagonal" },
}; };
const NamedEnum<tetDecomposer::decompositionType, 2>
tetDecomposer::decompositionTypeNames;
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //

View File

@ -39,7 +39,7 @@ SourceFiles
#include "PackedBoolList.H" #include "PackedBoolList.H"
#include "boolList.H" #include "boolList.H"
#include "typeInfo.H" #include "typeInfo.H"
#include "NamedEnum.H" #include "Enum.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -68,7 +68,7 @@ public:
FACE_DIAG_TRIS //- Faces decomposed into triangles diagonally FACE_DIAG_TRIS //- Faces decomposed into triangles diagonally
}; };
static const NamedEnum<decompositionType, 2> decompositionTypeNames; static const Enum<decompositionType> decompositionTypeNames;
private: private:

View File

@ -45,22 +45,18 @@ namespace Foam
slidingInterface, slidingInterface,
dictionary dictionary
); );
template<>
const char* Foam::NamedEnum
<
Foam::slidingInterface::typeOfMatch,
2
>::names[] =
{
"integral",
"partial"
};
} }
const Foam::NamedEnum<Foam::slidingInterface::typeOfMatch, 2> const Foam::Enum
Foam::slidingInterface::typeOfMatchNames_; <
Foam::slidingInterface::typeOfMatch
>
Foam::slidingInterface::typeOfMatchNames_
{
{ typeOfMatch::INTEGRAL, "integral" },
{ typeOfMatch::PARTIAL, "partial" },
};
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -248,7 +244,7 @@ Foam::slidingInterface::slidingInterface
dict.lookup("slavePatchName"), dict.lookup("slavePatchName"),
mme.mesh().boundaryMesh() mme.mesh().boundaryMesh()
), ),
matchType_(typeOfMatchNames_.read((dict.lookup("typeOfMatch")))), matchType_(typeOfMatchNames_.lookup("typeOfMatch", dict)),
coupleDecouple_(dict.lookup("coupleDecouple")), coupleDecouple_(dict.lookup("coupleDecouple")),
attached_(dict.lookup("attached")), attached_(dict.lookup("attached")),
projectionAlgo_ projectionAlgo_

View File

@ -85,7 +85,7 @@ public:
}; };
//- Direction names //- Direction names
static const NamedEnum<typeOfMatch, 2> typeOfMatchNames_; static const Enum<typeOfMatch> typeOfMatchNames_;
private: private:

View File

@ -27,7 +27,10 @@ License
// * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * // // * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * //
const Foam::Enum<Foam::coordSet::coordFormat> const Foam::Enum
<
Foam::coordSet::coordFormat
>
Foam::coordSet::coordFormatNames_ Foam::coordSet::coordFormatNames_
{ {
{ coordFormat::XYZ, "xyz" }, { coordFormat::XYZ, "xyz" },

View File

@ -27,7 +27,10 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
const Foam::Enum<Foam::fileFormats::FIRECore::fileExt3d> const Foam::Enum
<
Foam::fileFormats::FIRECore::fileExt3d
>
Foam::fileFormats::FIRECore::file3dExtensions Foam::fileFormats::FIRECore::file3dExtensions
{ {
{ fileExt3d::POLY_ASCII, "fpma" }, { fileExt3d::POLY_ASCII, "fpma" },

View File

@ -33,7 +33,10 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
const Foam::Enum<Foam::fileFormats::STARCDCore::fileHeader> const Foam::Enum
<
Foam::fileFormats::STARCDCore::fileHeader
>
Foam::fileFormats::STARCDCore::fileHeaders_ Foam::fileFormats::STARCDCore::fileHeaders_
{ {
{ fileHeader::HEADER_CEL, "PROSTAR_CELL" }, { fileHeader::HEADER_CEL, "PROSTAR_CELL" },
@ -41,7 +44,11 @@ const Foam::Enum<Foam::fileFormats::STARCDCore::fileHeader>
{ fileHeader::HEADER_BND, "PROSTAR_BOUNDARY" } { fileHeader::HEADER_BND, "PROSTAR_BOUNDARY" }
}; };
const Foam::Enum<Foam::fileFormats::STARCDCore::fileExt>
const Foam::Enum
<
Foam::fileFormats::STARCDCore::fileExt
>
Foam::fileFormats::STARCDCore::fileExtensions_ Foam::fileFormats::STARCDCore::fileExtensions_
{ {
{ fileExt::CEL_FILE, "cel" }, { fileExt::CEL_FILE, "cel" },
@ -50,6 +57,7 @@ const Foam::Enum<Foam::fileFormats::STARCDCore::fileExt>
{ fileExt::INP_FILE, "inp" } { fileExt::INP_FILE, "inp" }
}; };
const char* const Foam::fileFormats::STARCDCore::defaultBoundaryName = const char* const Foam::fileFormats::STARCDCore::defaultBoundaryName =
"Default_Boundary_Region"; "Default_Boundary_Region";

View File

@ -27,7 +27,11 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
const Foam::Enum<Foam::vtk::fileTag> Foam::vtk::fileTagNames const Foam::Enum
<
Foam::vtk::fileTag
>
Foam::vtk::fileTagNames
{ {
{ fileTag::VTK_FILE, "VTKFile" }, { fileTag::VTK_FILE, "VTKFile" },
{ fileTag::DATA_ARRAY, "DataArray" }, { fileTag::DATA_ARRAY, "DataArray" },
@ -45,7 +49,11 @@ const Foam::Enum<Foam::vtk::fileTag> Foam::vtk::fileTagNames
}; };
const Foam::Enum<Foam::vtk::fileAttr> Foam::vtk::fileAttrNames const Foam::Enum
<
Foam::vtk::fileAttr
>
Foam::vtk::fileAttrNames
{ {
{ fileAttr::OFFSET, "offset" }, { fileAttr::OFFSET, "offset" },
{ fileAttr::NUMBER_OF_COMPONENTS, "NumberOfComponents" }, { fileAttr::NUMBER_OF_COMPONENTS, "NumberOfComponents" },
@ -57,7 +65,11 @@ const Foam::Enum<Foam::vtk::fileAttr> Foam::vtk::fileAttrNames
}; };
const Foam::Enum<Foam::vtk::dataArrayAttr> Foam::vtk::dataArrayAttrNames const Foam::Enum
<
Foam::vtk::dataArrayAttr
>
Foam::vtk::dataArrayAttrNames
{ {
{ dataArrayAttr::POINTS, "Points" }, { dataArrayAttr::POINTS, "Points" },
{ dataArrayAttr::OFFSETS, "offsets" }, { dataArrayAttr::OFFSETS, "offsets" },

View File

@ -36,7 +36,10 @@ License
// * * * * * * * * * * * * * * * Static Data * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Static Data * * * * * * * * * * * * * * * * //
const Foam::Enum<Foam::vtk::fileTag> const Foam::Enum
<
Foam::vtk::fileTag
>
Foam::vtk::legacy::contentNames Foam::vtk::legacy::contentNames
{ {
{ vtk::fileTag::POLY_DATA, "POLYDATA" }, { vtk::fileTag::POLY_DATA, "POLYDATA" },
@ -44,7 +47,10 @@ Foam::vtk::legacy::contentNames
}; };
const Foam::Enum<Foam::vtk::fileTag> const Foam::Enum
<
Foam::vtk::fileTag
>
Foam::vtk::legacy::dataTypeNames Foam::vtk::legacy::dataTypeNames
{ {
{ vtk::fileTag::CELL_DATA, "CELL_DATA" }, { vtk::fileTag::CELL_DATA, "CELL_DATA" },

View File

@ -37,7 +37,10 @@ namespace Foam
defineTypeNameAndDebug(vtkUnstructuredReader, 1); defineTypeNameAndDebug(vtkUnstructuredReader, 1);
} }
const Foam::Enum<Foam::vtkUnstructuredReader::vtkDataType> const Foam::Enum
<
Foam::vtkUnstructuredReader::vtkDataType
>
Foam::vtkUnstructuredReader::vtkDataTypeNames Foam::vtkUnstructuredReader::vtkDataTypeNames
{ {
{ vtkDataType::VTK_INT, "int" }, { vtkDataType::VTK_INT, "int" },
@ -50,7 +53,11 @@ const Foam::Enum<Foam::vtkUnstructuredReader::vtkDataType>
{ vtkDataType::VTK_ID, "vtkIdType" } { vtkDataType::VTK_ID, "vtkIdType" }
}; };
const Foam::Enum<Foam::vtkUnstructuredReader::vtkDataSetType>
const Foam::Enum
<
Foam::vtkUnstructuredReader::vtkDataSetType
>
Foam::vtkUnstructuredReader::vtkDataSetTypeNames Foam::vtkUnstructuredReader::vtkDataSetTypeNames
{ {
{ vtkDataSetType::VTK_FIELD, "FIELD" }, { vtkDataSetType::VTK_FIELD, "FIELD" },
@ -58,7 +65,11 @@ const Foam::Enum<Foam::vtkUnstructuredReader::vtkDataSetType>
{ vtkDataSetType::VTK_VECTORS, "VECTORS" } { vtkDataSetType::VTK_VECTORS, "VECTORS" }
}; };
const Foam::Enum<Foam::vtkUnstructuredReader::parseMode>
const Foam::Enum
<
Foam::vtkUnstructuredReader::parseMode
>
Foam::vtkUnstructuredReader::parseModeNames Foam::vtkUnstructuredReader::parseModeNames
{ {
{ parseMode::NOMODE, "NOMODE" }, { parseMode::NOMODE, "NOMODE" },

View File

@ -30,25 +30,15 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam const Foam::Enum
{
template<>
const char* NamedEnum
< <
fanPressureFvPatchScalarField::fanFlowDirection, Foam::fanPressureFvPatchScalarField::fanFlowDirection
2 >
>::names[] = Foam::fanPressureFvPatchScalarField::fanFlowDirectionNames_
{ {
"in", { fanFlowDirection::ffdIn, "in" },
"out" { fanFlowDirection::ffdOut, "out" },
}; };
}
const Foam::NamedEnum
<
Foam::fanPressureFvPatchScalarField::fanFlowDirection,
2
> Foam::fanPressureFvPatchScalarField::fanFlowDirectionNames_;
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -94,7 +84,7 @@ Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField
: :
totalPressureFvPatchScalarField(p, iF, dict), totalPressureFvPatchScalarField(p, iF, dict),
fanCurve_(dict), fanCurve_(dict),
direction_(fanFlowDirectionNames_.read(dict.lookup("direction"))), direction_(fanFlowDirectionNames_.lookup("direction", dict)),
nonDimensional_(dict.lookupOrDefault<Switch>("nonDimensional", false)), nonDimensional_(dict.lookupOrDefault<Switch>("nonDimensional", false)),
rpm_(dict.lookupOrDefault<scalar>("rpm", 0.0)), rpm_(dict.lookupOrDefault<scalar>("rpm", 0.0)),
dm_(dict.lookupOrDefault<scalar>("dm", 0.0)) dm_(dict.lookupOrDefault<scalar>("dm", 0.0))
@ -205,10 +195,8 @@ void Foam::fanPressureFvPatchScalarField::write(Ostream& os) const
{ {
totalPressureFvPatchScalarField::write(os); totalPressureFvPatchScalarField::write(os);
fanCurve_.write(os); fanCurve_.write(os);
os.writeKeyword("direction") os.writeEntry("direction", fanFlowDirectionNames_[direction_]);
<< fanFlowDirectionNames_[direction_] << token::END_STATEMENT << nl; os.writeEntry("nonDimensional", nonDimensional_);
os.writeKeyword("nonDimensional") << nonDimensional_
<< token::END_STATEMENT << nl;
os.writeEntry("rpm", rpm_); os.writeEntry("rpm", rpm_);
os.writeEntry("dm", dm_); os.writeEntry("dm", dm_);
} }

View File

@ -123,8 +123,8 @@ public:
ffdOut ffdOut
}; };
//- Fan flow directions names //- Fan flow direction names
static const NamedEnum<fanFlowDirection, 2> fanFlowDirectionNames_; static const Enum<fanFlowDirection> fanFlowDirectionNames_;
private: private:

View File

@ -35,27 +35,25 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam const Foam::Enum
{
template<>
const char* NamedEnum
< <
waveSurfacePressureFvPatchScalarField::ddtSchemeType, Foam::waveSurfacePressureFvPatchScalarField::ddtSchemeType
3 >
>::names[] = Foam::waveSurfacePressureFvPatchScalarField::ddtSchemeTypeNames_
{ {
fv::EulerDdtScheme<scalar>::typeName_(), {
fv::CrankNicolsonDdtScheme<scalar>::typeName_(), ddtSchemeType::tsEuler,
fv::EulerDdtScheme<scalar>::typeName_()
},
{
ddtSchemeType::tsCrankNicolson,
fv::CrankNicolsonDdtScheme<scalar>::typeName_()
},
{
ddtSchemeType::tsBackward,
fv::backwardDdtScheme<scalar>::typeName_() fv::backwardDdtScheme<scalar>::typeName_()
},
}; };
}
const Foam::NamedEnum
<
Foam::waveSurfacePressureFvPatchScalarField::ddtSchemeType,
3
> Foam::waveSurfacePressureFvPatchScalarField::ddtSchemeTypeNames_;
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -79,7 +79,7 @@ SourceFiles
#define waveSurfacePressureFvPatchScalarField_H #define waveSurfacePressureFvPatchScalarField_H
#include "fixedValueFvPatchFields.H" #include "fixedValueFvPatchFields.H"
#include "NamedEnum.H" #include "Enum.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -121,7 +121,7 @@ private:
word rhoName_; word rhoName_;
//- Time scheme type names //- Time scheme type names
static const NamedEnum<ddtSchemeType, 3> ddtSchemeTypeNames_; static const Enum<ddtSchemeType> ddtSchemeTypeNames_;
public: public:

View File

@ -37,19 +37,16 @@ namespace functionObjects
} }
} }
template<>
const char*
Foam::NamedEnum
<
Foam::functionObjects::volRegion::regionTypes,
2
>::names[] = {"cellZone", "all"};
const Foam::NamedEnum const Foam::Enum
< <
Foam::functionObjects::volRegion::regionTypes, Foam::functionObjects::volRegion::regionTypes
2 >
> Foam::functionObjects::volRegion::regionTypeNames_; Foam::functionObjects::volRegion::regionTypeNames_
{
{ regionTypes::vrtCellZone, "cellZone" },
{ regionTypes::vrtAll, "all" },
};
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
@ -79,9 +76,12 @@ Foam::functionObjects::volRegion::volRegion
mesh_(mesh), mesh_(mesh),
regionType_ regionType_
( (
dict.found("regionType") regionTypeNames_.lookupOrDefault
? regionTypeNames_.read(dict.lookup("regionType")) (
: vrtAll "regionType",
dict,
regionTypes::vrtAll
)
), ),
regionName_(polyMesh::defaultRegion), regionName_(polyMesh::defaultRegion),
regionID_(-1) regionID_(-1)
@ -144,7 +144,7 @@ bool Foam::functionObjects::volRegion::read
{ {
FatalIOErrorInFunction(dict) FatalIOErrorInFunction(dict)
<< "Unknown region type. Valid region types are:" << "Unknown region type. Valid region types are:"
<< regionTypeNames_.toc() << regionTypeNames_.sortedToc()
<< exit(FatalIOError); << exit(FatalIOError);
} }
} }

View File

@ -71,7 +71,7 @@ SourceFiles
#define functionObjects_volRegion_H #define functionObjects_volRegion_H
#include "writeFile.H" #include "writeFile.H"
#include "NamedEnum.H" #include "Enum.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -111,7 +111,7 @@ public:
}; };
//- Region type names //- Region type names
static const NamedEnum<regionTypes, 2> regionTypeNames_; static const Enum<regionTypes> regionTypeNames_;
protected: protected:

View File

@ -50,7 +50,10 @@ namespace functionObjects
} }
} }
const Foam::Enum<Foam::functionObjects::externalCoupled::stateEnd> const Foam::Enum
<
Foam::functionObjects::externalCoupled::stateEnd
>
Foam::functionObjects::externalCoupled::stateEndNames_ Foam::functionObjects::externalCoupled::stateEndNames_
{ {
{ stateEnd::REMOVE, "remove" }, { stateEnd::REMOVE, "remove" },

View File

@ -37,18 +37,16 @@ const Foam::word Foam::functionObjects::fieldAverageItem::EXT_PRIME2MEAN
"Prime2Mean" "Prime2Mean"
); );
template<>
const char* Foam::NamedEnum
<
Foam::functionObjects::fieldAverageItem::baseType,
2
>::names[] = { "iteration", "time"};
const Foam::NamedEnum const Foam::Enum
< <
Foam::functionObjects::fieldAverageItem::baseType, Foam::functionObjects::fieldAverageItem::baseType
2 >
> Foam::functionObjects::fieldAverageItem::baseTypeNames_; Foam::functionObjects::fieldAverageItem::baseTypeNames_
{
{ baseType::ITER, "iteration" },
{ baseType::TIME, "time" },
};
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -50,7 +50,7 @@ SourceFiles
#ifndef fieldAverageItem_H #ifndef fieldAverageItem_H
#define fieldAverageItem_H #define fieldAverageItem_H
#include "NamedEnum.H" #include "Enum.H"
#include "Switch.H" #include "Switch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -119,7 +119,7 @@ private:
word prime2MeanFieldName_; word prime2MeanFieldName_;
//- Averaging base type names //- Averaging base type names
static const NamedEnum<baseType, 2> baseTypeNames_; static const Enum<baseType> baseTypeNames_;
//- Averaging base type //- Averaging base type
baseType base_; baseType base_;

View File

@ -47,7 +47,7 @@ Foam::functionObjects::fieldAverageItem::fieldAverageItem(Istream& is)
fieldName_ = entry.keyword(); fieldName_ = entry.keyword();
mean_ = readBool(entry.lookup("mean")); mean_ = readBool(entry.lookup("mean"));
prime2Mean_ = readBool(entry.lookup("prime2Mean")); prime2Mean_ = readBool(entry.lookup("prime2Mean"));
base_ = baseTypeNames_[entry.lookup("base")]; base_ = baseTypeNames_.lookup("base", entry);
window_ = entry.lookupOrDefault<scalar>("window", -1.0); window_ = entry.lookupOrDefault<scalar>("window", -1.0);
windowName_ = entry.lookupOrDefault<word>("windowName", ""); windowName_ = entry.lookupOrDefault<word>("windowName", "");
@ -77,7 +77,7 @@ Foam::Istream& Foam::functionObjects::operator>>
faItem.fieldName_ = entry.keyword(); faItem.fieldName_ = entry.keyword();
faItem.mean_ = readBool(entry.lookup("mean")); faItem.mean_ = readBool(entry.lookup("mean"));
faItem.prime2Mean_ = readBool(entry.lookup("prime2Mean")); faItem.prime2Mean_ = readBool(entry.lookup("prime2Mean"));
faItem.base_ = faItem.baseTypeNames_[entry.lookup("base")]; faItem.base_ = faItem.baseTypeNames_.lookup("base", entry);
faItem.window_ = entry.lookupOrDefault<scalar>("window", -1.0); faItem.window_ = entry.lookupOrDefault<scalar>("window", -1.0);
faItem.windowName_ = entry.lookupOrDefault<word>("windowName", ""); faItem.windowName_ = entry.lookupOrDefault<word>("windowName", "");

View File

@ -38,18 +38,15 @@ namespace functionObjects
} }
} }
template<> const Foam::Enum
const char* Foam::NamedEnum
< <
Foam::functionObjects::fieldMinMax::modeType, Foam::functionObjects::fieldMinMax::modeType
2 >
>::names[] = {"magnitude", "component"}; Foam::functionObjects::fieldMinMax::modeTypeNames_
{
const Foam::NamedEnum { modeType::mdMag, "magnitude" },
< { modeType::mdCmpt, "component" },
Foam::functionObjects::fieldMinMax::modeType, };
2
> Foam::functionObjects::fieldMinMax::modeTypeNames_;
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
@ -126,7 +123,7 @@ bool Foam::functionObjects::fieldMinMax::read(const dictionary& dict)
location_ = dict.lookupOrDefault<Switch>("location", true); location_ = dict.lookupOrDefault<Switch>("location", true);
mode_ = modeTypeNames_[dict.lookupOrDefault<word>("mode", "magnitude")]; mode_ = modeTypeNames_.lookupOrDefault("mode", dict, modeType::mdMag);
dict.lookup("fields") >> fieldSet_; dict.lookup("fields") >> fieldSet_;
return true; return true;

View File

@ -78,7 +78,7 @@ SourceFiles
#define functionObjects_fieldMinMax_H #define functionObjects_fieldMinMax_H
#include "Switch.H" #include "Switch.H"
#include "NamedEnum.H" #include "Enum.H"
#include "fvMeshFunctionObject.H" #include "fvMeshFunctionObject.H"
#include "writeFile.H" #include "writeFile.H"
#include "vector.H" #include "vector.H"
@ -115,7 +115,7 @@ protected:
// Protected data // Protected data
//- Mode type names //- Mode type names
static const NamedEnum<modeType, 2> modeTypeNames_; static const Enum<modeType> modeTypeNames_;
//- Switch to write location of min/max values //- Switch to write location of min/max values
Switch location_; Switch location_;

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd. \\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -40,24 +40,19 @@ namespace fieldValues
} }
} }
template<>
const char* Foam::NamedEnum const Foam::Enum
< <
Foam::functionObjects::fieldValues::fieldValueDelta::operationType, Foam::functionObjects::fieldValues::fieldValueDelta::operationType
5 >
>::names[] = Foam::functionObjects::fieldValues::fieldValueDelta::operationTypeNames_
{ {
"add", { operationType::opAdd, "add" },
"subtract", { operationType::opSubtract, "subtract" },
"min", { operationType::opMin, "min" },
"max", { operationType::opMax, "max" },
"average" { operationType::opAverage, "average" },
}; };
const Foam::NamedEnum
<
Foam::functionObjects::fieldValues::fieldValueDelta::operationType,
5
> Foam::functionObjects::fieldValues::fieldValueDelta::operationTypeNames_;
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
@ -151,7 +146,7 @@ bool Foam::functionObjects::fieldValues::fieldValueDelta::read
).ptr() ).ptr()
); );
operation_ = operationTypeNames_.read(dict.lookup("operation")); operation_ = operationTypeNames_.lookup("operation", dict);
return true; return true;
} }

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd. \\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -85,6 +85,7 @@ SourceFiles
#include "stateFunctionObject.H" #include "stateFunctionObject.H"
#include "writeFile.H" #include "writeFile.H"
#include "fieldValue.H" #include "fieldValue.H"
#include "Enum.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -116,7 +117,7 @@ public:
}; };
//- Operation type names //- Operation type names
static const NamedEnum<operationType, 5> operationTypeNames_; static const Enum<operationType> operationTypeNames_;
private: private:

View File

@ -49,75 +49,54 @@ namespace fieldValues
} }
} }
template<>
const char* Foam::NamedEnum
<
Foam::functionObjects::fieldValues::surfaceFieldValue::regionTypes,
4
>::names[] =
{
"faceZone",
"patch",
"surface",
"sampledSurface"
};
template<> const Foam::Enum
const char* Foam::NamedEnum
< <
Foam::functionObjects::fieldValues::surfaceFieldValue::operationType, Foam::functionObjects::fieldValues::surfaceFieldValue::regionTypes
17
>::names[] =
{
"none",
"sum",
"weightedSum",
"sumMag",
"sumDirection",
"sumDirectionBalance",
"average",
"weightedAverage",
"areaAverage",
"weightedAreaAverage",
"areaIntegrate",
"weightedAreaIntegrate",
"min",
"max",
"CoV",
"areaNormalAverage",
"areaNormalIntegrate"
};
template<>
const char* Foam::NamedEnum
<
Foam::functionObjects::fieldValues::surfaceFieldValue::postOperationType,
2
>::names[] =
{
"none",
"sqrt"
};
const Foam::NamedEnum
<
Foam::functionObjects::fieldValues::surfaceFieldValue::regionTypes,
4
> Foam::functionObjects::fieldValues::surfaceFieldValue::regionTypeNames_;
const Foam::NamedEnum
<
Foam::functionObjects::fieldValues::surfaceFieldValue::operationType,
17
> Foam::functionObjects::fieldValues::surfaceFieldValue::operationTypeNames_;
const Foam::NamedEnum
<
Foam::functionObjects::fieldValues::surfaceFieldValue::postOperationType,
2
> >
Foam::functionObjects::fieldValues::surfaceFieldValue::postOperationTypeNames_; Foam::functionObjects::fieldValues::surfaceFieldValue::regionTypeNames_
{
{ regionTypes::stFaceZone, "faceZone" },
{ regionTypes::stPatch, "patch" },
{ regionTypes::stSurface, "surface" },
{ regionTypes::stSampledSurface, "sampledSurface" },
};
const Foam::Enum
<
Foam::functionObjects::fieldValues::surfaceFieldValue::operationType
>
Foam::functionObjects::fieldValues::surfaceFieldValue::operationTypeNames_
{
{ operationType::opNone, "none" },
{ operationType::opSum, "sum" },
{ operationType::opWeightedSum, "weightedSum" },
{ operationType::opSumMag, "sumMag" },
{ operationType::opSumDirection, "sumDirection" },
{ operationType::opSumDirectionBalance, "sumDirectionBalance" },
{ operationType::opAverage, "average" },
{ operationType::opWeightedAverage, "weightedAverage" },
{ operationType::opAreaAverage, "areaAverage" },
{ operationType::opWeightedAreaAverage, "weightedAreaAverage" },
{ operationType::opAreaIntegrate, "areaIntegrate" },
{ operationType::opWeightedAreaIntegrate, "weightedAreaIntegrate" },
{ operationType::opMin, "min" },
{ operationType::opMax, "max" },
{ operationType::opCoV, "CoV" },
{ operationType::opAreaNormalAverage, "areaNormalAverage" },
{ operationType::opAreaNormalIntegrate, "areaNormalIntegrate" },
};
const Foam::Enum
<
Foam::functionObjects::fieldValues::surfaceFieldValue::postOperationType
>
Foam::functionObjects::fieldValues::surfaceFieldValue::postOperationTypeNames_
{
{ postOperationType::postOpNone, "none" },
{ postOperationType::postOpSqrt, "sqrt" },
};
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
@ -832,12 +811,16 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::surfaceFieldValue
) )
: :
fieldValue(name, runTime, dict, typeName), fieldValue(name, runTime, dict, typeName),
regionType_(regionTypeNames_.read(dict.lookup("regionType"))), regionType_(regionTypeNames_.lookup("regionType", dict)),
operation_(operationTypeNames_.read(dict.lookup("operation"))), operation_(operationTypeNames_.lookup("operation", dict)),
postOperation_ postOperation_
( (
postOperationTypeNames_ postOperationTypeNames_.lookupOrDefault
[dict.lookupOrDefault<word>("postOperation", "none")] (
"postOperation",
dict,
postOperationType::postOpNone
)
), ),
weightFieldName_("none"), weightFieldName_("none"),
writeArea_(dict.lookupOrDefault("writeArea", false)), writeArea_(dict.lookupOrDefault("writeArea", false)),
@ -859,12 +842,16 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::surfaceFieldValue
) )
: :
fieldValue(name, obr, dict, typeName), fieldValue(name, obr, dict, typeName),
regionType_(regionTypeNames_.read(dict.lookup("regionType"))), regionType_(regionTypeNames_.lookup("regionType", dict)),
operation_(operationTypeNames_.read(dict.lookup("operation"))), operation_(operationTypeNames_.lookup("operation", dict)),
postOperation_ postOperation_
( (
postOperationTypeNames_ postOperationTypeNames_.lookupOrDefault
[dict.lookupOrDefault<word>("postOperation", "none")] (
"postOperation",
dict,
postOperationType::postOpNone
)
), ),
weightFieldName_("none"), weightFieldName_("none"),
writeArea_(dict.lookupOrDefault("writeArea", false)), writeArea_(dict.lookupOrDefault("writeArea", false)),

View File

@ -156,7 +156,7 @@ SourceFiles
#define functionObjects_surfaceFieldValue_H #define functionObjects_surfaceFieldValue_H
#include "fieldValue.H" #include "fieldValue.H"
#include "NamedEnum.H" #include "Enum.H"
#include "meshedSurf.H" #include "meshedSurf.H"
#include "surfaceMesh.H" #include "surfaceMesh.H"
#include "fvsPatchField.H" #include "fvsPatchField.H"
@ -198,7 +198,7 @@ public:
}; };
//- Region type names //- Region type names
static const NamedEnum<regionTypes, 4> regionTypeNames_; static const Enum<regionTypes> regionTypeNames_;
//- Operation type enumeration //- Operation type enumeration
@ -224,7 +224,7 @@ public:
}; };
//- Operation type names //- Operation type names
static const NamedEnum<operationType, 17> operationTypeNames_; static const Enum<operationType> operationTypeNames_;
//- Post-operation type enumeration //- Post-operation type enumeration
@ -235,7 +235,7 @@ public:
}; };
//- Operation type names //- Operation type names
static const NamedEnum<postOperationType, 2> postOperationTypeNames_; static const Enum<postOperationType> postOperationTypeNames_;
private: private:

View File

@ -43,35 +43,27 @@ namespace fieldValues
} }
} }
template<> const Foam::Enum
const char*
Foam::NamedEnum
< <
Foam::functionObjects::fieldValues::volFieldValue::operationType, Foam::functionObjects::fieldValues::volFieldValue::operationType
13 >
>::names[] = Foam::functionObjects::fieldValues::volFieldValue::operationTypeNames_
{ {
"none", { operationType::opNone, "none" },
"sum", { operationType::opSum, "sum" },
"weightedSum", { operationType::opWeightedSum, "weightedSum" },
"sumMag", { operationType::opSumMag, "sumMag" },
"average", { operationType::opAverage, "average" },
"weightedAverage", { operationType::opWeightedAverage, "weightedAverage" },
"volAverage", { operationType::opVolAverage, "volAverage" },
"weightedVolAverage", { operationType::opWeightedVolAverage, "weightedVolAverage" },
"volIntegrate", { operationType::opVolIntegrate, "volIntegrate" },
"weightedVolIntegrate", { operationType::opWeightedVolIntegrate, "weightedVolIntegrate" },
"min", { operationType::opMin, "min" },
"max", { operationType::opMax, "max" },
"CoV" { operationType::opCoV, "CoV" },
}; };
const Foam::NamedEnum
<
Foam::functionObjects::fieldValues::volFieldValue::operationType,
13
> Foam::functionObjects::fieldValues::volFieldValue::operationTypeNames_;
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
@ -198,7 +190,7 @@ Foam::functionObjects::fieldValues::volFieldValue::volFieldValue
: :
fieldValue(name, runTime, dict, typeName), fieldValue(name, runTime, dict, typeName),
volRegion(fieldValue::mesh_, dict), volRegion(fieldValue::mesh_, dict),
operation_(operationTypeNames_.read(dict.lookup("operation"))), operation_(operationTypeNames_.lookup("operation", dict)),
weightFieldName_("none") weightFieldName_("none")
{ {
read(dict); read(dict);
@ -215,7 +207,7 @@ Foam::functionObjects::fieldValues::volFieldValue::volFieldValue
: :
fieldValue(name, obr, dict, typeName), fieldValue(name, obr, dict, typeName),
volRegion(fieldValue::mesh_, dict), volRegion(fieldValue::mesh_, dict),
operation_(operationTypeNames_.read(dict.lookup("operation"))), operation_(operationTypeNames_.lookup("operation", dict)),
weightFieldName_("none") weightFieldName_("none")
{ {
read(dict); read(dict);

View File

@ -153,7 +153,7 @@ public:
}; };
//- Operation type names //- Operation type names
static const NamedEnum<operationType, 13> operationTypeNames_; static const Enum<operationType> operationTypeNames_;
protected: protected:

View File

@ -52,24 +52,20 @@ namespace functionObjects
dictionary dictionary
); );
} }
template<>
const char* NamedEnum
<
functionObjects::fluxSummary::modeType,
5
>::names[] =
{
"faceZone",
"faceZoneAndDirection",
"cellZoneAndDirection",
"surface",
"surfaceAndDirection"
};
} }
const Foam::Enum
const Foam::NamedEnum<Foam::functionObjects::fluxSummary::modeType, 5> <
Foam::functionObjects::fluxSummary::modeTypeNames_; 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 * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -823,7 +819,7 @@ bool Foam::functionObjects::fluxSummary::read(const dictionary& dict)
fvMeshFunctionObject::read(dict); fvMeshFunctionObject::read(dict);
writeFile::read(dict); writeFile::read(dict);
mode_ = modeTypeNames_.read(dict.lookup("mode")); mode_ = modeTypeNames_.lookup("mode", dict);
phiName_ = dict.lookupOrDefault<word>("phi", "phi"); phiName_ = dict.lookupOrDefault<word>("phi", "phi");
scaleFactor_ = dict.lookupOrDefault<scalar>("scaleFactor", 1.0); scaleFactor_ = dict.lookupOrDefault<scalar>("scaleFactor", 1.0);
tolerance_ = dict.lookupOrDefault<scalar>("tolerance", 0.8); tolerance_ = dict.lookupOrDefault<scalar>("tolerance", 0.8);

View File

@ -124,7 +124,7 @@ public:
}; };
//- Mode type names //- Mode type names
static const NamedEnum<modeType, 5> modeTypeNames_; static const Enum<modeType> modeTypeNames_;
protected: protected:

View File

@ -48,7 +48,10 @@ namespace functionObjects
} }
const Foam::Enum<Foam::functionObjects::setFlow::modeType> const Foam::Enum
<
Foam::functionObjects::setFlow::modeType
>
Foam::functionObjects::setFlow::modeTypeNames Foam::functionObjects::setFlow::modeTypeNames
{ {
{ functionObjects::setFlow::modeType::FUNCTION, "function" }, { functionObjects::setFlow::modeType::FUNCTION, "function" },

View File

@ -110,7 +110,7 @@ class setFlow
VORTEX3D VORTEX3D
}; };
static const Foam::Enum<modeType> modeTypeNames; static const Enum<modeType> modeTypeNames;
// Private Data // Private Data

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -45,51 +45,39 @@ namespace functionObjects
} }
} }
template<> const Foam::Enum
const char* Foam::NamedEnum
< <
Foam::functionObjects::turbulenceFields::compressibleField, Foam::functionObjects::turbulenceFields::compressibleField
9 >
>::names[] = Foam::functionObjects::turbulenceFields::compressibleFieldNames_
{ {
"k", { compressibleField::cfK, "k" },
"epsilon", { compressibleField::cfEpsilon, "epsilon" },
"omega", { compressibleField::cfOmega, "omega" },
"mut", { compressibleField::cfMut, "mut" },
"muEff", { compressibleField::cfMuEff, "muEff" },
"alphat", { compressibleField::cfAlphat, "alphat" },
"alphaEff", { compressibleField::cfAlphaEff, "alphaEff" },
"R", { compressibleField::cfR, "R" },
"devRhoReff" { compressibleField::cfDevRhoReff, "devRhoReff" },
}; };
const Foam::NamedEnum
<
Foam::functionObjects::turbulenceFields::compressibleField,
9
> Foam::functionObjects::turbulenceFields::compressibleFieldNames_;
template<> const Foam::Enum
const char* Foam::NamedEnum
< <
Foam::functionObjects::turbulenceFields::incompressibleField, Foam::functionObjects::turbulenceFields::incompressibleField
7 >
>::names[] = Foam::functionObjects::turbulenceFields::incompressibleFieldNames_
{ {
"k", { incompressibleField::ifK, "k" },
"epsilon", { incompressibleField::ifEpsilon, "epsilon" },
"omega", { incompressibleField::ifOmega, "omega" },
"nut", { incompressibleField::ifNut, "nut" },
"nuEff", { incompressibleField::ifNuEff, "nuEff" },
"R", { incompressibleField::ifR, "R" },
"devReff" { incompressibleField::ifDevReff, "devReff" },
}; };
const Foam::NamedEnum
<
Foam::functionObjects::turbulenceFields::incompressibleField,
7
> Foam::functionObjects::turbulenceFields::incompressibleFieldNames_;
const Foam::word Foam::functionObjects::turbulenceFields::modelName const Foam::word Foam::functionObjects::turbulenceFields::modelName
( (

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -90,7 +90,7 @@ SourceFiles
#include "fvMeshFunctionObject.H" #include "fvMeshFunctionObject.H"
#include "HashSet.H" #include "HashSet.H"
#include "NamedEnum.H" #include "Enum.H"
#include "volFieldsFwd.H" #include "volFieldsFwd.H"
#include "Switch.H" #include "Switch.H"
@ -123,7 +123,7 @@ public:
cfR, cfR,
cfDevRhoReff cfDevRhoReff
}; };
static const NamedEnum<compressibleField, 9> compressibleFieldNames_; static const Enum<compressibleField> compressibleFieldNames_;
enum incompressibleField enum incompressibleField
{ {
@ -135,7 +135,7 @@ public:
ifR, ifR,
ifDevReff ifDevReff
}; };
static const NamedEnum<incompressibleField, 7> incompressibleFieldNames_; static const Enum<incompressibleField> incompressibleFieldNames_;
static const word modelName; static const word modelName;

View File

@ -47,46 +47,27 @@ License
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
namespace Foam const Foam::Enum
{
template<>
const char* NamedEnum
< <
functionObjects::fieldVisualisationBase::colourByType, Foam::functionObjects::fieldVisualisationBase::colourByType
2 >
>::names[] = Foam::functionObjects::fieldVisualisationBase::colourByTypeNames
{ {
"colour", { colourByType::cbColour, "colour" },
"field" { colourByType::cbField, "field" },
}; };
template<> const Foam::Enum
const char* NamedEnum
< <
functionObjects::fieldVisualisationBase::colourMapType, Foam::functionObjects::fieldVisualisationBase::colourMapType
4 >
>::names[] = Foam::functionObjects::fieldVisualisationBase::colourMapTypeNames
{ {
"rainbow", { colourMapType::cmRainbow, "rainbow" },
"blueWhiteRed", { colourMapType::cmBlueWhiteRed, "blueWhiteRed" },
"fire", { colourMapType::cmFire, "fire" },
"greyscale" { colourMapType::cmGreyscale, "greyscale" },
}; };
}
const Foam::NamedEnum
<
Foam::functionObjects::fieldVisualisationBase::colourByType,
2
>
Foam::functionObjects::fieldVisualisationBase::colourByTypeNames;
const Foam::NamedEnum
<
Foam::functionObjects::fieldVisualisationBase::colourMapType,
4
>
Foam::functionObjects::fieldVisualisationBase::colourMapTypeNames;
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
@ -508,7 +489,7 @@ Foam::functionObjects::fieldVisualisationBase::fieldVisualisationBase
colourMap_(cmRainbow), colourMap_(cmRainbow),
range_() range_()
{ {
colourBy_ = colourByTypeNames.read(dict.lookup("colourBy")); colourBy_ = colourByTypeNames.lookup("colourBy", dict);
switch (colourBy_) switch (colourBy_)
{ {
@ -523,7 +504,7 @@ Foam::functionObjects::fieldVisualisationBase::fieldVisualisationBase
if (dict.found("colourMap")) if (dict.found("colourMap"))
{ {
colourMap_ = colourMapTypeNames.read(dict.lookup("colourMap")); colourMap_ = colourMapTypeNames.lookup("colourMap", dict);
} }
const dictionary& sbarDict = dict.subDict("scalarBar"); const dictionary& sbarDict = dict.subDict("scalarBar");

View File

@ -37,7 +37,7 @@ SourceFiles
#include "dictionary.H" #include "dictionary.H"
#include "Tuple2.H" #include "Tuple2.H"
#include "NamedEnum.H" #include "Enum.H"
#include "vector.H" #include "vector.H"
#include "HashPtrTable.H" #include "HashPtrTable.H"
#include "Function1.H" #include "Function1.H"
@ -78,7 +78,7 @@ public:
cbField cbField
}; };
static const NamedEnum<colourByType, 2> colourByTypeNames; static const Enum<colourByType> colourByTypeNames;
enum colourMapType enum colourMapType
{ {
@ -88,7 +88,7 @@ public:
cmGreyscale cmGreyscale
}; };
static const NamedEnum<colourMapType, 4> colourMapTypeNames; static const Enum<colourMapType> colourMapTypeNames;
private: private:

View File

@ -32,27 +32,16 @@ License
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
namespace Foam const Foam::Enum
{
template<>
const char* NamedEnum
< <
functionObjects::runTimePostPro::geometryBase::renderModeType, Foam::functionObjects::runTimePostPro::geometryBase::renderModeType
3
>::names[] =
{
"flat",
"gouraud",
"phong"
};
}
const Foam::NamedEnum
<
Foam::functionObjects::runTimePostPro::geometryBase::renderModeType,
3
> >
Foam::functionObjects::runTimePostPro::geometryBase::renderModeTypeNames; Foam::functionObjects::runTimePostPro::geometryBase::renderModeTypeNames
{
{ renderModeType::rmFlat, "flat" },
{ renderModeType::rmGouraud, "gouraud" },
{ renderModeType::rmPhong, "phong" },
};
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
@ -104,7 +93,7 @@ Foam::functionObjects::runTimePostPro::geometryBase::geometryBase
{ {
if (dict.found("renderMode")) if (dict.found("renderMode"))
{ {
renderMode_ = renderModeTypeNames.read(dict.lookup("renderMode")); renderMode_ = renderModeTypeNames.lookup("renderMode", dict);
} }
if (dict.found("opacity")) if (dict.found("opacity"))

View File

@ -39,7 +39,7 @@ SourceFiles
#include "vector.H" #include "vector.H"
#include "Function1.H" #include "Function1.H"
#include "HashPtrTable.H" #include "HashPtrTable.H"
#include "NamedEnum.H" #include "Enum.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -75,7 +75,7 @@ public:
rmPhong //!< Phong shading rmPhong //!< Phong shading
}; };
static const NamedEnum<renderModeType, 3> renderModeTypeNames; static const Enum<renderModeType> renderModeTypeNames;
private: private:

View File

@ -48,27 +48,19 @@ namespace runTimePostPro
defineRunTimeSelectionTable(pathline, dictionary); defineRunTimeSelectionTable(pathline, dictionary);
} }
} }
template<>
const char* NamedEnum
<
functionObjects::runTimePostPro::pathline::representationType,
4
>::names[] =
{
"none",
"line",
"tube",
"vector"
};
} }
const Foam::NamedEnum const Foam::Enum
< <
Foam::functionObjects::runTimePostPro::pathline::representationType, Foam::functionObjects::runTimePostPro::pathline::representationType
4
> >
Foam::functionObjects::runTimePostPro::pathline::representationTypeNames; Foam::functionObjects::runTimePostPro::pathline::representationTypeNames
{
{ representationType::rtNone, "none" },
{ representationType::rtLine, "line" },
{ representationType::rtTube, "tube" },
{ representationType::rtVector, "vector" },
};
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
@ -137,7 +129,7 @@ Foam::functionObjects::runTimePostPro::pathline::pathline
geometryBase(parent, dict, colours), geometryBase(parent, dict, colours),
representation_ representation_
( (
representationTypeNames.read(dict.lookup("representation")) representationTypeNames.lookup("representation", dict)
), ),
tubeRadius_(0.0), tubeRadius_(0.0),
lineColour_(nullptr) lineColour_(nullptr)

View File

@ -35,7 +35,7 @@ SourceFiles
#define functionObjects_runTimePostPro_pathline_H #define functionObjects_runTimePostPro_pathline_H
#include "geometryBase.H" #include "geometryBase.H"
#include "NamedEnum.H" #include "Enum.H"
#include "runTimeSelectionTables.H" #include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -71,7 +71,7 @@ public:
rtVector rtVector
}; };
static const NamedEnum<representationType, 4> representationTypeNames; static const Enum<representationType> representationTypeNames;
private: private:

View File

@ -48,24 +48,17 @@ namespace runTimePostPro
defineRunTimeSelectionTable(pointData, dictionary); defineRunTimeSelectionTable(pointData, dictionary);
} }
} }
template<>
const char* NamedEnum
<
functionObjects::runTimePostPro::pointData::representationType,
2
>::names[] =
{
"sphere",
"vector"
};
} }
const Foam::NamedEnum const Foam::Enum
< <
Foam::functionObjects::runTimePostPro::pointData::representationType, Foam::functionObjects::runTimePostPro::pointData::representationType
2
> >
Foam::functionObjects::runTimePostPro::pointData::representationTypeNames; Foam::functionObjects::runTimePostPro::pointData::representationTypeNames
{
{ representationType::rtSphere, "sphere" },
{ representationType::rtVector, "vector" },
};
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
@ -106,7 +99,7 @@ Foam::functionObjects::runTimePostPro::pointData::pointData
geometryBase(parent, dict, colours), geometryBase(parent, dict, colours),
representation_ representation_
( (
representationTypeNames.read(dict.lookup("representation")) representationTypeNames.lookup("representation", dict)
), ),
maxGlyphLength_(readScalar(dict.lookup("maxGlyphLength"))), maxGlyphLength_(readScalar(dict.lookup("maxGlyphLength"))),
pointColour_(nullptr) pointColour_(nullptr)

View File

@ -35,7 +35,7 @@ SourceFiles
#define functionObjects_runTimePostPro_pointData_H #define functionObjects_runTimePostPro_pointData_H
#include "geometryBase.H" #include "geometryBase.H"
#include "NamedEnum.H" #include "Enum.H"
#include "runTimeSelectionTables.H" #include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -69,7 +69,7 @@ public:
rtVector //!< Vector rtVector //!< Vector
}; };
static const NamedEnum<representationType, 2> representationTypeNames; static const Enum<representationType> representationTypeNames;
private: private:

View File

@ -62,7 +62,7 @@ SourceFiles
#include "vector.H" #include "vector.H"
#include "point.H" #include "point.H"
#include "boundBox.H" #include "boundBox.H"
#include "NamedEnum.H" #include "Enum.H"
#include "HashPtrTable.H" #include "HashPtrTable.H"
#include "vector.H" #include "vector.H"

View File

@ -48,27 +48,21 @@ namespace runTimePostPro
defineRunTimeSelectionTable(surface, dictionary); defineRunTimeSelectionTable(surface, dictionary);
} }
} }
template<>
const char* NamedEnum
<
functionObjects::runTimePostPro::surface::representationType,
5
>::names[] =
{
"none",
"wireframe",
"surface",
"surfaceWithEdges",
"glyph"
};
} }
const Foam::NamedEnum
const Foam::Enum
< <
Foam::functionObjects::runTimePostPro::surface::representationType, Foam::functionObjects::runTimePostPro::surface::representationType
5
> >
Foam::functionObjects::runTimePostPro::surface::representationTypeNames; Foam::functionObjects::runTimePostPro::surface::representationTypeNames
{
{ representationType::rtNone, "none" },
{ representationType::rtWireframe, "wireframe" },
{ representationType::rtSurface, "surface" },
{ representationType::rtSurfaceWithEdges, "surfaceWithEdges" },
{ representationType::rtGlyph, "glyph" },
};
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
@ -155,7 +149,7 @@ Foam::functionObjects::runTimePostPro::surface::surface
geometryBase(parent, dict, colours), geometryBase(parent, dict, colours),
representation_ representation_
( (
representationTypeNames.read(dict.lookup("representation")) representationTypeNames.lookup("representation", dict)
), ),
featureEdges_(false), featureEdges_(false),
surfaceColour_(nullptr), surfaceColour_(nullptr),

View File

@ -35,7 +35,7 @@ SourceFiles
#define functionObjects_runTimePostPro_surface_H #define functionObjects_runTimePostPro_surface_H
#include "geometryBase.H" #include "geometryBase.H"
#include "NamedEnum.H" #include "Enum.H"
#include "runTimeSelectionTables.H" #include "runTimeSelectionTables.H"
#include "vtkSmartPointer.h" #include "vtkSmartPointer.h"
@ -74,7 +74,7 @@ public:
rtGlyph rtGlyph
}; };
static const NamedEnum<representationType, 5> representationTypeNames; static const Enum<representationType> representationTypeNames;
private: private:

View File

@ -48,23 +48,17 @@ namespace functionObjects
} }
} }
template<>
const char* Foam::NamedEnum
<
Foam::functionObjects::abort::actionType,
3
>::names[] =
{
"noWriteNow",
"writeNow",
"nextWrite"
};
const Foam::NamedEnum const Foam::Enum
< <
Foam::functionObjects::abort::actionType, Foam::Time::stopAtControls
3 >
> Foam::functionObjects::abort::actionTypeNames_; Foam::functionObjects::abort::actionNames_
{
{ Time::stopAtControls::saNoWriteNow, "noWriteNow" },
{ Time::stopAtControls::saWriteNow, "writeNow" },
{ Time::stopAtControls::saNextWrite, "nextWrite" },
};
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -94,7 +88,7 @@ Foam::functionObjects::abort::abort
functionObject(name), functionObject(name),
time_(runTime), time_(runTime),
abortFile_("$FOAM_CASE/" + name), abortFile_("$FOAM_CASE/" + name),
action_(nextWrite) action_(Time::stopAtControls::saNextWrite)
{ {
abortFile_.expand(); abortFile_.expand();
read(dict); read(dict);
@ -116,14 +110,12 @@ bool Foam::functionObjects::abort::read(const dictionary& dict)
{ {
functionObject::read(dict); functionObject::read(dict);
if (dict.found("action")) action_ = actionNames_.lookupOrDefault
{ (
action_ = actionTypeNames_.read(dict.lookup("action")); "action",
} dict,
else Time::stopAtControls::saNextWrite
{ );
action_ = nextWrite;
}
if (dict.readIfPresent("file", abortFile_)) if (dict.readIfPresent("file", abortFile_))
{ {
@ -143,9 +135,9 @@ bool Foam::functionObjects::abort::execute()
{ {
switch (action_) switch (action_)
{ {
case noWriteNow : case Time::saNoWriteNow :
{ {
if (time_.stopAt(Time::saNoWriteNow)) if (time_.stopAt(action_))
{ {
Info<< "USER REQUESTED ABORT (timeIndex=" Info<< "USER REQUESTED ABORT (timeIndex="
<< time_.timeIndex() << time_.timeIndex()
@ -155,9 +147,9 @@ bool Foam::functionObjects::abort::execute()
break; break;
} }
case writeNow : case Time::saWriteNow :
{ {
if (time_.stopAt(Time::saWriteNow)) if (time_.stopAt(action_))
{ {
Info<< "USER REQUESTED ABORT (timeIndex=" Info<< "USER REQUESTED ABORT (timeIndex="
<< time_.timeIndex() << time_.timeIndex()
@ -167,9 +159,9 @@ bool Foam::functionObjects::abort::execute()
break; break;
} }
case nextWrite : case Time::saNextWrite :
{ {
if (time_.stopAt(Time::saNextWrite)) if (time_.stopAt(action_))
{ {
Info<< "USER REQUESTED ABORT (timeIndex=" Info<< "USER REQUESTED ABORT (timeIndex="
<< time_.timeIndex() << time_.timeIndex()
@ -178,6 +170,11 @@ bool Foam::functionObjects::abort::execute()
} }
break; break;
} }
default:
{
// Invalid choices already filtered out by Enum
}
} }
} }

View File

@ -45,7 +45,7 @@ SourceFiles
#define functionObjects_abort_H #define functionObjects_abort_H
#include "functionObject.H" #include "functionObject.H"
#include "NamedEnum.H" #include "Time.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -62,33 +62,19 @@ class abort
: :
public functionObject public functionObject
{ {
public:
// Public data
//- Enumeration defining the type of action
enum actionType
{
noWriteNow, //!< stop immediately without writing data
writeNow, //!< write data and stop immediately
nextWrite //!< stop the next time data are written
};
private:
// Private data // Private data
//- A subset of Time stopAtControls
static const Enum<Time::stopAtControls> actionNames_;
//- Reference to the Time //- Reference to the Time
const Time& time_; const Time& time_;
//- The fully-qualified name of the abort file //- The fully-qualified name of the abort file
fileName abortFile_; fileName abortFile_;
//- Action type names
static const NamedEnum<actionType, 3> actionTypeNames_;
//- The type of action //- The type of action
actionType action_; Time::stopAtControls action_;
// Private Member Functions // Private Member Functions
@ -97,10 +83,10 @@ private:
void removeFile() const; void removeFile() const;
//- Disallow default bitwise copy construct //- Disallow default bitwise copy construct
abort(const abort&); abort(const abort&) = delete;
//- Disallow default bitwise assignment //- Disallow default bitwise assignment
void operator=(const abort&); void operator=(const abort&) = delete;
public: public:
@ -127,7 +113,7 @@ public:
// Member Functions // Member Functions
//- Read the dictionary settings //- Read the dictionary settings
virtual bool read(const dictionary&); virtual bool read(const dictionary& dict);
//- Execute, check existence of abort file and take action //- Execute, check existence of abort file and take action
virtual bool execute(); virtual bool execute();

View File

@ -47,32 +47,21 @@ namespace runTimeControls
} }
} }
} }
template<>
const char* Foam::NamedEnum
<
Foam
::functionObjects
::runTimeControls
::equationInitialResidualCondition
::operatingMode,
2
>::names[] =
{
"minimum",
"maximum"
};
const Foam::NamedEnum const Foam::Enum
< <
Foam Foam
::functionObjects ::functionObjects
::runTimeControls ::runTimeControls
::equationInitialResidualCondition ::equationInitialResidualCondition
::operatingMode, ::operatingMode
2
> >
Foam::functionObjects::runTimeControls::equationInitialResidualCondition:: Foam::functionObjects::runTimeControls::equationInitialResidualCondition::
operatingModeNames; operatingModeNames
{
{ operatingMode::omMin, "minimum" },
{ operatingMode::omMax, "maximum" },
};
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -90,7 +79,7 @@ equationInitialResidualCondition
fieldNames_(dict.lookup("fields")), fieldNames_(dict.lookup("fields")),
value_(readScalar(dict.lookup("value"))), value_(readScalar(dict.lookup("value"))),
timeStart_(dict.lookupOrDefault("timeStart", -GREAT)), timeStart_(dict.lookupOrDefault("timeStart", -GREAT)),
mode_(operatingModeNames.read(dict.lookup("mode"))) mode_(operatingModeNames.lookup("mode", dict))
{ {
if (fieldNames_.size()) if (fieldNames_.size())
{ {

View File

@ -37,7 +37,7 @@ SourceFiles
#define functionObjects_runTimeControls_equationInitialResidualCondition_H #define functionObjects_runTimeControls_equationInitialResidualCondition_H
#include "runTimeCondition.H" #include "runTimeCondition.H"
#include "NamedEnum.H" #include "Enum.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -64,7 +64,7 @@ public:
omMax //!< Maximum omMax //!< Maximum
}; };
static const NamedEnum<operatingMode, 2> operatingModeNames; static const Enum<operatingMode> operatingModeNames;
protected: protected:

View File

@ -57,27 +57,19 @@ namespace runTimeControls
} }
} }
template<> const Foam::Enum
const char* Foam::NamedEnum
<
Foam::functionObjects::runTimeControls::minMaxCondition::modeType,
2
>::names[] =
{
"minimum",
"maximum"
};
const Foam::NamedEnum
< <
Foam Foam
::functionObjects ::functionObjects
::runTimeControls ::runTimeControls
::minMaxCondition ::minMaxCondition
::modeType, ::modeType
2
> >
Foam::functionObjects::runTimeControls::minMaxCondition::modeTypeNames_; Foam::functionObjects::runTimeControls::minMaxCondition::modeTypeNames_
{
{ modeType::mdMin, "minimum" },
{ modeType::mdMax, "maximum" },
};
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -92,7 +84,7 @@ Foam::functionObjects::runTimeControls::minMaxCondition::minMaxCondition
: :
runTimeCondition(name, obr, dict, state), runTimeCondition(name, obr, dict, state),
functionObjectName_(dict.lookup("functionObject")), functionObjectName_(dict.lookup("functionObject")),
mode_(modeTypeNames_.read(dict.lookup("mode"))), mode_(modeTypeNames_.lookup("mode", dict)),
fieldNames_(dict.lookup("fields")), fieldNames_(dict.lookup("fields")),
value_(readScalar(dict.lookup("value"))) value_(readScalar(dict.lookup("value")))
{} {}

View File

@ -38,7 +38,7 @@ SourceFiles
#define functionObjects_runTimeControls_minMaxCondition_H #define functionObjects_runTimeControls_minMaxCondition_H
#include "runTimeCondition.H" #include "runTimeCondition.H"
#include "NamedEnum.H" #include "Enum.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -68,7 +68,7 @@ public:
mdMax //!< Maximum mdMax //!< Maximum
}; };
static const NamedEnum<modeType, 2> modeTypeNames_; static const Enum<modeType> modeTypeNames_;
protected: protected:

View File

@ -37,7 +37,6 @@ SourceFiles
#define functionObjects_runTimeConditions_minTimeStepCondition_H #define functionObjects_runTimeConditions_minTimeStepCondition_H
#include "runTimeCondition.H" #include "runTimeCondition.H"
#include "NamedEnum.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -45,24 +45,17 @@ namespace functionObjects
} }
} }
template<> const Foam::Enum
const char* Foam::NamedEnum
< <
Foam::functionObjects::writeObjects::writeOption, Foam::functionObjects::writeObjects::writeOption
3 >
>::names[] = Foam::functionObjects::writeObjects::writeOptionNames_
{ {
"autoWrite", { writeOption::AUTO_WRITE, "autoWrite" },
"noWrite", { writeOption::NO_WRITE, "noWrite" },
"anyWrite" { writeOption::ANY_WRITE, "anyWrite" },
}; };
const Foam::NamedEnum
<
Foam::functionObjects::writeObjects::writeOption,
3
> Foam::functionObjects::writeObjects::writeOptionNames_;
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -114,14 +107,12 @@ bool Foam::functionObjects::writeObjects::read(const dictionary& dict)
dict.lookup("objects") >> objectNames_; dict.lookup("objects") >> objectNames_;
} }
if (dict.found("writeOption")) writeOption_ = writeOptionNames_.lookupOrDefault
{ (
writeOption_ = writeOptionNames_.read(dict.lookup("writeOption")); "writeOption",
} dict,
else writeOption::ANY_WRITE
{ );
writeOption_ = ANY_WRITE;
}
return true; return true;
} }

View File

@ -84,8 +84,8 @@ SourceFiles
#define functionObjects_writeObjects_H #define functionObjects_writeObjects_H
#include "functionObject.H" #include "functionObject.H"
#include "wordReList.H" #include "wordRes.H"
#include "NamedEnum.H" #include "Enum.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -119,7 +119,7 @@ public:
ANY_WRITE ANY_WRITE
}; };
static const NamedEnum<writeOption, 3> writeOptionNames_; static const Enum<writeOption> writeOptionNames_;
private: private:
@ -138,10 +138,10 @@ private:
// Private Member Functions // Private Member Functions
//- Disallow default bitwise copy construct //- Disallow default bitwise copy construct
writeObjects(const writeObjects&); writeObjects(const writeObjects&) = delete;
//- Disallow default bitwise assignment //- Disallow default bitwise assignment
void operator=(const writeObjects&); void operator=(const writeObjects&) = delete;
public: public:

Some files were not shown because too many files have changed in this diff Show More