GeometricField::dimensionedInteralFieldRef() -> GeometricField::ref()

In order to simplify expressions involving dimensioned internal field it
is preferable to use a simpler access convention.  Given that
GeometricField is derived from DimensionedField it is simply a matter of
de-referencing this underlying type unlike the boundary field which is
peripheral information.  For consistency with the new convention in
"tmp"  "dimensionedInteralFieldRef()" has been renamed "ref()".
This commit is contained in:
Henry Weller
2016-04-30 18:43:51 +01:00
parent 68b69a25a4
commit ccd958a8f1
40 changed files with 136 additions and 134 deletions

View File

@ -58,10 +58,10 @@ License
// Flow time scale // Flow time scale
{ {
rDeltaT.dimensionedInternalFieldRef() = rDeltaT.ref() =
( (
fvc::surfaceSum(mag(phi))().dimensionedInternalField() fvc::surfaceSum(mag(phi))()()
/((2*maxCo)*mesh.V()*rho.dimensionedInternalField()) /((2*maxCo)*mesh.V()*rho())
); );
// Limit the largest time scale // Limit the largest time scale
@ -84,9 +84,9 @@ License
<< gMin(1/(rDeltaTT.field() + VSMALL)) << ", " << gMin(1/(rDeltaTT.field() + VSMALL)) << ", "
<< gMax(1/(rDeltaTT.field() + VSMALL)) << endl; << gMax(1/(rDeltaTT.field() + VSMALL)) << endl;
rDeltaT.dimensionedInternalFieldRef() = max rDeltaT.ref() = max
( (
rDeltaT.dimensionedInternalField(), rDeltaT(),
rDeltaTT rDeltaTT
); );
} }

View File

@ -185,9 +185,9 @@ int main(int argc, char *argv[])
// --- Solve momentum // --- Solve momentum
solve(fvm::ddt(rhoU) + fvc::div(phiUp)); solve(fvm::ddt(rhoU) + fvc::div(phiUp));
U.dimensionedInternalFieldRef() = U.ref() =
rhoU.dimensionedInternalField() rhoU()
/rho.dimensionedInternalField(); /rho();
U.correctBoundaryConditions(); U.correctBoundaryConditions();
rhoU.boundaryFieldRef() == rho.boundaryField()*U.boundaryField(); rhoU.boundaryFieldRef() == rho.boundaryField()*U.boundaryField();
@ -240,9 +240,9 @@ int main(int argc, char *argv[])
rhoE = rho*(e + 0.5*magSqr(U)); rhoE = rho*(e + 0.5*magSqr(U));
} }
p.dimensionedInternalFieldRef() = p.ref() =
rho.dimensionedInternalField() rho()
/psi.dimensionedInternalField(); /psi();
p.correctBoundaryConditions(); p.correctBoundaryConditions();
rho.boundaryFieldRef() == psi.boundaryField()*p.boundaryField(); rho.boundaryFieldRef() == psi.boundaryField()*p.boundaryField();

View File

@ -178,9 +178,9 @@ int main(int argc, char *argv[])
// --- Solve momentum // --- Solve momentum
solve(fvm::ddt(rhoU) + fvc::div(phiUp)); solve(fvm::ddt(rhoU) + fvc::div(phiUp));
U.dimensionedInternalFieldRef() = U.ref() =
rhoU.dimensionedInternalField() rhoU()
/rho.dimensionedInternalField(); /rho();
U.correctBoundaryConditions(); U.correctBoundaryConditions();
rhoU.boundaryFieldRef() == rho.boundaryField()*U.boundaryField(); rhoU.boundaryFieldRef() == rho.boundaryField()*U.boundaryField();
@ -233,9 +233,9 @@ int main(int argc, char *argv[])
rhoE = rho*(e + 0.5*magSqr(U)); rhoE = rho*(e + 0.5*magSqr(U));
} }
p.dimensionedInternalFieldRef() = p.ref() =
rho.dimensionedInternalField() rho()
/psi.dimensionedInternalField(); /psi();
p.correctBoundaryConditions(); p.correctBoundaryConditions();
rho.boundaryFieldRef() == psi.boundaryField()*p.boundaryField(); rho.boundaryFieldRef() == psi.boundaryField()*p.boundaryField();

View File

@ -11,10 +11,10 @@
); );
// Set the reciprocal time-step from the local Courant number // Set the reciprocal time-step from the local Courant number
rDeltaT.dimensionedInternalFieldRef() = max rDeltaT.ref() = max
( (
1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT), 1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT),
fvc::surfaceSum(amaxSf)().dimensionedInternalField() fvc::surfaceSum(amaxSf)()()
/((2*maxCo)*mesh.V()) /((2*maxCo)*mesh.V())
); );

View File

@ -26,11 +26,11 @@
volScalarField rDeltaT0("rDeltaT0", rDeltaT); volScalarField rDeltaT0("rDeltaT0", rDeltaT);
// Set the reciprocal time-step from the local Courant number // Set the reciprocal time-step from the local Courant number
rDeltaT.dimensionedInternalFieldRef() = max rDeltaT.ref() = max
( (
1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT), 1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT),
fvc::surfaceSum(mag(phi))().dimensionedInternalField() fvc::surfaceSum(mag(phi))()()
/((2*maxCo)*mesh.V()*rho.dimensionedInternalField()) /((2*maxCo)*mesh.V()*rho())
); );
if (pimple.transonic()) if (pimple.transonic())
@ -41,11 +41,11 @@
fvc::interpolate(psi)*fvc::flux(U) fvc::interpolate(psi)*fvc::flux(U)
); );
rDeltaT.dimensionedInternalFieldRef() = max rDeltaT.ref() = max
( (
rDeltaT.dimensionedInternalField(), rDeltaT(),
fvc::surfaceSum(mag(phid))().dimensionedInternalField() fvc::surfaceSum(mag(phid))()()
/((2*maxCo)*mesh.V()*psi.dimensionedInternalField()) /((2*maxCo)*mesh.V()*psi())
); );
} }

View File

@ -6,7 +6,7 @@
+ MRF.DDt(rho, U) + MRF.DDt(rho, U)
+ turbulence->divDevRhoReff(U) + turbulence->divDevRhoReff(U)
== ==
rho.dimensionedInternalField()*g rho()*g
+ coalParcels.SU(U) + coalParcels.SU(U)
+ limestoneParcels.SU(U) + limestoneParcels.SU(U)
+ fvOptions(rho, U) + fvOptions(rho, U)

View File

@ -58,10 +58,10 @@ License
// Flow time scale // Flow time scale
{ {
rDeltaT.dimensionedInternalFieldRef() = rDeltaT.ref() =
( (
fvc::surfaceSum(mag(phi))().dimensionedInternalField() fvc::surfaceSum(mag(phi))()()
/((2*maxCo)*mesh.V()*rho.dimensionedInternalField()) /((2*maxCo)*mesh.V()*rho())
); );
// Limit the largest time scale // Limit the largest time scale
@ -84,9 +84,9 @@ License
) )
/( /(
alphaTemp alphaTemp
*rho.dimensionedInternalField() *rho()
*thermo.Cp()().dimensionedInternalField() *thermo.Cp()()()
*T.dimensionedInternalField() *T()
) )
); );
@ -94,9 +94,9 @@ License
<< gMin(1/(rDeltaTT.field() + VSMALL)) << ", " << gMin(1/(rDeltaTT.field() + VSMALL)) << ", "
<< gMax(1/(rDeltaTT.field() + VSMALL)) << endl; << gMax(1/(rDeltaTT.field() + VSMALL)) << endl;
rDeltaT.dimensionedInternalFieldRef() = max rDeltaT.ref() = max
( (
rDeltaT.dimensionedInternalField(), rDeltaT(),
rDeltaTT rDeltaTT
); );
} }

View File

@ -6,7 +6,7 @@
+ MRF.DDt(rho, U) + MRF.DDt(rho, U)
+ turbulence->divDevRhoReff(U) + turbulence->divDevRhoReff(U)
== ==
rho.dimensionedInternalField()*g rho()*g
+ parcels.SU(U) + parcels.SU(U)
+ fvOptions(rho, U) + fvOptions(rho, U)
); );

View File

@ -58,10 +58,10 @@ License
// Flow time scale // Flow time scale
{ {
rDeltaT.dimensionedInternalFieldRef() = rDeltaT.ref() =
( (
fvc::surfaceSum(mag(phi))().dimensionedInternalField() fvc::surfaceSum(mag(phi))()()
/((2*maxCo)*mesh.V()*rho.dimensionedInternalField()) /((2*maxCo)*mesh.V()*rho())
); );
// Limit the largest time scale // Limit the largest time scale
@ -83,9 +83,9 @@ License
) )
/( /(
alphaTemp alphaTemp
*rho.dimensionedInternalField() *rho()
*thermo.Cp()().dimensionedInternalField() *thermo.Cp()()()
*T.dimensionedInternalField() *T()
) )
); );
@ -93,9 +93,9 @@ License
<< gMin(1/(rDeltaTT.field() + VSMALL)) << ", " << gMin(1/(rDeltaTT.field() + VSMALL)) << ", "
<< gMax(1/(rDeltaTT.field() + VSMALL)) << endl; << gMax(1/(rDeltaTT.field() + VSMALL)) << endl;
rDeltaT.dimensionedInternalFieldRef() = max rDeltaT.ref() = max
( (
rDeltaT.dimensionedInternalField(), rDeltaT(),
rDeltaTT rDeltaTT
); );
} }

View File

@ -6,7 +6,7 @@
+ MRF.DDt(rho, U) + MRF.DDt(rho, U)
+ turbulence->divDevRhoReff(U) + turbulence->divDevRhoReff(U)
== ==
rho.dimensionedInternalField()*g rho()*g
+ parcels.SU(U) + parcels.SU(U)
+ fvOptions(rho, U) + fvOptions(rho, U)
); );

View File

@ -8,7 +8,7 @@ tmp<fvVectorMatrix> tUEqn
+ MRF.DDt(rho, U) + MRF.DDt(rho, U)
+ turbulence->divDevRhoReff(U) + turbulence->divDevRhoReff(U)
== ==
rho.dimensionedInternalField()*g rho()*g
+ parcels.SU(U) + parcels.SU(U)
+ fvOptions(rho, U) + fvOptions(rho, U)
); );

View File

@ -56,11 +56,11 @@
volScalarField rDeltaT0("rDeltaT0", rDeltaT); volScalarField rDeltaT0("rDeltaT0", rDeltaT);
// Set the reciprocal time-step from the local Courant number // Set the reciprocal time-step from the local Courant number
rDeltaT.dimensionedInternalFieldRef() = max rDeltaT.ref() = max
( (
1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT), 1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT),
fvc::surfaceSum(mag(rhoPhi))().dimensionedInternalField() fvc::surfaceSum(mag(rhoPhi))()()
/((2*maxCo)*mesh.V()*rho.dimensionedInternalField()) /((2*maxCo)*mesh.V()*rho())
); );
if (maxAlphaCo < maxCo) if (maxAlphaCo < maxCo)
@ -70,12 +70,12 @@
volScalarField alpha1Bar(fvc::average(alpha1)); volScalarField alpha1Bar(fvc::average(alpha1));
rDeltaT.dimensionedInternalFieldRef() = max rDeltaT.ref() = max
( (
rDeltaT.dimensionedInternalField(), rDeltaT(),
pos(alpha1Bar.dimensionedInternalField() - alphaSpreadMin) pos(alpha1Bar() - alphaSpreadMin)
*pos(alphaSpreadMax - alpha1Bar.dimensionedInternalField()) *pos(alphaSpreadMax - alpha1Bar())
*fvc::surfaceSum(mag(phi))().dimensionedInternalField() *fvc::surfaceSum(mag(phi))()()
/((2*maxAlphaCo)*mesh.V()) /((2*maxAlphaCo)*mesh.V())
); );
} }

View File

@ -43,7 +43,7 @@ forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter)
slamDampCoeff slamDampCoeff
*max *max
( (
mag(U.dimensionedInternalField()) - maxSlamVelocity, mag(U()) - maxSlamVelocity,
dimensionedScalar("U0", dimVelocity, 0) dimensionedScalar("U0", dimVelocity, 0)
) )
/pow(mesh.V(), 1.0/3.0), /pow(mesh.V(), 1.0/3.0),

View File

@ -26,10 +26,10 @@
} }
// Set the reciprocal time-step from the local Courant number // Set the reciprocal time-step from the local Courant number
rDeltaT.dimensionedInternalFieldRef() = max rDeltaT.ref() = max
( (
1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT), 1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT),
fvc::surfaceSum(maxPhi)().dimensionedInternalField() fvc::surfaceSum(maxPhi)()()
/((2*maxCo)*mesh.V()) /((2*maxCo)*mesh.V())
); );

View File

@ -19,10 +19,10 @@
); );
// Set the reciprocal time-step from the local Courant number // Set the reciprocal time-step from the local Courant number
rDeltaT.dimensionedInternalFieldRef() = max rDeltaT.ref() = max
( (
1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT), 1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT),
fvc::surfaceSum(max(mag(phi1), mag(phi2)))().dimensionedInternalField() fvc::surfaceSum(max(mag(phi1), mag(phi2)))()()
/((2*maxCo)*mesh.V()) /((2*maxCo)*mesh.V())
); );

View File

@ -212,26 +212,26 @@ void Foam::twoPhaseSystem::solve()
{ {
tdgdt = tdgdt =
( (
alpha2.dimensionedInternalField() alpha2()
*phase1_.divU()().dimensionedInternalField() *phase1_.divU()()()
- alpha1.dimensionedInternalField() - alpha1()
*phase2_.divU()().dimensionedInternalField() *phase2_.divU()()()
); );
} }
else if (phase1_.divU().valid()) else if (phase1_.divU().valid())
{ {
tdgdt = tdgdt =
( (
alpha2.dimensionedInternalField() alpha2()
*phase1_.divU()().dimensionedInternalField() *phase1_.divU()()()
); );
} }
else if (phase2_.divU().valid()) else if (phase2_.divU().valid())
{ {
tdgdt = tdgdt =
( (
- alpha1.dimensionedInternalField() - alpha1()
*phase2_.divU()().dimensionedInternalField() *phase2_.divU()()()
); );
} }

View File

@ -115,7 +115,7 @@ int main(int argc, char *argv[])
calculatedFvPatchField<scalar>::typeName calculatedFvPatchField<scalar>::typeName
); );
V.dimensionedInternalFieldRef() = mesh.V(); V.ref() = mesh.V();
volScalarField::Boundary& Vbf = V.boundaryFieldRef(); volScalarField::Boundary& Vbf = V.boundaryFieldRef();

View File

@ -87,9 +87,9 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
mesh mesh
); );
Co.dimensionedInternalFieldRef() = Co.ref() =
(0.5*runTime.deltaT()) (0.5*runTime.deltaT())
*fvc::surfaceSum(mag(phi))().dimensionedInternalField() *fvc::surfaceSum(mag(phi))()()
/(rho*mesh.V()); /(rho*mesh.V());
Co.correctBoundaryConditions(); Co.correctBoundaryConditions();
} }
@ -97,9 +97,9 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
{ {
Info<< " Calculating incompressible Co" << endl; Info<< " Calculating incompressible Co" << endl;
Co.dimensionedInternalFieldRef() = Co.ref() =
(0.5*runTime.deltaT()) (0.5*runTime.deltaT())
*fvc::surfaceSum(mag(phi))().dimensionedInternalField() *fvc::surfaceSum(mag(phi))()()
/mesh.V(); /mesh.V();
Co.correctBoundaryConditions(); Co.correctBoundaryConditions();
} }

View File

@ -714,7 +714,7 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::~GeometricField()
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& Foam::GeometricField<Type, PatchField, GeoMesh>::Internal&
Foam::GeometricField<Type, PatchField, GeoMesh>::dimensionedInternalFieldRef() Foam::GeometricField<Type, PatchField, GeoMesh>::ref()
{ {
this->setUpToDate(); this->setUpToDate();
storeOldTimes(); storeOldTimes();
@ -1138,7 +1138,7 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::operator=
// Only assign field contents not ID // Only assign field contents not ID
dimensionedInternalFieldRef() = gf.dimensionedInternalField(); ref() = gf();
boundaryFieldRef() = gf.boundaryField(); boundaryFieldRef() = gf.boundaryField();
} }
@ -1182,7 +1182,7 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::operator=
const dimensioned<Type>& dt const dimensioned<Type>& dt
) )
{ {
dimensionedInternalFieldRef() = dt; ref() = dt;
boundaryFieldRef() = dt.value(); boundaryFieldRef() = dt.value();
} }
@ -1199,7 +1199,7 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::operator==
// Only assign field contents not ID // Only assign field contents not ID
dimensionedInternalFieldRef() = gf.dimensionedInternalField(); ref() = gf();
boundaryFieldRef() == gf.boundaryField(); boundaryFieldRef() == gf.boundaryField();
tgf.clear(); tgf.clear();
@ -1212,7 +1212,7 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::operator==
const dimensioned<Type>& dt const dimensioned<Type>& dt
) )
{ {
dimensionedInternalFieldRef() = dt; ref() = dt;
boundaryFieldRef() == dt.value(); boundaryFieldRef() == dt.value();
} }
@ -1227,7 +1227,7 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::operator op \
{ \ { \
checkField(*this, gf, #op); \ checkField(*this, gf, #op); \
\ \
dimensionedInternalFieldRef() op gf.dimensionedInternalField(); \ ref() op gf(); \
boundaryFieldRef() op gf.boundaryField(); \ boundaryFieldRef() op gf.boundaryField(); \
} \ } \
\ \
@ -1247,7 +1247,7 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::operator op \
const dimensioned<TYPE>& dt \ const dimensioned<TYPE>& dt \
) \ ) \
{ \ { \
dimensionedInternalFieldRef() op dt; \ ref() op dt; \
boundaryFieldRef() op dt.value(); \ boundaryFieldRef() op dt.value(); \
} }
@ -1268,7 +1268,7 @@ Foam::Ostream& Foam::operator<<
const GeometricField<Type, PatchField, GeoMesh>& gf const GeometricField<Type, PatchField, GeoMesh>& gf
) )
{ {
gf.dimensionedInternalField().writeData(os, "internalField"); gf().writeData(os, "internalField");
os << nl; os << nl;
gf.boundaryField().writeEntry("boundaryField", os); gf.boundaryField().writeEntry("boundaryField", os);

View File

@ -447,7 +447,7 @@ public:
//- Return a reference to the dimensioned internal field //- Return a reference to the dimensioned 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.
Internal& dimensionedInternalFieldRef(); Internal& ref();
//- Return a const-reference to the dimensioned internal field //- Return a const-reference to the dimensioned internal field
inline const Internal& dimensionedInternalField() const; inline const Internal& dimensionedInternalField() const;

View File

@ -33,17 +33,6 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::null()
} }
template<class Type, template<class> class PatchField, class GeoMesh>
inline
const typename
Foam::GeometricField<Type, PatchField, GeoMesh>::Internal&
Foam::GeometricField<Type, PatchField, GeoMesh>::
operator()() const
{
return *this;
}
template<class Type, template<class> class PatchField, class GeoMesh> template<class Type, template<class> class PatchField, class GeoMesh>
inline inline
const typename const typename
@ -90,4 +79,17 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::timeIndex()
} }
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class Type, template<class> class PatchField, class GeoMesh>
inline
const typename
Foam::GeometricField<Type, PatchField, GeoMesh>::Internal&
Foam::GeometricField<Type, PatchField, GeoMesh>::
operator()() const
{
return *this;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -695,7 +695,7 @@ void kkLOmega::correct()
- fvm::Sp(Cw2_*sqr(fw)*omega_, omega_) - fvm::Sp(Cw2_*sqr(fw)*omega_, omega_)
+ ( + (
Cw3_*fOmega(lambdaEff, lambdaT)*alphaTEff*sqr(fw)*sqrt(kt_) Cw3_*fOmega(lambdaEff, lambdaT)*alphaTEff*sqr(fw)*sqrt(kt_)
)().dimensionedInternalField()/pow3(y_.dimensionedInternalField()) )()()/pow3(y_())
); );
omegaEqn.ref().relax(); omegaEqn.ref().relax();

View File

@ -57,7 +57,7 @@ Foam::laplaceFilter::laplaceFilter(const fvMesh& mesh, scalar widthCoeff)
calculatedFvPatchScalarField::typeName calculatedFvPatchScalarField::typeName
) )
{ {
coeff_.dimensionedInternalFieldRef() = pow(mesh.V(), 2.0/3.0)/widthCoeff_; coeff_.ref() = pow(mesh.V(), 2.0/3.0)/widthCoeff_;
} }
@ -78,7 +78,7 @@ Foam::laplaceFilter::laplaceFilter(const fvMesh& mesh, const dictionary& bd)
calculatedFvPatchScalarField::typeName calculatedFvPatchScalarField::typeName
) )
{ {
coeff_.dimensionedInternalFieldRef() = pow(mesh.V(), 2.0/3.0)/widthCoeff_; coeff_.ref() = pow(mesh.V(), 2.0/3.0)/widthCoeff_;
} }

View File

@ -158,7 +158,7 @@ tmp<volScalarField> SpalartAllmarasDES<BasicTurbulenceModel>::dTilda
) const ) const
{ {
tmp<volScalarField> tdTilda(CDES_*this->delta()); tmp<volScalarField> tdTilda(CDES_*this->delta());
min(tdTilda.ref().dimensionedInternalFieldRef(), tdTilda(), y_); min(tdTilda.ref().ref(), tdTilda(), y_);
return tdTilda; return tdTilda;
} }

View File

@ -161,7 +161,7 @@ singleStepCombustion<CombThermoType, ThermoType>::dQ() const
if (this->active()) if (this->active())
{ {
volScalarField& dQ = tdQ.ref(); volScalarField& dQ = tdQ.ref();
dQ.dimensionedInternalFieldRef() = this->mesh().V()*Sh()(); dQ.ref() = this->mesh().V()*Sh()();
} }
return tdQ; return tdQ;
} }

View File

@ -157,7 +157,7 @@ void Foam::fvMeshAdder::MapVolField
( (
bfld[newPatchi], // old field bfld[newPatchi], // old field
mesh.boundary()[newPatchi], // new fvPatch mesh.boundary()[newPatchi], // new fvPatch
fld.dimensionedInternalField(), // new internal field fld(), // new internal field
patchMapper // mapper (new to old) patchMapper // mapper (new to old)
) )
); );
@ -211,7 +211,7 @@ void Foam::fvMeshAdder::MapVolField
( (
fldToAdd.boundaryField()[patchi], // added field fldToAdd.boundaryField()[patchi], // added field
mesh.boundary()[newPatchi], // new fvPatch mesh.boundary()[newPatchi], // new fvPatch
fld.dimensionedInternalField(), // new int. field fld(), // new int. field
patchMapper // mapper patchMapper // mapper
) )
); );
@ -464,7 +464,7 @@ void Foam::fvMeshAdder::MapSurfaceField
( (
bfld[newPatchi], // old field bfld[newPatchi], // old field
mesh.boundary()[newPatchi], // new fvPatch mesh.boundary()[newPatchi], // new fvPatch
fld.dimensionedInternalField(), // new internal field fld(), // new internal field
patchMapper // mapper (new to old) patchMapper // mapper (new to old)
) )
); );
@ -518,7 +518,7 @@ void Foam::fvMeshAdder::MapSurfaceField
( (
fldToAdd.boundaryField()[patchi],// added field fldToAdd.boundaryField()[patchi],// added field
mesh.boundary()[newPatchi], // new fvPatch mesh.boundary()[newPatchi], // new fvPatch
fld.dimensionedInternalField(), // new int. field fld(), // new int. field
patchMapper // mapper patchMapper // mapper
) )
); );

View File

@ -61,7 +61,7 @@ void Foam::fvMeshTools::addPatchFields
GeoField::Patch::New GeoField::Patch::New
( (
mesh.boundary()[sz], mesh.boundary()[sz],
fld.dimensionedInternalField(), fld(),
patchFieldDict.subDict(fld.name()) patchFieldDict.subDict(fld.name())
) )
); );
@ -75,7 +75,7 @@ void Foam::fvMeshTools::addPatchFields
( (
defaultPatchFieldType, defaultPatchFieldType,
mesh.boundary()[sz], mesh.boundary()[sz],
fld.dimensionedInternalField() fld()
) )
); );
bfld[sz] == defaultPatchValue; bfld[sz] == defaultPatchValue;
@ -112,7 +112,7 @@ void Foam::fvMeshTools::setPatchFields
GeoField::Patch::New GeoField::Patch::New
( (
mesh.boundary()[patchi], mesh.boundary()[patchi],
fld.dimensionedInternalField(), fld(),
patchFieldDict.subDict(fld.name()) patchFieldDict.subDict(fld.name())
) )
); );

View File

@ -323,14 +323,14 @@ CrankNicolsonDdtScheme<Type>::fvcDdt
{ {
dimensionedScalar rDtCoef0 = rDtCoef0_(ddt0); dimensionedScalar rDtCoef0 = rDtCoef0_(ddt0);
ddt0.dimensionedInternalFieldRef() = ddt0.ref() =
( (
(rDtCoef0*dt)*(mesh().V0() - mesh().V00()) (rDtCoef0*dt)*(mesh().V0() - mesh().V00())
- mesh().V00()*offCentre_(ddt0.dimensionedInternalField()) - mesh().V00()*offCentre_(ddt0.dimensionedInternalField())
)/mesh().V0(); )/mesh().V0();
} }
tdtdt.ref().dimensionedInternalFieldRef() = tdtdt.ref().ref() =
( (
(rDtCoef*dt)*(mesh().V() - mesh().V0()) (rDtCoef*dt)*(mesh().V() - mesh().V0())
- mesh().V0()*offCentre_(ddt0.dimensionedInternalField()) - mesh().V0()*offCentre_(ddt0.dimensionedInternalField())

View File

@ -144,7 +144,7 @@ tmp<GeometricField<Type, fvPatchField, volMesh>> fvMeshSubset::interpolate
( (
vf.boundaryField()[patchMap[patchi]], vf.boundaryField()[patchMap[patchi]],
subPatch, subPatch,
resF.dimensionedInternalField(), resF(),
directFvPatchFieldMapper(directAddressing) directFvPatchFieldMapper(directAddressing)
) )
); );
@ -288,7 +288,7 @@ tmp<GeometricField<Type, fvsPatchField, surfaceMesh>> fvMeshSubset::interpolate
( (
vf.boundaryField()[patchMap[patchi]], vf.boundaryField()[patchMap[patchi]],
subPatch, subPatch,
resF.dimensionedInternalField(), resF(),
directFvPatchFieldMapper(directAddressing) directFvPatchFieldMapper(directAddressing)
) )
); );
@ -462,7 +462,7 @@ fvMeshSubset::interpolate
( (
vf.boundaryField()[patchMap[patchi]], vf.boundaryField()[patchMap[patchi]],
subPatch, subPatch,
resF.dimensionedInternalField(), resF(),
directPointPatchFieldMapper(directAddressing) directPointPatchFieldMapper(directAddressing)
) )
); );

View File

@ -115,7 +115,7 @@ tmp<GeometricField<Type, fvPatchField, volMesh>> singleCellFvMesh::interpolate
( (
vf.boundaryField()[patchi], vf.boundaryField()[patchi],
boundary()[patchi], boundary()[patchi],
resF.dimensionedInternalField(), resF(),
agglomPatchFieldMapper(coarseToFine, coarseWeights) agglomPatchFieldMapper(coarseToFine, coarseWeights)
) )
); );
@ -134,7 +134,7 @@ tmp<GeometricField<Type, fvPatchField, volMesh>> singleCellFvMesh::interpolate
( (
vf.boundaryField()[patchi], vf.boundaryField()[patchi],
boundary()[patchi], boundary()[patchi],
resF.dimensionedInternalField(), resF(),
directFvPatchFieldMapper(map) directFvPatchFieldMapper(map)
) )
); );

View File

@ -87,7 +87,7 @@ void Foam::volPointInterpolation::addSeparated
} }
typename GeometricField<Type, pointPatchField, pointMesh>:: typename GeometricField<Type, pointPatchField, pointMesh>::
Internal& pfi = pf.dimensionedInternalFieldRef(); Internal& pfi = pf.ref();
typename GeometricField<Type, pointPatchField, pointMesh>:: typename GeometricField<Type, pointPatchField, pointMesh>::
Boundary& pfbf = pf.boundaryFieldRef(); Boundary& pfbf = pf.boundaryFieldRef();

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) 2012-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -249,7 +249,7 @@ void uniformInterpolatedDisplacementPointPatchVectorField::updateCoeffs()
// Extract back from the internal field // Extract back from the internal field
this->operator== this->operator==
( (
this->patchInternalField(result.dimensionedInternalField()) this->patchInternalField(result())
); );
fixedValuePointPatchField<vector>::updateCoeffs(); fixedValuePointPatchField<vector>::updateCoeffs();

View File

@ -226,7 +226,7 @@ void Foam::meshRefinement::addPatchFields
( (
patchFieldType, patchFieldType,
mesh.boundary()[sz], mesh.boundary()[sz],
fld.dimensionedInternalField() fld()
) )
); );
} }

View File

@ -96,7 +96,7 @@ Foam::fvFieldDecomposer::decomposeField
( (
field.boundaryField()[boundaryAddressing_[patchi]], field.boundaryField()[boundaryAddressing_[patchi]],
procMesh_.boundary()[patchi], procMesh_.boundary()[patchi],
resF.dimensionedInternalField(), resF(),
*patchFieldDecomposerPtrs_[patchi] *patchFieldDecomposerPtrs_[patchi]
) )
); );
@ -109,7 +109,7 @@ Foam::fvFieldDecomposer::decomposeField
new processorCyclicFvPatchField<Type> new processorCyclicFvPatchField<Type>
( (
procMesh_.boundary()[patchi], procMesh_.boundary()[patchi],
resF.dimensionedInternalField(), resF(),
Field<Type> Field<Type>
( (
field.internalField(), field.internalField(),
@ -126,7 +126,7 @@ Foam::fvFieldDecomposer::decomposeField
new processorFvPatchField<Type> new processorFvPatchField<Type>
( (
procMesh_.boundary()[patchi], procMesh_.boundary()[patchi],
resF.dimensionedInternalField(), resF(),
Field<Type> Field<Type>
( (
field.internalField(), field.internalField(),
@ -143,7 +143,7 @@ Foam::fvFieldDecomposer::decomposeField
new emptyFvPatchField<Type> new emptyFvPatchField<Type>
( (
procMesh_.boundary()[patchi], procMesh_.boundary()[patchi],
resF.dimensionedInternalField() resF()
) )
); );
} }
@ -266,7 +266,7 @@ Foam::fvFieldDecomposer::decomposeField
( (
field.boundaryField()[boundaryAddressing_[patchi]], field.boundaryField()[boundaryAddressing_[patchi]],
procMesh_.boundary()[patchi], procMesh_.boundary()[patchi],
resF.dimensionedInternalField(), resF(),
*patchFieldDecomposerPtrs_[patchi] *patchFieldDecomposerPtrs_[patchi]
) )
); );
@ -279,7 +279,7 @@ Foam::fvFieldDecomposer::decomposeField
new processorCyclicFvsPatchField<Type> new processorCyclicFvsPatchField<Type>
( (
procMesh_.boundary()[patchi], procMesh_.boundary()[patchi],
resF.dimensionedInternalField(), resF(),
Field<Type> Field<Type>
( (
allFaceField, allFaceField,
@ -296,7 +296,7 @@ Foam::fvFieldDecomposer::decomposeField
new processorFvsPatchField<Type> new processorFvsPatchField<Type>
( (
procMesh_.boundary()[patchi], procMesh_.boundary()[patchi],
resF.dimensionedInternalField(), resF(),
Field<Type> Field<Type>
( (
allFaceField, allFaceField,

View File

@ -142,10 +142,10 @@ void Foam::CourantNo::execute()
mesh.lookupObject<volScalarField>(type()) mesh.lookupObject<volScalarField>(type())
); );
Co.dimensionedInternalFieldRef() = byRho Co.ref() = byRho
( (
(0.5*mesh.time().deltaT()) (0.5*mesh.time().deltaT())
*fvc::surfaceSum(mag(phi))().dimensionedInternalField() *fvc::surfaceSum(mag(phi))()()
/mesh.V() /mesh.V()
); );
Co.correctBoundaryConditions(); Co.correctBoundaryConditions();

View File

@ -351,7 +351,7 @@ void Foam::meshToMesh::mapSrcToTgt
( (
srcField, srcField,
tgtField.patch(), tgtField.patch(),
result.dimensionedInternalField(), result(),
weightedFvPatchFieldMapper weightedFvPatchFieldMapper
( (
AMIList[i].tgtAddress(), AMIList[i].tgtAddress(),
@ -540,7 +540,7 @@ void Foam::meshToMesh::mapTgtToSrc
( (
tgtField, tgtField,
srcField.patch(), srcField.patch(),
result.dimensionedInternalField(), result(),
weightedFvPatchFieldMapper weightedFvPatchFieldMapper
( (
AMIList[i].srcAddress(), AMIList[i].srcAddress(),

View File

@ -611,7 +611,7 @@ Foam::chemistryModel<CompType, ThermoType>::dQ() const
if (this->chemistry_) if (this->chemistry_)
{ {
volScalarField& dQ = tdQ.ref(); volScalarField& dQ = tdQ.ref();
dQ.dimensionedInternalFieldRef() = this->mesh_.V()*Sh()(); dQ.ref() = this->mesh_.V()*Sh()();
} }
return tdQ; return tdQ;

View File

@ -282,11 +282,11 @@ Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh>>
Foam::radiation::P1::Ru() const Foam::radiation::P1::Ru() const
{ {
const DimensionedField<scalar, volMesh>& G = const DimensionedField<scalar, volMesh>& G =
G_.dimensionedInternalField(); G_();
const DimensionedField<scalar, volMesh> E = const DimensionedField<scalar, volMesh> E =
absorptionEmission_->ECont()().dimensionedInternalField(); absorptionEmission_->ECont()()();
const DimensionedField<scalar, volMesh> a = const DimensionedField<scalar, volMesh> a =
absorptionEmission_->aCont()().dimensionedInternalField(); absorptionEmission_->aCont()()();
return a*G - E; return a*G - E;
} }

View File

@ -494,14 +494,14 @@ Foam::radiation::fvDOM::Ru() const
{ {
const DimensionedField<scalar, volMesh>& G = const DimensionedField<scalar, volMesh>& G =
G_.dimensionedInternalField(); G_();
const DimensionedField<scalar, volMesh> E = const DimensionedField<scalar, volMesh> E =
absorptionEmission_->ECont()().dimensionedInternalField(); absorptionEmission_->ECont()()();
// Only include continuous phase absorption // Only include continuous phase absorption
const DimensionedField<scalar, volMesh> a = const DimensionedField<scalar, volMesh> a =
absorptionEmission_->aCont()().dimensionedInternalField(); absorptionEmission_->aCont()()();
return a*G - E; return a*G - E;
} }

View File

@ -177,7 +177,7 @@ Foam::solidChemistryModel<CompType, SolidThermo>::dQ() const
if (this->chemistry_) if (this->chemistry_)
{ {
volScalarField& dQ = tdQ.ref(); volScalarField& dQ = tdQ.ref();
dQ.dimensionedInternalFieldRef() = this->mesh_.V()*Sh()(); dQ.ref() = this->mesh_.V()*Sh()();
} }
return tdQ; return tdQ;