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

This commit is contained in:
Henry Weller
2016-02-26 08:13:59 +00:00
parent e1405f2260
commit f4ba71ddd0
163 changed files with 346 additions and 346 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -184,7 +184,7 @@ Foam::cyclicACMIGAMGInterface::internalFieldTransfer
const labelUList& nbrFaceCells = nbr.faceCells();
tmp<labelField> tpnf(new labelField(nbrFaceCells.size()));
labelField& pnf = tpnf();
labelField& pnf = tpnf.ref();
forAll(pnf, facei)
{

View File

@ -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
@ -183,7 +183,7 @@ Foam::tmp<Foam::labelField> Foam::cyclicAMIGAMGInterface::internalFieldTransfer
const labelUList& nbrFaceCells = nbr.faceCells();
tmp<labelField> tpnf(new labelField(nbrFaceCells.size()));
labelField& pnf = tpnf();
labelField& pnf = tpnf.ref();
forAll(pnf, facei)
{

View File

@ -1,4 +1,4 @@
EXE_INC = \
EXE_INC = -DCONST_TMP \
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/surfMesh/lnInclude \
-I$(LIB_SRC)/fileFormats/lnInclude

View File

@ -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
@ -47,7 +47,7 @@ Foam::tmp<Foam::scalarField> Foam::cellQuality::nonOrthogonality() const
)
);
scalarField& result = tresult();
scalarField& result = tresult.ref();
scalarField sumArea(mesh_.nCells(), 0.0);
@ -108,7 +108,7 @@ Foam::tmp<Foam::scalarField> Foam::cellQuality::skewness() const
mesh_.nCells(), 0.0
)
);
scalarField& result = tresult();
scalarField& result = tresult.ref();
scalarField sumArea(mesh_.nCells(), 0.0);
@ -187,7 +187,7 @@ Foam::tmp<Foam::scalarField> Foam::cellQuality::faceNonOrthogonality() const
mesh_.nFaces(), 0.0
)
);
scalarField& result = tresult();
scalarField& result = tresult.ref();
const vectorField& centres = mesh_.cellCentres();
@ -247,7 +247,7 @@ Foam::tmp<Foam::scalarField> Foam::cellQuality::faceSkewness() const
mesh_.nFaces(), 0.0
)
);
scalarField& result = tresult();
scalarField& result = tresult.ref();
const vectorField& cellCtrs = mesh_.cellCentres();

View File

@ -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
@ -128,7 +128,7 @@ transformVector
) const
{
tmp<symmTensorField> tfld(new symmTensorField(st.size()));
symmTensorField& fld = tfld();
symmTensorField& fld = tfld.ref();
forAll(fld, i)
{

View File

@ -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 @@ transformVector
) const
{
tmp<symmTensorField> tfld(new symmTensorField(st.size()));
symmTensorField& fld = tfld();
symmTensorField& fld = tfld.ref();
forAll(fld, i)
{

View File

@ -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
@ -232,7 +232,7 @@ Foam::tmp<Foam::symmTensorField> Foam::axesRotation::transformVector
) const
{
tmp<symmTensorField> tfld(new symmTensorField(st.size()));
symmTensorField& fld = tfld();
symmTensorField& fld = tfld.ref();
forAll(fld, i)
{

View File

@ -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
@ -304,7 +304,7 @@ Foam::tmp<Foam::tensorField> Foam::cylindrical::transformTensor
const tensorField& R = Rptr_();
const tensorField Rtr(R.T());
tmp<tensorField> tt(new tensorField(cellMap.size()));
tensorField& t = tt();
tensorField& t = tt.ref();
forAll(cellMap, i)
{
const label cellI = cellMap[i];
@ -328,7 +328,7 @@ Foam::tmp<Foam::symmTensorField> Foam::cylindrical::transformVector
}
tmp<symmTensorField> tfld(new symmTensorField(Rptr_->size()));
symmTensorField& fld = tfld();
symmTensorField& fld = tfld.ref();
const tensorField& R = Rptr_();
forAll(fld, i)

View File

@ -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
@ -208,7 +208,7 @@ Foam::tmp<Foam::vectorField> Foam::cylindricalCS::globalToLocal
);
tmp<vectorField> tresult(new vectorField(lc.size()));
vectorField& result = tresult();
vectorField& result = tresult.ref();
result.replace
(

View File

@ -99,7 +99,7 @@ Foam::tmp<Foam::pointField> Foam::mappedPatchBase::facePoints
// Initialise to face-centre
tmp<pointField> tfacePoints(new pointField(patch_.size()));
pointField& facePoints = tfacePoints();
pointField& facePoints = tfacePoints.ref();
forAll(pp, faceI)
{
@ -867,7 +867,7 @@ Foam::tmp<Foam::pointField> Foam::mappedPatchBase::readListOrField
)
{
tmp<pointField> tfld(new pointField());
pointField& fld = tfld();
pointField& fld = tfld.ref();
if (size)
{
@ -1267,7 +1267,7 @@ Foam::tmp<Foam::pointField> Foam::mappedPatchBase::samplePoints
) const
{
tmp<pointField> tfld(new pointField(fc));
pointField& fld = tfld();
pointField& fld = tfld.ref();
switch (offsetMode_)
{

View File

@ -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
@ -306,7 +306,7 @@ Foam::tmp<Foam::tensorField> Foam::momentOfInertia::meshInertia
{
tmp<tensorField> tTf = tmp<tensorField>(new tensorField(mesh.nCells()));
tensorField& tf = tTf();
tensorField& tf = tTf.ref();
forAll(tf, cI)
{

View File

@ -223,7 +223,7 @@ const Foam::wordList& Foam::searchableBox::regions() const
Foam::tmp<Foam::pointField> Foam::searchableBox::coordinates() const
{
tmp<pointField> tCtrs = tmp<pointField>(new pointField(6));
pointField& ctrs = tCtrs();
pointField& ctrs = tCtrs.ref();
const pointField pts(treeBoundBox::points());
const faceList& fcs = treeBoundBox::faces;

View File

@ -30,10 +30,8 @@ License
namespace Foam
{
defineTypeNameAndDebug(searchableCylinder, 0);
addToRunTimeSelectionTable(searchableSurface, searchableCylinder, dict);
defineTypeNameAndDebug(searchableCylinder, 0);
addToRunTimeSelectionTable(searchableSurface, searchableCylinder, dict);
}
@ -67,7 +65,7 @@ void Foam::searchableCylinder::boundingSpheres
Foam::tmp<Foam::pointField> Foam::searchableCylinder::points() const
{
tmp<pointField> tPts(new pointField(2));
pointField& pts = tPts();
pointField& pts = tPts.ref();
pts[0] = point1_;
pts[1] = point2_;

View File

@ -298,7 +298,7 @@ void Foam::searchablePlate::boundingSpheres
Foam::tmp<Foam::pointField> Foam::searchablePlate::points() const
{
tmp<pointField> tPts(new pointField(4));
pointField& pts = tPts();
pointField& pts = tPts.ref();
pts[0] = origin_;
pts[2] = origin_ + span_;

View File

@ -325,7 +325,7 @@ Foam::tmp<Foam::pointField>
Foam::searchableSurfaceCollection::coordinates() const
{
tmp<pointField> tCtrs = tmp<pointField>(new pointField(size()));
pointField& ctrs = tCtrs();
pointField& ctrs = tCtrs.ref();
// Append individual coordinates
label coordI = 0;
@ -400,7 +400,7 @@ Foam::searchableSurfaceCollection::points() const
}
tmp<pointField> tPts(new pointField(nPoints));
pointField& pts = tPts();
pointField& pts = tPts.ref();
// Append individual coordinates
nPoints = 0;

View File

@ -382,7 +382,7 @@ void Foam::triSurfaceMesh::clearOut()
Foam::tmp<Foam::pointField> Foam::triSurfaceMesh::coordinates() const
{
tmp<pointField> tPts(new pointField(8));
pointField& pt = tPts();
pointField& pt = tPts.ref();
// Use copy to calculate face centres so they don't get stored
pt = PrimitivePatch<triSurface::FaceType, SubList, const pointField&>

View File

@ -197,7 +197,7 @@ void Foam::pointToPointPlanarInterpolation::calcWeights
(
referenceCS_.localPosition(sourcePoints)
);
vectorField& localVertices = tlocalVertices();
vectorField& localVertices = tlocalVertices.ref();
const boundBox bb(localVertices, true);
const point bbMid(bb.midpoint());