GeometricField: Rationalized and simplified access to the dimensioned internal field

Given that the type of the dimensioned internal field is encapsulated in
the GeometricField class the name need not include "Field"; the type
name is "Internal" so

volScalarField::DimensionedInternalField -> volScalarField::Internal

In addition to the ".dimensionedInternalField()" access function the
simpler "()" de-reference operator is also provided to greatly simplify
FV equation source term expressions which need not evaluate boundary
conditions.  To demonstrate this kEpsilon.C has been updated to use
dimensioned internal field expressions in the k and epsilon equation
source terms.
This commit is contained in:
Henry Weller
2016-04-27 21:32:45 +01:00
parent d82049c0b2
commit a25a449c9e
40 changed files with 196 additions and 167 deletions

View File

@ -75,7 +75,7 @@ License
// Reaction source time scale
if (alphaTemp < 1.0)
{
volScalarField::DimensionedInternalField rDeltaTT
volScalarField::Internal rDeltaTT
(
mag(reaction->Sh())/(alphaTemp*rho*thermo.Cp()*T)
);

View File

@ -74,7 +74,7 @@ License
// Reaction source time scale
{
volScalarField::DimensionedInternalField rDeltaTT
volScalarField::Internal rDeltaTT
(
mag
(

View File

@ -74,7 +74,7 @@ License
// Reaction source time scale
{
volScalarField::DimensionedInternalField rDeltaTT
volScalarField::Internal rDeltaTT
(
mag
(

View File

@ -6,7 +6,7 @@
for (int gCorr=0; gCorr<nAlphaCorr; gCorr++)
{
volScalarField::DimensionedInternalField Sp
volScalarField::Internal Sp
(
IOobject
(
@ -18,7 +18,7 @@
dimensionedScalar("Sp", dgdt.dimensions(), 0.0)
);
volScalarField::DimensionedInternalField Su
volScalarField::Internal Su
(
IOobject
(

View File

@ -1058,7 +1058,7 @@ void Foam::multiphaseMixtureThermo::solveAlphas
surfaceScalarField& alphaPhi = alphaPhiCorrs[phasei];
alphaPhi += upwind<scalar>(mesh_, phi_).flux(alpha);
volScalarField::DimensionedInternalField Sp
volScalarField::Internal Sp
(
IOobject
(
@ -1070,7 +1070,7 @@ void Foam::multiphaseMixtureThermo::solveAlphas
dimensionedScalar("Sp", alpha.dgdt().dimensions(), 0.0)
);
volScalarField::DimensionedInternalField Su
volScalarField::Internal Su
(
IOobject
(

View File

@ -218,7 +218,7 @@ void Foam::multiphaseSystem::solveAlphas()
surfaceScalarField& alphaPhic = alphaPhiCorrs[phasei];
alphaPhic += upwind<scalar>(mesh_, phi_).flux(phase);
volScalarField::DimensionedInternalField Sp
volScalarField::Internal Sp
(
IOobject
(
@ -230,7 +230,7 @@ void Foam::multiphaseSystem::solveAlphas()
dimensionedScalar("Sp", divU.dimensions(), 0.0)
);
volScalarField::DimensionedInternalField Su
volScalarField::Internal Su
(
IOobject
(

View File

@ -206,7 +206,7 @@ void Foam::twoPhaseSystem::solve()
const surfaceScalarField& phi2 = phase2_.phi();
// Construct the dilatation rate source term
tmp<volScalarField::DimensionedInternalField> tdgdt;
tmp<volScalarField::Internal> tdgdt;
if (phase1_.divU().valid() && phase2_.divU().valid())
{
@ -257,7 +257,7 @@ void Foam::twoPhaseSystem::solve()
for (int acorr=0; acorr<nAlphaCorr; acorr++)
{
volScalarField::DimensionedInternalField Sp
volScalarField::Internal Sp
(
IOobject
(
@ -269,7 +269,7 @@ void Foam::twoPhaseSystem::solve()
dimensionedScalar("Sp", dimless/dimTime, 0.0)
);
volScalarField::DimensionedInternalField Su
volScalarField::Internal Su
(
IOobject
(

View File

@ -392,7 +392,7 @@ void Foam::twoPhaseSystem::solve()
for (int acorr=0; acorr<nAlphaCorr; acorr++)
{
volScalarField::DimensionedInternalField Sp
volScalarField::Internal Sp
(
IOobject
(
@ -404,7 +404,7 @@ void Foam::twoPhaseSystem::solve()
dimensionedScalar("Sp", dgdt_.dimensions(), 0.0)
);
volScalarField::DimensionedInternalField Su
volScalarField::Internal Su
(
IOobject
(

View File

@ -148,8 +148,7 @@ void Foam::backgroundMeshDecomposition::initialRefinement()
decompositionMethod& decomposer = decomposerPtr_();
volScalarField::InternalField& icellWeights = cellWeights.internalField();
volScalarField::Internal& icellWeights = cellWeights;
// For each cell in the mesh has it been determined if it is fully
// inside, outside, or overlaps the surface
@ -632,7 +631,7 @@ Foam::labelList Foam::backgroundMeshDecomposition::selectRefinementCells
volScalarField& cellWeights
) const
{
volScalarField::InternalField& icellWeights = cellWeights.internalField();
volScalarField::Internal& icellWeights = cellWeights;
labelHashSet cellsToRefine;
@ -873,7 +872,7 @@ Foam::backgroundMeshDecomposition::distribute
mesh_.write();
}
volScalarField::InternalField& icellWeights = cellWeights.internalField();
volScalarField::Internal& icellWeights = cellWeights;
while (true)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -175,19 +175,19 @@ void calc
// Read vol-internal fields.
PtrList<volScalarField::DimensionedInternalField> vsiFlds;
PtrList<volScalarField::Internal> vsiFlds;
ReadFields(mesh, objects, vsiFlds);
PtrList<volVectorField::DimensionedInternalField> vviFlds;
PtrList<volVectorField::Internal> vviFlds;
ReadFields(mesh, objects, vviFlds);
PtrList<volSphericalTensorField::DimensionedInternalField> vstiFlds;
PtrList<volSphericalTensorField::Internal> vstiFlds;
ReadFields(mesh, objects, vstiFlds);
PtrList<volSymmTensorField::DimensionedInternalField> vsymtiFlds;
PtrList<volSymmTensorField::Internal> vsymtiFlds;
ReadFields(mesh, objects, vsymtiFlds);
PtrList<volTensorField::DimensionedInternalField> vtiFlds;
PtrList<volTensorField::Internal> vtiFlds;
ReadFields(mesh, objects, vtiFlds);
// Read surface fields.

View File

@ -683,19 +683,19 @@ DebugSwitches
pointIndexHitList 0;
pointPatchField 0;
pointScalarField 0;
pointScalarField::DimensionedInternalField 0;
pointScalarField::Internal 0;
pointSet 0;
pointSphericalTensorField 0;
pointSphericalTensorField::DimensionedInternalField 0;
pointSphericalTensorField::Internal 0;
pointSymmTensorField 0;
pointSymmTensorField::DimensionedInternalField 0;
pointSymmTensorField::Internal 0;
pointTensorField 0;
pointTensorField::DimensionedInternalField 0;
pointTensorField::Internal 0;
pointToCell 0;
pointToFace 0;
pointToPoint 0;
pointVectorField 0;
pointVectorField::DimensionedInternalField 0;
pointVectorField::Internal 0;
pointZone 0;
polyBoundaryMesh 0;
polyMesh 0;
@ -798,18 +798,18 @@ DebugSwitches
surfacePatch 0;
surfacePatchIOList 0;
surfaceScalarField 0;
surfaceScalarField::DimensionedInternalField 0;
surfaceScalarField::Internal 0;
surfaceSlipDisplacement 0;
surfaceSphericalTensorField 0;
surfaceSphericalTensorField::DimensionedInternalField 0;
surfaceSphericalTensorField::Internal 0;
surfaceSymmTensorField 0;
surfaceSymmTensorField::DimensionedInternalField 0;
surfaceSymmTensorField::Internal 0;
surfaceTensorField 0;
surfaceTensorField::DimensionedInternalField 0;
surfaceTensorField::Internal 0;
surfaceToCell 0;
surfaceToPoint 0;
surfaceVectorField 0;
surfaceVectorField::DimensionedInternalField 0;
surfaceVectorField::Internal 0;
surfaceWriter 0;
surfaces 0;
swirlInjector 0;
@ -876,15 +876,15 @@ DebugSwitches
viscosityModel 0;
volPointInterpolation 0;
volScalarField 0;
volScalarField::DimensionedInternalField 0;
volScalarField::Internal 0;
volSphericalTensorField 0;
volSphericalTensorField::DimensionedInternalField 0;
volSphericalTensorField::Internal 0;
volSymmTensorField 0;
volSymmTensorField::DimensionedInternalField 0;
volSymmTensorField::Internal 0;
volTensorField 0;
volTensorField::DimensionedInternalField 0;
volTensorField::Internal 0;
volVectorField 0;
volVectorField::DimensionedInternalField 0;
volVectorField::Internal 0;
vtk 0;
walkPatch 0;
wall 0;

View File

@ -79,7 +79,13 @@ public:
// Public typedefs
//- Type of mesh on which this DimensionedField is instantiated
typedef typename GeoMesh::Mesh Mesh;
//- Type of the field from which this DimensionedField is derived
typedef Field<Type> FieldType;
//- Component type of the elements of the field
typedef typename Field<Type>::cmptType cmptType;

View File

@ -55,6 +55,11 @@ class oneField
public:
// Public typedefs
typedef oneField FieldType;
// Constructors
//- Construct null

View File

@ -689,7 +689,7 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::~GeometricField()
template<class Type, template<class> class PatchField, class GeoMesh>
typename
Foam::GeometricField<Type, PatchField, GeoMesh>::DimensionedInternalField&
Foam::GeometricField<Type, PatchField, GeoMesh>::Internal&
Foam::GeometricField<Type, PatchField, GeoMesh>::dimensionedInternalFieldRef()
{
this->setUpToDate();
@ -700,7 +700,7 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::dimensionedInternalFieldRef()
template<class Type, template<class> class PatchField, class GeoMesh>
typename
Foam::GeometricField<Type, PatchField, GeoMesh>::InternalField&
Foam::GeometricField<Type, PatchField, GeoMesh>::Internal::FieldType&
Foam::GeometricField<Type, PatchField, GeoMesh>::internalField()
{
this->setUpToDate();

View File

@ -95,12 +95,19 @@ public:
// Public typedefs
//- Type of mesh on which this GeometricField is instantiated
typedef typename GeoMesh::Mesh Mesh;
//- Type of boundary mesh on which this
// GeometricField::GeometricBoundaryField is instantiated
typedef typename GeoMesh::BoundaryMesh BoundaryMesh;
typedef DimensionedField<Type, GeoMesh> DimensionedInternalField;
typedef Field<Type> InternalField;
typedef PatchField<Type> PatchFieldType;
//- Type of the internal field from which this GeometricField is derived
typedef DimensionedField<Type, GeoMesh> Internal;
//- Type of the patch field of which the
// GeometricField::GeometricBoundaryField is composed
typedef PatchField<Type> Patch;
class GeometricBoundaryField
@ -126,7 +133,7 @@ public:
GeometricBoundaryField
(
const BoundaryMesh&,
const DimensionedInternalField&,
const Internal&,
const word&
);
@ -137,7 +144,7 @@ public:
GeometricBoundaryField
(
const BoundaryMesh&,
const DimensionedInternalField&,
const Internal&,
const wordList& wantedPatchTypes,
const wordList& actualPatchTypes = wordList()
);
@ -148,14 +155,14 @@ public:
GeometricBoundaryField
(
const BoundaryMesh&,
const DimensionedInternalField&,
const Internal&,
const PtrList<PatchField<Type>>&
);
//- Construct as copy setting the reference to the internal field
GeometricBoundaryField
(
const DimensionedInternalField&,
const Internal&,
const GeometricBoundaryField&
);
@ -173,7 +180,7 @@ public:
GeometricBoundaryField
(
const BoundaryMesh&,
const DimensionedInternalField&,
const Internal&,
const dictionary&
);
@ -432,23 +439,23 @@ public:
//- Return a reference to the dimensioned internal field
// Note: this increments the event counter and checks the
// old-time fields; avoid in loops.
DimensionedInternalField& dimensionedInternalFieldRef();
Internal& dimensionedInternalFieldRef();
//- Return a const-reference to the dimensioned internal field
inline const DimensionedInternalField& dimensionedInternalField() const;
inline const Internal& dimensionedInternalField() const;
//- Return a const-reference to the dimensioned internal field
// of a "vol" field. Useful in the formulation of source-terms
// for FV equations
inline const DimensionedInternalField& v() const;
inline const Internal& v() const;
//- Return a reference to the internal field
// Note: this increments the event counter and checks the
// old-time fields; avoid in loops.
InternalField& internalField();
typename Internal::FieldType& internalField();
//- Return a const-reference to the internal field
inline const InternalField& internalField() const;
inline const typename Internal::FieldType& internalField() const;
//- Return a reference to the boundary field
// Note: this increments the event counter and checks the
@ -570,9 +577,8 @@ public:
// Member operators
//- Return a const-reference to the dimensioned internal field
// of a "vol" field. Useful in the formulation of source-terms
// for FV equations
inline const DimensionedInternalField& operator~() const;
// Useful in the formulation of source-terms for FV equations
inline const Internal& operator()() const;
void operator=(const GeometricField<Type, PatchField, GeoMesh>&);
void operator=(const tmp<GeometricField<Type, PatchField, GeoMesh>>&);

View File

@ -36,7 +36,18 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::null()
template<class Type, template<class> class PatchField, class GeoMesh>
inline
const typename
Foam::GeometricField<Type, PatchField, GeoMesh>::DimensionedInternalField&
Foam::GeometricField<Type, PatchField, GeoMesh>::Internal&
Foam::GeometricField<Type, PatchField, GeoMesh>::
operator()() const
{
return *this;
}
template<class Type, template<class> class PatchField, class GeoMesh>
inline
const typename
Foam::GeometricField<Type, PatchField, GeoMesh>::Internal&
Foam::GeometricField<Type, PatchField, GeoMesh>::
dimensionedInternalField() const
{
@ -47,7 +58,7 @@ dimensionedInternalField() const
template<class Type, template<class> class PatchField, class GeoMesh>
inline
const typename
Foam::GeometricField<Type, PatchField, GeoMesh>::InternalField&
Foam::GeometricField<Type, PatchField, GeoMesh>::Internal::FieldType&
Foam::GeometricField<Type, PatchField, GeoMesh>::internalField() const
{
return *this;

View File

@ -176,7 +176,7 @@ template
class GeoMesh
>
Foam::SlicedGeometricField<Type, PatchField, SlicedPatchField, GeoMesh>::
DimensionedInternalField::DimensionedInternalField
Internal::Internal
(
const IOobject& io,
const Mesh& mesh,
@ -364,7 +364,7 @@ template
class GeoMesh
>
Foam::SlicedGeometricField<Type, PatchField, SlicedPatchField, GeoMesh>::
DimensionedInternalField::~DimensionedInternalField()
Internal::~Internal()
{
// Set the internalField storage pointer to NULL before its destruction
// to protect the field it a slice of.

View File

@ -70,7 +70,7 @@ public:
typedef typename GeoMesh::Mesh Mesh;
typedef typename GeoMesh::BoundaryMesh BoundaryMesh;
class DimensionedInternalField;
class Internal;
private:
@ -172,7 +172,7 @@ public:
/*---------------------------------------------------------------------------*\
Class SlicedGeometricField::DimensionedInternalField Declaration
Class SlicedGeometricField::Internal Declaration
\*---------------------------------------------------------------------------*/
//- The internalField of a SlicedGeometricField
@ -184,9 +184,9 @@ template
class GeoMesh
>
class SlicedGeometricField<Type, PatchField, SlicedPatchField, GeoMesh>::
DimensionedInternalField
Internal
:
public GeometricField<Type, PatchField, GeoMesh>::DimensionedInternalField
public GeometricField<Type, PatchField, GeoMesh>::Internal
{
public:
@ -194,7 +194,7 @@ public:
// Constructors
//- Construct from components and field to slice
DimensionedInternalField
Internal
(
const IOobject&,
const Mesh&,
@ -204,7 +204,7 @@ public:
//- Destructor
~DimensionedInternalField();
~Internal();
};

View File

@ -59,9 +59,8 @@ public:
// Public typedefs
typedef oneField DimensionedInternalField;
typedef oneField InternalField;
typedef oneField PatchFieldType;
typedef oneField Internal;
typedef oneField Patch;
typedef oneFieldField GeometricBoundaryField;
typedef one cmptType;
@ -82,9 +81,11 @@ public:
inline oneField oldTime() const;
inline InternalField internalField() const;
inline Internal operator()() const;
inline DimensionedInternalField v() const;
inline Internal v() const;
inline typename Internal::FieldType internalField() const;
inline GeometricBoundaryField boundaryField() const;
};
@ -96,16 +97,16 @@ inline const geometricOneField& operator*
const geometricOneField&
);
inline const geometricOneField::DimensionedInternalField& operator*
inline const geometricOneField::Internal& operator*
(
const geometricOneField::DimensionedInternalField&,
const geometricOneField::Internal&,
const geometricOneField&
);
inline const geometricOneField::DimensionedInternalField& operator*
inline const geometricOneField::Internal& operator*
(
const geometricOneField&,
const geometricOneField::DimensionedInternalField&
const geometricOneField::Internal&
);
inline const geometricOneField& operator/
@ -114,16 +115,16 @@ inline const geometricOneField& operator/
const geometricOneField&
);
inline const geometricOneField::DimensionedInternalField& operator/
inline const geometricOneField::Internal& operator/
(
const geometricOneField::DimensionedInternalField&,
const geometricOneField::Internal&,
const geometricOneField&
);
inline const geometricOneField::DimensionedInternalField& operator/
inline const geometricOneField::Internal& operator/
(
const geometricOneField&,
const geometricOneField::DimensionedInternalField&
const geometricOneField::Internal&
);

View File

@ -51,17 +51,24 @@ inline Foam::oneField Foam::geometricOneField::oldTime() const
}
inline Foam::geometricOneField::InternalField
Foam::geometricOneField::internalField() const
inline Foam::geometricOneField::Internal
Foam::geometricOneField::operator()() const
{
return InternalField();
return Internal();
}
inline Foam::geometricOneField::DimensionedInternalField
inline Foam::geometricOneField::Internal
Foam::geometricOneField::v() const
{
return DimensionedInternalField();
return Internal();
}
inline typename Foam::geometricOneField::Internal::FieldType
Foam::geometricOneField::internalField() const
{
return typename Internal::FieldType();
}
@ -82,9 +89,9 @@ inline const Foam::geometricOneField& Foam::operator*
}
inline const Foam::geometricOneField::DimensionedInternalField& Foam::operator*
inline const Foam::geometricOneField::Internal& Foam::operator*
(
const geometricOneField::DimensionedInternalField& of,
const geometricOneField::Internal& of,
const geometricOneField&
)
{
@ -92,10 +99,10 @@ inline const Foam::geometricOneField::DimensionedInternalField& Foam::operator*
}
inline const Foam::geometricOneField::DimensionedInternalField& Foam::operator*
inline const Foam::geometricOneField::Internal& Foam::operator*
(
const geometricOneField&,
const geometricOneField::DimensionedInternalField& of
const geometricOneField::Internal& of
)
{
return of;
@ -112,9 +119,9 @@ inline const Foam::geometricOneField& Foam::operator/
}
inline const Foam::geometricOneField::DimensionedInternalField& Foam::operator/
inline const Foam::geometricOneField::Internal& Foam::operator/
(
const geometricOneField::DimensionedInternalField& of,
const geometricOneField::Internal& of,
const geometricOneField&
)
{
@ -122,10 +129,10 @@ inline const Foam::geometricOneField::DimensionedInternalField& Foam::operator/
}
inline const Foam::geometricOneField::DimensionedInternalField& Foam::operator/
inline const Foam::geometricOneField::Internal& Foam::operator/
(
const geometricOneField&,
const geometricOneField::DimensionedInternalField& of
const geometricOneField::Internal& of
)
{
return of;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -33,19 +33,19 @@ namespace Foam
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTemplate2TypeNameAndDebug(pointScalarField::DimensionedInternalField, 0);
defineTemplate2TypeNameAndDebug(pointVectorField::DimensionedInternalField, 0);
defineTemplate2TypeNameAndDebug(pointScalarField::Internal, 0);
defineTemplate2TypeNameAndDebug(pointVectorField::Internal, 0);
defineTemplate2TypeNameAndDebug
(
pointSphericalTensorField::DimensionedInternalField,
pointSphericalTensorField::Internal,
0
);
defineTemplate2TypeNameAndDebug
(
pointSymmTensorField::DimensionedInternalField,
pointSymmTensorField::Internal,
0
);
defineTemplate2TypeNameAndDebug(pointTensorField::DimensionedInternalField, 0);
defineTemplate2TypeNameAndDebug(pointTensorField::Internal, 0);
defineTemplateTypeNameAndDebug(pointScalarField, 0);

View File

@ -235,10 +235,17 @@ void kEpsilon<BasicTurbulenceModel>::correct()
eddyViscosity<RASModel<BasicTurbulenceModel>>::correct();
volScalarField divU(fvc::div(fvc::absolute(this->phi(), U)));
volScalarField::Internal divU
(
fvc::div(fvc::absolute(this->phi(), U))().v()
);
tmp<volTensorField> tgradU = fvc::grad(U);
volScalarField G(this->GName(), nut*(dev(twoSymm(tgradU())) && tgradU()));
volScalarField::Internal G
(
this->GName(),
nut.v()*(dev(twoSymm(tgradU().v())) && tgradU().v())
);
tgradU.clear();
// Update epsilon and G at the wall
@ -251,9 +258,9 @@ void kEpsilon<BasicTurbulenceModel>::correct()
+ fvm::div(alphaRhoPhi, epsilon_)
- fvm::laplacian(alpha*rho*DepsilonEff(), epsilon_)
==
C1_*alpha*rho*G*epsilon_/k_
- fvm::SuSp(((2.0/3.0)*C1_ + C3_)*alpha*rho*divU, epsilon_)
- fvm::Sp(C2_*alpha*rho*epsilon_/k_, epsilon_)
C1_*alpha()*rho()*G*epsilon_()/k_()
- fvm::SuSp(((2.0/3.0)*C1_ + C3_)*alpha()*rho()*divU, epsilon_)
- fvm::Sp(C2_*alpha()*rho()*epsilon_()/k_(), epsilon_)
+ epsilonSource()
+ fvOptions(alpha, rho, epsilon_)
);
@ -272,9 +279,9 @@ void kEpsilon<BasicTurbulenceModel>::correct()
+ fvm::div(alphaRhoPhi, k_)
- fvm::laplacian(alpha*rho*DkEff(), k_)
==
alpha*rho*G
- fvm::SuSp((2.0/3.0)*alpha*rho*divU, k_)
- fvm::Sp(alpha*rho*epsilon_/k_, k_)
alpha()*rho()*G
- fvm::SuSp((2.0/3.0)*alpha()*rho()*divU, k_)
- fvm::Sp(alpha()*rho()*epsilon_()/k_(), k_)
+ kSource()
+ fvOptions(alpha, rho, k_)
);

View File

@ -104,7 +104,7 @@ Foam::tmp<Foam::volScalarField> Foam::consumptionSpeed::omega0Sigma
volScalarField& omega0 = tomega0.ref();
volScalarField::InternalField& iomega0 = omega0.internalField();
volScalarField::Internal& iomega0 = omega0;
forAll(iomega0, celli)
{

View File

@ -58,7 +58,7 @@ void Foam::fvMeshTools::addPatchFields
bfld.set
(
sz,
GeoField::PatchFieldType::New
GeoField::Patch::New
(
mesh.boundary()[sz],
fld.dimensionedInternalField(),
@ -71,7 +71,7 @@ void Foam::fvMeshTools::addPatchFields
bfld.set
(
sz,
GeoField::PatchFieldType::New
GeoField::Patch::New
(
defaultPatchFieldType,
mesh.boundary()[sz],
@ -109,7 +109,7 @@ void Foam::fvMeshTools::setPatchFields
bfld.set
(
patchi,
GeoField::PatchFieldType::New
GeoField::Patch::New
(
mesh.boundary()[patchi],
fld.dimensionedInternalField(),

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -34,27 +34,27 @@ namespace Foam
defineTemplate2TypeNameAndDebug
(
surfaceScalarField::DimensionedInternalField,
surfaceScalarField::Internal,
0
);
defineTemplate2TypeNameAndDebug
(
surfaceVectorField::DimensionedInternalField,
surfaceVectorField::Internal,
0
);
defineTemplate2TypeNameAndDebug
(
surfaceSphericalTensorField::DimensionedInternalField,
surfaceSphericalTensorField::Internal,
0
);
defineTemplate2TypeNameAndDebug
(
surfaceSymmTensorField::DimensionedInternalField,
surfaceSymmTensorField::Internal,
0
);
defineTemplate2TypeNameAndDebug
(
surfaceTensorField::DimensionedInternalField,
surfaceTensorField::Internal,
0
);

View File

@ -32,19 +32,19 @@ namespace Foam
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTemplate2TypeNameAndDebug(volScalarField::DimensionedInternalField, 0);
defineTemplate2TypeNameAndDebug(volVectorField::DimensionedInternalField, 0);
defineTemplate2TypeNameAndDebug(volScalarField::Internal, 0);
defineTemplate2TypeNameAndDebug(volVectorField::Internal, 0);
defineTemplate2TypeNameAndDebug
(
volSphericalTensorField::DimensionedInternalField,
volSphericalTensorField::Internal,
0
);
defineTemplate2TypeNameAndDebug
(
volSymmTensorField::DimensionedInternalField,
volSymmTensorField::Internal,
0
);
defineTemplate2TypeNameAndDebug(volTensorField::DimensionedInternalField, 0);
defineTemplate2TypeNameAndDebug(volTensorField::Internal, 0);
defineTemplateTypeNameAndDebug(volScalarField, 0);
defineTemplateTypeNameAndDebug(volVectorField, 0);

View File

@ -26,7 +26,7 @@ License
template<class Type, template<class> class PatchField, class GeoMesh>
inline
const typename
Foam::GeometricField<Type, PatchField, GeoMesh>::DimensionedInternalField&
Foam::GeometricField<Type, PatchField, GeoMesh>::Internal&
Foam::GeometricField<Type, PatchField, GeoMesh>::
v() const
{
@ -35,16 +35,4 @@ v() const
}
template<class Type, template<class> class PatchField, class GeoMesh>
inline
const typename
Foam::GeometricField<Type, PatchField, GeoMesh>::DimensionedInternalField&
Foam::GeometricField<Type, PatchField, GeoMesh>::
operator~() const
{
static_assert(isVolMesh<GeoMesh>::value, "Only valid for volFields");
return *this;
}
// ************************************************************************* //

View File

@ -168,7 +168,7 @@ void Foam::MULES::limiterCorr
const labelUList& owner = mesh.owner();
const labelUList& neighb = mesh.neighbour();
tmp<volScalarField::DimensionedInternalField> tVsc = mesh.Vsc();
tmp<volScalarField::Internal> tVsc = mesh.Vsc();
const scalarField& V = tVsc();
const surfaceScalarField::GeometricBoundaryField& phiBf =

View File

@ -199,7 +199,7 @@ void Foam::MULES::limiter
const labelUList& owner = mesh.owner();
const labelUList& neighb = mesh.neighbour();
tmp<volScalarField::DimensionedInternalField> tVsc = mesh.Vsc();
tmp<volScalarField::Internal> tVsc = mesh.Vsc();
const scalarField& V = tVsc();
const scalarField& phiBDIf = phiBD;
@ -330,7 +330,7 @@ void Foam::MULES::limiter
if (mesh.moving())
{
tmp<volScalarField::DimensionedInternalField> V0 = mesh.Vsc0();
tmp<volScalarField::Internal> V0 = mesh.Vsc0();
psiMaxn =
V

View File

@ -63,8 +63,8 @@ void Foam::fvMesh::clearGeomNotOldVol()
MoveableMeshObject
>(*this);
slicedVolScalarField::DimensionedInternalField* VPtr =
static_cast<slicedVolScalarField::DimensionedInternalField*>(VPtr_);
slicedVolScalarField::Internal* VPtr =
static_cast<slicedVolScalarField::Internal*>(VPtr_);
deleteDemandDrivenData(VPtr);
VPtr_ = NULL;

View File

@ -183,7 +183,7 @@ void Foam::fvMesh::makeCf() const
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::volScalarField::DimensionedInternalField& Foam::fvMesh::V() const
const Foam::volScalarField::Internal& Foam::fvMesh::V() const
{
if (!VPtr_)
{
@ -193,7 +193,7 @@ const Foam::volScalarField::DimensionedInternalField& Foam::fvMesh::V() const
<< "Constructing from primitiveMesh::cellVolumes()" << endl;
}
VPtr_ = new slicedVolScalarField::DimensionedInternalField
VPtr_ = new slicedVolScalarField::Internal
(
IOobject
(
@ -210,11 +210,11 @@ const Foam::volScalarField::DimensionedInternalField& Foam::fvMesh::V() const
);
}
return *static_cast<slicedVolScalarField::DimensionedInternalField*>(VPtr_);
return *static_cast<slicedVolScalarField::Internal*>(VPtr_);
}
const Foam::volScalarField::DimensionedInternalField& Foam::fvMesh::V0() const
const Foam::volScalarField::Internal& Foam::fvMesh::V0() const
{
if (!V0Ptr_)
{
@ -227,7 +227,7 @@ const Foam::volScalarField::DimensionedInternalField& Foam::fvMesh::V0() const
}
Foam::volScalarField::DimensionedInternalField& Foam::fvMesh::setV0()
Foam::volScalarField::Internal& Foam::fvMesh::setV0()
{
if (!V0Ptr_)
{
@ -240,7 +240,7 @@ Foam::volScalarField::DimensionedInternalField& Foam::fvMesh::setV0()
}
const Foam::volScalarField::DimensionedInternalField& Foam::fvMesh::V00() const
const Foam::volScalarField::Internal& Foam::fvMesh::V00() const
{
if (!V00Ptr_)
{
@ -271,7 +271,7 @@ const Foam::volScalarField::DimensionedInternalField& Foam::fvMesh::V00() const
}
Foam::tmp<Foam::volScalarField::DimensionedInternalField>
Foam::tmp<Foam::volScalarField::Internal>
Foam::fvMesh::Vsc() const
{
if (moving() && time().subCycling())
@ -300,7 +300,7 @@ Foam::fvMesh::Vsc() const
}
Foam::tmp<Foam::volScalarField::DimensionedInternalField>
Foam::tmp<Foam::volScalarField::Internal>
Foam::fvMesh::Vsc0() const
{
if (moving() && time().subCycling())

View File

@ -245,7 +245,7 @@ public:
//- Return the corresponding patchField of the named field
template<class GeometricField, class Type>
const typename GeometricField::PatchFieldType& patchField
const typename GeometricField::Patch& patchField
(
const GeometricField&
) const;
@ -256,7 +256,7 @@ public:
// instantiated within a templated function to avoid a bug in gcc.
// See inletOutletFvPatchField.C and outletInletFvPatchField.C
template<class GeometricField, class Type>
const typename GeometricField::PatchFieldType& lookupPatchField
const typename GeometricField::Patch& lookupPatchField
(
const word& name,
const GeometricField* = NULL,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -28,7 +28,7 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class GeometricField, class Type>
const typename GeometricField::PatchFieldType& Foam::fvPatch::lookupPatchField
const typename GeometricField::Patch& Foam::fvPatch::lookupPatchField
(
const word& name,
const GeometricField*,

View File

@ -66,7 +66,7 @@ void Foam::fvPatch::patchInternalField
template<class GeometricField, class Type>
const typename GeometricField::PatchFieldType& Foam::fvPatch::patchField
const typename GeometricField::Patch& Foam::fvPatch::patchField
(
const GeometricField& gf
) const

View File

@ -276,7 +276,7 @@ Foam::surfaceInterpolationScheme<Type>::dotInterpolate
Field<RetType>& sfi = sf.internalField();
const typename SFType::InternalField& Sfi = Sf.internalField();
const typename SFType::Internal& Sfi = Sf();
for (label fi=0; fi<P.size(); fi++)
{
@ -291,7 +291,7 @@ Foam::surfaceInterpolationScheme<Type>::dotInterpolate
forAll(lambdas.boundaryField(), pi)
{
const fvsPatchScalarField& pLambda = lambdas.boundaryField()[pi];
const typename SFType::PatchFieldType& pSf = Sf.boundaryField()[pi];
const typename SFType::Patch& pSf = Sf.boundaryField()[pi];
fvsPatchField<RetType>& psf = sfbf[pi];
if (vf.boundaryField()[pi].coupled())

View File

@ -76,8 +76,7 @@ if (runTime.outputTime())
}
}
volVectorField::InternalField& itotalVelocity =
totalVelocity.internalField();
volVectorField::Internal& itotalVelocity = totalVelocity;
forAll(itotalVelocity, tV)
{
@ -150,8 +149,8 @@ if (runTime.outputTime())
}
}
volScalarField::InternalField& itotalTemperature =
totalTemperature.internalField();
volScalarField::Internal& itotalTemperature =
totalTemperature;
forAll(itotalTemperature, tT)
{
@ -209,7 +208,7 @@ if (runTime.outputTime())
}
}
volScalarField::InternalField& itotalMeanKE = totalMeanKE.internalField();
volScalarField::Internal& itotalMeanKE = totalMeanKE;
forAll(itotalMeanKE, tMKE)
{

View File

@ -222,7 +222,7 @@ void Foam::meshRefinement::addPatchFields
fldBf.set
(
sz,
GeoField::PatchFieldType::New
GeoField::Patch::New
(
patchFieldType,
mesh.boundary()[sz],

View File

@ -38,10 +38,10 @@ namespace Foam
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField::DimensionedInternalField>
Foam::tmp<Foam::volScalarField::Internal>
Foam::CourantNo::byRho
(
const tmp<volScalarField::DimensionedInternalField>& Co
const tmp<volScalarField::Internal>& Co
) const
{
if (Co().dimensions() == dimDensity)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -81,9 +81,9 @@ class CourantNo
// Private Member Functions
//- Divide Co by rho if required
tmp<volScalarField::DimensionedInternalField> byRho
tmp<volScalarField::Internal> byRho
(
const tmp<volScalarField::DimensionedInternalField>& Co
const tmp<volScalarField::Internal>& Co
) const;
//- Disallow default bitwise copy construct

View File

@ -637,7 +637,7 @@ Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::gasHs
)
);
volScalarField::InternalField& gasHs = tHs.ref().internalField();
volScalarField::Internal& gasHs = tHs.ref();
const GasThermo& mixture = gasThermo_[index];