GeometricField::internalField() -> GeometricField::internalFieldRef()

Non-const access to the internal field now obtained from a specifically
named access function consistent with the new names for non-canst access
to the boundary field boundaryFieldRef() and dimensioned internal field
dimensionedInternalFieldRef().

See also commit 22f4ad32b1
This commit is contained in:
Henry Weller
2016-04-30 14:25:21 +01:00
parent 67e2d02800
commit 5df2b96489
105 changed files with 356 additions and 309 deletions

View File

@ -61,7 +61,7 @@ int main(int argc, char *argv[])
{
Info<< "Time = " << runTime.timeName() << nl << endl;
force.internalField() = ReImSum
force.internalFieldRef() = ReImSum
(
fft::reverseTransform
(

View File

@ -105,7 +105,7 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::basicSubGrid::XiEq() const
mesh,
dimensionedScalar("zero", Nv.dimensions(), 0.0)
);
N.internalField() = Nv.internalField()*Cw;
N.internalFieldRef() = Nv.internalField()*Cw;
volSymmTensorField ns
(
@ -125,7 +125,7 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::basicSubGrid::XiEq() const
Zero
)
);
ns.internalField() = nsv.internalField()*Cw;
ns.internalFieldRef() = nsv.internalField()*Cw;
volScalarField n(max(N - (Uhat & ns & Uhat), scalar(1e-4)));
volScalarField b((Uhat & B_ & Uhat)/sqrt(n));

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
@ -74,7 +74,7 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::Gulder::XiEq() const
if (subGridSchelkin_)
{
up.internalField() += calculateSchelkinEffect(uPrimeCoef_);
up.internalFieldRef() += calculateSchelkinEffect(uPrimeCoef_);
}
volScalarField tauEta(sqrt(mag(thermo_.muu()/(thermo_.rhou()*epsilon))));

View File

@ -82,7 +82,7 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::SCOPEXiEq::XiEq() const
volScalarField up(sqrt((2.0/3.0)*k));
if (subGridSchelkin_)
{
up.internalField() += calculateSchelkinEffect(uPrimeCoef_);
up.internalFieldRef() += calculateSchelkinEffect(uPrimeCoef_);
}
volScalarField l(lCoef_*sqrt(3.0/2.0)*up*k/epsilon);

View File

@ -114,7 +114,7 @@ Foam::XiEqModel::calculateSchelkinEffect(const scalar uPrimeCoef) const
)
);
volScalarField& N = tN.ref();
N.internalField() = Nv.internalField()*pow(mesh.V(), 2.0/3.0);
N.internalFieldRef() = Nv.internalField()*pow(mesh.V(), 2.0/3.0);
volSymmTensorField ns
(
@ -134,7 +134,7 @@ Foam::XiEqModel::calculateSchelkinEffect(const scalar uPrimeCoef) const
Zero
)
);
ns.internalField() = nsv.internalField()*pow(mesh.V(), 2.0/3.0);
ns.internalFieldRef() = nsv.internalField()*pow(mesh.V(), 2.0/3.0);
const volVectorField Uhat
(
@ -150,7 +150,7 @@ Foam::XiEqModel::calculateSchelkinEffect(const scalar uPrimeCoef) const
const scalarField deltaUp(upLocal*(max(scalar(1.0), pow(nr, 0.5)) - 1.0));
// Re use tN
N.internalField() = upLocal*(max(scalar(1.0), pow(nr, 0.5)) - 1.0);
N.internalFieldRef() = upLocal*(max(scalar(1.0), pow(nr, 0.5)) - 1.0);
return tN;
}

View File

@ -61,7 +61,7 @@
)
);
aniAlphas[i].internalField() =
aniAlphas[i].internalFieldRef() =
coordinates[i].R().transformVector(tkappaByCp());
aniAlphas[i].correctBoundaryConditions();

View File

@ -14,7 +14,7 @@ if (!thermo.isotropic())
tmp<volVectorField> tkappaByCp = thermo.Kappa()/cp;
const coordinateSystem& coodSys = coordinates[i];
aniAlpha.internalField() =
aniAlpha.internalFieldRef() =
coodSys.R().transformVector(tkappaByCp());
aniAlpha.correctBoundaryConditions();

View File

@ -107,7 +107,7 @@ int main(int argc, char *argv[])
zeroGradientFvPatchVectorField::typeName
);
cloudVolSUSu.internalField() = -cloudSU.source()/mesh.V();
cloudVolSUSu.internalFieldRef() = -cloudSU.source()/mesh.V();
cloudVolSUSu.correctBoundaryConditions();
cloudSU.source() = Zero;

View File

@ -104,7 +104,7 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::segregated::K() const
dimensionedScalar("L", dimLength, 0),
zeroGradientFvPatchField<scalar>::typeName
);
L.internalField() = cbrt(mesh.V());
L.internalFieldRef() = cbrt(mesh.V());
L.correctBoundaryConditions();
volScalarField I

View File

@ -104,7 +104,7 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::segregated::K() const
dimensionedScalar("L", dimLength, 0),
zeroGradientFvPatchField<scalar>::typeName
);
L.internalField() = cbrt(mesh.V());
L.internalFieldRef() = cbrt(mesh.V());
L.correctBoundaryConditions();
volScalarField I

View File

@ -87,7 +87,7 @@ int main(int argc, char *argv[])
mesh,
dimensionedScalar("aggomeration", dimless, 0.0)
);
scalarField& fld = scalarAgglomeration.internalField();
scalarField& fld = scalarAgglomeration.internalFieldRef();
forAll(fld, celli)
{
fld[celli] = cellToCoarse[celli];
@ -166,7 +166,7 @@ int main(int argc, char *argv[])
mesh,
dimensionedScalar("aggomeration", dimless, 0.0)
);
scalarField& fld = scalarAgglomeration.internalField();
scalarField& fld = scalarAgglomeration.internalFieldRef();
forAll(fld, celli)
{
fld[celli] = cellToCoarse[celli];

View File

@ -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
@ -164,7 +164,7 @@ int main(int argc, char *argv[])
dimensionedScalar("one", dimless, 1.0),
calculatedPointPatchScalarField::typeName
);
pointX.internalField() = mesh.points().component(0);
pointX.internalFieldRef() = mesh.points().component(0);
pointX.correctBoundaryConditions();
Info<< "Writing x-component field "
<< pointX.name() << " in " << runTime.timeName() << endl;

View File

@ -86,7 +86,7 @@ int main(int argc, char *argv[])
patchFieldTypes
);
cc.internalField() = mesh.C().internalField();
cc.internalFieldRef() = mesh.C().internalField();
cc.boundaryFieldRef().updateCoeffs();
forAll(cc.boundaryField(), patchi)

View File

@ -1137,7 +1137,7 @@ void Foam::conformalVoronoiMesh::writeCellSizes
zeroGradientFvPatchScalarField::typeName
);
scalarField& cellSize = targetCellSize.internalField();
scalarField& cellSize = targetCellSize.internalFieldRef();
const vectorField& C = mesh.cellCentres();
@ -1163,7 +1163,7 @@ void Foam::conformalVoronoiMesh::writeCellSizes
// zeroGradientFvPatchScalarField::typeName
// );
// targetCellVolume.internalField() = pow3(cellSize);
// targetCellVolume.internalFieldRef() = pow3(cellSize);
// Info<< nl << "Create actualCellVolume volScalarField" << endl;
@ -1182,7 +1182,7 @@ void Foam::conformalVoronoiMesh::writeCellSizes
// zeroGradientFvPatchScalarField::typeName
// );
// actualCellVolume.internalField() = mesh.cellVolumes();
// actualCellVolume.internalFieldRef() = mesh.cellVolumes();
// Info<< nl << "Create equivalentCellSize volScalarField" << endl;
@ -1201,7 +1201,7 @@ void Foam::conformalVoronoiMesh::writeCellSizes
// zeroGradientFvPatchScalarField::typeName
// );
// equivalentCellSize.internalField() = pow
// equivalentCellSize.internalFieldRef() = pow
// (
// actualCellVolume.internalField(),
// 1.0/3.0
@ -1247,7 +1247,7 @@ void Foam::conformalVoronoiMesh::writeCellSizes
// pointPatchVectorField::calculatedType()
// );
// scalarField& cellSize = ptTargetCellSize.internalField();
// scalarField& cellSize = ptTargetCellSize.internalFieldRef();
// const vectorField& P = tetMesh.points();
@ -1283,7 +1283,7 @@ void Foam::conformalVoronoiMesh::writeCellAlignments
// zeroGradientFvPatchTensorField::typeName
// );
//
// tensorField& cellAlignment = cellAlignments.internalField();
// tensorField& cellAlignment = cellAlignments.internalFieldRef();
//
// const vectorField& C = mesh.cellCentres();
//

View File

@ -117,16 +117,14 @@ bool Foam::conformalVoronoiMesh::distributeBackground(const Triangulation& mesh)
}
}
scalarField& cwi = cellWeights.internalFieldRef();
forAll(cellVertices, cI)
{
// Give a small but finite weight for empty cells. Some
// decomposition methods have difficulty with integer overflows in
// the sum of the normalised weight field.
cellWeights.internalField()[cI] = max
(
cellVertices[cI],
1e-2
);
cwi[cI] = max(cellVertices[cI], 1e-2);
}
autoPtr<mapDistributePolyMesh> mapDist = decomposition_().distribute

View File

@ -636,7 +636,7 @@ int main(int argc, char *argv[])
{
// Internal field
cellDistance.internalField() = signedDistance
cellDistance.internalFieldRef() = signedDistance
(
distSqr,
fvm.C(),
@ -701,7 +701,7 @@ int main(int argc, char *argv[])
-sqr(GREAT) // null value
);
pointDistance.internalField() = signedDistance
pointDistance.internalFieldRef() = signedDistance
(
pointDistSqr,
fvm.points(),

View File

@ -91,7 +91,7 @@ void ReadAndMapFields
)
);
Field<Type>& fld = tetFields[i].internalField();
Field<Type>& fld = tetFields[i].internalFieldRef();
// Map from read field. Set unmapped entries to nullValue.
fld.setSize(map.size(), nullValue);

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
@ -57,7 +57,7 @@ int main(int argc, char *argv[])
turbGen Ugen(K, Ea, k0);
U.internalField() = Ugen.U();
U.internalFieldRef() = Ugen.U();
U.correctBoundaryConditions();
Info<< "k("

View File

@ -88,7 +88,7 @@ bool setCellFieldType
if (selectedCells.size() == field.size())
{
field.internalField() = value;
field.internalFieldRef() = value;
}
else
{