mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: upgrade from NamedEnum to Enum (issue #515)
This commit is contained in:
@ -27,21 +27,19 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
const Foam::Enum
|
||||
<
|
||||
Foam::faceAreaIntersect::triangulationMode
|
||||
>
|
||||
Foam::faceAreaIntersect::triangulationModeNames_
|
||||
{
|
||||
template<>
|
||||
const char* NamedEnum<faceAreaIntersect::triangulationMode, 2>::names[] =
|
||||
{
|
||||
"fan",
|
||||
"mesh"
|
||||
};
|
||||
}
|
||||
|
||||
const Foam::NamedEnum<Foam::faceAreaIntersect::triangulationMode, 2>
|
||||
Foam::faceAreaIntersect::triangulationModeNames_;
|
||||
{ triangulationMode::tmFan, "fan" },
|
||||
{ triangulationMode::tmMesh, "mesh" },
|
||||
};
|
||||
|
||||
Foam::scalar Foam::faceAreaIntersect::tol = 1e-6;
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
||||
|
||||
void Foam::faceAreaIntersect::triSliceWithPlane
|
||||
|
||||
@ -42,7 +42,7 @@ SourceFiles
|
||||
#include "plane.H"
|
||||
#include "face.H"
|
||||
#include "triPoints.H"
|
||||
#include "NamedEnum.H"
|
||||
#include "Enum.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -63,7 +63,7 @@ public:
|
||||
tmMesh
|
||||
};
|
||||
|
||||
static const NamedEnum<triangulationMode, 2> triangulationModeNames_;
|
||||
static const Enum<triangulationMode> triangulationModeNames_;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@ -40,57 +40,50 @@ License
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(extendedEdgeMesh, 0);
|
||||
|
||||
template<>
|
||||
const char* Foam::NamedEnum
|
||||
<
|
||||
Foam::extendedEdgeMesh::pointStatus,
|
||||
4
|
||||
>::names[] =
|
||||
{
|
||||
"convex",
|
||||
"concave",
|
||||
"mixed",
|
||||
"nonFeature"
|
||||
};
|
||||
|
||||
template<>
|
||||
const char* Foam::NamedEnum
|
||||
<
|
||||
Foam::extendedEdgeMesh::edgeStatus,
|
||||
6
|
||||
>::names[] =
|
||||
{
|
||||
"external",
|
||||
"internal",
|
||||
"flat",
|
||||
"open",
|
||||
"multiple",
|
||||
"none"
|
||||
};
|
||||
|
||||
template<>
|
||||
const char* Foam::NamedEnum
|
||||
<
|
||||
Foam::extendedEdgeMesh::sideVolumeType,
|
||||
4
|
||||
>::names[] =
|
||||
{
|
||||
"inside",
|
||||
"outside",
|
||||
"both",
|
||||
"neither"
|
||||
};
|
||||
}
|
||||
|
||||
const Foam::NamedEnum<Foam::extendedEdgeMesh::pointStatus, 4>
|
||||
Foam::extendedEdgeMesh::pointStatusNames_;
|
||||
|
||||
const Foam::NamedEnum<Foam::extendedEdgeMesh::edgeStatus, 6>
|
||||
Foam::extendedEdgeMesh::edgeStatusNames_;
|
||||
const Foam::Enum
|
||||
<
|
||||
Foam::extendedEdgeMesh::pointStatus
|
||||
>
|
||||
Foam::extendedEdgeMesh::pointStatusNames_
|
||||
{
|
||||
{ pointStatus::CONVEX, "convex" },
|
||||
{ pointStatus::CONCAVE, "concave" },
|
||||
{ pointStatus::MIXED, "mixed" },
|
||||
{ pointStatus::NONFEATURE, "nonFeature" },
|
||||
};
|
||||
|
||||
|
||||
const Foam::Enum
|
||||
<
|
||||
Foam::extendedEdgeMesh::edgeStatus
|
||||
>
|
||||
Foam::extendedEdgeMesh::edgeStatusNames_
|
||||
{
|
||||
{ edgeStatus::EXTERNAL, "external" },
|
||||
{ edgeStatus::INTERNAL, "internal" },
|
||||
{ edgeStatus::FLAT, "flat" },
|
||||
{ edgeStatus::OPEN, "open" },
|
||||
{ edgeStatus::MULTIPLE, "multiple" },
|
||||
{ edgeStatus::NONE, "none" },
|
||||
|
||||
};
|
||||
|
||||
|
||||
const Foam::Enum
|
||||
<
|
||||
Foam::extendedEdgeMesh::sideVolumeType
|
||||
>
|
||||
Foam::extendedEdgeMesh::sideVolumeTypeNames_
|
||||
{
|
||||
{ sideVolumeType::INSIDE, "inside" },
|
||||
{ sideVolumeType::OUTSIDE, "outside" },
|
||||
{ sideVolumeType::BOTH, "both" },
|
||||
{ sideVolumeType::NEITHER, "neither" },
|
||||
};
|
||||
|
||||
const Foam::NamedEnum<Foam::extendedEdgeMesh::sideVolumeType, 4>
|
||||
Foam::extendedEdgeMesh::sideVolumeTypeNames_;
|
||||
|
||||
Foam::scalar Foam::extendedEdgeMesh::cosNormalAngleTol_ =
|
||||
Foam::cos(degToRad(0.1));
|
||||
|
||||
@ -100,7 +100,7 @@ public:
|
||||
NONFEATURE //!< Not a feature point
|
||||
};
|
||||
|
||||
static const Foam::NamedEnum<pointStatus, 4> pointStatusNames_;
|
||||
static const Enum<pointStatus> pointStatusNames_;
|
||||
|
||||
enum edgeStatus
|
||||
{
|
||||
@ -112,7 +112,7 @@ public:
|
||||
NONE //!< Unclassified (consistency with surfaceFeatures)
|
||||
};
|
||||
|
||||
static const Foam::NamedEnum<edgeStatus, 6> edgeStatusNames_;
|
||||
static const Enum<edgeStatus> edgeStatusNames_;
|
||||
|
||||
//- Normals point to the outside
|
||||
enum sideVolumeType
|
||||
@ -123,7 +123,7 @@ public:
|
||||
NEITHER = 3 //!< not sure when this may be used
|
||||
};
|
||||
|
||||
static const Foam::NamedEnum<sideVolumeType, 4> sideVolumeTypeNames_;
|
||||
static const Enum<sideVolumeType> sideVolumeTypeNames_;
|
||||
|
||||
//- Angular closeness tolerance for treating normals as the same
|
||||
static scalar cosNormalAngleTol_;
|
||||
|
||||
@ -48,41 +48,34 @@ License
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(mappedPatchBase, 0);
|
||||
|
||||
template<>
|
||||
const char* Foam::NamedEnum
|
||||
<
|
||||
Foam::mappedPatchBase::sampleMode,
|
||||
6
|
||||
>::names[] =
|
||||
{
|
||||
"nearestCell",
|
||||
"nearestPatchFace",
|
||||
"nearestPatchFaceAMI",
|
||||
"nearestPatchPoint",
|
||||
"nearestFace",
|
||||
"nearestOnlyCell"
|
||||
};
|
||||
|
||||
template<>
|
||||
const char* Foam::NamedEnum
|
||||
<
|
||||
Foam::mappedPatchBase::offsetMode,
|
||||
3
|
||||
>::names[] =
|
||||
{
|
||||
"uniform",
|
||||
"nonuniform",
|
||||
"normal"
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
const Foam::NamedEnum<Foam::mappedPatchBase::sampleMode, 6>
|
||||
Foam::mappedPatchBase::sampleModeNames_;
|
||||
const Foam::Enum
|
||||
<
|
||||
Foam::mappedPatchBase::sampleMode
|
||||
>
|
||||
Foam::mappedPatchBase::sampleModeNames_
|
||||
{
|
||||
{ sampleMode::NEARESTCELL, "nearestCell" },
|
||||
{ sampleMode::NEARESTPATCHFACE, "nearestPatchFace" },
|
||||
{ sampleMode::NEARESTPATCHFACEAMI, "nearestPatchFaceAMI" },
|
||||
{ sampleMode::NEARESTPATCHPOINT, "nearestPatchPoint" },
|
||||
{ sampleMode::NEARESTFACE, "nearestFace" },
|
||||
{ sampleMode::NEARESTONLYCELL, "nearestOnlyCell" },
|
||||
};
|
||||
|
||||
const Foam::NamedEnum<Foam::mappedPatchBase::offsetMode, 3>
|
||||
Foam::mappedPatchBase::offsetModeNames_;
|
||||
|
||||
const Foam::Enum
|
||||
<
|
||||
Foam::mappedPatchBase::offsetMode
|
||||
>
|
||||
Foam::mappedPatchBase::offsetModeNames_
|
||||
{
|
||||
{ offsetMode::UNIFORM, "uniform" },
|
||||
{ offsetMode::NONUNIFORM, "nonuniform" },
|
||||
{ offsetMode::NORMAL, "normal" },
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
@ -1042,7 +1035,7 @@ Foam::mappedPatchBase::mappedPatchBase
|
||||
:
|
||||
patch_(pp),
|
||||
sampleRegion_(dict.lookupOrDefault<word>("sampleRegion", "")),
|
||||
mode_(sampleModeNames_.read(dict.lookup("sampleMode"))),
|
||||
mode_(sampleModeNames_.lookup("sampleMode", dict)),
|
||||
samplePatch_(dict.lookupOrDefault<word>("samplePatch", "")),
|
||||
coupleGroup_(dict),
|
||||
offsetMode_(UNIFORM),
|
||||
@ -1068,7 +1061,7 @@ Foam::mappedPatchBase::mappedPatchBase
|
||||
|
||||
if (dict.found("offsetMode"))
|
||||
{
|
||||
offsetMode_ = offsetModeNames_.read(dict.lookup("offsetMode"));
|
||||
offsetMode_ = offsetModeNames_.lookup("offsetMode", dict);
|
||||
|
||||
switch (offsetMode_)
|
||||
{
|
||||
@ -1387,17 +1380,14 @@ Foam::pointIndexHit Foam::mappedPatchBase::facePoint
|
||||
|
||||
void Foam::mappedPatchBase::write(Ostream& os) const
|
||||
{
|
||||
os.writeKeyword("sampleMode") << sampleModeNames_[mode_]
|
||||
<< token::END_STATEMENT << nl;
|
||||
os.writeEntry("sampleMode", sampleModeNames_[mode_]);
|
||||
if (!sampleRegion_.empty())
|
||||
{
|
||||
os.writeKeyword("sampleRegion") << sampleRegion_
|
||||
<< token::END_STATEMENT << nl;
|
||||
os.writeEntry("sampleRegion", sampleRegion_);
|
||||
}
|
||||
if (!samplePatch_.empty())
|
||||
{
|
||||
os.writeKeyword("samplePatch") << samplePatch_
|
||||
<< token::END_STATEMENT << nl;
|
||||
os.writeEntry("samplePatch", samplePatch_);
|
||||
}
|
||||
coupleGroup_.write(os);
|
||||
|
||||
@ -1412,15 +1402,13 @@ void Foam::mappedPatchBase::write(Ostream& os) const
|
||||
}
|
||||
else
|
||||
{
|
||||
os.writeKeyword("offsetMode") << offsetModeNames_[offsetMode_]
|
||||
<< token::END_STATEMENT << nl;
|
||||
os.writeEntry("offsetMode", offsetModeNames_[offsetMode_]);
|
||||
|
||||
switch (offsetMode_)
|
||||
{
|
||||
case UNIFORM:
|
||||
{
|
||||
os.writeKeyword("offset") << offset_ << token::END_STATEMENT
|
||||
<< nl;
|
||||
os.writeEntry("offset", offset_);
|
||||
break;
|
||||
}
|
||||
case NONUNIFORM:
|
||||
@ -1430,8 +1418,7 @@ void Foam::mappedPatchBase::write(Ostream& os) const
|
||||
}
|
||||
case NORMAL:
|
||||
{
|
||||
os.writeKeyword("distance") << distance_ << token::END_STATEMENT
|
||||
<< nl;
|
||||
os.writeEntry("distance", distance_);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1440,8 +1427,7 @@ void Foam::mappedPatchBase::write(Ostream& os) const
|
||||
{
|
||||
if (AMIReverse_)
|
||||
{
|
||||
os.writeKeyword("flipNormals") << AMIReverse_
|
||||
<< token::END_STATEMENT << nl;
|
||||
os.writeEntry("flipNormals", AMIReverse_);
|
||||
}
|
||||
|
||||
if (!surfDict_.empty())
|
||||
|
||||
@ -111,25 +111,25 @@ public:
|
||||
//- Mesh items to sample
|
||||
enum sampleMode
|
||||
{
|
||||
NEARESTCELL, // nearest cell containing sample
|
||||
NEARESTPATCHFACE, // nearest face on selected patch
|
||||
NEARESTPATCHFACEAMI, // nearest patch face + AMI interpolation
|
||||
NEARESTPATCHPOINT, // nearest point on selected patch
|
||||
NEARESTFACE, // nearest face
|
||||
NEARESTONLYCELL // nearest cell (even if not containing cell)
|
||||
NEARESTCELL, //!< nearest cell containing sample
|
||||
NEARESTPATCHFACE, //!< nearest face on selected patch
|
||||
NEARESTPATCHFACEAMI, //!< nearest patch face + AMI interpolation
|
||||
NEARESTPATCHPOINT, //!< nearest point on selected patch
|
||||
NEARESTFACE, //!< nearest face
|
||||
NEARESTONLYCELL //!< nearest cell (even if not containing cell)
|
||||
};
|
||||
|
||||
//- How to project face centres
|
||||
enum offsetMode
|
||||
{
|
||||
UNIFORM, // single offset vector
|
||||
NONUNIFORM, // per-face offset vector
|
||||
NORMAL // use face normal + distance
|
||||
UNIFORM, //!< single offset vector
|
||||
NONUNIFORM, //!< per-face offset vector
|
||||
NORMAL //!< use face normal + distance
|
||||
};
|
||||
|
||||
static const NamedEnum<sampleMode, 6> sampleModeNames_;
|
||||
static const Enum<sampleMode> sampleModeNames_;
|
||||
|
||||
static const NamedEnum<offsetMode, 3> offsetModeNames_;
|
||||
static const Enum<offsetMode> offsetModeNames_;
|
||||
|
||||
|
||||
//- Helper class for finding nearest
|
||||
|
||||
@ -36,19 +36,6 @@ namespace Foam
|
||||
defineTypeNameAndDebug(faceToCell, 0);
|
||||
addToRunTimeSelectionTable(topoSetSource, faceToCell, word);
|
||||
addToRunTimeSelectionTable(topoSetSource, faceToCell, istream);
|
||||
|
||||
template<>
|
||||
const char* Foam::NamedEnum
|
||||
<
|
||||
Foam::faceToCell::faceAction,
|
||||
4
|
||||
>::names[] =
|
||||
{
|
||||
"neighbour",
|
||||
"owner",
|
||||
"any",
|
||||
"all"
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -60,8 +47,17 @@ Foam::topoSetSource::addToUsageTable Foam::faceToCell::usage_
|
||||
" of the faces in the faceSet or where all faces are in the faceSet\n\n"
|
||||
);
|
||||
|
||||
const Foam::NamedEnum<Foam::faceToCell::faceAction, 4>
|
||||
Foam::faceToCell::faceActionNames_;
|
||||
const Foam::Enum
|
||||
<
|
||||
Foam::faceToCell::faceAction
|
||||
>
|
||||
Foam::faceToCell::faceActionNames_
|
||||
{
|
||||
{ faceAction::NEIGHBOUR, "neighbour" },
|
||||
{ faceAction::OWNER, "owner" },
|
||||
{ faceAction::ANY, "any" },
|
||||
{ faceAction::ALL, "all" },
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
@ -175,7 +171,7 @@ Foam::faceToCell::faceToCell
|
||||
:
|
||||
topoSetSource(mesh),
|
||||
setName_(dict.lookup("set")),
|
||||
option_(faceActionNames_.read(dict.lookup("option")))
|
||||
option_(faceActionNames_.lookup("option", dict))
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ SourceFiles
|
||||
#define faceToCell_H
|
||||
|
||||
#include "topoSetSource.H"
|
||||
#include "NamedEnum.H"
|
||||
#include "Enum.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -63,7 +63,7 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
static const NamedEnum<faceAction, 4> faceActionNames_;
|
||||
static const Enum<faceAction> faceActionNames_;
|
||||
|
||||
|
||||
//- Add usage string
|
||||
|
||||
@ -35,17 +35,6 @@ namespace Foam
|
||||
defineTypeNameAndDebug(faceZoneToCell, 0);
|
||||
addToRunTimeSelectionTable(topoSetSource, faceZoneToCell, word);
|
||||
addToRunTimeSelectionTable(topoSetSource, faceZoneToCell, istream);
|
||||
|
||||
template<>
|
||||
const char* Foam::NamedEnum
|
||||
<
|
||||
Foam::faceZoneToCell::faceAction,
|
||||
2
|
||||
>::names[] =
|
||||
{
|
||||
"master",
|
||||
"slave"
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -58,8 +47,15 @@ Foam::topoSetSource::addToUsageTable Foam::faceZoneToCell::usage_
|
||||
);
|
||||
|
||||
|
||||
const Foam::NamedEnum<Foam::faceZoneToCell::faceAction, 2>
|
||||
Foam::faceZoneToCell::faceActionNames_;
|
||||
const Foam::Enum
|
||||
<
|
||||
Foam::faceZoneToCell::faceAction
|
||||
>
|
||||
Foam::faceZoneToCell::faceActionNames_
|
||||
{
|
||||
{ faceAction::MASTER, "master" },
|
||||
{ faceAction::SLAVE, "slave" },
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
@ -132,7 +128,7 @@ Foam::faceZoneToCell::faceZoneToCell
|
||||
:
|
||||
topoSetSource(mesh),
|
||||
zoneName_(dict.lookup("name")),
|
||||
option_(faceActionNames_.read(dict.lookup("option")))
|
||||
option_(faceActionNames_.lookup("option", dict))
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -63,7 +63,7 @@ private:
|
||||
|
||||
// Private data
|
||||
|
||||
static const NamedEnum<faceAction, 2> faceActionNames_;
|
||||
static const Enum<faceAction> faceActionNames_;
|
||||
|
||||
//- Add usage string
|
||||
static addToUsageTable usage_;
|
||||
|
||||
@ -36,17 +36,6 @@ namespace Foam
|
||||
defineTypeNameAndDebug(pointToCell, 0);
|
||||
addToRunTimeSelectionTable(topoSetSource, pointToCell, word);
|
||||
addToRunTimeSelectionTable(topoSetSource, pointToCell, istream);
|
||||
|
||||
template<>
|
||||
const char* Foam::NamedEnum
|
||||
<
|
||||
Foam::pointToCell::pointAction,
|
||||
2
|
||||
>::names[] =
|
||||
{
|
||||
"any",
|
||||
"edge"
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -58,8 +47,15 @@ Foam::topoSetSource::addToUsageTable Foam::pointToCell::usage_
|
||||
" in the pointSet\n\n"
|
||||
);
|
||||
|
||||
const Foam::NamedEnum<Foam::pointToCell::pointAction, 2>
|
||||
Foam::pointToCell::pointActionNames_;
|
||||
const Foam::Enum
|
||||
<
|
||||
Foam::pointToCell::pointAction
|
||||
>
|
||||
Foam::pointToCell::pointActionNames_
|
||||
{
|
||||
{ pointAction::ANY, "any" },
|
||||
{ pointAction::EDGE, "edge" },
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
@ -132,7 +128,7 @@ Foam::pointToCell::pointToCell
|
||||
:
|
||||
topoSetSource(mesh),
|
||||
setName_(dict.lookup("set")),
|
||||
option_(pointActionNames_.read(dict.lookup("option")))
|
||||
option_(pointActionNames_.lookup("option", dict))
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ SourceFiles
|
||||
#define pointToCell_H
|
||||
|
||||
#include "topoSetSource.H"
|
||||
#include "NamedEnum.H"
|
||||
#include "Enum.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -65,7 +65,7 @@ private:
|
||||
//- Add usage string
|
||||
static addToUsageTable usage_;
|
||||
|
||||
static const NamedEnum<pointAction, 2> pointActionNames_;
|
||||
static const Enum<pointAction> pointActionNames_;
|
||||
|
||||
//- Name of set to use
|
||||
word setName_;
|
||||
|
||||
@ -37,17 +37,6 @@ namespace Foam
|
||||
defineTypeNameAndDebug(cellToFace, 0);
|
||||
addToRunTimeSelectionTable(topoSetSource, cellToFace, word);
|
||||
addToRunTimeSelectionTable(topoSetSource, cellToFace, istream);
|
||||
|
||||
template<>
|
||||
const char* Foam::NamedEnum
|
||||
<
|
||||
Foam::cellToFace::cellAction,
|
||||
2
|
||||
>::names[] =
|
||||
{
|
||||
"all",
|
||||
"both"
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -59,8 +48,15 @@ Foam::topoSetSource::addToUsageTable Foam::cellToFace::usage_
|
||||
" -both: faces where both neighbours are in the cellSet\n\n"
|
||||
);
|
||||
|
||||
const Foam::NamedEnum<Foam::cellToFace::cellAction, 2>
|
||||
Foam::cellToFace::cellActionNames_;
|
||||
const Foam::Enum
|
||||
<
|
||||
Foam::cellToFace::cellAction
|
||||
>
|
||||
Foam::cellToFace::cellActionNames_
|
||||
{
|
||||
{ cellAction::ALL, "all" },
|
||||
{ cellAction::BOTH, "both" },
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
@ -177,7 +173,7 @@ Foam::cellToFace::cellToFace
|
||||
:
|
||||
topoSetSource(mesh),
|
||||
setName_(dict.lookup("set")),
|
||||
option_(cellActionNames_.read(dict.lookup("option")))
|
||||
option_(cellActionNames_.lookup("option", dict))
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -40,7 +40,7 @@ SourceFiles
|
||||
#define cellToFace_H
|
||||
|
||||
#include "topoSetSource.H"
|
||||
#include "NamedEnum.H"
|
||||
#include "Enum.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -69,7 +69,7 @@ private:
|
||||
//- Add usage string
|
||||
static addToUsageTable usage_;
|
||||
|
||||
static const NamedEnum<cellAction, 2> cellActionNames_;
|
||||
static const Enum<cellAction> cellActionNames_;
|
||||
|
||||
//- Name of set to use
|
||||
word setName_;
|
||||
|
||||
@ -36,7 +36,6 @@ SourceFiles
|
||||
#define normalToFace_H
|
||||
|
||||
#include "topoSetSource.H"
|
||||
#include "NamedEnum.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -36,18 +36,6 @@ namespace Foam
|
||||
defineTypeNameAndDebug(pointToFace, 0);
|
||||
addToRunTimeSelectionTable(topoSetSource, pointToFace, word);
|
||||
addToRunTimeSelectionTable(topoSetSource, pointToFace, istream);
|
||||
|
||||
template<>
|
||||
const char* Foam::NamedEnum
|
||||
<
|
||||
Foam::pointToFace::pointAction,
|
||||
3
|
||||
>::names[] =
|
||||
{
|
||||
"any",
|
||||
"all",
|
||||
"edge"
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -61,8 +49,16 @@ Foam::topoSetSource::addToUsageTable Foam::pointToFace::usage_
|
||||
" -two consecutive points (an edge) in the pointSet\n\n"
|
||||
);
|
||||
|
||||
const Foam::NamedEnum<Foam::pointToFace::pointAction, 3>
|
||||
Foam::pointToFace::pointActionNames_;
|
||||
const Foam::Enum
|
||||
<
|
||||
Foam::pointToFace::pointAction
|
||||
>
|
||||
Foam::pointToFace::pointActionNames_
|
||||
{
|
||||
{ pointAction::ANY, "any" },
|
||||
{ pointAction::ALL, "all" },
|
||||
{ pointAction::EDGE, "edge" },
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
@ -173,7 +169,7 @@ Foam::pointToFace::pointToFace
|
||||
:
|
||||
topoSetSource(mesh),
|
||||
setName_(dict.lookup("set")),
|
||||
option_(pointActionNames_.read(dict.lookup("option")))
|
||||
option_(pointActionNames_.lookup("option", dict))
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ SourceFiles
|
||||
#define pointToFace_H
|
||||
|
||||
#include "topoSetSource.H"
|
||||
#include "NamedEnum.H"
|
||||
#include "Enum.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -68,7 +68,7 @@ private:
|
||||
//- Add usage string
|
||||
static addToUsageTable usage_;
|
||||
|
||||
static const NamedEnum<pointAction, 3> pointActionNames_;
|
||||
static const Enum<pointAction> pointActionNames_;
|
||||
|
||||
//- Name of set to use
|
||||
word setName_;
|
||||
|
||||
@ -36,16 +36,6 @@ namespace Foam
|
||||
defineTypeNameAndDebug(cellToPoint, 0);
|
||||
addToRunTimeSelectionTable(topoSetSource, cellToPoint, word);
|
||||
addToRunTimeSelectionTable(topoSetSource, cellToPoint, istream);
|
||||
|
||||
template<>
|
||||
const char* Foam::NamedEnum
|
||||
<
|
||||
Foam::cellToPoint::cellAction,
|
||||
1
|
||||
>::names[] =
|
||||
{
|
||||
"all"
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -56,8 +46,14 @@ Foam::topoSetSource::addToUsageTable Foam::cellToPoint::usage_
|
||||
" Select all points of cells in the cellSet\n\n"
|
||||
);
|
||||
|
||||
const Foam::NamedEnum<Foam::cellToPoint::cellAction, 1>
|
||||
Foam::cellToPoint::cellActionNames_;
|
||||
const Foam::Enum
|
||||
<
|
||||
Foam::cellToPoint::cellAction
|
||||
>
|
||||
Foam::cellToPoint::cellActionNames_
|
||||
{
|
||||
{ cellAction::ALL, "all" },
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
@ -111,7 +107,7 @@ Foam::cellToPoint::cellToPoint
|
||||
:
|
||||
topoSetSource(mesh),
|
||||
setName_(dict.lookup("set")),
|
||||
option_(cellActionNames_.read(dict.lookup("option")))
|
||||
option_(cellActionNames_.lookup("option", dict))
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ SourceFiles
|
||||
#define cellToPoint_H
|
||||
|
||||
#include "topoSetSource.H"
|
||||
#include "NamedEnum.H"
|
||||
#include "Enum.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -64,7 +64,7 @@ private:
|
||||
//- Add usage string
|
||||
static addToUsageTable usage_;
|
||||
|
||||
static const NamedEnum<cellAction, 1> cellActionNames_;
|
||||
static const Enum<cellAction> cellActionNames_;
|
||||
|
||||
//- Name of set to use
|
||||
word setName_;
|
||||
|
||||
@ -36,19 +36,8 @@ namespace Foam
|
||||
defineTypeNameAndDebug(faceToPoint, 0);
|
||||
addToRunTimeSelectionTable(topoSetSource, faceToPoint, word);
|
||||
addToRunTimeSelectionTable(topoSetSource, faceToPoint, istream);
|
||||
|
||||
template<>
|
||||
const char* Foam::NamedEnum
|
||||
<
|
||||
Foam::faceToPoint::faceAction,
|
||||
1
|
||||
>::names[] =
|
||||
{
|
||||
"all"
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Foam::topoSetSource::addToUsageTable Foam::faceToPoint::usage_
|
||||
(
|
||||
faceToPoint::typeName,
|
||||
@ -56,8 +45,14 @@ Foam::topoSetSource::addToUsageTable Foam::faceToPoint::usage_
|
||||
" Select all points of faces in the faceSet\n\n"
|
||||
);
|
||||
|
||||
const Foam::NamedEnum<Foam::faceToPoint::faceAction, 1>
|
||||
Foam::faceToPoint::faceActionNames_;
|
||||
const Foam::Enum
|
||||
<
|
||||
Foam::faceToPoint::faceAction
|
||||
>
|
||||
Foam::faceToPoint::faceActionNames_
|
||||
{
|
||||
{ faceAction::ALL, "all" },
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
@ -105,7 +100,7 @@ Foam::faceToPoint::faceToPoint
|
||||
:
|
||||
topoSetSource(mesh),
|
||||
setName_(dict.lookup("set")),
|
||||
option_(faceActionNames_.read(dict.lookup("option")))
|
||||
option_(faceActionNames_.lookup("option", dict))
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ SourceFiles
|
||||
#define faceToPoint_H
|
||||
|
||||
#include "topoSetSource.H"
|
||||
#include "NamedEnum.H"
|
||||
#include "Enum.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -64,7 +64,7 @@ private:
|
||||
//- Add usage string
|
||||
static addToUsageTable usage_;
|
||||
|
||||
static const NamedEnum<faceAction, 1> faceActionNames_;
|
||||
static const Enum<faceAction> faceActionNames_;
|
||||
|
||||
//- Name of set to use
|
||||
word setName_;
|
||||
|
||||
@ -34,31 +34,27 @@ namespace Foam
|
||||
defineTypeNameAndDebug(topoSetSource, 0);
|
||||
defineRunTimeSelectionTable(topoSetSource, word);
|
||||
defineRunTimeSelectionTable(topoSetSource, istream);
|
||||
|
||||
template<>
|
||||
const char* Foam::NamedEnum
|
||||
<
|
||||
Foam::topoSetSource::setAction,
|
||||
8
|
||||
>::names[] =
|
||||
{
|
||||
"clear",
|
||||
"new",
|
||||
"invert",
|
||||
"add",
|
||||
"delete",
|
||||
"subset",
|
||||
"list",
|
||||
"remove"
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Foam::HashTable<Foam::string>* Foam::topoSetSource::usageTablePtr_ = nullptr;
|
||||
|
||||
|
||||
const Foam::NamedEnum<Foam::topoSetSource::setAction, 8>
|
||||
Foam::topoSetSource::actionNames_;
|
||||
const Foam::Enum
|
||||
<
|
||||
Foam::topoSetSource::setAction
|
||||
>
|
||||
Foam::topoSetSource::actionNames_
|
||||
{
|
||||
{ setAction::CLEAR, "clear" },
|
||||
{ setAction::NEW, "new" },
|
||||
{ setAction::INVERT, "invert" },
|
||||
{ setAction::ADD, "add" },
|
||||
{ setAction::DELETE, "delete" },
|
||||
{ setAction::SUBSET, "subset" },
|
||||
{ setAction::LIST, "list" },
|
||||
{ setAction::REMOVE, "remove" },
|
||||
};
|
||||
|
||||
|
||||
const Foam::string Foam::topoSetSource::illegalSource_
|
||||
|
||||
@ -45,7 +45,7 @@ SourceFiles
|
||||
#include "typeInfo.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
#include "autoPtr.H"
|
||||
#include "NamedEnum.H"
|
||||
#include "Enum.H"
|
||||
#include "HashTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -132,7 +132,7 @@ protected:
|
||||
|
||||
private:
|
||||
|
||||
static const NamedEnum<setAction, 8> actionNames_;
|
||||
static const Enum<setAction> actionNames_;
|
||||
|
||||
static const string illegalSource_;
|
||||
|
||||
@ -140,10 +140,10 @@ private:
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
topoSetSource(const topoSetSource&);
|
||||
topoSetSource(const topoSetSource&) = delete;
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const topoSetSource&);
|
||||
void operator=(const topoSetSource&) = delete;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -36,23 +36,19 @@ License
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(booleanSurface, 0);
|
||||
|
||||
template<>
|
||||
const char* Foam::NamedEnum
|
||||
<
|
||||
Foam::booleanSurface::booleanOpType,
|
||||
4
|
||||
>::names[] =
|
||||
{
|
||||
"union",
|
||||
"intersection",
|
||||
"difference",
|
||||
"all"
|
||||
};
|
||||
}
|
||||
|
||||
const Foam::NamedEnum<Foam::booleanSurface::booleanOpType, 4>
|
||||
Foam::booleanSurface::booleanOpTypeNames;
|
||||
const Foam::Enum
|
||||
<
|
||||
Foam::booleanSurface::booleanOpType
|
||||
>
|
||||
Foam::booleanSurface::booleanOpTypeNames
|
||||
{
|
||||
{ booleanOpType::UNION, "union" },
|
||||
{ booleanOpType::INTERSECTION, "intersection" },
|
||||
{ booleanOpType::DIFFERENCE, "difference" },
|
||||
{ booleanOpType::ALL, "all" },
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
@ -172,7 +172,7 @@ public:
|
||||
|
||||
// Static data
|
||||
|
||||
static const NamedEnum<booleanOpType, 4> booleanOpTypeNames;
|
||||
static const Enum<booleanOpType> booleanOpTypeNames;
|
||||
|
||||
|
||||
|
||||
|
||||
@ -41,7 +41,10 @@ namespace Foam
|
||||
defineTypeNameAndDebug(surfaceIntersection, 0);
|
||||
}
|
||||
|
||||
const Foam::Enum<Foam::surfaceIntersection::intersectionType>
|
||||
const Foam::Enum
|
||||
<
|
||||
Foam::surfaceIntersection::intersectionType
|
||||
>
|
||||
Foam::surfaceIntersection::selfIntersectionNames
|
||||
{
|
||||
{ intersectionType::SELF, "self" },
|
||||
|
||||
@ -30,11 +30,17 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
const Foam::Enum<Foam::triSurfaceLoader::loadingOption>
|
||||
const Foam::Enum
|
||||
<
|
||||
Foam::triSurfaceLoader::loadingOption
|
||||
>
|
||||
Foam::triSurfaceLoader::loadingOptionNames
|
||||
(
|
||||
SINGLE_REGION, { "single", "file", "offset", "merge" }
|
||||
);
|
||||
{
|
||||
{ loadingOption::SINGLE_REGION, "single" },
|
||||
{ loadingOption::FILE_REGION, "file" },
|
||||
{ loadingOption::OFFSET_REGION, "offset" },
|
||||
{ loadingOption::MERGE_REGION, "merge" }
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Reference in New Issue
Block a user