/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . \*---------------------------------------------------------------------------*/ #include "surfaceFieldValue.H" #include "fvMesh.H" #include "emptyPolyPatch.H" #include "coupledPolyPatch.H" #include "sampledSurface.H" #include "mergePoints.H" #include "indirectPrimitivePatch.H" #include "PatchTools.H" #include "meshedSurfRef.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { namespace functionObjects { namespace fieldValues { defineTypeNameAndDebug(surfaceFieldValue, 0); addToRunTimeSelectionTable(fieldValue, surfaceFieldValue, dictionary); addToRunTimeSelectionTable(functionObject, surfaceFieldValue, dictionary); } } } template<> const char* Foam::NamedEnum < Foam::functionObjects::fieldValues::surfaceFieldValue::regionTypes, 4 >::names[] = { "faceZone", "patch", "surface", "sampledSurface" }; template<> const char* Foam::NamedEnum < Foam::functionObjects::fieldValues::surfaceFieldValue::operationType, 17 >::names[] = { "none", "sum", "sumMag", "weightedSum", "sumDirection", "sumDirectionBalance", "average", "weightedAverage", "areaAverage", "weightedAreaAverage", "areaIntegrate", "weightedAreaIntegrate", "min", "max", "CoV", "areaNormalAverage", "areaNormalIntegrate" }; template<> const char* Foam::NamedEnum < Foam::functionObjects::fieldValues::surfaceFieldValue::postOperationType, 2 >::names[] = { "none", "sqrt" }; const Foam::NamedEnum < Foam::functionObjects::fieldValues::surfaceFieldValue::regionTypes, 4 > Foam::functionObjects::fieldValues::surfaceFieldValue::regionTypeNames_; const Foam::NamedEnum < Foam::functionObjects::fieldValues::surfaceFieldValue::operationType, 17 > Foam::functionObjects::fieldValues::surfaceFieldValue::operationTypeNames_; const Foam::NamedEnum < Foam::functionObjects::fieldValues::surfaceFieldValue::postOperationType, 2 > 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() { const label zoneId = mesh_.faceZones().findZoneID(regionName_); if (zoneId < 0) { FatalErrorInFunction << type() << " " << name() << ": " << regionTypeNames_[regionType_] << "(" << regionName_ << "):" << nl << " Unknown face zone name: " << regionName_ << ". Valid face zones are: " << mesh_.faceZones().names() << nl << exit(FatalError); } const faceZone& fZone = mesh_.faceZones()[zoneId]; DynamicList