From 6c103e247d1310c1ac4c11a88fd4eafbc2e0f8c1 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Wed, 8 Mar 2017 11:48:06 +0000 Subject: [PATCH] decomposePar: Added 'copyZero' option Using decomposePar -copyZero The mesh is decomposed as usual but the '0' directory is recursively copied to the 'processor.*' directories rather than decomposing the fields. This is a convenient option to handle cases where the initial field files are generic and can be used for serial or parallel running. See for example the incompressible/simpleFoam/motorBike tutorial case. --- .../decomposePar/decomposePar.C | 1316 +++++++++-------- src/OpenFOAM/db/Time/timeSelector.C | 8 +- .../simpleFoam/motorBike/Allclean | 5 +- .../simpleFoam/motorBike/Allrun | 13 +- 4 files changed, 700 insertions(+), 642 deletions(-) diff --git a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C index bc9478264..f9425cc50 100644 --- a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C +++ b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,6 +43,9 @@ Usage Decompose all regions in regionProperties. Does not check for existence of processor*. + - \par -copyZero \n + Copy \a 0 directory to processor* rather than decompose the fields. + - \par -copyUniform \n Copy any \a uniform directories too. @@ -215,6 +218,11 @@ int main(int argc, char *argv[]) "decomposition method or as a volScalarField for post-processing." ); argList::addBoolOption + ( + "copyZero", + "Copy \a 0 directory to processor* rather than decompose the fields" + ); + argList::addBoolOption ( "copyUniform", "copy any uniform/ directories too" @@ -247,6 +255,7 @@ int main(int argc, char *argv[]) bool allRegions = args.optionFound("allRegions"); bool writeCellDist = args.optionFound("cellDist"); + bool copyZero = args.optionFound("copyZero"); bool copyUniform = args.optionFound("copyUniform"); bool decomposeFieldsOnly = args.optionFound("fields"); bool decomposeSets = !args.optionFound("noSets"); @@ -476,668 +485,715 @@ int main(int argc, char *argv[]) } - - // Caches - // ~~~~~~ - // Cached processor meshes and maps. These are only preserved if running - // with multiple times. - PtrList