Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
f55c568f
Commit
f55c568f
authored
Jul 03, 2017
by
Mark OLESEN
Browse files
ENH: upgrade from NamedEnum to Enum (issue
#515
)
parent
57507389
Changes
179
Hide whitespace changes
Inline
Side-by-side
applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C
View file @
f55c568f
...
...
@@ -43,26 +43,17 @@ using namespace Foam::constant::mathematical;
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template
<>
const
char
*
Foam
::
NamedEnum
const
Foam
::
Enum
<
Foam
::
compressible
::
alphatWallBoilingWallFunctionFvPatchScalarField
::
phaseType
,
2
>::
names
[]
=
{
"vapor"
,
"liquid"
};
const
Foam
::
NamedEnum
<
Foam
::
compressible
::
alphatWallBoilingWallFunctionFvPatchScalarField
::
phaseType
,
2
alphatWallBoilingWallFunctionFvPatchScalarField
::
phaseType
>
Foam
::
compressible
::
alphatWallBoilingWallFunctionFvPatchScalarField
::
phaseTypeNames_
;
alphatWallBoilingWallFunctionFvPatchScalarField
::
phaseTypeNames_
{
{
phaseType
::
vaporPhase
,
"vapor"
},
{
phaseType
::
liquidPhase
,
"liquid"
},
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
@@ -111,7 +102,7 @@ alphatWallBoilingWallFunctionFvPatchScalarField
)
:
alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField
(
p
,
iF
,
dict
),
phaseType_
(
phaseTypeNames_
.
read
(
dict
.
lookup
(
"phaseType"
)
)),
phaseType_
(
phaseTypeNames_
.
lookup
(
"phaseType"
,
dict
)),
relax_
(
dict
.
lookupOrDefault
<
scalar
>
(
"relax"
,
0
.
5
)),
AbyV_
(
p
.
size
(),
0
),
alphatConv_
(
p
.
size
(),
0
),
...
...
applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.H
View file @
f55c568f
...
...
@@ -164,7 +164,7 @@ private:
// Private data
//- Heat source type names
static
const
Named
Enum
<
phaseType
,
2
>
phaseTypeNames_
;
static
const
Enum
<
phaseType
>
phaseTypeNames_
;
//- Heat source type
phaseType
phaseType_
;
...
...
applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C
View file @
f55c568f
...
...
@@ -69,18 +69,12 @@ enum ExtrudeMode
SURFACE
};
namespace
Foam
static
const
Enum
<
ExtrudeMode
>
ExtrudeModeNames
{
template
<>
const
char
*
NamedEnum
<
ExtrudeMode
,
3
>::
names
[]
=
{
"mesh"
,
"patch"
,
"surface"
};
}
static
const
NamedEnum
<
ExtrudeMode
,
3
>
ExtrudeModeNames
;
{
ExtrudeMode
::
MESH
,
"mesh"
},
{
ExtrudeMode
::
PATCH
,
"patch"
},
{
ExtrudeMode
::
SURFACE
,
"surface"
},
};
void
createDummyFvMeshFiles
(
const
polyMesh
&
mesh
,
const
word
&
regionName
)
...
...
@@ -305,9 +299,10 @@ int main(int argc, char *argv[])
const
Switch
flipNormals
(
dict
.
lookup
(
"flipNormals"
));
// What to extrude
const
ExtrudeMode
mode
=
ExtrudeModeNames
.
read
const
ExtrudeMode
mode
=
ExtrudeModeNames
.
lookup
(
dict
.
lookup
(
"constructFrom"
)
"constructFrom"
,
dict
);
// Any merging of small edges
...
...
applications/utilities/mesh/generation/extrude2DMesh/extrude2DMeshApp.C
View file @
f55c568f
...
...
@@ -60,17 +60,11 @@ enum ExtrudeMode
MESHEDSURFACE
};
namespace
Foam
static
const
Enum
<
ExtrudeMode
>
ExtrudeModeNames
{
template
<>
const
char
*
NamedEnum
<
ExtrudeMode
,
2
>::
names
[]
=
{
"polyMesh2D"
,
"MeshedSurface"
};
}
static
const
NamedEnum
<
ExtrudeMode
,
2
>
ExtrudeModeNames
;
{
ExtrudeMode
::
POLYMESH2D
,
"polyMesh2D"
},
{
ExtrudeMode
::
MESHEDSURFACE
,
"MeshedSurface"
},
};
//pointField moveInitialPoints
...
...
applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C
View file @
f55c568f
...
...
@@ -42,24 +42,20 @@ License
namespace
Foam
{
defineTypeNameAndDebug
(
conformalVoronoiMesh
,
0
);
template
<>
const
char
*
NamedEnum
<
conformalVoronoiMesh
::
dualMeshPointType
,
5
>::
names
[]
=
{
"internal"
,
"surface"
,
"featureEdge"
,
"featurePoint"
,
"constrained"
};
}
const
Foam
::
NamedEnum
<
Foam
::
conformalVoronoiMesh
::
dualMeshPointType
,
5
>
Foam
::
conformalVoronoiMesh
::
dualMeshPointTypeNames_
;
const
Foam
::
Enum
<
Foam
::
conformalVoronoiMesh
::
dualMeshPointType
>
Foam
::
conformalVoronoiMesh
::
dualMeshPointTypeNames_
{
{
dualMeshPointType
::
internal
,
"internal"
},
{
dualMeshPointType
::
surface
,
"surface"
},
{
dualMeshPointType
::
featureEdge
,
"featureEdge"
},
{
dualMeshPointType
::
featurePoint
,
"featurePoint"
},
{
dualMeshPointType
::
constrained
,
"constrained"
},
};
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
...
...
applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.H
View file @
f55c568f
...
...
@@ -122,7 +122,7 @@ public:
constrained
=
4
};
static
const
Named
Enum
<
dualMeshPointType
,
5
>
dualMeshPointTypeNames_
;
static
const
Enum
<
dualMeshPointType
>
dualMeshPointTypeNames_
;
private:
...
...
applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedCell/indexedCellEnum.C
View file @
f55c568f
...
...
@@ -27,20 +27,19 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template
<>
const
char
*
Foam
::
NamedEnum
<
Foam
::
indexedCellEnum
::
cellTypes
,
6
>::
names
[]
=
const
Foam
::
Enum
<
Foam
::
indexedCellEnum
::
cellTypes
>
Foam
::
indexedCellEnum
::
cellTypesNames_
{
"Unassigned"
,
"Internal"
,
"Surface"
,
"FeatureEdge"
,
"Feature
Point"
,
"Far"
{
cellTypes
::
ctUnassigned
,
"Unassigned"
}
,
{
cellTypes
::
ctFar
,
"Far"
}
,
{
cellTypes
::
ctInternal
,
"Internal"
}
,
{
cellTypes
::
ctSurface
,
"Surface"
}
,
{
cellTypes
::
ctFeatureEdge
,
"Feature
Edge"
}
,
{
cellTypes
::
ctFeaturePoint
,
"FeaturePoint"
},
};
const
Foam
::
NamedEnum
<
Foam
::
indexedCellEnum
::
cellTypes
,
6
>
cellTypesNames_
;
// ************************************************************************* //
applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedCell/indexedCellEnum.H
View file @
f55c568f
...
...
@@ -34,7 +34,7 @@ SourceFiles
#ifndef indexedCellEnum_H
#define indexedCellEnum_H
#include
"
Named
Enum.H"
#include
"Enum.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
@@ -47,7 +47,6 @@ class indexedCellEnum
{
public:
enum
cellTypes
{
ctUnassigned
=
INT_MIN
,
...
...
@@ -58,7 +57,7 @@ public:
ctFeaturePoint
=
INT_MIN
+
5
};
static
const
Foam
::
Named
Enum
<
cellTypes
,
6
>
cellTypesNames_
;
static
const
Enum
<
cellTypes
>
cellTypesNames_
;
};
...
...
applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertexEnum.C
View file @
f55c568f
...
...
@@ -28,42 +28,42 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template
<>
const
char
*
Foam
::
NamedEnum
<
Foam
::
indexedVertexEnum
::
vertexType
,
15
>::
names
[]
=
const
Foam
::
Enum
<
Foam
::
indexedVertexEnum
::
vertexType
>
Foam
::
indexedVertexEnum
::
vertexTypeNames_
{
"Unassigned"
,
"Internal"
,
"InternalNearBoundary"
,
"InternalSurface"
,
"InternalSurfaceBaffle"
,
"ExternalSurfaceBaffle"
,
"InternalFeatureEdge"
,
"InternalFeatureEdgeBaffle"
,
"ExternalFeatureEdgeBaffle"
,
"InternalFeaturePoint"
,
"ExternalSurface"
,
"ExternalFeatureEdge"
,
"ExternalFeaturePoint"
,
"Far"
,
"Constrained"
{
vertexType
::
vtUnassigned
,
"Unassigned"
}
,
{
vertexType
::
vtInternal
,
"Internal"
}
,
{
vertexType
::
vtInternalNearBoundary
,
"InternalNearBoundary"
}
,
{
vertexType
::
vtInternalSurface
,
"InternalSurface"
}
,
{
vertexType
::
vtInternalSurfaceBaffle
,
"InternalSurfaceBaffle"
}
,
{
vertexType
::
vtExternalSurfaceBaffle
,
"ExternalSurfaceBaffle"
}
,
{
vertexType
::
vtInternalFeatureEdge
,
"InternalFeatureEdge"
}
,
{
vertexType
::
vtInternalFeatureEdgeBaffle
,
"InternalFeatureEdgeBaffle"
}
,
{
vertexType
::
vtExternalFeatureEdgeBaffle
,
"ExternalFeatureEdgeBaffle"
}
,
{
vertexType
::
vtInternalFeaturePoint
,
"InternalFeaturePoint"
}
,
{
vertexType
::
vtExternalSurface
,
"ExternalSurface"
}
,
{
vertexType
::
vtExternalFeatureEdge
,
"ExternalFeatureEdge"
}
,
{
vertexType
::
vtExternalFeaturePoint
,
"ExternalFeaturePoint"
}
,
{
vertexType
::
vtFar
,
"Far"
}
,
{
vertexType
::
vtConstrained
,
"Constrained"
},
};
const
Foam
::
NamedEnum
<
Foam
::
indexedVertexEnum
::
vertexType
,
15
>
Foam
::
indexedVertexEnum
::
vertexTypeNames_
;
template
<>
const
char
*
Foam
::
NamedEnum
<
Foam
::
indexedVertexEnum
::
vertexMotion
,
2
>::
names
[]
=
const
Foam
::
Enum
<
Foam
::
indexedVertexEnum
::
vertexMotion
>
Foam
::
indexedVertexEnum
::
vertexMotionNames_
{
"fixed"
,
"movable"
{
vertexMotion
::
fixed
,
"fixed"
}
,
{
vertexMotion
::
movable
,
"movable"
},
};
const
Foam
::
NamedEnum
<
Foam
::
indexedVertexEnum
::
vertexMotion
,
2
>
vertexMotionNames_
;
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
Foam
::
Ostream
&
Foam
::
operator
<<
(
...
...
applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertexEnum.H
View file @
f55c568f
...
...
@@ -34,7 +34,7 @@ SourceFiles
#ifndef indexedVertexEnum_H
#define indexedVertexEnum_H
#include
"
Named
Enum.H"
#include
"Enum.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
@@ -72,9 +72,9 @@ public:
movable
=
1
};
static
const
Foam
::
Named
Enum
<
vertexType
,
15
>
vertexTypeNames_
;
static
const
Enum
<
vertexType
>
vertexTypeNames_
;
static
const
Foam
::
Named
Enum
<
vertexMotion
,
2
>
vertexMotionNames_
;
static
const
Enum
<
vertexMotion
>
vertexMotionNames_
;
friend
Ostream
&
operator
<<
(
Foam
::
Ostream
&
,
const
vertexType
&
);
...
...
applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C
View file @
f55c568f
...
...
@@ -848,7 +848,7 @@ int main(int argc, char *argv[])
(
meshRefinement
::
readFlags
(
meshRefinement
::
IO
debugTypeNames
,
meshRefinement
::
debugTypeNames
,
flags
)
);
...
...
@@ -873,7 +873,7 @@ int main(int argc, char *argv[])
(
meshRefinement
::
readFlags
(
meshRefinement
::
IO
writeTypeNames
,
meshRefinement
::
writeTypeNames
,
flags
)
)
...
...
@@ -892,7 +892,7 @@ int main(int argc, char *argv[])
(
meshRefinement
::
readFlags
(
meshRefinement
::
IO
outputTypeNames
,
meshRefinement
::
outputTypeNames
,
flags
)
)
...
...
applications/utilities/postProcessing/miscellaneous/postChannel/channelIndex.C
View file @
f55c568f
...
...
@@ -33,23 +33,14 @@ License
// * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * //
namespace
Foam
{
template
<>
const
char
*
Foam
::
NamedEnum
<
Foam
::
vector
::
components
,
3
>::
names
[]
=
{
"x"
,
"y"
,
"z"
};
}
const
Foam
::
NamedEnum
<
Foam
::
vector
::
components
,
3
>
Foam
::
channelIndex
::
vectorComponentsNames_
;
const
Foam
::
Enum
<
Foam
::
vector
::
components
>
Foam
::
channelIndex
::
vectorComponentsNames_
(
Foam
::
vector
::
components
::
X
,
{
"x"
,
"y"
,
"z"
}
);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
...
...
@@ -233,7 +224,7 @@ Foam::channelIndex::channelIndex
)
:
symmetric_
(
readBool
(
dict
.
lookup
(
"symmetric"
))),
dir_
(
vectorComponentsNames_
.
read
(
dict
.
lookup
(
"component"
)
))
dir_
(
vectorComponentsNames_
.
lookup
(
"component"
,
dict
))
{
const
polyBoundaryMesh
&
patches
=
mesh
.
boundaryMesh
();
...
...
applications/utilities/postProcessing/miscellaneous/postChannel/channelIndex.H
View file @
f55c568f
...
...
@@ -55,7 +55,7 @@ class channelIndex
// Private data
static
const
Named
Enum
<
vector
::
components
,
3
>
vectorComponentsNames_
;
static
const
Enum
<
vector
::
components
>
vectorComponentsNames_
;
//- Is mesh symmetric
const
bool
symmetric_
;
...
...
applications/utilities/preProcessing/createZeroDirectory/solverTemplate.C
View file @
f55c568f
...
...
@@ -29,24 +29,19 @@ License
#include
"polyMesh.H"
#include
"regionProperties.H"
using
namespace
Foam
;
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace
Foam
const
Foam
::
Enum
<
Foam
::
solverTemplate
::
solverType
>
Foam
::
solverTemplate
::
solverTypeNames_
{
template
<>
const
char
*
Foam
::
NamedEnum
<
Foam
::
solverTemplate
::
solverType
,
4
>::
names
[]
=
{
"compressible"
,
"incompressible"
,
"buoyant"
,
"unknown"
};
}
const
Foam
::
NamedEnum
<
Foam
::
solverTemplate
::
solverType
,
4
>
Foam
::
solverTemplate
::
solverTypeNames_
;
{
solverType
::
stCompressible
,
"compressible"
},
{
solverType
::
stIncompressible
,
"incompressible"
},
{
solverType
::
stBuoyant
,
"buoyant"
},
{
solverType
::
stUnknown
,
"unknown"
},
};
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
...
...
@@ -261,7 +256,7 @@ Foam::solverTemplate::solverTemplate
Info
<<
"Selecting "
<<
solverName
<<
": "
;
solverType_
=
solverTypeNames_
.
read
(
solverDict
.
lookup
(
"solverType"
)
);
solverType_
=
solverTypeNames_
.
lookup
(
"solverType"
,
solverDict
);
Info
<<
solverTypeNames_
[
solverType_
];
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
();
}
...
...
applications/utilities/preProcessing/createZeroDirectory/solverTemplate.H
View file @
f55c568f
...
...
@@ -36,7 +36,7 @@ Description
#include
"wordList.H"
#include
"dimensionSet.H"
#include
"IOobject.H"
#include
"
Named
Enum.H"
#include
"Enum.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
@@ -65,7 +65,7 @@ public:
};
//- Solver type names
static
const
Named
Enum
<
solverType
,
4
>
solverTypeNames_
;
static
const
Enum
<
solverType
>
solverTypeNames_
;
private:
...
...
applications/utilities/preProcessing/setAlphaField/setAlphaField.C
View file @
f55c568f
...
...
@@ -59,7 +59,12 @@ class shapeSelector
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
::
SPHERE
,
"sphere"
},
...
...
applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/general/general.C
View file @
f55c568f
...
...
@@ -41,22 +41,16 @@ namespace Foam
dictionary
);
}
template
<>
const
char
*
Foam
::
NamedEnum
<
Foam
::
tabulatedWallFunctions
::
general
::
interpolationType
,
1
>::
names
[]
=
{
"linear"
};
}
const
Foam
::
NamedEnum
<
Foam
::
tabulatedWallFunctions
::
general
::
interpolationType
,
1
>
Foam
::
tabulatedWallFunctions
::
general
::
interpolationTypeNames_
;
const
Foam
::
Enum
<
Foam
::
tabulatedWallFunctions
::
general
::
interpolationType
>
Foam
::
tabulatedWallFunctions
::
general
::
interpolationTypeNames_
{
{
interpolationType
::
itLinear
,
"linear"
},
};
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
...
...
@@ -138,7 +132,7 @@ Foam::tabulatedWallFunctions::general::general
)
:
tabulatedWallFunction
(
dict
,
mesh
,
typeName
),
interpType_
(
interpolationTypeNames_
[
coeffDict_
.
lookup
(
"interpType"
)
]
),
interpType_
(
interpolationTypeNames_
.
lookup
(
"interpType"
,
coeffDict_
)),
yPlus_
(),
uPlus_
(),
log10YPlus_
(
coeffDict_
.
lookup
(
"log10YPlus"
)),
...
...
applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/general/general.H
View file @
f55c568f
...
...
@@ -63,7 +63,7 @@ SourceFiles
#define general_H
#include
"tabulatedWallFunction.H"
#include
"
Named
Enum.H"
#include
"Enum.H"
#include
"Switch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
@@ -91,7 +91,7 @@ public:
itLinear
};
static
const
Named
Enum
<
interpolationType
,
1
>
interpolationTypeNames_
;
static
const
Enum
<
interpolationType
>
interpolationTypeNames_
;
protected:
...
...
src/OSspecific/POSIX/fileMonitor.C
View file @
f55c568f
...
...
@@ -45,25 +45,22 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
const
Foam
::
NamedEnum
<
Foam
::
fileMonitor
::
fileState
,
3
>
Foam
::
fileMonitor
::
fileStateNames_
;
const
Foam
::
Enum
<
Foam
::
fileMonitor
::
fileState
>
Foam
::
fileMonitor
::
fileStateNames_
{
{
fileState
::
UNMODIFIED
,
"unmodified"
},
{
fileState
::
MODIFIED
,
"modified"
},
{
fileState
::
DELETED
,
"deleted"
},
};
namespace
Foam
{
defineTypeNameAndDebug
(
fileMonitor
,
0
);
template
<>
const
char
*
Foam
::
NamedEnum
<
Foam
::
fileMonitor
::
fileState
,
3
>::
names
[]
=