ENH: allow modifiable access to IOobject local(), as per instance()

ENH: simplify code by using fieldTypes::is_xxx() tests
This commit is contained in:
Mark Olesen
2025-08-12 12:34:39 +02:00
parent 891ac808de
commit 1642841868
26 changed files with 95 additions and 128 deletions

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2019-2023 OpenCFD Ltd.
Copyright (C) 2019-2025 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -315,8 +315,8 @@ bool Foam::areaWrite::write()
if
(
fieldTypes::area.contains(clsName)
|| fieldTypes::area_internal.contains(clsName)
Foam::fieldTypes::is_area(clsName)
|| Foam::fieldTypes::is_area_internal(clsName)
)
{
nAreaFields += n;

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017-2022 OpenCFD Ltd.
Copyright (C) 2017-2025 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -29,7 +29,7 @@ License
#include "dictionary.H"
#include "Time.H"
#include "areaFields.H"
#include "stringListOps.H" // For stringListOps::foundOp()
#include "volFields.H"
#include "foamVtkInternalWriter.H"
#include "foamVtkPatchWriter.H"
#include "foamVtkSeriesWriter.H"
@ -332,11 +332,7 @@ bool Foam::functionObjects::vtkWrite::write()
const label nVolFields =
(
(doInternal_ || doBoundary_)
? baseMesh.count
(
stringListOps::foundOp<word>(fieldTypes::volume),
candidateNames
)
? baseMesh.count(Foam::fieldTypes::is_volume, candidateNames)
: 0
);
@ -345,11 +341,7 @@ bool Foam::functionObjects::vtkWrite::write()
const label nDimFields = 0;
// (
// (doInternal_ || doBoundary_)
// ? baseMesh.count
// (
// stringListOps::foundOp<word>(fieldTypes::internal),
// candidateNames
// )
// ? baseMesh.count(Foam::fieldTypes::is_internal, candidateNames)
// : 0
// );