Commit 95219e6f authored by Mark Olesen's avatar Mark Olesen
Browse files

COMP: specialization Foam::NamedEnum templates within namespace Foam

- otherwise gets flagged as an error by clang
parent 05fe5f2f
......@@ -49,19 +49,19 @@ Class
defineTypeNameAndDebug(Foam::fileMonitor, 0);
template<>
const char* Foam::NamedEnum<Foam::fileMonitor::fileState, 3>::names[] =
{
"unmodified",
"modified",
"deleted"
};
const Foam::NamedEnum<Foam::fileMonitor::fileState, 3>
Foam::fileMonitor::fileStateNames_;
namespace Foam
{
template<>
const char* Foam::NamedEnum<Foam::fileMonitor::fileState, 3>::names[] =
{
"unmodified",
"modified",
"deleted"
};
//- Reduction operator for PackedList of fileState
class reduceFileStates
{
......
......@@ -32,13 +32,17 @@ License
defineTypeNameAndDebug(Foam::UPstream, 0);
template<>
const char* Foam::NamedEnum<Foam::UPstream::commsTypes, 3>::names[] =
namespace Foam
{
"blocking",
"scheduled",
"nonBlocking"
};
template<>
const char* Foam::NamedEnum<Foam::UPstream::commsTypes, 3>::names[] =
{
"blocking",
"scheduled",
"nonBlocking"
};
}
const Foam::NamedEnum<Foam::UPstream::commsTypes, 3>
Foam::UPstream::commsTypeNames;
......
......@@ -32,28 +32,31 @@ License
defineTypeNameAndDebug(Foam::Time, 0);
template<>
const char* Foam::NamedEnum<Foam::Time::stopAtControls, 4>::names[] =
namespace Foam
{
"endTime",
"noWriteNow",
"writeNow",
"nextWrite"
};
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>
Foam::Time::stopAtControlNames_;
template<>
const char* Foam::NamedEnum<Foam::Time::writeControls, 5>::names[] =
{
"timeStep",
"runTime",
"adjustableRunTime",
"clockTime",
"cpuTime"
};
const Foam::NamedEnum<Foam::Time::writeControls, 5>
Foam::Time::writeControlNames_;
......
......@@ -27,16 +27,19 @@ License
// * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * //
template<>
const char* Foam::NamedEnum
<
Foam::outputFilterOutputControl::outputControls,
2
>::names[] =
namespace Foam
{
"timeStep",
"outputTime"
};
template<>
const char* Foam::NamedEnum
<
Foam::outputFilterOutputControl::outputControls,
2
>::names[] =
{
"timeStep",
"outputTime"
};
}
const Foam::NamedEnum<Foam::outputFilterOutputControl::outputControls, 2>
Foam::outputFilterOutputControl::outputControlNames_;
......
......@@ -44,16 +44,20 @@ namespace Foam
addToRunTimeSelectionTable(polyPatch, cyclicPolyPatch, word);
addToRunTimeSelectionTable(polyPatch, cyclicPolyPatch, dictionary);
}
template<>
const char* Foam::NamedEnum<Foam::cyclicPolyPatch::transformType, 4>::names[] =
{
"unknown",
"rotational",
"translational",
"noOrdering"
};
template<>
const char* Foam::NamedEnum
<
Foam::cyclicPolyPatch::transformType,
4
>::names[] =
{
"unknown",
"rotational",
"translational",
"noOrdering"
};
}
const Foam::NamedEnum<Foam::cyclicPolyPatch::transformType, 4>
Foam::cyclicPolyPatch::transformTypeNames;
......
......@@ -29,27 +29,29 @@ License
Foam::scalar Foam::intersection::planarTol_ = 0.2;
template<>
const char* Foam::NamedEnum<Foam::intersection::direction, 2>::names[] =
namespace Foam
{
"vector",
"contactSphere"
};
template<>
const char* Foam::NamedEnum<Foam::intersection::direction, 2>::names[] =
{
"vector",
"contactSphere"
};
template<>
const char* Foam::NamedEnum<Foam::intersection::algorithm, 3>::names[] =
{
"fullRay",
"halfRay",
"visible"
};
}
const Foam::NamedEnum<Foam::intersection::direction, 2>
Foam::intersection::directionNames_;
template<>
const char* Foam::NamedEnum<Foam::intersection::algorithm, 3>::names[] =
{
"fullRay",
"halfRay",
"visible"
};
const Foam::NamedEnum<Foam::intersection::algorithm, 3>
Foam::intersection::algorithmNames_;
// ************************************************************************* //
......@@ -35,19 +35,21 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template<>
const char* Foam::NamedEnum<Foam::directions::directionType, 3>::names[] =
namespace Foam
{
"tan1",
"tan2",
"normal"
};
template<>
const char* Foam::NamedEnum<Foam::directions::directionType, 3>::names[] =
{
"tan1",
"tan2",
"normal"
};
}
const Foam::NamedEnum<Foam::directions::directionType, 3>
Foam::directions::directionTypeNames_;
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// For debugging
......
......@@ -45,15 +45,18 @@ namespace Foam
slidingInterface,
dictionary
);
}
template<>
const char* Foam::NamedEnum<Foam::slidingInterface::typeOfMatch, 2>::names[] =
{
"integral",
"partial"
};
template<>
const char* Foam::NamedEnum
<
Foam::slidingInterface::typeOfMatch,
2
>::names[] =
{
"integral",
"partial"
};
}
const Foam::NamedEnum<Foam::slidingInterface::typeOfMatch, 2>
......
......@@ -27,15 +27,17 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template<>
const char* Foam::NamedEnum<Foam::phaseProperties::phaseType, 4>::names[] =
namespace Foam
{
"gas",
"liquid",
"solid",
"unknown"
};
template<>
const char* Foam::NamedEnum<Foam::phaseProperties::phaseType, 4>::names[] =
{
"gas",
"liquid",
"solid",
"unknown"
};
}
const Foam::NamedEnum<Foam::phaseProperties::phaseType, 4>
Foam::phaseProperties::phaseTypeNames_;
......
......@@ -34,15 +34,19 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template<>
const char*
Foam::NamedEnum<Foam::refinementSurfaces::areaSelectionAlgo, 4>::names[] =
namespace Foam
{
"inside",
"outside",
"insidePoint",
"none"
};
template<>
const char*
Foam::NamedEnum<Foam::refinementSurfaces::areaSelectionAlgo, 4>::names[] =
{
"inside",
"outside",
"insidePoint",
"none"
};
}
const Foam::NamedEnum<Foam::refinementSurfaces::areaSelectionAlgo, 4>
Foam::refinementSurfaces::areaSelectionAlgoNames;
......@@ -388,7 +392,7 @@ Foam::labelList Foam::refinementSurfaces::getClosedNamedSurfaces() const
}
// Get indices of named surfaces with a
// Get indices of named surfaces with a
Foam::labelList Foam::refinementSurfaces::getInsidePointNamedSurfaces() const
{
labelList closed(cellZoneNames_.size());
......@@ -411,9 +415,9 @@ Foam::labelList Foam::refinementSurfaces::getInsidePointNamedSurfaces() const
// Foam::labelList Foam::refinementSurfaces::countRegions(const triSurface& s)
// {
// const geometricSurfacePatchList& regions = s.patches();
//
//
// labelList nTris(regions.size(), 0);
//
//
// forAll(s, triI)
// {
// nTris[s[triI].region()]++;
......@@ -433,15 +437,15 @@ Foam::labelList Foam::refinementSurfaces::getInsidePointNamedSurfaces() const
// ) const
// {
// const searchableSurface& geom = allGeometry_[surfaces_[surfI]];
//
//
// // Get per element the region
// labelList region;
// geom.getRegion(info, region);
//
//
// // Initialise fields to region wise minLevel
// minLevelField.setSize(ctrs.size());
// minLevelField = -1;
//
//
// forAll(minLevelField, i)
// {
// if (info[i].hit())
......@@ -449,12 +453,12 @@ Foam::labelList Foam::refinementSurfaces::getInsidePointNamedSurfaces() const
// minLevelField[i] = minLevel(surfI, region[i]);
// }
// }
//
//
// // Find out if triangle inside shell with higher level
// // What level does shell want to refine fc to?
// labelList shellLevel;
// shells.findHigherLevel(ctrs, minLevelField, shellLevel);
//
//
// forAll(minLevelField, i)
// {
// minLevelField[i] = max(minLevelField[i], shellLevel[i]);
......
......@@ -33,13 +33,18 @@ License
namespace Foam
{
defineTypeNameAndDebug(faceToCell, 0);
addToRunTimeSelectionTable(topoSetSource, faceToCell, word);
addToRunTimeSelectionTable(topoSetSource, faceToCell, istream);
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"
};
}
......@@ -51,15 +56,6 @@ Foam::topoSetSource::addToUsageTable Foam::faceToCell::usage_
" of the faces in the faceSet or where all faces are in the faceSet\n\n"
);
template<>
const char* Foam::NamedEnum<Foam::faceToCell::faceAction, 4>::names[] =
{
"neighbour",
"owner",
"any",
"all"
};
const Foam::NamedEnum<Foam::faceToCell::faceAction, 4>
Foam::faceToCell::faceActionNames_;
......
......@@ -32,13 +32,16 @@ License
namespace Foam
{
defineTypeNameAndDebug(faceZoneToCell, 0);
addToRunTimeSelectionTable(topoSetSource, faceZoneToCell, word);
addToRunTimeSelectionTable(topoSetSource, faceZoneToCell, istream);
defineTypeNameAndDebug(faceZoneToCell, 0);
addToRunTimeSelectionTable(topoSetSource, faceZoneToCell, word);
addToRunTimeSelectionTable(topoSetSource, faceZoneToCell, istream);
template<>
const char* Foam::NamedEnum<Foam::faceZoneToCell::faceAction, 2>::names[] =
{
"master",
"slave"
};
}
......@@ -51,14 +54,6 @@ Foam::topoSetSource::addToUsageTable Foam::faceZoneToCell::usage_
);
template<>
const char* Foam::NamedEnum<Foam::faceZoneToCell::faceAction, 2>::names[] =
{
"master",
"slave"
};
const Foam::NamedEnum<Foam::faceZoneToCell::faceAction, 2>
Foam::faceZoneToCell::faceActionNames_;
......
......@@ -33,13 +33,15 @@ License
namespace Foam
{
defineTypeNameAndDebug(pointToCell, 0);
addToRunTimeSelectionTable(topoSetSource, pointToCell, word);
addToRunTimeSelectionTable(topoSetSource, pointToCell, istream);
defineTypeNameAndDebug(pointToCell, 0);
addToRunTimeSelectionTable(topoSetSource, pointToCell, word);
addToRunTimeSelectionTable(topoSetSource, pointToCell, istream);
template<>
const char* Foam::NamedEnum<Foam::pointToCell::pointAction, 1>::names[] =
{
"any"
};
}
......@@ -50,13 +52,6 @@ Foam::topoSetSource::addToUsageTable Foam::pointToCell::usage_
" Select all cells with any point in the pointSet\n\n"
);
template<>
const char* Foam::NamedEnum<Foam::pointToCell::pointAction, 1>::names[] =
{
"any"
};
const Foam::NamedEnum<Foam::pointToCell::pointAction, 1>
Foam::pointToCell::pointActionNames_;
......
......@@ -34,13 +34,16 @@ License
namespace Foam
{
defineTypeNameAndDebug(cellToFace, 0);
addToRunTimeSelectionTable(topoSetSource, cellToFace, word);
addToRunTimeSelectionTable(topoSetSource, cellToFace, istream);
defineTypeNameAndDebug(cellToFace, 0);
addToRunTimeSelectionTable(topoSetSource, cellToFace, word);
addToRunTimeSelectionTable(topoSetSource, cellToFace, istream);
template<>
const char* Foam::NamedEnum<Foam::cellToFace::cellAction, 2>::names[] =
{
"all",
"both"
};
}
......@@ -52,13 +55,6 @@ Foam::topoSetSource::addToUsageTable Foam::cellToFace::usage_
" -both: faces where both neighbours are in the cellSet\n\n"
);
template<>
const char* Foam::NamedEnum<Foam::cellToFace::cellAction, 2>::names[] =
{
"all",
"both"
};
const Foam::NamedEnum<Foam::cellToFace::cellAction, 2>
Foam::cellToFace::cellActionNames_;
......
......@@ -33,13 +33,16 @@ License
namespace Foam
{
defineTypeNameAndDebug(pointToFace, 0);
addToRunTimeSelectionTable(topoSetSource, pointToFace, word);
addToRunTimeSelectionTable(topoSetSource, pointToFace, istream);
defineTypeNameAndDebug(pointToFace, 0);
addToRunTimeSelectionTable(topoSetSource, pointToFace, word);
addToRunTimeSelectionTable(topoSetSource, pointToFace, istream);
template<>
const char* Foam::NamedEnum<Foam::pointToFace::pointAction, 2>::names[] =
{
"any",
"all"
};
}
......@@ -52,13 +55,6 @@ Foam::topoSetSource::addToUsageTable Foam::pointToFace::usage_
" -all points in the pointSet\n\n"
);
template<>
const char* Foam::NamedEnum<Foam::pointToFace::pointAction, 2>::names[] =
{
"any",
"all"
};
const Foam::NamedEnum<Foam::pointToFace::pointAction, 2>
Foam::pointToFace::pointActionNames_;
......
......@@ -33,13 +33,15 @@ License
namespace Foam
{
defineTypeNameAndDebug(cellToPoint, 0);
addToRunTimeSelectionTable(topoSetSource, cellToPoint, word);
addToRunTimeSelectionTable(topoSetSource, cellToPoint, istream);
defineTypeNameAndDebug(cellToPoint, 0);
addToRunTimeSelectionTable(topoSetSource, cellToPoint, word);
addToRunTimeSelectionTable(topoSetSource, cellToPoint, istream);
template<>
const char* Foam::NamedEnum<Foam::cellToPoint::cellAction, 1>::names[] =
{
"all"
};
}
......@@ -50,12 +52,6 @@ Foam::topoSetSource::addToUsageTable Foam::cellToPoint::usage_
" Select all points of cells in the cellSet\n\n"
);
template<>
const char* Foam::NamedEnum<Foam::cellToPoint::cellAction, 1>::names[] =
{
"all"
};
const Foam::NamedEnum<Foam::cellToPoint::cellAction, 1>
Foam::cellToPoint::cellActionNames_;
......
......@@ -33,13 +33,15 @@ License
namespace Foam
{
defineTypeNameAndDebug(faceToPoint, 0);
addToRunTimeSelectionTable(topoSetSource, faceToPoint, word);