ENH: new foamToVTK output option -processor-fields

- write values of processor boundaries only, for diagnostic purposes.

- parallel only, and non-legacy format only
This commit is contained in:
Mark Olesen
2019-01-14 17:32:07 +01:00
parent 9ccae1d37f
commit 2a1d0f36ec
2 changed files with 252 additions and 1 deletions

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2016-2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -329,6 +329,12 @@ int main(int argc, char *argv[])
"Eg, 'T' or '(p T U \"alpha.*\")'"
);
argList::addBoolOption
(
"processor-fields",
"Write field values on processor boundaries only",
true // mark as an advanced option
);
argList::addBoolOption
(
"surfaceFields",
@ -450,6 +456,29 @@ int main(int argc, char *argv[])
const vtk::outputOptions writeOpts = getOutputOptions(args);
bool processorFieldsOnly = false;
if (args.found("processor-fields"))
{
if (!Pstream::parRun())
{
Info<< "Ignoring processor patch writing in serial"
<< nl << endl;
}
else if (writeOpts.legacy())
{
Info<< "Ignoring processor patch writing in legacy format"
<< nl << endl;
}
else
{
processorFieldsOnly = true;
Info<< "Writing processor patch fields only"
<< nl << endl;
}
}
if (nearCellValue)
{
Info<< "Using neighbouring cell value instead of patch value"
@ -741,6 +770,13 @@ int main(int argc, char *argv[])
);
}
if (processorFieldsOnly)
{
// Processor-patches only and continue
#include "convertProcessorPatches.H"
continue;
}
// Volume, internal, point fields
#include "convertVolumeFields.H"