From 3d892ace290b5ecc7d222844a41b92f2afdfdf9c Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 18 Jul 2022 12:11:53 +0200 Subject: [PATCH] STYLE: set readOpt(..), writeOpt(..) by parameter, not by assignment STYLE: qualify format/version/compression with IOstreamOption not IOstream STYLE: reduce number of lookups when scanning {fa,fv}Solution STYLE: call IOobject::writeEndDivider as static --- .../combustion/PDRFoam/PDRFoamAutoRefine.C | 2 +- .../laserDTRM/DTRMParticle/DTRMParticleIO.C | 6 +-- .../test/CompactIOList/Test-CompactIOList.C | 18 +++----- .../test/IndirectList/Test-IndirectList.C | 2 +- .../Test-decomposedBlockData.C | 4 +- .../test/foamToMetisGraph/foamToMetisGraph.C | 4 +- .../test/primitives/Test-primitives.C | 6 +-- .../foamyHexMeshBackgroundMesh.C | 4 +- .../generation/snappyHexMesh/snappyHexMesh.C | 2 +- .../foamFormatConvert/foamFormatConvert.C | 6 +-- .../reconstructParMesh/reconstructParMesh.C | 6 ++- .../redistributePar/passivePositionParticle.H | 4 +- .../profilingSummary/profilingSummary.C | 2 +- .../createZeroDirectory/createZeroDirectory.C | 4 +- .../writeActiveDesignVariables.C | 4 +- .../setExprBoundaryFields.C | 4 +- .../setExprFields/setExprFields.C | 6 +-- src/OpenFOAM/containers/Bits/BitOps/BitOps.H | 2 +- .../containers/Bits/PackedList/PackedListIO.C | 6 +-- .../containers/Buffers/CircularBufferIO.C | 2 +- .../IndirectListBase/IndirectListBaseIO.C | 4 +- .../containers/Lists/FixedList/FixedListIO.C | 6 +-- src/OpenFOAM/containers/Lists/List/ListIO.C | 4 +- src/OpenFOAM/containers/Lists/List/UListIO.C | 8 ++-- .../IOobjects/CompactIOField/CompactIOField.C | 6 +-- .../IOobjects/CompactIOList/CompactIOList.C | 10 ++--- .../IOobjects/GlobalIOField/GlobalIOField.C | 12 ++--- .../db/IOobjects/GlobalIOList/GlobalIOList.C | 10 ++--- .../db/IOobjects/IOdictionary/IOdictionary.C | 4 +- .../IOdictionary/localIOdictionary.C | 4 +- .../IOdictionary/unwatchedIOdictionary.C | 2 +- src/OpenFOAM/db/IOstreams/IOstreams/IOmanip.H | 18 ++++---- .../db/IOstreams/Pstreams/UIPstreamBase.C | 6 +-- src/OpenFOAM/db/Time/Time.C | 8 ++-- src/OpenFOAM/db/Time/Time.H | 6 +-- .../functionObjectList/functionObjectList.C | 4 +- src/OpenFOAM/db/regIOobject/regIOobjectRead.C | 5 ++- src/OpenFOAM/dimensionSet/dimensionSetIO.C | 4 +- .../expressions/exprResult/exprResult.C | 8 ++-- .../exprResult/exprResultGlobals.C | 8 ++-- .../UniformDimensionedField.C | 5 ++- .../collatedFileOperation.C | 5 ++- .../threadedCollatedOFstream.C | 4 +- src/OpenFOAM/global/profiling/profiling.C | 9 +++- .../tableReaders/csv/csvTableReader.C | 6 +-- .../uniformInterpolationTable.C | 4 +- src/OpenFOAM/matrices/Matrix/MatrixIO.C | 6 +-- src/OpenFOAM/matrices/schemes/schemesLookup.C | 2 +- src/OpenFOAM/matrices/solution/solution.C | 44 ++++++++++--------- src/OpenFOAM/meshes/boundBox/boundBox.C | 6 +-- .../meshShapes/labelledTri/labelledTriI.H | 6 +-- .../mapDistribute/mapDistributeBaseIO.C | 4 +- .../primitiveShapes/objectHit/PointIndexHit.H | 6 +-- .../primitives/chars/lists/charList.C | 4 +- .../primitives/chars/lists/charUList.C | 6 +-- .../coordinate/systems/coordinateSystems.C | 2 +- .../primitives/functions/Function1/CSV/CSV.C | 6 +-- src/conversion/common/reader/meshReaderAux.C | 4 +- src/conversion/fire/FIREMeshReader.C | 8 ++-- src/conversion/fire/FIREMeshWriter.C | 28 ++++++++---- .../directions/directionInfo/directionInfo.C | 6 +-- .../meshCut/refineCell/refineCell.C | 3 +- .../wallNormalInfo/wallNormalInfo.C | 6 +-- .../polyTopoChange/refinementData.C | 6 +-- src/fileFormats/ensight/file/ensightCase.C | 4 +- src/fileFormats/ensight/file/ensightCase.H | 4 +- .../ensight/file/ensightCaseOptions.C | 4 +- src/fileFormats/ensight/file/ensightFile.C | 8 ++-- src/fileFormats/ensight/file/ensightFile.H | 4 +- src/fileFormats/ensight/file/ensightGeoFile.C | 8 ++-- src/fileFormats/ensight/file/ensightGeoFile.H | 4 +- src/fileFormats/fire/FIRECore.C | 18 ++++---- src/fileFormats/gltf/foamGltfScene.C | 2 +- src/fileFormats/stl/STLCore.C | 9 ++-- .../field/momentumError/momentumError.C | 2 +- .../field/nearWallFields/findCellParticle.C | 6 +-- .../wallBoundedParticle.C | 6 +-- .../Templates/DSMCParcel/DSMCParcelIO.C | 6 +-- src/lagrangian/basic/Cloud/CloudIO.C | 2 +- .../injectedParticle/injectedParticleIO.C | 8 ++-- src/lagrangian/basic/particle/particleIO.C | 12 ++--- .../Templates/KinematicCloud/KinematicCloud.C | 4 +- .../conversion/ensight/ensightOutputCloud.C | 2 +- .../CollidingParcel/CollidingParcelIO.C | 6 +-- .../KinematicParcel/KinematicParcelIO.C | 6 +-- .../Templates/MPPICParcel/MPPICParcelIO.C | 6 +-- .../ReactingHeterogeneousParcelIO.C | 4 +- .../ReactingMultiphaseParcelIO.C | 4 +- .../ReactingParcel/ReactingParcelIO.C | 6 +-- .../Templates/ThermoParcel/ThermoParcelIO.C | 6 +-- .../PatchParticleHistogram.C | 4 +- .../PatchPostProcessing/PatchPostProcessing.C | 4 +- .../molecule/molecule/moleculeIO.C | 6 +-- .../solidParticle/solidParticleIO.C | 6 +-- .../Templates/SprayParcel/SprayParcelIO.C | 6 +-- .../PDRblockMesh/PDRblockBlockMesh.C | 2 +- .../PointIntegrateData/PointIntegrateDataI.H | 4 +- .../trackedParticle/trackedParticle.C | 6 +-- src/meshTools/AABBTree/AABBTree.C | 6 +-- .../algorithms/PointEdgeWave/PointData.C | 4 +- .../coordSet/writers/csv/csvCoordSetWriter.C | 4 +- .../writers/ensight/ensightCoordSetWriter.C | 4 +- .../writers/ensight/ensightCoordSetWriter.H | 2 +- .../ensight/ensightCoordSetWriterCollated.C | 2 +- .../ensight/ensightCoordSetWriterUncollated.C | 2 +- .../writers/gnuplot/gnuplotCoordSetWriter.C | 4 +- .../coordSet/writers/raw/rawCoordSetWriter.C | 4 +- .../coordSet/writers/vtk/vtkCoordSetWriter.C | 4 +- .../writers/xmgrace/xmgraceCoordSetWriter.C | 4 +- .../edgeMesh/edgeFormats/obj/OBJedgeFormat.C | 4 +- .../edgeFormats/starcd/STARCDedgeFormat.C | 4 +- .../lineSearch/lineSearch/lineSearch.C | 4 +- .../updateMethod/updateMethod/updateMethod.C | 4 +- .../distributedTriSurfaceMesh.C | 2 +- .../reconstruct/passivePositionParticle.H | 2 +- .../regionModel/regionModel/regionModel.C | 4 +- .../rigidBodyMeshMotion/rigidBodyMeshMotion.C | 4 +- .../rigidBodyMeshMotionSolver.C | 4 +- .../readers/ensight/ensightSurfaceReader.C | 12 ++--- .../MeshedSurfaceProxy/MeshedSurfaceProxy.C | 8 ++-- .../abaqus/ABAQUSsurfaceFormat.C | 4 +- .../surfaceFormats/ac3d/AC3DsurfaceFormat.C | 6 +-- .../surfaceFormats/fire/FLMAsurfaceFormat.C | 42 ++++++++++++------ .../surfaceFormats/gts/GTSsurfaceFormat.C | 6 +-- .../surfaceFormats/nas/NASsurfaceFormat.C | 4 +- .../surfaceFormats/obj/OBJsurfaceFormat.C | 4 +- .../surfaceFormats/off/OFFsurfaceFormat.C | 4 +- .../surfaceFormats/smesh/SMESHsurfaceFormat.C | 4 +- .../starcd/STARCDsurfaceFormat.C | 4 +- .../surfaceFormats/stl/STLsurfaceFormat.C | 10 ++--- .../surfaceFormats/tri/TRIsurfaceFormat.C | 6 +-- .../surfaceFormats/x3d/X3DsurfaceFormat.C | 4 +- .../boundary/boundaryDataSurfaceWriter.C | 10 ++--- .../ensight/ensightSurfaceWriterCollated.C | 2 +- .../ensight/ensightSurfaceWriterUncollated.C | 2 +- 135 files changed, 423 insertions(+), 387 deletions(-) diff --git a/applications/solvers/combustion/PDRFoam/PDRFoamAutoRefine.C b/applications/solvers/combustion/PDRFoam/PDRFoamAutoRefine.C index eee192b2f9..4dd385162d 100644 --- a/applications/solvers/combustion/PDRFoam/PDRFoamAutoRefine.C +++ b/applications/solvers/combustion/PDRFoam/PDRFoamAutoRefine.C @@ -116,7 +116,7 @@ int main(int argc, char *argv[]) "normalisedGradP", tmagGradP()/max(tmagGradP()) ); - normalisedGradP.writeOpt() = IOobject::AUTO_WRITE; + normalisedGradP.writeOpt(IOobject::AUTO_WRITE); tmagGradP.clear(); ++runTime; diff --git a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/laserDTRM/DTRMParticle/DTRMParticleIO.C b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/laserDTRM/DTRMParticle/DTRMParticleIO.C index 77592c7eae..0a8387a4d5 100644 --- a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/laserDTRM/DTRMParticle/DTRMParticleIO.C +++ b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/laserDTRM/DTRMParticle/DTRMParticleIO.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2017-2019 OpenCFD Ltd. + Copyright (C) 2017-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -59,7 +59,7 @@ Foam::DTRMParticle::DTRMParticle { if (readFields) { - if (is.format() == IOstream::ASCII) + if (is.format() == IOstreamOption::ASCII) { is >> p0_ >> p1_ >> I0_ >> I_ >> dA_ >> transmissiveId_; } @@ -115,7 +115,7 @@ void Foam::DTRMParticle::writeProperties Foam::Ostream& Foam::operator<<(Ostream& os, const DTRMParticle& p) { - if (os.format() == IOstream::ASCII) + if (os.format() == IOstreamOption::ASCII) { os << static_cast(p) << token::SPACE << p.p0_ diff --git a/applications/test/CompactIOList/Test-CompactIOList.C b/applications/test/CompactIOList/Test-CompactIOList.C index 9e5b40e9b1..66d5b8dd7e 100644 --- a/applications/test/CompactIOList/Test-CompactIOList.C +++ b/applications/test/CompactIOList/Test-CompactIOList.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2020 OpenCFD Ltd. + Copyright (C) 2020-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -49,8 +49,8 @@ int main(int argc, char *argv[]) #include "setRootCase.H" #include "createTime.H" - IOstream::streamFormat format = IOstream::BINARY; - // IOstream::streamFormat format = IOstream::ASCII; + IOstreamOption streamOpt(IOstreamOption::BINARY); + // IOstreamOption streamOpt(IOstreamOption::ASCII); const label size = 20000000; @@ -85,11 +85,7 @@ int main(int argc, char *argv[]) << runTime.cpuTimeIncrement() << " s" << nl << endl; - faces2.writeObject - ( - IOstreamOption(format), - true - ); + faces2.writeObject(streamOpt, true); Info<< "Written old format faceList in = " << runTime.cpuTimeIncrement() << " s" << nl << endl; @@ -145,11 +141,7 @@ int main(int argc, char *argv[]) << runTime.cpuTimeIncrement() << " s" << nl << endl; - faces2.writeObject - ( - IOstreamOption(format), - true - ); + faces2.writeObject(streamOpt, true); Info<< "Written new format faceList in = " << runTime.cpuTimeIncrement() << " s" << nl << endl; diff --git a/applications/test/IndirectList/Test-IndirectList.C b/applications/test/IndirectList/Test-IndirectList.C index 27736a2cd6..eb22bf3b30 100644 --- a/applications/test/IndirectList/Test-IndirectList.C +++ b/applications/test/IndirectList/Test-IndirectList.C @@ -146,7 +146,7 @@ int main(int argc, char *argv[]) { Info<<"Writing output to " << binaryOutput << endl; - OFstream os(binaryOutput, IOstream::BINARY); + OFstream os(binaryOutput, IOstreamOption::BINARY); os.writeEntry("idl1", idl1); os.writeEntry("idl2", idl2); diff --git a/applications/test/decomposedBlockData/Test-decomposedBlockData.C b/applications/test/decomposedBlockData/Test-decomposedBlockData.C index 2402055210..182e9214cc 100644 --- a/applications/test/decomposedBlockData/Test-decomposedBlockData.C +++ b/applications/test/decomposedBlockData/Test-decomposedBlockData.C @@ -78,8 +78,8 @@ int main(int argc, char *argv[]) OFstream os ( objPath, - IOstream::BINARY, - IOstream::currentVersion, + IOstreamOption::BINARY, + IOstreamOption::currentVersion, runTime.writeCompression() ); if (!os.good()) diff --git a/applications/test/foamToMetisGraph/foamToMetisGraph.C b/applications/test/foamToMetisGraph/foamToMetisGraph.C index f80943b8c4..3a40f25a9e 100644 --- a/applications/test/foamToMetisGraph/foamToMetisGraph.C +++ b/applications/test/foamToMetisGraph/foamToMetisGraph.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2017 OpenCFD Ltd. + Copyright (C) 2017-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -56,7 +56,7 @@ int main(int argc, char *argv[]) // No. of Nodes = nCells // No. of Edges connecting Nodes = nInternalFaces - OFstream os(args.caseName() + ".graph", IOstream::ASCII); + OFstream os(args.caseName() + ".graph", IOstreamOption::ASCII); os << "%% metis graph file, of an OpenFOAM mesh %%" << nl << "%% nCells=" << mesh.nCells() diff --git a/applications/test/primitives/Test-primitives.C b/applications/test/primitives/Test-primitives.C index 0eb6a07110..bfa5d38906 100644 --- a/applications/test/primitives/Test-primitives.C +++ b/applications/test/primitives/Test-primitives.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2017-2021 OpenCFD Ltd. + Copyright (C) 2017-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -334,7 +334,7 @@ int main(int argc, char *argv[]) DynamicList buf; - OListStream os(std::move(buf), IOstream::BINARY); + OListStream os(std::move(buf), IOstreamOption::BINARY); os << srcList; os.swap(buf); // Recover buffer @@ -342,7 +342,7 @@ int main(int argc, char *argv[]) // Read back List dstList; - UIListStream is(buf, IOstream::BINARY); + UIListStream is(buf, IOstreamOption::BINARY); is.setScalarByteSize(sizeof(otherType)); Info<< "Stream scalar-size (" diff --git a/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshBackgroundMesh/foamyHexMeshBackgroundMesh.C b/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshBackgroundMesh/foamyHexMeshBackgroundMesh.C index 3e2903b858..39729a2a78 100644 --- a/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshBackgroundMesh/foamyHexMeshBackgroundMesh.C +++ b/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshBackgroundMesh/foamyHexMeshBackgroundMesh.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2012-2016 OpenFOAM Foundation - Copyright (C) 2016-2021 OpenCFD Ltd. + Copyright (C) 2016-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -73,7 +73,7 @@ scalar getMergeDistance Info<< "Merge tolerance : " << mergeTol << nl << "Write tolerance : " << writeTol << endl; - if (runTime.writeFormat() == IOstream::ASCII && mergeTol < writeTol) + if (runTime.writeFormat() == IOstreamOption::ASCII && mergeTol < writeTol) { FatalErrorInFunction << "Your current settings specify ASCII writing with " diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C index 51d7bde843..c62a340a02 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C +++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C @@ -616,7 +616,7 @@ scalar getMergeDistance << endl; // check writing tolerance - if (mesh.time().writeFormat() == IOstream::ASCII && !dryRun) + if (mesh.time().writeFormat() == IOstreamOption::ASCII && !dryRun) { const scalar writeTol = std::pow ( diff --git a/applications/utilities/miscellaneous/foamFormatConvert/foamFormatConvert.C b/applications/utilities/miscellaneous/foamFormatConvert/foamFormatConvert.C index 44ef3d3f7c..6abc6c7020 100644 --- a/applications/utilities/miscellaneous/foamFormatConvert/foamFormatConvert.C +++ b/applications/utilities/miscellaneous/foamFormatConvert/foamFormatConvert.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2016-2021 OpenCFD Ltd. + Copyright (C) 2016-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -160,7 +160,7 @@ bool writeZones // Force writing as ASCII writeOk = meshObject.regIOobject::writeObject ( - IOstreamOption(IOstream::ASCII, compression), + IOstreamOption(IOstreamOption::ASCII, compression), true ); } @@ -355,7 +355,7 @@ int main(int argc, char *argv[]) runTime ); - if (runTime.writeFormat() == IOstream::ASCII) + if (runTime.writeFormat() == IOstreamOption::ASCII) { // Only do zones when converting from binary to ascii // The other way gives problems since working on dictionary level. diff --git a/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C b/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C index 4b57c890dc..e285bd12a3 100644 --- a/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C +++ b/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C @@ -663,7 +663,11 @@ int main(int argc, char *argv[]) Info<< "Merge tolerance : " << mergeTol << nl << "Write tolerance : " << writeTol << endl; - if (runTime.writeFormat() == IOstream::ASCII && mergeTol < writeTol) + if + ( + runTime.writeFormat() == IOstreamOption::ASCII + && mergeTol < writeTol + ) { FatalErrorInFunction << "Your current settings specify ASCII writing with " diff --git a/applications/utilities/parallelProcessing/redistributePar/passivePositionParticle.H b/applications/utilities/parallelProcessing/redistributePar/passivePositionParticle.H index 3a03163c53..394f64e490 100644 --- a/applications/utilities/parallelProcessing/redistributePar/passivePositionParticle.H +++ b/applications/utilities/parallelProcessing/redistributePar/passivePositionParticle.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2017-2019 OpenCFD Ltd. + Copyright (C) 2017-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -159,7 +159,7 @@ public: p.origProc = ppi.origProc(); p.origId = ppi.origId(); - if (os.format() == IOstream::ASCII) + if (os.format() == IOstreamOption::ASCII) { os << p.position << token::SPACE << p.celli diff --git a/applications/utilities/postProcessing/miscellaneous/profilingSummary/profilingSummary.C b/applications/utilities/postProcessing/miscellaneous/profilingSummary/profilingSummary.C index f37f7bc685..e08b94f232 100644 --- a/applications/utilities/postProcessing/miscellaneous/profilingSummary/profilingSummary.C +++ b/applications/utilities/postProcessing/miscellaneous/profilingSummary/profilingSummary.C @@ -390,7 +390,7 @@ int main(int argc, char *argv[]) summary.writeHeader(os); summary.writeData(os); - summary.writeEndDivider(os); + IOobject::writeEndDivider(os); Info<< "Wrote to " << outputName << nl << endl; } diff --git a/applications/utilities/preProcessing/createZeroDirectory/createZeroDirectory.C b/applications/utilities/preProcessing/createZeroDirectory/createZeroDirectory.C index 3cdc15bff7..ebfef7d84a 100644 --- a/applications/utilities/preProcessing/createZeroDirectory/createZeroDirectory.C +++ b/applications/utilities/preProcessing/createZeroDirectory/createZeroDirectory.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2015 OpenFOAM Foundation - Copyright (C) 2015-2020 OpenCFD Ltd. + Copyright (C) 2015-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -199,7 +199,7 @@ void createFieldFiles fieldOut.regIOobject::writeObject ( - IOstreamOption(IOstream::ASCII), + IOstreamOption(IOstreamOption::ASCII), true ); } diff --git a/applications/utilities/preProcessing/optimisation/writeActiveDesignVariables/writeActiveDesignVariables.C b/applications/utilities/preProcessing/optimisation/writeActiveDesignVariables/writeActiveDesignVariables.C index 44a2f55dda..b87b0bb837 100644 --- a/applications/utilities/preProcessing/optimisation/writeActiveDesignVariables/writeActiveDesignVariables.C +++ b/applications/utilities/preProcessing/optimisation/writeActiveDesignVariables/writeActiveDesignVariables.C @@ -7,7 +7,7 @@ ------------------------------------------------------------------------------- Copyright (C) 2007-2019 PCOpt/NTUA Copyright (C) 2013-2019 FOSS GP - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -95,7 +95,7 @@ int main(int argc, char *argv[]) // Write modified dictionary optDict.regIOobject::writeObject ( - IOstreamOption(IOstream::ASCII), + IOstreamOption(IOstreamOption::ASCII), true ); diff --git a/applications/utilities/preProcessing/setExprBoundaryFields/setExprBoundaryFields.C b/applications/utilities/preProcessing/setExprBoundaryFields/setExprBoundaryFields.C index b421782f29..6116871109 100644 --- a/applications/utilities/preProcessing/setExprBoundaryFields/setExprBoundaryFields.C +++ b/applications/utilities/preProcessing/setExprBoundaryFields/setExprBoundaryFields.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019-2021 OpenCFD Ltd. + Copyright (C) 2019-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -133,7 +133,7 @@ int main(int argc, char *argv[]) IOstreamOption streamOpt(runTime.writeFormat()); if (args.found("ascii")) { - streamOpt.format(IOstream::ASCII); + streamOpt.format(IOstreamOption::ASCII); } forAll(times, timei) diff --git a/applications/utilities/preProcessing/setExprFields/setExprFields.C b/applications/utilities/preProcessing/setExprFields/setExprFields.C index 88d9ee210f..71019ca540 100644 --- a/applications/utilities/preProcessing/setExprFields/setExprFields.C +++ b/applications/utilities/preProcessing/setExprFields/setExprFields.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019-2021 OpenCFD Ltd. + Copyright (C) 2019-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -767,7 +767,7 @@ int main(int argc, char *argv[]) ctrl.streamOpt.format(runTime.writeFormat()); if (args.found("ascii")) { - ctrl.streamOpt.format(IOstream::ASCII); + ctrl.streamOpt.format(IOstreamOption::ASCII); } expressions::exprString valueExpr_ @@ -838,7 +838,7 @@ int main(int argc, char *argv[]) ctrl.streamOpt.format(runTime.writeFormat()); if (args.found("ascii")) { - ctrl.streamOpt.format(IOstream::ASCII); + ctrl.streamOpt.format(IOstreamOption::ASCII); } if (ctrl.createNew && ctrl.keepPatches) diff --git a/src/OpenFOAM/containers/Bits/BitOps/BitOps.H b/src/OpenFOAM/containers/Bits/BitOps/BitOps.H index 5262a89f9a..1f57396c38 100644 --- a/src/OpenFOAM/containers/Bits/BitOps/BitOps.H +++ b/src/OpenFOAM/containers/Bits/BitOps/BitOps.H @@ -239,7 +239,7 @@ inline UIntType repeat_value(unsigned val) template inline Ostream& print(Ostream& os, UIntType value, char off='0', char on='1') { - if (os.format() == IOstream::BINARY) + if (os.format() == IOstreamOption::BINARY) { // Perhaps not the most sensible, but the only thing we currently have. os << label(value); diff --git a/src/OpenFOAM/containers/Bits/PackedList/PackedListIO.C b/src/OpenFOAM/containers/Bits/PackedList/PackedListIO.C index b61897267f..70cf53d767 100644 --- a/src/OpenFOAM/containers/Bits/PackedList/PackedListIO.C +++ b/src/OpenFOAM/containers/Bits/PackedList/PackedListIO.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018-2021 OpenCFD Ltd. + Copyright (C) 2018-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -81,7 +81,7 @@ Foam::Istream& Foam::PackedList::readList(Istream& is) // Set list length to that read list.resize(len); - if (is.format() == IOstream::BINARY) + if (is.format() == IOstreamOption::BINARY) { // Binary (always contiguous) @@ -184,7 +184,7 @@ Foam::Ostream& Foam::PackedList::writeList const PackedList& list = *this; const label len = list.size(); - if (os.format() == IOstream::BINARY) + if (os.format() == IOstreamOption::BINARY) { // Binary (always contiguous) diff --git a/src/OpenFOAM/containers/Buffers/CircularBufferIO.C b/src/OpenFOAM/containers/Buffers/CircularBufferIO.C index 78f60f6386..b6b6619eac 100644 --- a/src/OpenFOAM/containers/Buffers/CircularBufferIO.C +++ b/src/OpenFOAM/containers/Buffers/CircularBufferIO.C @@ -167,7 +167,7 @@ Foam::Ostream& Foam::CircularBuffer::writeList } #endif - if (os.format() == IOstream::BINARY && is_contiguous::value) + if (os.format() == IOstreamOption::BINARY && is_contiguous::value) { // Binary and contiguous diff --git a/src/OpenFOAM/containers/IndirectLists/IndirectListBase/IndirectListBaseIO.C b/src/OpenFOAM/containers/IndirectLists/IndirectListBase/IndirectListBaseIO.C index 727533b11b..d08bcb4314 100644 --- a/src/OpenFOAM/containers/IndirectLists/IndirectListBase/IndirectListBaseIO.C +++ b/src/OpenFOAM/containers/IndirectLists/IndirectListBase/IndirectListBaseIO.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2014 OpenFOAM Foundation - Copyright (C) 2016-2021 OpenCFD Ltd. + Copyright (C) 2016-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -44,7 +44,7 @@ Foam::Ostream& Foam::IndirectListBase::writeList const label len = list.size(); - if (os.format() == IOstream::BINARY && is_contiguous::value) + if (os.format() == IOstreamOption::BINARY && is_contiguous::value) { // Binary and contiguous os << nl << len << nl; diff --git a/src/OpenFOAM/containers/Lists/FixedList/FixedListIO.C b/src/OpenFOAM/containers/Lists/FixedList/FixedListIO.C index 666643d9ad..62baf65e13 100644 --- a/src/OpenFOAM/containers/Lists/FixedList/FixedListIO.C +++ b/src/OpenFOAM/containers/Lists/FixedList/FixedListIO.C @@ -40,7 +40,7 @@ void Foam::FixedList::writeEntry(Ostream& os) const if (token::compound::isCompound(tag)) { os << tag << token::SPACE; - if (os.format() == IOstream::BINARY && is_contiguous::value) + if (os.format() == IOstreamOption::BINARY && is_contiguous::value) { // Need the size too so that List::readList parses correctly os << static_cast