From 95219e6f7672b4df2e049a8c5ab10798ecb243af Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 12 Oct 2010 12:17:13 +0200 Subject: [PATCH] COMP: specialization Foam::NamedEnum templates within namespace Foam - otherwise gets flagged as an error by clang --- src/OSspecific/POSIX/fileMonitor.C | 16 ++++---- src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C | 16 +++++--- src/OpenFOAM/db/Time/Time.C | 37 ++++++++++--------- .../outputFilterOutputControl.C | 21 ++++++----- .../constraint/cyclic/cyclicPolyPatch.C | 22 ++++++----- .../primitiveShapes/triangle/intersection.C | 30 ++++++++------- .../meshCut/directions/directions.C | 16 ++++---- .../slidingInterface/slidingInterface.C | 19 ++++++---- .../phaseProperties/phaseProperties.C | 18 +++++---- .../refinementSurfaces/refinementSurfaces.C | 36 ++++++++++-------- .../sets/cellSources/faceToCell/faceToCell.C | 26 ++++++------- .../faceZoneToCell/faceZoneToCell.C | 23 +++++------- .../cellSources/pointToCell/pointToCell.C | 21 ++++------- .../sets/faceSources/cellToFace/cellToFace.C | 22 +++++------ .../faceSources/pointToFace/pointToFace.C | 22 +++++------ .../pointSources/cellToPoint/cellToPoint.C | 20 ++++------ .../pointSources/faceToPoint/faceToPoint.C | 20 ++++------ .../sets/topoSetSource/topoSetSource.C | 26 ++++++------- .../distributedTriSurfaceMesh.C | 22 ++++++----- .../fieldAverageItem/fieldAverageItem.C | 14 ++++--- .../field/fieldMinMax/fieldMinMax.C | 14 ++++--- .../abortCalculation/abortCalculation.C | 20 +++++++--- src/sampling/sampledSet/coordSet/coordSet.C | 20 ++++++---- .../alphaContactAngleFvPatchScalarField.C | 26 ++++++------- 24 files changed, 272 insertions(+), 255 deletions(-) diff --git a/src/OSspecific/POSIX/fileMonitor.C b/src/OSspecific/POSIX/fileMonitor.C index 48807d2e68..982d5e28dc 100644 --- a/src/OSspecific/POSIX/fileMonitor.C +++ b/src/OSspecific/POSIX/fileMonitor.C @@ -49,19 +49,19 @@ Class defineTypeNameAndDebug(Foam::fileMonitor, 0); -template<> -const char* Foam::NamedEnum::names[] = -{ - "unmodified", - "modified", - "deleted" -}; const Foam::NamedEnum Foam::fileMonitor::fileStateNames_; - namespace Foam { + template<> + const char* Foam::NamedEnum::names[] = + { + "unmodified", + "modified", + "deleted" + }; + //- Reduction operator for PackedList of fileState class reduceFileStates { diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C index b5d22692f0..51e2fadfe7 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C +++ b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C @@ -32,13 +32,17 @@ License defineTypeNameAndDebug(Foam::UPstream, 0); -template<> -const char* Foam::NamedEnum::names[] = +namespace Foam { - "blocking", - "scheduled", - "nonBlocking" -}; + template<> + const char* Foam::NamedEnum::names[] = + { + "blocking", + "scheduled", + "nonBlocking" + }; +} + const Foam::NamedEnum Foam::UPstream::commsTypeNames; diff --git a/src/OpenFOAM/db/Time/Time.C b/src/OpenFOAM/db/Time/Time.C index aadcdc7c54..487576586b 100644 --- a/src/OpenFOAM/db/Time/Time.C +++ b/src/OpenFOAM/db/Time/Time.C @@ -32,28 +32,31 @@ License defineTypeNameAndDebug(Foam::Time, 0); -template<> -const char* Foam::NamedEnum::names[] = +namespace Foam { - "endTime", - "noWriteNow", - "writeNow", - "nextWrite" -}; + template<> + const char* Foam::NamedEnum::names[] = + { + "endTime", + "noWriteNow", + "writeNow", + "nextWrite" + }; + + template<> + const char* Foam::NamedEnum::names[] = + { + "timeStep", + "runTime", + "adjustableRunTime", + "clockTime", + "cpuTime" + }; +} const Foam::NamedEnum Foam::Time::stopAtControlNames_; -template<> -const char* Foam::NamedEnum::names[] = -{ - "timeStep", - "runTime", - "adjustableRunTime", - "clockTime", - "cpuTime" -}; - const Foam::NamedEnum Foam::Time::writeControlNames_; diff --git a/src/OpenFOAM/db/functionObjects/outputFilterOutputControl/outputFilterOutputControl.C b/src/OpenFOAM/db/functionObjects/outputFilterOutputControl/outputFilterOutputControl.C index 82e74c55c7..008085253d 100644 --- a/src/OpenFOAM/db/functionObjects/outputFilterOutputControl/outputFilterOutputControl.C +++ b/src/OpenFOAM/db/functionObjects/outputFilterOutputControl/outputFilterOutputControl.C @@ -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::outputControlNames_; diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C index 330b912fb9..01ed37fd16 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C @@ -44,16 +44,20 @@ namespace Foam addToRunTimeSelectionTable(polyPatch, cyclicPolyPatch, word); addToRunTimeSelectionTable(polyPatch, cyclicPolyPatch, dictionary); -} -template<> -const char* Foam::NamedEnum::names[] = -{ - "unknown", - "rotational", - "translational", - "noOrdering" -}; + template<> + const char* Foam::NamedEnum + < + Foam::cyclicPolyPatch::transformType, + 4 + >::names[] = + { + "unknown", + "rotational", + "translational", + "noOrdering" + }; +} const Foam::NamedEnum Foam::cyclicPolyPatch::transformTypeNames; diff --git a/src/OpenFOAM/meshes/primitiveShapes/triangle/intersection.C b/src/OpenFOAM/meshes/primitiveShapes/triangle/intersection.C index abaf9c5015..110754f77a 100644 --- a/src/OpenFOAM/meshes/primitiveShapes/triangle/intersection.C +++ b/src/OpenFOAM/meshes/primitiveShapes/triangle/intersection.C @@ -29,27 +29,29 @@ License Foam::scalar Foam::intersection::planarTol_ = 0.2; -template<> -const char* Foam::NamedEnum::names[] = +namespace Foam { - "vector", - "contactSphere" -}; + template<> + const char* Foam::NamedEnum::names[] = + { + "vector", + "contactSphere" + }; + + template<> + const char* Foam::NamedEnum::names[] = + { + "fullRay", + "halfRay", + "visible" + }; +} const Foam::NamedEnum Foam::intersection::directionNames_; -template<> -const char* Foam::NamedEnum::names[] = -{ - "fullRay", - "halfRay", - "visible" -}; - const Foam::NamedEnum Foam::intersection::algorithmNames_; - // ************************************************************************* // diff --git a/src/dynamicMesh/meshCut/directions/directions.C b/src/dynamicMesh/meshCut/directions/directions.C index 793323e54d..5f5fb220af 100644 --- a/src/dynamicMesh/meshCut/directions/directions.C +++ b/src/dynamicMesh/meshCut/directions/directions.C @@ -35,19 +35,21 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -template<> -const char* Foam::NamedEnum::names[] = +namespace Foam { - "tan1", - "tan2", - "normal" -}; + template<> + const char* Foam::NamedEnum::names[] = + { + "tan1", + "tan2", + "normal" + }; +} const Foam::NamedEnum Foam::directions::directionTypeNames_; - // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // For debugging diff --git a/src/dynamicMesh/slidingInterface/slidingInterface.C b/src/dynamicMesh/slidingInterface/slidingInterface.C index b7bbecdc5c..85fa080750 100644 --- a/src/dynamicMesh/slidingInterface/slidingInterface.C +++ b/src/dynamicMesh/slidingInterface/slidingInterface.C @@ -45,17 +45,20 @@ namespace Foam slidingInterface, dictionary ); + + template<> + const char* Foam::NamedEnum + < + Foam::slidingInterface::typeOfMatch, + 2 + >::names[] = + { + "integral", + "partial" + }; } -template<> -const char* Foam::NamedEnum::names[] = -{ - "integral", - "partial" -}; - - const Foam::NamedEnum Foam::slidingInterface::typeOfMatchNames_; diff --git a/src/lagrangian/intermediate/phaseProperties/phaseProperties/phaseProperties.C b/src/lagrangian/intermediate/phaseProperties/phaseProperties/phaseProperties.C index bd01c8b207..4ad492b064 100644 --- a/src/lagrangian/intermediate/phaseProperties/phaseProperties/phaseProperties.C +++ b/src/lagrangian/intermediate/phaseProperties/phaseProperties/phaseProperties.C @@ -27,15 +27,17 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -template<> -const char* Foam::NamedEnum::names[] = +namespace Foam { - "gas", - "liquid", - "solid", - "unknown" -}; - + template<> + const char* Foam::NamedEnum::names[] = + { + "gas", + "liquid", + "solid", + "unknown" + }; +} const Foam::NamedEnum Foam::phaseProperties::phaseTypeNames_; diff --git a/src/mesh/autoMesh/autoHexMesh/refinementSurfaces/refinementSurfaces.C b/src/mesh/autoMesh/autoHexMesh/refinementSurfaces/refinementSurfaces.C index ecb0542578..9a91bcccb0 100644 --- a/src/mesh/autoMesh/autoHexMesh/refinementSurfaces/refinementSurfaces.C +++ b/src/mesh/autoMesh/autoHexMesh/refinementSurfaces/refinementSurfaces.C @@ -34,15 +34,19 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -template<> -const char* -Foam::NamedEnum::names[] = +namespace Foam { - "inside", - "outside", - "insidePoint", - "none" -}; + template<> + const char* + Foam::NamedEnum::names[] = + { + "inside", + "outside", + "insidePoint", + "none" + }; +} + const Foam::NamedEnum 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]); diff --git a/src/meshTools/sets/cellSources/faceToCell/faceToCell.C b/src/meshTools/sets/cellSources/faceToCell/faceToCell.C index db7cb5269f..9589929aed 100644 --- a/src/meshTools/sets/cellSources/faceToCell/faceToCell.C +++ b/src/meshTools/sets/cellSources/faceToCell/faceToCell.C @@ -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::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::names[] = -{ - "neighbour", - "owner", - "any", - "all" -}; - const Foam::NamedEnum Foam::faceToCell::faceActionNames_; diff --git a/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.C b/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.C index da2feb7e04..2d5bd7f4d5 100644 --- a/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.C +++ b/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.C @@ -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::names[] = + { + "master", + "slave" + }; } @@ -51,14 +54,6 @@ Foam::topoSetSource::addToUsageTable Foam::faceZoneToCell::usage_ ); -template<> -const char* Foam::NamedEnum::names[] = -{ - "master", - "slave" -}; - - const Foam::NamedEnum Foam::faceZoneToCell::faceActionNames_; diff --git a/src/meshTools/sets/cellSources/pointToCell/pointToCell.C b/src/meshTools/sets/cellSources/pointToCell/pointToCell.C index 359f82fae3..ebb3a010b9 100644 --- a/src/meshTools/sets/cellSources/pointToCell/pointToCell.C +++ b/src/meshTools/sets/cellSources/pointToCell/pointToCell.C @@ -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::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::names[] = -{ - "any" -}; - - const Foam::NamedEnum Foam::pointToCell::pointActionNames_; diff --git a/src/meshTools/sets/faceSources/cellToFace/cellToFace.C b/src/meshTools/sets/faceSources/cellToFace/cellToFace.C index a7e5b8c285..2ff1769c8f 100644 --- a/src/meshTools/sets/faceSources/cellToFace/cellToFace.C +++ b/src/meshTools/sets/faceSources/cellToFace/cellToFace.C @@ -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::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::names[] = -{ - "all", - "both" -}; - const Foam::NamedEnum Foam::cellToFace::cellActionNames_; diff --git a/src/meshTools/sets/faceSources/pointToFace/pointToFace.C b/src/meshTools/sets/faceSources/pointToFace/pointToFace.C index 51c7fb1351..8e272b86df 100644 --- a/src/meshTools/sets/faceSources/pointToFace/pointToFace.C +++ b/src/meshTools/sets/faceSources/pointToFace/pointToFace.C @@ -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::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::names[] = -{ - "any", - "all" -}; - const Foam::NamedEnum Foam::pointToFace::pointActionNames_; diff --git a/src/meshTools/sets/pointSources/cellToPoint/cellToPoint.C b/src/meshTools/sets/pointSources/cellToPoint/cellToPoint.C index aaa74c8493..5026b51cfc 100644 --- a/src/meshTools/sets/pointSources/cellToPoint/cellToPoint.C +++ b/src/meshTools/sets/pointSources/cellToPoint/cellToPoint.C @@ -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::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::names[] = -{ - "all" -}; - const Foam::NamedEnum Foam::cellToPoint::cellActionNames_; diff --git a/src/meshTools/sets/pointSources/faceToPoint/faceToPoint.C b/src/meshTools/sets/pointSources/faceToPoint/faceToPoint.C index ff1161b820..4d0919f7c8 100644 --- a/src/meshTools/sets/pointSources/faceToPoint/faceToPoint.C +++ b/src/meshTools/sets/pointSources/faceToPoint/faceToPoint.C @@ -33,13 +33,15 @@ License namespace Foam { + defineTypeNameAndDebug(faceToPoint, 0); + addToRunTimeSelectionTable(topoSetSource, faceToPoint, word); + addToRunTimeSelectionTable(topoSetSource, faceToPoint, istream); -defineTypeNameAndDebug(faceToPoint, 0); - -addToRunTimeSelectionTable(topoSetSource, faceToPoint, word); - -addToRunTimeSelectionTable(topoSetSource, faceToPoint, istream); - + template<> + const char* Foam::NamedEnum::names[] = + { + "all" + }; } @@ -50,12 +52,6 @@ Foam::topoSetSource::addToUsageTable Foam::faceToPoint::usage_ " Select all points of faces in the faceSet\n\n" ); -template<> -const char* Foam::NamedEnum::names[] = -{ - "all" -}; - const Foam::NamedEnum Foam::faceToPoint::faceActionNames_; diff --git a/src/meshTools/sets/topoSetSource/topoSetSource.C b/src/meshTools/sets/topoSetSource/topoSetSource.C index bb68be7e9c..f82cf59a90 100644 --- a/src/meshTools/sets/topoSetSource/topoSetSource.C +++ b/src/meshTools/sets/topoSetSource/topoSetSource.C @@ -34,24 +34,24 @@ namespace Foam defineTypeNameAndDebug(topoSetSource, 0); defineRunTimeSelectionTable(topoSetSource, word); defineRunTimeSelectionTable(topoSetSource, istream); + + template<> + const char* Foam::NamedEnum::names[] = + { + "clear", + "new", + "invert", + "add", + "delete", + "subset", + "list", + "remove" + }; } Foam::HashTable* Foam::topoSetSource::usageTablePtr_ = NULL; -template<> -const char* Foam::NamedEnum::names[] = -{ - "clear", - "new", - "invert", - "add", - "delete", - "subset", - "list", - "remove" -}; - const Foam::NamedEnum Foam::topoSetSource::actionNames_; diff --git a/src/parallel/distributed/distributedTriSurfaceMesh/distributedTriSurfaceMesh.C b/src/parallel/distributed/distributedTriSurfaceMesh/distributedTriSurfaceMesh.C index 80d9c43651..accee92b3f 100644 --- a/src/parallel/distributed/distributedTriSurfaceMesh/distributedTriSurfaceMesh.C +++ b/src/parallel/distributed/distributedTriSurfaceMesh/distributedTriSurfaceMesh.C @@ -49,18 +49,20 @@ namespace Foam distributedTriSurfaceMesh, dict ); + + template<> + const char* Foam::NamedEnum + < + Foam::distributedTriSurfaceMesh::distributionType, + 3 + >::names[] = + { + "follow", + "independent", + "frozen" + }; } - -template<> -const char* -Foam::NamedEnum::names[] = -{ - "follow", - "independent", - "frozen" -}; - const Foam::NamedEnum Foam::distributedTriSurfaceMesh::distributionTypeNames_; diff --git a/src/postProcessing/functionObjects/field/fieldAverage/fieldAverageItem/fieldAverageItem.C b/src/postProcessing/functionObjects/field/fieldAverage/fieldAverageItem/fieldAverageItem.C index 591bc36229..ee3d6e4e8a 100644 --- a/src/postProcessing/functionObjects/field/fieldAverage/fieldAverageItem/fieldAverageItem.C +++ b/src/postProcessing/functionObjects/field/fieldAverage/fieldAverageItem/fieldAverageItem.C @@ -27,12 +27,16 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -template<> -const char* Foam::NamedEnum::names[] = +namespace Foam { - "iteration", - "time" -}; + template<> + const char* Foam::NamedEnum::names[] = + { + "iteration", + "time" + }; +} + const Foam::NamedEnum Foam::fieldAverageItem::baseTypeNames_; diff --git a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.C b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.C index eda5f7434f..c0f715e716 100644 --- a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.C +++ b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.C @@ -33,13 +33,15 @@ License defineTypeNameAndDebug(Foam::fieldMinMax, 0); - -template<> -const char* Foam::NamedEnum::names[] = +namespace Foam { - "magnitude", - "component" -}; + template<> + const char* Foam::NamedEnum::names[] = + { + "magnitude", + "component" + }; +} const Foam::NamedEnum diff --git a/src/postProcessing/functionObjects/jobControl/abortCalculation/abortCalculation.C b/src/postProcessing/functionObjects/jobControl/abortCalculation/abortCalculation.C index 49ae674ef6..f26f558fb5 100644 --- a/src/postProcessing/functionObjects/jobControl/abortCalculation/abortCalculation.C +++ b/src/postProcessing/functionObjects/jobControl/abortCalculation/abortCalculation.C @@ -37,13 +37,21 @@ defineTypeNameAndDebug(Foam::abortCalculation, 0); // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -template<> -const char* Foam::NamedEnum::names[] = +namespace Foam { - "noWriteNow", - "writeNow", - "nextWrite" -}; + template<> + const char* Foam::NamedEnum + < + Foam::abortCalculation::actionType, + 3 + >::names[] = + { + "noWriteNow", + "writeNow", + "nextWrite" + }; +} + const Foam::NamedEnum Foam::abortCalculation::actionTypeNames_; diff --git a/src/sampling/sampledSet/coordSet/coordSet.C b/src/sampling/sampledSet/coordSet/coordSet.C index bc1237f310..24d6b4174c 100644 --- a/src/sampling/sampledSet/coordSet/coordSet.C +++ b/src/sampling/sampledSet/coordSet/coordSet.C @@ -27,15 +27,19 @@ License // * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * // -template<> -const char* Foam::NamedEnum::names[] = +namespace Foam { - "xyz", - "x", - "y", - "z", - "distance" -}; + template<> + const char* Foam::NamedEnum::names[] = + { + "xyz", + "x", + "y", + "z", + "distance" + }; +} + const Foam::NamedEnum Foam::coordSet::coordFormatNames_; diff --git a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C b/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C index 1d030286cf..53e2bdc5c8 100644 --- a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C +++ b/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C @@ -33,20 +33,20 @@ License namespace Foam { defineTypeNameAndDebug(alphaContactAngleFvPatchScalarField, 0); -} -template<> -const char* Foam::NamedEnum -< - Foam::alphaContactAngleFvPatchScalarField::limitControls, - 4 ->::names[] = -{ - "none", - "gradient", - "zeroGradient", - "alpha" -}; + template<> + const char* Foam::NamedEnum + < + Foam::alphaContactAngleFvPatchScalarField::limitControls, + 4 + >::names[] = + { + "none", + "gradient", + "zeroGradient", + "alpha" + }; +} const Foam::NamedEnum <