From 3a56ebf33d8bd6c4dec707dc0d00e2d1b4639a19 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Wed, 24 Feb 2016 12:47:36 +0000 Subject: [PATCH] tmp: Improved reference count checks to provide better error diagnostics in case of tmp misuse. Simplified tmp reuse pattern in field algebra to use tmp copy and assignment rather than the complex delayed call to 'ptr()'. Removed support for unused non-const 'REF' storage of non-tmp objects due to C++ limitation in constructor overloading: if both tmp(T&) and tmp(const T&) constructors are provided resolution is ambiguous. The turbulence libraries have been upgraded and '-DCONST_TMP' option specified in the 'options' file to switch to the new 'tmp' behavior. --- .../DPMFoam/DPMTurbulenceModels/Make/options | 2 +- .../MomentumTransferPhaseSystem.C | 2 +- .../Make/options | 2 +- .../Make/options | 2 +- ...ayatillekeWallFunctionFvPatchScalarField.C | 6 +- .../Schaeffer/SchaefferFrictionalStress.C | 4 +- .../kineticTheoryModel/kineticTheoryModel.C | 3 +- .../phasePressureModel/phasePressureModel.C | 5 +- .../Make/options | 2 +- .../Schaeffer/SchaefferFrictionalStress.C | 4 +- .../kineticTheoryModel/kineticTheoryModel.C | 3 +- .../phasePressureModel/phasePressureModel.C | 5 +- src/OpenFOAM/db/IOstreams/token/tokenI.H | 4 +- .../DimensionedFieldFunctions.C | 16 +- .../DimensionedFieldFunctionsM.C | 40 ++--- .../DimensionedFieldReuseFunctions.H | 27 +--- .../DimensionedScalarField.C | 40 ++--- .../FieldFields/FieldField/FieldField.C | 4 +- .../FieldField/FieldFieldFunctions.C | 50 +++--- .../FieldField/FieldFieldFunctionsM.C | 40 ++--- .../FieldField/FieldFieldReuseFunctions.H | 29 +--- src/OpenFOAM/fields/Fields/Field/Field.C | 5 +- .../fields/Fields/Field/FieldReuseFunctions.H | 27 +--- .../GeometricField/GeometricField.C | 8 +- .../GeometricField/GeometricFieldFunctions.C | 38 ++--- .../GeometricField/GeometricFieldFunctionsM.C | 44 +++--- .../GeometricFieldReuseFunctions.H | 29 +--- .../GeometricScalarField.C | 40 ++--- .../SlicedGeometricField.C | 6 +- .../lduMatrix/lduMatrix/lduMatrixTemplates.C | 4 +- src/OpenFOAM/memory/refCount/refCount.H | 6 +- src/OpenFOAM/memory/tmp/tmp.H | 9 +- src/OpenFOAM/memory/tmp/tmpI.H | 96 ++++------- .../compressible/Make/options | 2 +- .../thermalBaffle1DFvPatchScalarField.C | 6 +- ...tureCoupledBaffleMixedFvPatchScalarField.C | 12 +- .../incompressible/Make/options | 2 +- .../RAS/LamBremhorstKE/LamBremhorstKE.C | 8 +- .../RAS/LienCubicKE/LienCubicKE.C | 8 +- .../RAS/LienLeschziner/LienLeschziner.C | 8 +- .../RAS/ShihQuadraticKE/ShihQuadraticKE.C | 8 +- .../RAS/kkLOmega/kkLOmega.C | 14 +- .../RAS/qZeta/qZeta.C | 6 +- .../RAS/mixtureKEpsilon/mixtureKEpsilon.C | 14 +- .../DeardorffDiffStress/DeardorffDiffStress.C | 6 +- .../LES/LESdeltas/IDDESDelta/IDDESDelta.C | 4 +- .../LES/LESdeltas/maxDeltaxyz/maxDeltaxyz.C | 27 +--- .../anisotropicFilter/anisotropicFilter.C | 6 +- .../SpalartAllmarasDDES/SpalartAllmarasDDES.C | 4 +- .../SpalartAllmarasDES/SpalartAllmarasDES.C | 10 +- .../LES/dynamicKEqn/dynamicKEqn.C | 6 +- .../turbulenceModels/LES/kEqn/kEqn.C | 6 +- .../turbulenceModels/Make/options | 2 +- .../turbulenceModels/RAS/LRR/LRR.C | 12 +- .../RAS/LaunderSharmaKE/LaunderSharmaKE.C | 10 +- .../RAS/RNGkEpsilon/RNGkEpsilon.C | 10 +- .../turbulenceModels/RAS/SSG/SSG.C | 10 +- .../RAS/SpalartAllmaras/SpalartAllmaras.C | 4 +- .../turbulenceModels/RAS/kEpsilon/kEpsilon.C | 10 +- .../turbulenceModels/RAS/kOmega/kOmega.C | 10 +- .../RAS/kOmegaSST/kOmegaSST.C | 12 +- .../RAS/realizableKE/realizableKE.C | 10 +- .../turbulenceModels/RAS/v2f/v2f.C | 18 +-- .../ReynoldsStress/ReynoldsStress.C | 2 +- .../nutURoughWallFunctionFvPatchScalarField.C | 8 +- ...tUSpaldingWallFunctionFvPatchScalarField.C | 4 +- ...UTabulatedWallFunctionFvPatchScalarField.C | 4 +- .../nutUWallFunctionFvPatchScalarField.C | 8 +- ...tkAtmRoughWallFunctionFvPatchScalarField.C | 4 +- .../nutkRoughWallFunctionFvPatchScalarField.C | 4 +- .../nutkWallFunctionFvPatchScalarField.C | 4 +- .../nonlinearEddyViscosity.C | 6 +- src/finiteVolume/Make/options | 2 +- .../cfdTools/general/MRF/MRFZoneList.C | 10 +- .../general/SRF/SRFModel/SRFModel/SRFModel.C | 6 +- .../general/constrainHbyA/constrainHbyA.C | 7 +- .../general/fvOptions/fvOptionListTemplates.C | 6 +- .../porosityModel/porosityModel.C | 4 +- .../constraint/cyclic/cyclicFvPatchField.C | 2 +- .../cyclicACMI/cyclicACMIFvPatchField.C | 2 +- .../cyclicAMI/cyclicAMIFvPatchField.C | 2 +- .../jumpCyclic/jumpCyclicFvPatchField.C | 2 +- .../mappedField/mappedPatchFieldBase.C | 2 +- .../fvPatchField/fvPatchFieldNew.C | 2 +- .../gaussConvectionScheme.C | 4 +- .../EulerD2dt2Scheme/EulerD2dt2Scheme.C | 6 +- .../CoEulerDdtScheme/CoEulerDdtScheme.C | 12 +- .../CrankNicolsonDdtScheme.C | 10 +- .../EulerDdtScheme/EulerDdtScheme.C | 10 +- .../ddtSchemes/SLTSDdtScheme/SLTSDdtScheme.C | 12 +- .../backwardDdtScheme/backwardDdtScheme.C | 10 +- .../boundedDdtScheme/boundedDdtScheme.C | 30 ++-- .../ddtSchemes/ddtScheme/ddtScheme.C | 2 +- .../localEulerDdtScheme/localEulerDdtScheme.C | 10 +- .../gaussDivScheme/gaussDivScheme.C | 4 +- .../finiteVolume/fvc/fvcAverage.C | 3 +- src/finiteVolume/finiteVolume/fvc/fvcDdt.C | 18 +-- src/finiteVolume/finiteVolume/fvc/fvcDiv.C | 4 +- .../finiteVolume/fvc/fvcLaplacian.C | 6 +- .../finiteVolume/fvc/fvcMagSqrGradGrad.C | 3 +- .../finiteVolume/fvc/fvcMeshPhi.C | 8 +- .../finiteVolume/fvc/fvcReconstructMag.C | 5 +- .../finiteVolume/fvc/fvcSurfaceIntegrate.C | 4 +- src/finiteVolume/finiteVolume/fvm/fvmDdt.C | 8 +- .../finiteVolume/fvm/fvmLaplacian.C | 4 +- src/finiteVolume/finiteVolume/fvm/fvmSup.C | 8 +- .../LeastSquaresGrad/LeastSquaresGrad.C | 2 +- .../gradSchemes/fourthGrad/fourthGrad.C | 2 +- .../gradSchemes/gaussGrad/gaussGrad.C | 4 +- .../leastSquaresGrad/leastSquaresGrad.C | 2 +- .../cellLimitedGrad/cellLimitedGrads.C | 6 +- .../cellMDLimitedGrad/cellMDLimitedGrads.C | 6 +- .../faceLimitedGrad/faceLimitedGrads.C | 6 +- .../faceMDLimitedGrad/faceMDLimitedGrads.C | 6 +- .../gaussLaplacianScheme.C | 15 +- .../gaussLaplacianSchemes.C | 7 +- .../CentredFitSnGrad/CentredFitSnGradScheme.H | 2 +- .../correctedSnGrad/correctedSnGrad.C | 4 +- .../faceCorrectedSnGrad/faceCorrectedSnGrad.C | 6 +- .../snGradSchemes/snGradScheme/snGradScheme.C | 4 +- .../fvMatrices/fvMatrix/fvMatrix.C | 149 +++++++++--------- .../fvScalarMatrix/fvScalarMatrix.C | 6 +- .../extendedCellToFaceStencilTemplates.C | 2 +- ...extendedUpwindCellToFaceStencilTemplates.C | 2 +- .../extendedFaceToCellStencilTemplates.C | 2 +- src/finiteVolume/fvMesh/fvMesh.C | 2 +- src/finiteVolume/fvMesh/fvMeshGeometry.C | 2 +- .../constraint/cyclic/cyclicFvPatch.C | 4 +- .../constraint/cyclicACMI/cyclicACMIFvPatch.C | 4 +- .../constraint/cyclicAMI/cyclicAMIFvPatch.C | 4 +- .../fvMesh/fvPatches/fvPatch/fvPatch.C | 4 +- .../fvPatches/fvPatch/fvPatchTemplates.C | 2 +- .../Poisson/PoissonPatchDistMethod.C | 5 +- .../fvMesh/wallDist/wallDist/wallDist.C | 6 +- .../LimitedScheme/LimitedScheme.C | 2 +- .../limitedSchemes/PhiScheme/PhiScheme.C | 4 +- .../limitedSurfaceInterpolationScheme.C | 2 +- .../schemes/clippedLinear/clippedLinear.H | 5 +- .../schemes/cubic/cubic.H | 3 +- .../schemes/linearUpwind/linearUpwind.C | 2 +- .../schemes/linearUpwind/linearUpwindV.C | 2 +- .../schemes/localMax/localMax.H | 2 +- .../schemes/localMin/localMin.H | 2 +- .../schemes/midPoint/midPoint.H | 4 +- .../outletStabilised/outletStabilised.H | 4 +- .../schemes/pointLinear/pointLinear.C | 4 +- .../schemes/reverseLinear/reverseLinear.H | 5 +- .../schemes/skewCorrected/skewCorrected.H | 2 +- .../surfaceInterpolationScheme.C | 8 +- .../volPointInterpolate.C | 4 +- .../AMIInterpolation/AMIInterpolation.C | 4 +- ...pointToPointPlanarInterpolationTemplates.C | 2 +- 152 files changed, 677 insertions(+), 789 deletions(-) diff --git a/applications/solvers/lagrangian/DPMFoam/DPMTurbulenceModels/Make/options b/applications/solvers/lagrangian/DPMFoam/DPMTurbulenceModels/Make/options index 902afe59e..bd9cbcb61 100644 --- a/applications/solvers/lagrangian/DPMFoam/DPMTurbulenceModels/Make/options +++ b/applications/solvers/lagrangian/DPMFoam/DPMTurbulenceModels/Make/options @@ -1,4 +1,4 @@ -EXE_INC = \ +EXE_INC = -DCONST_TMP \ -I$(LIB_SRC)/transportModels/compressible/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/transportModels \ diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.C index c789d365b..6ea8dadf5 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.C @@ -201,7 +201,7 @@ Foam::MomentumTransferPhaseSystem::Kd { if (phase1 == &phase) { - tKd() += K; + tKd.ref() += K; } Swap(phase1, phase2); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels/Make/options b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels/Make/options index 5bdb4cea1..ec5ca1596 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels/Make/options +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels/Make/options @@ -1,4 +1,4 @@ -EXE_INC = \ +EXE_INC = -DCONST_TMP \ -I../multiphaseSystem/lnInclude \ -I../../phaseSystems/lnInclude \ -I../../interfacialModels/lnInclude\ diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/Make/options b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/Make/options index 3c3db948d..46e46e459 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/Make/options +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/Make/options @@ -1,4 +1,4 @@ -EXE_INC = \ +EXE_INC = -DCONST_TMP \ -I../twoPhaseSystem/lnInclude \ -I../../phaseSystems/lnInclude \ -I../../interfacialModels/lnInclude\ diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.C index 0d4a1128c..996f96cec 100755 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -83,7 +83,7 @@ alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::yPlusTherm ) const { tmp typsf(new scalarField(this->size())); - scalarField& ypsf = typsf(); + scalarField& ypsf = typsf.ref(); forAll(ypsf, faceI) { @@ -197,7 +197,7 @@ alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::calcAlphat scalarField yPlusTherm(this->yPlusTherm(P, Prat)); tmp talphatConv(new scalarField(this->size())); - scalarField& alphatConv = talphatConv(); + scalarField& alphatConv = talphatConv.ref(); // Populate boundary values forAll(alphatConv, faceI) diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C index 4a0d2290d..b88ec0923 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -132,7 +132,7 @@ Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::nu ) ); - volScalarField& nuf = tnu(); + volScalarField& nuf = tnu.ref(); forAll(D, celli) { diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C index 9f436cd5a..f3b7d5da1 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C @@ -273,7 +273,8 @@ Foam::RASModels::kineticTheoryModel::pPrime() const ) ); - volScalarField::GeometricBoundaryField& bpPrime = tpPrime().boundaryField(); + volScalarField::GeometricBoundaryField& bpPrime = + tpPrime.ref().boundaryField(); forAll(bpPrime, patchi) { diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C index c4ce9a758..a9eb50af3 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C @@ -164,7 +164,8 @@ Foam::RASModels::phasePressureModel::pPrime() const ) ); - volScalarField::GeometricBoundaryField& bpPrime = tpPrime().boundaryField(); + volScalarField::GeometricBoundaryField& bpPrime = + tpPrime.ref().boundaryField(); forAll(bpPrime, patchi) { @@ -192,7 +193,7 @@ Foam::RASModels::phasePressureModel::pPrimef() const ); surfaceScalarField::GeometricBoundaryField& bpPrime = - tpPrime().boundaryField(); + tpPrime.ref().boundaryField(); forAll(bpPrime, patchi) { diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/Make/options b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/Make/options index 84786bdc5..58f3051b4 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/Make/options +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/Make/options @@ -1,4 +1,4 @@ -EXE_INC = \ +EXE_INC = -DCONST_TMP \ -I../twoPhaseSystem/lnInclude \ -I../interfacialModels/lnInclude\ -I$(LIB_SRC)/transportModels/compressible/lnInclude \ diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C index 4a0d2290d..b88ec0923 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -132,7 +132,7 @@ Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::nu ) ); - volScalarField& nuf = tnu(); + volScalarField& nuf = tnu.ref(); forAll(D, celli) { diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C index de35e7900..6a5a474b3 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C @@ -278,7 +278,8 @@ Foam::RASModels::kineticTheoryModel::pPrime() const ) ); - volScalarField::GeometricBoundaryField& bpPrime = tpPrime().boundaryField(); + volScalarField::GeometricBoundaryField& bpPrime = + tpPrime.ref().boundaryField(); forAll(bpPrime, patchi) { diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C index 47364ab10..3c8b16027 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C @@ -170,7 +170,8 @@ Foam::RASModels::phasePressureModel::pPrime() const ) ); - volScalarField::GeometricBoundaryField& bpPrime = tpPrime().boundaryField(); + volScalarField::GeometricBoundaryField& bpPrime = + tpPrime.ref().boundaryField(); forAll(bpPrime, patchi) { @@ -198,7 +199,7 @@ Foam::RASModels::phasePressureModel::pPrimef() const ); surfaceScalarField::GeometricBoundaryField& bpPrime = - tpPrime().boundaryField(); + tpPrime.ref().boundaryField(); forAll(bpPrime, patchi) { diff --git a/src/OpenFOAM/db/IOstreams/token/tokenI.H b/src/OpenFOAM/db/IOstreams/token/tokenI.H index 6d34249a6..d2d9a39d7 100644 --- a/src/OpenFOAM/db/IOstreams/token/tokenI.H +++ b/src/OpenFOAM/db/IOstreams/token/tokenI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -45,7 +45,7 @@ inline void token::clear() } else if (type_ == COMPOUND) { - if (compoundTokenPtr_->okToDelete()) + if (compoundTokenPtr_->unique()) { delete compoundTokenPtr_; } diff --git a/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedFieldFunctions.C b/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedFieldFunctions.C index 678d42875..c5fffefcb 100644 --- a/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedFieldFunctions.C +++ b/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedFieldFunctions.C @@ -390,7 +390,7 @@ operator op \ ) \ ); \ \ - Foam::opFunc(tRes().field(), df1.field(), df2.field()); \ + Foam::opFunc(tRes.ref().field(), df1.field(), df2.field()); \ \ return tRes; \ } \ @@ -415,7 +415,7 @@ operator op \ df1.dimensions() op df2.dimensions() \ ); \ \ - Foam::opFunc(tRes().field(), df1.field(), df2.field()); \ + Foam::opFunc(tRes.ref().field(), df1.field(), df2.field()); \ \ reuseTmpDimensionedField::clear(tdf2); \ \ @@ -442,7 +442,7 @@ operator op \ df1.dimensions() op df2.dimensions() \ ); \ \ - Foam::opFunc(tRes().field(), df1.field(), df2.field()); \ + Foam::opFunc(tRes.ref().field(), df1.field(), df2.field()); \ \ reuseTmpDimensionedField::clear(tdf1); \ \ @@ -472,7 +472,7 @@ operator op \ df1.dimensions() op df2.dimensions() \ ); \ \ - Foam::opFunc(tRes().field(), df1.field(), df2.field()); \ + Foam::opFunc(tRes.ref().field(), df1.field(), df2.field()); \ \ reuseTmpTmpDimensionedField \ ::clear(tdf1, tdf2); \ @@ -505,7 +505,7 @@ operator op \ ) \ ); \ \ - Foam::opFunc(tRes().field(), df1.field(), dvs.value()); \ + Foam::opFunc(tRes.ref().field(), df1.field(), dvs.value()); \ \ return tRes; \ } \ @@ -542,7 +542,7 @@ operator op \ df1.dimensions() op dvs.dimensions() \ ); \ \ - Foam::opFunc(tRes().field(), df1.field(), dvs.value()); \ + Foam::opFunc(tRes.ref().field(), df1.field(), dvs.value()); \ \ reuseTmpDimensionedField::clear(tdf1); \ \ @@ -585,7 +585,7 @@ operator op \ ) \ ); \ \ - Foam::opFunc(tRes().field(), dvs.value(), df1.field()); \ + Foam::opFunc(tRes.ref().field(), dvs.value(), df1.field()); \ \ return tRes; \ } \ @@ -621,7 +621,7 @@ operator op \ dvs.dimensions() op df1.dimensions() \ ); \ \ - Foam::opFunc(tRes().field(), dvs.value(), df1.field()); \ + Foam::opFunc(tRes.ref().field(), dvs.value(), df1.field()); \ \ reuseTmpDimensionedField::clear(tdf1); \ \ diff --git a/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedFieldFunctionsM.C b/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedFieldFunctionsM.C index 4fe75afd3..743ea0de3 100644 --- a/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedFieldFunctionsM.C +++ b/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedFieldFunctionsM.C @@ -50,7 +50,7 @@ tmp> Func \ ) \ ); \ \ - Func(tRes().field(), df1.field()); \ + Func(tRes.ref().field(), df1.field()); \ \ return tRes; \ } \ @@ -73,7 +73,7 @@ tmp> Func \ ) \ ); \ \ - Func(tRes().field(), df1.field()); \ + Func(tRes.ref().field(), df1.field()); \ \ reuseTmpDimensionedField::clear(tdf1); \ \ @@ -106,7 +106,7 @@ tmp> operator Op \ ) \ ); \ \ - Foam::OpFunc(tRes().field(), df1.field()); \ + Foam::OpFunc(tRes.ref().field(), df1.field()); \ \ return tRes; \ } \ @@ -129,7 +129,7 @@ tmp> operator Op \ ) \ ); \ \ - Foam::OpFunc(tRes().field(), df1.field()); \ + Foam::OpFunc(tRes.ref().field(), df1.field()); \ \ reuseTmpDimensionedField::clear(tdf1); \ \ @@ -163,7 +163,7 @@ tmp> Func \ ) \ ); \ \ - Func(tRes().field(), df1.field(), df2.field()); \ + Func(tRes.ref().field(), df1.field(), df2.field()); \ \ return tRes; \ } \ @@ -187,7 +187,7 @@ tmp> Func \ ) \ ); \ \ - Func(tRes().field(), df1.field(), df2.field()); \ + Func(tRes.ref().field(), df1.field(), df2.field()); \ \ reuseTmpDimensionedField::clear(tdf2); \ \ @@ -213,7 +213,7 @@ tmp> Func \ ) \ ); \ \ - Func(tRes().field(), df1.field(), df2.field()); \ + Func(tRes.ref().field(), df1.field(), df2.field()); \ \ reuseTmpDimensionedField::clear(tdf1); \ \ @@ -242,7 +242,7 @@ tmp> Func \ ) \ ); \ \ - Func(tRes().field(), df1.field(), df2.field()); \ + Func(tRes.ref().field(), df1.field(), df2.field()); \ \ reuseTmpTmpDimensionedField \ ::clear(tdf1, tdf2); \ @@ -277,7 +277,7 @@ tmp> Func \ ) \ ); \ \ - Func(tRes().field(), dt1.value(), df2.field()); \ + Func(tRes.ref().field(), dt1.value(), df2.field()); \ \ return tRes; \ } \ @@ -312,7 +312,7 @@ tmp> Func \ ) \ ); \ \ - Func(tRes().field(), dt1.value(), df2.field()); \ + Func(tRes.ref().field(), dt1.value(), df2.field()); \ \ reuseTmpDimensionedField::clear(tdf2); \ \ @@ -354,7 +354,7 @@ tmp> Func \ ) \ ); \ \ - Func(tRes().field(), df1.field(), dt2.value()); \ + Func(tRes.ref().field(), df1.field(), dt2.value()); \ \ return tRes; \ } \ @@ -389,7 +389,7 @@ tmp> Func \ ) \ ); \ \ - Func(tRes().field(), df1.field(), dt2.value()); \ + Func(tRes.ref().field(), df1.field(), dt2.value()); \ \ reuseTmpDimensionedField::clear(tdf1); \ \ @@ -438,7 +438,7 @@ tmp> operator Op \ ) \ ); \ \ - Foam::OpFunc(tRes().field(), df1.field(), df2.field()); \ + Foam::OpFunc(tRes.ref().field(), df1.field(), df2.field()); \ \ return tRes; \ } \ @@ -462,7 +462,7 @@ tmp> operator Op \ ) \ ); \ \ - Foam::OpFunc(tRes().field(), df1.field(), df2.field()); \ + Foam::OpFunc(tRes.ref().field(), df1.field(), df2.field()); \ \ reuseTmpDimensionedField::clear(tdf2); \ \ @@ -488,7 +488,7 @@ tmp> operator Op \ ) \ ); \ \ - Foam::OpFunc(tRes().field(), df1.field(), df2.field()); \ + Foam::OpFunc(tRes.ref().field(), df1.field(), df2.field()); \ \ reuseTmpDimensionedField::clear(tdf1); \ \ @@ -517,7 +517,7 @@ tmp> operator Op \ ) \ ); \ \ - Foam::OpFunc(tRes().field(), df1.field(), df2.field()); \ + Foam::OpFunc(tRes.ref().field(), df1.field(), df2.field()); \ \ reuseTmpTmpDimensionedField:: \ clear(tdf1, tdf2); \ @@ -552,7 +552,7 @@ tmp> operator Op \ ) \ ); \ \ - Foam::OpFunc(tRes().field(), dt1.value(), df2.field()); \ + Foam::OpFunc(tRes.ref().field(), dt1.value(), df2.field()); \ \ return tRes; \ } \ @@ -587,7 +587,7 @@ tmp> operator Op \ ) \ ); \ \ - Foam::OpFunc(tRes().field(), dt1.value(), tdf2().field()); \ + Foam::OpFunc(tRes.ref().field(), dt1.value(), tdf2().field()); \ \ reuseTmpDimensionedField::clear(tdf2); \ \ @@ -629,7 +629,7 @@ tmp> operator Op \ ) \ ); \ \ - Foam::OpFunc(tRes().field(), df1.field(), dt2.value()); \ + Foam::OpFunc(tRes.ref().field(), df1.field(), dt2.value()); \ \ return tRes; \ } \ @@ -664,7 +664,7 @@ tmp> operator Op \ ) \ ); \ \ - Foam::OpFunc(tRes().field(), tdf1().field(), dt2.value()); \ + Foam::OpFunc(tRes.ref().field(), tdf1().field(), dt2.value()); \ \ reuseTmpDimensionedField::clear(tdf1); \ \ diff --git a/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedFieldReuseFunctions.H b/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedFieldReuseFunctions.H index 2df208e96..b56adf380 100644 --- a/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedFieldReuseFunctions.H +++ b/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedFieldReuseFunctions.H @@ -112,10 +112,7 @@ public: static void clear(const tmp>& tdf1) { - if (tdf1.isTmp()) - { - tdf1.ptr(); - } + tdf1.clear(); } }; @@ -212,10 +209,7 @@ public: ) { tdf1.clear(); - if (tdf2.isTmp()) - { - tdf2.ptr(); - } + tdf2.clear(); } }; @@ -267,10 +261,7 @@ public: const tmp>& tdf2 ) { - if (tdf1.isTmp()) - { - tdf1.ptr(); - } + tdf1.clear(); tdf2.clear(); } }; @@ -331,16 +322,8 @@ public: const tmp>& tdf2 ) { - if (tdf1.isTmp()) - { - tdf1.ptr(); - tdf2.clear(); - } - else if (tdf2.isTmp()) - { - tdf1.clear(); - tdf2.ptr(); - } + tdf1.clear(); + tdf2.clear(); } }; diff --git a/src/OpenFOAM/fields/DimensionedFields/DimensionedScalarField/DimensionedScalarField.C b/src/OpenFOAM/fields/DimensionedFields/DimensionedScalarField/DimensionedScalarField.C index 238f230da..f8e3c8047 100644 --- a/src/OpenFOAM/fields/DimensionedFields/DimensionedScalarField/DimensionedScalarField.C +++ b/src/OpenFOAM/fields/DimensionedFields/DimensionedScalarField/DimensionedScalarField.C @@ -57,7 +57,7 @@ tmp> stabilise ) ); - stabilise(tRes().field(), dsf.field(), ds.value()); + stabilise(tRes.ref().field(), dsf.field(), ds.value()); return tRes; } @@ -80,7 +80,7 @@ tmp> stabilise dsf.dimensions() + ds.dimensions() ); - stabilise(tRes().field(), dsf.field(), ds.value()); + stabilise(tRes.ref().field(), dsf.field(), ds.value()); reuseTmpDimensionedField::clear(tdsf); @@ -126,7 +126,7 @@ tmp> pow ) ); - pow(tPow().field(), dsf1.field(), dsf2.field()); + pow(tPow.ref().field(), dsf1.field(), dsf2.field()); return tPow; } @@ -153,7 +153,7 @@ tmp> pow ) ); - pow(tPow().field(), dsf1.field(), dsf2.field()); + pow(tPow.ref().field(), dsf1.field(), dsf2.field()); reuseTmpDimensionedField::clear(tdsf1); @@ -182,7 +182,7 @@ tmp> pow ) ); - pow(tPow().field(), dsf1.field(), dsf2.field()); + pow(tPow.ref().field(), dsf1.field(), dsf2.field()); reuseTmpDimensionedField::clear(tdsf2); @@ -213,7 +213,7 @@ tmp> pow ) ); - pow(tPow().field(), dsf1.field(), dsf2.field()); + pow(tPow.ref().field(), dsf1.field(), dsf2.field()); reuseTmpTmpDimensionedField::clear ( @@ -247,7 +247,7 @@ tmp> pow ) ); - pow(tPow().field(), dsf.field(), ds.value()); + pow(tPow.ref().field(), dsf.field(), ds.value()); return tPow; } @@ -269,7 +269,7 @@ tmp> pow pow(dsf.dimensions(), ds) ); - pow(tPow().field(), dsf.field(), ds.value()); + pow(tPow.ref().field(), dsf.field(), ds.value()); reuseTmpDimensionedField::clear(tdsf); @@ -319,7 +319,7 @@ tmp> pow ) ); - pow(tPow().field(), ds.value(), dsf.field()); + pow(tPow.ref().field(), ds.value(), dsf.field()); return tPow; } @@ -342,7 +342,7 @@ tmp> pow pow(ds, dsf.dimensions()) ); - pow(tPow().field(), ds.value(), dsf.field()); + pow(tPow.ref().field(), ds.value(), dsf.field()); reuseTmpDimensionedField::clear(tdsf); @@ -394,7 +394,7 @@ tmp> atan2 ) ); - atan2(tAtan2().field(), dsf1.field(), dsf2.field()); + atan2(tAtan2.ref().field(), dsf1.field(), dsf2.field()); return tAtan2; } @@ -417,7 +417,7 @@ tmp> atan2 atan2(dsf1.dimensions(), dsf2.dimensions()) ); - atan2(tAtan2().field(), dsf1.field(), dsf2.field()); + atan2(tAtan2.ref().field(), dsf1.field(), dsf2.field()); reuseTmpDimensionedField::clear(tdsf1); @@ -442,7 +442,7 @@ tmp> atan2 atan2(dsf1.dimensions(), dsf2.dimensions()) ); - atan2(tAtan2().field(), dsf1.field(), dsf2.field()); + atan2(tAtan2.ref().field(), dsf1.field(), dsf2.field()); reuseTmpDimensionedField::clear(tdsf2); @@ -469,7 +469,7 @@ tmp> atan2 atan2(dsf1.dimensions(), dsf2.dimensions()) ); - atan2(tAtan2().field(), dsf1.field(), dsf2.field()); + atan2(tAtan2.ref().field(), dsf1.field(), dsf2.field()); reuseTmpTmpDimensionedField::clear ( @@ -503,7 +503,7 @@ tmp> atan2 ) ); - atan2(tAtan2().field(), dsf.field(), ds.value()); + atan2(tAtan2.ref().field(), dsf.field(), ds.value()); return tAtan2; } @@ -525,7 +525,7 @@ tmp> atan2 atan2(dsf.dimensions(), ds) ); - atan2(tAtan2().field(), dsf.field(), ds.value()); + atan2(tAtan2.ref().field(), dsf.field(), ds.value()); reuseTmpDimensionedField::clear(tdsf); @@ -575,7 +575,7 @@ tmp> atan2 ) ); - atan2(tAtan2().field(), ds.value(), dsf.field()); + atan2(tAtan2.ref().field(), ds.value(), dsf.field()); return tAtan2; } @@ -598,7 +598,7 @@ tmp> atan2 atan2(ds, dsf.dimensions()) ); - atan2(tAtan2().field(), ds.value(), dsf.field()); + atan2(tAtan2.ref().field(), ds.value(), dsf.field()); reuseTmpDimensionedField::clear(tdsf); @@ -698,7 +698,7 @@ tmp> func \ ) \ ); \ \ - func(tFunc().field(), n, dsf.field()); \ + func(tFunc.ref().field(), n, dsf.field()); \ \ return tFunc; \ } \ @@ -729,7 +729,7 @@ tmp> func \ ) \ ); \ \ - func(tFunc().field(), n, dsf.field()); \ + func(tFunc.ref().field(), n, dsf.field()); \ \ reuseTmpDimensionedField::clear(tdsf); \ \ diff --git a/src/OpenFOAM/fields/FieldFields/FieldField/FieldField.C b/src/OpenFOAM/fields/FieldFields/FieldField/FieldField.C index fba85680a..c26bdd03a 100644 --- a/src/OpenFOAM/fields/FieldFields/FieldField/FieldField.C +++ b/src/OpenFOAM/fields/FieldFields/FieldField/FieldField.C @@ -232,7 +232,7 @@ FieldField::component NewCalculatedType(*this) ); - ::Foam::component(Component(), *this, d); + ::Foam::component(Component.ref(), *this, d); return Component; } @@ -274,7 +274,7 @@ tmp> FieldField::T() const FieldField::NewCalculatedType(*this) ); - ::Foam::T(transpose(), *this); + ::Foam::T(transpose.ref(), *this); return transpose; } diff --git a/src/OpenFOAM/fields/FieldFields/FieldField/FieldFieldFunctions.C b/src/OpenFOAM/fields/FieldFields/FieldField/FieldFieldFunctions.C index 02219f424..1b705e2b8 100644 --- a/src/OpenFOAM/fields/FieldFields/FieldField/FieldFieldFunctions.C +++ b/src/OpenFOAM/fields/FieldFields/FieldField/FieldFieldFunctions.C @@ -86,7 +86,7 @@ pow ( FieldField::NewCalculatedType(f) ); - pow(tRes(), f); + pow(tRes.ref(), f); return tRes; } @@ -102,7 +102,7 @@ pow ( reuseTmpFieldField::New(tf) ); - pow(tRes(), tf()); + pow(tRes.ref(), tf()); reuseTmpFieldField::clear(tf); return tRes; } @@ -130,7 +130,7 @@ sqr(const FieldField& f) ( FieldField::NewCalculatedType(f) ); - sqr(tRes(), f); + sqr(tRes.ref(), f); return tRes; } @@ -143,7 +143,7 @@ sqr(const tmp>& tf) ( reuseTmpFieldField::New(tf) ); - sqr(tRes(), tf()); + sqr(tRes.ref(), tf()); reuseTmpFieldField::clear(tf); return tRes; } @@ -166,7 +166,7 @@ tmp> magSqr(const FieldField& f) FieldField::NewCalculatedType(f) ); - magSqr(tRes(), f); + magSqr(tRes.ref(), f); return tRes; } @@ -178,7 +178,7 @@ tmp> magSqr(const tmp>& tf) reuseTmpFieldField::New(tf) ); - magSqr(tRes(), tf()); + magSqr(tRes.ref(), tf()); reuseTmpFieldField::clear(tf); return tRes; } @@ -201,7 +201,7 @@ tmp> mag(const FieldField& f) FieldField::NewCalculatedType(f) ); - mag(tRes(), f); + mag(tRes.ref(), f); return tRes; } @@ -213,7 +213,7 @@ tmp> mag(const tmp>& tf) reuseTmpFieldField::New(tf) ); - mag(tRes(), tf()); + mag(tRes.ref(), tf()); reuseTmpFieldField::clear(tf); return tRes; } @@ -243,7 +243,7 @@ tmp::cmptType>> cmptMax ( FieldField::NewCalculatedType(f) ); - cmptMax(tRes(), f); + cmptMax(tRes.ref(), f); return tRes; } @@ -258,7 +258,7 @@ tmp::cmptType>> cmptMax ( reuseTmpFieldField::New(tf) ); - cmptMax(tRes(), tf()); + cmptMax(tRes.ref(), tf()); reuseTmpFieldField::clear(tf); return tRes; } @@ -288,7 +288,7 @@ tmp::cmptType>> cmptMin ( FieldField::NewCalculatedType(f) ); - cmptMin(tRes(), f); + cmptMin(tRes.ref(), f); return tRes; } @@ -303,7 +303,7 @@ tmp::cmptType>> cmptMin ( reuseTmpFieldField::New(tf) ); - cmptMin(tRes(), tf()); + cmptMin(tRes.ref(), tf()); reuseTmpFieldField::clear(tf); return tRes; } @@ -333,7 +333,7 @@ tmp::cmptType>> cmptAv ( FieldField::NewCalculatedType(f) ); - cmptAv(tRes(), f); + cmptAv(tRes.ref(), f); return tRes; } @@ -348,7 +348,7 @@ tmp::cmptType>> cmptAv ( reuseTmpFieldField::New(tf) ); - cmptAv(tRes(), tf()); + cmptAv(tRes.ref(), tf()); reuseTmpFieldField::clear(tf); return tRes; } @@ -377,7 +377,7 @@ tmp> cmptMag ( FieldField::NewCalculatedType(f) ); - cmptMag(tRes(), f); + cmptMag(tRes.ref(), f); return tRes; } @@ -391,7 +391,7 @@ tmp> cmptMag ( reuseTmpFieldField::New(tf) ); - cmptMag(tRes(), tf()); + cmptMag(tRes.ref(), tf()); reuseTmpFieldField::clear(tf); return tRes; } @@ -667,7 +667,7 @@ operator op \ ( \ FieldField::NewCalculatedType(f1) \ ); \ - opFunc(tRes(), f1, f2); \ + opFunc(tRes.ref(), f1, f2); \ return tRes; \ } \ \ @@ -684,7 +684,7 @@ operator op \ ( \ reuseTmpFieldField::New(tf2) \ ); \ - opFunc(tRes(), f1, tf2()); \ + opFunc(tRes.ref(), f1, tf2()); \ reuseTmpFieldField::clear(tf2); \ return tRes; \ } \ @@ -708,7 +708,7 @@ operator op \ ( \ FieldField::NewCalculatedType(f1) \ ); \ - opFunc(tRes(), f1, tf2()); \ + opFunc(tRes.ref(), f1, tf2()); \ tf2.clear(); \ return tRes; \ } \ @@ -732,7 +732,7 @@ operator op \ ( \ reuseTmpFieldField::New(tf1) \ ); \ - opFunc(tRes(), tf1(), f2); \ + opFunc(tRes.ref(), tf1(), f2); \ reuseTmpFieldField::clear(tf1); \ return tRes; \ } \ @@ -757,7 +757,7 @@ operator op \ reuseTmpTmpFieldField::New \ (tf1, tf2) \ ); \ - opFunc(tRes(), tf1(), tf2()); \ + opFunc(tRes.ref(), tf1(), tf2()); \ reuseTmpTmpFieldField::clear \ (tf1, tf2); \ return tRes; \ @@ -792,7 +792,7 @@ operator op \ ( \ FieldField::NewCalculatedType(f1) \ ); \ - opFunc(tRes(), f1, static_cast(vs)); \ + opFunc(tRes.ref(), f1, static_cast(vs)); \ return tRes; \ } \ \ @@ -810,7 +810,7 @@ operator op \ ( \ reuseTmpFieldField::New(tf1) \ ); \ - opFunc(tRes(), tf1(), static_cast(vs)); \ + opFunc(tRes.ref(), tf1(), static_cast(vs)); \ reuseTmpFieldField::clear(tf1); \ return tRes; \ } \ @@ -844,7 +844,7 @@ operator op \ ( \ FieldField::NewCalculatedType(f1) \ ); \ - opFunc(tRes(), static_cast(vs), f1); \ + opFunc(tRes.ref(), static_cast(vs), f1); \ return tRes; \ } \ \ @@ -862,7 +862,7 @@ operator op \ ( \ reuseTmpFieldField::New(tf1) \ ); \ - opFunc(tRes(), static_cast(vs), tf1()); \ + opFunc(tRes.ref(), static_cast(vs), tf1()); \ reuseTmpFieldField::clear(tf1); \ return tRes; \ } diff --git a/src/OpenFOAM/fields/FieldFields/FieldField/FieldFieldFunctionsM.C b/src/OpenFOAM/fields/FieldFields/FieldField/FieldFieldFunctionsM.C index 03df3f8b9..1d4b59cbf 100644 --- a/src/OpenFOAM/fields/FieldFields/FieldField/FieldFieldFunctionsM.C +++ b/src/OpenFOAM/fields/FieldFields/FieldField/FieldFieldFunctionsM.C @@ -53,7 +53,7 @@ tmp> Func \ ( \ FieldField::NewCalculatedType(f) \ ); \ - Func(tRes(), f); \ + Func(tRes.ref(), f); \ return tRes; \ } \ \ @@ -67,7 +67,7 @@ tmp> Func \ ( \ reuseTmpFieldField::New(tf) \ ); \ - Func(tRes(), tf()); \ + Func(tRes.ref(), tf()); \ reuseTmpFieldField::clear(tf); \ return tRes; \ } @@ -100,7 +100,7 @@ tmp> operator Op \ ( \ FieldField::NewCalculatedType(f) \ ); \ - OpFunc(tRes(), f); \ + OpFunc(tRes.ref(), f); \ return tRes; \ } \ \ @@ -114,7 +114,7 @@ tmp> operator Op \ ( \ reuseTmpFieldField::New(tf) \ ); \ - OpFunc(tRes(), tf()); \ + OpFunc(tRes.ref(), tf()); \ reuseTmpFieldField::clear(tf); \ return tRes; \ } @@ -149,7 +149,7 @@ tmp> Func \ ( \ FieldField::NewCalculatedType(f1) \ ); \ - Func(tRes(), f1, f2); \ + Func(tRes.ref(), f1, f2); \ return tRes; \ } \ \ @@ -164,7 +164,7 @@ tmp> Func \ ( \ reuseTmpFieldField::New(tf2) \ ); \ - Func(tRes(), f1, tf2()); \ + Func(tRes.ref(), f1, tf2()); \ reuseTmpFieldField::clear(tf2); \ return tRes; \ } \ @@ -180,7 +180,7 @@ tmp> Func \ ( \ reuseTmpFieldField::New(tf1) \ ); \ - Func(tRes(), tf1(), f2); \ + Func(tRes.ref(), tf1(), f2); \ reuseTmpFieldField::clear(tf1); \ return tRes; \ } \ @@ -197,7 +197,7 @@ tmp> Func \ reuseTmpTmpFieldField:: \ New(tf1, tf2) \ ); \ - Func(tRes(), tf1(), tf2()); \ + Func(tRes.ref(), tf1(), tf2()); \ reuseTmpTmpFieldField:: \ clear(tf1, tf2); \ return tRes; \ @@ -233,7 +233,7 @@ tmp> Func \ ( \ FieldField::NewCalculatedType(f1) \ ); \ - Func(tRes(), f1, s); \ + Func(tRes.ref(), f1, s); \ return tRes; \ } \ \ @@ -248,7 +248,7 @@ tmp> Func \ ( \ reuseTmpFieldField::New(tf1) \ ); \ - Func(tRes(), tf1(), s); \ + Func(tRes.ref(), tf1(), s); \ reuseTmpFieldField::clear(tf1); \ return tRes; \ } @@ -281,7 +281,7 @@ tmp> Func \ ( \ FieldField::NewCalculatedType(f2) \ ); \ - Func(tRes(), s, f2); \ + Func(tRes.ref(), s, f2); \ return tRes; \ } \ \ @@ -296,7 +296,7 @@ tmp> Func \ ( \ reuseTmpFieldField::New(tf2) \ ); \ - Func(tRes(), s, tf2()); \ + Func(tRes.ref(), s, tf2()); \ reuseTmpFieldField::clear(tf2); \ return tRes; \ } @@ -336,7 +336,7 @@ tmp> operator Op \ ( \ FieldField::NewCalculatedType(f1) \ ); \ - OpFunc(tRes(), f1, f2); \ + OpFunc(tRes.ref(), f1, f2); \ return tRes; \ } \ \ @@ -351,7 +351,7 @@ tmp> operator Op \ ( \ reuseTmpFieldField::New(tf2) \ ); \ - OpFunc(tRes(), f1, tf2()); \ + OpFunc(tRes.ref(), f1, tf2()); \ reuseTmpFieldField::clear(tf2); \ return tRes; \ } \ @@ -367,7 +367,7 @@ tmp> operator Op \ ( \ reuseTmpFieldField::New(tf1) \ ); \ - OpFunc(tRes(), tf1(), f2); \ + OpFunc(tRes.ref(), tf1(), f2); \ reuseTmpFieldField::clear(tf1); \ return tRes; \ } \ @@ -384,7 +384,7 @@ tmp> operator Op \ reuseTmpTmpFieldField:: \ New(tf1, tf2) \ ); \ - OpFunc(tRes(), tf1(), tf2()); \ + OpFunc(tRes.ref(), tf1(), tf2()); \ reuseTmpTmpFieldField:: \ clear(tf1, tf2); \ return tRes; \ @@ -420,7 +420,7 @@ tmp> operator Op \ ( \ FieldField::NewCalculatedType(f2) \ ); \ - OpFunc(tRes(), s, f2); \ + OpFunc(tRes.ref(), s, f2); \ return tRes; \ } \ \ @@ -435,7 +435,7 @@ tmp> operator Op \ ( \ reuseTmpFieldField::New(tf2) \ ); \ - OpFunc(tRes(), s, tf2()); \ + OpFunc(tRes.ref(), s, tf2()); \ reuseTmpFieldField::clear(tf2); \ return tRes; \ } @@ -468,7 +468,7 @@ tmp> operator Op \ ( \ FieldField::NewCalculatedType(f1) \ ); \ - OpFunc(tRes(), f1, s); \ + OpFunc(tRes.ref(), f1, s); \ return tRes; \ } \ \ @@ -483,7 +483,7 @@ tmp> operator Op \ ( \ reuseTmpFieldField::New(tf1) \ ); \ - OpFunc(tRes(), tf1(), s); \ + OpFunc(tRes.ref(), tf1(), s); \ reuseTmpFieldField::clear(tf1); \ return tRes; \ } diff --git a/src/OpenFOAM/fields/FieldFields/FieldField/FieldFieldReuseFunctions.H b/src/OpenFOAM/fields/FieldFields/FieldField/FieldFieldReuseFunctions.H index 3e7b3fe66..672006b45 100644 --- a/src/OpenFOAM/fields/FieldFields/FieldField/FieldFieldReuseFunctions.H +++ b/src/OpenFOAM/fields/FieldFields/FieldField/FieldFieldReuseFunctions.H @@ -80,7 +80,7 @@ public: if (initRet) { - rtf() = tf1(); + rtf.ref() = tf1(); } return rtf; @@ -89,10 +89,7 @@ public: static void clear(const tmp>& tf1) { - if (tf1.isTmp()) - { - tf1.ptr(); - } + tf1.clear(); } }; @@ -164,10 +161,7 @@ public: ) { tf1.clear(); - if (tf2.isTmp()) - { - tf2.ptr(); - } + tf2.clear(); } }; @@ -202,10 +196,7 @@ public: const tmp>& tf2 ) { - if (tf1.isTmp()) - { - tf1.ptr(); - } + tf1.clear(); tf2.clear(); } }; @@ -245,16 +236,8 @@ public: const tmp>& tf2 ) { - if (tf1.isTmp()) - { - tf1.ptr(); - tf2.clear(); - } - else if (tf2.isTmp()) - { - tf1.clear(); - tf2.ptr(); - } + tf1.clear(); + tf2.clear(); } }; diff --git a/src/OpenFOAM/fields/Fields/Field/Field.C b/src/OpenFOAM/fields/Fields/Field/Field.C index 9f8f3da08..596f74f1c 100644 --- a/src/OpenFOAM/fields/Fields/Field/Field.C +++ b/src/OpenFOAM/fields/Fields/Field/Field.C @@ -690,10 +690,7 @@ void Foam::Field::operator=(const tmp& rhs) << abort(FatalError); } - // This is dodgy stuff, don't try it at home. - Field* fieldPtr = rhs.ptr(); - List::transfer(*fieldPtr); - delete fieldPtr; + List::operator=(rhs()); } diff --git a/src/OpenFOAM/fields/Fields/Field/FieldReuseFunctions.H b/src/OpenFOAM/fields/Fields/Field/FieldReuseFunctions.H index 8bceb6885..4eedccdc4 100644 --- a/src/OpenFOAM/fields/Fields/Field/FieldReuseFunctions.H +++ b/src/OpenFOAM/fields/Fields/Field/FieldReuseFunctions.H @@ -80,10 +80,7 @@ public: static void clear(const tmp>& tf1) { - if (tf1.isTmp()) - { - tf1.ptr(); - } + tf1.clear(); } }; @@ -142,10 +139,7 @@ public: ) { tf1.clear(); - if (tf2.isTmp()) - { - tf2.ptr(); - } + tf2.clear(); } }; @@ -177,10 +171,7 @@ public: const tmp>& tf2 ) { - if (tf1.isTmp()) - { - tf1.ptr(); - } + tf1.clear(); tf2.clear(); } }; @@ -217,16 +208,8 @@ public: const tmp>& tf2 ) { - if (tf1.isTmp()) - { - tf1.ptr(); - tf2.clear(); - } - else if (tf2.isTmp()) - { - tf1.clear(); - tf2.ptr(); - } + tf1.clear(); + tf2.clear(); } }; diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C index 14098437e..959a1182b 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C @@ -992,8 +992,8 @@ Foam::GeometricField::T() const ) ); - Foam::T(result().internalField(), internalField()); - Foam::T(result().boundaryField(), boundaryField()); + Foam::T(result.ref().internalField(), internalField()); + Foam::T(result.ref().boundaryField(), boundaryField()); return result; } @@ -1029,8 +1029,8 @@ Foam::GeometricField::component ) ); - Foam::component(Component().internalField(), internalField(), d); - Foam::component(Component().boundaryField(), boundaryField(), d); + Foam::component(Component.ref().internalField(), internalField(), d); + Foam::component(Component.ref().boundaryField(), boundaryField(), d); return Component; } diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricFieldFunctions.C b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricFieldFunctions.C index a315c3e3c..59b356e6f 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricFieldFunctions.C +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricFieldFunctions.C @@ -104,7 +104,7 @@ pow ) ); - pow(tPow(), gf); + pow(tPow.ref(), gf); return tPow; } @@ -139,7 +139,7 @@ pow ) ); - pow(tPow(), gf); + pow(tPow.ref(), gf); tgf.clear(); @@ -190,7 +190,7 @@ sqr(const GeometricField& gf) ) ); - sqr(tSqr(), gf); + sqr(tSqr.ref(), gf); return tSqr; } @@ -228,7 +228,7 @@ sqr(const tmp>& tgf) ) ); - sqr(tSqr(), gf); + sqr(tSqr.ref(), gf); tgf.clear(); @@ -270,7 +270,7 @@ tmp> magSqr ) ); - magSqr(tMagSqr(), gf); + magSqr(tMagSqr.ref(), gf); return tMagSqr; } @@ -300,7 +300,7 @@ tmp> magSqr ) ); - magSqr(tMagSqr(), gf); + magSqr(tMagSqr.ref(), gf); tgf.clear(); @@ -342,7 +342,7 @@ tmp> mag ) ); - mag(tMag(), gf); + mag(tMag.ref(), gf); return tMag; } @@ -372,7 +372,7 @@ tmp> mag ) ); - mag(tMag(), gf); + mag(tMag.ref(), gf); tgf.clear(); @@ -428,7 +428,7 @@ cmptAv(const GeometricField& gf) ) ); - cmptAv(CmptAv(), gf); + cmptAv(CmptAv.ref(), gf); return CmptAv; } @@ -467,7 +467,7 @@ cmptAv(const tmp>& tgf) ) ); - cmptAv(CmptAv(), gf); + cmptAv(CmptAv.ref(), gf); tgf.clear(); @@ -589,7 +589,7 @@ template \ class PatchField, class GeoMesh> \ tmp \ < \ - GeometricField::type, PatchField, GeoMesh> \ + GeometricField::type, PatchField, GeoMesh> \ > \ operator op \ ( \ @@ -615,7 +615,7 @@ operator op \ ) \ ); \ \ - Foam::opFunc(tRes(), gf1, gf2); \ + Foam::opFunc(tRes.ref(), gf1, gf2); \ \ return tRes; \ } \ @@ -644,7 +644,7 @@ operator op \ gf1.dimensions() op gf2.dimensions() \ ); \ \ - Foam::opFunc(tRes(), gf1, gf2); \ + Foam::opFunc(tRes.ref(), gf1, gf2); \ \ reuseTmpGeometricField \ ::clear(tgf2); \ @@ -676,7 +676,7 @@ operator op \ gf1.dimensions() op gf2.dimensions() \ ); \ \ - Foam::opFunc(tRes(), gf1, gf2); \ + Foam::opFunc(tRes.ref(), gf1, gf2); \ \ reuseTmpGeometricField \ ::clear(tgf1); \ @@ -711,7 +711,7 @@ operator op \ gf1.dimensions() op gf2.dimensions() \ ); \ \ - Foam::opFunc(tRes(), gf1, gf2); \ + Foam::opFunc(tRes.ref(), gf1, gf2); \ \ reuseTmpTmpGeometricField \ \ @@ -762,7 +762,7 @@ operator op \ ) \ ); \ \ - Foam::opFunc(tRes(), gf1, dvs); \ + Foam::opFunc(tRes.ref(), gf1, dvs); \ \ return tRes; \ } \ @@ -807,7 +807,7 @@ operator op \ gf1.dimensions() op dvs.dimensions() \ ); \ \ - Foam::opFunc(tRes(), gf1, dvs); \ + Foam::opFunc(tRes.ref(), gf1, dvs); \ \ reuseTmpGeometricField \ ::clear(tgf1); \ @@ -875,7 +875,7 @@ operator op \ ) \ ); \ \ - Foam::opFunc(tRes(), dvs, gf1); \ + Foam::opFunc(tRes.ref(), dvs, gf1); \ \ return tRes; \ } \ @@ -919,7 +919,7 @@ operator op \ dvs.dimensions() op gf1.dimensions() \ ); \ \ - Foam::opFunc(tRes(), dvs, gf1); \ + Foam::opFunc(tRes.ref(), dvs, gf1); \ \ reuseTmpGeometricField \ ::clear(tgf1); \ diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricFieldFunctionsM.C b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricFieldFunctionsM.C index 01d84a1a6..344e79e8e 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricFieldFunctionsM.C +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricFieldFunctionsM.C @@ -68,7 +68,7 @@ tmp> Func \ ) \ ); \ \ - Foam::Func(tRes(), gf1); \ + Foam::Func(tRes.ref(), gf1); \ \ return tRes; \ } \ @@ -91,7 +91,7 @@ tmp> Func \ ) \ ); \ \ - Foam::Func(tRes(), gf1); \ + Foam::Func(tRes.ref(), gf1); \ \ reuseTmpGeometricField \ ::clear(tgf1); \ @@ -138,7 +138,7 @@ tmp> operator Op \ ) \ ); \ \ - Foam::OpFunc(tRes(), gf1); \ + Foam::OpFunc(tRes.ref(), gf1); \ \ return tRes; \ } \ @@ -161,7 +161,7 @@ tmp> operator Op \ ) \ ); \ \ - Foam::OpFunc(tRes(), gf1); \ + Foam::OpFunc(tRes.ref(), gf1); \ \ reuseTmpGeometricField \ ::clear(tgf1); \ @@ -210,7 +210,7 @@ tmp> Func \ ) \ ); \ \ - Foam::Func(tRes(), gf1, gf2); \ + Foam::Func(tRes.ref(), gf1, gf2); \ \ return tRes; \ } \ @@ -234,7 +234,7 @@ tmp> Func \ ) \ ); \ \ - Foam::Func(tRes(), gf1, gf2); \ + Foam::Func(tRes.ref(), gf1, gf2); \ \ reuseTmpGeometricField \ ::clear(tgf2); \ @@ -261,7 +261,7 @@ tmp> Func \ ) \ ); \ \ - Foam::Func(tRes(), gf1, gf2); \ + Foam::Func(tRes.ref(), gf1, gf2); \ \ reuseTmpGeometricField \ ::clear(tgf1); \ @@ -292,7 +292,7 @@ tmp> Func \ ) \ ); \ \ - Foam::Func(tRes(), gf1, gf2); \ + Foam::Func(tRes.ref(), gf1, gf2); \ \ reuseTmpTmpGeometricField \ \ @@ -341,7 +341,7 @@ tmp> Func \ ) \ ); \ \ - Foam::Func(tRes(), dt1, gf2); \ + Foam::Func(tRes.ref(), dt1, gf2); \ \ return tRes; \ } \ @@ -376,7 +376,7 @@ tmp> Func \ ) \ ); \ \ - Foam::Func(tRes(), dt1, gf2); \ + Foam::Func(tRes.ref(), dt1, gf2); \ \ reuseTmpGeometricField \ ::clear(tgf2); \ @@ -433,7 +433,7 @@ tmp> Func \ ) \ ); \ \ - Foam::Func(tRes(), gf1, dt2); \ + Foam::Func(tRes.ref(), gf1, dt2); \ \ return tRes; \ } \ @@ -468,7 +468,7 @@ tmp> Func \ ) \ ); \ \ - Foam::Func(tRes(), gf1, dt2); \ + Foam::Func(tRes.ref(), gf1, dt2); \ \ reuseTmpGeometricField \ ::clear(tgf1); \ @@ -534,7 +534,7 @@ tmp> operator Op \ ) \ ); \ \ - Foam::OpFunc(tRes(), gf1, gf2); \ + Foam::OpFunc(tRes.ref(), gf1, gf2); \ \ return tRes; \ } \ @@ -558,7 +558,7 @@ tmp> operator Op \ ) \ ); \ \ - Foam::OpFunc(tRes(), gf1, gf2); \ + Foam::OpFunc(tRes.ref(), gf1, gf2); \ \ reuseTmpGeometricField \ ::clear(tgf2); \ @@ -585,7 +585,7 @@ tmp> operator Op \ ) \ ); \ \ - Foam::OpFunc(tRes(), gf1, gf2); \ + Foam::OpFunc(tRes.ref(), gf1, gf2); \ \ reuseTmpGeometricField \ ::clear(tgf1); \ @@ -615,7 +615,7 @@ tmp> operator Op \ ) \ ); \ \ - Foam::OpFunc(tRes(), gf1, gf2); \ + Foam::OpFunc(tRes.ref(), gf1, gf2); \ \ reuseTmpTmpGeometricField \ \ @@ -627,7 +627,7 @@ tmp> operator Op \ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpName, OpFunc) \ +#define BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpName, OpFunc) \ \ TEMPLATE \ void OpFunc \ @@ -665,7 +665,7 @@ tmp> operator Op \ ) \ ); \ \ - Foam::OpFunc(tRes(), dt1, gf2); \ + Foam::OpFunc(tRes.ref(), dt1, gf2); \ \ return tRes; \ } \ @@ -700,7 +700,7 @@ tmp> operator Op \ ) \ ); \ \ - Foam::OpFunc(tRes(), dt1, gf2); \ + Foam::OpFunc(tRes.ref(), dt1, gf2); \ \ reuseTmpGeometricField \ ::clear(tgf2); \ @@ -719,7 +719,7 @@ tmp> operator Op \ } -#define BINARY_TYPE_OPERATOR_FS(ReturnType, Type1, Type2, Op, OpName, OpFunc) \ +#define BINARY_TYPE_OPERATOR_FS(ReturnType, Type1, Type2, Op, OpName, OpFunc) \ \ TEMPLATE \ void OpFunc \ @@ -757,7 +757,7 @@ tmp> operator Op \ ) \ ); \ \ - Foam::OpFunc(tRes(), gf1, dt2); \ + Foam::OpFunc(tRes.ref(), gf1, dt2); \ \ return tRes; \ } \ @@ -792,7 +792,7 @@ tmp> operator Op \ ) \ ); \ \ - Foam::OpFunc(tRes(), gf1, dt2); \ + Foam::OpFunc(tRes.ref(), gf1, dt2); \ \ reuseTmpGeometricField \ ::clear(tgf1); \ diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricFieldReuseFunctions.H b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricFieldReuseFunctions.H index 563dc9b19..5429c4f44 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricFieldReuseFunctions.H +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricFieldReuseFunctions.H @@ -162,7 +162,7 @@ public: if (initRet) { - rtgf() == tgf1(); + rtgf.ref() == tgf1(); } return rtgf; @@ -174,10 +174,7 @@ public: const tmp>& tgf1 ) { - if (reusable(tgf1)) - { - tgf1.ptr(); - } + tgf1.clear(); } }; @@ -290,10 +287,7 @@ public: ) { tgf1.clear(); - if (reusable(tgf2)) - { - tgf2.ptr(); - } + tgf2.clear(); } }; @@ -351,10 +345,7 @@ public: const tmp>& tgf2 ) { - if (reusable(tgf1)) - { - tgf1.ptr(); - } + tgf1.clear(); tgf2.clear(); } }; @@ -415,16 +406,8 @@ public: const tmp>& tgf2 ) { - if (reusable(tgf1)) - { - tgf1.ptr(); - tgf2.clear(); - } - else if (reusable(tgf2)) - { - tgf1.clear(); - tgf2.ptr(); - } + tgf1.clear(); + tgf2.clear(); } }; diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricScalarField/GeometricScalarField.C b/src/OpenFOAM/fields/GeometricFields/GeometricScalarField/GeometricScalarField.C index a5a0d9b5c..add1ed8df 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricScalarField/GeometricScalarField.C +++ b/src/OpenFOAM/fields/GeometricFields/GeometricScalarField/GeometricScalarField.C @@ -72,7 +72,7 @@ tmp> stabilise ) ); - stabilise(tRes(), gsf, ds); + stabilise(tRes.ref(), gsf, ds); return tRes; } @@ -97,7 +97,7 @@ tmp> stabilise ) ); - stabilise(tRes(), gsf, ds); + stabilise(tRes.ref(), gsf, ds); reuseTmpGeometricField::clear(tgsf); @@ -159,7 +159,7 @@ tmp> pow ) ); - pow(tPow(), gsf1, gsf2); + pow(tPow.ref(), gsf1, gsf2); return tPow; } @@ -188,7 +188,7 @@ tmp> pow ) ); - pow(tPow(), gsf1, gsf2); + pow(tPow.ref(), gsf1, gsf2); reuseTmpGeometricField::clear(tgsf1); @@ -219,7 +219,7 @@ tmp> pow ) ); - pow(tPow(), gsf1, gsf2); + pow(tPow.ref(), gsf1, gsf2); reuseTmpGeometricField::clear(tgsf2); @@ -252,7 +252,7 @@ tmp> pow ) ); - pow(tPow(), gsf1, gsf2); + pow(tPow.ref(), gsf1, gsf2); reuseTmpTmpGeometricField @@ -299,7 +299,7 @@ tmp> pow ) ); - pow(tPow(), gsf, ds); + pow(tPow.ref(), gsf, ds); return tPow; } @@ -323,7 +323,7 @@ tmp> pow ) ); - pow(tPow(), gsf, ds); + pow(tPow.ref(), gsf, ds); reuseTmpGeometricField::clear(tgsf); @@ -388,7 +388,7 @@ tmp> pow ) ); - pow(tPow(), ds, gsf); + pow(tPow.ref(), ds, gsf); return tPow; } @@ -413,7 +413,7 @@ tmp> pow ) ); - pow(tPow(), ds, gsf); + pow(tPow.ref(), ds, gsf); reuseTmpGeometricField::clear(tgsf); @@ -480,7 +480,7 @@ tmp> atan2 ) ); - atan2(tAtan2(), gsf1, gsf2); + atan2(tAtan2.ref(), gsf1, gsf2); return tAtan2; } @@ -505,7 +505,7 @@ tmp> atan2 ) ); - atan2(tAtan2(), gsf1, gsf2); + atan2(tAtan2.ref(), gsf1, gsf2); reuseTmpGeometricField::clear(tgsf1); @@ -532,7 +532,7 @@ tmp> atan2 ) ); - atan2(tAtan2(), gsf1, gsf2); + atan2(tAtan2.ref(), gsf1, gsf2); reuseTmpGeometricField::clear(tgsf2); @@ -561,7 +561,7 @@ tmp> atan2 ) ); - atan2(tAtan2(), gsf1, gsf2); + atan2(tAtan2.ref(), gsf1, gsf2); reuseTmpTmpGeometricField @@ -608,7 +608,7 @@ tmp> atan2 ) ); - atan2(tAtan2(), gsf, ds); + atan2(tAtan2.ref(), gsf, ds); return tAtan2; } @@ -632,7 +632,7 @@ tmp> atan2 ) ); - atan2(tAtan2(), gsf, ds); + atan2(tAtan2.ref(), gsf, ds); reuseTmpGeometricField::clear(tgsf); @@ -697,7 +697,7 @@ tmp> atan2 ) ); - atan2(tAtan2(), ds, gsf); + atan2(tAtan2.ref(), ds, gsf); return tAtan2; } @@ -722,7 +722,7 @@ tmp> atan2 ) ); - atan2(tAtan2(), ds, gsf); + atan2(tAtan2.ref(), ds, gsf); reuseTmpGeometricField::clear(tgsf); @@ -836,7 +836,7 @@ tmp> func \ ) \ ); \ \ - func(tFunc(), n, gsf); \ + func(tFunc.ref(), n, gsf); \ \ return tFunc; \ } \ @@ -867,7 +867,7 @@ tmp> func \ ) \ ); \ \ - func(tFunc(), n, gsf); \ + func(tFunc.ref(), n, gsf); \ \ reuseTmpGeometricField \ ::clear(tgsf); \ diff --git a/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.C b/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.C index 5d7766e4f..e347e2bf4 100644 --- a/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.C +++ b/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.C @@ -49,8 +49,7 @@ slicedBoundaryField ( new FieldField(mesh.boundary().size()) ); - - FieldField& bf = tbf(); + FieldField& bf = tbf.ref(); forAll(mesh.boundary(), patchi) { @@ -126,8 +125,7 @@ slicedBoundaryField ( new FieldField(mesh.boundary().size()) ); - - FieldField& bf = tbf(); + FieldField& bf = tbf.ref(); forAll(mesh.boundary(), patchi) { diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixTemplates.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixTemplates.C index f674bba7a..739251c35 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixTemplates.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixTemplates.C @@ -40,7 +40,7 @@ Foam::tmp> Foam::lduMatrix::H(const Field& psi) const if (lowerPtr_ || upperPtr_) { - Field & Hpsi = tHpsi(); + Field & Hpsi = tHpsi.ref(); Type* __restrict__ HpsiPtr = Hpsi.begin(); @@ -87,7 +87,7 @@ Foam::lduMatrix::faceH(const Field& psi) const const labelUList& u = lduAddr().upperAddr(); tmp> tfaceHpsi(new Field (Lower.size())); - Field & faceHpsi = tfaceHpsi(); + Field & faceHpsi = tfaceHpsi.ref(); for (label face=0; face&&); - //- Construct copy and increment reference count inline tmp(const tmp&); @@ -90,7 +83,7 @@ public: inline tmp(const tmp&, bool allowTransfer); - //- Destructor, delete object when reference count == 0 + //- Destructor: deletes temporary object when the reference count is 0 inline ~tmp(); diff --git a/src/OpenFOAM/memory/tmp/tmpI.H b/src/OpenFOAM/memory/tmp/tmpI.H index bb6fdbe90..4d0ad7561 100644 --- a/src/OpenFOAM/memory/tmp/tmpI.H +++ b/src/OpenFOAM/memory/tmp/tmpI.H @@ -36,14 +36,6 @@ inline Foam::tmp::tmp(T* tPtr) {} -template -inline Foam::tmp::tmp(T&& tRef) -: - type_(REF), - ptr_(&tRef) -{} - - template inline Foam::tmp::tmp(const T& tRef) : @@ -52,29 +44,6 @@ inline Foam::tmp::tmp(const T& tRef) {} -template -inline Foam::tmp::tmp(tmp&& t) -: - type_(t.type_), - ptr_(t.ptr_) -{ - if (isTmp()) - { - if (ptr_) - { - ptr_->operator++(); - } - else - { - FatalErrorInFunction - << "Attempted copy of a deallocated temporary" - << " of type " << typeid(T).name() - << abort(FatalError); - } - } -} - - template inline Foam::tmp::tmp(const tmp& t) : @@ -95,10 +64,6 @@ inline Foam::tmp::tmp(const tmp& t) << abort(FatalError); } } - else if (type_ == REF) - { - type_ = CONST_REF; - } } @@ -137,7 +102,7 @@ inline Foam::tmp::~tmp() { if (isTmp() && ptr_) { - if (ptr_->okToDelete()) + if (ptr_->unique()) { delete ptr_; ptr_ = 0; @@ -187,13 +152,10 @@ inline T& Foam::tmp::ref() return *ptr_; } - else if (type_ == REF) - { - return *ptr_; - } else { - FatalErrorInFunction << "Const object cast to non-const" + FatalErrorInFunction + << "Attempt to acquire non-const reference to const object" << abort(FatalError); return *ptr_; } @@ -205,19 +167,25 @@ inline T* Foam::tmp::ptr() const { if (isTmp()) { - if (!ptr_) - { - FatalErrorInFunction - << "Temporary of type " << typeid(T).name() << " deallocated" - << abort(FatalError); - } + if (!ptr_) + { + FatalErrorInFunction + << "Temporary of type " << typeid(T).name() << " deallocated" + << abort(FatalError); + } - T* ptr = ptr_; - ptr_ = 0; + if (!ptr_->unique()) + { + FatalErrorInFunction + << "Attempt to acquire pointer to object referred to" + " by multiple 'tmp's" + << abort(FatalError); + } - ptr->resetRefCount(); + T* ptr = ptr_; + ptr_ = 0; - return ptr; + return ptr; } else { @@ -229,10 +197,18 @@ inline T* Foam::tmp::ptr() const template inline void Foam::tmp::clear() const { - if (isTmp() && ptr_) // Skip this bit: && ptr_->okToDelete()) + if (isTmp() && ptr_) { - delete ptr_; - ptr_ = 0; + if (ptr_->unique()) + { + delete ptr_; + ptr_ = 0; + } + else + { + ptr_->operator--(); + ptr_ = 0; + } } } @@ -307,10 +283,6 @@ inline T* Foam::tmp::operator->() return ptr_; } - else if (type_ == REF) - { - return ptr_; - } else { FatalErrorInFunction << "Const object cast to non-const" @@ -346,7 +318,7 @@ inline void Foam::tmp::operator=(T* tPtr) { if (isTmp() && ptr_) { - if (ptr_->okToDelete()) + if (ptr_->unique()) { delete ptr_; ptr_ = 0; @@ -377,7 +349,7 @@ inline void Foam::tmp::operator=(const tmp& t) { if (isTmp() && ptr_) { - if (ptr_->okToDelete()) + if (ptr_->unique()) { delete ptr_; ptr_ = 0; @@ -401,8 +373,8 @@ inline void Foam::tmp::operator=(const tmp& t) } ptr_ = t.ptr_; - const_cast&>(t).ptr_ = 0; - ptr_->resetRefCount(); + + ptr_->operator++(); } else { diff --git a/src/TurbulenceModels/compressible/Make/options b/src/TurbulenceModels/compressible/Make/options index 4a6578d62..a6401963f 100644 --- a/src/TurbulenceModels/compressible/Make/options +++ b/src/TurbulenceModels/compressible/Make/options @@ -1,4 +1,4 @@ -EXE_INC = \ +EXE_INC = -DCONST_TMP \ -I../turbulenceModels/lnInclude \ -I$(LIB_SRC)/transportModels/compressible/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C index 7612f746e..e2cdfdfc0 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -257,7 +257,7 @@ baffleThickness() const ( new scalarField(nbrField.baffleThickness()) ); - scalarField& thickness = tthickness(); + scalarField& thickness = tthickness.ref(); mapDist.distribute(thickness); return tthickness; } @@ -285,7 +285,7 @@ tmp thermalBaffle1DFvPatchScalarField::Qs() const ); tmp tQs(new scalarField(nbrField.Qs())); - scalarField& Qs = tQs(); + scalarField& Qs = tQs.ref(); mapDist.distribute(Qs); return tQs; } diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C index ad3705918..f5940847c 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C @@ -195,17 +195,17 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs() if (contactRes_ == 0.0) { - nbrIntFld() = nbrField.patchInternalField(); - nbrKDelta() = nbrField.kappa(nbrField)*nbrPatch.deltaCoeffs(); + nbrIntFld.ref() = nbrField.patchInternalField(); + nbrKDelta.ref() = nbrField.kappa(nbrField)*nbrPatch.deltaCoeffs(); } else { - nbrIntFld() = nbrField; - nbrKDelta() = contactRes_; + nbrIntFld.ref() = nbrField; + nbrKDelta.ref() = contactRes_; } - mpp.distribute(nbrIntFld()); - mpp.distribute(nbrKDelta()); + mpp.distribute(nbrIntFld.ref()); + mpp.distribute(nbrKDelta.ref()); tmp myKDelta = kappa(*this)*patch().deltaCoeffs(); diff --git a/src/TurbulenceModels/incompressible/Make/options b/src/TurbulenceModels/incompressible/Make/options index c44e9ae61..cf54ffd96 100644 --- a/src/TurbulenceModels/incompressible/Make/options +++ b/src/TurbulenceModels/incompressible/Make/options @@ -1,4 +1,4 @@ -EXE_INC = \ +EXE_INC = -DCONST_TMP \ -I../turbulenceModels/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/finiteVolume/lnInclude \ diff --git a/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/LamBremhorstKE/LamBremhorstKE.C b/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/LamBremhorstKE/LamBremhorstKE.C index 245a0ff55..70c7403e2 100644 --- a/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/LamBremhorstKE/LamBremhorstKE.C +++ b/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/LamBremhorstKE/LamBremhorstKE.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -235,8 +235,8 @@ void LamBremhorstKE::correct() - fvm::Sp(Ceps2_*f2(Rt)*epsilon_/k_, epsilon_) ); - epsEqn().relax(); - epsEqn().boundaryManipulate(epsilon_.boundaryField()); + epsEqn.ref().relax(); + epsEqn.ref().boundaryManipulate(epsilon_.boundaryField()); solve(epsEqn); bound(epsilon_, epsilonMin_); @@ -250,7 +250,7 @@ void LamBremhorstKE::correct() G - fvm::Sp(epsilon_/k_, k_) ); - kEqn().relax(); + kEqn.ref().relax(); solve(kEqn); bound(k_, kMin_); diff --git a/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/LienCubicKE/LienCubicKE.C b/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/LienCubicKE/LienCubicKE.C index cc58aabc7..3a4bc9c26 100644 --- a/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/LienCubicKE/LienCubicKE.C +++ b/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/LienCubicKE/LienCubicKE.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -404,8 +404,8 @@ void LienCubicKE::correct() + E(f2) ); - epsEqn().relax(); - epsEqn().boundaryManipulate(epsilon_.boundaryField()); + epsEqn.ref().relax(); + epsEqn.ref().boundaryManipulate(epsilon_.boundaryField()); solve(epsEqn); bound(epsilon_, epsilonMin_); @@ -421,7 +421,7 @@ void LienCubicKE::correct() - fvm::Sp(epsilon_/k_, k_) ); - kEqn().relax(); + kEqn.ref().relax(); solve(kEqn); bound(k_, kMin_); diff --git a/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/LienLeschziner/LienLeschziner.C b/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/LienLeschziner/LienLeschziner.C index 0b1ec7320..e91c62356 100644 --- a/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/LienLeschziner/LienLeschziner.C +++ b/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/LienLeschziner/LienLeschziner.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -288,8 +288,8 @@ void LienLeschziner::correct() + E(f2) ); - epsEqn().relax(); - epsEqn().boundaryManipulate(epsilon_.boundaryField()); + epsEqn.ref().relax(); + epsEqn.ref().boundaryManipulate(epsilon_.boundaryField()); solve(epsEqn); bound(epsilon_, epsilonMin_); @@ -305,7 +305,7 @@ void LienLeschziner::correct() - fvm::Sp(epsilon_/k_, k_) ); - kEqn().relax(); + kEqn.ref().relax(); solve(kEqn); bound(k_, kMin_); diff --git a/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/ShihQuadraticKE/ShihQuadraticKE.C b/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/ShihQuadraticKE/ShihQuadraticKE.C index c2d22054c..145c86393 100644 --- a/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/ShihQuadraticKE/ShihQuadraticKE.C +++ b/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/ShihQuadraticKE/ShihQuadraticKE.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -286,8 +286,8 @@ void ShihQuadraticKE::correct() - fvm::Sp(Ceps2_*epsilon_/k_, epsilon_) ); - epsEqn().relax(); - epsEqn().boundaryManipulate(epsilon_.boundaryField()); + epsEqn.ref().relax(); + epsEqn.ref().boundaryManipulate(epsilon_.boundaryField()); solve(epsEqn); bound(epsilon_, epsilonMin_); @@ -303,7 +303,7 @@ void ShihQuadraticKE::correct() - fvm::Sp(epsilon_/k_, k_) ); - kEqn().relax(); + kEqn.ref().relax(); solve(kEqn); bound(k_, kMin_); diff --git a/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/kkLOmega/kkLOmega.C b/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/kkLOmega/kkLOmega.C index 58a84fc14..6b30ee9d0 100644 --- a/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/kkLOmega/kkLOmega.C +++ b/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/kkLOmega/kkLOmega.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -698,8 +698,8 @@ void kkLOmega::correct() )().dimensionedInternalField()/pow3(y_.dimensionedInternalField()) ); - omegaEqn().relax(); - omegaEqn().boundaryManipulate(omega_.boundaryField()); + omegaEqn.ref().relax(); + omegaEqn.ref().boundaryManipulate(omega_.boundaryField()); solve(omegaEqn); bound(omega_, omegaMin_); @@ -718,8 +718,8 @@ void kkLOmega::correct() - fvm::Sp(Rbp + Rnat + Dl/(kl_ + kMin_), kl_) ); - klEqn().relax(); - klEqn().boundaryManipulate(kl_.boundaryField()); + klEqn.ref().relax(); + klEqn.ref().boundaryManipulate(kl_.boundaryField()); solve(klEqn); bound(kl_, kMin_); @@ -739,8 +739,8 @@ void kkLOmega::correct() - fvm::Sp(omega_ + Dt/(kt_+ kMin_), kt_) ); - ktEqn().relax(); - ktEqn().boundaryManipulate(kt_.boundaryField()); + ktEqn.ref().relax(); + ktEqn.ref().boundaryManipulate(kt_.boundaryField()); solve(ktEqn); bound(kt_, kMin_); diff --git a/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/qZeta/qZeta.C b/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/qZeta/qZeta.C index 44a5c3312..f5b587385 100644 --- a/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/qZeta/qZeta.C +++ b/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/qZeta/qZeta.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -260,7 +260,7 @@ void qZeta::correct() + E ); - zetaEqn().relax(); + zetaEqn.ref().relax(); solve(zetaEqn); bound(zeta_, zetaMin_); @@ -275,7 +275,7 @@ void qZeta::correct() G - fvm::Sp(zeta_/q_, q_) ); - qEqn().relax(); + qEqn.ref().relax(); solve(qEqn); bound(q_, qMin_); diff --git a/src/TurbulenceModels/phaseCompressible/RAS/mixtureKEpsilon/mixtureKEpsilon.C b/src/TurbulenceModels/phaseCompressible/RAS/mixtureKEpsilon/mixtureKEpsilon.C index 8c0e6b598..789a1688d 100644 --- a/src/TurbulenceModels/phaseCompressible/RAS/mixtureKEpsilon/mixtureKEpsilon.C +++ b/src/TurbulenceModels/phaseCompressible/RAS/mixtureKEpsilon/mixtureKEpsilon.C @@ -615,7 +615,7 @@ void mixtureKEpsilon::correct() kl.boundaryField().updateCoeffs(); epsilonl.boundaryField().updateCoeffs(); - Gc().checkOut(); + Gc.ref().checkOut(); } tmp Gd; @@ -635,7 +635,7 @@ void mixtureKEpsilon::correct() kg.boundaryField().updateCoeffs(); epsilong.boundaryField().updateCoeffs(); - Gd().checkOut(); + Gd.ref().checkOut(); } // Mixture turbulence generation @@ -665,9 +665,9 @@ void mixtureKEpsilon::correct() + fvOptions(epsilonm) ); - epsEqn().relax(); - fvOptions.constrain(epsEqn()); - epsEqn().boundaryManipulate(epsilonm.boundaryField()); + epsEqn.ref().relax(); + fvOptions.constrain(epsEqn.ref()); + epsEqn.ref().boundaryManipulate(epsilonm.boundaryField()); solve(epsEqn); fvOptions.correct(epsilonm); bound(epsilonm, this->epsilonMin_); @@ -688,8 +688,8 @@ void mixtureKEpsilon::correct() + fvOptions(km) ); - kmEqn().relax(); - fvOptions.constrain(kmEqn()); + kmEqn.ref().relax(); + fvOptions.constrain(kmEqn.ref()); solve(kmEqn); fvOptions.correct(km); bound(km, this->kMin_); diff --git a/src/TurbulenceModels/turbulenceModels/LES/DeardorffDiffStress/DeardorffDiffStress.C b/src/TurbulenceModels/turbulenceModels/LES/DeardorffDiffStress/DeardorffDiffStress.C index 40f670e36..b2e6cd979 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/DeardorffDiffStress/DeardorffDiffStress.C +++ b/src/TurbulenceModels/turbulenceModels/LES/DeardorffDiffStress/DeardorffDiffStress.C @@ -202,9 +202,9 @@ void DeardorffDiffStress::correct() + fvOptions(alpha, rho, R) ); - REqn().relax(); - fvOptions.constrain(REqn()); - REqn().solve(); + REqn.ref().relax(); + fvOptions.constrain(REqn.ref()); + REqn.ref().solve(); fvOptions.correct(R); this->boundNormalStress(R); diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/IDDESDelta/IDDESDelta.C b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/IDDESDelta/IDDESDelta.C index 38517e5bc..9b6f2c4c8 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/IDDESDelta/IDDESDelta.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/IDDESDelta/IDDESDelta.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -66,7 +66,7 @@ void Foam::LESModels::IDDESDelta::calcDelta() ) ); - scalarField& faceToFacenMax = tfaceToFacenMax().internalField(); + scalarField& faceToFacenMax = tfaceToFacenMax.ref().internalField(); const cellList& cells = mesh.cells(); const vectorField& faceCentres = mesh.faceCentres(); diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/maxDeltaxyz/maxDeltaxyz.C b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/maxDeltaxyz/maxDeltaxyz.C index 701bab6da..865f3fc69 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/maxDeltaxyz/maxDeltaxyz.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/maxDeltaxyz/maxDeltaxyz.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -46,24 +46,8 @@ void Foam::LESModels::maxDeltaxyz::calcDelta() label nD = mesh.nGeometricD(); - tmp hmax - ( - new volScalarField - ( - IOobject - ( - "hmax", - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh, - dimensionedScalar("zrero", dimLength, 0.0) - ) - ); - const cellList& cells = mesh.cells(); + scalarField hmax(cells.size()); forAll(cells,cellI) { @@ -81,12 +65,13 @@ void Foam::LESModels::maxDeltaxyz::calcDelta() deltaMaxTmp = tmp; } } - hmax()[cellI] = deltaCoeff_*deltaMaxTmp; + + hmax[cellI] = deltaCoeff_*deltaMaxTmp; } if (nD == 3) { - delta_.internalField() = hmax(); + delta_.internalField() = hmax; } else if (nD == 2) { @@ -94,7 +79,7 @@ void Foam::LESModels::maxDeltaxyz::calcDelta() << "Case is 2D, LES is not strictly applicable\n" << endl; - delta_.internalField() = hmax(); + delta_.internalField() = hmax; } else { diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESfilters/anisotropicFilter/anisotropicFilter.C b/src/TurbulenceModels/turbulenceModels/LES/LESfilters/anisotropicFilter/anisotropicFilter.C index 08ce6197c..8128591b4 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESfilters/anisotropicFilter/anisotropicFilter.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESfilters/anisotropicFilter/anisotropicFilter.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -190,7 +190,7 @@ Foam::tmp Foam::anisotropicFilter::operator() for (direction d=0; d Foam::anisotropicFilter::operator() for (direction d=0; d SpalartAllmarasDDES::rd scalar(10) ) ); - tr().boundaryField() == 0.0; + tr.ref().boundaryField() == 0.0; return tr; } diff --git a/src/TurbulenceModels/turbulenceModels/LES/SpalartAllmarasDES/SpalartAllmarasDES.C b/src/TurbulenceModels/turbulenceModels/LES/SpalartAllmarasDES/SpalartAllmarasDES.C index 02f35be37..401e26d96 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/SpalartAllmarasDES/SpalartAllmarasDES.C +++ b/src/TurbulenceModels/turbulenceModels/LES/SpalartAllmarasDES/SpalartAllmarasDES.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -129,7 +129,7 @@ tmp SpalartAllmarasDES::r scalar(10) ) ); - tr().boundaryField() == 0.0; + tr.ref().boundaryField() == 0.0; return tr; } @@ -158,7 +158,7 @@ tmp SpalartAllmarasDES::dTilda ) const { tmp tdTilda(CDES_*this->delta()); - min(tdTilda().dimensionedInternalField(), tdTilda(), y_); + min(tdTilda.ref().dimensionedInternalField(), tdTilda(), y_); return tdTilda; } @@ -442,8 +442,8 @@ void SpalartAllmarasDES::correct() + fvOptions(alpha, rho, nuTilda_) ); - nuTildaEqn().relax(); - fvOptions.constrain(nuTildaEqn()); + nuTildaEqn.ref().relax(); + fvOptions.constrain(nuTildaEqn.ref()); solve(nuTildaEqn); fvOptions.correct(nuTilda_); bound(nuTilda_, dimensionedScalar("0", nuTilda_.dimensions(), 0.0)); diff --git a/src/TurbulenceModels/turbulenceModels/LES/dynamicKEqn/dynamicKEqn.C b/src/TurbulenceModels/turbulenceModels/LES/dynamicKEqn/dynamicKEqn.C index 1b6197589..c9c08b567 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/dynamicKEqn/dynamicKEqn.C +++ b/src/TurbulenceModels/turbulenceModels/LES/dynamicKEqn/dynamicKEqn.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -274,8 +274,8 @@ void dynamicKEqn::correct() + fvOptions(alpha, rho, k_) ); - kEqn().relax(); - fvOptions.constrain(kEqn()); + kEqn.ref().relax(); + fvOptions.constrain(kEqn.ref()); solve(kEqn); fvOptions.correct(k_); bound(k_, this->kMin_); diff --git a/src/TurbulenceModels/turbulenceModels/LES/kEqn/kEqn.C b/src/TurbulenceModels/turbulenceModels/LES/kEqn/kEqn.C index 4a87768c1..5f617bf84 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/kEqn/kEqn.C +++ b/src/TurbulenceModels/turbulenceModels/LES/kEqn/kEqn.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -196,8 +196,8 @@ void kEqn::correct() + fvOptions(alpha, rho, k_) ); - kEqn().relax(); - fvOptions.constrain(kEqn()); + kEqn.ref().relax(); + fvOptions.constrain(kEqn.ref()); solve(kEqn); fvOptions.correct(k_); bound(k_, this->kMin_); diff --git a/src/TurbulenceModels/turbulenceModels/Make/options b/src/TurbulenceModels/turbulenceModels/Make/options index a3ae8da83..bcd627471 100644 --- a/src/TurbulenceModels/turbulenceModels/Make/options +++ b/src/TurbulenceModels/turbulenceModels/Make/options @@ -1,4 +1,4 @@ -EXE_INC = \ +EXE_INC = -DCONST_TMP \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude diff --git a/src/TurbulenceModels/turbulenceModels/RAS/LRR/LRR.C b/src/TurbulenceModels/turbulenceModels/RAS/LRR/LRR.C index 63625919d..c15fabab3 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/LRR/LRR.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/LRR/LRR.C @@ -307,9 +307,9 @@ void LRR::correct() + fvOptions(alpha, rho, epsilon_) ); - epsEqn().relax(); - fvOptions.constrain(epsEqn()); - epsEqn().boundaryManipulate(epsilon_.boundaryField()); + epsEqn.ref().relax(); + fvOptions.constrain(epsEqn.ref()); + epsEqn.ref().boundaryManipulate(epsilon_.boundaryField()); solve(epsEqn); fvOptions.correct(epsilon_); bound(epsilon_, this->epsilonMin_); @@ -362,13 +362,13 @@ void LRR::correct() Cref1_*R - ((Cref2_*C2_)*(k_/epsilon_))*dev(P) ); - REqn() += + REqn.ref() += ((3*pow(Cmu_, 0.75)/kappa_)*(alpha*rho*sqrt(k_)/y_)) *dev(symm((n_ & reflect)*n_)); } - REqn().relax(); - fvOptions.constrain(REqn()); + REqn.ref().relax(); + fvOptions.constrain(REqn.ref()); solve(REqn); fvOptions.correct(R); diff --git a/src/TurbulenceModels/turbulenceModels/RAS/LaunderSharmaKE/LaunderSharmaKE.C b/src/TurbulenceModels/turbulenceModels/RAS/LaunderSharmaKE/LaunderSharmaKE.C index c69c7b13c..ce79ca501 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/LaunderSharmaKE/LaunderSharmaKE.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/LaunderSharmaKE/LaunderSharmaKE.C @@ -280,9 +280,9 @@ void LaunderSharmaKE::correct() + fvOptions(alpha, rho, epsilon_) ); - epsEqn().relax(); - fvOptions.constrain(epsEqn()); - epsEqn().boundaryManipulate(epsilon_.boundaryField()); + epsEqn.ref().relax(); + fvOptions.constrain(epsEqn.ref()); + epsEqn.ref().boundaryManipulate(epsilon_.boundaryField()); solve(epsEqn); fvOptions.correct(epsilon_); bound(epsilon_, this->epsilonMin_); @@ -301,8 +301,8 @@ void LaunderSharmaKE::correct() + fvOptions(alpha, rho, k_) ); - kEqn().relax(); - fvOptions.constrain(kEqn()); + kEqn.ref().relax(); + fvOptions.constrain(kEqn.ref()); solve(kEqn); fvOptions.correct(k_); bound(k_, this->kMin_); diff --git a/src/TurbulenceModels/turbulenceModels/RAS/RNGkEpsilon/RNGkEpsilon.C b/src/TurbulenceModels/turbulenceModels/RAS/RNGkEpsilon/RNGkEpsilon.C index c88dffbc8..17e8f14f9 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/RNGkEpsilon/RNGkEpsilon.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/RNGkEpsilon/RNGkEpsilon.C @@ -288,9 +288,9 @@ void RNGkEpsilon::correct() + fvOptions(alpha, rho, epsilon_) ); - epsEqn().relax(); - fvOptions.constrain(epsEqn()); - epsEqn().boundaryManipulate(epsilon_.boundaryField()); + epsEqn.ref().relax(); + fvOptions.constrain(epsEqn.ref()); + epsEqn.ref().boundaryManipulate(epsilon_.boundaryField()); solve(epsEqn); fvOptions.correct(epsilon_); bound(epsilon_, this->epsilonMin_); @@ -311,8 +311,8 @@ void RNGkEpsilon::correct() + fvOptions(alpha, rho, k_) ); - kEqn().relax(); - fvOptions.constrain(kEqn()); + kEqn.ref().relax(); + fvOptions.constrain(kEqn.ref()); solve(kEqn); fvOptions.correct(k_); bound(k_, this->kMin_); diff --git a/src/TurbulenceModels/turbulenceModels/RAS/SSG/SSG.C b/src/TurbulenceModels/turbulenceModels/RAS/SSG/SSG.C index dc8815d8f..7117f1662 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/SSG/SSG.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/SSG/SSG.C @@ -317,9 +317,9 @@ void SSG::correct() + fvOptions(alpha, rho, epsilon_) ); - epsEqn().relax(); - fvOptions.constrain(epsEqn()); - epsEqn().boundaryManipulate(epsilon_.boundaryField()); + epsEqn.ref().relax(); + fvOptions.constrain(epsEqn.ref()); + epsEqn.ref().boundaryManipulate(epsilon_.boundaryField()); solve(epsEqn); fvOptions.correct(epsilon_); bound(epsilon_, this->epsilonMin_); @@ -371,8 +371,8 @@ void SSG::correct() + fvOptions(alpha, rho, R) ); - REqn().relax(); - fvOptions.constrain(REqn()); + REqn.ref().relax(); + fvOptions.constrain(REqn.ref()); solve(REqn); fvOptions.correct(R); diff --git a/src/TurbulenceModels/turbulenceModels/RAS/SpalartAllmaras/SpalartAllmaras.C b/src/TurbulenceModels/turbulenceModels/RAS/SpalartAllmaras/SpalartAllmaras.C index 23446bc65..22e052972 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/SpalartAllmaras/SpalartAllmaras.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/SpalartAllmaras/SpalartAllmaras.C @@ -377,8 +377,8 @@ void SpalartAllmaras::correct() + fvOptions(alpha, rho, nuTilda_) ); - nuTildaEqn().relax(); - fvOptions.constrain(nuTildaEqn()); + nuTildaEqn.ref().relax(); + fvOptions.constrain(nuTildaEqn.ref()); solve(nuTildaEqn); fvOptions.correct(nuTilda_); bound(nuTilda_, dimensionedScalar("0", nuTilda_.dimensions(), 0.0)); diff --git a/src/TurbulenceModels/turbulenceModels/RAS/kEpsilon/kEpsilon.C b/src/TurbulenceModels/turbulenceModels/RAS/kEpsilon/kEpsilon.C index 2fd57bbc3..8733871d7 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/kEpsilon/kEpsilon.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/kEpsilon/kEpsilon.C @@ -258,9 +258,9 @@ void kEpsilon::correct() + fvOptions(alpha, rho, epsilon_) ); - epsEqn().relax(); - fvOptions.constrain(epsEqn()); - epsEqn().boundaryManipulate(epsilon_.boundaryField()); + epsEqn.ref().relax(); + fvOptions.constrain(epsEqn.ref()); + epsEqn.ref().boundaryManipulate(epsilon_.boundaryField()); solve(epsEqn); fvOptions.correct(epsilon_); bound(epsilon_, this->epsilonMin_); @@ -279,8 +279,8 @@ void kEpsilon::correct() + fvOptions(alpha, rho, k_) ); - kEqn().relax(); - fvOptions.constrain(kEqn()); + kEqn.ref().relax(); + fvOptions.constrain(kEqn.ref()); solve(kEqn); fvOptions.correct(k_); bound(k_, this->kMin_); diff --git a/src/TurbulenceModels/turbulenceModels/RAS/kOmega/kOmega.C b/src/TurbulenceModels/turbulenceModels/RAS/kOmega/kOmega.C index 0a45b3532..9084c5720 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/kOmega/kOmega.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/kOmega/kOmega.C @@ -221,9 +221,9 @@ void kOmega::correct() + fvOptions(alpha, rho, omega_) ); - omegaEqn().relax(); - fvOptions.constrain(omegaEqn()); - omegaEqn().boundaryManipulate(omega_.boundaryField()); + omegaEqn.ref().relax(); + fvOptions.constrain(omegaEqn.ref()); + omegaEqn.ref().boundaryManipulate(omega_.boundaryField()); solve(omegaEqn); fvOptions.correct(omega_); bound(omega_, this->omegaMin_); @@ -242,8 +242,8 @@ void kOmega::correct() + fvOptions(alpha, rho, k_) ); - kEqn().relax(); - fvOptions.constrain(kEqn()); + kEqn.ref().relax(); + fvOptions.constrain(kEqn.ref()); solve(kEqn); fvOptions.correct(k_); bound(k_, this->kMin_); diff --git a/src/TurbulenceModels/turbulenceModels/RAS/kOmegaSST/kOmegaSST.C b/src/TurbulenceModels/turbulenceModels/RAS/kOmegaSST/kOmegaSST.C index ffbb4cb89..1deb432d4 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/kOmegaSST/kOmegaSST.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/kOmegaSST/kOmegaSST.C @@ -101,7 +101,7 @@ tmp kOmegaSST::kOmegaSST::F23() const if (F3_) { - f23() *= F3(); + f23.ref() *= F3(); } return f23; @@ -452,9 +452,9 @@ void kOmegaSST::correct() + fvOptions(alpha, rho, omega_) ); - omegaEqn().relax(); - fvOptions.constrain(omegaEqn()); - omegaEqn().boundaryManipulate(omega_.boundaryField()); + omegaEqn.ref().relax(); + fvOptions.constrain(omegaEqn.ref()); + omegaEqn.ref().boundaryManipulate(omega_.boundaryField()); solve(omegaEqn); fvOptions.correct(omega_); bound(omega_, this->omegaMin_); @@ -474,8 +474,8 @@ void kOmegaSST::correct() + fvOptions(alpha, rho, k_) ); - kEqn().relax(); - fvOptions.constrain(kEqn()); + kEqn.ref().relax(); + fvOptions.constrain(kEqn.ref()); solve(kEqn); fvOptions.correct(k_); bound(k_, this->kMin_); diff --git a/src/TurbulenceModels/turbulenceModels/RAS/realizableKE/realizableKE.C b/src/TurbulenceModels/turbulenceModels/RAS/realizableKE/realizableKE.C index f5b7dcf76..aa74f0e57 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/realizableKE/realizableKE.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/realizableKE/realizableKE.C @@ -304,9 +304,9 @@ void realizableKE::correct() + fvOptions(alpha, rho, epsilon_) ); - epsEqn().relax(); - fvOptions.constrain(epsEqn()); - epsEqn().boundaryManipulate(epsilon_.boundaryField()); + epsEqn.ref().relax(); + fvOptions.constrain(epsEqn.ref()); + epsEqn.ref().boundaryManipulate(epsilon_.boundaryField()); solve(epsEqn); fvOptions.correct(epsilon_); bound(epsilon_, this->epsilonMin_); @@ -327,8 +327,8 @@ void realizableKE::correct() + fvOptions(alpha, rho, k_) ); - kEqn().relax(); - fvOptions.constrain(kEqn()); + kEqn.ref().relax(); + fvOptions.constrain(kEqn.ref()); solve(kEqn); fvOptions.correct(k_); bound(k_, this->kMin_); diff --git a/src/TurbulenceModels/turbulenceModels/RAS/v2f/v2f.C b/src/TurbulenceModels/turbulenceModels/RAS/v2f/v2f.C index 84b12dc1b..3bbe58c36 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/v2f/v2f.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/v2f/v2f.C @@ -329,9 +329,9 @@ void v2f::correct() + fvOptions(alpha, rho, epsilon_) ); - epsEqn().relax(); - fvOptions.constrain(epsEqn()); - epsEqn().boundaryManipulate(epsilon_.boundaryField()); + epsEqn.ref().relax(); + fvOptions.constrain(epsEqn.ref()); + epsEqn.ref().boundaryManipulate(epsilon_.boundaryField()); solve(epsEqn); fvOptions.correct(epsilon_); bound(epsilon_, this->epsilonMin_); @@ -350,8 +350,8 @@ void v2f::correct() + fvOptions(alpha, rho, k_) ); - kEqn().relax(); - fvOptions.constrain(kEqn()); + kEqn.ref().relax(); + fvOptions.constrain(kEqn.ref()); solve(kEqn); fvOptions.correct(k_); bound(k_, this->kMin_); @@ -366,8 +366,8 @@ void v2f::correct() - 1.0/L2/k_*(v2fAlpha - C2_*G) ); - fEqn().relax(); - fvOptions.constrain(fEqn()); + fEqn.ref().relax(); + fvOptions.constrain(fEqn.ref()); solve(fEqn); fvOptions.correct(f_); bound(f_, fMin_); @@ -385,8 +385,8 @@ void v2f::correct() + fvOptions(alpha, rho, v2_) ); - v2Eqn().relax(); - fvOptions.constrain(v2Eqn()); + v2Eqn.ref().relax(); + fvOptions.constrain(v2Eqn.ref()); solve(v2Eqn); fvOptions.correct(v2_); bound(v2_, v2Min_); diff --git a/src/TurbulenceModels/turbulenceModels/ReynoldsStress/ReynoldsStress.C b/src/TurbulenceModels/turbulenceModels/ReynoldsStress/ReynoldsStress.C index 0893bea4a..e32c7369f 100644 --- a/src/TurbulenceModels/turbulenceModels/ReynoldsStress/ReynoldsStress.C +++ b/src/TurbulenceModels/turbulenceModels/ReynoldsStress/ReynoldsStress.C @@ -198,7 +198,7 @@ Foam::tmp Foam::ReynoldsStress::k() const { tmp tk(0.5*tr(R_)); - tk().rename("k"); + tk.ref().rename("k"); return tk; } diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C index 476a1679a..7605716a4 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -57,10 +57,10 @@ tmp nutURoughWallFunctionFvPatchScalarField::calcNut() const const scalarField magUp(mag(Uw.patchInternalField() - Uw)); tmp tyPlus = calcYPlus(magUp); - scalarField& yPlus = tyPlus(); + scalarField& yPlus = tyPlus.ref(); tmp tnutw(new scalarField(patch().size(), 0.0)); - scalarField& nutw = tnutw(); + scalarField& nutw = tnutw.ref(); forAll(yPlus, facei) { @@ -95,7 +95,7 @@ tmp nutURoughWallFunctionFvPatchScalarField::calcYPlus const scalarField& nuw = tnuw(); tmp tyPlus(new scalarField(patch().size(), 0.0)); - scalarField& yPlus = tyPlus(); + scalarField& yPlus = tyPlus.ref(); if (roughnessHeight_ > 0.0) { diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C index 711eb5443..fca1d717d 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -87,7 +87,7 @@ tmp nutUSpaldingWallFunctionFvPatchScalarField::calcUTau const scalarField& nutw = *this; tmp tuTau(new scalarField(patch().size(), 0.0)); - scalarField& uTau = tuTau(); + scalarField& uTau = tuTau.ref(); forAll(uTau, faceI) { diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C index 9bc4767ef..eb4c55fb9 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -72,7 +72,7 @@ tmp nutUTabulatedWallFunctionFvPatchScalarField::calcUPlus ) const { tmp tuPlus(new scalarField(patch().size(), 0.0)); - scalarField& uPlus = tuPlus(); + scalarField& uPlus = tuPlus.ref(); forAll(uPlus, faceI) { diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C index 9d848e8ef..8a85d7226 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -54,10 +54,10 @@ tmp nutUWallFunctionFvPatchScalarField::calcNut() const const scalarField& nuw = tnuw(); tmp tyPlus = calcYPlus(magUp); - scalarField& yPlus = tyPlus(); + scalarField& yPlus = tyPlus.ref(); tmp tnutw(new scalarField(patch().size(), 0.0)); - scalarField& nutw = tnutw(); + scalarField& nutw = tnutw.ref(); forAll(yPlus, facei) { @@ -92,7 +92,7 @@ tmp nutUWallFunctionFvPatchScalarField::calcYPlus const scalarField& nuw = tnuw(); tmp tyPlus(new scalarField(patch().size(), 0.0)); - scalarField& yPlus = tyPlus(); + scalarField& yPlus = tyPlus.ref(); forAll(yPlus, facei) { diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.C index 939240888..710ff8242 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -57,7 +57,7 @@ tmp nutkAtmRoughWallFunctionFvPatchScalarField::calcNut() const const scalar Cmu25 = pow025(Cmu_); tmp tnutw(new scalarField(*this)); - scalarField& nutw = tnutw(); + scalarField& nutw = tnutw.ref(); forAll(nutw, faceI) { diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C index 2d2f038b5..67405f0aa 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -80,7 +80,7 @@ tmp nutkRoughWallFunctionFvPatchScalarField::calcNut() const const scalar Cmu25 = pow025(Cmu_); tmp tnutw(new scalarField(*this)); - scalarField& nutw = tnutw(); + scalarField& nutw = tnutw.ref(); forAll(nutw, faceI) { diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C index 98b3f548f..60dcf74b2 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -59,7 +59,7 @@ tmp nutkWallFunctionFvPatchScalarField::calcNut() const const scalar Cmu25 = pow025(Cmu_); tmp tnutw(new scalarField(patch().size(), 0.0)); - scalarField& nutw = tnutw(); + scalarField& nutw = tnutw.ref(); forAll(nutw, faceI) { diff --git a/src/TurbulenceModels/turbulenceModels/nonlinearEddyViscosity/nonlinearEddyViscosity.C b/src/TurbulenceModels/turbulenceModels/nonlinearEddyViscosity/nonlinearEddyViscosity.C index c24ac4d6c..409e9e8ca 100644 --- a/src/TurbulenceModels/turbulenceModels/nonlinearEddyViscosity/nonlinearEddyViscosity.C +++ b/src/TurbulenceModels/turbulenceModels/nonlinearEddyViscosity/nonlinearEddyViscosity.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -83,7 +83,7 @@ Foam::nonlinearEddyViscosity::R() const ( eddyViscosity::R() ); - tR() += nonlinearStress_; + tR.ref() += nonlinearStress_; return tR; } @@ -96,7 +96,7 @@ Foam::nonlinearEddyViscosity::devRhoReff() const ( eddyViscosity::devRhoReff() ); - tdevRhoReff() += this->rho_*nonlinearStress_; + tdevRhoReff.ref() += this->rho_*nonlinearStress_; return tdevRhoReff; } diff --git a/src/finiteVolume/Make/options b/src/finiteVolume/Make/options index 1c1990e5f..25eb0cc6f 100644 --- a/src/finiteVolume/Make/options +++ b/src/finiteVolume/Make/options @@ -1,4 +1,4 @@ -EXE_INC = \ +EXE_INC = -DCONST_TMP \ -I$(LIB_SRC)/triSurface/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.C b/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.C index 89b9e8547..a4b099b6c 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.C +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.C @@ -180,7 +180,7 @@ Foam::tmp Foam::MRFZoneList::DDt dimensionedVector("0", U.dimensions()/dimTime, vector::zero) ) ); - volVectorField& acceleration = tacceleration(); + volVectorField& acceleration = tacceleration.ref(); forAll(*this, i) { @@ -238,7 +238,7 @@ Foam::tmp Foam::MRFZoneList::relative ) ); - makeRelative(rphi()); + makeRelative(rphi.ref()); reuseTmpGeometricField ::clear(tphi); @@ -267,7 +267,7 @@ Foam::MRFZoneList::relative forAll(*this, i) { - operator[](i).makeRelative(rphi()); + operator[](i).makeRelative(rphi.ref()); } reuseTmpFieldField::clear(tphi); @@ -297,7 +297,7 @@ Foam::MRFZoneList::relative forAll(*this, i) { - operator[](i).makeRelative(rphi(), patchi); + operator[](i).makeRelative(rphi.ref(), patchi); } reuseTmp::clear(tphi); @@ -361,7 +361,7 @@ Foam::tmp Foam::MRFZoneList::absolute ) ); - makeAbsolute(rphi()); + makeAbsolute(rphi.ref()); reuseTmpGeometricField ::clear(tphi); diff --git a/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModel.C b/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModel.C index 928777483..93944c12b 100644 --- a/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModel.C +++ b/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModel.C @@ -226,7 +226,7 @@ Foam::tmp Foam::SRF::SRFModel::Uabs() const ); // Add SRF contribution to internal field - tUabs().internalField() += Urel_.internalField(); + tUabs.ref().internalField() += Urel_.internalField(); // Add Urel boundary contributions const volVectorField::GeometricBoundaryField& bvf = Urel_.boundaryField(); @@ -241,12 +241,12 @@ Foam::tmp Foam::SRF::SRFModel::Uabs() const refCast(bvf[i]); if (UrelPatch.relative()) { - tUabs().boundaryField()[i] += Urel_.boundaryField()[i]; + tUabs.ref().boundaryField()[i] += Urel_.boundaryField()[i]; } } else { - tUabs().boundaryField()[i] += Urel_.boundaryField()[i]; + tUabs.ref().boundaryField()[i] += Urel_.boundaryField()[i]; } } diff --git a/src/finiteVolume/cfdTools/general/constrainHbyA/constrainHbyA.C b/src/finiteVolume/cfdTools/general/constrainHbyA/constrainHbyA.C index beb2c223e..38f84f96a 100644 --- a/src/finiteVolume/cfdTools/general/constrainHbyA/constrainHbyA.C +++ b/src/finiteVolume/cfdTools/general/constrainHbyA/constrainHbyA.C @@ -40,16 +40,15 @@ Foam::tmp Foam::constrainHbyA if (tHbyA.isTmp()) { - volVectorField* HbyAPtr = tHbyA.ptr(); - HbyAPtr->rename("HbyA"); - tHbyANew = HbyAPtr; + tHbyANew = tHbyA; + tHbyANew.ref().rename("HbyA"); } else { tHbyANew = new volVectorField("HbyA", tHbyA); } - volVectorField& HbyA = tHbyANew(); + volVectorField& HbyA = tHbyANew.ref(); forAll(U.boundaryField(), patchi) { diff --git a/src/finiteVolume/cfdTools/general/fvOptions/fvOptionListTemplates.C b/src/finiteVolume/cfdTools/general/fvOptions/fvOptionListTemplates.C index ca14e2b24..8b9c65856 100644 --- a/src/finiteVolume/cfdTools/general/fvOptions/fvOptionListTemplates.C +++ b/src/finiteVolume/cfdTools/general/fvOptions/fvOptionListTemplates.C @@ -47,7 +47,7 @@ Foam::tmp> Foam::fv::optionList::operator() const dimensionSet ds = field.dimensions()/dimTime*dimVolume; tmp> tmtx(new fvMatrix(field, ds)); - fvMatrix& mtx = tmtx(); + fvMatrix& mtx = tmtx.ref(); forAll(*this, i) { @@ -103,7 +103,7 @@ Foam::tmp> Foam::fv::optionList::operator() ); tmp> tmtx(new fvMatrix(field, ds)); - fvMatrix& mtx = tmtx(); + fvMatrix& mtx = tmtx.ref(); forAll(*this, i) { @@ -162,7 +162,7 @@ Foam::tmp> Foam::fv::optionList::operator() ); tmp> tmtx(new fvMatrix(field, ds)); - fvMatrix& mtx = tmtx(); + fvMatrix& mtx = tmtx.ref(); forAll(*this, i) { diff --git a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C index 8dd817f29..631f074ad 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C +++ b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -158,7 +158,7 @@ Foam::tmp Foam::porosityModel::porosityModel::force if (!cellZoneIDs_.empty()) { - this->calcForce(U, rho, mu, tforce()); + this->calcForce(U, rho, mu, tforce.ref()); } return tforce; diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.C index 835de2a5f..a80f6c078 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.C @@ -127,7 +127,7 @@ Foam::cyclicFvPatchField::patchNeighbourField() const cyclicPatch().cyclicPatch().neighbPatch().faceCells(); tmp> tpnf(new Field(this->size())); - Field& pnf = tpnf(); + Field& pnf = tpnf.ref(); if (doTransform()) diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicACMI/cyclicACMIFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicACMI/cyclicACMIFvPatchField.C index 194aabf65..0ded42fdf 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicACMI/cyclicACMIFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicACMI/cyclicACMIFvPatchField.C @@ -159,7 +159,7 @@ Foam::cyclicACMIFvPatchField::patchNeighbourField() const if (doTransform()) { - tpnf() = transform(forwardT(), tpnf()); + tpnf.ref() = transform(forwardT(), tpnf()); } return tpnf; diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.C index f993a8d8d..a241a8071 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.C @@ -151,7 +151,7 @@ Foam::cyclicAMIFvPatchField::patchNeighbourField() const if (doTransform()) { - tpnf() = transform(forwardT(), tpnf()); + tpnf.ref() = transform(forwardT(), tpnf()); } return tpnf; diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.C index a66f60895..07764053f 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.C @@ -98,7 +98,7 @@ Foam::jumpCyclicFvPatchField::patchNeighbourField() const this->cyclicPatch().neighbFvPatch().faceCells(); tmp> tpnf(new Field(this->size())); - Field& pnf = tpnf(); + Field& pnf = tpnf.ref(); Field jf(this->jump()); if (!this->cyclicPatch().owner()) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedPatchFieldBase.C b/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedPatchFieldBase.C index a4f4856f2..1c52eadef 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedPatchFieldBase.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedPatchFieldBase.C @@ -180,7 +180,7 @@ tmp> mappedPatchFieldBase::mappedField() const // Result of obtaining remote values tmp> tnewValues(new Field(0)); - Field& newValues = tnewValues(); + Field& newValues = tnewValues.ref(); switch (mapper_.mode()) { diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchFieldNew.C b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchFieldNew.C index e8f97d0cf..537881840 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchFieldNew.C +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchFieldNew.C @@ -80,7 +80,7 @@ Foam::tmp> Foam::fvPatchField::New // Check if constraint type override and store patchType if so if ((patchTypeCstrIter != patchConstructorTablePtr_->end())) { - tfvp().patchType() = actualPatchType; + tfvp.ref().patchType() = actualPatchType; } return tfvp; } diff --git a/src/finiteVolume/finiteVolume/convectionSchemes/gaussConvectionScheme/gaussConvectionScheme.C b/src/finiteVolume/finiteVolume/convectionSchemes/gaussConvectionScheme/gaussConvectionScheme.C index 152b0dc6c..38040b211 100644 --- a/src/finiteVolume/finiteVolume/convectionSchemes/gaussConvectionScheme/gaussConvectionScheme.C +++ b/src/finiteVolume/finiteVolume/convectionSchemes/gaussConvectionScheme/gaussConvectionScheme.C @@ -90,7 +90,7 @@ gaussConvectionScheme::fvmDiv faceFlux.dimensions()*vf.dimensions() ) ); - fvMatrix& fvm = tfvm(); + fvMatrix& fvm = tfvm.ref(); fvm.lower() = -weights.internalField()*faceFlux.internalField(); fvm.upper() = fvm.lower() + faceFlux.internalField(); @@ -128,7 +128,7 @@ gaussConvectionScheme::fvcDiv fvc::surfaceIntegrate(flux(faceFlux, vf)) ); - tConvection().rename + tConvection.ref().rename ( "convection(" + faceFlux.name() + ',' + vf.name() + ')' ); diff --git a/src/finiteVolume/finiteVolume/d2dt2Schemes/EulerD2dt2Scheme/EulerD2dt2Scheme.C b/src/finiteVolume/finiteVolume/d2dt2Schemes/EulerD2dt2Scheme/EulerD2dt2Scheme.C index 6d8a46ba7..44ee36496 100644 --- a/src/finiteVolume/finiteVolume/d2dt2Schemes/EulerD2dt2Scheme/EulerD2dt2Scheme.C +++ b/src/finiteVolume/finiteVolume/d2dt2Schemes/EulerD2dt2Scheme/EulerD2dt2Scheme.C @@ -247,7 +247,7 @@ EulerD2dt2Scheme::fvmD2dt2 ) ); - fvMatrix& fvm = tfvm(); + fvMatrix& fvm = tfvm.ref(); scalar deltaT = mesh().time().deltaTValue(); scalar deltaT0 = mesh().time().deltaT0Value(); @@ -308,7 +308,7 @@ EulerD2dt2Scheme::fvmD2dt2 ) ); - fvMatrix& fvm = tfvm(); + fvMatrix& fvm = tfvm.ref(); scalar deltaT = mesh().time().deltaTValue(); scalar deltaT0 = mesh().time().deltaT0Value(); @@ -368,7 +368,7 @@ EulerD2dt2Scheme::fvmD2dt2 ) ); - fvMatrix& fvm = tfvm(); + fvMatrix& fvm = tfvm.ref(); scalar deltaT = mesh().time().deltaTValue(); scalar deltaT0 = mesh().time().deltaT0Value(); diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/CoEulerDdtScheme/CoEulerDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/CoEulerDdtScheme/CoEulerDdtScheme.C index f45c34dfc..2374f31ff 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/CoEulerDdtScheme/CoEulerDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/CoEulerDdtScheme/CoEulerDdtScheme.C @@ -61,7 +61,7 @@ tmp CoEulerDdtScheme::CorDeltaT() const ) ); - volScalarField& corDeltaT = tcorDeltaT(); + volScalarField& corDeltaT = tcorDeltaT.ref(); const labelUList& owner = mesh().owner(); const labelUList& neighbour = mesh().neighbour(); @@ -183,7 +183,7 @@ CoEulerDdtScheme::fvcDdt ) ); - tdtdt().internalField() = + tdtdt.ref().internalField() = rDeltaT.internalField()*dt.value() *(1.0 - mesh().Vsc0()/mesh().Vsc()); @@ -453,7 +453,7 @@ CoEulerDdtScheme::fvmDdt ) ); - fvMatrix& fvm = tfvm(); + fvMatrix& fvm = tfvm.ref(); scalarField rDeltaT(CorDeltaT()().internalField()); @@ -488,7 +488,7 @@ CoEulerDdtScheme::fvmDdt rho.dimensions()*vf.dimensions()*dimVol/dimTime ) ); - fvMatrix& fvm = tfvm(); + fvMatrix& fvm = tfvm.ref(); scalarField rDeltaT(CorDeltaT()().internalField()); @@ -525,7 +525,7 @@ CoEulerDdtScheme::fvmDdt rho.dimensions()*vf.dimensions()*dimVol/dimTime ) ); - fvMatrix& fvm = tfvm(); + fvMatrix& fvm = tfvm.ref(); scalarField rDeltaT(CorDeltaT()().internalField()); @@ -565,7 +565,7 @@ CoEulerDdtScheme::fvmDdt alpha.dimensions()*rho.dimensions()*vf.dimensions()*dimVol/dimTime ) ); - fvMatrix& fvm = tfvm(); + fvMatrix& fvm = tfvm.ref(); scalarField rDeltaT(CorDeltaT()().internalField()); diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.C index c98d9979a..d33969f50 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.C @@ -330,7 +330,7 @@ CrankNicolsonDdtScheme::fvcDdt )/mesh().V0(); } - tdtdt().dimensionedInternalField() = + tdtdt.ref().dimensionedInternalField() = ( (rDtCoef*dt)*(mesh().V() - mesh().V0()) - mesh().V0()*offCentre_(ddt0.dimensionedInternalField()) @@ -773,7 +773,7 @@ CrankNicolsonDdtScheme::fvmDdt ) ); - fvMatrix& fvm = tfvm(); + fvMatrix& fvm = tfvm.ref(); scalar rDtCoef = rDtCoef_(ddt0).value(); fvm.diag() = rDtCoef*mesh().V(); @@ -855,7 +855,7 @@ CrankNicolsonDdtScheme::fvmDdt rho.dimensions()*vf.dimensions()*dimVol/dimTime ) ); - fvMatrix& fvm = tfvm(); + fvMatrix& fvm = tfvm.ref(); scalar rDtCoef = rDtCoef_(ddt0).value(); fvm.diag() = rDtCoef*rho.value()*mesh().V(); @@ -937,7 +937,7 @@ CrankNicolsonDdtScheme::fvmDdt rho.dimensions()*vf.dimensions()*dimVol/dimTime ) ); - fvMatrix& fvm = tfvm(); + fvMatrix& fvm = tfvm.ref(); scalar rDtCoef = rDtCoef_(ddt0).value(); fvm.diag() = rDtCoef*rho.internalField()*mesh().V(); @@ -1028,7 +1028,7 @@ CrankNicolsonDdtScheme::fvmDdt alpha.dimensions()*rho.dimensions()*vf.dimensions()*dimVol/dimTime ) ); - fvMatrix& fvm = tfvm(); + fvMatrix& fvm = tfvm.ref(); scalar rDtCoef = rDtCoef_(ddt0).value(); fvm.diag() = rDtCoef*alpha.internalField()*rho.internalField()*mesh().V(); diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.C index 8cbc6d42a..79c3069f0 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.C @@ -73,7 +73,7 @@ EulerDdtScheme::fvcDdt ) ); - tdtdt().internalField() = + tdtdt.ref().internalField() = rDeltaT.value()*dt.value()*(1.0 - mesh().Vsc0()/mesh().Vsc()); return tdtdt; @@ -342,7 +342,7 @@ EulerDdtScheme::fvmDdt ) ); - fvMatrix& fvm = tfvm(); + fvMatrix& fvm = tfvm.ref(); scalar rDeltaT = 1.0/mesh().time().deltaTValue(); @@ -377,7 +377,7 @@ EulerDdtScheme::fvmDdt rho.dimensions()*vf.dimensions()*dimVol/dimTime ) ); - fvMatrix& fvm = tfvm(); + fvMatrix& fvm = tfvm.ref(); scalar rDeltaT = 1.0/mesh().time().deltaTValue(); @@ -414,7 +414,7 @@ EulerDdtScheme::fvmDdt rho.dimensions()*vf.dimensions()*dimVol/dimTime ) ); - fvMatrix& fvm = tfvm(); + fvMatrix& fvm = tfvm.ref(); scalar rDeltaT = 1.0/mesh().time().deltaTValue(); @@ -454,7 +454,7 @@ EulerDdtScheme::fvmDdt alpha.dimensions()*rho.dimensions()*vf.dimensions()*dimVol/dimTime ) ); - fvMatrix& fvm = tfvm(); + fvMatrix& fvm = tfvm.ref(); scalar rDeltaT = 1.0/mesh().time().deltaTValue(); diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/SLTSDdtScheme/SLTSDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/SLTSDdtScheme/SLTSDdtScheme.C index ea8742604..204f88e69 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/SLTSDdtScheme/SLTSDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/SLTSDdtScheme/SLTSDdtScheme.C @@ -111,7 +111,7 @@ tmp SLTSDdtScheme::SLrDeltaT() const ) ); - volScalarField& rDeltaT = trDeltaT(); + volScalarField& rDeltaT = trDeltaT.ref(); relaxedDiag(rDeltaT, phi); @@ -183,7 +183,7 @@ SLTSDdtScheme::fvcDdt ) ); - tdtdt().internalField() = + tdtdt.ref().internalField() = rDeltaT.internalField()*dt.value()*(1.0 - mesh().V0()/mesh().V()); return tdtdt; @@ -452,7 +452,7 @@ SLTSDdtScheme::fvmDdt ) ); - fvMatrix& fvm = tfvm(); + fvMatrix& fvm = tfvm.ref(); scalarField rDeltaT(SLrDeltaT()().internalField()); @@ -487,7 +487,7 @@ SLTSDdtScheme::fvmDdt rho.dimensions()*vf.dimensions()*dimVol/dimTime ) ); - fvMatrix& fvm = tfvm(); + fvMatrix& fvm = tfvm.ref(); scalarField rDeltaT(SLrDeltaT()().internalField()); @@ -524,7 +524,7 @@ SLTSDdtScheme::fvmDdt rho.dimensions()*vf.dimensions()*dimVol/dimTime ) ); - fvMatrix& fvm = tfvm(); + fvMatrix& fvm = tfvm.ref(); scalarField rDeltaT(SLrDeltaT()().internalField()); @@ -564,7 +564,7 @@ SLTSDdtScheme::fvmDdt alpha.dimensions()*rho.dimensions()*vf.dimensions()*dimVol/dimTime ) ); - fvMatrix& fvm = tfvm(); + fvMatrix& fvm = tfvm.ref(); scalarField rDeltaT(SLrDeltaT()().internalField()); diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.C index 5108e7d31..9297d106d 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.C @@ -111,7 +111,7 @@ backwardDdtScheme::fvcDdt ) ); - tdtdt().internalField() = rDeltaT.value()*dt.value()* + tdtdt.ref().internalField() = rDeltaT.value()*dt.value()* ( coefft - (coefft0*mesh().V0() - coefft00*mesh().V00())/mesh().V() ); @@ -467,7 +467,7 @@ backwardDdtScheme::fvmDdt ) ); - fvMatrix& fvm = tfvm(); + fvMatrix& fvm = tfvm.ref(); scalar rDeltaT = 1.0/deltaT_(); @@ -518,7 +518,7 @@ backwardDdtScheme::fvmDdt rho.dimensions()*vf.dimensions()*dimVol/dimTime ) ); - fvMatrix& fvm = tfvm(); + fvMatrix& fvm = tfvm.ref(); scalar rDeltaT = 1.0/deltaT_(); @@ -569,7 +569,7 @@ backwardDdtScheme::fvmDdt rho.dimensions()*vf.dimensions()*dimVol/dimTime ) ); - fvMatrix& fvm = tfvm(); + fvMatrix& fvm = tfvm.ref(); scalar rDeltaT = 1.0/deltaT_(); @@ -624,7 +624,7 @@ backwardDdtScheme::fvmDdt alpha.dimensions()*rho.dimensions()*vf.dimensions()*dimVol/dimTime ) ); - fvMatrix& fvm = tfvm(); + fvMatrix& fvm = tfvm.ref(); scalar rDeltaT = 1.0/deltaT_(); diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/boundedDdtScheme/boundedDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/boundedDdtScheme/boundedDdtScheme.C index e7dc6dc81..c81e9f526 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/boundedDdtScheme/boundedDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/boundedDdtScheme/boundedDdtScheme.C @@ -48,7 +48,7 @@ boundedDdtScheme::fvcDdt const dimensioned& dt ) { - return scheme_().fvcDdt(dt); + return scheme_.ref().fvcDdt(dt); } @@ -59,7 +59,7 @@ boundedDdtScheme::fvcDdt const GeometricField& vf ) { - return scheme_().fvcDdt(vf); + return scheme_.ref().fvcDdt(vf); } @@ -71,7 +71,7 @@ boundedDdtScheme::fvcDdt const GeometricField& vf ) { - return scheme_().fvcDdt(rho, vf); + return scheme_.ref().fvcDdt(rho, vf); } @@ -83,7 +83,7 @@ boundedDdtScheme::fvcDdt const GeometricField& vf ) { - return scheme_().fvcDdt(rho, vf) - fvc::ddt(rho)*vf; + return scheme_.ref().fvcDdt(rho, vf) - fvc::ddt(rho)*vf; } @@ -96,7 +96,7 @@ boundedDdtScheme::fvcDdt const GeometricField& vf ) { - return scheme_().fvcDdt(alpha, rho, vf) - fvc::ddt(alpha, rho)*vf; + return scheme_.ref().fvcDdt(alpha, rho, vf) - fvc::ddt(alpha, rho)*vf; } @@ -107,7 +107,7 @@ boundedDdtScheme::fvmDdt const GeometricField& vf ) { - return scheme_().fvmDdt(vf); + return scheme_.ref().fvmDdt(vf); } @@ -119,7 +119,7 @@ boundedDdtScheme::fvmDdt const GeometricField& vf ) { - return scheme_().fvmDdt(rho, vf); + return scheme_.ref().fvmDdt(rho, vf); } @@ -131,7 +131,7 @@ boundedDdtScheme::fvmDdt const GeometricField& vf ) { - return scheme_().fvmDdt(rho, vf) - fvm::Sp(fvc::ddt(rho), vf); + return scheme_.ref().fvmDdt(rho, vf) - fvm::Sp(fvc::ddt(rho), vf); } @@ -144,7 +144,9 @@ boundedDdtScheme::fvmDdt const GeometricField& vf ) { - return scheme_().fvmDdt(alpha, rho, vf) - fvm::Sp(fvc::ddt(alpha, rho), vf); + return + scheme_.ref().fvmDdt(alpha, rho, vf) + - fvm::Sp(fvc::ddt(alpha, rho), vf); } @@ -156,7 +158,7 @@ boundedDdtScheme::fvcDdtUfCorr const GeometricField& Uf ) { - return scheme_().fvcDdtUfCorr(U, Uf); + return scheme_.ref().fvcDdtUfCorr(U, Uf); } @@ -168,7 +170,7 @@ boundedDdtScheme::fvcDdtPhiCorr const fluxFieldType& phi ) { - return scheme_().fvcDdtPhiCorr(U, phi); + return scheme_.ref().fvcDdtPhiCorr(U, phi); } @@ -181,7 +183,7 @@ boundedDdtScheme::fvcDdtUfCorr const GeometricField& Uf ) { - return scheme_().fvcDdtUfCorr(rho, U, Uf); + return scheme_.ref().fvcDdtUfCorr(rho, U, Uf); } @@ -194,7 +196,7 @@ boundedDdtScheme::fvcDdtPhiCorr const fluxFieldType& phi ) { - return scheme_().fvcDdtPhiCorr(rho, U, phi); + return scheme_.ref().fvcDdtPhiCorr(rho, U, phi); } @@ -204,7 +206,7 @@ tmp boundedDdtScheme::meshPhi const GeometricField& vf ) { - return scheme_().meshPhi(vf); + return scheme_.ref().meshPhi(vf); } diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C index 5144c744c..62cca7ec3 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C @@ -148,7 +148,7 @@ tmp ddtScheme::fvcDdtPhiCoeff scalar(1) ); - surfaceScalarField& ddtCouplingCoeff = tddtCouplingCoeff(); + surfaceScalarField& ddtCouplingCoeff = tddtCouplingCoeff.ref(); forAll(U.boundaryField(), patchi) { diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/localEulerDdtScheme/localEulerDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/localEulerDdtScheme/localEulerDdtScheme.C index c77e3de64..433839957 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/localEulerDdtScheme/localEulerDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/localEulerDdtScheme/localEulerDdtScheme.C @@ -79,7 +79,7 @@ localEulerDdtScheme::fvcDdt ) ); - tdtdt().internalField() = + tdtdt.ref().internalField() = rDeltaT.internalField()*dt.value() *(1.0 - mesh().Vsc0()/mesh().Vsc()); @@ -349,7 +349,7 @@ localEulerDdtScheme::fvmDdt ) ); - fvMatrix& fvm = tfvm(); + fvMatrix& fvm = tfvm.ref(); const scalarField& rDeltaT = localRDeltaT().internalField(); @@ -384,7 +384,7 @@ localEulerDdtScheme::fvmDdt rho.dimensions()*vf.dimensions()*dimVol/dimTime ) ); - fvMatrix& fvm = tfvm(); + fvMatrix& fvm = tfvm.ref(); const scalarField& rDeltaT = localRDeltaT().internalField(); @@ -421,7 +421,7 @@ localEulerDdtScheme::fvmDdt rho.dimensions()*vf.dimensions()*dimVol/dimTime ) ); - fvMatrix& fvm = tfvm(); + fvMatrix& fvm = tfvm.ref(); const scalarField& rDeltaT = localRDeltaT().internalField(); @@ -461,7 +461,7 @@ localEulerDdtScheme::fvmDdt alpha.dimensions()*rho.dimensions()*vf.dimensions()*dimVol/dimTime ) ); - fvMatrix& fvm = tfvm(); + fvMatrix& fvm = tfvm.ref(); const scalarField& rDeltaT = localRDeltaT().internalField(); diff --git a/src/finiteVolume/finiteVolume/divSchemes/gaussDivScheme/gaussDivScheme.C b/src/finiteVolume/finiteVolume/divSchemes/gaussDivScheme/gaussDivScheme.C index 8d445b2f7..9721a04ec 100644 --- a/src/finiteVolume/finiteVolume/divSchemes/gaussDivScheme/gaussDivScheme.C +++ b/src/finiteVolume/finiteVolume/divSchemes/gaussDivScheme/gaussDivScheme.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -62,7 +62,7 @@ gaussDivScheme::fvcDiv ) ); - tDiv().rename("div(" + vf.name() + ')'); + tDiv.ref().rename("div(" + vf.name() + ')'); return tDiv; } diff --git a/src/finiteVolume/finiteVolume/fvc/fvcAverage.C b/src/finiteVolume/finiteVolume/fvc/fvcAverage.C index 022a5a688..711a012f6 100644 --- a/src/finiteVolume/finiteVolume/fvc/fvcAverage.C +++ b/src/finiteVolume/finiteVolume/fvc/fvcAverage.C @@ -65,8 +65,7 @@ average ssf.dimensions() ) ); - - GeometricField& av = taverage(); + GeometricField& av = taverage.ref(); av.internalField() = ( diff --git a/src/finiteVolume/finiteVolume/fvc/fvcDdt.C b/src/finiteVolume/finiteVolume/fvc/fvcDdt.C index 3cabcd515..391da38be 100644 --- a/src/finiteVolume/finiteVolume/fvc/fvcDdt.C +++ b/src/finiteVolume/finiteVolume/fvc/fvcDdt.C @@ -51,7 +51,7 @@ ddt ( mesh, mesh.ddtScheme("ddt(" + dt.name() + ')') - )().fvcDdt(dt); + ).ref().fvcDdt(dt); } @@ -66,7 +66,7 @@ ddt ( vf.mesh(), vf.mesh().ddtScheme("ddt(" + vf.name() + ')') - )().fvcDdt(vf); + ).ref().fvcDdt(vf); } @@ -82,7 +82,7 @@ ddt ( vf.mesh(), vf.mesh().ddtScheme("ddt(" + rho.name() + ',' + vf.name() + ')') - )().fvcDdt(rho, vf); + ).ref().fvcDdt(rho, vf); } @@ -98,7 +98,7 @@ ddt ( vf.mesh(), vf.mesh().ddtScheme("ddt(" + rho.name() + ',' + vf.name() + ')') - )().fvcDdt(rho, vf); + ).ref().fvcDdt(rho, vf); } @@ -121,7 +121,7 @@ ddt + rho.name() + ',' + vf.name() + ')' ) - )().fvcDdt(alpha, rho, vf); + ).ref().fvcDdt(alpha, rho, vf); } @@ -161,7 +161,7 @@ ddtCorr ( U.mesh(), U.mesh().ddtScheme("ddt(" + U.name() + ')') - )().fvcDdtUfCorr(U, Uf); + ).ref().fvcDdtUfCorr(U, Uf); } @@ -182,7 +182,7 @@ ddtCorr ( U.mesh(), U.mesh().ddtScheme("ddt(" + U.name() + ')') - )().fvcDdtPhiCorr(U, phi); + ).ref().fvcDdtPhiCorr(U, phi); } @@ -199,7 +199,7 @@ ddtCorr ( U.mesh(), U.mesh().ddtScheme("ddt(" + U.name() + ')') - )().fvcDdtUfCorr(rho, U, Uf); + ).ref().fvcDdtUfCorr(rho, U, Uf); } @@ -221,7 +221,7 @@ ddtCorr ( U.mesh(), U.mesh().ddtScheme("ddt(" + rho.name() + ',' + U.name() + ')') - )().fvcDdtPhiCorr(rho, U, phi); + ).ref().fvcDdtPhiCorr(rho, U, phi); } diff --git a/src/finiteVolume/finiteVolume/fvc/fvcDiv.C b/src/finiteVolume/finiteVolume/fvc/fvcDiv.C index c788eac5b..888e394df 100644 --- a/src/finiteVolume/finiteVolume/fvc/fvcDiv.C +++ b/src/finiteVolume/finiteVolume/fvc/fvcDiv.C @@ -89,7 +89,7 @@ div return fv::divScheme::New ( vf.mesh(), vf.mesh().divScheme(name) - )().fvcDiv(vf); + ).ref().fvcDiv(vf); } @@ -167,7 +167,7 @@ div vf.mesh(), flux, vf.mesh().divScheme(name) - )().fvcDiv(flux, vf); + ).ref().fvcDiv(flux, vf); } diff --git a/src/finiteVolume/finiteVolume/fvc/fvcLaplacian.C b/src/finiteVolume/finiteVolume/fvc/fvcLaplacian.C index 0ec6662ce..56b94907d 100644 --- a/src/finiteVolume/finiteVolume/fvc/fvcLaplacian.C +++ b/src/finiteVolume/finiteVolume/fvc/fvcLaplacian.C @@ -51,7 +51,7 @@ laplacian ( vf.mesh(), vf.mesh().laplacianScheme(name) - )().fvcLaplacian(vf); + ).ref().fvcLaplacian(vf); } @@ -202,7 +202,7 @@ laplacian ( vf.mesh(), vf.mesh().laplacianScheme(name) - )().fvcLaplacian(gamma, vf); + ).ref().fvcLaplacian(gamma, vf); } @@ -344,7 +344,7 @@ laplacian ( vf.mesh(), vf.mesh().laplacianScheme(name) - )().fvcLaplacian(gamma, vf); + ).ref().fvcLaplacian(gamma, vf); } diff --git a/src/finiteVolume/finiteVolume/fvc/fvcMagSqrGradGrad.C b/src/finiteVolume/finiteVolume/fvc/fvcMagSqrGradGrad.C index fbe3bca33..6def790f2 100644 --- a/src/finiteVolume/finiteVolume/fvc/fvcMagSqrGradGrad.C +++ b/src/finiteVolume/finiteVolume/fvc/fvcMagSqrGradGrad.C @@ -53,7 +53,8 @@ tmp magSqrGradGrad // Loop over other vector field components for (direction cmpt = 1; cmpt < pTraits::nComponents; cmpt++) { - tMagSqrGradGrad() += magSqr(fvc::grad(fvc::grad(vf.component(cmpt))))(); + tMagSqrGradGrad.ref() += + magSqr(fvc::grad(fvc::grad(vf.component(cmpt))))(); } return tMagSqrGradGrad; diff --git a/src/finiteVolume/finiteVolume/fvc/fvcMeshPhi.C b/src/finiteVolume/finiteVolume/fvc/fvcMeshPhi.C index 741321612..f7707e0db 100644 --- a/src/finiteVolume/finiteVolume/fvc/fvcMeshPhi.C +++ b/src/finiteVolume/finiteVolume/fvc/fvcMeshPhi.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -38,7 +38,7 @@ Foam::tmp Foam::fvc::meshPhi ( vf.mesh(), vf.mesh().ddtScheme("ddt(" + vf.name() + ')') - )().meshPhi(vf); + ).ref().meshPhi(vf); } @@ -52,7 +52,7 @@ Foam::tmp Foam::fvc::meshPhi ( vf.mesh(), vf.mesh().ddtScheme("ddt(" + rho.name() + ',' + vf.name() + ')') - )().meshPhi(vf); + ).ref().meshPhi(vf); } @@ -66,7 +66,7 @@ Foam::tmp Foam::fvc::meshPhi ( vf.mesh(), vf.mesh().ddtScheme("ddt(" + rho.name() + ',' + vf.name() + ')') - )().meshPhi(vf); + ).ref().meshPhi(vf); } diff --git a/src/finiteVolume/finiteVolume/fvc/fvcReconstructMag.C b/src/finiteVolume/finiteVolume/fvc/fvcReconstructMag.C index 2b8c34a41..30d12abc4 100644 --- a/src/finiteVolume/finiteVolume/fvc/fvcReconstructMag.C +++ b/src/finiteVolume/finiteVolume/fvc/fvcReconstructMag.C @@ -75,8 +75,7 @@ tmp reconstructMag(const surfaceScalarField& ssf) extrapolatedCalculatedFvPatchScalarField::typeName ) ); - - scalarField& rf = treconField(); + scalarField& rf = treconField.ref(); forAll(owner, facei) { @@ -109,7 +108,7 @@ tmp reconstructMag(const surfaceScalarField& ssf) rf /= mesh.V(); - treconField().correctBoundaryConditions(); + treconField.ref().correctBoundaryConditions(); return treconField; } diff --git a/src/finiteVolume/finiteVolume/fvc/fvcSurfaceIntegrate.C b/src/finiteVolume/finiteVolume/fvc/fvcSurfaceIntegrate.C index ccf92f56c..dd08e083a 100644 --- a/src/finiteVolume/finiteVolume/fvc/fvcSurfaceIntegrate.C +++ b/src/finiteVolume/finiteVolume/fvc/fvcSurfaceIntegrate.C @@ -107,7 +107,7 @@ surfaceIntegrate extrapolatedCalculatedFvPatchField::typeName ) ); - GeometricField& vf = tvf(); + GeometricField& vf = tvf.ref(); surfaceIntegrate(vf.internalField(), ssf); vf.correctBoundaryConditions(); @@ -158,7 +158,7 @@ surfaceSum extrapolatedCalculatedFvPatchField::typeName ) ); - GeometricField& vf = tvf(); + GeometricField& vf = tvf.ref(); const labelUList& owner = mesh.owner(); const labelUList& neighbour = mesh.neighbour(); diff --git a/src/finiteVolume/finiteVolume/fvm/fvmDdt.C b/src/finiteVolume/finiteVolume/fvm/fvmDdt.C index 2cea308b2..da9cef131 100644 --- a/src/finiteVolume/finiteVolume/fvm/fvmDdt.C +++ b/src/finiteVolume/finiteVolume/fvm/fvmDdt.C @@ -51,7 +51,7 @@ ddt ( vf.mesh(), vf.mesh().ddtScheme("ddt(" + vf.name() + ')') - )().fvmDdt(vf); + ).ref().fvmDdt(vf); } @@ -79,7 +79,7 @@ ddt ( vf.mesh(), vf.mesh().ddtScheme("ddt(" + rho.name() + ',' + vf.name() + ')') - )().fvmDdt(rho, vf); + ).ref().fvmDdt(rho, vf); } @@ -95,7 +95,7 @@ ddt ( vf.mesh(), vf.mesh().ddtScheme("ddt(" + rho.name() + ',' + vf.name() + ')') - )().fvmDdt(rho, vf); + ).ref().fvmDdt(rho, vf); } @@ -118,7 +118,7 @@ ddt + rho.name() + ',' + vf.name() + ')' ) - )().fvmDdt(alpha, rho, vf); + ).ref().fvmDdt(alpha, rho, vf); } diff --git a/src/finiteVolume/finiteVolume/fvm/fvmLaplacian.C b/src/finiteVolume/finiteVolume/fvm/fvmLaplacian.C index ef77f5698..aa44d4e68 100644 --- a/src/finiteVolume/finiteVolume/fvm/fvmLaplacian.C +++ b/src/finiteVolume/finiteVolume/fvm/fvmLaplacian.C @@ -216,7 +216,7 @@ laplacian ( vf.mesh(), vf.mesh().laplacianScheme(name) - )().fvmLaplacian(gamma, vf); + ).ref().fvmLaplacian(gamma, vf); } @@ -281,7 +281,7 @@ laplacian ( vf.mesh(), vf.mesh().laplacianScheme(name) - )().fvmLaplacian(gamma, vf); + ).ref().fvmLaplacian(gamma, vf); } diff --git a/src/finiteVolume/finiteVolume/fvm/fvmSup.C b/src/finiteVolume/finiteVolume/fvm/fvmSup.C index 5228eddca..97d33bd60 100644 --- a/src/finiteVolume/finiteVolume/fvm/fvmSup.C +++ b/src/finiteVolume/finiteVolume/fvm/fvmSup.C @@ -47,7 +47,7 @@ Foam::fvm::Su dimVol*su.dimensions() ) ); - fvMatrix& fvm = tfvm(); + fvMatrix& fvm = tfvm.ref(); fvm.source() -= mesh.V()*su.field(); @@ -113,7 +113,7 @@ Foam::fvm::Sp dimVol*sp.dimensions()*vf.dimensions() ) ); - fvMatrix& fvm = tfvm(); + fvMatrix& fvm = tfvm.ref(); fvm.diag() += mesh.V()*sp.field(); @@ -167,7 +167,7 @@ Foam::fvm::Sp dimVol*sp.dimensions()*vf.dimensions() ) ); - fvMatrix& fvm = tfvm(); + fvMatrix& fvm = tfvm.ref(); fvm.diag() += mesh.V()*sp.value(); @@ -205,7 +205,7 @@ Foam::fvm::SuSp dimVol*susp.dimensions()*vf.dimensions() ) ); - fvMatrix& fvm = tfvm(); + fvMatrix& fvm = tfvm.ref(); fvm.diag() += mesh.V()*max(susp.field(), scalar(0)); diff --git a/src/finiteVolume/finiteVolume/gradSchemes/LeastSquaresGrad/LeastSquaresGrad.C b/src/finiteVolume/finiteVolume/gradSchemes/LeastSquaresGrad/LeastSquaresGrad.C index 26b582f77..a462ff85f 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/LeastSquaresGrad/LeastSquaresGrad.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/LeastSquaresGrad/LeastSquaresGrad.C @@ -80,7 +80,7 @@ Foam::fv::LeastSquaresGrad::calcGrad extrapolatedCalculatedFvPatchField::typeName ) ); - GeometricField& lsGrad = tlsGrad(); + GeometricField& lsGrad = tlsGrad.ref(); Field& lsGradIf = lsGrad; const extendedCentredCellToCellStencil& stencil = lsv.stencil(); diff --git a/src/finiteVolume/finiteVolume/gradSchemes/fourthGrad/fourthGrad.C b/src/finiteVolume/finiteVolume/gradSchemes/fourthGrad/fourthGrad.C index 32a433c61..975ff9141 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/fourthGrad/fourthGrad.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/fourthGrad/fourthGrad.C @@ -85,7 +85,7 @@ Foam::fv::fourthGrad::calcGrad secondfGrad ) ); - GeometricField& fGrad = tfGrad(); + GeometricField& fGrad = tfGrad.ref(); const vectorField& C = mesh.C(); diff --git a/src/finiteVolume/finiteVolume/gradSchemes/gaussGrad/gaussGrad.C b/src/finiteVolume/finiteVolume/gradSchemes/gaussGrad/gaussGrad.C index a70e53f5a..7e0c76cf5 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/gaussGrad/gaussGrad.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/gaussGrad/gaussGrad.C @@ -70,7 +70,7 @@ Foam::fv::gaussGrad::gradf extrapolatedCalculatedFvPatchField::typeName ) ); - GeometricField& gGrad = tgGrad(); + GeometricField& gGrad = tgGrad.ref(); const labelUList& owner = mesh.owner(); const labelUList& neighbour = mesh.neighbour(); @@ -132,7 +132,7 @@ Foam::fv::gaussGrad::calcGrad ( gradf(tinterpScheme_().interpolate(vsf), name) ); - GeometricField& gGrad = tgGrad(); + GeometricField& gGrad = tgGrad.ref(); correctBoundaryConditions(vsf, gGrad); diff --git a/src/finiteVolume/finiteVolume/gradSchemes/leastSquaresGrad/leastSquaresGrad.C b/src/finiteVolume/finiteVolume/gradSchemes/leastSquaresGrad/leastSquaresGrad.C index fa80a0856..4a15dbc4d 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/leastSquaresGrad/leastSquaresGrad.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/leastSquaresGrad/leastSquaresGrad.C @@ -76,7 +76,7 @@ Foam::fv::leastSquaresGrad::calcGrad extrapolatedCalculatedFvPatchField::typeName ) ); - GeometricField& lsGrad = tlsGrad(); + GeometricField& lsGrad = tlsGrad.ref(); // Get reference to least square vectors const leastSquaresVectors& lsv = leastSquaresVectors::New(mesh); diff --git a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellLimitedGrad/cellLimitedGrads.C b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellLimitedGrad/cellLimitedGrads.C index 14064aa9e..43238d823 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellLimitedGrad/cellLimitedGrads.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellLimitedGrad/cellLimitedGrads.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -54,7 +54,7 @@ Foam::fv::cellLimitedGrad::calcGrad return tGrad; } - volVectorField& g = tGrad(); + volVectorField& g = tGrad.ref(); const labelUList& owner = mesh.owner(); const labelUList& neighbour = mesh.neighbour(); @@ -208,7 +208,7 @@ Foam::fv::cellLimitedGrad::calcGrad return tGrad; } - volTensorField& g = tGrad(); + volTensorField& g = tGrad.ref(); const labelUList& owner = mesh.owner(); const labelUList& neighbour = mesh.neighbour(); diff --git a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellMDLimitedGrad/cellMDLimitedGrads.C b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellMDLimitedGrad/cellMDLimitedGrads.C index 594ad63dd..5f2301562 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellMDLimitedGrad/cellMDLimitedGrads.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellMDLimitedGrad/cellMDLimitedGrads.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -54,7 +54,7 @@ Foam::fv::cellMDLimitedGrad::calcGrad return tGrad; } - volVectorField& g = tGrad(); + volVectorField& g = tGrad.ref(); const labelUList& owner = mesh.owner(); const labelUList& neighbour = mesh.neighbour(); @@ -197,7 +197,7 @@ Foam::fv::cellMDLimitedGrad::calcGrad return tGrad; } - volTensorField& g = tGrad(); + volTensorField& g = tGrad.ref(); const labelUList& owner = mesh.owner(); const labelUList& neighbour = mesh.neighbour(); diff --git a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceLimitedGrad/faceLimitedGrads.C b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceLimitedGrad/faceLimitedGrads.C index c37b14a29..775dee934 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceLimitedGrad/faceLimitedGrads.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceLimitedGrad/faceLimitedGrads.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -54,7 +54,7 @@ Foam::fv::faceLimitedGrad::calcGrad return tGrad; } - volVectorField& g = tGrad(); + volVectorField& g = tGrad.ref(); const labelUList& owner = mesh.owner(); const labelUList& neighbour = mesh.neighbour(); @@ -190,7 +190,7 @@ Foam::fv::faceLimitedGrad::calcGrad return tGrad; } - volTensorField& g = tGrad(); + volTensorField& g = tGrad.ref(); const labelUList& owner = mesh.owner(); const labelUList& neighbour = mesh.neighbour(); diff --git a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceMDLimitedGrad/faceMDLimitedGrads.C b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceMDLimitedGrad/faceMDLimitedGrads.C index 9a43689fd..f0fd65ee0 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceMDLimitedGrad/faceMDLimitedGrads.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceMDLimitedGrad/faceMDLimitedGrads.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -55,7 +55,7 @@ Foam::fv::faceMDLimitedGrad::calcGrad return tGrad; } - volVectorField& g = tGrad(); + volVectorField& g = tGrad.ref(); const labelUList& owner = mesh.owner(); const labelUList& neighbour = mesh.neighbour(); @@ -195,7 +195,7 @@ Foam::fv::faceMDLimitedGrad::calcGrad return tGrad; } - volTensorField& g = tGrad(); + volTensorField& g = tGrad.ref(); const labelUList& owner = mesh.owner(); const labelUList& neighbour = mesh.neighbour(); diff --git a/src/finiteVolume/finiteVolume/laplacianSchemes/gaussLaplacianScheme/gaussLaplacianScheme.C b/src/finiteVolume/finiteVolume/laplacianSchemes/gaussLaplacianScheme/gaussLaplacianScheme.C index 3bf14b57b..fd9df516e 100644 --- a/src/finiteVolume/finiteVolume/laplacianSchemes/gaussLaplacianScheme/gaussLaplacianScheme.C +++ b/src/finiteVolume/finiteVolume/laplacianSchemes/gaussLaplacianScheme/gaussLaplacianScheme.C @@ -58,7 +58,7 @@ gaussLaplacianScheme::fvmLaplacianUncorrected deltaCoeffs.dimensions()*gammaMagSf.dimensions()*vf.dimensions() ) ); - fvMatrix& fvm = tfvm(); + fvMatrix& fvm = tfvm.ref(); fvm.upper() = deltaCoeffs.internalField()*gammaMagSf.internalField(); fvm.negSumDiag(); @@ -118,7 +118,7 @@ gaussLaplacianScheme::gammaSnGradCorr for (direction cmpt = 0; cmpt < pTraits::nComponents; cmpt++) { - tgammaSnGradCorr().replace + tgammaSnGradCorr.ref().replace ( cmpt, SfGammaCorr & fvc::interpolate(fvc::grad(vf.component(cmpt))) @@ -145,7 +145,7 @@ gaussLaplacianScheme::fvcLaplacian fvc::div(this->tsnGradScheme_().snGrad(vf)*mesh.magSf()) ); - tLaplacian().rename("laplacian(" + vf.name() + ')'); + tLaplacian.ref().rename("laplacian(" + vf.name() + ')'); return tLaplacian; } @@ -176,14 +176,14 @@ gaussLaplacianScheme::fvmLaplacian this->tsnGradScheme_().deltaCoeffs(vf), vf ); - fvMatrix& fvm = tfvm(); + fvMatrix& fvm = tfvm.ref(); tmp> tfaceFluxCorrection = gammaSnGradCorr(SfGammaCorr, vf); if (this->tsnGradScheme_().corrected()) { - tfaceFluxCorrection() += + tfaceFluxCorrection.ref() += SfGammaSn*this->tsnGradScheme_().correction(vf); } @@ -225,7 +225,10 @@ gaussLaplacianScheme::fvcLaplacian ) ); - tLaplacian().rename("laplacian(" + gamma.name() + ',' + vf.name() + ')'); + tLaplacian.ref().rename + ( + "laplacian(" + gamma.name() + ',' + vf.name() + ')' + ); return tLaplacian; } diff --git a/src/finiteVolume/finiteVolume/laplacianSchemes/gaussLaplacianScheme/gaussLaplacianSchemes.C b/src/finiteVolume/finiteVolume/laplacianSchemes/gaussLaplacianScheme/gaussLaplacianSchemes.C index 417c3ac19..8afa4447d 100644 --- a/src/finiteVolume/finiteVolume/laplacianSchemes/gaussLaplacianScheme/gaussLaplacianSchemes.C +++ b/src/finiteVolume/finiteVolume/laplacianSchemes/gaussLaplacianScheme/gaussLaplacianSchemes.C @@ -53,7 +53,7 @@ Foam::fv::gaussLaplacianScheme::fvmLaplacian \ this->tsnGradScheme_().deltaCoeffs(vf), \ vf \ ); \ - fvMatrix& fvm = tfvm(); \ + fvMatrix& fvm = tfvm.ref(); \ \ if (this->tsnGradScheme_().corrected()) \ { \ @@ -102,7 +102,10 @@ Foam::fv::gaussLaplacianScheme::fvcLaplacian \ fvc::div(gamma*this->tsnGradScheme_().snGrad(vf)*mesh.magSf()) \ ); \ \ - tLaplacian().rename("laplacian(" + gamma.name() + ',' + vf.name() + ')');\ + tLaplacian.ref().rename \ + ( \ + "laplacian(" + gamma.name() + ',' + vf.name() + ')' \ + ); \ \ return tLaplacian; \ } diff --git a/src/finiteVolume/finiteVolume/snGradSchemes/CentredFitSnGrad/CentredFitSnGradScheme.H b/src/finiteVolume/finiteVolume/snGradSchemes/CentredFitSnGrad/CentredFitSnGradScheme.H index 1a05f609c..f06951f10 100644 --- a/src/finiteVolume/finiteVolume/snGradSchemes/CentredFitSnGrad/CentredFitSnGradScheme.H +++ b/src/finiteVolume/finiteVolume/snGradSchemes/CentredFitSnGrad/CentredFitSnGradScheme.H @@ -137,7 +137,7 @@ public: stencil.weightedSum(vf, cfd.coeffs()) ); - sft().dimensions() /= dimLength; + sft.ref().dimensions() /= dimLength; return sft; } diff --git a/src/finiteVolume/finiteVolume/snGradSchemes/correctedSnGrad/correctedSnGrad.C b/src/finiteVolume/finiteVolume/snGradSchemes/correctedSnGrad/correctedSnGrad.C index b653e839e..ea58ee024 100644 --- a/src/finiteVolume/finiteVolume/snGradSchemes/correctedSnGrad/correctedSnGrad.C +++ b/src/finiteVolume/finiteVolume/snGradSchemes/correctedSnGrad/correctedSnGrad.C @@ -59,7 +59,7 @@ Foam::fv::correctedSnGrad::fullGradCorrection mesh.gradScheme("grad(" + vf.name() + ')') )().grad(vf, "grad(" + vf.name() + ')') ); - tssf().rename("snGradCorr(" + vf.name() + ')'); + tssf.ref().rename("snGradCorr(" + vf.name() + ')'); return tssf; } @@ -91,7 +91,7 @@ Foam::fv::correctedSnGrad::correction vf.dimensions()*mesh.nonOrthDeltaCoeffs().dimensions() ) ); - GeometricField& ssf = tssf(); + GeometricField& ssf = tssf.ref(); for (direction cmpt = 0; cmpt < pTraits::nComponents; cmpt++) { diff --git a/src/finiteVolume/finiteVolume/snGradSchemes/faceCorrectedSnGrad/faceCorrectedSnGrad.C b/src/finiteVolume/finiteVolume/snGradSchemes/faceCorrectedSnGrad/faceCorrectedSnGrad.C index 1d13539f4..467dc0af5 100644 --- a/src/finiteVolume/finiteVolume/snGradSchemes/faceCorrectedSnGrad/faceCorrectedSnGrad.C +++ b/src/finiteVolume/finiteVolume/snGradSchemes/faceCorrectedSnGrad/faceCorrectedSnGrad.C @@ -68,7 +68,7 @@ Foam::fv::faceCorrectedSnGrad::fullGradCorrection ) ); - Field& sfCorr = tsfCorr().internalField(); + Field& sfCorr = tsfCorr.ref().internalField(); const pointField& points = mesh.points(); const faceList& faces = mesh.faces(); @@ -116,7 +116,7 @@ Foam::fv::faceCorrectedSnGrad::fullGradCorrection sfCorr[facei] = dCorr&fgrad; } - tsfCorr().boundaryField() = pTraits::zero; + tsfCorr.ref().boundaryField() = pTraits::zero; return tsfCorr; } @@ -148,7 +148,7 @@ Foam::fv::faceCorrectedSnGrad::correction vf.dimensions()*mesh.nonOrthDeltaCoeffs().dimensions() ) ); - GeometricField& ssf = tssf(); + GeometricField& ssf = tssf.ref(); for (direction cmpt = 0; cmpt < pTraits::nComponents; cmpt++) { diff --git a/src/finiteVolume/finiteVolume/snGradSchemes/snGradScheme/snGradScheme.C b/src/finiteVolume/finiteVolume/snGradSchemes/snGradScheme/snGradScheme.C index c667c4410..f5c28f080 100644 --- a/src/finiteVolume/finiteVolume/snGradSchemes/snGradScheme/snGradScheme.C +++ b/src/finiteVolume/finiteVolume/snGradSchemes/snGradScheme/snGradScheme.C @@ -123,7 +123,7 @@ snGradScheme::snGrad vf.dimensions()*tdeltaCoeffs().dimensions() ) ); - GeometricField& ssf = tsf(); + GeometricField& ssf = tsf.ref(); // set reference to difference factors array const scalarField& deltaCoeffs = tdeltaCoeffs().internalField(); @@ -183,7 +183,7 @@ snGradScheme::snGrad if (corrected()) { - tsf() += correction(vf); + tsf.ref() += correction(vf); } return tsf; diff --git a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C index 7fb437976..6d4b18f37 100644 --- a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C +++ b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C @@ -158,7 +158,7 @@ void Foam::fvMatrix::addBoundarySource } else if (couples) { - tmp> tpnf = ptf.patchNeighbourField(); + const tmp> tpnf = ptf.patchNeighbourField(); const Field& pnf = tpnf(); const labelUList& addr = lduAddr().patchAddr(patchI); @@ -743,8 +743,8 @@ Foam::tmp Foam::fvMatrix::A() const ) ); - tAphi().internalField() = D()/psi_.mesh().V(); - tAphi().correctBoundaryConditions(); + tAphi.ref().internalField() = D()/psi_.mesh().V(); + tAphi.ref().correctBoundaryConditions(); return tAphi; } @@ -771,7 +771,7 @@ Foam::fvMatrix::H() const extrapolatedCalculatedFvPatchScalarField::typeName ) ); - GeometricField& Hphi = tHphi(); + GeometricField& Hphi = tHphi.ref(); // Loop over field components for (direction cmpt=0; cmpt Foam::fvMatrix::H1() const extrapolatedCalculatedFvPatchScalarField::typeName ) ); - volScalarField& H1_ = tH1(); + volScalarField& H1_ = tH1.ref(); H1_.internalField() = lduMatrix::H1(); @@ -890,7 +890,8 @@ flux() const dimensions() ) ); - GeometricField& fieldFlux = tfieldFlux(); + GeometricField& fieldFlux = + tfieldFlux.ref(); for (direction cmpt=0; cmpt::nComponents; cmpt++) { @@ -1462,7 +1463,7 @@ Foam::tmp> Foam::operator== { checkMethod(A, su, "=="); tmp> tC(new fvMatrix(A)); - tC().source() += su.mesh().V()*su.field(); + tC.ref().source() += su.mesh().V()*su.field(); return tC; } @@ -1475,7 +1476,7 @@ Foam::tmp> Foam::operator== { checkMethod(A, tsu(), "=="); tmp> tC(new fvMatrix(A)); - tC().source() += tsu().mesh().V()*tsu().field(); + tC.ref().source() += tsu().mesh().V()*tsu().field(); tsu.clear(); return tC; } @@ -1489,7 +1490,7 @@ Foam::tmp> Foam::operator== { checkMethod(A, tsu(), "=="); tmp> tC(new fvMatrix(A)); - tC().source() += tsu().mesh().V()*tsu().internalField(); + tC.ref().source() += tsu().mesh().V()*tsu().internalField(); tsu.clear(); return tC; } @@ -1503,7 +1504,7 @@ Foam::tmp> Foam::operator== { checkMethod(tA(), su, "=="); tmp> tC(tA.ptr()); - tC().source() += su.mesh().V()*su.field(); + tC.ref().source() += su.mesh().V()*su.field(); return tC; } @@ -1516,7 +1517,7 @@ Foam::tmp> Foam::operator== { checkMethod(tA(), tsu(), "=="); tmp> tC(tA.ptr()); - tC().source() += tsu().mesh().V()*tsu().field(); + tC.ref().source() += tsu().mesh().V()*tsu().field(); tsu.clear(); return tC; } @@ -1530,7 +1531,7 @@ Foam::tmp> Foam::operator== { checkMethod(tA(), tsu(), "=="); tmp> tC(tA.ptr()); - tC().source() += tsu().mesh().V()*tsu().internalField(); + tC.ref().source() += tsu().mesh().V()*tsu().internalField(); tsu.clear(); return tC; } @@ -1544,7 +1545,7 @@ Foam::tmp> Foam::operator== { checkMethod(A, su, "=="); tmp> tC(new fvMatrix(A)); - tC().source() += A.psi().mesh().V()*su.value(); + tC.ref().source() += A.psi().mesh().V()*su.value(); return tC; } @@ -1557,7 +1558,7 @@ Foam::tmp> Foam::operator== { checkMethod(tA(), su, "=="); tmp> tC(tA.ptr()); - tC().source() += tC().psi().mesh().V()*su.value(); + tC.ref().source() += tC().psi().mesh().V()*su.value(); return tC; } @@ -1590,7 +1591,7 @@ Foam::tmp> Foam::operator- ) { tmp> tC(new fvMatrix(A)); - tC().negate(); + tC.ref().negate(); return tC; } @@ -1601,7 +1602,7 @@ Foam::tmp> Foam::operator- ) { tmp> tC(tA.ptr()); - tC().negate(); + tC.ref().negate(); return tC; } @@ -1615,7 +1616,7 @@ Foam::tmp> Foam::operator+ { checkMethod(A, B, "+"); tmp> tC(new fvMatrix(A)); - tC() += B; + tC.ref() += B; return tC; } @@ -1628,7 +1629,7 @@ Foam::tmp> Foam::operator+ { checkMethod(tA(), B, "+"); tmp> tC(tA.ptr()); - tC() += B; + tC.ref() += B; return tC; } @@ -1641,7 +1642,7 @@ Foam::tmp> Foam::operator+ { checkMethod(A, tB(), "+"); tmp> tC(tB.ptr()); - tC() += A; + tC.ref() += A; return tC; } @@ -1654,7 +1655,7 @@ Foam::tmp> Foam::operator+ { checkMethod(tA(), tB(), "+"); tmp> tC(tA.ptr()); - tC() += tB(); + tC.ref() += tB(); tB.clear(); return tC; } @@ -1668,7 +1669,7 @@ Foam::tmp> Foam::operator+ { checkMethod(A, su, "+"); tmp> tC(new fvMatrix(A)); - tC().source() -= su.mesh().V()*su.field(); + tC.ref().source() -= su.mesh().V()*su.field(); return tC; } @@ -1681,7 +1682,7 @@ Foam::tmp> Foam::operator+ { checkMethod(A, tsu(), "+"); tmp> tC(new fvMatrix(A)); - tC().source() -= tsu().mesh().V()*tsu().field(); + tC.ref().source() -= tsu().mesh().V()*tsu().field(); tsu.clear(); return tC; } @@ -1695,7 +1696,7 @@ Foam::tmp> Foam::operator+ { checkMethod(A, tsu(), "+"); tmp> tC(new fvMatrix(A)); - tC().source() -= tsu().mesh().V()*tsu().internalField(); + tC.ref().source() -= tsu().mesh().V()*tsu().internalField(); tsu.clear(); return tC; } @@ -1709,7 +1710,7 @@ Foam::tmp> Foam::operator+ { checkMethod(tA(), su, "+"); tmp> tC(tA.ptr()); - tC().source() -= su.mesh().V()*su.field(); + tC.ref().source() -= su.mesh().V()*su.field(); return tC; } @@ -1722,7 +1723,7 @@ Foam::tmp> Foam::operator+ { checkMethod(tA(), tsu(), "+"); tmp> tC(tA.ptr()); - tC().source() -= tsu().mesh().V()*tsu().field(); + tC.ref().source() -= tsu().mesh().V()*tsu().field(); tsu.clear(); return tC; } @@ -1736,7 +1737,7 @@ Foam::tmp> Foam::operator+ { checkMethod(tA(), tsu(), "+"); tmp> tC(tA.ptr()); - tC().source() -= tsu().mesh().V()*tsu().internalField(); + tC.ref().source() -= tsu().mesh().V()*tsu().internalField(); tsu.clear(); return tC; } @@ -1750,7 +1751,7 @@ Foam::tmp> Foam::operator+ { checkMethod(A, su, "+"); tmp> tC(new fvMatrix(A)); - tC().source() -= su.mesh().V()*su.field(); + tC.ref().source() -= su.mesh().V()*su.field(); return tC; } @@ -1763,7 +1764,7 @@ Foam::tmp> Foam::operator+ { checkMethod(A, tsu(), "+"); tmp> tC(new fvMatrix(A)); - tC().source() -= tsu().mesh().V()*tsu().field(); + tC.ref().source() -= tsu().mesh().V()*tsu().field(); tsu.clear(); return tC; } @@ -1777,7 +1778,7 @@ Foam::tmp> Foam::operator+ { checkMethod(A, tsu(), "+"); tmp> tC(new fvMatrix(A)); - tC().source() -= tsu().mesh().V()*tsu().internalField(); + tC.ref().source() -= tsu().mesh().V()*tsu().internalField(); tsu.clear(); return tC; } @@ -1791,7 +1792,7 @@ Foam::tmp> Foam::operator+ { checkMethod(tA(), su, "+"); tmp> tC(tA.ptr()); - tC().source() -= su.mesh().V()*su.field(); + tC.ref().source() -= su.mesh().V()*su.field(); return tC; } @@ -1804,7 +1805,7 @@ Foam::tmp> Foam::operator+ { checkMethod(tA(), tsu(), "+"); tmp> tC(tA.ptr()); - tC().source() -= tsu().mesh().V()*tsu().field(); + tC.ref().source() -= tsu().mesh().V()*tsu().field(); tsu.clear(); return tC; } @@ -1818,7 +1819,7 @@ Foam::tmp> Foam::operator+ { checkMethod(tA(), tsu(), "+"); tmp> tC(tA.ptr()); - tC().source() -= tsu().mesh().V()*tsu().internalField(); + tC.ref().source() -= tsu().mesh().V()*tsu().internalField(); tsu.clear(); return tC; } @@ -1833,7 +1834,7 @@ Foam::tmp> Foam::operator- { checkMethod(A, B, "-"); tmp> tC(new fvMatrix(A)); - tC() -= B; + tC.ref() -= B; return tC; } @@ -1846,7 +1847,7 @@ Foam::tmp> Foam::operator- { checkMethod(tA(), B, "-"); tmp> tC(tA.ptr()); - tC() -= B; + tC.ref() -= B; return tC; } @@ -1859,8 +1860,8 @@ Foam::tmp> Foam::operator- { checkMethod(A, tB(), "-"); tmp> tC(tB.ptr()); - tC() -= A; - tC().negate(); + tC.ref() -= A; + tC.ref().negate(); return tC; } @@ -1873,7 +1874,7 @@ Foam::tmp> Foam::operator- { checkMethod(tA(), tB(), "-"); tmp> tC(tA.ptr()); - tC() -= tB(); + tC.ref() -= tB(); tB.clear(); return tC; } @@ -1887,7 +1888,7 @@ Foam::tmp> Foam::operator- { checkMethod(A, su, "-"); tmp> tC(new fvMatrix(A)); - tC().source() += su.mesh().V()*su.field(); + tC.ref().source() += su.mesh().V()*su.field(); return tC; } @@ -1900,7 +1901,7 @@ Foam::tmp> Foam::operator- { checkMethod(A, tsu(), "-"); tmp> tC(new fvMatrix(A)); - tC().source() += tsu().mesh().V()*tsu().field(); + tC.ref().source() += tsu().mesh().V()*tsu().field(); tsu.clear(); return tC; } @@ -1914,7 +1915,7 @@ Foam::tmp> Foam::operator- { checkMethod(A, tsu(), "-"); tmp> tC(new fvMatrix(A)); - tC().source() += tsu().mesh().V()*tsu().internalField(); + tC.ref().source() += tsu().mesh().V()*tsu().internalField(); tsu.clear(); return tC; } @@ -1928,7 +1929,7 @@ Foam::tmp> Foam::operator- { checkMethod(tA(), su, "-"); tmp> tC(tA.ptr()); - tC().source() += su.mesh().V()*su.field(); + tC.ref().source() += su.mesh().V()*su.field(); return tC; } @@ -1941,7 +1942,7 @@ Foam::tmp> Foam::operator- { checkMethod(tA(), tsu(), "-"); tmp> tC(tA.ptr()); - tC().source() += tsu().mesh().V()*tsu().field(); + tC.ref().source() += tsu().mesh().V()*tsu().field(); tsu.clear(); return tC; } @@ -1955,7 +1956,7 @@ Foam::tmp> Foam::operator- { checkMethod(tA(), tsu(), "-"); tmp> tC(tA.ptr()); - tC().source() += tsu().mesh().V()*tsu().internalField(); + tC.ref().source() += tsu().mesh().V()*tsu().internalField(); tsu.clear(); return tC; } @@ -1969,8 +1970,8 @@ Foam::tmp> Foam::operator- { checkMethod(A, su, "-"); tmp> tC(new fvMatrix(A)); - tC().negate(); - tC().source() -= su.mesh().V()*su.field(); + tC.ref().negate(); + tC.ref().source() -= su.mesh().V()*su.field(); return tC; } @@ -1983,8 +1984,8 @@ Foam::tmp> Foam::operator- { checkMethod(A, tsu(), "-"); tmp> tC(new fvMatrix(A)); - tC().negate(); - tC().source() -= tsu().mesh().V()*tsu().field(); + tC.ref().negate(); + tC.ref().source() -= tsu().mesh().V()*tsu().field(); tsu.clear(); return tC; } @@ -1998,8 +1999,8 @@ Foam::tmp> Foam::operator- { checkMethod(A, tsu(), "-"); tmp> tC(new fvMatrix(A)); - tC().negate(); - tC().source() -= tsu().mesh().V()*tsu().internalField(); + tC.ref().negate(); + tC.ref().source() -= tsu().mesh().V()*tsu().internalField(); tsu.clear(); return tC; } @@ -2013,8 +2014,8 @@ Foam::tmp> Foam::operator- { checkMethod(tA(), su, "-"); tmp> tC(tA.ptr()); - tC().negate(); - tC().source() -= su.mesh().V()*su.field(); + tC.ref().negate(); + tC.ref().source() -= su.mesh().V()*su.field(); return tC; } @@ -2027,8 +2028,8 @@ Foam::tmp> Foam::operator- { checkMethod(tA(), tsu(), "-"); tmp> tC(tA.ptr()); - tC().negate(); - tC().source() -= tsu().mesh().V()*tsu().field(); + tC.ref().negate(); + tC.ref().source() -= tsu().mesh().V()*tsu().field(); tsu.clear(); return tC; } @@ -2042,8 +2043,8 @@ Foam::tmp> Foam::operator- { checkMethod(tA(), tsu(), "-"); tmp> tC(tA.ptr()); - tC().negate(); - tC().source() -= tsu().mesh().V()*tsu().internalField(); + tC.ref().negate(); + tC.ref().source() -= tsu().mesh().V()*tsu().internalField(); tsu.clear(); return tC; } @@ -2057,7 +2058,7 @@ Foam::tmp> Foam::operator+ { checkMethod(A, su, "+"); tmp> tC(new fvMatrix(A)); - tC().source() -= su.value()*A.psi().mesh().V(); + tC.ref().source() -= su.value()*A.psi().mesh().V(); return tC; } @@ -2070,7 +2071,7 @@ Foam::tmp> Foam::operator+ { checkMethod(tA(), su, "+"); tmp> tC(tA.ptr()); - tC().source() -= su.value()*tC().psi().mesh().V(); + tC.ref().source() -= su.value()*tC().psi().mesh().V(); return tC; } @@ -2083,7 +2084,7 @@ Foam::tmp> Foam::operator+ { checkMethod(A, su, "+"); tmp> tC(new fvMatrix(A)); - tC().source() -= su.value()*A.psi().mesh().V(); + tC.ref().source() -= su.value()*A.psi().mesh().V(); return tC; } @@ -2096,7 +2097,7 @@ Foam::tmp> Foam::operator+ { checkMethod(tA(), su, "+"); tmp> tC(tA.ptr()); - tC().source() -= su.value()*tC().psi().mesh().V(); + tC.ref().source() -= su.value()*tC().psi().mesh().V(); return tC; } @@ -2109,7 +2110,7 @@ Foam::tmp> Foam::operator- { checkMethod(A, su, "-"); tmp> tC(new fvMatrix(A)); - tC().source() += su.value()*tC().psi().mesh().V(); + tC.ref().source() += su.value()*tC().psi().mesh().V(); return tC; } @@ -2122,7 +2123,7 @@ Foam::tmp> Foam::operator- { checkMethod(tA(), su, "-"); tmp> tC(tA.ptr()); - tC().source() += su.value()*tC().psi().mesh().V(); + tC.ref().source() += su.value()*tC().psi().mesh().V(); return tC; } @@ -2135,8 +2136,8 @@ Foam::tmp> Foam::operator- { checkMethod(A, su, "-"); tmp> tC(new fvMatrix(A)); - tC().negate(); - tC().source() -= su.value()*A.psi().mesh().V(); + tC.ref().negate(); + tC.ref().source() -= su.value()*A.psi().mesh().V(); return tC; } @@ -2149,8 +2150,8 @@ Foam::tmp> Foam::operator- { checkMethod(tA(), su, "-"); tmp> tC(tA.ptr()); - tC().negate(); - tC().source() -= su.value()*tC().psi().mesh().V(); + tC.ref().negate(); + tC.ref().source() -= su.value()*tC().psi().mesh().V(); return tC; } @@ -2163,7 +2164,7 @@ Foam::tmp> Foam::operator* ) { tmp> tC(new fvMatrix(A)); - tC() *= dsf; + tC.ref() *= dsf; return tC; } @@ -2175,7 +2176,7 @@ Foam::tmp> Foam::operator* ) { tmp> tC(new fvMatrix(A)); - tC() *= tdsf; + tC.ref() *= tdsf; return tC; } @@ -2187,7 +2188,7 @@ Foam::tmp> Foam::operator* ) { tmp> tC(new fvMatrix(A)); - tC() *= tvsf; + tC.ref() *= tvsf; return tC; } @@ -2199,7 +2200,7 @@ Foam::tmp> Foam::operator* ) { tmp> tC(tA.ptr()); - tC() *= dsf; + tC.ref() *= dsf; return tC; } @@ -2211,7 +2212,7 @@ Foam::tmp> Foam::operator* ) { tmp> tC(tA.ptr()); - tC() *= tdsf; + tC.ref() *= tdsf; return tC; } @@ -2223,7 +2224,7 @@ Foam::tmp> Foam::operator* ) { tmp> tC(tA.ptr()); - tC() *= tvsf; + tC.ref() *= tvsf; return tC; } @@ -2235,7 +2236,7 @@ Foam::tmp> Foam::operator* ) { tmp> tC(new fvMatrix(A)); - tC() *= ds; + tC.ref() *= ds; return tC; } @@ -2247,7 +2248,7 @@ Foam::tmp> Foam::operator* ) { tmp> tC(tA.ptr()); - tC() *= ds; + tC.ref() *= ds; return tC; } @@ -2277,7 +2278,7 @@ Foam::operator& extrapolatedCalculatedFvPatchScalarField::typeName ) ); - GeometricField& Mphi = tMphi(); + GeometricField& Mphi = tMphi.ref(); // Loop over field components if (M.hasDiag()) diff --git a/src/finiteVolume/fvMatrices/fvScalarMatrix/fvScalarMatrix.C b/src/finiteVolume/fvMatrices/fvScalarMatrix/fvScalarMatrix.C index 7effdd1ef..46fa55528 100644 --- a/src/finiteVolume/fvMatrices/fvScalarMatrix/fvScalarMatrix.C +++ b/src/finiteVolume/fvMatrices/fvScalarMatrix/fvScalarMatrix.C @@ -201,7 +201,7 @@ Foam::tmp Foam::fvMatrix::residual() const ) ); - addBoundarySource(tres()); + addBoundarySource(tres.ref()); return tres; } @@ -227,7 +227,7 @@ Foam::tmp Foam::fvMatrix::H() const extrapolatedCalculatedFvPatchScalarField::typeName ) ); - volScalarField& Hphi = tHphi(); + volScalarField& Hphi = tHphi.ref(); Hphi.internalField() = (lduMatrix::H(psi_.internalField()) + source_); addBoundarySource(Hphi.internalField()); @@ -259,7 +259,7 @@ Foam::tmp Foam::fvMatrix::H1() const extrapolatedCalculatedFvPatchScalarField::typeName ) ); - volScalarField& H1_ = tH1(); + volScalarField& H1_ = tH1.ref(); H1_.internalField() = lduMatrix::H1(); //addBoundarySource(Hphi.internalField()); diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencilTemplates.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencilTemplates.C index a14c06c71..7fe2202af 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencilTemplates.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencilTemplates.C @@ -118,7 +118,7 @@ Foam::extendedCellToFaceStencil::weightedSum ) ) ); - GeometricField& sf = tsfCorr(); + GeometricField& sf = tsfCorr.ref(); // Internal faces for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++) diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencilTemplates.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencilTemplates.C index 0607c8e4e..fe06177ec 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencilTemplates.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencilTemplates.C @@ -67,7 +67,7 @@ Foam::extendedUpwindCellToFaceStencil::weightedSum ) ) ); - GeometricField& sf = tsfCorr(); + GeometricField& sf = tsfCorr.ref(); // Internal faces for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++) diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencilTemplates.C b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencilTemplates.C index d6b47a56b..e1530b0b3 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencilTemplates.C +++ b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencilTemplates.C @@ -112,7 +112,7 @@ Foam::extendedFaceToCellStencil::weightedSum ) ) ); - GeometricField& sf = tsfCorr(); + GeometricField& sf = tsfCorr.ref(); // cells forAll(sf, cellI) diff --git a/src/finiteVolume/fvMesh/fvMesh.C b/src/finiteVolume/fvMesh/fvMesh.C index 22f12198d..a6ccd8ab0 100644 --- a/src/finiteVolume/fvMesh/fvMesh.C +++ b/src/finiteVolume/fvMesh/fvMesh.C @@ -761,7 +761,7 @@ Foam::tmp Foam::fvMesh::movePoints(const pointField& p) scalar rDeltaT = 1.0/time().deltaTValue(); tmp tsweptVols = polyMesh::movePoints(p); - scalarField& sweptVols = tsweptVols(); + scalarField& sweptVols = tsweptVols.ref(); phi.internalField() = scalarField::subField(sweptVols, nInternalFaces()); phi.internalField() *= rDeltaT; diff --git a/src/finiteVolume/fvMesh/fvMeshGeometry.C b/src/finiteVolume/fvMesh/fvMeshGeometry.C index 17bb30ec0..8cdeca38a 100644 --- a/src/finiteVolume/fvMesh/fvMeshGeometry.C +++ b/src/finiteVolume/fvMesh/fvMeshGeometry.C @@ -399,7 +399,7 @@ Foam::tmp Foam::fvMesh::delta() const dimLength ) ); - surfaceVectorField& delta = tdelta(); + surfaceVectorField& delta = tdelta.ref(); const volVectorField& C = this->C(); const labelUList& owner = this->owner(); diff --git a/src/finiteVolume/fvMesh/fvPatches/constraint/cyclic/cyclicFvPatch.C b/src/finiteVolume/fvMesh/fvPatches/constraint/cyclic/cyclicFvPatch.C index 5b6ed7314..9b5a2aaf4 100644 --- a/src/finiteVolume/fvMesh/fvPatches/constraint/cyclic/cyclicFvPatch.C +++ b/src/finiteVolume/fvMesh/fvPatches/constraint/cyclic/cyclicFvPatch.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -62,7 +62,7 @@ Foam::tmp Foam::cyclicFvPatch::delta() const const vectorField nbrPatchD(neighbFvPatch().coupledFvPatch::delta()); tmp tpdv(new vectorField(patchD.size())); - vectorField& pdv = tpdv(); + vectorField& pdv = tpdv.ref(); // To the transformation if necessary if (parallel()) diff --git a/src/finiteVolume/fvMesh/fvPatches/constraint/cyclicACMI/cyclicACMIFvPatch.C b/src/finiteVolume/fvMesh/fvPatches/constraint/cyclicACMI/cyclicACMIFvPatch.C index b87157e34..ed1d97fb1 100644 --- a/src/finiteVolume/fvMesh/fvPatches/constraint/cyclicACMI/cyclicACMIFvPatch.C +++ b/src/finiteVolume/fvMesh/fvPatches/constraint/cyclicACMI/cyclicACMIFvPatch.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -148,7 +148,7 @@ Foam::tmp Foam::cyclicACMIFvPatch::delta() const nbrPatchD -= nbrPatchD0; tmp tpdv(new vectorField(patchD.size())); - vectorField& pdv = tpdv(); + vectorField& pdv = tpdv.ref(); // do the transformation if necessary if (parallel()) diff --git a/src/finiteVolume/fvMesh/fvPatches/constraint/cyclicAMI/cyclicAMIFvPatch.C b/src/finiteVolume/fvMesh/fvPatches/constraint/cyclicAMI/cyclicAMIFvPatch.C index 5d8935139..69e940d12 100644 --- a/src/finiteVolume/fvMesh/fvPatches/constraint/cyclicAMI/cyclicAMIFvPatch.C +++ b/src/finiteVolume/fvMesh/fvPatches/constraint/cyclicAMI/cyclicAMIFvPatch.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -113,7 +113,7 @@ Foam::tmp Foam::cyclicAMIFvPatch::delta() const const vectorField& nbrPatchD = tnbrPatchD(); tmp tpdv(new vectorField(patchD.size())); - vectorField& pdv = tpdv(); + vectorField& pdv = tpdv.ref(); // do the transformation if necessary if (parallel()) diff --git a/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatch.C b/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatch.C index d7f1bcd39..a3a9a2dd7 100644 --- a/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatch.C +++ b/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatch.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -105,7 +105,7 @@ const Foam::vectorField& Foam::fvPatch::Cf() const Foam::tmp Foam::fvPatch::Cn() const { tmp tcc(new vectorField(size())); - vectorField& cc = tcc(); + vectorField& cc = tcc.ref(); const labelUList& faceCells = this->faceCells(); diff --git a/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatchTemplates.C b/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatchTemplates.C index 21e931f01..f3862fdc0 100644 --- a/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatchTemplates.C +++ b/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatchTemplates.C @@ -34,7 +34,7 @@ Foam::tmp> Foam::fvPatch::patchInternalField ) const { tmp> tpif(new Field(size())); - Field& pif = tpif(); + Field& pif = tpif.ref(); const labelUList& faceCells = this->faceCells(); diff --git a/src/finiteVolume/fvMesh/wallDist/patchDistMethods/Poisson/PoissonPatchDistMethod.C b/src/finiteVolume/fvMesh/wallDist/patchDistMethods/Poisson/PoissonPatchDistMethod.C index d93e64dea..03e03c6df 100644 --- a/src/finiteVolume/fvMesh/wallDist/patchDistMethods/Poisson/PoissonPatchDistMethod.C +++ b/src/finiteVolume/fvMesh/wallDist/patchDistMethods/Poisson/PoissonPatchDistMethod.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -94,8 +94,7 @@ bool Foam::patchDistMethods::Poisson::correct ) ); } - - volScalarField& yPsi = tyPsi_(); + volScalarField& yPsi = tyPsi_.ref(); solve(fvm::laplacian(yPsi) == dimensionedScalar("1", dimless, -1.0)); diff --git a/src/finiteVolume/fvMesh/wallDist/wallDist/wallDist.C b/src/finiteVolume/fvMesh/wallDist/wallDist/wallDist.C index b84c345a1..8b2131ea3 100644 --- a/src/finiteVolume/fvMesh/wallDist/wallDist/wallDist.C +++ b/src/finiteVolume/fvMesh/wallDist/wallDist/wallDist.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -176,7 +176,7 @@ const Foam::volVectorField& Foam::wallDist::n() const nRequired_ = true; constructn(); - pdm_->correct(y_, n_()); + pdm_->correct(y_, n_.ref()); } return n_(); @@ -189,7 +189,7 @@ bool Foam::wallDist::movePoints() { if (nRequired_) { - return pdm_->correct(y_, n_()); + return pdm_->correct(y_, n_.ref()); } else { diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/LimitedScheme/LimitedScheme.C b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/LimitedScheme/LimitedScheme.C index 834241246..8b523015e 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/LimitedScheme/LimitedScheme.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/LimitedScheme/LimitedScheme.C @@ -198,7 +198,7 @@ Foam::LimitedScheme::limiter ) ); - calcLimiter(phi, tlimiterField()); + calcLimiter(phi, tlimiterField.ref()); return tlimiterField; } diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/PhiScheme/PhiScheme.C b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/PhiScheme/PhiScheme.C index 28cc9fa1d..3101d6089 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/PhiScheme/PhiScheme.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/PhiScheme/PhiScheme.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -54,7 +54,7 @@ Foam::PhiScheme::limiter dimless ) ); - surfaceScalarField& Limiter = tLimiter(); + surfaceScalarField& Limiter = tLimiter.ref(); const surfaceScalarField& CDweights = mesh.surfaceInterpolation::weights(); diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationScheme.C b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationScheme.C index 9b26d679a..138fad0ee 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationScheme.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationScheme.C @@ -147,7 +147,7 @@ Foam::limitedSurfaceInterpolationScheme::weights { // Note that here the weights field is initialised as the limiter // from which the weight is calculated using the limiter value - surfaceScalarField& Weights = tLimiter(); + surfaceScalarField& Weights = tLimiter.ref(); scalarField& pWeights = Weights.internalField(); diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/clippedLinear/clippedLinear.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/clippedLinear/clippedLinear.H index b704841a4..59ffd4bac 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/clippedLinear/clippedLinear.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/clippedLinear/clippedLinear.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -150,7 +150,8 @@ public: dimless ) ); - surfaceScalarField& clippedLinearWeights = tclippedLinearWeights(); + surfaceScalarField& clippedLinearWeights = + tclippedLinearWeights.ref(); clippedLinearWeights.internalField() = max(min(cdWeights.internalField(), 1 - wfLimit_), wfLimit_); diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/cubic/cubic.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/cubic/cubic.H index f8f139771..253157431 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/cubic/cubic.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/cubic/cubic.H @@ -142,9 +142,8 @@ public: surfaceInterpolationScheme::interpolate(vf, kSc, -kSc) ) ); - GeometricField& sfCorr = - tsfCorr(); + tsfCorr.ref(); for (direction cmpt=0; cmpt::nComponents; cmpt++) { diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearUpwind/linearUpwind.C b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearUpwind/linearUpwind.C index a2a81508f..aa7d4482b 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearUpwind/linearUpwind.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearUpwind/linearUpwind.C @@ -55,7 +55,7 @@ Foam::linearUpwind::correction ) ); - GeometricField& sfCorr = tsfCorr(); + GeometricField& sfCorr = tsfCorr.ref(); const surfaceScalarField& faceFlux = this->faceFlux_; diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearUpwind/linearUpwindV.C b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearUpwind/linearUpwindV.C index 85fc6a959..fce527802 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearUpwind/linearUpwindV.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearUpwind/linearUpwindV.C @@ -62,7 +62,7 @@ Foam::linearUpwindV::correction ) ); - GeometricField& sfCorr = tsfCorr(); + GeometricField& sfCorr = tsfCorr.ref(); const surfaceScalarField& faceFlux = this->faceFlux_; const surfaceScalarField& w = mesh.weights(); diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/localMax/localMax.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/localMax/localMax.H index d0cc9fba8..e081db91e 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/localMax/localMax.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/localMax/localMax.H @@ -136,7 +136,7 @@ public: vf.dimensions() ) ); - GeometricField& vff = tvff(); + GeometricField& vff = tvff.ref(); forAll(vff.boundaryField(), patchi) { diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/localMin/localMin.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/localMin/localMin.H index 598e45c79..7099656dd 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/localMin/localMin.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/localMin/localMin.H @@ -136,7 +136,7 @@ public: vf.dimensions() ) ); - GeometricField& vff = tvff(); + GeometricField& vff = tvff.ref(); forAll(vff.boundaryField(), patchi) { diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/midPoint/midPoint.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/midPoint/midPoint.H index 1841b832d..021abd768 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/midPoint/midPoint.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/midPoint/midPoint.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -117,7 +117,7 @@ public: ); surfaceScalarField::GeometricBoundaryField& awbf = - taw().boundaryField(); + taw.ref().boundaryField(); forAll(awbf, patchi) { diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/outletStabilised/outletStabilised.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/outletStabilised/outletStabilised.H index 49a70b700..819347a97 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/outletStabilised/outletStabilised.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/outletStabilised/outletStabilised.H @@ -133,7 +133,7 @@ public: ) const { tmp tw = tScheme_().weights(vf); - surfaceScalarField& w = tw(); + surfaceScalarField& w = tw.ref(); const fvMesh& mesh_ = this->mesh(); const cellList& cells = mesh_.cells(); @@ -193,7 +193,7 @@ public: tScheme_().correction(vf); GeometricField& corr = - tcorr(); + tcorr.ref(); const fvMesh& mesh_ = this->mesh(); const cellList& cells = mesh_.cells(); diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/pointLinear/pointLinear.C b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/pointLinear/pointLinear.C index 7b6d3048e..98a7cdbf4 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/pointLinear/pointLinear.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/pointLinear/pointLinear.C @@ -48,7 +48,7 @@ correction tmp> tsfCorr = linearInterpolate(vf); - Field& sfCorr = tsfCorr().internalField(); + Field& sfCorr = tsfCorr.ref().internalField(); const pointField& points = mesh.points(); const pointField& C = mesh.C().internalField(); @@ -104,7 +104,7 @@ correction typename GeometricField:: - GeometricBoundaryField& bSfCorr = tsfCorr().boundaryField(); + GeometricBoundaryField& bSfCorr = tsfCorr.ref().boundaryField(); forAll(bSfCorr, patchi) { diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/reverseLinear/reverseLinear.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/reverseLinear/reverseLinear.H index 3f3cae05f..e84e66f25 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/reverseLinear/reverseLinear.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/reverseLinear/reverseLinear.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -122,7 +122,8 @@ public: dimless ) ); - surfaceScalarField& reverseLinearWeights = treverseLinearWeights(); + surfaceScalarField& reverseLinearWeights = + treverseLinearWeights.ref(); reverseLinearWeights.internalField() = 1.0 - cdWeights.internalField(); diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/skewCorrected/skewCorrected.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/skewCorrected/skewCorrected.H index aab20dac7..1f568e631 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/skewCorrected/skewCorrected.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/skewCorrected/skewCorrected.H @@ -159,7 +159,7 @@ public: for (direction cmpt=0; cmpt::nComponents; cmpt++) { - tsfCorr().replace + tsfCorr.ref().replace ( cmpt, scv() & linear diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.C b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.C index 43bcbe9d1..d871edb6e 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.C @@ -178,7 +178,7 @@ Foam::surfaceInterpolationScheme::interpolate vf.dimensions() ) ); - GeometricField& sf = tsf(); + GeometricField& sf = tsf.ref(); Field& sfi = sf.internalField(); @@ -256,7 +256,7 @@ Foam::surfaceInterpolationScheme::interpolate vf.dimensions() ) ); - GeometricField& sf = tsf(); + GeometricField& sf = tsf.ref(); Field& sfi = sf.internalField(); @@ -273,7 +273,7 @@ Foam::surfaceInterpolationScheme::interpolate if (vf.boundaryField()[pi].coupled()) { - tsf().boundaryField()[pi] = + tsf.ref().boundaryField()[pi] = pLambda*vf.boundaryField()[pi].patchInternalField() + (1.0 - pLambda)*vf.boundaryField()[pi].patchNeighbourField(); } @@ -311,7 +311,7 @@ Foam::surfaceInterpolationScheme::interpolate if (corrected()) { - tsf() += correction(vf); + tsf.ref() += correction(vf); } return tsf; diff --git a/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolate.C b/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolate.C index 84f41bba6..79bdc2a29 100644 --- a/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolate.C +++ b/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolate.C @@ -167,7 +167,7 @@ Foam::tmp> Foam::volPointInterpolation::flatBoundaryField ( new Field(mesh.nFaces()-mesh.nInternalFaces()) ); - Field& boundaryVals = tboundaryVals(); + Field& boundaryVals = tboundaryVals.ref(); forAll(vf.boundaryField(), patchI) { @@ -395,7 +395,7 @@ Foam::volPointInterpolation::interpolate ) ); - interpolate(vf, tpf()); + interpolate(vf, tpf.ref()); return tpf; } diff --git a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C index ce776051c..6b2f0ae69 100644 --- a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C +++ b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C @@ -1292,7 +1292,7 @@ Foam::AMIInterpolation::interpolateToSource ( fld, multiplyWeightedOp(cop), - tresult(), + tresult.ref(), defaultValues ); @@ -1337,7 +1337,7 @@ Foam::AMIInterpolation::interpolateToTarget ( fld, multiplyWeightedOp(cop), - tresult(), + tresult.ref(), defaultValues ); diff --git a/src/meshTools/triSurface/triSurfaceTools/pointToPointPlanarInterpolationTemplates.C b/src/meshTools/triSurface/triSurfaceTools/pointToPointPlanarInterpolationTemplates.C index 4b9f3b2dc..03c34e0e4 100644 --- a/src/meshTools/triSurface/triSurfaceTools/pointToPointPlanarInterpolationTemplates.C +++ b/src/meshTools/triSurface/triSurfaceTools/pointToPointPlanarInterpolationTemplates.C @@ -42,7 +42,7 @@ Foam::tmp> Foam::pointToPointPlanarInterpolation::interpolate } tmp> tfld(new Field(nearestVertex_.size())); - Field& fld = tfld(); + Field& fld = tfld.ref(); forAll(fld, i) {