ENH: -exclude-fields, -no-fields options for foamToEnsight, foamToVTK

- additional verbosity option for conversions

- ignore old `-finite-area` option and always convert available
  finiteArea mesh/fields unless `-no-finite-area` is specified (#2374)

ENH: simplify point offset handling for ensight output

- extend writing to include compact face/cell lists
This commit is contained in:
Mark Olesen
2022-03-07 15:15:21 +01:00
parent 730ce92b68
commit c4d4becbac
28 changed files with 642 additions and 240 deletions

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2021 OpenCFD Ltd.
Copyright (C) 2021-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
@ -26,27 +26,37 @@ forAll(meshes, regioni)
{
const auto& mesh = meshes[regioni];
IOobjectList objects(mesh, timeDirs.last().name());
IOobjectList objects(0);
if (!fieldPatterns.empty())
if (doConvertFields)
{
objects.filterObjects(fieldPatterns);
}
objects = IOobjectList(mesh, timeDirs.last().name());
// Remove "*_0" restart fields
objects.prune_0();
if (fieldSelector && !fieldSelector().empty())
{
objects.filterObjects(fieldSelector());
}
if (!doPointValues)
{
// Prune point fields if disabled
objects.filterClasses
(
[](const word& clsName)
{
return fieldTypes::point.found(clsName);
},
true // prune
);
if (fieldSelector && !fieldSelector().empty())
{
objects.filterObjects(fieldSelector());
}
// Remove "*_0" restart fields
objects.prune_0();
if (!doPointValues)
{
// Prune point fields if disabled
objects.filterClasses
(
[](const word& clsName)
{
return fieldTypes::point.found(clsName);
},
true // prune
);
}
}
wordList objectNames(objects.sortedNames());