diff --git a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C index 627dd41b6f..9b064b14c6 100644 --- a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C +++ b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C @@ -34,6 +34,7 @@ License #include "fvcFlux.H" #include "fvcMeshPhi.H" #include "surfaceInterpolate.H" +#include "unitConversion.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -43,10 +44,6 @@ namespace Foam } -const Foam::scalar Foam::multiphaseMixtureThermo::convertToRad = - Foam::constant::mathematical::pi/180.0; - - // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // void Foam::multiphaseMixtureThermo::calcAlphas() @@ -855,7 +852,7 @@ void Foam::multiphaseMixtureThermo::correctContactAngle bool matched = (tp.key().first() == alpha1.name()); - scalar theta0 = convertToRad*tp().theta0(matched); + const scalar theta0 = degToRad(tp().theta0(matched)); scalarField theta(boundary[patchi].size(), theta0); scalar uTheta = tp().uTheta(); @@ -863,8 +860,8 @@ void Foam::multiphaseMixtureThermo::correctContactAngle // Calculate the dynamic contact angle if required if (uTheta > SMALL) { - scalar thetaA = convertToRad*tp().thetaA(matched); - scalar thetaR = convertToRad*tp().thetaR(matched); + const scalar thetaA = degToRad(tp().thetaA(matched)); + const scalar thetaR = degToRad(tp().thetaR(matched)); // Calculated the component of the velocity parallel to the wall vectorField Uwall diff --git a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.H b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.H index 7c8c5b6f03..1fd4e40639 100644 --- a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.H +++ b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.H @@ -144,9 +144,6 @@ private: //- Stabilisation for normalisation of the interface normal const dimensionedScalar deltaN_; - //- Conversion factor for degrees into radians - static const scalar convertToRad; - // Private member functions diff --git a/applications/solvers/multiphase/interFoam/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.C b/applications/solvers/multiphase/interFoam/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.C index 644c3b25a0..b5495dd6ae 100644 --- a/applications/solvers/multiphase/interFoam/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.C +++ b/applications/solvers/multiphase/interFoam/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.C @@ -30,12 +30,7 @@ License #include "fvcDiv.H" #include "fvcGrad.H" #include "fvcSnGrad.H" - -// * * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * // - -const Foam::scalar Foam::threePhaseInterfaceProperties::convertToRad = - Foam::constant::mathematical::pi/180.0; - +#include "unitConversion.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -83,7 +78,7 @@ void Foam::threePhaseInterfaceProperties::correctContactAngle scalarField theta ( - convertToRad + degToRad() * ( twoPhaseAlpha2*(180 - a2cap.theta(U[patchi], nHatp)) + twoPhaseAlpha3*(180 - a3cap.theta(U[patchi], nHatp)) diff --git a/applications/solvers/multiphase/interFoam/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.H b/applications/solvers/multiphase/interFoam/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.H index 826d6658d9..482a8a1a8e 100644 --- a/applications/solvers/multiphase/interFoam/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.H +++ b/applications/solvers/multiphase/interFoam/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.H @@ -91,10 +91,6 @@ class threePhaseInterfaceProperties public: - //- Conversion factor for degrees into radians - static const scalar convertToRad; - - // Constructors //- Construct from volume fraction field alpha and IOdictionary diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C index de3084f69f..425be38063 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C @@ -35,12 +35,7 @@ License #include "fvcDiv.H" #include "fvcFlux.H" #include "fvcAverage.H" - -// * * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * // - -const Foam::scalar Foam::multiphaseSystem::convertToRad = - Foam::constant::mathematical::pi/180.0; - +#include "unitConversion.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -290,7 +285,7 @@ void Foam::multiphaseSystem::correctContactAngle bool matched = (tp.key().first() == phase1.name()); - scalar theta0 = convertToRad*tp().theta0(matched); + const scalar theta0 = degToRad(tp().theta0(matched)); scalarField theta(boundary[patchi].size(), theta0); scalar uTheta = tp().uTheta(); @@ -298,8 +293,8 @@ void Foam::multiphaseSystem::correctContactAngle // Calculate the dynamic contact angle if required if (uTheta > SMALL) { - scalar thetaA = convertToRad*tp().thetaA(matched); - scalar thetaR = convertToRad*tp().thetaR(matched); + const scalar thetaA = degToRad(tp().thetaA(matched)); + const scalar thetaR = degToRad(tp().thetaR(matched)); // Calculated the component of the velocity parallel to the wall vectorField Uwall diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.H b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.H index 02b56684da..0094c2c164 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.H @@ -187,9 +187,6 @@ private: //- Stabilisation for normalisation of the interface normal const dimensionedScalar deltaN_; - //- Conversion factor for degrees into radians - static const scalar convertToRad; - // Private member functions diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C index b6144051a4..63a2776db4 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C @@ -33,12 +33,7 @@ License #include "fvcSnGrad.H" #include "fvcDiv.H" #include "fvcFlux.H" - -// * * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * // - -const Foam::scalar Foam::multiphaseMixture::convertToRad = - Foam::constant::mathematical::pi/180.0; - +#include "unitConversion.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -456,7 +451,7 @@ void Foam::multiphaseMixture::correctContactAngle bool matched = (tp.key().first() == alpha1.name()); - scalar theta0 = convertToRad*tp().theta0(matched); + const scalar theta0 = degToRad(tp().theta0(matched)); scalarField theta(boundary[patchi].size(), theta0); scalar uTheta = tp().uTheta(); @@ -464,8 +459,8 @@ void Foam::multiphaseMixture::correctContactAngle // Calculate the dynamic contact angle if required if (uTheta > SMALL) { - scalar thetaA = convertToRad*tp().thetaA(matched); - scalar thetaR = convertToRad*tp().thetaR(matched); + const scalar thetaA = degToRad(tp().thetaA(matched)); + const scalar thetaR = degToRad(tp().thetaR(matched)); // Calculated the component of the velocity parallel to the wall vectorField Uwall diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H index 44150c9d2b..0183652ffc 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H @@ -154,9 +154,6 @@ private: //- Stabilisation for normalisation of the interface normal const dimensionedScalar deltaN_; - //- Conversion factor for degrees into radians - static const scalar convertToRad; - // Private member functions diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C index 627af1db87..1f8f83599b 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C @@ -40,6 +40,8 @@ License #include "fvmLaplacian.H" #include "fvmSup.H" +#include "unitConversion.H" + // * * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * // namespace Foam @@ -48,9 +50,6 @@ namespace Foam defineRunTimeSelectionTable(multiphaseSystem, dictionary); } -const Foam::scalar Foam::multiphaseSystem::convertToRad = - Foam::constant::mathematical::pi/180.0; - // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -399,7 +398,7 @@ void Foam::multiphaseSystem::correctContactAngle bool matched = (tp.key().first() == phase1.name()); - scalar theta0 = convertToRad*tp().theta0(matched); + const scalar theta0 = degToRad(tp().theta0(matched)); scalarField theta(boundary[patchi].size(), theta0); scalar uTheta = tp().uTheta(); @@ -407,8 +406,8 @@ void Foam::multiphaseSystem::correctContactAngle // Calculate the dynamic contact angle if required if (uTheta > SMALL) { - scalar thetaA = convertToRad*tp().thetaA(matched); - scalar thetaR = convertToRad*tp().thetaR(matched); + const scalar thetaA = degToRad(tp().thetaA(matched)); + const scalar thetaR = degToRad(tp().thetaR(matched)); // Calculated the component of the velocity parallel to the wall vectorField Uwall diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.H b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.H index dca55bf873..0c43f6dd8f 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.H @@ -65,9 +65,6 @@ class multiphaseSystem //- Stabilisation for normalisation of the interface normal const dimensionedScalar deltaN_; - //- Conversion factor for degrees into radians - static const scalar convertToRad; - // Private member functions @@ -207,10 +204,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "multiphaseSystemI.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - #endif // ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C index 034da57349..a1ac6c46f6 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C @@ -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("relax", 0.5)), AbyV_(p.size(), 0), alphatConv_(p.size(), 0), diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.H index 665d41197e..33ca2fe31e 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.H @@ -164,7 +164,7 @@ private: // Private data //- Heat source type names - static const NamedEnum phaseTypeNames_; + static const Enum phaseTypeNames_; //- Heat source type phaseType phaseType_; diff --git a/applications/test/PackedList2/Test-PackedList2.C b/applications/test/PackedList2/Test-PackedList2.C index 26981b484f..ce9b15ed51 100644 --- a/applications/test/PackedList2/Test-PackedList2.C +++ b/applications/test/PackedList2/Test-PackedList2.C @@ -54,7 +54,7 @@ int main(int argc, char *argv[]) std::vector stlVector(n, true); labelHashSet emptyHash; - labelHashSet fullHash(1000); + labelHashSet fullHash(1024); for (label i = 0; i < n; i++) { fullHash.insert(i); diff --git a/applications/test/dictionary/Test-dictionary.C b/applications/test/dictionary/Test-dictionary.C index dc55b9902f..3d7e445ab5 100644 --- a/applications/test/dictionary/Test-dictionary.C +++ b/applications/test/dictionary/Test-dictionary.C @@ -50,7 +50,7 @@ int main(int argc, char *argv[]) dictionary dict; dict.add(word("aa" + getEnv("WM_MPLIB") + "cc"), 16); - string s("DDD${aa${WM_MPLIB}cc}EEE"); + string s("DDD_${aa${WM_MPLIB}cc}_EEE"); stringOps::inplaceExpand(s, dict, true, false); Info<< "variable expansion:" << s << endl; } diff --git a/applications/test/parallel/Test-parallel.C b/applications/test/parallel/Test-parallel.C index 7a61b77f72..14ba97f7a5 100644 --- a/applications/test/parallel/Test-parallel.C +++ b/applications/test/parallel/Test-parallel.C @@ -51,7 +51,7 @@ void testMapDistribute() List>> complexData(100); forAll(complexData, i) { - complexData[i].first() = rndGen.integer(0, Pstream::nProcs()-1); + complexData[i].first() = rndGen.position(0, Pstream::nProcs()-1); complexData[i].second().setSize(3); complexData[i].second()[0] = 1; complexData[i].second()[1] = 2; diff --git a/applications/utilities/mesh/conversion/datToFoam/datToFoam.C b/applications/utilities/mesh/conversion/datToFoam/datToFoam.C index ec4b6e994f..06564cd80f 100644 --- a/applications/utilities/mesh/conversion/datToFoam/datToFoam.C +++ b/applications/utilities/mesh/conversion/datToFoam/datToFoam.C @@ -122,7 +122,7 @@ int main(int argc, char *argv[]) fileName pointsFile(runTime.constantPath()/"points.tmp"); OFstream pFile(pointsFile); - scalar a(degToRad(0.1)); + const scalar a = 0.1_deg; tensor rotateZ = tensor ( diff --git a/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H b/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H index 6b5fa8621c..8db1bdfec8 100644 --- a/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H +++ b/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H @@ -419,7 +419,7 @@ if (pFaces[WEDGE].size() && pFaces[WEDGE][0].size()) { // Distribute the points to be +/- 2.5deg from the x-z plane - scalar tanTheta = Foam::tan(degToRad(2.5)); + const scalar tanTheta = Foam::tan(2.5_deg); SLList::iterator iterf = pFaces[WEDGE][0].begin(); SLList::iterator iterb = pFaces[WEDGE][1].begin(); diff --git a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C index 26b23f691a..52dba40d6e 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C +++ b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C @@ -69,18 +69,12 @@ enum ExtrudeMode SURFACE }; -namespace Foam +static const Enum ExtrudeModeNames { - template<> - const char* NamedEnum::names[] = - { - "mesh", - "patch", - "surface" - }; -} - -static const NamedEnum 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 diff --git a/applications/utilities/mesh/generation/extrude2DMesh/extrude2DMeshApp.C b/applications/utilities/mesh/generation/extrude2DMesh/extrude2DMeshApp.C index f10a593a29..e978b44e61 100644 --- a/applications/utilities/mesh/generation/extrude2DMesh/extrude2DMeshApp.C +++ b/applications/utilities/mesh/generation/extrude2DMesh/extrude2DMeshApp.C @@ -60,17 +60,11 @@ enum ExtrudeMode MESHEDSURFACE }; -namespace Foam +static const Enum ExtrudeModeNames { - template<> - const char* NamedEnum::names[] = - { - "polyMesh2D", - "MeshedSurface" - }; -} - -static const NamedEnum ExtrudeModeNames; + { ExtrudeMode::POLYMESH2D, "polyMesh2D" }, + { ExtrudeMode::MESHEDSURFACE, "MeshedSurface" }, +}; //pointField moveInitialPoints diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C index 43131671d5..141f36b933 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C @@ -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::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 * * * * * * * * * * * * // diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.H b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.H index d204911c8f..0960b5e63c 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.H +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.H @@ -122,7 +122,7 @@ public: constrained = 4 }; - static const NamedEnum dualMeshPointTypeNames_; + static const Enum dualMeshPointTypeNames_; private: diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshConformToSurface.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshConformToSurface.C index 9567b8886b..df009f3083 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshConformToSurface.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshConformToSurface.C @@ -33,10 +33,10 @@ License using namespace Foam::vectorTools; const Foam::scalar Foam::conformalVoronoiMesh::searchConeAngle - = Foam::cos(degToRad(30)); + = Foam::cos(30.0_deg); const Foam::scalar Foam::conformalVoronoiMesh::searchAngleOppositeSurface - = Foam::cos(degToRad(150)); + = Foam::cos(150.0_deg); // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedCell/indexedCellEnum.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedCell/indexedCellEnum.C index 5dfac3963c..b9542b22ab 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedCell/indexedCellEnum.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedCell/indexedCellEnum.C @@ -27,20 +27,19 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -template<> -const char* -Foam::NamedEnum::names[] = +const Foam::Enum +< + Foam::indexedCellEnum::cellTypes +> +Foam::indexedCellEnum::cellTypesNames_ { - "Unassigned", - "Internal", - "Surface", - "FeatureEdge", - "FeaturePoint", - "Far" + { cellTypes::ctUnassigned, "Unassigned" }, + { cellTypes::ctFar, "Far" }, + { cellTypes::ctInternal, "Internal" }, + { cellTypes::ctSurface, "Surface" }, + { cellTypes::ctFeatureEdge, "FeatureEdge" }, + { cellTypes::ctFeaturePoint,"FeaturePoint" }, }; -const Foam::NamedEnum -cellTypesNames_; - // ************************************************************************* // diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedCell/indexedCellEnum.H b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedCell/indexedCellEnum.H index d81deca00c..eeab020502 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedCell/indexedCellEnum.H +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedCell/indexedCellEnum.H @@ -34,7 +34,7 @@ SourceFiles #ifndef indexedCellEnum_H #define indexedCellEnum_H -#include "NamedEnum.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::NamedEnum cellTypesNames_; + static const Enum cellTypesNames_; }; diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertexEnum.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertexEnum.C index ddb03fa28e..729eea93d2 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertexEnum.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertexEnum.C @@ -28,42 +28,42 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -template<> -const char* -Foam::NamedEnum::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::vertexTypeNames_; - -template<> -const char* -Foam::NamedEnum::names[] = +const Foam::Enum +< + Foam::indexedVertexEnum::vertexMotion +> +Foam::indexedVertexEnum::vertexMotionNames_ { - "fixed", - "movable" + { vertexMotion::fixed, "fixed" }, + { vertexMotion::movable, "movable" }, }; -const Foam::NamedEnum -vertexMotionNames_; +// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // Foam::Ostream& Foam::operator<< ( diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertexEnum.H b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertexEnum.H index 581bcf80a6..1568061fae 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertexEnum.H +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertexEnum.H @@ -34,7 +34,7 @@ SourceFiles #ifndef indexedVertexEnum_H #define indexedVertexEnum_H -#include "NamedEnum.H" +#include "Enum.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -72,9 +72,9 @@ public: movable = 1 }; - static const Foam::NamedEnum vertexTypeNames_; + static const Enum vertexTypeNames_; - static const Foam::NamedEnum vertexMotionNames_; + static const Enum vertexMotionNames_; friend Ostream& operator<<(Foam::Ostream&, const vertexType&); diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C index 3e91747415..00f2c7d05d 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C +++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C @@ -393,7 +393,7 @@ void extractSurface // Collect sizes. Hash on names to handle local-only patches (e.g. // processor patches) - HashTable