From fa6b1157f24bc31798e39bcff880ce433a1f28bd Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 17 Dec 2010 17:10:18 +0100 Subject: [PATCH] COMP: avoid ambiguous construct from tmp - mesh, meshTools --- .../autoHexMeshDriver/autoLayerDriver.C | 2 +- .../autoHexMeshDriver/autoSnapDriver.C | 3 ++- .../coordinateSystems/cylindricalCS.C | 13 +++++++---- src/meshTools/coordinateSystems/sphericalCS.C | 6 ++--- src/meshTools/coordinateSystems/toroidalCS.C | 22 ++++++++++++++----- .../directMappedPatchBase.C | 8 ------- 6 files changed, 31 insertions(+), 23 deletions(-) diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C index 1d3219972c..29288940c4 100644 --- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C +++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C @@ -3052,7 +3052,7 @@ void Foam::autoLayerDriver::addLayers } } - scalarField invExpansionRatio = 1.0 / expansionRatio; + const scalarField invExpansionRatio(1.0 / expansionRatio); // Add topo regardless of whether extrudeStatus is extruderemove. // Not add layer if patchDisp is zero. diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.C b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.C index c1c19fa173..95fd5ffabe 100644 --- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.C +++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.C @@ -652,7 +652,8 @@ Foam::scalarField Foam::autoSnapDriver::calcSnapDistance -GREAT // null value ); - return snapParams.snapTol()*maxEdgeLen; + tmp tfld = snapParams.snapTol()*maxEdgeLen; + return tfld(); } diff --git a/src/meshTools/coordinateSystems/cylindricalCS.C b/src/meshTools/coordinateSystems/cylindricalCS.C index 70f9379081..1be2500f16 100644 --- a/src/meshTools/coordinateSystems/cylindricalCS.C +++ b/src/meshTools/coordinateSystems/cylindricalCS.C @@ -148,7 +148,7 @@ Foam::tmp Foam::cylindricalCS::localToGlobal bool translate ) const { - scalarField theta = + scalarField theta ( local.component(vector::Y) *(inDegrees_ ? constant::mathematical::pi/180.0 : 1.0) @@ -170,7 +170,10 @@ Foam::vector Foam::cylindricalCS::globalToLocal bool translate ) const { - const vector lc = coordinateSystem::globalToLocal(global, translate); + const vector lc + ( + coordinateSystem::globalToLocal(global, translate) + ); return vector ( @@ -191,8 +194,10 @@ Foam::tmp Foam::cylindricalCS::globalToLocal bool translate ) const { - const vectorField lc = - coordinateSystem::globalToLocal(global, translate); + const vectorField lc + ( + coordinateSystem::globalToLocal(global, translate) + ); tmp tresult(new vectorField(lc.size())); vectorField& result = tresult(); diff --git a/src/meshTools/coordinateSystems/sphericalCS.C b/src/meshTools/coordinateSystems/sphericalCS.C index 1bc0b10790..281316c12e 100644 --- a/src/meshTools/coordinateSystems/sphericalCS.C +++ b/src/meshTools/coordinateSystems/sphericalCS.C @@ -155,7 +155,7 @@ Foam::tmp Foam::sphericalCS::localToGlobal bool translate ) const { - const scalarField r = local.component(vector::X); + const scalarField r(local.component(vector::X)); const scalarField theta ( local.component(vector::Y) @@ -206,8 +206,8 @@ Foam::tmp Foam::sphericalCS::globalToLocal bool translate ) const { - const vectorField lc = coordinateSystem::globalToLocal(global, translate); - const scalarField r = mag(lc); + const vectorField lc(coordinateSystem::globalToLocal(global, translate)); + const scalarField r(mag(lc)); tmp tresult(new vectorField(lc.size())); vectorField& result = tresult(); diff --git a/src/meshTools/coordinateSystems/toroidalCS.C b/src/meshTools/coordinateSystems/toroidalCS.C index d0463acaca..f7ce5a2bf8 100644 --- a/src/meshTools/coordinateSystems/toroidalCS.C +++ b/src/meshTools/coordinateSystems/toroidalCS.C @@ -97,15 +97,25 @@ Foam::tmp Foam::toroidalCS::localToGlobal bool translate ) const { - const scalarField r = local.component(vector::X); + const scalarField r + ( + local.component(vector::X) + ); - const scalarField theta = - local.component(vector::Y)*constant::mathematical::pi/180.0; + const scalarField theta + ( + local.component(vector::Y)*constant::mathematical::pi/180.0 + ); - const scalarField phi = - local.component(vector::Z)*constant::mathematical::pi/180.0; + const scalarField phi + ( + local.component(vector::Z)*constant::mathematical::pi/180.0 + ); - const scalarField rprime = radius_ + r*sin(phi); + const scalarField rprime + ( + radius_ + r*sin(phi) + ); vectorField lc(local.size()); lc.replace(vector::X, rprime*cos(theta)); diff --git a/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.C b/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.C index 35427e849f..fac488acc8 100644 --- a/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.C +++ b/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.C @@ -54,10 +54,6 @@ namespace Foam "nearestFace" }; - const NamedEnum - directMappedPatchBase::sampleModeNames_; - - template<> const char* Foam::NamedEnum < @@ -70,10 +66,6 @@ namespace Foam "normal" }; - const NamedEnum - directMappedPatchBase::offsetModeNames_; - - //- Private class for finding nearest // - point+local index // - sqr(distance)