Commit f4ba71dd authored by Henry Weller's avatar Henry Weller
Browse files

OpenFOAM libraries: Updated to use the new const-safe tmp

parent e1405f22
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -39,6 +39,7 @@ Description
#include "mapPolyMesh.H"
#include "polyTopoChange.H"
#include "fvcDiv.H"
#include "zeroGradientFvPatchFields.H"
#include "Random.H"
using namespace Foam;
......
......@@ -609,7 +609,7 @@ template<class Type>
Foam::tmp<Foam::Field<Type>> Foam::Field<Type>::T() const
{
tmp<Field<Type>> transpose(new Field<Type>(this->size()));
::Foam::T(transpose(), *this);
::Foam::T(transpose.ref(), *this);
return transpose;
}
......
......@@ -92,7 +92,7 @@ Foam::tmp<GeoField> Foam::uniformInterpolate
// Interpolate
tmp<GeoField> tfld(new GeoField(fieldIO, weights[0]*field0));
GeoField& fld = tfld();
GeoField& fld = tfld.ref();
for (label i = 1; i < times.size(); ++i)
{
......
......@@ -192,7 +192,7 @@ tmp<Field<Type>> PrimitivePatchInterpolation<Patch>::faceToPointInterpolate
)
);
Field<Type>& result = tresult();
Field<Type>& result = tresult.ref();
const labelListList& pointFaces = patch_.pointFaces();
const scalarListList& weights = faceToPointWeights();
......@@ -249,7 +249,7 @@ tmp<Field<Type>> PrimitivePatchInterpolation<Patch>::pointToFaceInterpolate
)
);
Field<Type>& result = tresult();
Field<Type>& result = tresult.ref();
const List<typename Patch::FaceType>& localFaces = patch_.localFaces();
......@@ -303,7 +303,7 @@ tmp<Field<Type>> PrimitivePatchInterpolation<Patch>::faceToEdgeInterpolate
new Field<Type>(patch_.nEdges(), pTraits<Type>::zero)
);
Field<Type>& result = tresult();
Field<Type>& result = tresult.ref();
const edgeList& edges = patch_.edges();
const labelListList& edgeFaces = patch_.edgeFaces();
......
......@@ -159,7 +159,7 @@ Foam::PatchTools::pointNormals
// to avoid them being stored)
tmp<pointField> textrudeN(new pointField(p.nPoints(), vector::zero));
pointField& extrudeN = textrudeN();
pointField& extrudeN = textrudeN.ref();
{
const faceList& localFaces = p.localFaces();
const vectorField& faceNormals = p.faceNormals();
......@@ -213,7 +213,7 @@ Foam::PatchTools::edgeNormals
// 1. Start off with local normals
tmp<pointField> tedgeNormals(new pointField(p.nEdges(), vector::zero));
pointField& edgeNormals = tedgeNormals();
pointField& edgeNormals = tedgeNormals.ref();
{
const labelListList& edgeFaces = p.edgeFaces();
const vectorField& faceNormals = p.faceNormals();
......
......@@ -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
......@@ -161,7 +161,7 @@ void FSD<CombThermoType, ThermoType>::calculateSourceNorm()
)
);
volScalarField& pc = tPc();
volScalarField& pc = tPc.ref();
tmp<volScalarField> tomegaFuel
(
......@@ -185,7 +185,7 @@ void FSD<CombThermoType, ThermoType>::calculateSourceNorm()
)
);
volScalarField& omegaFuelBar = tomegaFuel();
volScalarField& omegaFuelBar = tomegaFuel.ref();
// Calculation of the mixture fraction variance (ftVar)
const compressible::LESModel& lesModel =
......@@ -311,7 +311,7 @@ void FSD<CombThermoType, ThermoType>::calculateSourceNorm()
)
);
volScalarField& products = tproducts();
volScalarField& products = tproducts.ref();
forAll(productsIndex, j)
{
......
......@@ -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
......@@ -102,7 +102,7 @@ Foam::tmp<Foam::volScalarField> Foam::consumptionSpeed::omega0Sigma
)
);
volScalarField& omega0 = tomega0();
volScalarField& omega0 = tomega0.ref();
volScalarField::InternalField& iomega0 = omega0.internalField();
......
EXE_INC = \
EXE_INC = -DCONST_TMP \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
......
......@@ -119,7 +119,7 @@ Foam::combustionModels::laminar<Type>::R(volScalarField& Y) const
{
tmp<fvScalarMatrix> tSu(new fvScalarMatrix(Y, dimMass/dimTime));
fvScalarMatrix& Su = tSu();
fvScalarMatrix& Su = tSu.ref();
if (this->active())
{
......@@ -157,7 +157,7 @@ Foam::combustionModels::laminar<Type>::dQ() const
if (this->active())
{
tdQ() = this->chemistryPtr_->dQ();
tdQ.ref() = this->chemistryPtr_->dQ();
}
return tdQ;
......@@ -188,7 +188,7 @@ Foam::combustionModels::laminar<Type>::Sh() const
if (this->active())
{
tSh() = this->chemistryPtr_->Sh();
tSh.ref() = this->chemistryPtr_->Sh();
}
return tSh;
......
......@@ -160,7 +160,7 @@ singleStepCombustion<CombThermoType, ThermoType>::dQ() const
if (this->active())
{
volScalarField& dQ = tdQ();
volScalarField& dQ = tdQ.ref();
dQ.dimensionedInternalField() = this->mesh().V()*Sh()();
}
return tdQ;
......
EXE_INC = \
EXE_INC = -DCONST_TMP \
-I$(LIB_SRC)/fileFormats/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
......
EXE_INC = \
EXE_INC = -DCONST_TMP \
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
......
EXE_INC = \
EXE_INC = -DCONST_TMP \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/triSurface/lnInclude \
......
......@@ -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 @@ Foam::tmp<Foam::vectorField> Foam::layerAdditionRemoval::extrusionDir() const
const labelList& mp = masterFaceLayer.meshPoints();
tmp<vectorField> textrusionDir(new vectorField(mp.size()));
vectorField& extrusionDir = textrusionDir();
vectorField& extrusionDir = textrusionDir.ref();
if (setLayerPairing())
{
......
......@@ -119,7 +119,7 @@ Foam::tmp<Foam::scalarField> Foam::motionSmootherAlgo::calcEdgeWeights
const edgeList& edges = mesh_.edges();
tmp<scalarField> twght(new scalarField(edges.size()));
scalarField& wght = twght();
scalarField& wght = twght.ref();
forAll(edges, edgeI)
{
......@@ -815,7 +815,7 @@ Foam::tmp<Foam::pointField> Foam::motionSmootherAlgo::curPoints() const
tmp<pointField> tnewPoints(oldPoints_ + totalDisplacement.internalField());
// Correct for 2-D motion
modifyMotionPoints(tnewPoints());
modifyMotionPoints(tnewPoints.ref());
return tnewPoints;
}
......
......@@ -159,7 +159,7 @@ Foam::motionSmootherAlgo::avg
dimensioned<Type>("zero", fld.dimensions(), pTraits<Type>::zero)
)
);
GeometricField<Type, pointPatchField, pointMesh>& res = tres();
GeometricField<Type, pointPatchField, pointMesh>& res = tres.ref();
const polyMesh& mesh = fld.mesh()();
......
EXE_INC = \
EXE_INC = -DCONST_TMP \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
......
......@@ -70,7 +70,7 @@ tmp<GeometricField<Type, fvPatchField, volMesh>> cellReduce
)
);
volFieldType& result = tresult();
volFieldType& result = tresult.ref();
const labelUList& own = mesh.owner();
const labelUList& nbr = mesh.neighbour();
......@@ -102,7 +102,8 @@ tmp<GeometricField<Type, fvPatchField, volMesh>> cellReduce
tmp<GeometricField<Type, fvPatchField, volMesh>>
tvf(cellReduce(cop, tssf));
tssf.clear();
tssf.clear();
return tvf;
}
......
......@@ -56,7 +56,7 @@ curl
tmp<GeometricField<Type, fvPatchField, volMesh>> tcurlVf =
2.0*(*skew(fvc::grad(vf, nameCurlVf)));
tcurlVf().rename(nameCurlVf);
tcurlVf.ref().rename(nameCurlVf);
return tcurlVf;
}
......
......@@ -78,7 +78,7 @@ reconstruct
)
);
treconField().correctBoundaryConditions();
treconField.ref().correctBoundaryConditions();
return treconField;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment