From 8e0981d9ed28706ec723b28d6d76530ab899e751 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Fri, 9 Sep 2016 11:01:37 +0100 Subject: [PATCH 01/42] functionObjectList::readFunctionObject: Added support for region specification Now the postProcess utility '-region' option works correctly, e.g. for the chtMultiRegionSimpleFoam/heatExchanger case postProcess -region air -func "mag(U)" calculates 'mag(U)' for all the time steps in region 'air'. --- .../functionObjectList/functionObjectList.C | 33 +++++++++++++++++-- .../functionObjectList/functionObjectList.H | 3 +- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C index 7bd1882942..04cfc5acfb 100644 --- a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C +++ b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C @@ -151,7 +151,8 @@ bool Foam::functionObjectList::readFunctionObject ( const string& funcNameArgs, dictionary& functionsDict, - HashSet& requiredFields + HashSet& requiredFields, + const word& region ) { // Parse the optional functionObject arguments: @@ -291,6 +292,12 @@ bool Foam::functionObjectList::readFunctionObject funcDict.set(entry::New(entryStream).ptr()); } + // Insert the region name if specified + if (region != word::null) + { + funcDict.set("region", region); + } + // Merge this functionObject dictionary into functionsDict dictionary funcArgsDict; funcArgsDict.add(string::validate(funcNameArgs), funcDict); @@ -352,6 +359,14 @@ Foam::autoPtr Foam::functionObjectList::New dictionary& functionsDict = controlDict.subDict("functions"); + word region = word::null; + + // Set the region name if specified + if (args.optionFound("region")) + { + region = args["region"]; + } + if ( args.optionFound("dict") @@ -377,7 +392,13 @@ Foam::autoPtr Foam::functionObjectList::New if (args.optionFound("func")) { - readFunctionObject(args["func"], functionsDict, requiredFields); + readFunctionObject + ( + args["func"], + functionsDict, + requiredFields, + region + ); } if (args.optionFound("funcs")) @@ -386,7 +407,13 @@ Foam::autoPtr Foam::functionObjectList::New forAll(funcs, i) { - readFunctionObject(funcs[i], functionsDict, requiredFields); + readFunctionObject + ( + funcs[i], + functionsDict, + requiredFields, + region + ); } } diff --git a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H index da27e7d7f3..405e613369 100644 --- a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H +++ b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H @@ -218,7 +218,8 @@ public: ( const string& funcNameArgs0, dictionary& functionsDict, - HashSet& requiredFields + HashSet& requiredFields, + const word& region = word::null ); //- Read and set the function objects if their data have changed From cb1a012b66b3e0d72cef50197b6cd3d0887c7693 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Fri, 9 Sep 2016 12:20:25 +0100 Subject: [PATCH 02/42] structuredRenumber: Corrected to run in parallel Patch contributed by Mattijs Janssens --- .../structuredRenumber/OppositeFaceCellWave.C | 331 ++++++++++++++++++ .../structuredRenumber/OppositeFaceCellWave.H | 143 ++++++++ .../OppositeFaceCellWaveName.C | 36 ++ .../structuredRenumber/structuredRenumber.C | 154 +++++--- .../structuredRenumber/structuredRenumber.H | 35 +- 5 files changed, 651 insertions(+), 48 deletions(-) create mode 100644 src/renumber/renumberMethods/structuredRenumber/OppositeFaceCellWave.C create mode 100644 src/renumber/renumberMethods/structuredRenumber/OppositeFaceCellWave.H create mode 100644 src/renumber/renumberMethods/structuredRenumber/OppositeFaceCellWaveName.C diff --git a/src/renumber/renumberMethods/structuredRenumber/OppositeFaceCellWave.C b/src/renumber/renumberMethods/structuredRenumber/OppositeFaceCellWave.C new file mode 100644 index 0000000000..4e865bd0b1 --- /dev/null +++ b/src/renumber/renumberMethods/structuredRenumber/OppositeFaceCellWave.C @@ -0,0 +1,331 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +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 "OppositeFaceCellWave.H" +#include "polyMesh.H" + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +template +void Foam::OppositeFaceCellWave::opposingFaceLabels +( + const label celli, + const label masterFaceLabel, + DynamicList