diff --git a/applications/solvers/lagrangian/DPMFoam/DPMTurbulenceModels/Make/options b/applications/solvers/lagrangian/DPMFoam/DPMTurbulenceModels/Make/options index 902afe59e4f2e3d14c15180e41b3820174b4a584..bd9cbcb6133ea6dd7c9b41509c231bdd930b8b8b 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 c789d365b7788f2f58616de5c34174d5a7f3f75e..6ea8dadf59245beddfa3ea2c1547f3f218b5eda2 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<BasePhaseSystem>::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 5bdb4cea14078d765f89ceaefb7db8452f217dfd..ec5ca1596d4fbdb85cbc6c97e91694472e5b3299 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 3c3db948ddad8755f7a8faceec780fbe92b2b843..46e46e4599516204a0e140aa63b4ec4c0fd0e904 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 0d4a1128c056051e28ebc6cbee84fbbc6a708b26..996f96cecfa8d1be6a5f8801b0ac7f069a827d4d 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<scalarField> 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<scalarField> 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 4a0d2290d13c91fa9b755a82119190e730241f56..b88ec0923abf187218bce9d510032cb9673c2961 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 9f436cd5a0ed15a8418021e1b3b8e4cc14c5fc7c..f3b7d5da14091749b9961211d1b2820386a45dae 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 c4ce9a7583ffe0bf3ae797f06acdacab9056a78a..a9eb50af353ae85083e328cf6d43b0217b5a64fc 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 84786bdc5dbe4ee4ceccd265fd150dfbb5ced98b..58f3051b4d7e61bbedb05494fd571178510984b1 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 4a0d2290d13c91fa9b755a82119190e730241f56..b88ec0923abf187218bce9d510032cb9673c2961 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 de35e7900becbb93abd6238fdc997e158397fe69..6a5a474b3462459b792d79f07a004b0790417767 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 47364ab10d53d144cd7e51c1368b7bbeb68cb05c..3c8b16027ff800fa475ebfa3d3524e1be5fb949e 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 6d34249a6133dd924d02d66e64c0c6808f7958f5..d2d9a39d7e5c32fa6f77696348c4e7b338830777 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 678d42875f386dd22bad00a71b014ed293d2870e..c5fffefcb83ecdeca634a40f24addb81aaed3100 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<productType, Type2, GeoMesh>::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<productType, Type1, GeoMesh>::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 \ <productType, Type1, Type1, Type2, GeoMesh>::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<productType, Type, GeoMesh>::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<productType, Type, GeoMesh>::clear(tdf1); \ \ diff --git a/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedFieldFunctionsM.C b/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedFieldFunctionsM.C index 4fe75afd3f799a4fcf905e32f132a76dfdf47233..743ea0de38fb097df72fb21110d38ef2d22faa0f 100644 --- a/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedFieldFunctionsM.C +++ b/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedFieldFunctionsM.C @@ -50,7 +50,7 @@ tmp<DimensionedField<ReturnType, GeoMesh>> Func \ ) \ ); \ \ - Func(tRes().field(), df1.field()); \ + Func(tRes.ref().field(), df1.field()); \ \ return tRes; \ } \ @@ -73,7 +73,7 @@ tmp<DimensionedField<ReturnType, GeoMesh>> Func \ ) \ ); \ \ - Func(tRes().field(), df1.field()); \ + Func(tRes.ref().field(), df1.field()); \ \ reuseTmpDimensionedField<ReturnType, Type1, GeoMesh>::clear(tdf1); \ \ @@ -106,7 +106,7 @@ tmp<DimensionedField<ReturnType, GeoMesh>> operator Op \ ) \ ); \ \ - Foam::OpFunc(tRes().field(), df1.field()); \ + Foam::OpFunc(tRes.ref().field(), df1.field()); \ \ return tRes; \ } \ @@ -129,7 +129,7 @@ tmp<DimensionedField<ReturnType, GeoMesh>> operator Op \ ) \ ); \ \ - Foam::OpFunc(tRes().field(), df1.field()); \ + Foam::OpFunc(tRes.ref().field(), df1.field()); \ \ reuseTmpDimensionedField<ReturnType, Type1, GeoMesh>::clear(tdf1); \ \ @@ -163,7 +163,7 @@ tmp<DimensionedField<ReturnType, GeoMesh>> Func \ ) \ ); \ \ - Func(tRes().field(), df1.field(), df2.field()); \ + Func(tRes.ref().field(), df1.field(), df2.field()); \ \ return tRes; \ } \ @@ -187,7 +187,7 @@ tmp<DimensionedField<ReturnType, GeoMesh>> Func \ ) \ ); \ \ - Func(tRes().field(), df1.field(), df2.field()); \ + Func(tRes.ref().field(), df1.field(), df2.field()); \ \ reuseTmpDimensionedField<ReturnType, Type2, GeoMesh>::clear(tdf2); \ \ @@ -213,7 +213,7 @@ tmp<DimensionedField<ReturnType, GeoMesh>> Func \ ) \ ); \ \ - Func(tRes().field(), df1.field(), df2.field()); \ + Func(tRes.ref().field(), df1.field(), df2.field()); \ \ reuseTmpDimensionedField<ReturnType, Type1, GeoMesh>::clear(tdf1); \ \ @@ -242,7 +242,7 @@ tmp<DimensionedField<ReturnType, GeoMesh>> Func \ ) \ ); \ \ - Func(tRes().field(), df1.field(), df2.field()); \ + Func(tRes.ref().field(), df1.field(), df2.field()); \ \ reuseTmpTmpDimensionedField<ReturnType, Type1, Type1, Type2, GeoMesh> \ ::clear(tdf1, tdf2); \ @@ -277,7 +277,7 @@ tmp<DimensionedField<ReturnType, GeoMesh>> Func \ ) \ ); \ \ - Func(tRes().field(), dt1.value(), df2.field()); \ + Func(tRes.ref().field(), dt1.value(), df2.field()); \ \ return tRes; \ } \ @@ -312,7 +312,7 @@ tmp<DimensionedField<ReturnType, GeoMesh>> Func \ ) \ ); \ \ - Func(tRes().field(), dt1.value(), df2.field()); \ + Func(tRes.ref().field(), dt1.value(), df2.field()); \ \ reuseTmpDimensionedField<ReturnType, Type2, GeoMesh>::clear(tdf2); \ \ @@ -354,7 +354,7 @@ tmp<DimensionedField<ReturnType, GeoMesh>> Func \ ) \ ); \ \ - Func(tRes().field(), df1.field(), dt2.value()); \ + Func(tRes.ref().field(), df1.field(), dt2.value()); \ \ return tRes; \ } \ @@ -389,7 +389,7 @@ tmp<DimensionedField<ReturnType, GeoMesh>> Func \ ) \ ); \ \ - Func(tRes().field(), df1.field(), dt2.value()); \ + Func(tRes.ref().field(), df1.field(), dt2.value()); \ \ reuseTmpDimensionedField<ReturnType, Type1, GeoMesh>::clear(tdf1); \ \ @@ -438,7 +438,7 @@ tmp<DimensionedField<ReturnType, GeoMesh>> 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<DimensionedField<ReturnType, GeoMesh>> operator Op \ ) \ ); \ \ - Foam::OpFunc(tRes().field(), df1.field(), df2.field()); \ + Foam::OpFunc(tRes.ref().field(), df1.field(), df2.field()); \ \ reuseTmpDimensionedField<ReturnType, Type2, GeoMesh>::clear(tdf2); \ \ @@ -488,7 +488,7 @@ tmp<DimensionedField<ReturnType, GeoMesh>> operator Op \ ) \ ); \ \ - Foam::OpFunc(tRes().field(), df1.field(), df2.field()); \ + Foam::OpFunc(tRes.ref().field(), df1.field(), df2.field()); \ \ reuseTmpDimensionedField<ReturnType, Type1, GeoMesh>::clear(tdf1); \ \ @@ -517,7 +517,7 @@ tmp<DimensionedField<ReturnType, GeoMesh>> operator Op \ ) \ ); \ \ - Foam::OpFunc(tRes().field(), df1.field(), df2.field()); \ + Foam::OpFunc(tRes.ref().field(), df1.field(), df2.field()); \ \ reuseTmpTmpDimensionedField<ReturnType, Type1, Type1, Type2, GeoMesh>:: \ clear(tdf1, tdf2); \ @@ -552,7 +552,7 @@ tmp<DimensionedField<ReturnType, GeoMesh>> 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<DimensionedField<ReturnType, GeoMesh>> operator Op \ ) \ ); \ \ - Foam::OpFunc(tRes().field(), dt1.value(), tdf2().field()); \ + Foam::OpFunc(tRes.ref().field(), dt1.value(), tdf2().field()); \ \ reuseTmpDimensionedField<ReturnType, Type2, GeoMesh>::clear(tdf2); \ \ @@ -629,7 +629,7 @@ tmp<DimensionedField<ReturnType, GeoMesh>> 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<DimensionedField<ReturnType, GeoMesh>> operator Op \ ) \ ); \ \ - Foam::OpFunc(tRes().field(), tdf1().field(), dt2.value()); \ + Foam::OpFunc(tRes.ref().field(), tdf1().field(), dt2.value()); \ \ reuseTmpDimensionedField<ReturnType, Type1, GeoMesh>::clear(tdf1); \ \ diff --git a/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedFieldReuseFunctions.H b/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedFieldReuseFunctions.H index 2df208e96e2ee43e84c5033b118d3cc9dcabaeb5..b56adf3805dd65bab40481ffba89c7520bedc592 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<DimensionedField<TypeR, GeoMesh>>& 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<DimensionedField<Type2, GeoMesh>>& tdf2 ) { - if (tdf1.isTmp()) - { - tdf1.ptr(); - } + tdf1.clear(); tdf2.clear(); } }; @@ -331,16 +322,8 @@ public: const tmp<DimensionedField<TypeR, GeoMesh>>& 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 238f230daa572cc70c4887e8c85746b41977ee13..f8e3c8047eec275dcfb7c363decf28f5bf45ff43 100644 --- a/src/OpenFOAM/fields/DimensionedFields/DimensionedScalarField/DimensionedScalarField.C +++ b/src/OpenFOAM/fields/DimensionedFields/DimensionedScalarField/DimensionedScalarField.C @@ -57,7 +57,7 @@ tmp<DimensionedField<scalar, GeoMesh>> stabilise ) ); - stabilise(tRes().field(), dsf.field(), ds.value()); + stabilise(tRes.ref().field(), dsf.field(), ds.value()); return tRes; } @@ -80,7 +80,7 @@ tmp<DimensionedField<scalar, GeoMesh>> stabilise dsf.dimensions() + ds.dimensions() ); - stabilise(tRes().field(), dsf.field(), ds.value()); + stabilise(tRes.ref().field(), dsf.field(), ds.value()); reuseTmpDimensionedField<scalar, scalar, GeoMesh>::clear(tdsf); @@ -126,7 +126,7 @@ tmp<DimensionedField<scalar, GeoMesh>> pow ) ); - pow(tPow().field(), dsf1.field(), dsf2.field()); + pow(tPow.ref().field(), dsf1.field(), dsf2.field()); return tPow; } @@ -153,7 +153,7 @@ tmp<DimensionedField<scalar, GeoMesh>> pow ) ); - pow(tPow().field(), dsf1.field(), dsf2.field()); + pow(tPow.ref().field(), dsf1.field(), dsf2.field()); reuseTmpDimensionedField<scalar, scalar, GeoMesh>::clear(tdsf1); @@ -182,7 +182,7 @@ tmp<DimensionedField<scalar, GeoMesh>> pow ) ); - pow(tPow().field(), dsf1.field(), dsf2.field()); + pow(tPow.ref().field(), dsf1.field(), dsf2.field()); reuseTmpDimensionedField<scalar, scalar, GeoMesh>::clear(tdsf2); @@ -213,7 +213,7 @@ tmp<DimensionedField<scalar, GeoMesh>> pow ) ); - pow(tPow().field(), dsf1.field(), dsf2.field()); + pow(tPow.ref().field(), dsf1.field(), dsf2.field()); reuseTmpTmpDimensionedField<scalar, scalar, scalar, scalar, GeoMesh>::clear ( @@ -247,7 +247,7 @@ tmp<DimensionedField<scalar, GeoMesh>> pow ) ); - pow(tPow().field(), dsf.field(), ds.value()); + pow(tPow.ref().field(), dsf.field(), ds.value()); return tPow; } @@ -269,7 +269,7 @@ tmp<DimensionedField<scalar, GeoMesh>> pow pow(dsf.dimensions(), ds) ); - pow(tPow().field(), dsf.field(), ds.value()); + pow(tPow.ref().field(), dsf.field(), ds.value()); reuseTmpDimensionedField<scalar, scalar, GeoMesh>::clear(tdsf); @@ -319,7 +319,7 @@ tmp<DimensionedField<scalar, GeoMesh>> pow ) ); - pow(tPow().field(), ds.value(), dsf.field()); + pow(tPow.ref().field(), ds.value(), dsf.field()); return tPow; } @@ -342,7 +342,7 @@ tmp<DimensionedField<scalar, GeoMesh>> pow pow(ds, dsf.dimensions()) ); - pow(tPow().field(), ds.value(), dsf.field()); + pow(tPow.ref().field(), ds.value(), dsf.field()); reuseTmpDimensionedField<scalar, scalar, GeoMesh>::clear(tdsf); @@ -394,7 +394,7 @@ tmp<DimensionedField<scalar, GeoMesh>> atan2 ) ); - atan2(tAtan2().field(), dsf1.field(), dsf2.field()); + atan2(tAtan2.ref().field(), dsf1.field(), dsf2.field()); return tAtan2; } @@ -417,7 +417,7 @@ tmp<DimensionedField<scalar, GeoMesh>> atan2 atan2(dsf1.dimensions(), dsf2.dimensions()) ); - atan2(tAtan2().field(), dsf1.field(), dsf2.field()); + atan2(tAtan2.ref().field(), dsf1.field(), dsf2.field()); reuseTmpDimensionedField<scalar, scalar, GeoMesh>::clear(tdsf1); @@ -442,7 +442,7 @@ tmp<DimensionedField<scalar, GeoMesh>> atan2 atan2(dsf1.dimensions(), dsf2.dimensions()) ); - atan2(tAtan2().field(), dsf1.field(), dsf2.field()); + atan2(tAtan2.ref().field(), dsf1.field(), dsf2.field()); reuseTmpDimensionedField<scalar, scalar, GeoMesh>::clear(tdsf2); @@ -469,7 +469,7 @@ tmp<DimensionedField<scalar, GeoMesh>> atan2 atan2(dsf1.dimensions(), dsf2.dimensions()) ); - atan2(tAtan2().field(), dsf1.field(), dsf2.field()); + atan2(tAtan2.ref().field(), dsf1.field(), dsf2.field()); reuseTmpTmpDimensionedField<scalar, scalar, scalar, scalar, GeoMesh>::clear ( @@ -503,7 +503,7 @@ tmp<DimensionedField<scalar, GeoMesh>> atan2 ) ); - atan2(tAtan2().field(), dsf.field(), ds.value()); + atan2(tAtan2.ref().field(), dsf.field(), ds.value()); return tAtan2; } @@ -525,7 +525,7 @@ tmp<DimensionedField<scalar, GeoMesh>> atan2 atan2(dsf.dimensions(), ds) ); - atan2(tAtan2().field(), dsf.field(), ds.value()); + atan2(tAtan2.ref().field(), dsf.field(), ds.value()); reuseTmpDimensionedField<scalar, scalar, GeoMesh>::clear(tdsf); @@ -575,7 +575,7 @@ tmp<DimensionedField<scalar, GeoMesh>> atan2 ) ); - atan2(tAtan2().field(), ds.value(), dsf.field()); + atan2(tAtan2.ref().field(), ds.value(), dsf.field()); return tAtan2; } @@ -598,7 +598,7 @@ tmp<DimensionedField<scalar, GeoMesh>> atan2 atan2(ds, dsf.dimensions()) ); - atan2(tAtan2().field(), ds.value(), dsf.field()); + atan2(tAtan2.ref().field(), ds.value(), dsf.field()); reuseTmpDimensionedField<scalar, scalar, GeoMesh>::clear(tdsf); @@ -698,7 +698,7 @@ tmp<DimensionedField<scalar, GeoMesh>> func \ ) \ ); \ \ - func(tFunc().field(), n, dsf.field()); \ + func(tFunc.ref().field(), n, dsf.field()); \ \ return tFunc; \ } \ @@ -729,7 +729,7 @@ tmp<DimensionedField<scalar, GeoMesh>> func \ ) \ ); \ \ - func(tFunc().field(), n, dsf.field()); \ + func(tFunc.ref().field(), n, dsf.field()); \ \ reuseTmpDimensionedField<scalar, scalar, GeoMesh>::clear(tdsf); \ \ diff --git a/src/OpenFOAM/fields/FieldFields/FieldField/FieldField.C b/src/OpenFOAM/fields/FieldFields/FieldField/FieldField.C index fba85680a4eca2859bfc9bee507044aa8809b1b3..c26bdd03ac215d38f0d4d948dcb9ea4c719d51b7 100644 --- a/src/OpenFOAM/fields/FieldFields/FieldField/FieldField.C +++ b/src/OpenFOAM/fields/FieldFields/FieldField/FieldField.C @@ -232,7 +232,7 @@ FieldField<Field, Type>::component NewCalculatedType(*this) ); - ::Foam::component(Component(), *this, d); + ::Foam::component(Component.ref(), *this, d); return Component; } @@ -274,7 +274,7 @@ tmp<FieldField<Field, Type>> FieldField<Field, Type>::T() const FieldField<Field, Type>::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 02219f4243a8476504e9ad3caa668e5388fe2128..1b705e2b8d79e9164feb2542b7d92c06e7e91290 100644 --- a/src/OpenFOAM/fields/FieldFields/FieldField/FieldFieldFunctions.C +++ b/src/OpenFOAM/fields/FieldFields/FieldField/FieldFieldFunctions.C @@ -86,7 +86,7 @@ pow ( FieldField<Field, powProductType>::NewCalculatedType(f) ); - pow<Type, r>(tRes(), f); + pow<Type, r>(tRes.ref(), f); return tRes; } @@ -102,7 +102,7 @@ pow ( reuseTmpFieldField<Field, powProductType, Type>::New(tf) ); - pow<Type, r>(tRes(), tf()); + pow<Type, r>(tRes.ref(), tf()); reuseTmpFieldField<Field, powProductType, Type>::clear(tf); return tRes; } @@ -130,7 +130,7 @@ sqr(const FieldField<Field, Type>& f) ( FieldField<Field, outerProductType>::NewCalculatedType(f) ); - sqr(tRes(), f); + sqr(tRes.ref(), f); return tRes; } @@ -143,7 +143,7 @@ sqr(const tmp<FieldField<Field, Type>>& tf) ( reuseTmpFieldField<Field, outerProductType, Type>::New(tf) ); - sqr(tRes(), tf()); + sqr(tRes.ref(), tf()); reuseTmpFieldField<Field, outerProductType, Type>::clear(tf); return tRes; } @@ -166,7 +166,7 @@ tmp<FieldField<Field, scalar>> magSqr(const FieldField<Field, Type>& f) FieldField<Field, scalar>::NewCalculatedType(f) ); - magSqr(tRes(), f); + magSqr(tRes.ref(), f); return tRes; } @@ -178,7 +178,7 @@ tmp<FieldField<Field, scalar>> magSqr(const tmp<FieldField<Field, Type>>& tf) reuseTmpFieldField<Field, scalar, Type>::New(tf) ); - magSqr(tRes(), tf()); + magSqr(tRes.ref(), tf()); reuseTmpFieldField<Field, scalar, Type>::clear(tf); return tRes; } @@ -201,7 +201,7 @@ tmp<FieldField<Field, scalar>> mag(const FieldField<Field, Type>& f) FieldField<Field, scalar>::NewCalculatedType(f) ); - mag(tRes(), f); + mag(tRes.ref(), f); return tRes; } @@ -213,7 +213,7 @@ tmp<FieldField<Field, scalar>> mag(const tmp<FieldField<Field, Type>>& tf) reuseTmpFieldField<Field, scalar, Type>::New(tf) ); - mag(tRes(), tf()); + mag(tRes.ref(), tf()); reuseTmpFieldField<Field, scalar, Type>::clear(tf); return tRes; } @@ -243,7 +243,7 @@ tmp<FieldField<Field, typename FieldField<Field, Type>::cmptType>> cmptMax ( FieldField<Field, cmptType>::NewCalculatedType(f) ); - cmptMax(tRes(), f); + cmptMax(tRes.ref(), f); return tRes; } @@ -258,7 +258,7 @@ tmp<FieldField<Field, typename FieldField<Field, Type>::cmptType>> cmptMax ( reuseTmpFieldField<Field, cmptType, Type>::New(tf) ); - cmptMax(tRes(), tf()); + cmptMax(tRes.ref(), tf()); reuseTmpFieldField<Field, cmptType, Type>::clear(tf); return tRes; } @@ -288,7 +288,7 @@ tmp<FieldField<Field, typename FieldField<Field, Type>::cmptType>> cmptMin ( FieldField<Field, cmptType>::NewCalculatedType(f) ); - cmptMin(tRes(), f); + cmptMin(tRes.ref(), f); return tRes; } @@ -303,7 +303,7 @@ tmp<FieldField<Field, typename FieldField<Field, Type>::cmptType>> cmptMin ( reuseTmpFieldField<Field, cmptType, Type>::New(tf) ); - cmptMin(tRes(), tf()); + cmptMin(tRes.ref(), tf()); reuseTmpFieldField<Field, cmptType, Type>::clear(tf); return tRes; } @@ -333,7 +333,7 @@ tmp<FieldField<Field, typename FieldField<Field, Type>::cmptType>> cmptAv ( FieldField<Field, cmptType>::NewCalculatedType(f) ); - cmptAv(tRes(), f); + cmptAv(tRes.ref(), f); return tRes; } @@ -348,7 +348,7 @@ tmp<FieldField<Field, typename FieldField<Field, Type>::cmptType>> cmptAv ( reuseTmpFieldField<Field, cmptType, Type>::New(tf) ); - cmptAv(tRes(), tf()); + cmptAv(tRes.ref(), tf()); reuseTmpFieldField<Field, cmptType, Type>::clear(tf); return tRes; } @@ -377,7 +377,7 @@ tmp<FieldField<Field, Type>> cmptMag ( FieldField<Field, Type>::NewCalculatedType(f) ); - cmptMag(tRes(), f); + cmptMag(tRes.ref(), f); return tRes; } @@ -391,7 +391,7 @@ tmp<FieldField<Field, Type>> cmptMag ( reuseTmpFieldField<Field, Type, Type>::New(tf) ); - cmptMag(tRes(), tf()); + cmptMag(tRes.ref(), tf()); reuseTmpFieldField<Field, Type, Type>::clear(tf); return tRes; } @@ -667,7 +667,7 @@ operator op \ ( \ FieldField<Field1, productType>::NewCalculatedType(f1) \ ); \ - opFunc(tRes(), f1, f2); \ + opFunc(tRes.ref(), f1, f2); \ return tRes; \ } \ \ @@ -684,7 +684,7 @@ operator op \ ( \ reuseTmpFieldField<Field, productType, Type2>::New(tf2) \ ); \ - opFunc(tRes(), f1, tf2()); \ + opFunc(tRes.ref(), f1, tf2()); \ reuseTmpFieldField<Field, productType, Type2>::clear(tf2); \ return tRes; \ } \ @@ -708,7 +708,7 @@ operator op \ ( \ FieldField<Field1, productType>::NewCalculatedType(f1) \ ); \ - opFunc(tRes(), f1, tf2()); \ + opFunc(tRes.ref(), f1, tf2()); \ tf2.clear(); \ return tRes; \ } \ @@ -732,7 +732,7 @@ operator op \ ( \ reuseTmpFieldField<Field1, productType, Type1>::New(tf1) \ ); \ - opFunc(tRes(), tf1(), f2); \ + opFunc(tRes.ref(), tf1(), f2); \ reuseTmpFieldField<Field1, productType, Type1>::clear(tf1); \ return tRes; \ } \ @@ -757,7 +757,7 @@ operator op \ reuseTmpTmpFieldField<Field1, productType, Type1, Type1, Type2>::New \ (tf1, tf2) \ ); \ - opFunc(tRes(), tf1(), tf2()); \ + opFunc(tRes.ref(), tf1(), tf2()); \ reuseTmpTmpFieldField<Field1, productType, Type1, Type1, Type2>::clear \ (tf1, tf2); \ return tRes; \ @@ -792,7 +792,7 @@ operator op \ ( \ FieldField<Field, productType>::NewCalculatedType(f1) \ ); \ - opFunc(tRes(), f1, static_cast<const Form&>(vs)); \ + opFunc(tRes.ref(), f1, static_cast<const Form&>(vs)); \ return tRes; \ } \ \ @@ -810,7 +810,7 @@ operator op \ ( \ reuseTmpFieldField<Field, productType, Type>::New(tf1) \ ); \ - opFunc(tRes(), tf1(), static_cast<const Form&>(vs)); \ + opFunc(tRes.ref(), tf1(), static_cast<const Form&>(vs)); \ reuseTmpFieldField<Field, productType, Type>::clear(tf1); \ return tRes; \ } \ @@ -844,7 +844,7 @@ operator op \ ( \ FieldField<Field, productType>::NewCalculatedType(f1) \ ); \ - opFunc(tRes(), static_cast<const Form&>(vs), f1); \ + opFunc(tRes.ref(), static_cast<const Form&>(vs), f1); \ return tRes; \ } \ \ @@ -862,7 +862,7 @@ operator op \ ( \ reuseTmpFieldField<Field, productType, Type>::New(tf1) \ ); \ - opFunc(tRes(), static_cast<const Form&>(vs), tf1()); \ + opFunc(tRes.ref(), static_cast<const Form&>(vs), tf1()); \ reuseTmpFieldField<Field, productType, Type>::clear(tf1); \ return tRes; \ } diff --git a/src/OpenFOAM/fields/FieldFields/FieldField/FieldFieldFunctionsM.C b/src/OpenFOAM/fields/FieldFields/FieldField/FieldFieldFunctionsM.C index 03df3f8b9ed526f78d1bc1c3bda6a5e781ff0574..1d4b59cbf31cbe6dd2ad35f877a04989f9d69606 100644 --- a/src/OpenFOAM/fields/FieldFields/FieldField/FieldFieldFunctionsM.C +++ b/src/OpenFOAM/fields/FieldFields/FieldField/FieldFieldFunctionsM.C @@ -53,7 +53,7 @@ tmp<FieldField<Field, ReturnType>> Func \ ( \ FieldField<Field, ReturnType>::NewCalculatedType(f) \ ); \ - Func(tRes(), f); \ + Func(tRes.ref(), f); \ return tRes; \ } \ \ @@ -67,7 +67,7 @@ tmp<FieldField<Field, ReturnType>> Func \ ( \ reuseTmpFieldField<Field, Type, Type>::New(tf) \ ); \ - Func(tRes(), tf()); \ + Func(tRes.ref(), tf()); \ reuseTmpFieldField<Field, Type, Type>::clear(tf); \ return tRes; \ } @@ -100,7 +100,7 @@ tmp<FieldField<Field, ReturnType>> operator Op \ ( \ FieldField<Field, Type>::NewCalculatedType(f) \ ); \ - OpFunc(tRes(), f); \ + OpFunc(tRes.ref(), f); \ return tRes; \ } \ \ @@ -114,7 +114,7 @@ tmp<FieldField<Field, ReturnType>> operator Op \ ( \ reuseTmpFieldField<Field, Type, Type>::New(tf) \ ); \ - OpFunc(tRes(), tf()); \ + OpFunc(tRes.ref(), tf()); \ reuseTmpFieldField<Field, Type, Type>::clear(tf); \ return tRes; \ } @@ -149,7 +149,7 @@ tmp<FieldField<Field, ReturnType>> Func \ ( \ FieldField<Field, Type1>::NewCalculatedType(f1) \ ); \ - Func(tRes(), f1, f2); \ + Func(tRes.ref(), f1, f2); \ return tRes; \ } \ \ @@ -164,7 +164,7 @@ tmp<FieldField<Field, ReturnType>> Func \ ( \ reuseTmpFieldField<Field, ReturnType, Type2>::New(tf2) \ ); \ - Func(tRes(), f1, tf2()); \ + Func(tRes.ref(), f1, tf2()); \ reuseTmpFieldField<Field, ReturnType, Type2>::clear(tf2); \ return tRes; \ } \ @@ -180,7 +180,7 @@ tmp<FieldField<Field, ReturnType>> Func \ ( \ reuseTmpFieldField<Field, ReturnType, Type1>::New(tf1) \ ); \ - Func(tRes(), tf1(), f2); \ + Func(tRes.ref(), tf1(), f2); \ reuseTmpFieldField<Field, ReturnType, Type1>::clear(tf1); \ return tRes; \ } \ @@ -197,7 +197,7 @@ tmp<FieldField<Field, ReturnType>> Func \ reuseTmpTmpFieldField<Field, ReturnType, Type1, Type1, Type2>:: \ New(tf1, tf2) \ ); \ - Func(tRes(), tf1(), tf2()); \ + Func(tRes.ref(), tf1(), tf2()); \ reuseTmpTmpFieldField<Field, ReturnType, Type1, Type1, Type2>:: \ clear(tf1, tf2); \ return tRes; \ @@ -233,7 +233,7 @@ tmp<FieldField<Field, ReturnType>> Func \ ( \ FieldField<Field, Type1>::NewCalculatedType(f1) \ ); \ - Func(tRes(), f1, s); \ + Func(tRes.ref(), f1, s); \ return tRes; \ } \ \ @@ -248,7 +248,7 @@ tmp<FieldField<Field, ReturnType>> Func \ ( \ reuseTmpFieldField<Field, ReturnType, Type1>::New(tf1) \ ); \ - Func(tRes(), tf1(), s); \ + Func(tRes.ref(), tf1(), s); \ reuseTmpFieldField<Field, ReturnType, Type1>::clear(tf1); \ return tRes; \ } @@ -281,7 +281,7 @@ tmp<FieldField<Field, ReturnType>> Func \ ( \ FieldField<Field, Type2>::NewCalculatedType(f2) \ ); \ - Func(tRes(), s, f2); \ + Func(tRes.ref(), s, f2); \ return tRes; \ } \ \ @@ -296,7 +296,7 @@ tmp<FieldField<Field, ReturnType>> Func \ ( \ reuseTmpFieldField<Field, ReturnType, Type2>::New(tf2) \ ); \ - Func(tRes(), s, tf2()); \ + Func(tRes.ref(), s, tf2()); \ reuseTmpFieldField<Field, ReturnType, Type2>::clear(tf2); \ return tRes; \ } @@ -336,7 +336,7 @@ tmp<FieldField<Field, ReturnType>> operator Op \ ( \ FieldField<Field, ReturnType>::NewCalculatedType(f1) \ ); \ - OpFunc(tRes(), f1, f2); \ + OpFunc(tRes.ref(), f1, f2); \ return tRes; \ } \ \ @@ -351,7 +351,7 @@ tmp<FieldField<Field, ReturnType>> operator Op \ ( \ reuseTmpFieldField<Field, ReturnType, Type2>::New(tf2) \ ); \ - OpFunc(tRes(), f1, tf2()); \ + OpFunc(tRes.ref(), f1, tf2()); \ reuseTmpFieldField<Field, ReturnType, Type2>::clear(tf2); \ return tRes; \ } \ @@ -367,7 +367,7 @@ tmp<FieldField<Field, ReturnType>> operator Op \ ( \ reuseTmpFieldField<Field, ReturnType, Type1>::New(tf1) \ ); \ - OpFunc(tRes(), tf1(), f2); \ + OpFunc(tRes.ref(), tf1(), f2); \ reuseTmpFieldField<Field, ReturnType, Type1>::clear(tf1); \ return tRes; \ } \ @@ -384,7 +384,7 @@ tmp<FieldField<Field, ReturnType>> operator Op \ reuseTmpTmpFieldField<Field, ReturnType, Type1, Type1, Type2>:: \ New(tf1, tf2) \ ); \ - OpFunc(tRes(), tf1(), tf2()); \ + OpFunc(tRes.ref(), tf1(), tf2()); \ reuseTmpTmpFieldField<Field, ReturnType, Type1, Type1, Type2>:: \ clear(tf1, tf2); \ return tRes; \ @@ -420,7 +420,7 @@ tmp<FieldField<Field, ReturnType>> operator Op \ ( \ FieldField<Field, Type2>::NewCalculatedType(f2) \ ); \ - OpFunc(tRes(), s, f2); \ + OpFunc(tRes.ref(), s, f2); \ return tRes; \ } \ \ @@ -435,7 +435,7 @@ tmp<FieldField<Field, ReturnType>> operator Op \ ( \ reuseTmpFieldField<Field, ReturnType, Type2>::New(tf2) \ ); \ - OpFunc(tRes(), s, tf2()); \ + OpFunc(tRes.ref(), s, tf2()); \ reuseTmpFieldField<Field, ReturnType, Type2>::clear(tf2); \ return tRes; \ } @@ -468,7 +468,7 @@ tmp<FieldField<Field, ReturnType>> operator Op \ ( \ FieldField<Field, Type1>::NewCalculatedType(f1) \ ); \ - OpFunc(tRes(), f1, s); \ + OpFunc(tRes.ref(), f1, s); \ return tRes; \ } \ \ @@ -483,7 +483,7 @@ tmp<FieldField<Field, ReturnType>> operator Op \ ( \ reuseTmpFieldField<Field, ReturnType, Type1>::New(tf1) \ ); \ - OpFunc(tRes(), tf1(), s); \ + OpFunc(tRes.ref(), tf1(), s); \ reuseTmpFieldField<Field, ReturnType, Type1>::clear(tf1); \ return tRes; \ } diff --git a/src/OpenFOAM/fields/FieldFields/FieldField/FieldFieldReuseFunctions.H b/src/OpenFOAM/fields/FieldFields/FieldField/FieldFieldReuseFunctions.H index 3e7b3fe665884ef3a0a42fff19e4a486ed29405b..672006b45262293ed311a9f1bdd8e26ec5eb27de 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<FieldField<Field, TypeR>>& 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<FieldField<Field, Type2>>& tf2 ) { - if (tf1.isTmp()) - { - tf1.ptr(); - } + tf1.clear(); tf2.clear(); } }; @@ -245,16 +236,8 @@ public: const tmp<FieldField<Field, TypeR>>& 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 9f8f3da08189b4735666475c417918c33d7cdd07..596f74f1c30c33138275bde95debf41064b577de 100644 --- a/src/OpenFOAM/fields/Fields/Field/Field.C +++ b/src/OpenFOAM/fields/Fields/Field/Field.C @@ -690,10 +690,7 @@ void Foam::Field<Type>::operator=(const tmp<Field>& rhs) << abort(FatalError); } - // This is dodgy stuff, don't try it at home. - Field* fieldPtr = rhs.ptr(); - List<Type>::transfer(*fieldPtr); - delete fieldPtr; + List<Type>::operator=(rhs()); } diff --git a/src/OpenFOAM/fields/Fields/Field/FieldReuseFunctions.H b/src/OpenFOAM/fields/Fields/Field/FieldReuseFunctions.H index 8bceb6885a6a439687cff212eb4f562f9ba91df2..4eedccdc4313ab2ccc6e6a685fa37e677196f9a9 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<Field<TypeR>>& 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<Field<Type2>>& tf2 ) { - if (tf1.isTmp()) - { - tf1.ptr(); - } + tf1.clear(); tf2.clear(); } }; @@ -217,16 +208,8 @@ public: const tmp<Field<TypeR>>& 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 14098437e20147ea25fabf60987525e7e2e82342..959a1182b15e12926820933b4fe6ab66b0ffad46 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C @@ -992,8 +992,8 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::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<Type, PatchField, GeoMesh>::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 a315c3e3c805f9872dfd4e0099d92ae5efe0f094..59b356e6f2aac5ceeabef72c5876f0a7f90dcecc 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricFieldFunctions.C +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricFieldFunctions.C @@ -104,7 +104,7 @@ pow ) ); - pow<Type, r, PatchField, GeoMesh>(tPow(), gf); + pow<Type, r, PatchField, GeoMesh>(tPow.ref(), gf); return tPow; } @@ -139,7 +139,7 @@ pow ) ); - pow<Type, r, PatchField, GeoMesh>(tPow(), gf); + pow<Type, r, PatchField, GeoMesh>(tPow.ref(), gf); tgf.clear(); @@ -190,7 +190,7 @@ sqr(const GeometricField<Type, PatchField, GeoMesh>& gf) ) ); - sqr(tSqr(), gf); + sqr(tSqr.ref(), gf); return tSqr; } @@ -228,7 +228,7 @@ sqr(const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf) ) ); - sqr(tSqr(), gf); + sqr(tSqr.ref(), gf); tgf.clear(); @@ -270,7 +270,7 @@ tmp<GeometricField<scalar, PatchField, GeoMesh>> magSqr ) ); - magSqr(tMagSqr(), gf); + magSqr(tMagSqr.ref(), gf); return tMagSqr; } @@ -300,7 +300,7 @@ tmp<GeometricField<scalar, PatchField, GeoMesh>> magSqr ) ); - magSqr(tMagSqr(), gf); + magSqr(tMagSqr.ref(), gf); tgf.clear(); @@ -342,7 +342,7 @@ tmp<GeometricField<scalar, PatchField, GeoMesh>> mag ) ); - mag(tMag(), gf); + mag(tMag.ref(), gf); return tMag; } @@ -372,7 +372,7 @@ tmp<GeometricField<scalar, PatchField, GeoMesh>> mag ) ); - mag(tMag(), gf); + mag(tMag.ref(), gf); tgf.clear(); @@ -428,7 +428,7 @@ cmptAv(const GeometricField<Type, PatchField, GeoMesh>& gf) ) ); - cmptAv(CmptAv(), gf); + cmptAv(CmptAv.ref(), gf); return CmptAv; } @@ -467,7 +467,7 @@ cmptAv(const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf) ) ); - cmptAv(CmptAv(), gf); + cmptAv(CmptAv.ref(), gf); tgf.clear(); @@ -589,7 +589,7 @@ template \ <class Type1, class Type2, template<class> class PatchField, class GeoMesh> \ tmp \ < \ - GeometricField<typename product<Type1, Type2>::type, PatchField, GeoMesh> \ + GeometricField<typename product<Type1, Type2>::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<productType, Type2, PatchField, GeoMesh> \ ::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<productType, Type1, PatchField, GeoMesh> \ ::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 \ <productType, Type1, Type1, Type2, PatchField, GeoMesh> \ @@ -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<productType, Type, PatchField, GeoMesh> \ ::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<productType, Type, PatchField, GeoMesh> \ ::clear(tgf1); \ diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricFieldFunctionsM.C b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricFieldFunctionsM.C index 01d84a1a623a47d754c68ff3443edb524de5c980..344e79e8e699d8f80451b2f3b8dd8462ecedf936 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricFieldFunctionsM.C +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricFieldFunctionsM.C @@ -68,7 +68,7 @@ tmp<GeometricField<ReturnType, PatchField, GeoMesh>> Func \ ) \ ); \ \ - Foam::Func(tRes(), gf1); \ + Foam::Func(tRes.ref(), gf1); \ \ return tRes; \ } \ @@ -91,7 +91,7 @@ tmp<GeometricField<ReturnType, PatchField, GeoMesh>> Func \ ) \ ); \ \ - Foam::Func(tRes(), gf1); \ + Foam::Func(tRes.ref(), gf1); \ \ reuseTmpGeometricField \ <ReturnType, Type1, PatchField, GeoMesh>::clear(tgf1); \ @@ -138,7 +138,7 @@ tmp<GeometricField<ReturnType, PatchField, GeoMesh>> operator Op \ ) \ ); \ \ - Foam::OpFunc(tRes(), gf1); \ + Foam::OpFunc(tRes.ref(), gf1); \ \ return tRes; \ } \ @@ -161,7 +161,7 @@ tmp<GeometricField<ReturnType, PatchField, GeoMesh>> operator Op \ ) \ ); \ \ - Foam::OpFunc(tRes(), gf1); \ + Foam::OpFunc(tRes.ref(), gf1); \ \ reuseTmpGeometricField \ <ReturnType, Type1, PatchField, GeoMesh>::clear(tgf1); \ @@ -210,7 +210,7 @@ tmp<GeometricField<ReturnType, PatchField, GeoMesh>> Func \ ) \ ); \ \ - Foam::Func(tRes(), gf1, gf2); \ + Foam::Func(tRes.ref(), gf1, gf2); \ \ return tRes; \ } \ @@ -234,7 +234,7 @@ tmp<GeometricField<ReturnType, PatchField, GeoMesh>> Func \ ) \ ); \ \ - Foam::Func(tRes(), gf1, gf2); \ + Foam::Func(tRes.ref(), gf1, gf2); \ \ reuseTmpGeometricField \ <ReturnType, Type2, PatchField, GeoMesh>::clear(tgf2); \ @@ -261,7 +261,7 @@ tmp<GeometricField<ReturnType, PatchField, GeoMesh>> Func \ ) \ ); \ \ - Foam::Func(tRes(), gf1, gf2); \ + Foam::Func(tRes.ref(), gf1, gf2); \ \ reuseTmpGeometricField \ <ReturnType, Type1, PatchField, GeoMesh>::clear(tgf1); \ @@ -292,7 +292,7 @@ tmp<GeometricField<ReturnType, PatchField, GeoMesh>> Func \ ) \ ); \ \ - Foam::Func(tRes(), gf1, gf2); \ + Foam::Func(tRes.ref(), gf1, gf2); \ \ reuseTmpTmpGeometricField \ <ReturnType, Type1, Type1, Type2, PatchField, GeoMesh> \ @@ -341,7 +341,7 @@ tmp<GeometricField<ReturnType, PatchField, GeoMesh>> Func \ ) \ ); \ \ - Foam::Func(tRes(), dt1, gf2); \ + Foam::Func(tRes.ref(), dt1, gf2); \ \ return tRes; \ } \ @@ -376,7 +376,7 @@ tmp<GeometricField<ReturnType, PatchField, GeoMesh>> Func \ ) \ ); \ \ - Foam::Func(tRes(), dt1, gf2); \ + Foam::Func(tRes.ref(), dt1, gf2); \ \ reuseTmpGeometricField \ <ReturnType, Type2, PatchField, GeoMesh>::clear(tgf2); \ @@ -433,7 +433,7 @@ tmp<GeometricField<ReturnType, PatchField, GeoMesh>> Func \ ) \ ); \ \ - Foam::Func(tRes(), gf1, dt2); \ + Foam::Func(tRes.ref(), gf1, dt2); \ \ return tRes; \ } \ @@ -468,7 +468,7 @@ tmp<GeometricField<ReturnType, PatchField, GeoMesh>> Func \ ) \ ); \ \ - Foam::Func(tRes(), gf1, dt2); \ + Foam::Func(tRes.ref(), gf1, dt2); \ \ reuseTmpGeometricField \ <ReturnType, Type1, PatchField, GeoMesh>::clear(tgf1); \ @@ -534,7 +534,7 @@ tmp<GeometricField<ReturnType, PatchField, GeoMesh>> operator Op \ ) \ ); \ \ - Foam::OpFunc(tRes(), gf1, gf2); \ + Foam::OpFunc(tRes.ref(), gf1, gf2); \ \ return tRes; \ } \ @@ -558,7 +558,7 @@ tmp<GeometricField<ReturnType, PatchField, GeoMesh>> operator Op \ ) \ ); \ \ - Foam::OpFunc(tRes(), gf1, gf2); \ + Foam::OpFunc(tRes.ref(), gf1, gf2); \ \ reuseTmpGeometricField \ <ReturnType, Type2, PatchField, GeoMesh>::clear(tgf2); \ @@ -585,7 +585,7 @@ tmp<GeometricField<ReturnType, PatchField, GeoMesh>> operator Op \ ) \ ); \ \ - Foam::OpFunc(tRes(), gf1, gf2); \ + Foam::OpFunc(tRes.ref(), gf1, gf2); \ \ reuseTmpGeometricField \ <ReturnType, Type1, PatchField, GeoMesh>::clear(tgf1); \ @@ -615,7 +615,7 @@ tmp<GeometricField<ReturnType, PatchField, GeoMesh>> operator Op \ ) \ ); \ \ - Foam::OpFunc(tRes(), gf1, gf2); \ + Foam::OpFunc(tRes.ref(), gf1, gf2); \ \ reuseTmpTmpGeometricField \ <ReturnType, Type1, Type1, Type2, PatchField, GeoMesh> \ @@ -627,7 +627,7 @@ tmp<GeometricField<ReturnType, PatchField, GeoMesh>> 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<GeometricField<ReturnType, PatchField, GeoMesh>> operator Op \ ) \ ); \ \ - Foam::OpFunc(tRes(), dt1, gf2); \ + Foam::OpFunc(tRes.ref(), dt1, gf2); \ \ return tRes; \ } \ @@ -700,7 +700,7 @@ tmp<GeometricField<ReturnType, PatchField, GeoMesh>> operator Op \ ) \ ); \ \ - Foam::OpFunc(tRes(), dt1, gf2); \ + Foam::OpFunc(tRes.ref(), dt1, gf2); \ \ reuseTmpGeometricField<ReturnType, Type2, PatchField, GeoMesh> \ ::clear(tgf2); \ @@ -719,7 +719,7 @@ tmp<GeometricField<ReturnType, PatchField, GeoMesh>> 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<GeometricField<ReturnType, PatchField, GeoMesh>> operator Op \ ) \ ); \ \ - Foam::OpFunc(tRes(), gf1, dt2); \ + Foam::OpFunc(tRes.ref(), gf1, dt2); \ \ return tRes; \ } \ @@ -792,7 +792,7 @@ tmp<GeometricField<ReturnType, PatchField, GeoMesh>> operator Op \ ) \ ); \ \ - Foam::OpFunc(tRes(), gf1, dt2); \ + Foam::OpFunc(tRes.ref(), gf1, dt2); \ \ reuseTmpGeometricField<ReturnType, Type1, PatchField, GeoMesh> \ ::clear(tgf1); \ diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricFieldReuseFunctions.H b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricFieldReuseFunctions.H index 563dc9b1935002ee3b2e1381e288d7ff213a362c..5429c4f44ff1160bfbff5006f3d6544c8d18f204 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<GeometricField<TypeR, PatchField, GeoMesh>>& 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<GeometricField<Type2, PatchField, GeoMesh>>& tgf2 ) { - if (reusable(tgf1)) - { - tgf1.ptr(); - } + tgf1.clear(); tgf2.clear(); } }; @@ -415,16 +406,8 @@ public: const tmp<GeometricField<TypeR, PatchField, GeoMesh>>& 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 a5a0d9b5cfbf951b935de5292888225febaa2a7c..add1ed8dfb1759a45dffac8bdf0f9c1200738dd9 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricScalarField/GeometricScalarField.C +++ b/src/OpenFOAM/fields/GeometricFields/GeometricScalarField/GeometricScalarField.C @@ -72,7 +72,7 @@ tmp<GeometricField<scalar, PatchField, GeoMesh>> stabilise ) ); - stabilise(tRes(), gsf, ds); + stabilise(tRes.ref(), gsf, ds); return tRes; } @@ -97,7 +97,7 @@ tmp<GeometricField<scalar, PatchField, GeoMesh>> stabilise ) ); - stabilise(tRes(), gsf, ds); + stabilise(tRes.ref(), gsf, ds); reuseTmpGeometricField<scalar, scalar, PatchField, GeoMesh>::clear(tgsf); @@ -159,7 +159,7 @@ tmp<GeometricField<scalar, PatchField, GeoMesh>> pow ) ); - pow(tPow(), gsf1, gsf2); + pow(tPow.ref(), gsf1, gsf2); return tPow; } @@ -188,7 +188,7 @@ tmp<GeometricField<scalar, PatchField, GeoMesh>> pow ) ); - pow(tPow(), gsf1, gsf2); + pow(tPow.ref(), gsf1, gsf2); reuseTmpGeometricField<scalar, scalar, PatchField, GeoMesh>::clear(tgsf1); @@ -219,7 +219,7 @@ tmp<GeometricField<scalar, PatchField, GeoMesh>> pow ) ); - pow(tPow(), gsf1, gsf2); + pow(tPow.ref(), gsf1, gsf2); reuseTmpGeometricField<scalar, scalar, PatchField, GeoMesh>::clear(tgsf2); @@ -252,7 +252,7 @@ tmp<GeometricField<scalar, PatchField, GeoMesh>> pow ) ); - pow(tPow(), gsf1, gsf2); + pow(tPow.ref(), gsf1, gsf2); reuseTmpTmpGeometricField <scalar, scalar, scalar, scalar, PatchField, GeoMesh> @@ -299,7 +299,7 @@ tmp<GeometricField<scalar, PatchField, GeoMesh>> pow ) ); - pow(tPow(), gsf, ds); + pow(tPow.ref(), gsf, ds); return tPow; } @@ -323,7 +323,7 @@ tmp<GeometricField<scalar, PatchField, GeoMesh>> pow ) ); - pow(tPow(), gsf, ds); + pow(tPow.ref(), gsf, ds); reuseTmpGeometricField<scalar, scalar, PatchField, GeoMesh>::clear(tgsf); @@ -388,7 +388,7 @@ tmp<GeometricField<scalar, PatchField, GeoMesh>> pow ) ); - pow(tPow(), ds, gsf); + pow(tPow.ref(), ds, gsf); return tPow; } @@ -413,7 +413,7 @@ tmp<GeometricField<scalar, PatchField, GeoMesh>> pow ) ); - pow(tPow(), ds, gsf); + pow(tPow.ref(), ds, gsf); reuseTmpGeometricField<scalar, scalar, PatchField, GeoMesh>::clear(tgsf); @@ -480,7 +480,7 @@ tmp<GeometricField<scalar, PatchField, GeoMesh>> atan2 ) ); - atan2(tAtan2(), gsf1, gsf2); + atan2(tAtan2.ref(), gsf1, gsf2); return tAtan2; } @@ -505,7 +505,7 @@ tmp<GeometricField<scalar, PatchField, GeoMesh>> atan2 ) ); - atan2(tAtan2(), gsf1, gsf2); + atan2(tAtan2.ref(), gsf1, gsf2); reuseTmpGeometricField<scalar, scalar, PatchField, GeoMesh>::clear(tgsf1); @@ -532,7 +532,7 @@ tmp<GeometricField<scalar, PatchField, GeoMesh>> atan2 ) ); - atan2(tAtan2(), gsf1, gsf2); + atan2(tAtan2.ref(), gsf1, gsf2); reuseTmpGeometricField<scalar, scalar, PatchField, GeoMesh>::clear(tgsf2); @@ -561,7 +561,7 @@ tmp<GeometricField<scalar, PatchField, GeoMesh>> atan2 ) ); - atan2(tAtan2(), gsf1, gsf2); + atan2(tAtan2.ref(), gsf1, gsf2); reuseTmpTmpGeometricField <scalar, scalar, scalar, scalar, PatchField, GeoMesh> @@ -608,7 +608,7 @@ tmp<GeometricField<scalar, PatchField, GeoMesh>> atan2 ) ); - atan2(tAtan2(), gsf, ds); + atan2(tAtan2.ref(), gsf, ds); return tAtan2; } @@ -632,7 +632,7 @@ tmp<GeometricField<scalar, PatchField, GeoMesh>> atan2 ) ); - atan2(tAtan2(), gsf, ds); + atan2(tAtan2.ref(), gsf, ds); reuseTmpGeometricField<scalar, scalar, PatchField, GeoMesh>::clear(tgsf); @@ -697,7 +697,7 @@ tmp<GeometricField<scalar, PatchField, GeoMesh>> atan2 ) ); - atan2(tAtan2(), ds, gsf); + atan2(tAtan2.ref(), ds, gsf); return tAtan2; } @@ -722,7 +722,7 @@ tmp<GeometricField<scalar, PatchField, GeoMesh>> atan2 ) ); - atan2(tAtan2(), ds, gsf); + atan2(tAtan2.ref(), ds, gsf); reuseTmpGeometricField<scalar, scalar, PatchField, GeoMesh>::clear(tgsf); @@ -836,7 +836,7 @@ tmp<GeometricField<scalar, PatchField, GeoMesh>> func \ ) \ ); \ \ - func(tFunc(), n, gsf); \ + func(tFunc.ref(), n, gsf); \ \ return tFunc; \ } \ @@ -867,7 +867,7 @@ tmp<GeometricField<scalar, PatchField, GeoMesh>> func \ ) \ ); \ \ - func(tFunc(), n, gsf); \ + func(tFunc.ref(), n, gsf); \ \ reuseTmpGeometricField<scalar, scalar, PatchField, GeoMesh> \ ::clear(tgsf); \ diff --git a/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.C b/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.C index 5d7766e4f7aa26f7878ad0a409d11974e0c3244f..e347e2bf4b4237e9070b619bcec7d5c0f9c46e75 100644 --- a/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.C +++ b/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.C @@ -49,8 +49,7 @@ slicedBoundaryField ( new FieldField<PatchField, Type>(mesh.boundary().size()) ); - - FieldField<PatchField, Type>& bf = tbf(); + FieldField<PatchField, Type>& bf = tbf.ref(); forAll(mesh.boundary(), patchi) { @@ -126,8 +125,7 @@ slicedBoundaryField ( new FieldField<PatchField, Type>(mesh.boundary().size()) ); - - FieldField<PatchField, Type>& bf = tbf(); + FieldField<PatchField, Type>& 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 f674bba7a9f62ecefed3e2a967401ec4af04b895..739251c35879478fb47ac4112357846dbafa6939 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixTemplates.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixTemplates.C @@ -40,7 +40,7 @@ Foam::tmp<Foam::Field<Type>> Foam::lduMatrix::H(const Field<Type>& psi) const if (lowerPtr_ || upperPtr_) { - Field<Type> & Hpsi = tHpsi(); + Field<Type> & Hpsi = tHpsi.ref(); Type* __restrict__ HpsiPtr = Hpsi.begin(); @@ -87,7 +87,7 @@ Foam::lduMatrix::faceH(const Field<Type>& psi) const const labelUList& u = lduAddr().upperAddr(); tmp<Field<Type>> tfaceHpsi(new Field<Type> (Lower.size())); - Field<Type> & faceHpsi = tfaceHpsi(); + Field<Type> & faceHpsi = tfaceHpsi.ref(); for (label face=0; face<l.size(); face++) { diff --git a/src/OpenFOAM/memory/refCount/refCount.H b/src/OpenFOAM/memory/refCount/refCount.H index 132e8b0b8328507cd3ae5b406d39b923dc4beae4..67f8b4c9ff217ee5cfcca1dcfeb6427553f9ae30 100644 --- a/src/OpenFOAM/memory/refCount/refCount.H +++ b/src/OpenFOAM/memory/refCount/refCount.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 @@ -79,9 +79,9 @@ public: //- Return true if the reference count is zero - bool okToDelete() const + bool unique() const { - return !count_; + return count_ == 0; } diff --git a/src/OpenFOAM/memory/tmp/tmp.H b/src/OpenFOAM/memory/tmp/tmp.H index a842500af4f101d69baa94cb914ccb00b703c577..b431e73b810df985388df675a24ee76d1a435fb2 100644 --- a/src/OpenFOAM/memory/tmp/tmp.H +++ b/src/OpenFOAM/memory/tmp/tmp.H @@ -56,7 +56,6 @@ class tmp enum type { TMP, - REF, CONST_REF }; @@ -74,15 +73,9 @@ public: //- Store object pointer inline explicit tmp(T* = 0); - //- Store object rvalue reference - inline tmp(T&&); - //- Store object const reference inline tmp(const T&); - //- Construct copy and increment reference count - inline tmp(tmp<T>&&); - //- Construct copy and increment reference count inline tmp(const tmp<T>&); @@ -90,7 +83,7 @@ public: inline tmp(const tmp<T>&, 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 bb6fdbe902cbf9b460acfdf0aec83b54f27df16c..4d0ad75614d921bcb8c24f3fb8c8b98244bc93bd 100644 --- a/src/OpenFOAM/memory/tmp/tmpI.H +++ b/src/OpenFOAM/memory/tmp/tmpI.H @@ -36,14 +36,6 @@ inline Foam::tmp<T>::tmp(T* tPtr) {} -template<class T> -inline Foam::tmp<T>::tmp(T&& tRef) -: - type_(REF), - ptr_(&tRef) -{} - - template<class T> inline Foam::tmp<T>::tmp(const T& tRef) : @@ -52,29 +44,6 @@ inline Foam::tmp<T>::tmp(const T& tRef) {} -template<class T> -inline Foam::tmp<T>::tmp(tmp<T>&& 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<class T> inline Foam::tmp<T>::tmp(const tmp<T>& t) : @@ -95,10 +64,6 @@ inline Foam::tmp<T>::tmp(const tmp<T>& t) << abort(FatalError); } } - else if (type_ == REF) - { - type_ = CONST_REF; - } } @@ -137,7 +102,7 @@ inline Foam::tmp<T>::~tmp() { if (isTmp() && ptr_) { - if (ptr_->okToDelete()) + if (ptr_->unique()) { delete ptr_; ptr_ = 0; @@ -187,13 +152,10 @@ inline T& Foam::tmp<T>::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<T>::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<T>::ptr() const template<class T> inline void Foam::tmp<T>::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<T>::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<T>::operator=(T* tPtr) { if (isTmp() && ptr_) { - if (ptr_->okToDelete()) + if (ptr_->unique()) { delete ptr_; ptr_ = 0; @@ -377,7 +349,7 @@ inline void Foam::tmp<T>::operator=(const tmp<T>& t) { if (isTmp() && ptr_) { - if (ptr_->okToDelete()) + if (ptr_->unique()) { delete ptr_; ptr_ = 0; @@ -401,8 +373,8 @@ inline void Foam::tmp<T>::operator=(const tmp<T>& t) } ptr_ = t.ptr_; - const_cast<tmp<T>&>(t).ptr_ = 0; - ptr_->resetRefCount(); + + ptr_->operator++(); } else { diff --git a/src/TurbulenceModels/compressible/Make/options b/src/TurbulenceModels/compressible/Make/options index 4a6578d628571d492b84de2023e9bc1995fae803..a6401963fd1764080a335633f0d5e3bdb93f298c 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 7612f746e7a3d726bb898fa700e99600171e0aad..e2cdfdfc0d402fbadc2ca943c3ad029211abd38a 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<scalarField> thermalBaffle1DFvPatchScalarField<solidType>::Qs() const ); tmp<scalarField> 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 ad37059180e7a386e74dae36d5f9ae9bf01066fe..f5940847c045f3f72546ff2557a580880290da7b 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<scalarField> myKDelta = kappa(*this)*patch().deltaCoeffs(); diff --git a/src/TurbulenceModels/incompressible/Make/options b/src/TurbulenceModels/incompressible/Make/options index c44e9ae61c9cc89f7984bcebd9cef0318f44de8e..cf54ffd963bbcf322562cf402445e4f0621665fd 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 245a0ff55c80b11adbc348d6911a54c2d076d7f8..70c7403e2f96e2d6b831be872c1d3a051f3e50b5 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 cc58aabc787e045e4dbae86455cc1fdbc2a3de22..3a4bc9c2621666ee3730ce84eed1c422238c2302 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 0b1ec7320235533b0141d29de6ef45cff0e06ef9..e91c6235647225dd9f6fa23ac49def98312396a5 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 c2d22054c2df7fc76de332a080729e84f3a6ca39..145c863931f05ed659dc4c6c3b8c1231d26cb4fb 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 58a84fc1482f935b199afc03b66d71ca126af707..6b30ee9d0da76d798cb0ad1b96774c54814ce26e 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 44a5c331214720a8c0dba4eba3ec81a47e2ab53e..f5b587385af6dea8538da3d51b5ba044d7bc7895 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 8c0e6b59842fdc4f4cfb198592fd9a9255ffc4e8..789a1688da180f0fc21d3329d8c1233ecd11a2d6 100644 --- a/src/TurbulenceModels/phaseCompressible/RAS/mixtureKEpsilon/mixtureKEpsilon.C +++ b/src/TurbulenceModels/phaseCompressible/RAS/mixtureKEpsilon/mixtureKEpsilon.C @@ -615,7 +615,7 @@ void mixtureKEpsilon<BasicTurbulenceModel>::correct() kl.boundaryField().updateCoeffs(); epsilonl.boundaryField().updateCoeffs(); - Gc().checkOut(); + Gc.ref().checkOut(); } tmp<volScalarField> Gd; @@ -635,7 +635,7 @@ void mixtureKEpsilon<BasicTurbulenceModel>::correct() kg.boundaryField().updateCoeffs(); epsilong.boundaryField().updateCoeffs(); - Gd().checkOut(); + Gd.ref().checkOut(); } // Mixture turbulence generation @@ -665,9 +665,9 @@ void mixtureKEpsilon<BasicTurbulenceModel>::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<BasicTurbulenceModel>::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 40f670e36a932d8e2ad2a6e4b7cea6866e2659a6..b2e6cd9796c7b0f0b27379c47ef9cc9ceea75294 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/DeardorffDiffStress/DeardorffDiffStress.C +++ b/src/TurbulenceModels/turbulenceModels/LES/DeardorffDiffStress/DeardorffDiffStress.C @@ -202,9 +202,9 @@ void DeardorffDiffStress<BasicTurbulenceModel>::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 38517e5bc58c0b281e4ea39c859b65425b6724d2..9b6f2c4c8b1ea296399e77283b86f719fd764d51 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 701bab6da391b288e69fe7936081b610d7d8e64d..865f3fc693b0cde2474a70c57042dcdeca1df2db 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<volScalarField> 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 08ce6197c6543cd4a14c4fc32790b4475091290b..8128591b4277ab330679c5c882701a1c4019c4ef 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::volSymmTensorField> Foam::anisotropicFilter::operator() for (direction d=0; d<symmTensor::nComponents; d++) { - tmpFilteredField().replace + tmpFilteredField.ref().replace ( d, anisotropicFilter::operator()(unFilteredField().component(d)) ); @@ -224,7 +224,7 @@ Foam::tmp<Foam::volTensorField> Foam::anisotropicFilter::operator() for (direction d=0; d<tensor::nComponents; d++) { - tmpFilteredField().replace + tmpFilteredField.ref().replace ( d, anisotropicFilter::operator()(unFilteredField().component(d)) ); diff --git a/src/TurbulenceModels/turbulenceModels/LES/SpalartAllmarasDDES/SpalartAllmarasDDES.C b/src/TurbulenceModels/turbulenceModels/LES/SpalartAllmarasDDES/SpalartAllmarasDDES.C index 186970ca6137e643fce28ebb4cb1676d01cbc66a..c48c901ba3614dc1bb5863473c42e191ba28f8fc 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/SpalartAllmarasDDES/SpalartAllmarasDDES.C +++ b/src/TurbulenceModels/turbulenceModels/LES/SpalartAllmarasDDES/SpalartAllmarasDDES.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 @@ -56,7 +56,7 @@ tmp<volScalarField> SpalartAllmarasDDES<BasicTurbulenceModel>::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 02f35be37261fe3198445da4345aa2e7c70a9238..401e26d963ebb176226e1d6a19e6c90cbc6f8db4 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<volScalarField> SpalartAllmarasDES<BasicTurbulenceModel>::r scalar(10) ) ); - tr().boundaryField() == 0.0; + tr.ref().boundaryField() == 0.0; return tr; } @@ -158,7 +158,7 @@ tmp<volScalarField> SpalartAllmarasDES<BasicTurbulenceModel>::dTilda ) const { tmp<volScalarField> tdTilda(CDES_*this->delta()); - min(tdTilda().dimensionedInternalField(), tdTilda(), y_); + min(tdTilda.ref().dimensionedInternalField(), tdTilda(), y_); return tdTilda; } @@ -442,8 +442,8 @@ void SpalartAllmarasDES<BasicTurbulenceModel>::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 1b61975899f5a511a457b505ec240fd05b74fb80..c9c08b5672b16fcdd33ea497f588e63246b72ec3 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<BasicTurbulenceModel>::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 4a87768c10b89f97e528d9fb47ca5f0a8059485c..5f617bf84ee5e18e8042a8cf84c80d489a7e7aaf 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<BasicTurbulenceModel>::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 a3ae8da833177387e9eecf75b5e2675fc7b481f5..bcd627471b97e93547ed691c52bd70b90be9030e 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 63625919d8b0d215ea898ff519ddb69c4a93a363..c15fabab3df6201a0d8927fe7415941c8e1d9b8e 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/LRR/LRR.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/LRR/LRR.C @@ -307,9 +307,9 @@ void LRR<BasicTurbulenceModel>::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<BasicTurbulenceModel>::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 c69c7b13c4002ad3ef539c9cf2992436b44f4d9d..ce79ca5011e356e8121836aa098f8fd6987b51e5 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/LaunderSharmaKE/LaunderSharmaKE.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/LaunderSharmaKE/LaunderSharmaKE.C @@ -280,9 +280,9 @@ void LaunderSharmaKE<BasicTurbulenceModel>::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<BasicTurbulenceModel>::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 c88dffbc844d6241f64c779a6bfdec2ed1c668cf..17e8f14f98399e5f9c852b986947ed767d7a601a 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/RNGkEpsilon/RNGkEpsilon.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/RNGkEpsilon/RNGkEpsilon.C @@ -288,9 +288,9 @@ void RNGkEpsilon<BasicTurbulenceModel>::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<BasicTurbulenceModel>::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 dc8815d8f310de20a958182867ed5cacfb9ed257..7117f166234b0a53985b08d5eaa0cea8e130131d 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/SSG/SSG.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/SSG/SSG.C @@ -317,9 +317,9 @@ void SSG<BasicTurbulenceModel>::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<BasicTurbulenceModel>::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 23446bc657a1f9df5307da584254ef5150b2f857..22e052972905f382921df4032287a3fc15f0c29b 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/SpalartAllmaras/SpalartAllmaras.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/SpalartAllmaras/SpalartAllmaras.C @@ -377,8 +377,8 @@ void SpalartAllmaras<BasicTurbulenceModel>::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 2fd57bbc3ff723de969053de72f7f7d35ab42707..8733871d7a3c77d0116c6bfeade3363abf3e6ef9 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/kEpsilon/kEpsilon.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/kEpsilon/kEpsilon.C @@ -258,9 +258,9 @@ void kEpsilon<BasicTurbulenceModel>::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<BasicTurbulenceModel>::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 0a45b353255f6b2ce35ee1a62e32907718723a00..9084c5720854c907cadd5f4300f429235a7e90b6 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/kOmega/kOmega.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/kOmega/kOmega.C @@ -221,9 +221,9 @@ void kOmega<BasicTurbulenceModel>::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<BasicTurbulenceModel>::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 ffbb4cb895be973c6bc6abb99a8c1af2b9531ccd..1deb432d4acf1b034e7e4711d9ee8557cde28f6e 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/kOmegaSST/kOmegaSST.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/kOmegaSST/kOmegaSST.C @@ -101,7 +101,7 @@ tmp<volScalarField> kOmegaSST<BasicTurbulenceModel>::kOmegaSST::F23() const if (F3_) { - f23() *= F3(); + f23.ref() *= F3(); } return f23; @@ -452,9 +452,9 @@ void kOmegaSST<BasicTurbulenceModel>::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<BasicTurbulenceModel>::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 f5b7dcf76a82edf7dac5bd84df2e3797d611fbae..aa74f0e57b2844d422bb0f2eb6abc76de042e1ed 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/realizableKE/realizableKE.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/realizableKE/realizableKE.C @@ -304,9 +304,9 @@ void realizableKE<BasicTurbulenceModel>::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<BasicTurbulenceModel>::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 84b12dc1b879248ed347ef8db4a60c17cacee6b3..3bbe58c3606e61ef70196f4630568f331ce72360 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/v2f/v2f.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/v2f/v2f.C @@ -329,9 +329,9 @@ void v2f<BasicTurbulenceModel>::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<BasicTurbulenceModel>::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<BasicTurbulenceModel>::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<BasicTurbulenceModel>::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 0893bea4a6fa591ee7b2653c093fc4e628ebfabe..e32c7369fb44de64061b6d9b2cea6c6f9f43468c 100644 --- a/src/TurbulenceModels/turbulenceModels/ReynoldsStress/ReynoldsStress.C +++ b/src/TurbulenceModels/turbulenceModels/ReynoldsStress/ReynoldsStress.C @@ -198,7 +198,7 @@ Foam::tmp<Foam::volScalarField> Foam::ReynoldsStress<BasicTurbulenceModel>::k() const { tmp<Foam::volScalarField> 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 476a1679a0cf378a7133ab178d1786e0e7892c59..7605716a4a44c8174ec68418f0cbe1551143977a 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<scalarField> nutURoughWallFunctionFvPatchScalarField::calcNut() const const scalarField magUp(mag(Uw.patchInternalField() - Uw)); tmp<scalarField> tyPlus = calcYPlus(magUp); - scalarField& yPlus = tyPlus(); + scalarField& yPlus = tyPlus.ref(); tmp<scalarField> tnutw(new scalarField(patch().size(), 0.0)); - scalarField& nutw = tnutw(); + scalarField& nutw = tnutw.ref(); forAll(yPlus, facei) { @@ -95,7 +95,7 @@ tmp<scalarField> nutURoughWallFunctionFvPatchScalarField::calcYPlus const scalarField& nuw = tnuw(); tmp<scalarField> 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 711eb54438b763c913eb43a94deba6ce64fdd311..fca1d717d231a395705458bfbb8930ec4a234eea 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<scalarField> nutUSpaldingWallFunctionFvPatchScalarField::calcUTau const scalarField& nutw = *this; tmp<scalarField> 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 9bc4767efd77f068bfd71ca68b2d454e34e5f9d7..eb4c55fb94b78c53a0b4c5dfedf32742c67a6ff3 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<scalarField> nutUTabulatedWallFunctionFvPatchScalarField::calcUPlus ) const { tmp<scalarField> 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 9d848e8efad42c88ae9f7b4ebbd9dcc818141aef..8a85d7226703c1c3f5872463f06fddc175227173 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<scalarField> nutUWallFunctionFvPatchScalarField::calcNut() const const scalarField& nuw = tnuw(); tmp<scalarField> tyPlus = calcYPlus(magUp); - scalarField& yPlus = tyPlus(); + scalarField& yPlus = tyPlus.ref(); tmp<scalarField> tnutw(new scalarField(patch().size(), 0.0)); - scalarField& nutw = tnutw(); + scalarField& nutw = tnutw.ref(); forAll(yPlus, facei) { @@ -92,7 +92,7 @@ tmp<scalarField> nutUWallFunctionFvPatchScalarField::calcYPlus const scalarField& nuw = tnuw(); tmp<scalarField> 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 9392408888be779726a7fc2fedf690a4b791a5a5..710ff8242b909ec08d827eea54169343160d9e33 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<scalarField> nutkAtmRoughWallFunctionFvPatchScalarField::calcNut() const const scalar Cmu25 = pow025(Cmu_); tmp<scalarField> 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 2d2f038b5a5286181624942a689cd386d1675c22..67405f0aa8502d6a4cc5d4f3b592c6ad8119775e 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<scalarField> nutkRoughWallFunctionFvPatchScalarField::calcNut() const const scalar Cmu25 = pow025(Cmu_); tmp<scalarField> 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 98b3f548ff25af98156611124b7dbbc39674d757..60dcf74b264644879b86c797edefd5d5d8855c22 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<scalarField> nutkWallFunctionFvPatchScalarField::calcNut() const const scalar Cmu25 = pow025(Cmu_); tmp<scalarField> 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 c24ac4d6c5e3410ab77166211b5acbb35dd5481b..409e9e8ca97a255fc20806091e16d947d216f7a8 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<BasicTurbulenceModel>::R() const ( eddyViscosity<BasicTurbulenceModel>::R() ); - tR() += nonlinearStress_; + tR.ref() += nonlinearStress_; return tR; } @@ -96,7 +96,7 @@ Foam::nonlinearEddyViscosity<BasicTurbulenceModel>::devRhoReff() const ( eddyViscosity<BasicTurbulenceModel>::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 1c1990e5f3e5f624194a3d86a9cd7f3f30ce2aca..25eb0cc6f8f5a02ce5c78579b32ebe96d682ab66 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 89b9e8547010d06b04c1c1f41757be2ea40f1c81..a4b099b6cbab22e97348ae2988dc0db3fa3382df 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.C +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.C @@ -180,7 +180,7 @@ Foam::tmp<Foam::volVectorField> 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::surfaceScalarField> Foam::MRFZoneList::relative ) ); - makeRelative(rphi()); + makeRelative(rphi.ref()); reuseTmpGeometricField<scalar, scalar, fvsPatchField, surfaceMesh> ::clear(tphi); @@ -267,7 +267,7 @@ Foam::MRFZoneList::relative forAll(*this, i) { - operator[](i).makeRelative(rphi()); + operator[](i).makeRelative(rphi.ref()); } reuseTmpFieldField<fvsPatchField, scalar, scalar>::clear(tphi); @@ -297,7 +297,7 @@ Foam::MRFZoneList::relative forAll(*this, i) { - operator[](i).makeRelative(rphi(), patchi); + operator[](i).makeRelative(rphi.ref(), patchi); } reuseTmp<scalar, scalar>::clear(tphi); @@ -361,7 +361,7 @@ Foam::tmp<Foam::surfaceScalarField> Foam::MRFZoneList::absolute ) ); - makeAbsolute(rphi()); + makeAbsolute(rphi.ref()); reuseTmpGeometricField<scalar, scalar, fvsPatchField, surfaceMesh> ::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 928777483f3dee80ad5b76791c41964e23202779..93944c12bf54becfd6a6c0eee2e8c7a46bc67ecb 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::volVectorField> 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::volVectorField> Foam::SRF::SRFModel::Uabs() const refCast<const SRFVelocityFvPatchVectorField>(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 beb2c223e2cd1411ef8778e6a53025b5f9752bf2..38f84f96a7199d4076679b6fa4c9a1b84e15f83f 100644 --- a/src/finiteVolume/cfdTools/general/constrainHbyA/constrainHbyA.C +++ b/src/finiteVolume/cfdTools/general/constrainHbyA/constrainHbyA.C @@ -40,16 +40,15 @@ Foam::tmp<Foam::volVectorField> 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 ca14e2b24ec13e29187289bc471831937dcc309b..8b9c65856c7739ab68f291205fee7aed10bcba34 100644 --- a/src/finiteVolume/cfdTools/general/fvOptions/fvOptionListTemplates.C +++ b/src/finiteVolume/cfdTools/general/fvOptions/fvOptionListTemplates.C @@ -47,7 +47,7 @@ Foam::tmp<Foam::fvMatrix<Type>> Foam::fv::optionList::operator() const dimensionSet ds = field.dimensions()/dimTime*dimVolume; tmp<fvMatrix<Type>> tmtx(new fvMatrix<Type>(field, ds)); - fvMatrix<Type>& mtx = tmtx(); + fvMatrix<Type>& mtx = tmtx.ref(); forAll(*this, i) { @@ -103,7 +103,7 @@ Foam::tmp<Foam::fvMatrix<Type>> Foam::fv::optionList::operator() ); tmp<fvMatrix<Type>> tmtx(new fvMatrix<Type>(field, ds)); - fvMatrix<Type>& mtx = tmtx(); + fvMatrix<Type>& mtx = tmtx.ref(); forAll(*this, i) { @@ -162,7 +162,7 @@ Foam::tmp<Foam::fvMatrix<Type>> Foam::fv::optionList::operator() ); tmp<fvMatrix<Type>> tmtx(new fvMatrix<Type>(field, ds)); - fvMatrix<Type>& mtx = tmtx(); + fvMatrix<Type>& 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 8dd817f29308b98be6ed9f78be9ea2c6fdc4ebda..631f074ad93489adf4fbda7f52b9c334dbae17d4 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::vectorField> 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 835de2a5f1f548ed3c97a370c20032007a37609a..a80f6c07867cd0c6b948f07751338113446271d7 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<Type>::patchNeighbourField() const cyclicPatch().cyclicPatch().neighbPatch().faceCells(); tmp<Field<Type>> tpnf(new Field<Type>(this->size())); - Field<Type>& pnf = tpnf(); + Field<Type>& 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 194aabf65ead66166781c9afe368dbac3dfe9695..0ded42fdf7cd3f206d8050bd88de3f6938328c8d 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<Type>::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 f993a8d8d9bc73fc6b8092c255689ab6f754726d..a241a8071c8e6fc0a6c63fa9034d66aac75a4192 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<Type>::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 a66f608955cb9a57e00a7e9f555f6744df75e7ce..07764053fc833a8fe3c9da840963edd09254c671 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<Type>::patchNeighbourField() const this->cyclicPatch().neighbFvPatch().faceCells(); tmp<Field<Type>> tpnf(new Field<Type>(this->size())); - Field<Type>& pnf = tpnf(); + Field<Type>& pnf = tpnf.ref(); Field<Type> 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 a4f4856f2aee1f847db80afd80ae883af2248cf7..1c52eadef53328c2b264b71a0d014d21d72e2e02 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedPatchFieldBase.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedPatchFieldBase.C @@ -180,7 +180,7 @@ tmp<Field<Type>> mappedPatchFieldBase<Type>::mappedField() const // Result of obtaining remote values tmp<Field<Type>> tnewValues(new Field<Type>(0)); - Field<Type>& newValues = tnewValues(); + Field<Type>& 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 e8f97d0cf8a933a12c18cd7bd357116cc4806e9d..537881840b713e163febedf3c4c6ab22096cacd4 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<Type>> Foam::fvPatchField<Type>::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 152b0dc6c494d02aea4851c4f7892dbd7ab2b3b9..38040b2119b1853aeb0749062f84b452be7cdef1 100644 --- a/src/finiteVolume/finiteVolume/convectionSchemes/gaussConvectionScheme/gaussConvectionScheme.C +++ b/src/finiteVolume/finiteVolume/convectionSchemes/gaussConvectionScheme/gaussConvectionScheme.C @@ -90,7 +90,7 @@ gaussConvectionScheme<Type>::fvmDiv faceFlux.dimensions()*vf.dimensions() ) ); - fvMatrix<Type>& fvm = tfvm(); + fvMatrix<Type>& fvm = tfvm.ref(); fvm.lower() = -weights.internalField()*faceFlux.internalField(); fvm.upper() = fvm.lower() + faceFlux.internalField(); @@ -128,7 +128,7 @@ gaussConvectionScheme<Type>::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 6d8a46ba73212de4daf06765409a6f4b4f0fc558..44ee3649646d5184f6b7dce4238f5faa2f7070c0 100644 --- a/src/finiteVolume/finiteVolume/d2dt2Schemes/EulerD2dt2Scheme/EulerD2dt2Scheme.C +++ b/src/finiteVolume/finiteVolume/d2dt2Schemes/EulerD2dt2Scheme/EulerD2dt2Scheme.C @@ -247,7 +247,7 @@ EulerD2dt2Scheme<Type>::fvmD2dt2 ) ); - fvMatrix<Type>& fvm = tfvm(); + fvMatrix<Type>& fvm = tfvm.ref(); scalar deltaT = mesh().time().deltaTValue(); scalar deltaT0 = mesh().time().deltaT0Value(); @@ -308,7 +308,7 @@ EulerD2dt2Scheme<Type>::fvmD2dt2 ) ); - fvMatrix<Type>& fvm = tfvm(); + fvMatrix<Type>& fvm = tfvm.ref(); scalar deltaT = mesh().time().deltaTValue(); scalar deltaT0 = mesh().time().deltaT0Value(); @@ -368,7 +368,7 @@ EulerD2dt2Scheme<Type>::fvmD2dt2 ) ); - fvMatrix<Type>& fvm = tfvm(); + fvMatrix<Type>& 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 f45c34dfceaae7d70ae583a0830298b28cd28e7b..2374f31fffa2ff2c65e190c6107884ad3fb7d207 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/CoEulerDdtScheme/CoEulerDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/CoEulerDdtScheme/CoEulerDdtScheme.C @@ -61,7 +61,7 @@ tmp<volScalarField> CoEulerDdtScheme<Type>::CorDeltaT() const ) ); - volScalarField& corDeltaT = tcorDeltaT(); + volScalarField& corDeltaT = tcorDeltaT.ref(); const labelUList& owner = mesh().owner(); const labelUList& neighbour = mesh().neighbour(); @@ -183,7 +183,7 @@ CoEulerDdtScheme<Type>::fvcDdt ) ); - tdtdt().internalField() = + tdtdt.ref().internalField() = rDeltaT.internalField()*dt.value() *(1.0 - mesh().Vsc0()/mesh().Vsc()); @@ -453,7 +453,7 @@ CoEulerDdtScheme<Type>::fvmDdt ) ); - fvMatrix<Type>& fvm = tfvm(); + fvMatrix<Type>& fvm = tfvm.ref(); scalarField rDeltaT(CorDeltaT()().internalField()); @@ -488,7 +488,7 @@ CoEulerDdtScheme<Type>::fvmDdt rho.dimensions()*vf.dimensions()*dimVol/dimTime ) ); - fvMatrix<Type>& fvm = tfvm(); + fvMatrix<Type>& fvm = tfvm.ref(); scalarField rDeltaT(CorDeltaT()().internalField()); @@ -525,7 +525,7 @@ CoEulerDdtScheme<Type>::fvmDdt rho.dimensions()*vf.dimensions()*dimVol/dimTime ) ); - fvMatrix<Type>& fvm = tfvm(); + fvMatrix<Type>& fvm = tfvm.ref(); scalarField rDeltaT(CorDeltaT()().internalField()); @@ -565,7 +565,7 @@ CoEulerDdtScheme<Type>::fvmDdt alpha.dimensions()*rho.dimensions()*vf.dimensions()*dimVol/dimTime ) ); - fvMatrix<Type>& fvm = tfvm(); + fvMatrix<Type>& 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 c98d9979a916f0bdca10e513f65f80d567b0ed2a..d33969f50aac2e7d92f818b5f05738566fe0329a 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.C @@ -330,7 +330,7 @@ CrankNicolsonDdtScheme<Type>::fvcDdt )/mesh().V0(); } - tdtdt().dimensionedInternalField() = + tdtdt.ref().dimensionedInternalField() = ( (rDtCoef*dt)*(mesh().V() - mesh().V0()) - mesh().V0()*offCentre_(ddt0.dimensionedInternalField()) @@ -773,7 +773,7 @@ CrankNicolsonDdtScheme<Type>::fvmDdt ) ); - fvMatrix<Type>& fvm = tfvm(); + fvMatrix<Type>& fvm = tfvm.ref(); scalar rDtCoef = rDtCoef_(ddt0).value(); fvm.diag() = rDtCoef*mesh().V(); @@ -855,7 +855,7 @@ CrankNicolsonDdtScheme<Type>::fvmDdt rho.dimensions()*vf.dimensions()*dimVol/dimTime ) ); - fvMatrix<Type>& fvm = tfvm(); + fvMatrix<Type>& fvm = tfvm.ref(); scalar rDtCoef = rDtCoef_(ddt0).value(); fvm.diag() = rDtCoef*rho.value()*mesh().V(); @@ -937,7 +937,7 @@ CrankNicolsonDdtScheme<Type>::fvmDdt rho.dimensions()*vf.dimensions()*dimVol/dimTime ) ); - fvMatrix<Type>& fvm = tfvm(); + fvMatrix<Type>& fvm = tfvm.ref(); scalar rDtCoef = rDtCoef_(ddt0).value(); fvm.diag() = rDtCoef*rho.internalField()*mesh().V(); @@ -1028,7 +1028,7 @@ CrankNicolsonDdtScheme<Type>::fvmDdt alpha.dimensions()*rho.dimensions()*vf.dimensions()*dimVol/dimTime ) ); - fvMatrix<Type>& fvm = tfvm(); + fvMatrix<Type>& 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 8cbc6d42a0bcc7a24d82c9c9cd46eded03b32b30..79c3069f0df18bea4980064f5e961cdfa03928d6 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.C @@ -73,7 +73,7 @@ EulerDdtScheme<Type>::fvcDdt ) ); - tdtdt().internalField() = + tdtdt.ref().internalField() = rDeltaT.value()*dt.value()*(1.0 - mesh().Vsc0()/mesh().Vsc()); return tdtdt; @@ -342,7 +342,7 @@ EulerDdtScheme<Type>::fvmDdt ) ); - fvMatrix<Type>& fvm = tfvm(); + fvMatrix<Type>& fvm = tfvm.ref(); scalar rDeltaT = 1.0/mesh().time().deltaTValue(); @@ -377,7 +377,7 @@ EulerDdtScheme<Type>::fvmDdt rho.dimensions()*vf.dimensions()*dimVol/dimTime ) ); - fvMatrix<Type>& fvm = tfvm(); + fvMatrix<Type>& fvm = tfvm.ref(); scalar rDeltaT = 1.0/mesh().time().deltaTValue(); @@ -414,7 +414,7 @@ EulerDdtScheme<Type>::fvmDdt rho.dimensions()*vf.dimensions()*dimVol/dimTime ) ); - fvMatrix<Type>& fvm = tfvm(); + fvMatrix<Type>& fvm = tfvm.ref(); scalar rDeltaT = 1.0/mesh().time().deltaTValue(); @@ -454,7 +454,7 @@ EulerDdtScheme<Type>::fvmDdt alpha.dimensions()*rho.dimensions()*vf.dimensions()*dimVol/dimTime ) ); - fvMatrix<Type>& fvm = tfvm(); + fvMatrix<Type>& 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 ea874260418fa9fa8d828a49e2b7be81a10f2840..204f88e69c85c635b7f321b6fd08a90db6ba1725 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/SLTSDdtScheme/SLTSDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/SLTSDdtScheme/SLTSDdtScheme.C @@ -111,7 +111,7 @@ tmp<volScalarField> SLTSDdtScheme<Type>::SLrDeltaT() const ) ); - volScalarField& rDeltaT = trDeltaT(); + volScalarField& rDeltaT = trDeltaT.ref(); relaxedDiag(rDeltaT, phi); @@ -183,7 +183,7 @@ SLTSDdtScheme<Type>::fvcDdt ) ); - tdtdt().internalField() = + tdtdt.ref().internalField() = rDeltaT.internalField()*dt.value()*(1.0 - mesh().V0()/mesh().V()); return tdtdt; @@ -452,7 +452,7 @@ SLTSDdtScheme<Type>::fvmDdt ) ); - fvMatrix<Type>& fvm = tfvm(); + fvMatrix<Type>& fvm = tfvm.ref(); scalarField rDeltaT(SLrDeltaT()().internalField()); @@ -487,7 +487,7 @@ SLTSDdtScheme<Type>::fvmDdt rho.dimensions()*vf.dimensions()*dimVol/dimTime ) ); - fvMatrix<Type>& fvm = tfvm(); + fvMatrix<Type>& fvm = tfvm.ref(); scalarField rDeltaT(SLrDeltaT()().internalField()); @@ -524,7 +524,7 @@ SLTSDdtScheme<Type>::fvmDdt rho.dimensions()*vf.dimensions()*dimVol/dimTime ) ); - fvMatrix<Type>& fvm = tfvm(); + fvMatrix<Type>& fvm = tfvm.ref(); scalarField rDeltaT(SLrDeltaT()().internalField()); @@ -564,7 +564,7 @@ SLTSDdtScheme<Type>::fvmDdt alpha.dimensions()*rho.dimensions()*vf.dimensions()*dimVol/dimTime ) ); - fvMatrix<Type>& fvm = tfvm(); + fvMatrix<Type>& 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 5108e7d31a2691a0beda030290587bec6ccc0ae9..9297d106d84e9682d1b587467796ed47ddd082c4 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.C @@ -111,7 +111,7 @@ backwardDdtScheme<Type>::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<Type>::fvmDdt ) ); - fvMatrix<Type>& fvm = tfvm(); + fvMatrix<Type>& fvm = tfvm.ref(); scalar rDeltaT = 1.0/deltaT_(); @@ -518,7 +518,7 @@ backwardDdtScheme<Type>::fvmDdt rho.dimensions()*vf.dimensions()*dimVol/dimTime ) ); - fvMatrix<Type>& fvm = tfvm(); + fvMatrix<Type>& fvm = tfvm.ref(); scalar rDeltaT = 1.0/deltaT_(); @@ -569,7 +569,7 @@ backwardDdtScheme<Type>::fvmDdt rho.dimensions()*vf.dimensions()*dimVol/dimTime ) ); - fvMatrix<Type>& fvm = tfvm(); + fvMatrix<Type>& fvm = tfvm.ref(); scalar rDeltaT = 1.0/deltaT_(); @@ -624,7 +624,7 @@ backwardDdtScheme<Type>::fvmDdt alpha.dimensions()*rho.dimensions()*vf.dimensions()*dimVol/dimTime ) ); - fvMatrix<Type>& fvm = tfvm(); + fvMatrix<Type>& 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 e7dc6dc813b4f843b346b47f9c0fe68ce1f39718..c81e9f5266070b09e702590f02b32ce2024fff53 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/boundedDdtScheme/boundedDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/boundedDdtScheme/boundedDdtScheme.C @@ -48,7 +48,7 @@ boundedDdtScheme<Type>::fvcDdt const dimensioned<Type>& dt ) { - return scheme_().fvcDdt(dt); + return scheme_.ref().fvcDdt(dt); } @@ -59,7 +59,7 @@ boundedDdtScheme<Type>::fvcDdt const GeometricField<Type, fvPatchField, volMesh>& vf ) { - return scheme_().fvcDdt(vf); + return scheme_.ref().fvcDdt(vf); } @@ -71,7 +71,7 @@ boundedDdtScheme<Type>::fvcDdt const GeometricField<Type, fvPatchField, volMesh>& vf ) { - return scheme_().fvcDdt(rho, vf); + return scheme_.ref().fvcDdt(rho, vf); } @@ -83,7 +83,7 @@ boundedDdtScheme<Type>::fvcDdt const GeometricField<Type, fvPatchField, volMesh>& 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<Type>::fvcDdt const GeometricField<Type, fvPatchField, volMesh>& 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<Type>::fvmDdt const GeometricField<Type, fvPatchField, volMesh>& vf ) { - return scheme_().fvmDdt(vf); + return scheme_.ref().fvmDdt(vf); } @@ -119,7 +119,7 @@ boundedDdtScheme<Type>::fvmDdt const GeometricField<Type, fvPatchField, volMesh>& vf ) { - return scheme_().fvmDdt(rho, vf); + return scheme_.ref().fvmDdt(rho, vf); } @@ -131,7 +131,7 @@ boundedDdtScheme<Type>::fvmDdt const GeometricField<Type, fvPatchField, volMesh>& 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<Type>::fvmDdt const GeometricField<Type, fvPatchField, volMesh>& 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<Type>::fvcDdtUfCorr const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf ) { - return scheme_().fvcDdtUfCorr(U, Uf); + return scheme_.ref().fvcDdtUfCorr(U, Uf); } @@ -168,7 +170,7 @@ boundedDdtScheme<Type>::fvcDdtPhiCorr const fluxFieldType& phi ) { - return scheme_().fvcDdtPhiCorr(U, phi); + return scheme_.ref().fvcDdtPhiCorr(U, phi); } @@ -181,7 +183,7 @@ boundedDdtScheme<Type>::fvcDdtUfCorr const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf ) { - return scheme_().fvcDdtUfCorr(rho, U, Uf); + return scheme_.ref().fvcDdtUfCorr(rho, U, Uf); } @@ -194,7 +196,7 @@ boundedDdtScheme<Type>::fvcDdtPhiCorr const fluxFieldType& phi ) { - return scheme_().fvcDdtPhiCorr(rho, U, phi); + return scheme_.ref().fvcDdtPhiCorr(rho, U, phi); } @@ -204,7 +206,7 @@ tmp<surfaceScalarField> boundedDdtScheme<Type>::meshPhi const GeometricField<Type, fvPatchField, volMesh>& 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 5144c744c987beed56d26a65f698e9fc790584d2..62cca7ec3a8693a49f4175ac1a7beb1f94e68487 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C @@ -148,7 +148,7 @@ tmp<surfaceScalarField> ddtScheme<Type>::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 c77e3de64132917e690bd033d8016819f000ad94..4338399573993cdc0718420b2dcbbae0b2738b5e 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/localEulerDdtScheme/localEulerDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/localEulerDdtScheme/localEulerDdtScheme.C @@ -79,7 +79,7 @@ localEulerDdtScheme<Type>::fvcDdt ) ); - tdtdt().internalField() = + tdtdt.ref().internalField() = rDeltaT.internalField()*dt.value() *(1.0 - mesh().Vsc0()/mesh().Vsc()); @@ -349,7 +349,7 @@ localEulerDdtScheme<Type>::fvmDdt ) ); - fvMatrix<Type>& fvm = tfvm(); + fvMatrix<Type>& fvm = tfvm.ref(); const scalarField& rDeltaT = localRDeltaT().internalField(); @@ -384,7 +384,7 @@ localEulerDdtScheme<Type>::fvmDdt rho.dimensions()*vf.dimensions()*dimVol/dimTime ) ); - fvMatrix<Type>& fvm = tfvm(); + fvMatrix<Type>& fvm = tfvm.ref(); const scalarField& rDeltaT = localRDeltaT().internalField(); @@ -421,7 +421,7 @@ localEulerDdtScheme<Type>::fvmDdt rho.dimensions()*vf.dimensions()*dimVol/dimTime ) ); - fvMatrix<Type>& fvm = tfvm(); + fvMatrix<Type>& fvm = tfvm.ref(); const scalarField& rDeltaT = localRDeltaT().internalField(); @@ -461,7 +461,7 @@ localEulerDdtScheme<Type>::fvmDdt alpha.dimensions()*rho.dimensions()*vf.dimensions()*dimVol/dimTime ) ); - fvMatrix<Type>& fvm = tfvm(); + fvMatrix<Type>& 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 8d445b2f77e899e24ed10e07b6297a81f829a4db..9721a04ecafc119a7ccf80e748f0235ad85260c2 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<Type>::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 022a5a688a0d872b3f0634e869d7bcbcc4d1eb08..711a012f661bdd7c0a1ec5a37b3790cd45dad893 100644 --- a/src/finiteVolume/finiteVolume/fvc/fvcAverage.C +++ b/src/finiteVolume/finiteVolume/fvc/fvcAverage.C @@ -65,8 +65,7 @@ average ssf.dimensions() ) ); - - GeometricField<Type, fvPatchField, volMesh>& av = taverage(); + GeometricField<Type, fvPatchField, volMesh>& av = taverage.ref(); av.internalField() = ( diff --git a/src/finiteVolume/finiteVolume/fvc/fvcDdt.C b/src/finiteVolume/finiteVolume/fvc/fvcDdt.C index 3cabcd5154823c9ab6d7ce8e75addfe399edaeaa..391da38be341ef0760a8d700941eef98c7ebad19 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 c788eac5b6463a16f613ef4a7511283ad02fffd1..888e394dfac5dbd2ff6d9d8fa4e7a19aa22d7405 100644 --- a/src/finiteVolume/finiteVolume/fvc/fvcDiv.C +++ b/src/finiteVolume/finiteVolume/fvc/fvcDiv.C @@ -89,7 +89,7 @@ div return fv::divScheme<Type>::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 0ec6662ce5e292e26d79955f09ea66be575210e2..56b94907daac36114dc590731b41c51554ca88a8 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 fbe3bca33322af3ae79a492d327b1c0a7bc9ede4..6def790f2eb06899d6c5987b6fade9e7e005f7e7 100644 --- a/src/finiteVolume/finiteVolume/fvc/fvcMagSqrGradGrad.C +++ b/src/finiteVolume/finiteVolume/fvc/fvcMagSqrGradGrad.C @@ -53,7 +53,8 @@ tmp<volScalarField> magSqrGradGrad // Loop over other vector field components for (direction cmpt = 1; cmpt < pTraits<Type>::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 741321612c97fd5b16316b0ac3784ee7caef7d57..f7707e0db7cc3ee4165040aea183b1f763f3d85d 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::surfaceScalarField> Foam::fvc::meshPhi ( vf.mesh(), vf.mesh().ddtScheme("ddt(" + vf.name() + ')') - )().meshPhi(vf); + ).ref().meshPhi(vf); } @@ -52,7 +52,7 @@ Foam::tmp<Foam::surfaceScalarField> 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::surfaceScalarField> 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 2b8c34a41bdb8caf7d2362bc70c95c155dfb2634..30d12abc4b8fc578b30766ecb474e398ae55291d 100644 --- a/src/finiteVolume/finiteVolume/fvc/fvcReconstructMag.C +++ b/src/finiteVolume/finiteVolume/fvc/fvcReconstructMag.C @@ -75,8 +75,7 @@ tmp<volScalarField> reconstructMag(const surfaceScalarField& ssf) extrapolatedCalculatedFvPatchScalarField::typeName ) ); - - scalarField& rf = treconField(); + scalarField& rf = treconField.ref(); forAll(owner, facei) { @@ -109,7 +108,7 @@ tmp<volScalarField> 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 ccf92f56c0eb331b97f21b7196644551328b32db..dd08e083aa5780a4795b37a7fa50af4d96c45bb3 100644 --- a/src/finiteVolume/finiteVolume/fvc/fvcSurfaceIntegrate.C +++ b/src/finiteVolume/finiteVolume/fvc/fvcSurfaceIntegrate.C @@ -107,7 +107,7 @@ surfaceIntegrate extrapolatedCalculatedFvPatchField<Type>::typeName ) ); - GeometricField<Type, fvPatchField, volMesh>& vf = tvf(); + GeometricField<Type, fvPatchField, volMesh>& vf = tvf.ref(); surfaceIntegrate(vf.internalField(), ssf); vf.correctBoundaryConditions(); @@ -158,7 +158,7 @@ surfaceSum extrapolatedCalculatedFvPatchField<Type>::typeName ) ); - GeometricField<Type, fvPatchField, volMesh>& vf = tvf(); + GeometricField<Type, fvPatchField, volMesh>& 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 2cea308b28681657e2086a94ed82bdd14e21c39a..da9cef131c9a82d464bb075a686ae3f6cd3ddc56 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 ef77f56982822e51c99870e225a08d4baea73565..aa44d4e68f51a23134023d1b819ef8c2574df715 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 5228eddcae2c58c5a260b8f3108fa9851db15314..97d33bd609b96e357f9d34356f162ef0a1307863 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<Type>& fvm = tfvm(); + fvMatrix<Type>& fvm = tfvm.ref(); fvm.source() -= mesh.V()*su.field(); @@ -113,7 +113,7 @@ Foam::fvm::Sp dimVol*sp.dimensions()*vf.dimensions() ) ); - fvMatrix<Type>& fvm = tfvm(); + fvMatrix<Type>& fvm = tfvm.ref(); fvm.diag() += mesh.V()*sp.field(); @@ -167,7 +167,7 @@ Foam::fvm::Sp dimVol*sp.dimensions()*vf.dimensions() ) ); - fvMatrix<Type>& fvm = tfvm(); + fvMatrix<Type>& fvm = tfvm.ref(); fvm.diag() += mesh.V()*sp.value(); @@ -205,7 +205,7 @@ Foam::fvm::SuSp dimVol*susp.dimensions()*vf.dimensions() ) ); - fvMatrix<Type>& fvm = tfvm(); + fvMatrix<Type>& 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 26b582f77b240892317d31a2a32e4c33ff866f13..a462ff85f75ce8f4e9804bcf423665c7c3dc7a9a 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/LeastSquaresGrad/LeastSquaresGrad.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/LeastSquaresGrad/LeastSquaresGrad.C @@ -80,7 +80,7 @@ Foam::fv::LeastSquaresGrad<Type, Stencil>::calcGrad extrapolatedCalculatedFvPatchField<GradType>::typeName ) ); - GeometricField<GradType, fvPatchField, volMesh>& lsGrad = tlsGrad(); + GeometricField<GradType, fvPatchField, volMesh>& lsGrad = tlsGrad.ref(); Field<GradType>& 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 32a433c61aad56b583069f488f48b2807d303a43..975ff9141d91a22192bae107ba329e224f75a942 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/fourthGrad/fourthGrad.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/fourthGrad/fourthGrad.C @@ -85,7 +85,7 @@ Foam::fv::fourthGrad<Type>::calcGrad secondfGrad ) ); - GeometricField<GradType, fvPatchField, volMesh>& fGrad = tfGrad(); + GeometricField<GradType, fvPatchField, volMesh>& 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 a70e53f5a1b5ff92fecba983d710a1fb6c873308..7e0c76cf5513b1ac73b58b19a9cc37546a10f382 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/gaussGrad/gaussGrad.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/gaussGrad/gaussGrad.C @@ -70,7 +70,7 @@ Foam::fv::gaussGrad<Type>::gradf extrapolatedCalculatedFvPatchField<GradType>::typeName ) ); - GeometricField<GradType, fvPatchField, volMesh>& gGrad = tgGrad(); + GeometricField<GradType, fvPatchField, volMesh>& gGrad = tgGrad.ref(); const labelUList& owner = mesh.owner(); const labelUList& neighbour = mesh.neighbour(); @@ -132,7 +132,7 @@ Foam::fv::gaussGrad<Type>::calcGrad ( gradf(tinterpScheme_().interpolate(vsf), name) ); - GeometricField<GradType, fvPatchField, volMesh>& gGrad = tgGrad(); + GeometricField<GradType, fvPatchField, volMesh>& 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 fa80a0856736ada24e03c4b3137745e4f6891024..4a15dbc4d14bd8225d4bb7431467f2e31f21b9f3 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/leastSquaresGrad/leastSquaresGrad.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/leastSquaresGrad/leastSquaresGrad.C @@ -76,7 +76,7 @@ Foam::fv::leastSquaresGrad<Type>::calcGrad extrapolatedCalculatedFvPatchField<GradType>::typeName ) ); - GeometricField<GradType, fvPatchField, volMesh>& lsGrad = tlsGrad(); + GeometricField<GradType, fvPatchField, volMesh>& 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 14064aa9e225db82689151d5712c6dda5969f3f7..43238d823c9add8466c0d11eb2ba7ea8820d80a6 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<Foam::scalar>::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<Foam::vector>::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 594ad63dd9e8f36a21219bc4133d6b3b8085aac3..5f230156268ea03a21e3a3c6c32b6bc022c92866 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<Foam::scalar>::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<Foam::vector>::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 c37b14a298f1814edc3e216cda324050dfc41243..775dee934a0ece3c13cd4956094bd2377e1568cc 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<Foam::scalar>::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<Foam::vector>::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 9a43689fd482d56e98231ed9dfaddfd7035504c0..f0fd65ee018228f6c4f320d80974d247cc12dbf4 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<Foam::scalar>::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<Foam::vector>::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 3bf14b57b2dbb269c2596d5c9e602eaa011b4939..fd9df516e8f85abd1ca7a0ca14816944b2129332 100644 --- a/src/finiteVolume/finiteVolume/laplacianSchemes/gaussLaplacianScheme/gaussLaplacianScheme.C +++ b/src/finiteVolume/finiteVolume/laplacianSchemes/gaussLaplacianScheme/gaussLaplacianScheme.C @@ -58,7 +58,7 @@ gaussLaplacianScheme<Type, GType>::fvmLaplacianUncorrected deltaCoeffs.dimensions()*gammaMagSf.dimensions()*vf.dimensions() ) ); - fvMatrix<Type>& fvm = tfvm(); + fvMatrix<Type>& fvm = tfvm.ref(); fvm.upper() = deltaCoeffs.internalField()*gammaMagSf.internalField(); fvm.negSumDiag(); @@ -118,7 +118,7 @@ gaussLaplacianScheme<Type, GType>::gammaSnGradCorr for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++) { - tgammaSnGradCorr().replace + tgammaSnGradCorr.ref().replace ( cmpt, SfGammaCorr & fvc::interpolate(fvc::grad(vf.component(cmpt))) @@ -145,7 +145,7 @@ gaussLaplacianScheme<Type, GType>::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<Type, GType>::fvmLaplacian this->tsnGradScheme_().deltaCoeffs(vf), vf ); - fvMatrix<Type>& fvm = tfvm(); + fvMatrix<Type>& fvm = tfvm.ref(); tmp<GeometricField<Type, fvsPatchField, surfaceMesh>> tfaceFluxCorrection = gammaSnGradCorr(SfGammaCorr, vf); if (this->tsnGradScheme_().corrected()) { - tfaceFluxCorrection() += + tfaceFluxCorrection.ref() += SfGammaSn*this->tsnGradScheme_().correction(vf); } @@ -225,7 +225,10 @@ gaussLaplacianScheme<Type, GType>::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 417c3ac19e9f48f24fa7e9b1f6abf3ac2ec0b3e0..8afa4447dc6e9d4f8f8ee5c93564a228f5f70185 100644 --- a/src/finiteVolume/finiteVolume/laplacianSchemes/gaussLaplacianScheme/gaussLaplacianSchemes.C +++ b/src/finiteVolume/finiteVolume/laplacianSchemes/gaussLaplacianScheme/gaussLaplacianSchemes.C @@ -53,7 +53,7 @@ Foam::fv::gaussLaplacianScheme<Foam::Type, Foam::scalar>::fvmLaplacian \ this->tsnGradScheme_().deltaCoeffs(vf), \ vf \ ); \ - fvMatrix<Type>& fvm = tfvm(); \ + fvMatrix<Type>& fvm = tfvm.ref(); \ \ if (this->tsnGradScheme_().corrected()) \ { \ @@ -102,7 +102,10 @@ Foam::fv::gaussLaplacianScheme<Foam::Type, Foam::scalar>::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 1a05f609c5272ce32aeacd41e4e03340ee347425..f06951f10982cc9082898d1909d4a9e82ddee54f 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 b653e839ea8d13de1d36a3a429688c7bd25a30e9..ea58ee02497a30ce15b92384aac2a789c1230422 100644 --- a/src/finiteVolume/finiteVolume/snGradSchemes/correctedSnGrad/correctedSnGrad.C +++ b/src/finiteVolume/finiteVolume/snGradSchemes/correctedSnGrad/correctedSnGrad.C @@ -59,7 +59,7 @@ Foam::fv::correctedSnGrad<Type>::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<Type>::correction vf.dimensions()*mesh.nonOrthDeltaCoeffs().dimensions() ) ); - GeometricField<Type, fvsPatchField, surfaceMesh>& ssf = tssf(); + GeometricField<Type, fvsPatchField, surfaceMesh>& ssf = tssf.ref(); for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++) { diff --git a/src/finiteVolume/finiteVolume/snGradSchemes/faceCorrectedSnGrad/faceCorrectedSnGrad.C b/src/finiteVolume/finiteVolume/snGradSchemes/faceCorrectedSnGrad/faceCorrectedSnGrad.C index 1d13539f406d96c3d4b1e731756881cce2eaa0b2..467dc0af5246dcfb7e5b63733c94b13b17e2a2df 100644 --- a/src/finiteVolume/finiteVolume/snGradSchemes/faceCorrectedSnGrad/faceCorrectedSnGrad.C +++ b/src/finiteVolume/finiteVolume/snGradSchemes/faceCorrectedSnGrad/faceCorrectedSnGrad.C @@ -68,7 +68,7 @@ Foam::fv::faceCorrectedSnGrad<Type>::fullGradCorrection ) ); - Field<Type>& sfCorr = tsfCorr().internalField(); + Field<Type>& sfCorr = tsfCorr.ref().internalField(); const pointField& points = mesh.points(); const faceList& faces = mesh.faces(); @@ -116,7 +116,7 @@ Foam::fv::faceCorrectedSnGrad<Type>::fullGradCorrection sfCorr[facei] = dCorr&fgrad; } - tsfCorr().boundaryField() = pTraits<Type>::zero; + tsfCorr.ref().boundaryField() = pTraits<Type>::zero; return tsfCorr; } @@ -148,7 +148,7 @@ Foam::fv::faceCorrectedSnGrad<Type>::correction vf.dimensions()*mesh.nonOrthDeltaCoeffs().dimensions() ) ); - GeometricField<Type, fvsPatchField, surfaceMesh>& ssf = tssf(); + GeometricField<Type, fvsPatchField, surfaceMesh>& ssf = tssf.ref(); for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++) { diff --git a/src/finiteVolume/finiteVolume/snGradSchemes/snGradScheme/snGradScheme.C b/src/finiteVolume/finiteVolume/snGradSchemes/snGradScheme/snGradScheme.C index c667c4410de133feca0ca18c5f96df5f38da3adf..f5c28f080c517a1e39dfa655ef6e874659fe33f9 100644 --- a/src/finiteVolume/finiteVolume/snGradSchemes/snGradScheme/snGradScheme.C +++ b/src/finiteVolume/finiteVolume/snGradSchemes/snGradScheme/snGradScheme.C @@ -123,7 +123,7 @@ snGradScheme<Type>::snGrad vf.dimensions()*tdeltaCoeffs().dimensions() ) ); - GeometricField<Type, fvsPatchField, surfaceMesh>& ssf = tsf(); + GeometricField<Type, fvsPatchField, surfaceMesh>& ssf = tsf.ref(); // set reference to difference factors array const scalarField& deltaCoeffs = tdeltaCoeffs().internalField(); @@ -183,7 +183,7 @@ snGradScheme<Type>::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 7fb437976b8c8474d97c149c62d98f64a9b6fddd..6d4b18f3714a159dac7bf45db556254ff72dfc8b 100644 --- a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C +++ b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C @@ -158,7 +158,7 @@ void Foam::fvMatrix<Type>::addBoundarySource } else if (couples) { - tmp<Field<Type>> tpnf = ptf.patchNeighbourField(); + const tmp<Field<Type>> tpnf = ptf.patchNeighbourField(); const Field<Type>& pnf = tpnf(); const labelUList& addr = lduAddr().patchAddr(patchI); @@ -743,8 +743,8 @@ Foam::tmp<Foam::volScalarField> Foam::fvMatrix<Type>::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<Type>::H() const extrapolatedCalculatedFvPatchScalarField::typeName ) ); - GeometricField<Type, fvPatchField, volMesh>& Hphi = tHphi(); + GeometricField<Type, fvPatchField, volMesh>& Hphi = tHphi.ref(); // Loop over field components for (direction cmpt=0; cmpt<Type::nComponents; cmpt++) @@ -833,7 +833,7 @@ Foam::tmp<Foam::volScalarField> Foam::fvMatrix<Type>::H1() const extrapolatedCalculatedFvPatchScalarField::typeName ) ); - volScalarField& H1_ = tH1(); + volScalarField& H1_ = tH1.ref(); H1_.internalField() = lduMatrix::H1(); @@ -890,7 +890,8 @@ flux() const dimensions() ) ); - GeometricField<Type, fvsPatchField, surfaceMesh>& fieldFlux = tfieldFlux(); + GeometricField<Type, fvsPatchField, surfaceMesh>& fieldFlux = + tfieldFlux.ref(); for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++) { @@ -1462,7 +1463,7 @@ Foam::tmp<Foam::fvMatrix<Type>> Foam::operator== { checkMethod(A, su, "=="); tmp<fvMatrix<Type>> tC(new fvMatrix<Type>(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::fvMatrix<Type>> Foam::operator== { checkMethod(A, tsu(), "=="); tmp<fvMatrix<Type>> tC(new fvMatrix<Type>(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::fvMatrix<Type>> Foam::operator== { checkMethod(A, tsu(), "=="); tmp<fvMatrix<Type>> tC(new fvMatrix<Type>(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::fvMatrix<Type>> Foam::operator== { checkMethod(tA(), su, "=="); tmp<fvMatrix<Type>> 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::fvMatrix<Type>> Foam::operator== { checkMethod(tA(), tsu(), "=="); tmp<fvMatrix<Type>> 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::fvMatrix<Type>> Foam::operator== { checkMethod(tA(), tsu(), "=="); tmp<fvMatrix<Type>> 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::fvMatrix<Type>> Foam::operator== { checkMethod(A, su, "=="); tmp<fvMatrix<Type>> tC(new fvMatrix<Type>(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::fvMatrix<Type>> Foam::operator== { checkMethod(tA(), su, "=="); tmp<fvMatrix<Type>> 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::fvMatrix<Type>> Foam::operator- ) { tmp<fvMatrix<Type>> tC(new fvMatrix<Type>(A)); - tC().negate(); + tC.ref().negate(); return tC; } @@ -1601,7 +1602,7 @@ Foam::tmp<Foam::fvMatrix<Type>> Foam::operator- ) { tmp<fvMatrix<Type>> tC(tA.ptr()); - tC().negate(); + tC.ref().negate(); return tC; } @@ -1615,7 +1616,7 @@ Foam::tmp<Foam::fvMatrix<Type>> Foam::operator+ { checkMethod(A, B, "+"); tmp<fvMatrix<Type>> tC(new fvMatrix<Type>(A)); - tC() += B; + tC.ref() += B; return tC; } @@ -1628,7 +1629,7 @@ Foam::tmp<Foam::fvMatrix<Type>> Foam::operator+ { checkMethod(tA(), B, "+"); tmp<fvMatrix<Type>> tC(tA.ptr()); - tC() += B; + tC.ref() += B; return tC; } @@ -1641,7 +1642,7 @@ Foam::tmp<Foam::fvMatrix<Type>> Foam::operator+ { checkMethod(A, tB(), "+"); tmp<fvMatrix<Type>> tC(tB.ptr()); - tC() += A; + tC.ref() += A; return tC; } @@ -1654,7 +1655,7 @@ Foam::tmp<Foam::fvMatrix<Type>> Foam::operator+ { checkMethod(tA(), tB(), "+"); tmp<fvMatrix<Type>> tC(tA.ptr()); - tC() += tB(); + tC.ref() += tB(); tB.clear(); return tC; } @@ -1668,7 +1669,7 @@ Foam::tmp<Foam::fvMatrix<Type>> Foam::operator+ { checkMethod(A, su, "+"); tmp<fvMatrix<Type>> tC(new fvMatrix<Type>(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::fvMatrix<Type>> Foam::operator+ { checkMethod(A, tsu(), "+"); tmp<fvMatrix<Type>> tC(new fvMatrix<Type>(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::fvMatrix<Type>> Foam::operator+ { checkMethod(A, tsu(), "+"); tmp<fvMatrix<Type>> tC(new fvMatrix<Type>(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::fvMatrix<Type>> Foam::operator+ { checkMethod(tA(), su, "+"); tmp<fvMatrix<Type>> 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::fvMatrix<Type>> Foam::operator+ { checkMethod(tA(), tsu(), "+"); tmp<fvMatrix<Type>> 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::fvMatrix<Type>> Foam::operator+ { checkMethod(tA(), tsu(), "+"); tmp<fvMatrix<Type>> 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::fvMatrix<Type>> Foam::operator+ { checkMethod(A, su, "+"); tmp<fvMatrix<Type>> tC(new fvMatrix<Type>(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::fvMatrix<Type>> Foam::operator+ { checkMethod(A, tsu(), "+"); tmp<fvMatrix<Type>> tC(new fvMatrix<Type>(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::fvMatrix<Type>> Foam::operator+ { checkMethod(A, tsu(), "+"); tmp<fvMatrix<Type>> tC(new fvMatrix<Type>(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::fvMatrix<Type>> Foam::operator+ { checkMethod(tA(), su, "+"); tmp<fvMatrix<Type>> 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::fvMatrix<Type>> Foam::operator+ { checkMethod(tA(), tsu(), "+"); tmp<fvMatrix<Type>> 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::fvMatrix<Type>> Foam::operator+ { checkMethod(tA(), tsu(), "+"); tmp<fvMatrix<Type>> 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::fvMatrix<Type>> Foam::operator- { checkMethod(A, B, "-"); tmp<fvMatrix<Type>> tC(new fvMatrix<Type>(A)); - tC() -= B; + tC.ref() -= B; return tC; } @@ -1846,7 +1847,7 @@ Foam::tmp<Foam::fvMatrix<Type>> Foam::operator- { checkMethod(tA(), B, "-"); tmp<fvMatrix<Type>> tC(tA.ptr()); - tC() -= B; + tC.ref() -= B; return tC; } @@ -1859,8 +1860,8 @@ Foam::tmp<Foam::fvMatrix<Type>> Foam::operator- { checkMethod(A, tB(), "-"); tmp<fvMatrix<Type>> tC(tB.ptr()); - tC() -= A; - tC().negate(); + tC.ref() -= A; + tC.ref().negate(); return tC; } @@ -1873,7 +1874,7 @@ Foam::tmp<Foam::fvMatrix<Type>> Foam::operator- { checkMethod(tA(), tB(), "-"); tmp<fvMatrix<Type>> tC(tA.ptr()); - tC() -= tB(); + tC.ref() -= tB(); tB.clear(); return tC; } @@ -1887,7 +1888,7 @@ Foam::tmp<Foam::fvMatrix<Type>> Foam::operator- { checkMethod(A, su, "-"); tmp<fvMatrix<Type>> tC(new fvMatrix<Type>(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::fvMatrix<Type>> Foam::operator- { checkMethod(A, tsu(), "-"); tmp<fvMatrix<Type>> tC(new fvMatrix<Type>(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::fvMatrix<Type>> Foam::operator- { checkMethod(A, tsu(), "-"); tmp<fvMatrix<Type>> tC(new fvMatrix<Type>(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::fvMatrix<Type>> Foam::operator- { checkMethod(tA(), su, "-"); tmp<fvMatrix<Type>> 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::fvMatrix<Type>> Foam::operator- { checkMethod(tA(), tsu(), "-"); tmp<fvMatrix<Type>> 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::fvMatrix<Type>> Foam::operator- { checkMethod(tA(), tsu(), "-"); tmp<fvMatrix<Type>> 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::fvMatrix<Type>> Foam::operator- { checkMethod(A, su, "-"); tmp<fvMatrix<Type>> tC(new fvMatrix<Type>(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::fvMatrix<Type>> Foam::operator- { checkMethod(A, tsu(), "-"); tmp<fvMatrix<Type>> tC(new fvMatrix<Type>(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::fvMatrix<Type>> Foam::operator- { checkMethod(A, tsu(), "-"); tmp<fvMatrix<Type>> tC(new fvMatrix<Type>(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::fvMatrix<Type>> Foam::operator- { checkMethod(tA(), su, "-"); tmp<fvMatrix<Type>> 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::fvMatrix<Type>> Foam::operator- { checkMethod(tA(), tsu(), "-"); tmp<fvMatrix<Type>> 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::fvMatrix<Type>> Foam::operator- { checkMethod(tA(), tsu(), "-"); tmp<fvMatrix<Type>> 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::fvMatrix<Type>> Foam::operator+ { checkMethod(A, su, "+"); tmp<fvMatrix<Type>> tC(new fvMatrix<Type>(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::fvMatrix<Type>> Foam::operator+ { checkMethod(tA(), su, "+"); tmp<fvMatrix<Type>> 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::fvMatrix<Type>> Foam::operator+ { checkMethod(A, su, "+"); tmp<fvMatrix<Type>> tC(new fvMatrix<Type>(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::fvMatrix<Type>> Foam::operator+ { checkMethod(tA(), su, "+"); tmp<fvMatrix<Type>> 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::fvMatrix<Type>> Foam::operator- { checkMethod(A, su, "-"); tmp<fvMatrix<Type>> tC(new fvMatrix<Type>(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::fvMatrix<Type>> Foam::operator- { checkMethod(tA(), su, "-"); tmp<fvMatrix<Type>> 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::fvMatrix<Type>> Foam::operator- { checkMethod(A, su, "-"); tmp<fvMatrix<Type>> tC(new fvMatrix<Type>(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::fvMatrix<Type>> Foam::operator- { checkMethod(tA(), su, "-"); tmp<fvMatrix<Type>> 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::fvMatrix<Type>> Foam::operator* ) { tmp<fvMatrix<Type>> tC(new fvMatrix<Type>(A)); - tC() *= dsf; + tC.ref() *= dsf; return tC; } @@ -2175,7 +2176,7 @@ Foam::tmp<Foam::fvMatrix<Type>> Foam::operator* ) { tmp<fvMatrix<Type>> tC(new fvMatrix<Type>(A)); - tC() *= tdsf; + tC.ref() *= tdsf; return tC; } @@ -2187,7 +2188,7 @@ Foam::tmp<Foam::fvMatrix<Type>> Foam::operator* ) { tmp<fvMatrix<Type>> tC(new fvMatrix<Type>(A)); - tC() *= tvsf; + tC.ref() *= tvsf; return tC; } @@ -2199,7 +2200,7 @@ Foam::tmp<Foam::fvMatrix<Type>> Foam::operator* ) { tmp<fvMatrix<Type>> tC(tA.ptr()); - tC() *= dsf; + tC.ref() *= dsf; return tC; } @@ -2211,7 +2212,7 @@ Foam::tmp<Foam::fvMatrix<Type>> Foam::operator* ) { tmp<fvMatrix<Type>> tC(tA.ptr()); - tC() *= tdsf; + tC.ref() *= tdsf; return tC; } @@ -2223,7 +2224,7 @@ Foam::tmp<Foam::fvMatrix<Type>> Foam::operator* ) { tmp<fvMatrix<Type>> tC(tA.ptr()); - tC() *= tvsf; + tC.ref() *= tvsf; return tC; } @@ -2235,7 +2236,7 @@ Foam::tmp<Foam::fvMatrix<Type>> Foam::operator* ) { tmp<fvMatrix<Type>> tC(new fvMatrix<Type>(A)); - tC() *= ds; + tC.ref() *= ds; return tC; } @@ -2247,7 +2248,7 @@ Foam::tmp<Foam::fvMatrix<Type>> Foam::operator* ) { tmp<fvMatrix<Type>> tC(tA.ptr()); - tC() *= ds; + tC.ref() *= ds; return tC; } @@ -2277,7 +2278,7 @@ Foam::operator& extrapolatedCalculatedFvPatchScalarField::typeName ) ); - GeometricField<Type, fvPatchField, volMesh>& Mphi = tMphi(); + GeometricField<Type, fvPatchField, volMesh>& 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 7effdd1ef5abda35e87a1e9fbbb165628b15237e..46fa555289aa536ae1fd477089fec20a9bfafbcd 100644 --- a/src/finiteVolume/fvMatrices/fvScalarMatrix/fvScalarMatrix.C +++ b/src/finiteVolume/fvMatrices/fvScalarMatrix/fvScalarMatrix.C @@ -201,7 +201,7 @@ Foam::tmp<Foam::scalarField> Foam::fvMatrix<Foam::scalar>::residual() const ) ); - addBoundarySource(tres()); + addBoundarySource(tres.ref()); return tres; } @@ -227,7 +227,7 @@ Foam::tmp<Foam::volScalarField> Foam::fvMatrix<Foam::scalar>::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::volScalarField> Foam::fvMatrix<Foam::scalar>::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 a14c06c71099dc5a3a2e124ef3335bda4cb6379a..7fe2202afec526539dce2344d3c15739afeaf813 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<Type, fvsPatchField, surfaceMesh>& sf = tsfCorr(); + GeometricField<Type, fvsPatchField, surfaceMesh>& 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 0607c8e4e080da9679ed0724c51dc57415a3d763..fe06177ec4e3cfd4bf26787a0c6e9fe146b714b1 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<Type, fvsPatchField, surfaceMesh>& sf = tsfCorr(); + GeometricField<Type, fvsPatchField, surfaceMesh>& 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 d6b47a56b29ec267bf481b08dc09b825d2ba45d8..e1530b0b36c29ff2513e8cfac60cc3c67ea55540 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<Type, fvPatchField, volMesh>& sf = tsfCorr(); + GeometricField<Type, fvPatchField, volMesh>& sf = tsfCorr.ref(); // cells forAll(sf, cellI) diff --git a/src/finiteVolume/fvMesh/fvMesh.C b/src/finiteVolume/fvMesh/fvMesh.C index 22f12198d851a8c43c8835d295e2257e7b7b793a..a6ccd8ab03c878fdf599181be32bc3e695907b55 100644 --- a/src/finiteVolume/fvMesh/fvMesh.C +++ b/src/finiteVolume/fvMesh/fvMesh.C @@ -761,7 +761,7 @@ Foam::tmp<Foam::scalarField> Foam::fvMesh::movePoints(const pointField& p) scalar rDeltaT = 1.0/time().deltaTValue(); tmp<scalarField> 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 17bb30ec0551ead93c8691e76f90d7791a14867b..8cdeca38a43e971ae3b8cf27ad6aded7197605c7 100644 --- a/src/finiteVolume/fvMesh/fvMeshGeometry.C +++ b/src/finiteVolume/fvMesh/fvMeshGeometry.C @@ -399,7 +399,7 @@ Foam::tmp<Foam::surfaceVectorField> 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 5b6ed73144675f19d52bac221012e407d7e9180f..9b5a2aaf4459f1c4735ff7924c75e9aee4ae91d6 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::vectorField> Foam::cyclicFvPatch::delta() const const vectorField nbrPatchD(neighbFvPatch().coupledFvPatch::delta()); tmp<vectorField> 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 b87157e34335a9914a7999cbd612c130733f350d..ed1d97fb19c941f3d321750b6c84da908f7fa13b 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::vectorField> Foam::cyclicACMIFvPatch::delta() const nbrPatchD -= nbrPatchD0; tmp<vectorField> 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 5d8935139df4c38d726ef9fc50338d5413c9584b..69e940d12fb87fb7aaa4bacd165cd7336dd83d38 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::vectorField> Foam::cyclicAMIFvPatch::delta() const const vectorField& nbrPatchD = tnbrPatchD(); tmp<vectorField> 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 d7f1bcd39e4e5756f15402ecc1096e6769bb10e1..a3a9a2dd77c1f73dc69b7dca00bab5e97c9c2e06 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::vectorField> Foam::fvPatch::Cn() const { tmp<vectorField> 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 21e931f01c5747bcff5ee27f0ccc2461589127a2..f3862fdc0a9b0542384c4f0bc98d2f945fe3dfee 100644 --- a/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatchTemplates.C +++ b/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatchTemplates.C @@ -34,7 +34,7 @@ Foam::tmp<Foam::Field<Type>> Foam::fvPatch::patchInternalField ) const { tmp<Field<Type>> tpif(new Field<Type>(size())); - Field<Type>& pif = tpif(); + Field<Type>& 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 d93e64dea6ee2f664725cd933658e2e2ac8e325e..03e03c6dfebf21ebbb6d2a686b2190c2317c0d55 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 b84c345a140a4a1cb2dd3abd8a9fdfb19411d37a..8b2131ea3e6f17aadda6be22ef9b58bb2a173804 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 8342412460d37e3c268c4c1789ff405bc32ba9a8..8b523015e14c6a2cdcf5710bcef0e409a764d968 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<Type, Limiter, LimitFunc>::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 28cc9fa1dbb522d513557de4b8dee70101c08723..3101d60893e3fb134b9d28400cec4fac0bce72a8 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<Type, PhiLimiter>::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 9b26d679adaedd87a1dcaf7cb80c3122f4e78b64..138fad0ee760487a563954035b80ca4d5493ba79 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<Type>::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 b704841a40dc1557218426de64a8a0c3f4479c0e..59ffd4bac333dea891effae485c40bab4e495451 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 f8f1397711ee06fc0a1c225569056e1884ddbfb1..253157431578274d5b935603b08a7098d55129ff 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<Type>::interpolate(vf, kSc, -kSc) ) ); - GeometricField<Type, fvsPatchField, surfaceMesh>& sfCorr = - tsfCorr(); + tsfCorr.ref(); for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++) { diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearUpwind/linearUpwind.C b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearUpwind/linearUpwind.C index a2a81508fb72a372d5c84ed53d2408b775d72d9c..aa7d4482b8e786c402c8f52bf51b17d9328a7b38 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<Type>::correction ) ); - GeometricField<Type, fvsPatchField, surfaceMesh>& sfCorr = tsfCorr(); + GeometricField<Type, fvsPatchField, surfaceMesh>& 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 85fc6a9594db7a5f6406ce67776f79d27c9bd6ad..fce527802ca8f07773860b7715befe18264ebcf8 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<Type>::correction ) ); - GeometricField<Type, fvsPatchField, surfaceMesh>& sfCorr = tsfCorr(); + GeometricField<Type, fvsPatchField, surfaceMesh>& 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 d0cc9fba86cf3d5d42dd3254a6a7cd3444a8051c..e081db91e0b9c66fc8d3d3c1b036bc063b27b591 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<Type, fvsPatchField, surfaceMesh>& vff = tvff(); + GeometricField<Type, fvsPatchField, surfaceMesh>& 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 598e45c791e79e37e855b5d6f59fd2dc9fbc0d4c..7099656dddb7883cc064faee1faedfb954d2063a 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<Type, fvsPatchField, surfaceMesh>& vff = tvff(); + GeometricField<Type, fvsPatchField, surfaceMesh>& 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 1841b832db398ffb7fa60b579ce7bcbca1a7dd1c..021abd76859a382728f02dcc81913e995f68c09f 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 49a70b70014f48aedc72a2bc8a1f80c4f6012b93..819347a9721f906cdea43925f68036afe341ac90 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<surfaceScalarField> 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<Type, fvsPatchField, surfaceMesh>& 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 7b6d3048e5645a743bceffacf720f63bdb590638..98a7cdbf419ad5d7c4899b3758ed84d1ed9e257d 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<GeometricField<Type, fvsPatchField, surfaceMesh>> tsfCorr = linearInterpolate(vf); - Field<Type>& sfCorr = tsfCorr().internalField(); + Field<Type>& sfCorr = tsfCorr.ref().internalField(); const pointField& points = mesh.points(); const pointField& C = mesh.C().internalField(); @@ -104,7 +104,7 @@ correction typename GeometricField<Type, fvsPatchField, surfaceMesh>:: - 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 3f3cae05fedc836c7db478aba8e0e0b92f27f78f..e84e66f2512a3d636acce3c9f3fc94a11478477c 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 aab20dac76e6cf34a2689f77d8412c7a3bd921d8..1f568e6315799be89989afc38aec3dbc24bf5662 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<pTraits<Type>::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 43bcbe9d1cfa91fbff7e38eccd514d884d3aeab0..d871edb6e24bcbccebe2cc18d105e53df1fbb409 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.C @@ -178,7 +178,7 @@ Foam::surfaceInterpolationScheme<Type>::interpolate vf.dimensions() ) ); - GeometricField<Type, fvsPatchField, surfaceMesh>& sf = tsf(); + GeometricField<Type, fvsPatchField, surfaceMesh>& sf = tsf.ref(); Field<Type>& sfi = sf.internalField(); @@ -256,7 +256,7 @@ Foam::surfaceInterpolationScheme<Type>::interpolate vf.dimensions() ) ); - GeometricField<Type, fvsPatchField, surfaceMesh>& sf = tsf(); + GeometricField<Type, fvsPatchField, surfaceMesh>& sf = tsf.ref(); Field<Type>& sfi = sf.internalField(); @@ -273,7 +273,7 @@ Foam::surfaceInterpolationScheme<Type>::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<Type>::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 84f41bba62caf66ef5dd85517bc1b2903d972804..79bdc2a29af6b6cb190cab96a7d90ce6a5576899 100644 --- a/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolate.C +++ b/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolate.C @@ -167,7 +167,7 @@ Foam::tmp<Foam::Field<Type>> Foam::volPointInterpolation::flatBoundaryField ( new Field<Type>(mesh.nFaces()-mesh.nInternalFaces()) ); - Field<Type>& boundaryVals = tboundaryVals(); + Field<Type>& 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 ce776051c1146f44cf00b526da76c0a90292a744..6b2f0ae6920356e4a5aa677b398f2fad36553b0a 100644 --- a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C +++ b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C @@ -1292,7 +1292,7 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToSource ( fld, multiplyWeightedOp<Type, CombineOp>(cop), - tresult(), + tresult.ref(), defaultValues ); @@ -1337,7 +1337,7 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToTarget ( fld, multiplyWeightedOp<Type, CombineOp>(cop), - tresult(), + tresult.ref(), defaultValues ); diff --git a/src/meshTools/triSurface/triSurfaceTools/pointToPointPlanarInterpolationTemplates.C b/src/meshTools/triSurface/triSurfaceTools/pointToPointPlanarInterpolationTemplates.C index 4b9f3b2dc26ea9d40ff042c3151e585248570abd..03c34e0e49cfb73cab12456170e9ebc4c7e3f5b8 100644 --- a/src/meshTools/triSurface/triSurfaceTools/pointToPointPlanarInterpolationTemplates.C +++ b/src/meshTools/triSurface/triSurfaceTools/pointToPointPlanarInterpolationTemplates.C @@ -42,7 +42,7 @@ Foam::tmp<Foam::Field<Type>> Foam::pointToPointPlanarInterpolation::interpolate } tmp<Field<Type>> tfld(new Field<Type>(nearestVertex_.size())); - Field<Type>& fld = tfld(); + Field<Type>& fld = tfld.ref(); forAll(fld, i) {