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; Info<< "Time = " << runTime.timeName() << nl << endl;
force.internalField() = ReImSum force.internalFieldRef() = ReImSum
( (
fft::reverseTransform fft::reverseTransform
( (

View File

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

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -74,7 +74,7 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::Gulder::XiEq() const
if (subGridSchelkin_) if (subGridSchelkin_)
{ {
up.internalField() += calculateSchelkinEffect(uPrimeCoef_); up.internalFieldRef() += calculateSchelkinEffect(uPrimeCoef_);
} }
volScalarField tauEta(sqrt(mag(thermo_.muu()/(thermo_.rhou()*epsilon)))); 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)); volScalarField up(sqrt((2.0/3.0)*k));
if (subGridSchelkin_) if (subGridSchelkin_)
{ {
up.internalField() += calculateSchelkinEffect(uPrimeCoef_); up.internalFieldRef() += calculateSchelkinEffect(uPrimeCoef_);
} }
volScalarField l(lCoef_*sqrt(3.0/2.0)*up*k/epsilon); 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(); 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 volSymmTensorField ns
( (
@ -134,7 +134,7 @@ Foam::XiEqModel::calculateSchelkinEffect(const scalar uPrimeCoef) const
Zero 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 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)); const scalarField deltaUp(upLocal*(max(scalar(1.0), pow(nr, 0.5)) - 1.0));
// Re use tN // 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; return tN;
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -164,7 +164,7 @@ int main(int argc, char *argv[])
dimensionedScalar("one", dimless, 1.0), dimensionedScalar("one", dimless, 1.0),
calculatedPointPatchScalarField::typeName calculatedPointPatchScalarField::typeName
); );
pointX.internalField() = mesh.points().component(0); pointX.internalFieldRef() = mesh.points().component(0);
pointX.correctBoundaryConditions(); pointX.correctBoundaryConditions();
Info<< "Writing x-component field " Info<< "Writing x-component field "
<< pointX.name() << " in " << runTime.timeName() << endl; << pointX.name() << " in " << runTime.timeName() << endl;

View File

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

View File

@ -1137,7 +1137,7 @@ void Foam::conformalVoronoiMesh::writeCellSizes
zeroGradientFvPatchScalarField::typeName zeroGradientFvPatchScalarField::typeName
); );
scalarField& cellSize = targetCellSize.internalField(); scalarField& cellSize = targetCellSize.internalFieldRef();
const vectorField& C = mesh.cellCentres(); const vectorField& C = mesh.cellCentres();
@ -1163,7 +1163,7 @@ void Foam::conformalVoronoiMesh::writeCellSizes
// zeroGradientFvPatchScalarField::typeName // zeroGradientFvPatchScalarField::typeName
// ); // );
// targetCellVolume.internalField() = pow3(cellSize); // targetCellVolume.internalFieldRef() = pow3(cellSize);
// Info<< nl << "Create actualCellVolume volScalarField" << endl; // Info<< nl << "Create actualCellVolume volScalarField" << endl;
@ -1182,7 +1182,7 @@ void Foam::conformalVoronoiMesh::writeCellSizes
// zeroGradientFvPatchScalarField::typeName // zeroGradientFvPatchScalarField::typeName
// ); // );
// actualCellVolume.internalField() = mesh.cellVolumes(); // actualCellVolume.internalFieldRef() = mesh.cellVolumes();
// Info<< nl << "Create equivalentCellSize volScalarField" << endl; // Info<< nl << "Create equivalentCellSize volScalarField" << endl;
@ -1201,7 +1201,7 @@ void Foam::conformalVoronoiMesh::writeCellSizes
// zeroGradientFvPatchScalarField::typeName // zeroGradientFvPatchScalarField::typeName
// ); // );
// equivalentCellSize.internalField() = pow // equivalentCellSize.internalFieldRef() = pow
// ( // (
// actualCellVolume.internalField(), // actualCellVolume.internalField(),
// 1.0/3.0 // 1.0/3.0
@ -1247,7 +1247,7 @@ void Foam::conformalVoronoiMesh::writeCellSizes
// pointPatchVectorField::calculatedType() // pointPatchVectorField::calculatedType()
// ); // );
// scalarField& cellSize = ptTargetCellSize.internalField(); // scalarField& cellSize = ptTargetCellSize.internalFieldRef();
// const vectorField& P = tetMesh.points(); // const vectorField& P = tetMesh.points();
@ -1283,7 +1283,7 @@ void Foam::conformalVoronoiMesh::writeCellAlignments
// zeroGradientFvPatchTensorField::typeName // zeroGradientFvPatchTensorField::typeName
// ); // );
// //
// tensorField& cellAlignment = cellAlignments.internalField(); // tensorField& cellAlignment = cellAlignments.internalFieldRef();
// //
// const vectorField& C = mesh.cellCentres(); // 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) forAll(cellVertices, cI)
{ {
// Give a small but finite weight for empty cells. Some // Give a small but finite weight for empty cells. Some
// decomposition methods have difficulty with integer overflows in // decomposition methods have difficulty with integer overflows in
// the sum of the normalised weight field. // the sum of the normalised weight field.
cellWeights.internalField()[cI] = max cwi[cI] = max(cellVertices[cI], 1e-2);
(
cellVertices[cI],
1e-2
);
} }
autoPtr<mapDistributePolyMesh> mapDist = decomposition_().distribute autoPtr<mapDistributePolyMesh> mapDist = decomposition_().distribute

View File

@ -636,7 +636,7 @@ int main(int argc, char *argv[])
{ {
// Internal field // Internal field
cellDistance.internalField() = signedDistance cellDistance.internalFieldRef() = signedDistance
( (
distSqr, distSqr,
fvm.C(), fvm.C(),
@ -701,7 +701,7 @@ int main(int argc, char *argv[])
-sqr(GREAT) // null value -sqr(GREAT) // null value
); );
pointDistance.internalField() = signedDistance pointDistance.internalFieldRef() = signedDistance
( (
pointDistSqr, pointDistSqr,
fvm.points(), 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. // Map from read field. Set unmapped entries to nullValue.
fld.setSize(map.size(), nullValue); fld.setSize(map.size(), nullValue);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -57,7 +57,7 @@ int main(int argc, char *argv[])
turbGen Ugen(K, Ea, k0); turbGen Ugen(K, Ea, k0);
U.internalField() = Ugen.U(); U.internalFieldRef() = Ugen.U();
U.correctBoundaryConditions(); U.correctBoundaryConditions();
Info<< "k(" Info<< "k("

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -45,7 +45,7 @@ void transform
const GeometricField<Type, PatchField, GeoMesh>& tf 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()); transform(rtf.boundaryFieldRef(), trf.boundaryField(), tf.boundaryField());
} }
@ -131,7 +131,7 @@ void transform
const GeometricField<Type, PatchField, GeoMesh>& tf 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()); 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 cellList& cells = mesh.cells();
const vectorField& faceCentres = mesh.faceCentres(); const vectorField& faceCentres = mesh.faceCentres();
@ -113,7 +113,7 @@ void Foam::LESModels::IDDESDelta::calcDelta()
<< "Case must be either 2D or 3D" << exit(FatalError); << "Case must be either 2D or 3D" << exit(FatalError);
} }
delta_.internalField() = delta_.internalFieldRef() =
min min
( (
max max

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -48,7 +48,7 @@ void Foam::LESModels::cubeRootVolDelta::calcDelta()
if (nD == 3) 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) 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 else
{ {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -3,7 +3,7 @@
// The ddt term constructed by hand because it would be wrong for // The ddt term constructed by hand because it would be wrong for
// Backward Differencing in time. // Backward Differencing in time.
conserve.internalField() += conserve.internalFieldRef() +=
(1.0 - mesh.V0()/mesh.V())/runTime.deltaTValue(); (1.0 - mesh.V0()/mesh.V())/runTime.deltaTValue();
scalar sumLocalContErr = 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() rDeltaT.internalField()*dt.value()
*(1.0 - mesh().Vsc0()/mesh().Vsc()); *(1.0 - mesh().Vsc0()/mesh().Vsc());

View File

@ -373,7 +373,7 @@ CrankNicolsonDdtScheme<Type>::fvcDdt
{ {
scalar rDtCoef0 = rDtCoef0_(ddt0).value(); scalar rDtCoef0 = rDtCoef0_(ddt0).value();
ddt0.internalField() = ddt0.internalFieldRef() =
( (
rDtCoef0* rDtCoef0*
( (
@ -466,7 +466,7 @@ CrankNicolsonDdtScheme<Type>::fvcDdt
{ {
scalar rDtCoef0 = rDtCoef0_(ddt0).value(); scalar rDtCoef0 = rDtCoef0_(ddt0).value();
ddt0.internalField() = ddt0.internalFieldRef() =
( (
rDtCoef0*rho.value()* rDtCoef0*rho.value()*
( (
@ -559,7 +559,7 @@ CrankNicolsonDdtScheme<Type>::fvcDdt
{ {
scalar rDtCoef0 = rDtCoef0_(ddt0).value(); scalar rDtCoef0 = rDtCoef0_(ddt0).value();
ddt0.internalField() = ddt0.internalFieldRef() =
( (
rDtCoef0* rDtCoef0*
( (
@ -663,7 +663,7 @@ CrankNicolsonDdtScheme<Type>::fvcDdt
{ {
scalar rDtCoef0 = rDtCoef0_(ddt0).value(); scalar rDtCoef0 = rDtCoef0_(ddt0).value();
ddt0.internalField() = ddt0.internalFieldRef() =
( (
rDtCoef0* rDtCoef0*
( (
@ -801,7 +801,7 @@ CrankNicolsonDdtScheme<Type>::fvmDdt
{ {
scalar rDtCoef0 = rDtCoef0_(ddt0).value(); scalar rDtCoef0 = rDtCoef0_(ddt0).value();
ddt0.internalField() = ddt0.internalFieldRef() =
( (
rDtCoef0* rDtCoef0*
( (
@ -886,7 +886,7 @@ CrankNicolsonDdtScheme<Type>::fvmDdt
{ {
scalar rDtCoef0 = rDtCoef0_(ddt0).value(); scalar rDtCoef0 = rDtCoef0_(ddt0).value();
ddt0.internalField() = ddt0.internalFieldRef() =
( (
rDtCoef0*rho.value()* rDtCoef0*rho.value()*
( (
@ -972,7 +972,7 @@ CrankNicolsonDdtScheme<Type>::fvmDdt
{ {
scalar rDtCoef0 = rDtCoef0_(ddt0).value(); scalar rDtCoef0 = rDtCoef0_(ddt0).value();
ddt0.internalField() = ddt0.internalFieldRef() =
( (
rDtCoef0* rDtCoef0*
( (
@ -1067,7 +1067,7 @@ CrankNicolsonDdtScheme<Type>::fvmDdt
{ {
scalar rDtCoef0 = rDtCoef0_(ddt0).value(); scalar rDtCoef0 = rDtCoef0_(ddt0).value();
ddt0.internalField() = ddt0.internalFieldRef() =
( (
rDtCoef0* 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()); rDeltaT.value()*dt.value()*(1.0 - mesh().Vsc0()/mesh().Vsc());
return tdtdt; return tdtdt;

View File

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

View File

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

View File

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

View File

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

View File

@ -165,7 +165,7 @@ Foam::fv::faceLimitedGrad<Foam::scalar>::calcGrad
<< " average: " << gAverage(limiter) << endl; << " average: " << gAverage(limiter) << endl;
} }
g.internalField() *= limiter; g.internalFieldRef() *= limiter;
g.correctBoundaryConditions(); g.correctBoundaryConditions();
gaussGrad<scalar>::correctBoundaryConditions(vsf, g); gaussGrad<scalar>::correctBoundaryConditions(vsf, g);
@ -326,7 +326,7 @@ Foam::fv::faceLimitedGrad<Foam::vector>::calcGrad
<< " average: " << gAverage(limiter) << endl; << " average: " << gAverage(limiter) << endl;
} }
g.internalField() *= limiter; g.internalFieldRef() *= limiter;
g.correctBoundaryConditions(); g.correctBoundaryConditions();
gaussGrad<vector>::correctBoundaryConditions(vvf, g); 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 pointField& points = mesh.points();
const faceList& faces = mesh.faces(); const faceList& faces = mesh.faces();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -378,7 +378,7 @@ void Foam::pointConstraints::constrainDisplacement
syncUntransformedData syncUntransformedData
( (
pf.mesh()(), pf.mesh()(),
pf.internalField(), pf.internalFieldRef(),
maxMagSqrEqOp<vector>() maxMagSqrEqOp<vector>()
); );
@ -390,7 +390,7 @@ void Foam::pointConstraints::constrainDisplacement
twoDPointCorrector::New(mesh()()).correctDisplacement twoDPointCorrector::New(mesh()()).correctDisplacement
( (
mesh()().points(), mesh()().points(),
pf.internalField() pf.internalFieldRef()
); );
if (overrideFixedValue) if (overrideFixedValue)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -85,7 +85,7 @@ void Foam::inverseVolumeDiffusivity::correct()
zeroGradientFvPatchScalarField::typeName zeroGradientFvPatchScalarField::typeName
); );
V.internalField() = mesh().V(); V.internalFieldRef() = mesh().V();
V.correctBoundaryConditions(); V.correctBoundaryConditions();
faceDiffusivity_ = 1.0/fvc::interpolate(V); 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 heMin(thermo.he(thermo.p(), Tmin, cells_));
scalarField heMax(thermo.he(thermo.p(), Tmax, cells_)); scalarField heMax(thermo.he(thermo.p(), Tmax, cells_));
scalarField& hec = he.internalField(); scalarField& hec = he.internalFieldRef();
forAll(cells_, i) 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()) if (cells_.size() != values.size())
{ {

View File

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

View File

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

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -122,7 +122,7 @@ void Foam::fv::tabulatedHeatTransfer::calculateHtc()
const volVectorField& U = mesh_.lookupObject<volVectorField>(UName_); const volVectorField& U = mesh_.lookupObject<volVectorField>(UName_);
scalarField& htcc = htc_.internalField(); scalarField& htcc = htc_.internalFieldRef();
forAll(htcc, i) forAll(htcc, i)
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -122,7 +122,7 @@ void Foam::fv::variableHeatTransfer::calculateHtc()
const scalarField htcNbrMapped(interpolate(htcNbr)); 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 mostAbundantType
); );
sigmaTcRMax_.internalField() = cP.sigmaT()*maxwellianMostProbableSpeed sigmaTcRMax_.internalFieldRef() = cP.sigmaT()*maxwellianMostProbableSpeed
( (
temperature, temperature,
cP.mass() cP.mass()
@ -414,13 +414,13 @@ void Foam::DSMCCloud<ParcelType>::resetFields()
template<class ParcelType> template<class ParcelType>
void Foam::DSMCCloud<ParcelType>::calculateFields() void Foam::DSMCCloud<ParcelType>::calculateFields()
{ {
scalarField& rhoN = rhoN_.internalField(); scalarField& rhoN = rhoN_.internalFieldRef();
scalarField& rhoM = rhoM_.internalField(); scalarField& rhoM = rhoM_.internalFieldRef();
scalarField& dsmcRhoN = dsmcRhoN_.internalField(); scalarField& dsmcRhoN = dsmcRhoN_.internalFieldRef();
scalarField& linearKE = linearKE_.internalField(); scalarField& linearKE = linearKE_.internalFieldRef();
scalarField& internalE = internalE_.internalField(); scalarField& internalE = internalE_.internalFieldRef();
scalarField& iDof = iDof_.internalField(); scalarField& iDof = iDof_.internalFieldRef();
vectorField& momentum = momentum_.internalField(); vectorField& momentum = momentum_.internalFieldRef();
forAllConstIter(typename DSMCCloud<ParcelType>, *this, iter) 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[celli] += p.nParticle()*p.areaP()*mag(p.U() - U_[celli]);
} }
vDotSweep.internalField() /= mesh_.V(); vDotSweep.internalFieldRef() /= mesh_.V();
vDotSweep.correctBoundaryConditions(); vDotSweep.correctBoundaryConditions();
return tvDotSweep; return tvDotSweep;
@ -522,7 +522,7 @@ Foam::KinematicCloud<CloudType>::theta() const
theta[celli] += p.nParticle()*p.volume(); theta[celli] += p.nParticle()*p.volume();
} }
theta.internalField() /= mesh_.V(); theta.internalFieldRef() /= mesh_.V();
theta.correctBoundaryConditions(); theta.correctBoundaryConditions();
return ttheta; 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) forAllConstIter(typename KinematicCloud<CloudType>, *this, iter)
{ {
const parcelType& p = 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) forAllConstIter(typename KinematicCloud<CloudType>, *this, iter)
{ {
const parcelType& p = iter(); const parcelType& p = iter();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -3,25 +3,25 @@
List<scalarField> allSpeciesN_RU List<scalarField> allSpeciesN_RU
( (
molecules.potential().nIds(), molecules.potential().nIds(),
scalarField (mesh.nCells(), 0.0) scalarField(mesh.nCells(), 0.0)
); );
List<scalarField> allSpeciesM_RU List<scalarField> allSpeciesM_RU
( (
molecules.potential().nIds(), molecules.potential().nIds(),
scalarField (mesh.nCells(), 0.0) scalarField(mesh.nCells(), 0.0)
); );
List<vectorField> allSpeciesVelocitySum_RU List<vectorField> allSpeciesVelocitySum_RU
( (
molecules.potential().nIds(), molecules.potential().nIds(),
vectorField (mesh.nCells(), Zero) vectorField(mesh.nCells(), Zero)
); );
List<scalarField> allSpeciesVelocityMagSquaredSum_RU List<scalarField> allSpeciesVelocityMagSquaredSum_RU
( (
molecules.potential().nIds(), molecules.potential().nIds(),
scalarField (mesh.nCells(), 0.0) scalarField(mesh.nCells(), 0.0)
); );
// Geometric Fields for IO // Geometric Fields for IO
@ -60,7 +60,7 @@ forAll(allSpeciesRhoN, rN)
"zeroGradient" "zeroGradient"
) )
); );
allSpeciesRhoN[rN].internalField() = scalarField (mesh.nCells(), 0.0); allSpeciesRhoN[rN].internalFieldRef() = 0;
allSpeciesRhoN[rN].correctBoundaryConditions(); allSpeciesRhoN[rN].correctBoundaryConditions();
} }
@ -80,7 +80,7 @@ volScalarField totalRhoN
dimless/dimVolume, dimless/dimVolume,
"zeroGradient" "zeroGradient"
); );
totalRhoN.internalField() = scalarField (mesh.nCells(), 0.0); totalRhoN.internalFieldRef() = 0;
totalRhoN.correctBoundaryConditions(); totalRhoN.correctBoundaryConditions();
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
@ -115,7 +115,7 @@ forAll(allSpeciesRhoM, rM)
"zeroGradient" "zeroGradient"
) )
); );
allSpeciesRhoM[rM].internalField() = scalarField (mesh.nCells(), 0.0); allSpeciesRhoM[rM].internalFieldRef() = 0;
allSpeciesRhoM[rM].correctBoundaryConditions(); allSpeciesRhoM[rM].correctBoundaryConditions();
} }
@ -135,7 +135,7 @@ volScalarField totalRhoM
dimMass/dimVolume, dimMass/dimVolume,
"zeroGradient" "zeroGradient"
); );
totalRhoM.internalField() = scalarField (mesh.nCells(), 0.0); totalRhoM.internalFieldRef() = 0;
totalRhoM.correctBoundaryConditions(); totalRhoM.correctBoundaryConditions();
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
@ -170,8 +170,7 @@ forAll(allSpeciesVelocity, v)
"zeroGradient" "zeroGradient"
) )
); );
allSpeciesVelocity[v].internalField() = allSpeciesVelocity[v].internalFieldRef() = Zero;
vectorField (mesh.nCells(), Zero);
allSpeciesVelocity[v].correctBoundaryConditions(); allSpeciesVelocity[v].correctBoundaryConditions();
} }
@ -191,7 +190,7 @@ Info << " Creating total velocity field" << endl;
// dimVelocity, // dimVelocity,
// "zeroGradient" // "zeroGradient"
// ); // );
// totalVelocity.internalField() = vectorField (mesh.nCells(), Zero); // totalVelocity.internalFieldRef() = Zero;
// totalVelocity.correctBoundaryConditions(); // totalVelocity.correctBoundaryConditions();
@ -244,7 +243,7 @@ forAll(allSpeciesTemperature, t)
"zeroGradient" "zeroGradient"
) )
); );
allSpeciesTemperature[t].internalField() = scalarField (mesh.nCells(), 0.0); allSpeciesTemperature[t].internalFieldRef() = 0;
allSpeciesTemperature[t].correctBoundaryConditions(); allSpeciesTemperature[t].correctBoundaryConditions();
} }
@ -264,7 +263,7 @@ volScalarField totalTemperature
dimTemperature, dimTemperature,
"zeroGradient" "zeroGradient"
); );
totalTemperature.internalField() = scalarField (mesh.nCells(), 0.0); totalTemperature.internalFieldRef() = 0;
totalTemperature.correctBoundaryConditions(); totalTemperature.correctBoundaryConditions();
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
@ -300,7 +299,7 @@ forAll(allSpeciesMeanKE, mKE)
"zeroGradient" "zeroGradient"
) )
); );
allSpeciesMeanKE[mKE].internalField() = scalarField (mesh.nCells(), 0.0); allSpeciesMeanKE[mKE].internalFieldRef() = 0;
allSpeciesMeanKE[mKE].correctBoundaryConditions(); allSpeciesMeanKE[mKE].correctBoundaryConditions();
} }
@ -320,5 +319,5 @@ volScalarField totalMeanKE
dimensionSet(1, 2, -2, 0, 0, 0, 0), dimensionSet(1, 2, -2, 0, 0, 0, 0),
"zeroGradient" "zeroGradient"
); );
totalMeanKE.internalField() = scalarField (mesh.nCells(), 0.0); totalMeanKE.internalFieldRef() = 0;
totalMeanKE.correctBoundaryConditions(); 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(); trho.ref().correctBoundaryConditions();
return trho; 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(); tmu.ref().correctBoundaryConditions();
return tmu; 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(); tsigma.ref().correctBoundaryConditions();
return tsigma; 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(); tCp.ref().correctBoundaryConditions();
return tCp; 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(); tkappa.ref().correctBoundaryConditions();
return tkappa; 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_) if (useReferenceValues_)
{ {
@ -303,7 +303,7 @@ tmp<volScalarField> liquidFilmThermo::mu() const
) )
); );
scalarField& mu = tmu.ref().internalField(); scalarField& mu = tmu.ref().internalFieldRef();
if (useReferenceValues_) if (useReferenceValues_)
{ {
@ -351,7 +351,7 @@ tmp<volScalarField> liquidFilmThermo::sigma() const
) )
); );
scalarField& sigma = tsigma.ref().internalField(); scalarField& sigma = tsigma.ref().internalFieldRef();
if (useReferenceValues_) if (useReferenceValues_)
{ {
@ -399,7 +399,7 @@ tmp<volScalarField> liquidFilmThermo::Cp() const
) )
); );
scalarField& Cp = tCp.ref().internalField(); scalarField& Cp = tCp.ref().internalFieldRef();
if (useReferenceValues_) if (useReferenceValues_)
{ {
@ -447,7 +447,7 @@ tmp<volScalarField> liquidFilmThermo::kappa() const
) )
); );
scalarField& kappa = tkappa.ref().internalField(); scalarField& kappa = tkappa.ref().internalFieldRef();
if (useReferenceValues_) 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& own = owner_.regionMesh().owner();
const labelUList& nbr = owner_.regionMesh().neighbour(); 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 // apply defined patch radii
const scalar rMin = 1e-6; const scalar rMin = 1e-6;
@ -207,7 +207,7 @@ tmp<scalarField> curvatureSeparation::calcCosAngle
dimensionedScalar("zero", dimless, 0.0), dimensionedScalar("zero", dimless, 0.0),
zeroGradientFvPatchScalarField::typeName zeroGradientFvPatchScalarField::typeName
); );
volCosAngle.internalField() = cosAngle; volCosAngle.internalFieldRef() = cosAngle;
volCosAngle.correctBoundaryConditions(); volCosAngle.correctBoundaryConditions();
volCosAngle.write(); volCosAngle.write();
} }
@ -349,7 +349,7 @@ void curvatureSeparation::correct
dimensionedScalar("zero", dimForce, 0.0), dimensionedScalar("zero", dimForce, 0.0),
zeroGradientFvPatchScalarField::typeName zeroGradientFvPatchScalarField::typeName
); );
volFnet.internalField() = Fnet; volFnet.internalFieldRef() = Fnet;
volFnet.correctBoundaryConditions(); volFnet.correctBoundaryConditions();
volFnet.write(); volFnet.write();
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -33,11 +33,11 @@ void Foam::heRhoThermo<BasicPsiThermo, MixtureType>::calculate()
const scalarField& hCells = this->he(); const scalarField& hCells = this->he();
const scalarField& pCells = this->p_; const scalarField& pCells = this->p_;
scalarField& TCells = this->T_.internalField(); scalarField& TCells = this->T_.internalFieldRef();
scalarField& psiCells = this->psi_.internalField(); scalarField& psiCells = this->psi_.internalFieldRef();
scalarField& rhoCells = this->rho_.internalField(); scalarField& rhoCells = this->rho_.internalFieldRef();
scalarField& muCells = this->mu_.internalField(); scalarField& muCells = this->mu_.internalFieldRef();
scalarField& alphaCells = this->alpha_.internalField(); scalarField& alphaCells = this->alpha_.internalFieldRef();
forAll(TCells, celli) 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) forAll(a, celli)
{ {
@ -300,11 +300,11 @@ Foam::radiation::greyMeanAbsorptionEmission::ECont(const label bandI) const
if (dQ.dimensions() == dimEnergy/dimTime) 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) else if (dQ.dimensions() == dimEnergy/dimTime/dimVolume)
{ {
E.ref().internalField() = EhrrCoeff_*dQ; E.ref().internalFieldRef() = EhrrCoeff_*dQ;
} }
else else
{ {

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