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 a4e2afa4b3
This commit is contained in:
Henry Weller
2016-04-30 14:25:21 +01:00
parent 7155ef61ae
commit e1e996746b
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
{

View File

@ -50,7 +50,7 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::readFields
const dictionary& dict
)
{
DimensionedField<Type, GeoMesh>::readField(dict, "internalField");
Internal::readField(dict, "internalField");
boundaryField_.readField(*this, dict.subDict("boundaryField"));
@ -181,7 +181,7 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
const word& patchFieldType
)
:
DimensionedField<Type, GeoMesh>(io, mesh, ds, false),
Internal(io, mesh, ds, false),
timeIndex_(this->time().timeIndex()),
field0Ptr_(NULL),
fieldPrevIterPtr_(NULL),
@ -206,7 +206,7 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
const wordList& actualPatchTypes
)
:
DimensionedField<Type, GeoMesh>(io, mesh, ds, false),
Internal(io, mesh, ds, false),
timeIndex_(this->time().timeIndex()),
field0Ptr_(NULL),
fieldPrevIterPtr_(NULL),
@ -230,7 +230,7 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
const word& patchFieldType
)
:
DimensionedField<Type, GeoMesh>(io, mesh, dt, false),
Internal(io, mesh, dt, false),
timeIndex_(this->time().timeIndex()),
field0Ptr_(NULL),
fieldPrevIterPtr_(NULL),
@ -257,7 +257,7 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
const wordList& actualPatchTypes
)
:
DimensionedField<Type, GeoMesh>(io, mesh, dt, false),
Internal(io, mesh, dt, false),
timeIndex_(this->time().timeIndex()),
field0Ptr_(NULL),
fieldPrevIterPtr_(NULL),
@ -274,6 +274,30 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
}
template<class Type, template<class> class PatchField, class GeoMesh>
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
(
const IOobject& io,
const Internal& diField,
const PtrList<PatchField<Type>>& ptfl
)
:
Internal(io, diField),
timeIndex_(this->time().timeIndex()),
field0Ptr_(NULL),
fieldPrevIterPtr_(NULL),
boundaryField_(this->mesh().boundary(), *this, ptfl)
{
if (debug)
{
InfoInFunction
<< "Constructing from components" << endl << this->info() << endl;
}
readIfPresent();
}
template<class Type, template<class> class PatchField, class GeoMesh>
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
(
@ -284,7 +308,7 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
const PtrList<PatchField<Type>>& ptfl
)
:
DimensionedField<Type, GeoMesh>(io, mesh, ds, iField),
Internal(io, mesh, ds, iField),
timeIndex_(this->time().timeIndex()),
field0Ptr_(NULL),
fieldPrevIterPtr_(NULL),
@ -307,7 +331,7 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
const Mesh& mesh
)
:
DimensionedField<Type, GeoMesh>(io, mesh, dimless, false),
Internal(io, mesh, dimless, false),
timeIndex_(this->time().timeIndex()),
field0Ptr_(NULL),
fieldPrevIterPtr_(NULL),
@ -343,7 +367,7 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
const dictionary& dict
)
:
DimensionedField<Type, GeoMesh>(io, mesh, dimless, false),
Internal(io, mesh, dimless, false),
timeIndex_(this->time().timeIndex()),
field0Ptr_(NULL),
fieldPrevIterPtr_(NULL),
@ -378,7 +402,7 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
const GeometricField<Type, PatchField, GeoMesh>& gf
)
:
DimensionedField<Type, GeoMesh>(gf),
Internal(gf),
timeIndex_(gf.timeIndex()),
field0Ptr_(NULL),
fieldPrevIterPtr_(NULL),
@ -409,7 +433,7 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf
)
:
DimensionedField<Type, GeoMesh>
Internal
(
const_cast<GeometricField<Type, PatchField, GeoMesh>&>(tgf()),
tgf.isTmp()
@ -439,7 +463,7 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
const GeometricField<Type, PatchField, GeoMesh>& gf
)
:
DimensionedField<Type, GeoMesh>(io, gf),
Internal(io, gf),
timeIndex_(gf.timeIndex()),
field0Ptr_(NULL),
fieldPrevIterPtr_(NULL),
@ -471,7 +495,7 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf
)
:
DimensionedField<Type, GeoMesh>
Internal
(
io,
const_cast<GeometricField<Type, PatchField, GeoMesh>&>(tgf()),
@ -503,7 +527,7 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
const GeometricField<Type, PatchField, GeoMesh>& gf
)
:
DimensionedField<Type, GeoMesh>(newName, gf),
Internal(newName, gf),
timeIndex_(gf.timeIndex()),
field0Ptr_(NULL),
fieldPrevIterPtr_(NULL),
@ -535,7 +559,7 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf
)
:
DimensionedField<Type, GeoMesh>
Internal
(
newName,
const_cast<GeometricField<Type, PatchField, GeoMesh>&>(tgf()),
@ -566,7 +590,7 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
const word& patchFieldType
)
:
DimensionedField<Type, GeoMesh>(io, gf),
Internal(io, gf),
timeIndex_(gf.timeIndex()),
field0Ptr_(NULL),
fieldPrevIterPtr_(NULL),
@ -602,7 +626,7 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
)
:
DimensionedField<Type, GeoMesh>(io, gf),
Internal(io, gf),
timeIndex_(gf.timeIndex()),
field0Ptr_(NULL),
fieldPrevIterPtr_(NULL),
@ -644,7 +668,7 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
const wordList& actualPatchTypes
)
:
DimensionedField<Type, GeoMesh>
Internal
(
io,
const_cast<GeometricField<Type, PatchField, GeoMesh>&>(tgf()),
@ -701,7 +725,7 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::dimensionedInternalFieldRef()
template<class Type, template<class> class PatchField, class GeoMesh>
typename
Foam::GeometricField<Type, PatchField, GeoMesh>::Internal::FieldType&
Foam::GeometricField<Type, PatchField, GeoMesh>::internalField()
Foam::GeometricField<Type, PatchField, GeoMesh>::internalFieldRef()
{
this->setUpToDate();
storeOldTimes();
@ -992,7 +1016,7 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::T() const
)
);
Foam::T(result.ref().internalField(), internalField());
Foam::T(result.ref().internalFieldRef(), internalField());
Foam::T(result.ref().boundaryFieldRef(), boundaryField());
return result;
@ -1029,7 +1053,7 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::component
)
);
Foam::component(Component.ref().internalField(), internalField(), d);
Foam::component(Component.ref().internalFieldRef(), internalField(), d);
Foam::component(Component.ref().boundaryFieldRef(), boundaryField(), d);
return Component;
@ -1048,7 +1072,7 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::replace
>& gcf
)
{
internalField().replace(d, gcf.internalField());
internalFieldRef().replace(d, gcf.internalField());
boundaryFieldRef().replace(d, gcf.boundaryField());
}
@ -1060,7 +1084,7 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::replace
const dimensioned<cmptType>& ds
)
{
internalField().replace(d, ds.value());
internalFieldRef().replace(d, ds.value());
boundaryFieldRef().replace(d, ds.value());
}
@ -1071,7 +1095,7 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::max
const dimensioned<Type>& dt
)
{
Foam::max(internalField(), internalField(), dt.value());
Foam::max(internalFieldRef(), internalField(), dt.value());
Foam::max(boundaryFieldRef(), boundaryField(), dt.value());
}
@ -1082,7 +1106,7 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::min
const dimensioned<Type>& dt
)
{
Foam::min(internalField(), internalField(), dt.value());
Foam::min(internalFieldRef(), internalField(), dt.value());
Foam::min(boundaryFieldRef(), boundaryField(), dt.value());
}
@ -1090,7 +1114,7 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::min
template<class Type, template<class> class PatchField, class GeoMesh>
void Foam::GeometricField<Type, PatchField, GeoMesh>::negate()
{
internalField().negate();
internalFieldRef().negate();
boundaryFieldRef().negate();
}
@ -1141,7 +1165,7 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::operator=
this->dimensions() = gf.dimensions();
// Transfer the storage from the tmp
internalField().transfer
internalFieldRef().transfer
(
const_cast<Field<Type>&>(gf.internalField())
);

View File

@ -190,7 +190,7 @@ public:
//- Read the boundary field
void readField
(
const DimensionedField<Type, GeoMesh>& field,
const Internal& field,
const dictionary& dict
);
@ -330,6 +330,14 @@ public:
const wordList& actualPatchTypes = wordList()
);
//- Constructor from components
GeometricField
(
const IOobject&,
const Internal&,
const PtrList<PatchField<Type>>&
);
//- Constructor from components
GeometricField
(
@ -452,7 +460,7 @@ public:
//- Return a reference to the internal field
// Note: this increments the event counter and checks the
// old-time fields; avoid in loops.
typename Internal::FieldType& internalField();
typename Internal::FieldType& internalFieldRef();
//- Return a const-reference to the internal field
inline const typename Internal::FieldType& internalField() const;

View File

@ -49,7 +49,7 @@ void component
const direction d
)
{
component(gcf.internalField(), gf.internalField(), d);
component(gcf.internalFieldRef(), gf.internalField(), d);
component(gcf.boundaryFieldRef(), gf.boundaryField(), d);
}
@ -61,7 +61,7 @@ void T
const GeometricField<Type, PatchField, GeoMesh>& gf1
)
{
T(gf.internalField(), gf1.internalField());
T(gf.internalFieldRef(), gf1.internalField());
T(gf.boundaryFieldRef(), gf1.boundaryField());
}
@ -79,7 +79,7 @@ void pow
const GeometricField<Type, PatchField, GeoMesh>& gf1
)
{
pow(gf.internalField(), gf1.internalField(), r);
pow(gf.internalFieldRef(), gf1.internalField(), r);
pow(gf.boundaryFieldRef(), gf1.boundaryField(), r);
}
@ -173,7 +173,7 @@ void sqr
const GeometricField<Type, PatchField, GeoMesh>& gf1
)
{
sqr(gf.internalField(), gf1.internalField());
sqr(gf.internalFieldRef(), gf1.internalField());
sqr(gf.boundaryFieldRef(), gf1.boundaryField());
}
@ -261,7 +261,7 @@ void magSqr
const GeometricField<Type, PatchField, GeoMesh>& gf
)
{
magSqr(gsf.internalField(), gf.internalField());
magSqr(gsf.internalFieldRef(), gf.internalField());
magSqr(gsf.boundaryFieldRef(), gf.boundaryField());
}
@ -333,7 +333,7 @@ void mag
const GeometricField<Type, PatchField, GeoMesh>& gf
)
{
mag(gsf.internalField(), gf.internalField());
mag(gsf.internalFieldRef(), gf.internalField());
mag(gsf.boundaryFieldRef(), gf.boundaryField());
}
@ -410,7 +410,7 @@ void cmptAv
const GeometricField<Type, PatchField, GeoMesh>& gf
)
{
cmptAv(gcf.internalField(), gf.internalField());
cmptAv(gcf.internalFieldRef(), gf.internalField());
cmptAv(gcf.boundaryFieldRef(), gf.boundaryField());
}
@ -599,7 +599,12 @@ void opFunc \
const GeometricField<Type2, PatchField, GeoMesh>& gf2 \
) \
{ \
Foam::opFunc(gf.internalField(), gf1.internalField(), gf2.internalField());\
Foam::opFunc \
( \
gf.internalFieldRef(), \
gf1.internalField(), \
gf2.internalField() \
); \
Foam::opFunc \
( \
gf.boundaryFieldRef(), \
@ -750,7 +755,7 @@ void opFunc \
const dimensioned<Form>& dvs \
) \
{ \
Foam::opFunc(gf.internalField(), gf1.internalField(), dvs.value()); \
Foam::opFunc(gf.internalFieldRef(), gf1.internalField(), dvs.value()); \
Foam::opFunc(gf.boundaryFieldRef(), gf1.boundaryField(), dvs.value()); \
} \
\
@ -863,7 +868,7 @@ void opFunc \
const GeometricField<Type, PatchField, GeoMesh>& gf1 \
) \
{ \
Foam::opFunc(gf.internalField(), dvs.value(), gf1.internalField()); \
Foam::opFunc(gf.internalFieldRef(), dvs.value(), gf1.internalField()); \
Foam::opFunc(gf.boundaryFieldRef(), dvs.value(), gf1.boundaryField()); \
} \
\

View File

@ -41,7 +41,7 @@ void Func \
const GeometricField<Type1, PatchField, GeoMesh>& gf1 \
) \
{ \
Foam::Func(res.internalField(), gf1.internalField()); \
Foam::Func(res.internalFieldRef(), gf1.internalField()); \
Foam::Func(res.boundaryFieldRef(), gf1.boundaryField()); \
} \
\
@ -110,7 +110,7 @@ void OpFunc \
const GeometricField<Type1, PatchField, GeoMesh>& gf1 \
) \
{ \
Foam::OpFunc(res.internalField(), gf1.internalField()); \
Foam::OpFunc(res.internalFieldRef(), gf1.internalField()); \
Foam::OpFunc(res.boundaryFieldRef(), gf1.boundaryField()); \
} \
\
@ -180,7 +180,12 @@ void Func \
const GeometricField<Type2, PatchField, GeoMesh>& gf2 \
) \
{ \
Foam::Func(res.internalField(), gf1.internalField(), gf2.internalField()); \
Foam::Func \
( \
res.internalFieldRef(), \
gf1.internalField(), \
gf2.internalField() \
); \
Foam::Func \
( \
res.boundaryFieldRef(), \
@ -313,7 +318,7 @@ void Func \
const GeometricField<Type2, PatchField, GeoMesh>& gf2 \
) \
{ \
Foam::Func(res.internalField(), dt1.value(), gf2.internalField()); \
Foam::Func(res.internalFieldRef(), dt1.value(), gf2.internalField()); \
Foam::Func(res.boundaryFieldRef(), dt1.value(), gf2.boundaryField()); \
} \
\
@ -404,7 +409,7 @@ void Func \
const dimensioned<Type2>& dt2 \
) \
{ \
Foam::Func(res.internalField(), gf1.internalField(), dt2.value()); \
Foam::Func(res.internalFieldRef(), gf1.internalField(), dt2.value()); \
Foam::Func(res.boundaryFieldRef(), gf1.boundaryField(), dt2.value()); \
} \
\
@ -503,7 +508,7 @@ void OpFunc \
) \
{ \
Foam::OpFunc \
(res.internalField(), gf1.internalField(), gf2.internalField()); \
(res.internalFieldRef(), gf1.internalField(), gf2.internalField()); \
Foam::OpFunc \
(res.boundaryFieldRef(), gf1.boundaryField(), gf2.boundaryField()); \
} \
@ -632,7 +637,7 @@ void OpFunc \
const GeometricField<Type2, PatchField, GeoMesh>& gf2 \
) \
{ \
Foam::OpFunc(res.internalField(), dt1.value(), gf2.internalField()); \
Foam::OpFunc(res.internalFieldRef(), dt1.value(), gf2.internalField()); \
Foam::OpFunc(res.boundaryFieldRef(), dt1.value(), gf2.boundaryField()); \
} \
\
@ -723,7 +728,7 @@ void OpFunc \
const dimensioned<Type2>& dt2 \
) \
{ \
Foam::OpFunc(res.internalField(), gf1.internalField(), dt2.value()); \
Foam::OpFunc(res.internalFieldRef(), gf1.internalField(), dt2.value()); \
Foam::OpFunc(res.boundaryFieldRef(), gf1.boundaryField(), dt2.value()); \
} \
\

View File

@ -126,7 +126,7 @@ void MapGeometricFields
// Map the internal field
MapInternalField<Type, MeshMapper, GeoMesh>()
(
field.internalField(),
field.internalFieldRef(),
mapper
);

View File

@ -43,7 +43,7 @@ void stabilise
const dimensioned<scalar>& ds
)
{
stabilise(result.internalField(), gsf.internalField(), ds.value());
stabilise(result.internalFieldRef(), gsf.internalField(), ds.value());
stabilise(result.boundaryFieldRef(), gsf.boundaryField(), ds.value());
}
@ -126,7 +126,7 @@ void pow
const GeometricField<scalar, PatchField, GeoMesh>& gsf2
)
{
pow(Pow.internalField(), gsf1.internalField(), gsf2.internalField());
pow(Pow.internalFieldRef(), gsf1.internalField(), gsf2.internalField());
pow(Pow.boundaryFieldRef(), gsf1.boundaryField(), gsf2.boundaryField());
}
@ -269,7 +269,7 @@ void pow
const dimensioned<scalar>& ds
)
{
pow(tPow.internalField(), gsf.internalField(), ds.value());
pow(tPow.internalFieldRef(), gsf.internalField(), ds.value());
pow(tPow.boundaryFieldRef(), gsf.boundaryField(), ds.value());
}
@ -358,7 +358,7 @@ void pow
const GeometricField<scalar, PatchField, GeoMesh>& gsf
)
{
pow(tPow.internalField(), ds.value(), gsf.internalField());
pow(tPow.internalFieldRef(), ds.value(), gsf.internalField());
pow(tPow.boundaryFieldRef(), ds.value(), gsf.boundaryField());
}
@ -450,7 +450,7 @@ void atan2
const GeometricField<scalar, PatchField, GeoMesh>& gsf2
)
{
atan2(Atan2.internalField(), gsf1.internalField(), gsf2.internalField());
atan2(Atan2.internalFieldRef(), gsf1.internalField(), gsf2.internalField());
atan2(Atan2.boundaryFieldRef(), gsf1.boundaryField(), gsf2.boundaryField());
}
@ -577,7 +577,7 @@ void atan2
const dimensioned<scalar>& ds
)
{
atan2(tAtan2.internalField(), gsf.internalField(), ds.value());
atan2(tAtan2.internalFieldRef(), gsf.internalField(), ds.value());
atan2(tAtan2.boundaryFieldRef(), gsf.boundaryField(), ds.value());
}
@ -666,7 +666,7 @@ void atan2
const GeometricField<scalar, PatchField, GeoMesh>& gsf
)
{
atan2(tAtan2.internalField(), ds.value(), gsf.internalField());
atan2(tAtan2.internalFieldRef(), ds.value(), gsf.internalField());
atan2(tAtan2.boundaryFieldRef(), ds.value(), gsf.boundaryField());
}
@ -799,7 +799,7 @@ void func \
const GeometricField<scalar, PatchField, GeoMesh>& gsf1 \
) \
{ \
func(gsf.internalField(), n, gsf1.internalField()); \
func(gsf.internalFieldRef(), n, gsf1.internalField()); \
func(gsf.boundaryFieldRef(), n, gsf1.boundaryField()); \
} \
\

View File

@ -45,7 +45,7 @@ void transform
const GeometricField<Type, PatchField, GeoMesh>& tf
)
{
transform(rtf.internalField(), trf.internalField(), tf.internalField());
transform(rtf.internalFieldRef(), trf.internalField(), tf.internalField());
transform(rtf.boundaryFieldRef(), trf.boundaryField(), tf.boundaryField());
}
@ -131,7 +131,7 @@ void transform
const GeometricField<Type, PatchField, GeoMesh>& tf
)
{
transform(rtf.internalField(), t.value(), tf.internalField());
transform(rtf.internalFieldRef(), t.value(), tf.internalField());
transform(rtf.boundaryFieldRef(), t.value(), tf.boundaryField());
}

View File

@ -66,7 +66,7 @@ void Foam::LESModels::IDDESDelta::calcDelta()
)
);
scalarField& faceToFacenMax = tfaceToFacenMax.ref().internalField();
scalarField& faceToFacenMax = tfaceToFacenMax.ref().internalFieldRef();
const cellList& cells = mesh.cells();
const vectorField& faceCentres = mesh.faceCentres();
@ -113,7 +113,7 @@ void Foam::LESModels::IDDESDelta::calcDelta()
<< "Case must be either 2D or 3D" << exit(FatalError);
}
delta_.internalField() =
delta_.internalFieldRef() =
min
(
max

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
@ -48,7 +48,7 @@ void Foam::LESModels::cubeRootVolDelta::calcDelta()
if (nD == 3)
{
delta_.internalField() = deltaCoeff_*pow(mesh.V(), 1.0/3.0);
delta_.internalFieldRef() = deltaCoeff_*pow(mesh.V(), 1.0/3.0);
}
else if (nD == 2)
{
@ -68,7 +68,7 @@ void Foam::LESModels::cubeRootVolDelta::calcDelta()
}
}
delta_.internalField() = deltaCoeff_*sqrt(mesh.V()/thickness);
delta_.internalFieldRef() = deltaCoeff_*sqrt(mesh.V()/thickness);
}
else
{

View File

@ -71,7 +71,7 @@ void Foam::LESModels::maxDeltaxyz::calcDelta()
if (nD == 3)
{
delta_.internalField() = hmax;
delta_.internalFieldRef() = hmax;
}
else if (nD == 2)
{
@ -79,7 +79,7 @@ void Foam::LESModels::maxDeltaxyz::calcDelta()
<< "Case is 2D, LES is not strictly applicable\n"
<< endl;
delta_.internalField() = hmax;
delta_.internalFieldRef() = hmax;
}
else
{

View File

@ -63,7 +63,7 @@ Foam::anisotropicFilter::anisotropicFilter
{
for (direction d=0; d<vector::nComponents; d++)
{
coeff_.internalField().replace
coeff_.internalFieldRef().replace
(
d,
(1/widthCoeff_)*
@ -100,7 +100,7 @@ Foam::anisotropicFilter::anisotropicFilter
{
for (direction d=0; d<vector::nComponents; d++)
{
coeff_.internalField().replace
coeff_.internalFieldRef().replace
(
d,
(1/widthCoeff_)*

View File

@ -344,7 +344,7 @@ Foam::dynamicRefineFvMesh::refine
surfaceScalarField& phi = *iter();
sigFpe::fillNan(phi.internalField());
sigFpe::fillNan(phi.internalFieldRef());
continue;
}

View File

@ -49,7 +49,7 @@ void Foam::fvMeshAdder::MapVolField
Field<Type> oldInternalField(fld.internalField());
// Modify internal field
Field<Type>& intFld = fld.internalField();
Field<Type>& intFld = fld.internalFieldRef();
intFld.setSize(mesh.nCells());
@ -340,7 +340,7 @@ void Foam::fvMeshAdder::MapSurfaceField
Field<Type> oldField(fld);
// Modify internal field
Field<Type>& intFld = fld.internalField();
Field<Type>& intFld = fld.internalFieldRef();
intFld.setSize(mesh.nInternalFaces());

View File

@ -319,7 +319,7 @@ void Foam::MRFZone::addCoriolis
}
const labelList& cells = mesh_.cellZones()[cellZoneID_];
vectorField& ddtUc = ddtU.internalField();
vectorField& ddtUc = ddtU.internalFieldRef();
const vectorField& Uc = U;
const vector Omega = this->Omega();

View File

@ -45,7 +45,7 @@ void Foam::MRFZone::makeRelativeRhoFlux
const vectorField& Cfi = Cf;
const vectorField& Sfi = Sf;
scalarField& phii = phi.internalField();
scalarField& phii = phi.internalFieldRef();
// Internal faces
forAll(internalFaces_, i)
@ -145,7 +145,7 @@ void Foam::MRFZone::makeAbsoluteRhoFlux
const vectorField& Cfi = Cf;
const vectorField& Sfi = Sf;
scalarField& phii = phi.internalField();
scalarField& phii = phi.internalFieldRef();
// Internal faces
forAll(internalFaces_, i)

View File

@ -228,7 +228,7 @@ Foam::tmp<Foam::volVectorField> Foam::SRF::SRFModel::Uabs() const
volVectorField& Uabs = tUabs.ref();
// Add SRF contribution to internal field
Uabs.internalField() += Urel_.internalField();
Uabs.internalFieldRef() += Urel_.internalField();
// Add Urel boundary contributions
volVectorField::Boundary& Uabsbf = Uabs.boundaryFieldRef();

View File

@ -42,7 +42,7 @@ Foam::bound(volScalarField& vsf, const dimensionedScalar& lowerBound)
<< " average: " << gAverage(vsf.internalField())
<< endl;
vsf.internalField() = max
vsf.internalFieldRef() = max
(
max
(

View File

@ -3,7 +3,7 @@
// The ddt term constructed by hand because it would be wrong for
// Backward Differencing in time.
conserve.internalField() +=
conserve.internalFieldRef() +=
(1.0 - mesh.V0()/mesh.V())/runTime.deltaTValue();
scalar sumLocalContErr = runTime.deltaTValue()*

View File

@ -179,7 +179,7 @@ CoEulerDdtScheme<Type>::fvcDdt
)
);
tdtdt.ref().internalField() =
tdtdt.ref().internalFieldRef() =
rDeltaT.internalField()*dt.value()
*(1.0 - mesh().Vsc0()/mesh().Vsc());

View File

@ -373,7 +373,7 @@ CrankNicolsonDdtScheme<Type>::fvcDdt
{
scalar rDtCoef0 = rDtCoef0_(ddt0).value();
ddt0.internalField() =
ddt0.internalFieldRef() =
(
rDtCoef0*
(
@ -466,7 +466,7 @@ CrankNicolsonDdtScheme<Type>::fvcDdt
{
scalar rDtCoef0 = rDtCoef0_(ddt0).value();
ddt0.internalField() =
ddt0.internalFieldRef() =
(
rDtCoef0*rho.value()*
(
@ -559,7 +559,7 @@ CrankNicolsonDdtScheme<Type>::fvcDdt
{
scalar rDtCoef0 = rDtCoef0_(ddt0).value();
ddt0.internalField() =
ddt0.internalFieldRef() =
(
rDtCoef0*
(
@ -663,7 +663,7 @@ CrankNicolsonDdtScheme<Type>::fvcDdt
{
scalar rDtCoef0 = rDtCoef0_(ddt0).value();
ddt0.internalField() =
ddt0.internalFieldRef() =
(
rDtCoef0*
(
@ -801,7 +801,7 @@ CrankNicolsonDdtScheme<Type>::fvmDdt
{
scalar rDtCoef0 = rDtCoef0_(ddt0).value();
ddt0.internalField() =
ddt0.internalFieldRef() =
(
rDtCoef0*
(
@ -886,7 +886,7 @@ CrankNicolsonDdtScheme<Type>::fvmDdt
{
scalar rDtCoef0 = rDtCoef0_(ddt0).value();
ddt0.internalField() =
ddt0.internalFieldRef() =
(
rDtCoef0*rho.value()*
(
@ -972,7 +972,7 @@ CrankNicolsonDdtScheme<Type>::fvmDdt
{
scalar rDtCoef0 = rDtCoef0_(ddt0).value();
ddt0.internalField() =
ddt0.internalFieldRef() =
(
rDtCoef0*
(
@ -1067,7 +1067,7 @@ CrankNicolsonDdtScheme<Type>::fvmDdt
{
scalar rDtCoef0 = rDtCoef0_(ddt0).value();
ddt0.internalField() =
ddt0.internalFieldRef() =
(
rDtCoef0*
(

View File

@ -73,7 +73,7 @@ EulerDdtScheme<Type>::fvcDdt
)
);
tdtdt.ref().internalField() =
tdtdt.ref().internalFieldRef() =
rDeltaT.value()*dt.value()*(1.0 - mesh().Vsc0()/mesh().Vsc());
return tdtdt;

View File

@ -117,7 +117,7 @@ tmp<volScalarField> SLTSDdtScheme<Type>::SLrDeltaT() const
if (phi.dimensions() == dimensionSet(0, 3, -1, 0, 0))
{
rDeltaT.internalField() = max
rDeltaT.internalFieldRef() = max
(
rDeltaT.internalField()/mesh().V(),
scalar(1)/deltaT.value()
@ -131,7 +131,7 @@ tmp<volScalarField> SLTSDdtScheme<Type>::SLrDeltaT() const
rhoName_
).oldTime();
rDeltaT.internalField() = max
rDeltaT.internalFieldRef() = max
(
rDeltaT.internalField()/(rho.internalField()*mesh().V()),
scalar(1)/deltaT.value()
@ -183,7 +183,7 @@ SLTSDdtScheme<Type>::fvcDdt
)
);
tdtdt.ref().internalField() =
tdtdt.ref().internalFieldRef() =
rDeltaT.internalField()*dt.value()*(1.0 - mesh().V0()/mesh().V());
return tdtdt;

View File

@ -111,7 +111,7 @@ backwardDdtScheme<Type>::fvcDdt
)
);
tdtdt.ref().internalField() = rDeltaT.value()*dt.value()*
tdtdt.ref().internalFieldRef() = rDeltaT.value()*dt.value()*
(
coefft - (coefft0*mesh().V0() - coefft00*mesh().V00())/mesh().V()
);

View File

@ -79,7 +79,7 @@ localEulerDdtScheme<Type>::fvcDdt
)
);
tdtdt.ref().internalField() =
tdtdt.ref().internalFieldRef() =
rDeltaT.internalField()*dt.value()
*(1.0 - mesh().Vsc0()/mesh().Vsc());

View File

@ -67,7 +67,7 @@ average
);
GeometricField<Type, fvPatchField, volMesh>& av = taverage.ref();
av.internalField() =
av.internalFieldRef() =
(
surfaceSum(mesh.magSf()*ssf)().internalField()
/surfaceSum(mesh.magSf())().internalField()

View File

@ -109,7 +109,7 @@ surfaceIntegrate
);
GeometricField<Type, fvPatchField, volMesh>& vf = tvf.ref();
surfaceIntegrate(vf.internalField(), ssf);
surfaceIntegrate(vf.internalFieldRef(), ssf);
vf.correctBoundaryConditions();
return tvf;

View File

@ -183,7 +183,7 @@ Foam::fv::cellLimitedGrad<Foam::scalar>::calcGrad
<< " average: " << gAverage(limiter) << endl;
}
g.internalField() *= limiter;
g.internalFieldRef() *= limiter;
g.correctBoundaryConditions();
gaussGrad<scalar>::correctBoundaryConditions(vsf, g);
@ -336,7 +336,7 @@ Foam::fv::cellLimitedGrad<Foam::vector>::calcGrad
<< " average: " << gAverage(limiter) << endl;
}
tensorField& gIf = g.internalField();
tensorField& gIf = g.internalFieldRef();
forAll(gIf, celli)
{

View File

@ -165,7 +165,7 @@ Foam::fv::faceLimitedGrad<Foam::scalar>::calcGrad
<< " average: " << gAverage(limiter) << endl;
}
g.internalField() *= limiter;
g.internalFieldRef() *= limiter;
g.correctBoundaryConditions();
gaussGrad<scalar>::correctBoundaryConditions(vsf, g);
@ -326,7 +326,7 @@ Foam::fv::faceLimitedGrad<Foam::vector>::calcGrad
<< " average: " << gAverage(limiter) << endl;
}
g.internalField() *= limiter;
g.internalFieldRef() *= limiter;
g.correctBoundaryConditions();
gaussGrad<vector>::correctBoundaryConditions(vvf, g);

View File

@ -68,7 +68,7 @@ Foam::fv::faceCorrectedSnGrad<Type>::fullGradCorrection
)
);
Field<Type>& sfCorr = tsfCorr.ref().internalField();
Field<Type>& sfCorr = tsfCorr.ref().internalFieldRef();
const pointField& points = mesh.points();
const faceList& faces = mesh.faces();

View File

@ -191,7 +191,7 @@ void Foam::fvMatrix<Type>::setValuesFromList
const_cast
<
GeometricField<Type, fvPatchField, volMesh>&
>(psi_).internalField();
>(psi_).internalFieldRef();
forAll(cellLabels, i)
{
@ -742,7 +742,7 @@ Foam::tmp<Foam::volScalarField> Foam::fvMatrix<Type>::A() const
)
);
tAphi.ref().internalField() = D()/psi_.mesh().V();
tAphi.ref().internalFieldRef() = D()/psi_.mesh().V();
tAphi.ref().correctBoundaryConditions();
return tAphi;
@ -782,13 +782,13 @@ Foam::fvMatrix<Type>::H() const
boundaryDiagCmpt.negate();
addCmptAvBoundaryDiag(boundaryDiagCmpt);
Hphi.internalField().replace(cmpt, boundaryDiagCmpt*psiCmpt);
Hphi.internalFieldRef().replace(cmpt, boundaryDiagCmpt*psiCmpt);
}
Hphi.internalField() += lduMatrix::H(psi_.internalField()) + source_;
addBoundarySource(Hphi.internalField());
Hphi.internalFieldRef() += lduMatrix::H(psi_.internalField()) + source_;
addBoundarySource(Hphi.internalFieldRef());
Hphi.internalField() /= psi_.mesh().V();
Hphi.internalFieldRef() /= psi_.mesh().V();
Hphi.correctBoundaryConditions();
typename Type::labelType validComponents
@ -834,7 +834,7 @@ Foam::tmp<Foam::volScalarField> Foam::fvMatrix<Type>::H1() const
);
volScalarField& H1_ = tH1.ref();
H1_.internalField() = lduMatrix::H1();
H1_.internalFieldRef() = lduMatrix::H1();
forAll(psi_.boundaryField(), patchi)
{
@ -851,7 +851,7 @@ Foam::tmp<Foam::volScalarField> Foam::fvMatrix<Type>::H1() const
}
}
H1_.internalField() /= psi_.mesh().V();
H1_.internalFieldRef() /= psi_.mesh().V();
H1_.correctBoundaryConditions();
return tH1;
@ -894,7 +894,7 @@ flux() const
for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
{
fieldFlux.internalField().replace
fieldFlux.internalFieldRef().replace
(
cmpt,
lduMatrix::faceH(psi_.internalField().component(cmpt))
@ -2289,18 +2289,18 @@ Foam::operator&
scalarField psiCmpt(psi.field().component(cmpt));
scalarField boundaryDiagCmpt(M.diag());
M.addBoundaryDiag(boundaryDiagCmpt, cmpt);
Mphi.internalField().replace(cmpt, -boundaryDiagCmpt*psiCmpt);
Mphi.internalFieldRef().replace(cmpt, -boundaryDiagCmpt*psiCmpt);
}
}
else
{
Mphi.internalField() = Zero;
Mphi.internalFieldRef() = Zero;
}
Mphi.internalField() += M.lduMatrix::H(psi.field()) + M.source();
M.addBoundarySource(Mphi.internalField());
Mphi.internalFieldRef() += M.lduMatrix::H(psi.field()) + M.source();
M.addBoundarySource(Mphi.internalFieldRef());
Mphi.internalField() /= -psi.mesh().V();
Mphi.internalFieldRef() /= -psi.mesh().V();
Mphi.correctBoundaryConditions();
return tMphi;

View File

@ -202,7 +202,7 @@ Foam::SolverPerformance<Type> Foam::fvMatrix<Type>::solveSegregated
solverPerfVec.replace(cmpt, solverPerf);
psi.internalField().replace(cmpt, psiCmpt);
psi.internalFieldRef().replace(cmpt, psiCmpt);
diag() = saveDiag;
}

View File

@ -114,7 +114,7 @@ Foam::solverPerformance Foam::fvMatrix<Foam::scalar>::fvSolver::solve
solverPerformance solverPerf = solver_->solve
(
psi.internalField(),
psi.internalFieldRef(),
totalSource
);
@ -166,7 +166,7 @@ Foam::solverPerformance Foam::fvMatrix<Foam::scalar>::solveSegregated
internalCoeffs_,
psi_.boundaryField().scalarInterfaces(),
solverControls
)->solve(psi.internalField(), totalSource);
)->solve(psi.internalFieldRef(), totalSource);
if (solverPerformance::debug)
{
@ -229,10 +229,10 @@ Foam::tmp<Foam::volScalarField> Foam::fvMatrix<Foam::scalar>::H() const
);
volScalarField& Hphi = tHphi.ref();
Hphi.internalField() = (lduMatrix::H(psi_.internalField()) + source_);
addBoundarySource(Hphi.internalField());
Hphi.internalFieldRef() = (lduMatrix::H(psi_.internalField()) + source_);
addBoundarySource(Hphi.internalFieldRef());
Hphi.internalField() /= psi_.mesh().V();
Hphi.internalFieldRef() /= psi_.mesh().V();
Hphi.correctBoundaryConditions();
return tHphi;
@ -261,10 +261,10 @@ Foam::tmp<Foam::volScalarField> Foam::fvMatrix<Foam::scalar>::H1() const
);
volScalarField& H1_ = tH1.ref();
H1_.internalField() = lduMatrix::H1();
H1_.internalFieldRef() = lduMatrix::H1();
//addBoundarySource(Hphi.internalField());
H1_.internalField() /= psi_.mesh().V();
H1_.internalFieldRef() /= psi_.mesh().V();
H1_.correctBoundaryConditions();
return tH1;

View File

@ -53,7 +53,7 @@ void Foam::MULES::correct
if (mesh.moving())
{
psi.internalField() =
psi.internalFieldRef() =
(
rho.field()*psi.internalField()*rDeltaT
+ Su.field()
@ -62,7 +62,7 @@ void Foam::MULES::correct
}
else
{
psi.internalField() =
psi.internalFieldRef() =
(
rho.field()*psi.internalField()*rDeltaT
+ Su.field()

View File

@ -763,8 +763,8 @@ Foam::tmp<Foam::scalarField> Foam::fvMesh::movePoints(const pointField& p)
tmp<scalarField> tsweptVols = polyMesh::movePoints(p);
scalarField& sweptVols = tsweptVols.ref();
phi.internalField() = scalarField::subField(sweptVols, nInternalFaces());
phi.internalField() *= rDeltaT;
phi.internalFieldRef() = scalarField::subField(sweptVols, nInternalFaces());
phi.internalFieldRef() *= rDeltaT;
const fvPatchList& patches = boundary();

View File

@ -57,7 +57,7 @@ void Foam::LimitedScheme<Type, Limiter, LimitFunc>::calcLimiter
const vectorField& C = mesh.C();
scalarField& pLim = limiterField.internalField();
scalarField& pLim = limiterField.internalFieldRef();
forAll(pLim, face)
{

View File

@ -83,7 +83,7 @@ Foam::PhiScheme<Type, PhiLimiter>::limiter
const surfaceScalarField& Uflux = tUflux();
scalarField& pLimiter = Limiter.internalField();
scalarField& pLimiter = Limiter.internalFieldRef();
forAll(pLimiter, face)
{

View File

@ -149,7 +149,7 @@ Foam::limitedSurfaceInterpolationScheme<Type>::weights
// from which the weight is calculated using the limiter value
surfaceScalarField& Weights = tLimiter.ref();
scalarField& pWeights = Weights.internalField();
scalarField& pWeights = Weights.internalFieldRef();
forAll(pWeights, face)
{

View File

@ -238,7 +238,7 @@ public:
fvc::surfaceSum(mag(tUflux))().internalField()
);
Co.internalField() =
Co.internalFieldRef() =
(sumPhi/mesh.V().field())*(0.5*mesh.time().deltaTValue());
Co.correctBoundaryConditions();

View File

@ -153,7 +153,7 @@ public:
surfaceScalarField& clippedLinearWeights =
tclippedLinearWeights.ref();
clippedLinearWeights.internalField() =
clippedLinearWeights.internalFieldRef() =
max(min(cdWeights.internalField(), 1 - wfLimit_), wfLimit_);
surfaceScalarField::Boundary& clwbf =

View File

@ -48,7 +48,7 @@ correction
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>> tsfCorr =
linearInterpolate(vf);
Field<Type>& sfCorr = tsfCorr.ref().internalField();
Field<Type>& sfCorr = tsfCorr.ref().internalFieldRef();
const pointField& points = mesh.points();
const pointField& C = mesh.C();

View File

@ -125,7 +125,7 @@ public:
surfaceScalarField& reverseLinearWeights =
treverseLinearWeights.ref();
reverseLinearWeights.internalField() =
reverseLinearWeights.internalFieldRef() =
1.0 - cdWeights.internalField();
surfaceScalarField::Boundary& rlwbf =

View File

@ -169,7 +169,7 @@ void Foam::surfaceInterpolation::makeWeights() const
const vectorField& Sf = mesh_.faceAreas();
// ... and reference to the internal field of the weighting factors
scalarField& w = weights.internalField();
scalarField& w = weights.internalFieldRef();
forAll(owner, facei)
{

View File

@ -181,7 +181,7 @@ Foam::surfaceInterpolationScheme<Type>::interpolate
);
GeometricField<Type, fvsPatchField, surfaceMesh>& sf = tsf.ref();
Field<Type>& sfi = sf.internalField();
Field<Type>& sfi = sf.internalFieldRef();
for (label fi=0; fi<P.size(); fi++)
{
@ -274,7 +274,7 @@ Foam::surfaceInterpolationScheme<Type>::dotInterpolate
);
GeometricField<RetType, fvsPatchField, surfaceMesh>& sf = tsf.ref();
Field<RetType>& sfi = sf.internalField();
Field<RetType>& sfi = sf.internalFieldRef();
const typename SFType::Internal& Sfi = Sf();

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
@ -378,7 +378,7 @@ void Foam::pointConstraints::constrainDisplacement
syncUntransformedData
(
pf.mesh()(),
pf.internalField(),
pf.internalFieldRef(),
maxMagSqrEqOp<vector>()
);
@ -390,7 +390,7 @@ void Foam::pointConstraints::constrainDisplacement
twoDPointCorrector::New(mesh()()).correctDisplacement
(
mesh()().points(),
pf.internalField()
pf.internalFieldRef()
);
if (overrideFixedValue)

View File

@ -137,7 +137,12 @@ void Foam::pointConstraints::constrain
pf.correctBoundaryConditions();
// Sync any dangling points
syncUntransformedData(mesh()(), pf.internalField(), maxMagSqrEqOp<Type>());
syncUntransformedData
(
mesh()(),
pf.internalFieldRef(),
maxMagSqrEqOp<Type>()
);
// Apply multiple constraints on edge/corner points
constrainCorners(pf);

View File

@ -86,6 +86,9 @@ void Foam::volPointInterpolation::addSeparated
Pout<< "volPointInterpolation::addSeparated" << endl;
}
typename GeometricField<Type, pointPatchField, pointMesh>::
Internal& pfi = pf.dimensionedInternalFieldRef();
typename GeometricField<Type, pointPatchField, pointMesh>::
Boundary& pfbf = pf.boundaryFieldRef();
@ -97,7 +100,7 @@ void Foam::volPointInterpolation::addSeparated
(pfbf[patchi]).initSwapAddSeparated
(
Pstream::nonBlocking,
pf.internalField()
pfi
);
}
}
@ -113,7 +116,7 @@ void Foam::volPointInterpolation::addSeparated
(pfbf[patchi]).swapAddSeparated
(
Pstream::nonBlocking,
pf.internalField()
pfi
);
}
}
@ -213,7 +216,7 @@ void Foam::volPointInterpolation::interpolateBoundaryField
{
const primitivePatch& boundary = boundaryPtr_();
Field<Type>& pfi = pf.internalField();
Field<Type>& pfi = pf.internalFieldRef();
// Get face data in flat list
tmp<Field<Type>> tboundaryVals(flatBoundaryField(vf));

View File

@ -158,9 +158,9 @@ Foam::displacementComponentLaplacianFvMotionSolver::curPoints() const
// Apply pointLocation_ b.c. to mesh points.
pointLocation_().internalField() = fvMesh_.points();
pointLocation_().internalFieldRef() = fvMesh_.points();
pointLocation_().internalField().replace
pointLocation_().internalFieldRef().replace
(
cmpt_,
points0_ + pointDisplacement_.internalField()
@ -181,7 +181,7 @@ Foam::displacementComponentLaplacianFvMotionSolver::curPoints() const
}
}
twoDCorrectPoints(pointLocation_().internalField());
twoDCorrectPoints(pointLocation_().internalFieldRef());
return tmp<pointField>(pointLocation_().internalField());
}

View File

@ -173,7 +173,7 @@ Foam::displacementLaplacianFvMotionSolver::curPoints() const
<< endl;
}
pointLocation_().internalField() =
pointLocation_().internalFieldRef() =
points0()
+ pointDisplacement_.internalField();
@ -190,7 +190,7 @@ Foam::displacementLaplacianFvMotionSolver::curPoints() const
}
}
twoDCorrectPoints(pointLocation_().internalField());
twoDCorrectPoints(pointLocation_().internalFieldRef());
return tmp<pointField>(pointLocation_().internalField());
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -100,7 +100,7 @@ void Foam::inverseDistanceDiffusivity::correct()
dimless,
zeroGradientFvPatchScalarField::typeName
);
y_.internalField() = y();
y_.internalFieldRef() = y();
y_.correctBoundaryConditions();
faceDiffusivity_ = 1.0/fvc::interpolate(y_);

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
@ -85,7 +85,7 @@ void Foam::inverseVolumeDiffusivity::correct()
zeroGradientFvPatchScalarField::typeName
);
V.internalField() = mesh().V();
V.internalFieldRef() = mesh().V();
V.correctBoundaryConditions();
faceDiffusivity_ = 1.0/fvc::interpolate(V);

View File

@ -84,7 +84,7 @@ void Foam::fv::limitTemperature::correct(volScalarField& he)
scalarField heMin(thermo.he(thermo.p(), Tmin, cells_));
scalarField heMax(thermo.he(thermo.p(), Tmax, cells_));
scalarField& hec = he.internalField();
scalarField& hec = he.internalFieldRef();
forAll(cells_, i)
{

View File

@ -186,7 +186,7 @@ void Foam::fv::rotorDiskSource::writeField
)
);
Field<Type>& field = tfield.ref().internalField();
Field<Type>& field = tfield.ref().internalFieldRef();
if (cells_.size() != values.size())
{

View File

@ -162,7 +162,7 @@ void Foam::fv::interRegionExplicitPorositySource::addSup
(
U.internalField(),
plusEqOp<vector>(),
UNbr.internalField()
UNbr.internalFieldRef()
);
fvMatrix<vector> nbrEqn(UNbr, eqn.dimensions());
@ -216,7 +216,7 @@ void Foam::fv::interRegionExplicitPorositySource::addSup
(
U.internalField(),
plusEqOp<vector>(),
UNbr.internalField()
UNbr.internalFieldRef()
);
fvMatrix<vector> nbrEqn(UNbr, eqn.dimensions());
@ -257,7 +257,7 @@ void Foam::fv::interRegionExplicitPorositySource::addSup
(
rho.internalField(),
plusEqOp<scalar>(),
rhoNbr.internalField()
rhoNbr.internalFieldRef()
);
// Map local mu onto neighbour region
@ -265,7 +265,7 @@ void Foam::fv::interRegionExplicitPorositySource::addSup
(
mu.internalField(),
plusEqOp<scalar>(),
muNbr.internalField()
muNbr.internalFieldRef()
);
porosityPtr_->addResistance(nbrEqn, rhoNbr, muNbr);

View File

@ -201,7 +201,7 @@ void Foam::fv::interRegionHeatTransferModel::addSup
const volScalarField& Tnbr =
nbrMesh.lookupObject<volScalarField>(TNbrName_);
interpolate(Tnbr, Tmapped.internalField());
interpolate(Tnbr, Tmapped.internalFieldRef());
if (debug)
{

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
@ -122,7 +122,7 @@ void Foam::fv::tabulatedHeatTransfer::calculateHtc()
const volVectorField& U = mesh_.lookupObject<volVectorField>(UName_);
scalarField& htcc = htc_.internalField();
scalarField& htcc = htc_.internalFieldRef();
forAll(htcc, 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
@ -122,7 +122,7 @@ void Foam::fv::variableHeatTransfer::calculateHtc()
const scalarField htcNbrMapped(interpolate(htcNbr));
htc_.internalField() = htcNbrMapped*AoV_;
htc_.internalFieldRef() = htcNbrMapped*AoV_;
}

View File

@ -202,7 +202,7 @@ void Foam::DSMCCloud<ParcelType>::initialise
mostAbundantType
);
sigmaTcRMax_.internalField() = cP.sigmaT()*maxwellianMostProbableSpeed
sigmaTcRMax_.internalFieldRef() = cP.sigmaT()*maxwellianMostProbableSpeed
(
temperature,
cP.mass()
@ -414,13 +414,13 @@ void Foam::DSMCCloud<ParcelType>::resetFields()
template<class ParcelType>
void Foam::DSMCCloud<ParcelType>::calculateFields()
{
scalarField& rhoN = rhoN_.internalField();
scalarField& rhoM = rhoM_.internalField();
scalarField& dsmcRhoN = dsmcRhoN_.internalField();
scalarField& linearKE = linearKE_.internalField();
scalarField& internalE = internalE_.internalField();
scalarField& iDof = iDof_.internalField();
vectorField& momentum = momentum_.internalField();
scalarField& rhoN = rhoN_.internalFieldRef();
scalarField& rhoM = rhoM_.internalFieldRef();
scalarField& dsmcRhoN = dsmcRhoN_.internalFieldRef();
scalarField& linearKE = linearKE_.internalFieldRef();
scalarField& internalE = internalE_.internalFieldRef();
scalarField& iDof = iDof_.internalFieldRef();
vectorField& momentum = momentum_.internalFieldRef();
forAllConstIter(typename DSMCCloud<ParcelType>, *this, iter)
{

View File

@ -483,7 +483,7 @@ Foam::KinematicCloud<CloudType>::vDotSweep() const
vDotSweep[celli] += p.nParticle()*p.areaP()*mag(p.U() - U_[celli]);
}
vDotSweep.internalField() /= mesh_.V();
vDotSweep.internalFieldRef() /= mesh_.V();
vDotSweep.correctBoundaryConditions();
return tvDotSweep;
@ -522,7 +522,7 @@ Foam::KinematicCloud<CloudType>::theta() const
theta[celli] += p.nParticle()*p.volume();
}
theta.internalField() /= mesh_.V();
theta.internalFieldRef() /= mesh_.V();
theta.correctBoundaryConditions();
return ttheta;
@ -551,7 +551,7 @@ Foam::KinematicCloud<CloudType>::alpha() const
)
);
scalarField& alpha = talpha.ref().internalField();
scalarField& alpha = talpha.ref().internalFieldRef();
forAllConstIter(typename KinematicCloud<CloudType>, *this, iter)
{
const parcelType& p = iter();
@ -588,7 +588,7 @@ Foam::KinematicCloud<CloudType>::rhoEff() const
)
);
scalarField& rhoEff = trhoEff.ref().internalField();
scalarField& rhoEff = trhoEff.ref().internalFieldRef();
forAllConstIter(typename KinematicCloud<CloudType>, *this, iter)
{
const parcelType& p = iter();

View File

@ -129,7 +129,7 @@ inline Foam::tmp<Foam::fvScalarMatrix> Foam::ReactingCloud<CloudType>::SYi
volScalarField& sourceField = trhoTrans.ref();
sourceField.internalField() =
sourceField.internalFieldRef() =
rhoTrans_[i]/(this->db().time().deltaTValue()*this->mesh().V());
const dimensionedScalar YiSMALL("YiSMALL", dimless, SMALL);

View File

@ -282,7 +282,7 @@ inline Foam::tmp<Foam::volScalarField> Foam::ThermoCloud<CloudType>::Ep() const
if (radiation_)
{
scalarField& Ep = tEp.ref().internalField();
scalarField& Ep = tEp.ref().internalFieldRef();
const scalar dt = this->db().time().deltaTValue();
const scalarField& V = this->mesh().V();
const scalar epsilon = constProps_.epsilon0();
@ -318,7 +318,7 @@ inline Foam::tmp<Foam::volScalarField> Foam::ThermoCloud<CloudType>::ap() const
if (radiation_)
{
scalarField& ap = tap.ref().internalField();
scalarField& ap = tap.ref().internalFieldRef();
const scalar dt = this->db().time().deltaTValue();
const scalarField& V = this->mesh().V();
const scalar epsilon = constProps_.epsilon0();
@ -355,7 +355,7 @@ Foam::ThermoCloud<CloudType>::sigmap() const
if (radiation_)
{
scalarField& sigmap = tsigmap.ref().internalField();
scalarField& sigmap = tsigmap.ref().internalFieldRef();
const scalar dt = this->db().time().deltaTValue();
const scalarField& V = this->mesh().V();
const scalar epsilon = constProps_.epsilon0();

View File

@ -131,7 +131,7 @@ void Foam::ParticleErosion<CloudType>::preEvolve()
{
if (QPtr_.valid())
{
QPtr_->internalField() = 0.0;
QPtr_->internalFieldRef() = 0.0;
}
else
{

View File

@ -82,7 +82,7 @@ void Foam::VoidFraction<CloudType>::preEvolve()
{
if (thetaPtr_.valid())
{
thetaPtr_->internalField() = 0.0;
thetaPtr_->internalFieldRef() = 0.0;
}
else
{
@ -115,7 +115,7 @@ void Foam::VoidFraction<CloudType>::postEvolve()
const fvMesh& mesh = this->owner().mesh();
theta.internalField() /= mesh.time().deltaTValue()*mesh.V();
theta.internalFieldRef() /= mesh.time().deltaTValue()*mesh.V();
CloudFunctionObject<CloudType>::postEvolve();
}

View File

@ -231,10 +231,10 @@ bool Foam::AveragingMethod<Type>::write() const
}
// average
cellValue.internalField() /= mesh_.V();
cellGrad.internalField() /= mesh_.V();
pointValue.internalField() /= pointVolume;
pointGrad.internalField() /= pointVolume;
cellValue.internalFieldRef() /= mesh_.V();
cellGrad.internalFieldRef() /= mesh_.V();
pointValue.internalFieldRef() /= pointVolume;
pointGrad.internalFieldRef() /= pointVolume;
// write
if (!cellValue.write()) return false;

View File

@ -80,7 +80,7 @@ void Foam::AveragingMethods::Basic<Type>::updateGrad()
dimensioned<Type>("zero", dimless, Zero),
zeroGradientFvPatchField<Type>::typeName
);
tempData.internalField() = data_;
tempData.internalFieldRef() = data_;
tempData.correctBoundaryConditions();
dataGrad_ = fvc::grad(tempData)->internalField();
}

View File

@ -150,7 +150,7 @@ void Foam::PackingModels::Implicit<CloudType>::cacheFields(const bool store)
dimensionedScalar("zero", dimDensity, 0),
zeroGradientFvPatchField<scalar>::typeName
);
rho.internalField() = max(rhoAverage.internalField(), rhoMin_);
rho.internalFieldRef() = max(rhoAverage.internalField(), rhoMin_);
rho.correctBoundaryConditions();
// Stress field
@ -172,7 +172,7 @@ void Foam::PackingModels::Implicit<CloudType>::cacheFields(const bool store)
zeroGradientFvPatchField<scalar>::typeName
);
tauPrime.internalField() =
tauPrime.internalFieldRef() =
this->particleStressModel_->dTaudTheta
(
alpha_.internalField(),
@ -256,7 +256,7 @@ void Foam::PackingModels::Implicit<CloudType>::cacheFields(const bool store)
dimensionedVector("zero", dimVelocity, Zero),
fixedValueFvPatchField<vector>::typeName
);
U.internalField() = uAverage.internalField();
U.internalFieldRef() = uAverage.internalField();
U.correctBoundaryConditions();
surfaceScalarField phi

View File

@ -8,7 +8,7 @@ if (runTime.outputTime())
forAll(allSpeciesRhoN, rN)
{
allSpeciesRhoN[rN].internalField() =
allSpeciesRhoN[rN].internalFieldRef() =
allSpeciesN_RU[rN]
/mesh.cellVolumes()
/nAveragingSteps;
@ -16,7 +16,7 @@ if (runTime.outputTime())
totalRhoN_sum += allSpeciesRhoN[rN].internalField();
}
totalRhoN.internalField() = totalRhoN_sum;
totalRhoN.internalFieldRef() = totalRhoN_sum;
/*-----------------------------------------------------------------------*\
@ -27,7 +27,7 @@ if (runTime.outputTime())
forAll(allSpeciesRhoM, rM)
{
allSpeciesRhoM[rM].internalField() =
allSpeciesRhoM[rM].internalFieldRef() =
allSpeciesM_RU[rM]
/mesh.cellVolumes()
/nAveragingSteps;
@ -35,7 +35,7 @@ if (runTime.outputTime())
totalRhoM_sum += allSpeciesRhoM[rM].internalField();
}
totalRhoM.internalField() = totalRhoM_sum;
totalRhoM.internalFieldRef() = totalRhoM_sum;
/*-----------------------------------------------------------------------*\
Bulk velocity

View File

@ -60,7 +60,7 @@ forAll(allSpeciesRhoN, rN)
"zeroGradient"
)
);
allSpeciesRhoN[rN].internalField() = scalarField (mesh.nCells(), 0.0);
allSpeciesRhoN[rN].internalFieldRef() = 0;
allSpeciesRhoN[rN].correctBoundaryConditions();
}
@ -80,7 +80,7 @@ volScalarField totalRhoN
dimless/dimVolume,
"zeroGradient"
);
totalRhoN.internalField() = scalarField (mesh.nCells(), 0.0);
totalRhoN.internalFieldRef() = 0;
totalRhoN.correctBoundaryConditions();
/*---------------------------------------------------------------------------*\
@ -115,7 +115,7 @@ forAll(allSpeciesRhoM, rM)
"zeroGradient"
)
);
allSpeciesRhoM[rM].internalField() = scalarField (mesh.nCells(), 0.0);
allSpeciesRhoM[rM].internalFieldRef() = 0;
allSpeciesRhoM[rM].correctBoundaryConditions();
}
@ -135,7 +135,7 @@ volScalarField totalRhoM
dimMass/dimVolume,
"zeroGradient"
);
totalRhoM.internalField() = scalarField (mesh.nCells(), 0.0);
totalRhoM.internalFieldRef() = 0;
totalRhoM.correctBoundaryConditions();
/*---------------------------------------------------------------------------*\
@ -170,8 +170,7 @@ forAll(allSpeciesVelocity, v)
"zeroGradient"
)
);
allSpeciesVelocity[v].internalField() =
vectorField (mesh.nCells(), Zero);
allSpeciesVelocity[v].internalFieldRef() = Zero;
allSpeciesVelocity[v].correctBoundaryConditions();
}
@ -191,7 +190,7 @@ Info << " Creating total velocity field" << endl;
// dimVelocity,
// "zeroGradient"
// );
// totalVelocity.internalField() = vectorField (mesh.nCells(), Zero);
// totalVelocity.internalFieldRef() = Zero;
// totalVelocity.correctBoundaryConditions();
@ -244,7 +243,7 @@ forAll(allSpeciesTemperature, t)
"zeroGradient"
)
);
allSpeciesTemperature[t].internalField() = scalarField (mesh.nCells(), 0.0);
allSpeciesTemperature[t].internalFieldRef() = 0;
allSpeciesTemperature[t].correctBoundaryConditions();
}
@ -264,7 +263,7 @@ volScalarField totalTemperature
dimTemperature,
"zeroGradient"
);
totalTemperature.internalField() = scalarField (mesh.nCells(), 0.0);
totalTemperature.internalFieldRef() = 0;
totalTemperature.correctBoundaryConditions();
/*---------------------------------------------------------------------------*\
@ -300,7 +299,7 @@ forAll(allSpeciesMeanKE, mKE)
"zeroGradient"
)
);
allSpeciesMeanKE[mKE].internalField() = scalarField (mesh.nCells(), 0.0);
allSpeciesMeanKE[mKE].internalFieldRef() = 0;
allSpeciesMeanKE[mKE].correctBoundaryConditions();
}
@ -320,5 +319,5 @@ volScalarField totalMeanKE
dimensionSet(1, 2, -2, 0, 0, 0, 0),
"zeroGradient"
);
totalMeanKE.internalField() = scalarField (mesh.nCells(), 0.0);
totalMeanKE.internalFieldRef() = 0;
totalMeanKE.correctBoundaryConditions();

View File

@ -275,7 +275,7 @@ tmp<volScalarField> constantFilmThermo::rho() const
)
);
trho.ref().internalField() = this->rho(0, 0);
trho.ref().internalFieldRef() = this->rho(0, 0);
trho.ref().correctBoundaryConditions();
return trho;
@ -302,7 +302,7 @@ tmp<volScalarField> constantFilmThermo::mu() const
)
);
tmu.ref().internalField() = this->mu(0, 0);
tmu.ref().internalFieldRef() = this->mu(0, 0);
tmu.ref().correctBoundaryConditions();
return tmu;
@ -329,7 +329,7 @@ tmp<volScalarField> constantFilmThermo::sigma() const
)
);
tsigma.ref().internalField() = this->sigma(0, 0);
tsigma.ref().internalFieldRef() = this->sigma(0, 0);
tsigma.ref().correctBoundaryConditions();
return tsigma;
@ -356,7 +356,7 @@ tmp<volScalarField> constantFilmThermo::Cp() const
)
);
tCp.ref().internalField() = this->Cp(0, 0);
tCp.ref().internalFieldRef() = this->Cp(0, 0);
tCp.ref().correctBoundaryConditions();
return tCp;
@ -383,7 +383,7 @@ tmp<volScalarField> constantFilmThermo::kappa() const
)
);
tkappa.ref().internalField() = this->kappa(0, 0);
tkappa.ref().internalFieldRef() = this->kappa(0, 0);
tkappa.ref().correctBoundaryConditions();
return tkappa;

View File

@ -255,7 +255,7 @@ tmp<volScalarField> liquidFilmThermo::rho() const
)
);
scalarField& rho = trho.ref().internalField();
scalarField& rho = trho.ref().internalFieldRef();
if (useReferenceValues_)
{
@ -303,7 +303,7 @@ tmp<volScalarField> liquidFilmThermo::mu() const
)
);
scalarField& mu = tmu.ref().internalField();
scalarField& mu = tmu.ref().internalFieldRef();
if (useReferenceValues_)
{
@ -351,7 +351,7 @@ tmp<volScalarField> liquidFilmThermo::sigma() const
)
);
scalarField& sigma = tsigma.ref().internalField();
scalarField& sigma = tsigma.ref().internalFieldRef();
if (useReferenceValues_)
{
@ -399,7 +399,7 @@ tmp<volScalarField> liquidFilmThermo::Cp() const
)
);
scalarField& Cp = tCp.ref().internalField();
scalarField& Cp = tCp.ref().internalFieldRef();
if (useReferenceValues_)
{
@ -447,7 +447,7 @@ tmp<volScalarField> liquidFilmThermo::kappa() const
)
);
scalarField& kappa = tkappa.ref().internalField();
scalarField& kappa = tkappa.ref().internalFieldRef();
if (useReferenceValues_)
{

View File

@ -153,7 +153,7 @@ tmp<fvVectorMatrix> contactAngleForce::correct(volVectorField& U)
)
);
vectorField& force = tForce.ref().internalField();
vectorField& force = tForce.ref().internalFieldRef();
const labelUList& own = owner_.regionMesh().owner();
const labelUList& nbr = owner_.regionMesh().neighbour();

View File

@ -78,7 +78,7 @@ tmp<volScalarField> curvatureSeparation::calcInvR1
);
scalarField& invR1 = tinvR1.ref().internalField();
scalarField& invR1 = tinvR1.ref().internalFieldRef();
// apply defined patch radii
const scalar rMin = 1e-6;
@ -207,7 +207,7 @@ tmp<scalarField> curvatureSeparation::calcCosAngle
dimensionedScalar("zero", dimless, 0.0),
zeroGradientFvPatchScalarField::typeName
);
volCosAngle.internalField() = cosAngle;
volCosAngle.internalFieldRef() = cosAngle;
volCosAngle.correctBoundaryConditions();
volCosAngle.write();
}
@ -349,7 +349,7 @@ void curvatureSeparation::correct
dimensionedScalar("zero", dimForce, 0.0),
zeroGradientFvPatchScalarField::typeName
);
volFnet.internalField() = Fnet;
volFnet.internalFieldRef() = Fnet;
volFnet.correctBoundaryConditions();
volFnet.write();
}

View File

@ -132,7 +132,7 @@ tmp<volScalarField> standardRadiation::Shs()
Shs = beta_*QinP*alpha*(1.0 - exp(-kappaBar_*delta));
// Update net Qr on local region
QrNet_.internalField() = QinP - Shs;
QrNet_.internalFieldRef() = QinP - Shs;
QrNet_.correctBoundaryConditions();
return tShs;

View File

@ -153,7 +153,7 @@ Foam::rigidBodyMeshMotion::rigidBodyMeshMotion
pointScalarField& scale = bodyMeshes_[bi].weight_;
// Scaling: 1 up to di then linear down to 0 at do away from patches
scale.internalField() =
scale.internalFieldRef() =
min
(
max
@ -166,7 +166,7 @@ Foam::rigidBodyMeshMotion::rigidBodyMeshMotion
);
// Convert the scale function to a cosine
scale.internalField() =
scale.internalFieldRef() =
min
(
max
@ -281,7 +281,7 @@ void Foam::rigidBodyMeshMotion::solve()
// Update the displacements
if (bodyMeshes_.size() == 1)
{
pointDisplacement_.internalField() = model_.transformPoints
pointDisplacement_.internalFieldRef() = model_.transformPoints
(
bodyMeshes_[0].bodyID_,
bodyMeshes_[0].weight_,
@ -298,7 +298,7 @@ void Foam::rigidBodyMeshMotion::solve()
weights[bi] = &bodyMeshes_[bi].weight_;
}
pointDisplacement_.internalField() =
pointDisplacement_.internalFieldRef() =
model_.transformPoints(bodyIDs, weights, points0()) - points0();
}

View File

@ -325,7 +325,7 @@ void Foam::meshToMesh::mapSrcToTgt
GeometricField<Type, fvPatchField, volMesh>& result
) const
{
mapSrcToTgt(field, cop, result.internalField());
mapSrcToTgt(field, cop, result.internalFieldRef());
const PtrList<AMIPatchToPatchInterpolation>& AMIList = patchAMIs();

View File

@ -83,7 +83,7 @@ void Foam::distanceSurface::createGeometry()
// Internal field
{
const pointField& cc = fvm.C();
scalarField& fld = cellDistance.internalField();
scalarField& fld = cellDistance.internalFieldRef();
List<pointIndexHit> nearest;
surfPtr_().findNearest
@ -257,7 +257,7 @@ void Foam::distanceSurface::createGeometry()
pointMesh::New(fvm),
dimensionedScalar("zero", dimLength, 0)
);
pDist.internalField() = pointDistance_;
pDist.internalFieldRef() = pointDistance_;
Pout<< "Writing point distance:" << pDist.objectPath() << endl;
pDist.write();

View File

@ -125,7 +125,7 @@ void Foam::sampledCuttingPlane::createGeometry()
// Internal field
{
const pointField& cc = fvm.cellCentres();
scalarField& fld = cellDistance.internalField();
scalarField& fld = cellDistance.internalFieldRef();
forAll(cc, i)
{
@ -217,7 +217,7 @@ void Foam::sampledCuttingPlane::createGeometry()
pointMesh::New(fvm),
dimensionedScalar("zero", dimLength, 0)
);
pDist.internalField() = pointDistance_;
pDist.internalFieldRef() = pointDistance_;
Pout<< "Writing point distance:" << pDist.objectPath() << endl;
pDist.write();

View File

@ -118,7 +118,7 @@ Foam::sixDoFRigidBodyMotionSolver::sixDoFRigidBodyMotionSolver
pointPatchDist pDist(pMesh, patchSet_, points0());
// Scaling: 1 up to di then linear down to 0 at do away from patches
scale_.internalField() =
scale_.internalFieldRef() =
min
(
max
@ -130,7 +130,7 @@ Foam::sixDoFRigidBodyMotionSolver::sixDoFRigidBodyMotionSolver
);
// Convert the scale function to a cosine
scale_.internalField() =
scale_.internalFieldRef() =
min
(
max
@ -241,7 +241,7 @@ void Foam::sixDoFRigidBodyMotionSolver::solve()
}
// Update the displacements
pointDisplacement_.internalField() =
pointDisplacement_.internalFieldRef() =
motion_.transform(points0(), scale_) - points0();
// Displacement has changed. Update boundary conditions

View File

@ -54,7 +54,7 @@ heBoundaryCorrection(volScalarField& h)
template<class BasicThermo, class MixtureType>
void Foam::heThermo<BasicThermo, MixtureType>::init()
{
scalarField& heCells = he_.internalField();
scalarField& heCells = he_.internalFieldRef();
const scalarField& pCells = this->p_;
const scalarField& TCells = this->T_;
@ -187,7 +187,7 @@ Foam::tmp<Foam::volScalarField> Foam::heThermo<BasicThermo, MixtureType>::he
);
volScalarField& he = the.ref();
scalarField& heCells = he.internalField();
scalarField& heCells = he.internalFieldRef();
const scalarField& pCells = p;
const scalarField& TCells = T;
@ -282,7 +282,7 @@ Foam::heThermo<BasicThermo, MixtureType>::hc() const
);
volScalarField& hcf = thc.ref();
scalarField& hcCells = hcf.internalField();
scalarField& hcCells = hcf.internalFieldRef();
forAll(hcCells, celli)
{

View File

@ -33,10 +33,10 @@ void Foam::hePsiThermo<BasicPsiThermo, MixtureType>::calculate()
const scalarField& hCells = this->he_;
const scalarField& pCells = this->p_;
scalarField& TCells = this->T_.internalField();
scalarField& psiCells = this->psi_.internalField();
scalarField& muCells = this->mu_.internalField();
scalarField& alphaCells = this->alpha_.internalField();
scalarField& TCells = this->T_.internalFieldRef();
scalarField& psiCells = this->psi_.internalFieldRef();
scalarField& muCells = this->mu_.internalFieldRef();
scalarField& alphaCells = this->alpha_.internalFieldRef();
forAll(TCells, celli)
{

View File

@ -33,11 +33,11 @@ void Foam::heRhoThermo<BasicPsiThermo, MixtureType>::calculate()
const scalarField& hCells = this->he();
const scalarField& pCells = this->p_;
scalarField& TCells = this->T_.internalField();
scalarField& psiCells = this->psi_.internalField();
scalarField& rhoCells = this->rho_.internalField();
scalarField& muCells = this->mu_.internalField();
scalarField& alphaCells = this->alpha_.internalField();
scalarField& TCells = this->T_.internalFieldRef();
scalarField& psiCells = this->psi_.internalFieldRef();
scalarField& rhoCells = this->rho_.internalFieldRef();
scalarField& muCells = this->mu_.internalFieldRef();
scalarField& alphaCells = this->alpha_.internalFieldRef();
forAll(TCells, celli)
{

View File

@ -213,7 +213,7 @@ Foam::radiation::greyMeanAbsorptionEmission::aCont(const label bandI) const
)
);
scalarField& a = ta.ref().internalField();
scalarField& a = ta.ref().internalFieldRef();
forAll(a, celli)
{
@ -300,11 +300,11 @@ Foam::radiation::greyMeanAbsorptionEmission::ECont(const label bandI) const
if (dQ.dimensions() == dimEnergy/dimTime)
{
E.ref().internalField() = EhrrCoeff_*dQ/mesh_.V();
E.ref().internalFieldRef() = EhrrCoeff_*dQ/mesh_.V();
}
else if (dQ.dimensions() == dimEnergy/dimTime/dimVolume)
{
E.ref().internalField() = EhrrCoeff_*dQ;
E.ref().internalFieldRef() = EhrrCoeff_*dQ;
}
else
{

Some files were not shown because too many files have changed in this diff Show More