diff --git a/src/OpenFOAM/db/functionObjects/regionFunctionObject/regionFunctionObject.H b/src/OpenFOAM/db/functionObjects/regionFunctionObject/regionFunctionObject.H index 70be4fccfe..621479f615 100644 --- a/src/OpenFOAM/db/functionObjects/regionFunctionObject/regionFunctionObject.H +++ b/src/OpenFOAM/db/functionObjects/regionFunctionObject/regionFunctionObject.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation - \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. + \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -87,7 +87,7 @@ protected: ); //- The region or sub-region registry being used - const objectRegistry& obr() const; + virtual const objectRegistry& obr() const; //- Find object (eg, a field) in the (sub) objectRegistry @@ -176,7 +176,7 @@ public: // Member Functions //- Read optional controls - virtual bool read(const dictionary&); + virtual bool read(const dictionary& dict) override; }; diff --git a/src/functionObjects/field/fieldValues/surfaceFieldValue/surfaceFieldValue.C b/src/functionObjects/field/fieldValues/surfaceFieldValue/surfaceFieldValue.C index 0ccc48bd75..479f93c5a8 100644 --- a/src/functionObjects/field/fieldValues/surfaceFieldValue/surfaceFieldValue.C +++ b/src/functionObjects/field/fieldValues/surfaceFieldValue/surfaceFieldValue.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,6 +31,7 @@ License #include "mergePoints.H" #include "indirectPrimitivePatch.H" #include "PatchTools.H" +#include "meshedSurfRef.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -52,11 +53,12 @@ template<> const char* Foam::NamedEnum < Foam::functionObjects::fieldValues::surfaceFieldValue::regionTypes, - 3 + 4 >::names[] = { "faceZone", "patch", + "surface", "sampledSurface" }; @@ -64,12 +66,13 @@ template<> const char* Foam::NamedEnum < Foam::functionObjects::fieldValues::surfaceFieldValue::operationType, - 16 + 17 >::names[] = { "none", "sum", "sumMag", + "weightedSum", "sumDirection", "sumDirectionBalance", "average", @@ -100,13 +103,13 @@ const char* Foam::NamedEnum const Foam::NamedEnum < Foam::functionObjects::fieldValues::surfaceFieldValue::regionTypes, - 3 + 4 > Foam::functionObjects::fieldValues::surfaceFieldValue::regionTypeNames_; const Foam::NamedEnum < Foam::functionObjects::fieldValues::surfaceFieldValue::operationType, - 16 + 17 > Foam::functionObjects::fieldValues::surfaceFieldValue::operationTypeNames_; const Foam::NamedEnum @@ -119,9 +122,23 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::postOperationTypeNames_; // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // +const Foam::objectRegistry& +Foam::functionObjects::fieldValues::surfaceFieldValue::obr() const +{ + if (regionType_ == stSurface) + { + return mesh_.lookupObject(regionName_); + } + else + { + return mesh_; + } +} + + void Foam::functionObjects::fieldValues::surfaceFieldValue::setFaceZoneFaces() { - label zoneId = mesh_.faceZones().findZoneID(regionName_); + const label zoneId = mesh_.faceZones().findZoneID(regionName_); if (zoneId < 0) { @@ -137,11 +154,11 @@ void Foam::functionObjects::fieldValues::surfaceFieldValue::setFaceZoneFaces() DynamicList