From a25a449c9e8f0167302b517dfd2b87135250ec7a Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Wed, 27 Apr 2016 21:32:45 +0100 Subject: [PATCH] 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. --- .../combustion/reactingFoam/setRDeltaT.H | 2 +- .../lagrangian/coalChemistryFoam/setRDeltaT.H | 2 +- .../reactingParcelFoam/setRDeltaT.H | 2 +- .../compressibleInterFoam/alphaEqns.H | 4 +- .../multiphaseMixtureThermo.C | 4 +- .../multiphaseSystem/multiphaseSystem.C | 4 +- .../twoPhaseSystem/twoPhaseSystem.C | 6 +-- .../twoPhaseSystem/twoPhaseSystem.C | 4 +- .../backgroundMeshDecomposition.C | 7 ++-- .../execFlowFunctionObjects.C | 12 +++--- etc/controlDict | 30 +++++++-------- .../DimensionedField/DimensionedField.H | 6 +++ .../fields/Fields/oneField/oneField.H | 5 +++ .../GeometricField/GeometricField.C | 4 +- .../GeometricField/GeometricField.H | 38 +++++++++++-------- .../GeometricField/GeometricFieldI.H | 15 +++++++- .../SlicedGeometricField.C | 4 +- .../SlicedGeometricField.H | 12 +++--- .../geometricOneField/geometricOneField.H | 27 ++++++------- .../geometricOneField/geometricOneFieldI.H | 33 +++++++++------- .../GeometricFields/pointFields/pointFields.C | 12 +++--- .../turbulenceModels/RAS/kEpsilon/kEpsilon.C | 23 +++++++---- .../consumptionSpeed/consumptionSpeed.C | 2 +- .../fvMeshTools/fvMeshToolsTemplates.C | 6 +-- .../fields/surfaceFields/surfaceFields.C | 12 +++--- src/finiteVolume/fields/volFields/volFields.C | 10 ++--- .../fields/volFields/volFieldsI.H | 14 +------ .../solvers/MULES/CMULESTemplates.C | 2 +- .../fvMatrices/solvers/MULES/MULESTemplates.C | 4 +- src/finiteVolume/fvMesh/fvMesh.C | 4 +- src/finiteVolume/fvMesh/fvMeshGeometry.C | 16 ++++---- .../fvMesh/fvPatches/fvPatch/fvPatch.H | 4 +- .../fvPatch/fvPatchFvMeshTemplates.C | 4 +- .../fvPatches/fvPatch/fvPatchTemplates.C | 2 +- .../surfaceInterpolationScheme.C | 4 +- .../molecule/mdTools/averageMDFields.H | 9 ++--- .../meshRefinement/meshRefinementTemplates.C | 2 +- .../utilities/CourantNo/CourantNo.C | 4 +- .../utilities/CourantNo/CourantNo.H | 6 +-- .../pyrolysisChemistryModel.C | 2 +- 40 files changed, 196 insertions(+), 167 deletions(-) diff --git a/applications/solvers/combustion/reactingFoam/setRDeltaT.H b/applications/solvers/combustion/reactingFoam/setRDeltaT.H index 7612886aac..1267aefdcc 100644 --- a/applications/solvers/combustion/reactingFoam/setRDeltaT.H +++ b/applications/solvers/combustion/reactingFoam/setRDeltaT.H @@ -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) ); diff --git a/applications/solvers/lagrangian/coalChemistryFoam/setRDeltaT.H b/applications/solvers/lagrangian/coalChemistryFoam/setRDeltaT.H index 56c67ca2f2..c123dc4c75 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/setRDeltaT.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/setRDeltaT.H @@ -74,7 +74,7 @@ License // Reaction source time scale { - volScalarField::DimensionedInternalField rDeltaTT + volScalarField::Internal rDeltaTT ( mag ( diff --git a/applications/solvers/lagrangian/reactingParcelFoam/setRDeltaT.H b/applications/solvers/lagrangian/reactingParcelFoam/setRDeltaT.H index 5ee1dc4630..62565f6430 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/setRDeltaT.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/setRDeltaT.H @@ -74,7 +74,7 @@ License // Reaction source time scale { - volScalarField::DimensionedInternalField rDeltaTT + volScalarField::Internal rDeltaTT ( mag ( diff --git a/applications/solvers/multiphase/compressibleInterFoam/alphaEqns.H b/applications/solvers/multiphase/compressibleInterFoam/alphaEqns.H index 51dad81e77..eedf020670 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/alphaEqns.H +++ b/applications/solvers/multiphase/compressibleInterFoam/alphaEqns.H @@ -6,7 +6,7 @@ for (int gCorr=0; gCorr(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 ( diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C index 6504f943a0..c01236eb70 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C @@ -218,7 +218,7 @@ void Foam::multiphaseSystem::solveAlphas() surfaceScalarField& alphaPhic = alphaPhiCorrs[phasei]; alphaPhic += upwind(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 ( diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C index fc86ede74b..c12f258515 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C @@ -206,7 +206,7 @@ void Foam::twoPhaseSystem::solve() const surfaceScalarField& phi2 = phase2_.phi(); // Construct the dilatation rate source term - tmp tdgdt; + tmp tdgdt; if (phase1_.divU().valid() && phase2_.divU().valid()) { @@ -257,7 +257,7 @@ void Foam::twoPhaseSystem::solve() for (int acorr=0; acorr vsiFlds; + PtrList vsiFlds; ReadFields(mesh, objects, vsiFlds); - PtrList vviFlds; + PtrList vviFlds; ReadFields(mesh, objects, vviFlds); - PtrList vstiFlds; + PtrList vstiFlds; ReadFields(mesh, objects, vstiFlds); - PtrList vsymtiFlds; + PtrList vsymtiFlds; ReadFields(mesh, objects, vsymtiFlds); - PtrList vtiFlds; + PtrList vtiFlds; ReadFields(mesh, objects, vtiFlds); // Read surface fields. diff --git a/etc/controlDict b/etc/controlDict index eedb6119e8..152f441961 100644 --- a/etc/controlDict +++ b/etc/controlDict @@ -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; diff --git a/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedField.H b/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedField.H index 2f5034c0f8..d76f31c058 100644 --- a/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedField.H +++ b/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedField.H @@ -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 FieldType; + + //- Component type of the elements of the field typedef typename Field::cmptType cmptType; diff --git a/src/OpenFOAM/fields/Fields/oneField/oneField.H b/src/OpenFOAM/fields/Fields/oneField/oneField.H index 4bce84b203..64b73a9a7c 100644 --- a/src/OpenFOAM/fields/Fields/oneField/oneField.H +++ b/src/OpenFOAM/fields/Fields/oneField/oneField.H @@ -55,6 +55,11 @@ class oneField public: + // Public typedefs + + typedef oneField FieldType; + + // Constructors //- Construct null diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C index 5228c5a630..96244ccbde 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C @@ -689,7 +689,7 @@ Foam::GeometricField::~GeometricField() template class PatchField, class GeoMesh> typename -Foam::GeometricField::DimensionedInternalField& +Foam::GeometricField::Internal& Foam::GeometricField::dimensionedInternalFieldRef() { this->setUpToDate(); @@ -700,7 +700,7 @@ Foam::GeometricField::dimensionedInternalFieldRef() template class PatchField, class GeoMesh> typename -Foam::GeometricField::InternalField& +Foam::GeometricField::Internal::FieldType& Foam::GeometricField::internalField() { this->setUpToDate(); diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.H b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.H index d5be62367a..fbfd47553f 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.H +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.H @@ -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 DimensionedInternalField; - typedef Field InternalField; - typedef PatchField PatchFieldType; + //- Type of the internal field from which this GeometricField is derived + typedef DimensionedField Internal; + + //- Type of the patch field of which the + // GeometricField::GeometricBoundaryField is composed + typedef PatchField 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>& ); //- 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&); void operator=(const tmp>&); diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricFieldI.H b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricFieldI.H index aeda9e37fe..da87a00125 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricFieldI.H +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricFieldI.H @@ -36,7 +36,18 @@ Foam::GeometricField::null() template class PatchField, class GeoMesh> inline const typename -Foam::GeometricField::DimensionedInternalField& +Foam::GeometricField::Internal& +Foam::GeometricField:: +operator()() const +{ + return *this; +} + + +template class PatchField, class GeoMesh> +inline +const typename +Foam::GeometricField::Internal& Foam::GeometricField:: dimensionedInternalField() const { @@ -47,7 +58,7 @@ dimensionedInternalField() const template class PatchField, class GeoMesh> inline const typename -Foam::GeometricField::InternalField& +Foam::GeometricField::Internal::FieldType& Foam::GeometricField::internalField() const { return *this; diff --git a/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.C b/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.C index 601e1041c0..a3a42d71da 100644 --- a/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.C +++ b/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.C @@ -176,7 +176,7 @@ template class GeoMesh > Foam::SlicedGeometricField:: -DimensionedInternalField::DimensionedInternalField +Internal::Internal ( const IOobject& io, const Mesh& mesh, @@ -364,7 +364,7 @@ template class GeoMesh > Foam::SlicedGeometricField:: -DimensionedInternalField::~DimensionedInternalField() +Internal::~Internal() { // Set the internalField storage pointer to NULL before its destruction // to protect the field it a slice of. diff --git a/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.H b/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.H index 716225e3fb..13279bf737 100644 --- a/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.H +++ b/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.H @@ -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:: -DimensionedInternalField +Internal : - public GeometricField::DimensionedInternalField + public GeometricField::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(); }; diff --git a/src/OpenFOAM/fields/GeometricFields/geometricOneField/geometricOneField.H b/src/OpenFOAM/fields/GeometricFields/geometricOneField/geometricOneField.H index bca45d065e..13f626ba62 100644 --- a/src/OpenFOAM/fields/GeometricFields/geometricOneField/geometricOneField.H +++ b/src/OpenFOAM/fields/GeometricFields/geometricOneField/geometricOneField.H @@ -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& ); diff --git a/src/OpenFOAM/fields/GeometricFields/geometricOneField/geometricOneFieldI.H b/src/OpenFOAM/fields/GeometricFields/geometricOneField/geometricOneFieldI.H index 59a739684c..521962af09 100644 --- a/src/OpenFOAM/fields/GeometricFields/geometricOneField/geometricOneFieldI.H +++ b/src/OpenFOAM/fields/GeometricFields/geometricOneField/geometricOneFieldI.H @@ -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; diff --git a/src/OpenFOAM/fields/GeometricFields/pointFields/pointFields.C b/src/OpenFOAM/fields/GeometricFields/pointFields/pointFields.C index 0513921abb..04363c13ef 100644 --- a/src/OpenFOAM/fields/GeometricFields/pointFields/pointFields.C +++ b/src/OpenFOAM/fields/GeometricFields/pointFields/pointFields.C @@ -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); diff --git a/src/TurbulenceModels/turbulenceModels/RAS/kEpsilon/kEpsilon.C b/src/TurbulenceModels/turbulenceModels/RAS/kEpsilon/kEpsilon.C index f0cf0a0b2c..54a0db76ce 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/kEpsilon/kEpsilon.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/kEpsilon/kEpsilon.C @@ -235,10 +235,17 @@ void kEpsilon::correct() eddyViscosity>::correct(); - volScalarField divU(fvc::div(fvc::absolute(this->phi(), U))); + volScalarField::Internal divU + ( + fvc::div(fvc::absolute(this->phi(), U))().v() + ); tmp 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::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::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_) ); diff --git a/src/combustionModels/FSD/reactionRateFlameAreaModels/consumptionSpeed/consumptionSpeed.C b/src/combustionModels/FSD/reactionRateFlameAreaModels/consumptionSpeed/consumptionSpeed.C index bd4a6505cd..0d2228d199 100644 --- a/src/combustionModels/FSD/reactionRateFlameAreaModels/consumptionSpeed/consumptionSpeed.C +++ b/src/combustionModels/FSD/reactionRateFlameAreaModels/consumptionSpeed/consumptionSpeed.C @@ -104,7 +104,7 @@ Foam::tmp Foam::consumptionSpeed::omega0Sigma volScalarField& omega0 = tomega0.ref(); - volScalarField::InternalField& iomega0 = omega0.internalField(); + volScalarField::Internal& iomega0 = omega0; forAll(iomega0, celli) { diff --git a/src/dynamicMesh/fvMeshTools/fvMeshToolsTemplates.C b/src/dynamicMesh/fvMeshTools/fvMeshToolsTemplates.C index b63826a0e2..2a8f2cf51d 100644 --- a/src/dynamicMesh/fvMeshTools/fvMeshToolsTemplates.C +++ b/src/dynamicMesh/fvMeshTools/fvMeshToolsTemplates.C @@ -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(), diff --git a/src/finiteVolume/fields/surfaceFields/surfaceFields.C b/src/finiteVolume/fields/surfaceFields/surfaceFields.C index 0cdfda0ca8..83eee6a0e6 100644 --- a/src/finiteVolume/fields/surfaceFields/surfaceFields.C +++ b/src/finiteVolume/fields/surfaceFields/surfaceFields.C @@ -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 ); diff --git a/src/finiteVolume/fields/volFields/volFields.C b/src/finiteVolume/fields/volFields/volFields.C index 055e182b72..a5e05587d7 100644 --- a/src/finiteVolume/fields/volFields/volFields.C +++ b/src/finiteVolume/fields/volFields/volFields.C @@ -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); diff --git a/src/finiteVolume/fields/volFields/volFieldsI.H b/src/finiteVolume/fields/volFields/volFieldsI.H index 27599b47eb..1554785928 100644 --- a/src/finiteVolume/fields/volFields/volFieldsI.H +++ b/src/finiteVolume/fields/volFields/volFieldsI.H @@ -26,7 +26,7 @@ License template class PatchField, class GeoMesh> inline const typename -Foam::GeometricField::DimensionedInternalField& +Foam::GeometricField::Internal& Foam::GeometricField:: v() const { @@ -35,16 +35,4 @@ v() const } -template class PatchField, class GeoMesh> -inline -const typename -Foam::GeometricField::DimensionedInternalField& -Foam::GeometricField:: -operator~() const -{ - static_assert(isVolMesh::value, "Only valid for volFields"); - return *this; -} - - // ************************************************************************* // diff --git a/src/finiteVolume/fvMatrices/solvers/MULES/CMULESTemplates.C b/src/finiteVolume/fvMatrices/solvers/MULES/CMULESTemplates.C index e3f40d1638..db53cbd07f 100644 --- a/src/finiteVolume/fvMatrices/solvers/MULES/CMULESTemplates.C +++ b/src/finiteVolume/fvMatrices/solvers/MULES/CMULESTemplates.C @@ -168,7 +168,7 @@ void Foam::MULES::limiterCorr const labelUList& owner = mesh.owner(); const labelUList& neighb = mesh.neighbour(); - tmp tVsc = mesh.Vsc(); + tmp tVsc = mesh.Vsc(); const scalarField& V = tVsc(); const surfaceScalarField::GeometricBoundaryField& phiBf = diff --git a/src/finiteVolume/fvMatrices/solvers/MULES/MULESTemplates.C b/src/finiteVolume/fvMatrices/solvers/MULES/MULESTemplates.C index b18852a1ae..ba8d62bad5 100644 --- a/src/finiteVolume/fvMatrices/solvers/MULES/MULESTemplates.C +++ b/src/finiteVolume/fvMatrices/solvers/MULES/MULESTemplates.C @@ -199,7 +199,7 @@ void Foam::MULES::limiter const labelUList& owner = mesh.owner(); const labelUList& neighb = mesh.neighbour(); - tmp tVsc = mesh.Vsc(); + tmp tVsc = mesh.Vsc(); const scalarField& V = tVsc(); const scalarField& phiBDIf = phiBD; @@ -330,7 +330,7 @@ void Foam::MULES::limiter if (mesh.moving()) { - tmp V0 = mesh.Vsc0(); + tmp V0 = mesh.Vsc0(); psiMaxn = V diff --git a/src/finiteVolume/fvMesh/fvMesh.C b/src/finiteVolume/fvMesh/fvMesh.C index 0d6b415a48..d3a07693a5 100644 --- a/src/finiteVolume/fvMesh/fvMesh.C +++ b/src/finiteVolume/fvMesh/fvMesh.C @@ -63,8 +63,8 @@ void Foam::fvMesh::clearGeomNotOldVol() MoveableMeshObject >(*this); - slicedVolScalarField::DimensionedInternalField* VPtr = - static_cast(VPtr_); + slicedVolScalarField::Internal* VPtr = + static_cast(VPtr_); deleteDemandDrivenData(VPtr); VPtr_ = NULL; diff --git a/src/finiteVolume/fvMesh/fvMeshGeometry.C b/src/finiteVolume/fvMesh/fvMeshGeometry.C index 1a2c77c5de..efd216d05f 100644 --- a/src/finiteVolume/fvMesh/fvMeshGeometry.C +++ b/src/finiteVolume/fvMesh/fvMeshGeometry.C @@ -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(VPtr_); + return *static_cast(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::tmp Foam::fvMesh::Vsc() const { if (moving() && time().subCycling()) @@ -300,7 +300,7 @@ Foam::fvMesh::Vsc() const } -Foam::tmp +Foam::tmp Foam::fvMesh::Vsc0() const { if (moving() && time().subCycling()) diff --git a/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatch.H b/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatch.H index 95be079ad6..ee8943ec82 100644 --- a/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatch.H +++ b/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatch.H @@ -245,7 +245,7 @@ public: //- Return the corresponding patchField of the named field template - 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 - const typename GeometricField::PatchFieldType& lookupPatchField + const typename GeometricField::Patch& lookupPatchField ( const word& name, const GeometricField* = NULL, diff --git a/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatchFvMeshTemplates.C b/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatchFvMeshTemplates.C index d8fbc1f918..fb178bfeb8 100644 --- a/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatchFvMeshTemplates.C +++ b/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatchFvMeshTemplates.C @@ -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 -const typename GeometricField::PatchFieldType& Foam::fvPatch::lookupPatchField +const typename GeometricField::Patch& Foam::fvPatch::lookupPatchField ( const word& name, const GeometricField*, diff --git a/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatchTemplates.C b/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatchTemplates.C index f3862fdc0a..067ac5f00c 100644 --- a/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatchTemplates.C +++ b/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatchTemplates.C @@ -66,7 +66,7 @@ void Foam::fvPatch::patchInternalField template -const typename GeometricField::PatchFieldType& Foam::fvPatch::patchField +const typename GeometricField::Patch& Foam::fvPatch::patchField ( const GeometricField& gf ) const diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.C b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.C index 8e16fb1f73..92747cedb1 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.C @@ -276,7 +276,7 @@ Foam::surfaceInterpolationScheme::dotInterpolate Field& sfi = sf.internalField(); - const typename SFType::InternalField& Sfi = Sf.internalField(); + const typename SFType::Internal& Sfi = Sf(); for (label fi=0; fi::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& psf = sfbf[pi]; if (vf.boundaryField()[pi].coupled()) diff --git a/src/lagrangian/molecularDynamics/molecule/mdTools/averageMDFields.H b/src/lagrangian/molecularDynamics/molecule/mdTools/averageMDFields.H index fe512038ae..5c8fde3a12 100644 --- a/src/lagrangian/molecularDynamics/molecule/mdTools/averageMDFields.H +++ b/src/lagrangian/molecularDynamics/molecule/mdTools/averageMDFields.H @@ -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) { diff --git a/src/mesh/snappyHexMesh/meshRefinement/meshRefinementTemplates.C b/src/mesh/snappyHexMesh/meshRefinement/meshRefinementTemplates.C index 9246358321..c25a791b1a 100644 --- a/src/mesh/snappyHexMesh/meshRefinement/meshRefinementTemplates.C +++ b/src/mesh/snappyHexMesh/meshRefinement/meshRefinementTemplates.C @@ -222,7 +222,7 @@ void Foam::meshRefinement::addPatchFields fldBf.set ( sz, - GeoField::PatchFieldType::New + GeoField::Patch::New ( patchFieldType, mesh.boundary()[sz], diff --git a/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.C b/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.C index c35709cf6d..32f78e3aa9 100644 --- a/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.C +++ b/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.C @@ -38,10 +38,10 @@ namespace Foam // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -Foam::tmp +Foam::tmp Foam::CourantNo::byRho ( - const tmp& Co + const tmp& Co ) const { if (Co().dimensions() == dimDensity) diff --git a/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.H b/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.H index 7460d74ffb..eff16de0cb 100644 --- a/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.H +++ b/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.H @@ -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 byRho + tmp byRho ( - const tmp& Co + const tmp& Co ) const; //- Disallow default bitwise copy construct diff --git a/src/thermophysicalModels/solidChemistryModel/pyrolysisChemistryModel/pyrolysisChemistryModel.C b/src/thermophysicalModels/solidChemistryModel/pyrolysisChemistryModel/pyrolysisChemistryModel.C index 8817c2f5de..383b3a3b0a 100644 --- a/src/thermophysicalModels/solidChemistryModel/pyrolysisChemistryModel/pyrolysisChemistryModel.C +++ b/src/thermophysicalModels/solidChemistryModel/pyrolysisChemistryModel/pyrolysisChemistryModel.C @@ -637,7 +637,7 @@ Foam::pyrolysisChemistryModel::gasHs ) ); - volScalarField::InternalField& gasHs = tHs.ref().internalField(); + volScalarField::Internal& gasHs = tHs.ref(); const GasThermo& mixture = gasThermo_[index];