mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
- findStrings, findMatchingStrings now mostly covered by matching intrinsics in wordRe and wordRes. Add static wordRes match() and matching() variants COMP: remove stringListOps include from objectRegistry.H - was already noted for removal (NOV-2018)
72 lines
2.1 KiB
C
72 lines
2.1 KiB
C
/*---------------------------------------------------------------------------*\
|
|
========= |
|
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
\\ / O peration |
|
|
\\ / A nd | www.openfoam.com
|
|
\\/ M anipulation |
|
|
-------------------------------------------------------------------------------
|
|
Copyright (C) 2021-2023 OpenCFD Ltd.
|
|
-------------------------------------------------------------------------------
|
|
License
|
|
This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
|
|
|
Description
|
|
Check field availability for last time.
|
|
Done to avoid mapping 'undefined' when a field only exists as time 0.
|
|
|
|
Requires
|
|
readFields.H (for the checkData function)
|
|
|
|
\*---------------------------------------------------------------------------*/
|
|
|
|
// Initially all possible objects that are available at the final time
|
|
List<wordHashSet> availableRegionObjectNames(meshes.size());
|
|
|
|
forAll(meshes, regioni)
|
|
{
|
|
const auto& mesh = meshes[regioni];
|
|
|
|
IOobjectList objects;
|
|
|
|
if (doConvertFields && !timeDirs.empty())
|
|
{
|
|
objects = IOobjectList(mesh, timeDirs.back().name());
|
|
|
|
if (fieldSelector && !fieldSelector().empty())
|
|
{
|
|
objects.filterObjects(fieldSelector());
|
|
}
|
|
|
|
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());
|
|
|
|
// Check availability for all times...
|
|
checkData(mesh, timeDirs, objectNames);
|
|
|
|
availableRegionObjectNames[regioni] = objectNames;
|
|
}
|
|
|
|
|
|
// ************************************************************************* //
|