COMP: avoid ambiguous construct from tmp - mesh, meshTools

This commit is contained in:
Mark Olesen
2010-12-17 17:10:18 +01:00
parent ffa2836a75
commit fa6b1157f2
6 changed files with 31 additions and 23 deletions

View File

@ -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. // Add topo regardless of whether extrudeStatus is extruderemove.
// Not add layer if patchDisp is zero. // Not add layer if patchDisp is zero.

View File

@ -652,7 +652,8 @@ Foam::scalarField Foam::autoSnapDriver::calcSnapDistance
-GREAT // null value -GREAT // null value
); );
return snapParams.snapTol()*maxEdgeLen; tmp<scalarField> tfld = snapParams.snapTol()*maxEdgeLen;
return tfld();
} }

View File

@ -148,7 +148,7 @@ Foam::tmp<Foam::vectorField> Foam::cylindricalCS::localToGlobal
bool translate bool translate
) const ) const
{ {
scalarField theta = scalarField theta
( (
local.component(vector::Y) local.component(vector::Y)
*(inDegrees_ ? constant::mathematical::pi/180.0 : 1.0) *(inDegrees_ ? constant::mathematical::pi/180.0 : 1.0)
@ -170,7 +170,10 @@ Foam::vector Foam::cylindricalCS::globalToLocal
bool translate bool translate
) const ) const
{ {
const vector lc = coordinateSystem::globalToLocal(global, translate); const vector lc
(
coordinateSystem::globalToLocal(global, translate)
);
return vector return vector
( (
@ -191,8 +194,10 @@ Foam::tmp<Foam::vectorField> Foam::cylindricalCS::globalToLocal
bool translate bool translate
) const ) const
{ {
const vectorField lc = const vectorField lc
coordinateSystem::globalToLocal(global, translate); (
coordinateSystem::globalToLocal(global, translate)
);
tmp<vectorField> tresult(new vectorField(lc.size())); tmp<vectorField> tresult(new vectorField(lc.size()));
vectorField& result = tresult(); vectorField& result = tresult();

View File

@ -155,7 +155,7 @@ Foam::tmp<Foam::vectorField> Foam::sphericalCS::localToGlobal
bool translate bool translate
) const ) const
{ {
const scalarField r = local.component(vector::X); const scalarField r(local.component(vector::X));
const scalarField theta const scalarField theta
( (
local.component(vector::Y) local.component(vector::Y)
@ -206,8 +206,8 @@ Foam::tmp<Foam::vectorField> Foam::sphericalCS::globalToLocal
bool translate bool translate
) const ) const
{ {
const vectorField lc = coordinateSystem::globalToLocal(global, translate); const vectorField lc(coordinateSystem::globalToLocal(global, translate));
const scalarField r = mag(lc); const scalarField r(mag(lc));
tmp<vectorField> tresult(new vectorField(lc.size())); tmp<vectorField> tresult(new vectorField(lc.size()));
vectorField& result = tresult(); vectorField& result = tresult();

View File

@ -97,15 +97,25 @@ Foam::tmp<Foam::vectorField> Foam::toroidalCS::localToGlobal
bool translate bool translate
) const ) const
{ {
const scalarField r = local.component(vector::X); const scalarField r
(
local.component(vector::X)
);
const scalarField theta = const scalarField theta
local.component(vector::Y)*constant::mathematical::pi/180.0; (
local.component(vector::Y)*constant::mathematical::pi/180.0
);
const scalarField phi = const scalarField phi
local.component(vector::Z)*constant::mathematical::pi/180.0; (
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()); vectorField lc(local.size());
lc.replace(vector::X, rprime*cos(theta)); lc.replace(vector::X, rprime*cos(theta));

View File

@ -54,10 +54,6 @@ namespace Foam
"nearestFace" "nearestFace"
}; };
const NamedEnum<directMappedPatchBase::sampleMode, 3>
directMappedPatchBase::sampleModeNames_;
template<> template<>
const char* Foam::NamedEnum const char* Foam::NamedEnum
< <
@ -70,10 +66,6 @@ namespace Foam
"normal" "normal"
}; };
const NamedEnum<directMappedPatchBase::offsetMode, 3>
directMappedPatchBase::offsetModeNames_;
//- Private class for finding nearest //- Private class for finding nearest
// - point+local index // - point+local index
// - sqr(distance) // - sqr(distance)