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
This commit is contained in:
Mark Olesen
2022-07-18 12:11:53 +02:00
parent 8b1514c99b
commit 3d892ace29
135 changed files with 423 additions and 387 deletions

View File

@ -116,7 +116,7 @@ int main(int argc, char *argv[])
"normalisedGradP", "normalisedGradP",
tmagGradP()/max(tmagGradP()) tmagGradP()/max(tmagGradP())
); );
normalisedGradP.writeOpt() = IOobject::AUTO_WRITE; normalisedGradP.writeOpt(IOobject::AUTO_WRITE);
tmagGradP.clear(); tmagGradP.clear();
++runTime; ++runTime;

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2017-2019 OpenCFD Ltd. Copyright (C) 2017-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -59,7 +59,7 @@ Foam::DTRMParticle::DTRMParticle
{ {
if (readFields) if (readFields)
{ {
if (is.format() == IOstream::ASCII) if (is.format() == IOstreamOption::ASCII)
{ {
is >> p0_ >> p1_ >> I0_ >> I_ >> dA_ >> transmissiveId_; is >> p0_ >> p1_ >> I0_ >> I_ >> dA_ >> transmissiveId_;
} }
@ -115,7 +115,7 @@ void Foam::DTRMParticle::writeProperties
Foam::Ostream& Foam::operator<<(Ostream& os, const DTRMParticle& p) Foam::Ostream& Foam::operator<<(Ostream& os, const DTRMParticle& p)
{ {
if (os.format() == IOstream::ASCII) if (os.format() == IOstreamOption::ASCII)
{ {
os << static_cast<const particle&>(p) os << static_cast<const particle&>(p)
<< token::SPACE << p.p0_ << token::SPACE << p.p0_

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd. Copyright (C) 2020-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -49,8 +49,8 @@ int main(int argc, char *argv[])
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
IOstream::streamFormat format = IOstream::BINARY; IOstreamOption streamOpt(IOstreamOption::BINARY);
// IOstream::streamFormat format = IOstream::ASCII; // IOstreamOption streamOpt(IOstreamOption::ASCII);
const label size = 20000000; const label size = 20000000;
@ -85,11 +85,7 @@ int main(int argc, char *argv[])
<< runTime.cpuTimeIncrement() << " s" << nl << endl; << runTime.cpuTimeIncrement() << " s" << nl << endl;
faces2.writeObject faces2.writeObject(streamOpt, true);
(
IOstreamOption(format),
true
);
Info<< "Written old format faceList in = " Info<< "Written old format faceList in = "
<< runTime.cpuTimeIncrement() << " s" << nl << endl; << runTime.cpuTimeIncrement() << " s" << nl << endl;
@ -145,11 +141,7 @@ int main(int argc, char *argv[])
<< runTime.cpuTimeIncrement() << " s" << nl << endl; << runTime.cpuTimeIncrement() << " s" << nl << endl;
faces2.writeObject faces2.writeObject(streamOpt, true);
(
IOstreamOption(format),
true
);
Info<< "Written new format faceList in = " Info<< "Written new format faceList in = "
<< runTime.cpuTimeIncrement() << " s" << nl << endl; << runTime.cpuTimeIncrement() << " s" << nl << endl;

View File

@ -146,7 +146,7 @@ int main(int argc, char *argv[])
{ {
Info<<"Writing output to " << binaryOutput << endl; Info<<"Writing output to " << binaryOutput << endl;
OFstream os(binaryOutput, IOstream::BINARY); OFstream os(binaryOutput, IOstreamOption::BINARY);
os.writeEntry("idl1", idl1); os.writeEntry("idl1", idl1);
os.writeEntry("idl2", idl2); os.writeEntry("idl2", idl2);

View File

@ -78,8 +78,8 @@ int main(int argc, char *argv[])
OFstream os OFstream os
( (
objPath, objPath,
IOstream::BINARY, IOstreamOption::BINARY,
IOstream::currentVersion, IOstreamOption::currentVersion,
runTime.writeCompression() runTime.writeCompression()
); );
if (!os.good()) if (!os.good())

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2017 OpenCFD Ltd. Copyright (C) 2017-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -56,7 +56,7 @@ int main(int argc, char *argv[])
// No. of Nodes = nCells // No. of Nodes = nCells
// No. of Edges connecting Nodes = nInternalFaces // 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 os << "%% metis graph file, of an OpenFOAM mesh %%" << nl
<< "%% nCells=" << mesh.nCells() << "%% nCells=" << mesh.nCells()

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2017-2021 OpenCFD Ltd. Copyright (C) 2017-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -334,7 +334,7 @@ int main(int argc, char *argv[])
DynamicList<char> buf; DynamicList<char> buf;
OListStream os(std::move(buf), IOstream::BINARY); OListStream os(std::move(buf), IOstreamOption::BINARY);
os << srcList; os << srcList;
os.swap(buf); // Recover buffer os.swap(buf); // Recover buffer
@ -342,7 +342,7 @@ int main(int argc, char *argv[])
// Read back // Read back
List<scalar> dstList; List<scalar> dstList;
UIListStream is(buf, IOstream::BINARY); UIListStream is(buf, IOstreamOption::BINARY);
is.setScalarByteSize(sizeof(otherType)); is.setScalarByteSize(sizeof(otherType));
Info<< "Stream scalar-size (" Info<< "Stream scalar-size ("

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2012-2016 OpenFOAM Foundation Copyright (C) 2012-2016 OpenFOAM Foundation
Copyright (C) 2016-2021 OpenCFD Ltd. Copyright (C) 2016-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -73,7 +73,7 @@ scalar getMergeDistance
Info<< "Merge tolerance : " << mergeTol << nl Info<< "Merge tolerance : " << mergeTol << nl
<< "Write tolerance : " << writeTol << endl; << "Write tolerance : " << writeTol << endl;
if (runTime.writeFormat() == IOstream::ASCII && mergeTol < writeTol) if (runTime.writeFormat() == IOstreamOption::ASCII && mergeTol < writeTol)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Your current settings specify ASCII writing with " << "Your current settings specify ASCII writing with "

View File

@ -616,7 +616,7 @@ scalar getMergeDistance
<< endl; << endl;
// check writing tolerance // check writing tolerance
if (mesh.time().writeFormat() == IOstream::ASCII && !dryRun) if (mesh.time().writeFormat() == IOstreamOption::ASCII && !dryRun)
{ {
const scalar writeTol = std::pow const scalar writeTol = std::pow
( (

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2016-2021 OpenCFD Ltd. Copyright (C) 2016-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -160,7 +160,7 @@ bool writeZones
// Force writing as ASCII // Force writing as ASCII
writeOk = meshObject.regIOobject::writeObject writeOk = meshObject.regIOobject::writeObject
( (
IOstreamOption(IOstream::ASCII, compression), IOstreamOption(IOstreamOption::ASCII, compression),
true true
); );
} }
@ -355,7 +355,7 @@ int main(int argc, char *argv[])
runTime runTime
); );
if (runTime.writeFormat() == IOstream::ASCII) if (runTime.writeFormat() == IOstreamOption::ASCII)
{ {
// Only do zones when converting from binary to ascii // Only do zones when converting from binary to ascii
// The other way gives problems since working on dictionary level. // The other way gives problems since working on dictionary level.

View File

@ -663,7 +663,11 @@ int main(int argc, char *argv[])
Info<< "Merge tolerance : " << mergeTol << nl Info<< "Merge tolerance : " << mergeTol << nl
<< "Write tolerance : " << writeTol << endl; << "Write tolerance : " << writeTol << endl;
if (runTime.writeFormat() == IOstream::ASCII && mergeTol < writeTol) if
(
runTime.writeFormat() == IOstreamOption::ASCII
&& mergeTol < writeTol
)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Your current settings specify ASCII writing with " << "Your current settings specify ASCII writing with "

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2017-2019 OpenCFD Ltd. Copyright (C) 2017-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -159,7 +159,7 @@ public:
p.origProc = ppi.origProc(); p.origProc = ppi.origProc();
p.origId = ppi.origId(); p.origId = ppi.origId();
if (os.format() == IOstream::ASCII) if (os.format() == IOstreamOption::ASCII)
{ {
os << p.position os << p.position
<< token::SPACE << p.celli << token::SPACE << p.celli

View File

@ -390,7 +390,7 @@ int main(int argc, char *argv[])
summary.writeHeader(os); summary.writeHeader(os);
summary.writeData(os); summary.writeData(os);
summary.writeEndDivider(os); IOobject::writeEndDivider(os);
Info<< "Wrote to " << outputName << nl << endl; Info<< "Wrote to " << outputName << nl << endl;
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2015 OpenFOAM Foundation Copyright (C) 2015 OpenFOAM Foundation
Copyright (C) 2015-2020 OpenCFD Ltd. Copyright (C) 2015-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -199,7 +199,7 @@ void createFieldFiles
fieldOut.regIOobject::writeObject fieldOut.regIOobject::writeObject
( (
IOstreamOption(IOstream::ASCII), IOstreamOption(IOstreamOption::ASCII),
true true
); );
} }

View File

@ -7,7 +7,7 @@
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2007-2019 PCOpt/NTUA Copyright (C) 2007-2019 PCOpt/NTUA
Copyright (C) 2013-2019 FOSS GP Copyright (C) 2013-2019 FOSS GP
Copyright (C) 2019-2020 OpenCFD Ltd. Copyright (C) 2019-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -95,7 +95,7 @@ int main(int argc, char *argv[])
// Write modified dictionary // Write modified dictionary
optDict.regIOobject::writeObject optDict.regIOobject::writeObject
( (
IOstreamOption(IOstream::ASCII), IOstreamOption(IOstreamOption::ASCII),
true true
); );

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2019-2021 OpenCFD Ltd. Copyright (C) 2019-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -133,7 +133,7 @@ int main(int argc, char *argv[])
IOstreamOption streamOpt(runTime.writeFormat()); IOstreamOption streamOpt(runTime.writeFormat());
if (args.found("ascii")) if (args.found("ascii"))
{ {
streamOpt.format(IOstream::ASCII); streamOpt.format(IOstreamOption::ASCII);
} }
forAll(times, timei) forAll(times, timei)

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2019-2021 OpenCFD Ltd. Copyright (C) 2019-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -767,7 +767,7 @@ int main(int argc, char *argv[])
ctrl.streamOpt.format(runTime.writeFormat()); ctrl.streamOpt.format(runTime.writeFormat());
if (args.found("ascii")) if (args.found("ascii"))
{ {
ctrl.streamOpt.format(IOstream::ASCII); ctrl.streamOpt.format(IOstreamOption::ASCII);
} }
expressions::exprString valueExpr_ expressions::exprString valueExpr_
@ -838,7 +838,7 @@ int main(int argc, char *argv[])
ctrl.streamOpt.format(runTime.writeFormat()); ctrl.streamOpt.format(runTime.writeFormat());
if (args.found("ascii")) if (args.found("ascii"))
{ {
ctrl.streamOpt.format(IOstream::ASCII); ctrl.streamOpt.format(IOstreamOption::ASCII);
} }
if (ctrl.createNew && ctrl.keepPatches) if (ctrl.createNew && ctrl.keepPatches)

View File

@ -239,7 +239,7 @@ inline UIntType repeat_value(unsigned val)
template<class UIntType> template<class UIntType>
inline Ostream& print(Ostream& os, UIntType value, char off='0', char on='1') 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. // Perhaps not the most sensible, but the only thing we currently have.
os << label(value); os << label(value);

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2018-2021 OpenCFD Ltd. Copyright (C) 2018-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -81,7 +81,7 @@ Foam::Istream& Foam::PackedList<Width>::readList(Istream& is)
// Set list length to that read // Set list length to that read
list.resize(len); list.resize(len);
if (is.format() == IOstream::BINARY) if (is.format() == IOstreamOption::BINARY)
{ {
// Binary (always contiguous) // Binary (always contiguous)
@ -184,7 +184,7 @@ Foam::Ostream& Foam::PackedList<Width>::writeList
const PackedList<Width>& list = *this; const PackedList<Width>& list = *this;
const label len = list.size(); const label len = list.size();
if (os.format() == IOstream::BINARY) if (os.format() == IOstreamOption::BINARY)
{ {
// Binary (always contiguous) // Binary (always contiguous)

View File

@ -167,7 +167,7 @@ Foam::Ostream& Foam::CircularBuffer<T>::writeList
} }
#endif #endif
if (os.format() == IOstream::BINARY && is_contiguous<T>::value) if (os.format() == IOstreamOption::BINARY && is_contiguous<T>::value)
{ {
// Binary and contiguous // Binary and contiguous

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2014 OpenFOAM Foundation Copyright (C) 2011-2014 OpenFOAM Foundation
Copyright (C) 2016-2021 OpenCFD Ltd. Copyright (C) 2016-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -44,7 +44,7 @@ Foam::Ostream& Foam::IndirectListBase<T, Addr>::writeList
const label len = list.size(); const label len = list.size();
if (os.format() == IOstream::BINARY && is_contiguous<T>::value) if (os.format() == IOstreamOption::BINARY && is_contiguous<T>::value)
{ {
// Binary and contiguous // Binary and contiguous
os << nl << len << nl; os << nl << len << nl;

View File

@ -40,7 +40,7 @@ void Foam::FixedList<T, N>::writeEntry(Ostream& os) const
if (token::compound::isCompound(tag)) if (token::compound::isCompound(tag))
{ {
os << tag << token::SPACE; os << tag << token::SPACE;
if (os.format() == IOstream::BINARY && is_contiguous<T>::value) if (os.format() == IOstreamOption::BINARY && is_contiguous<T>::value)
{ {
// Need the size too so that List<Type>::readList parses correctly // Need the size too so that List<Type>::readList parses correctly
os << static_cast<label>(N); os << static_cast<label>(N);
@ -90,7 +90,7 @@ Foam::Ostream& Foam::FixedList<T, N>::writeList
// small and we prefer a consistent appearance. // small and we prefer a consistent appearance.
// Eg, FixedList<T,2> or Pair<T> as "(-1 -1)", never as "2{-1}" // Eg, FixedList<T,2> or Pair<T> as "(-1 -1)", never as "2{-1}"
if (os.format() == IOstream::BINARY && is_contiguous<T>::value) if (os.format() == IOstreamOption::BINARY && is_contiguous<T>::value)
{ {
// Binary and contiguous. Size is always non-zero // Binary and contiguous. Size is always non-zero
@ -158,7 +158,7 @@ Foam::Istream& Foam::FixedList<T, N>::readList
is.fatalCheck(FUNCTION_NAME); is.fatalCheck(FUNCTION_NAME);
if (is.format() == IOstream::BINARY && is_contiguous<T>::value) if (is.format() == IOstreamOption::BINARY && is_contiguous<T>::value)
{ {
// Binary and contiguous. Length is non-zero // Binary and contiguous. Length is non-zero

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2018-2021 OpenCFD Ltd. Copyright (C) 2018-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -80,7 +80,7 @@ Foam::Istream& Foam::List<T>::readList(Istream& is)
// Resize to actual length read // Resize to actual length read
list.resize(len); list.resize(len);
if (is.format() == IOstream::BINARY && is_contiguous<T>::value) if (is.format() == IOstreamOption::BINARY && is_contiguous<T>::value)
{ {
// Binary and contiguous // Binary and contiguous

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2016-2021 OpenCFD Ltd. Copyright (C) 2016-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -47,7 +47,7 @@ void Foam::UList<T>::writeEntry(Ostream& os) const
{ {
os << *this; os << *this;
} }
else if (os.format() == IOstream::ASCII) else if (os.format() == IOstreamOption::ASCII)
{ {
// Zero-sized ASCII - Write size and delimiters // Zero-sized ASCII - Write size and delimiters
os << 0 << token::BEGIN_LIST << token::END_LIST; os << 0 << token::BEGIN_LIST << token::END_LIST;
@ -85,7 +85,7 @@ Foam::Ostream& Foam::UList<T>::writeList
const label len = list.size(); const label len = list.size();
if (os.format() == IOstream::BINARY && is_contiguous<T>::value) if (os.format() == IOstreamOption::BINARY && is_contiguous<T>::value)
{ {
// Binary and contiguous // Binary and contiguous
@ -211,7 +211,7 @@ Foam::Istream& Foam::UList<T>::readList(Istream& is)
<< exit(FatalIOError); << exit(FatalIOError);
} }
if (is.format() == IOstream::BINARY && is_contiguous<T>::value) if (is.format() == IOstreamOption::BINARY && is_contiguous<T>::value)
{ {
// Binary and contiguous // Binary and contiguous

View File

@ -199,7 +199,7 @@ bool Foam::CompactIOField<T, BaseType>::writeObject
const bool valid const bool valid
) const ) const
{ {
if (streamOpt.format() == IOstream::ASCII) if (streamOpt.format() == IOstreamOption::ASCII)
{ {
// Change type to be non-compact format type // Change type to be non-compact format type
const word oldTypeName(typeName); const word oldTypeName(typeName);
@ -282,8 +282,8 @@ Foam::Ostream& Foam::operator<<
const Foam::CompactIOField<T, BaseType>& L const Foam::CompactIOField<T, BaseType>& L
) )
{ {
// Keep ascii writing same. // Keep ASCII writing same
if (os.format() == IOstream::ASCII) if (os.format() == IOstreamOption::ASCII)
{ {
os << static_cast<const Field<T>&>(L); os << static_cast<const Field<T>&>(L);
} }

View File

@ -174,11 +174,11 @@ bool Foam::CompactIOList<T, BaseType>::writeObject
{ {
if if
( (
streamOpt.format() == IOstream::BINARY streamOpt.format() == IOstreamOption::BINARY
&& overflows() && overflows()
) )
{ {
streamOpt.format(IOstream::ASCII); streamOpt.format(IOstreamOption::ASCII);
WarningInFunction WarningInFunction
<< "Overall number of elements of CompactIOList of size " << "Overall number of elements of CompactIOList of size "
@ -186,7 +186,7 @@ bool Foam::CompactIOList<T, BaseType>::writeObject
<< nl << " Switching to ascii writing" << endl; << nl << " Switching to ascii writing" << endl;
} }
if (streamOpt.format() == IOstream::ASCII) if (streamOpt.format() == IOstreamOption::ASCII)
{ {
// Change type to be non-compact format type // Change type to be non-compact format type
const word oldTypeName(typeName); const word oldTypeName(typeName);
@ -264,8 +264,8 @@ Foam::Ostream& Foam::operator<<
const Foam::CompactIOList<T, BaseType>& L const Foam::CompactIOList<T, BaseType>& L
) )
{ {
// Keep ascii writing same. // Keep ASCII writing same
if (os.format() == IOstream::ASCII) if (os.format() == IOstreamOption::ASCII)
{ {
os << static_cast<const List<T>&>(L); os << static_cast<const List<T>&>(L);
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2015 OpenFOAM Foundation Copyright (C) 2015 OpenFOAM Foundation
Copyright (C) 2016-2018 OpenCFD Ltd. Copyright (C) 2016-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -38,7 +38,7 @@ Foam::GlobalIOField<Type>::GlobalIOField(const IOobject& io)
// Check for MUST_READ_IF_MODIFIED // Check for MUST_READ_IF_MODIFIED
warnNoRereading<GlobalIOField<Type>>(); warnNoRereading<GlobalIOField<Type>>();
readHeaderOk(IOstream::BINARY, typeName); readHeaderOk(IOstreamOption::BINARY, typeName);
} }
@ -50,7 +50,7 @@ Foam::GlobalIOField<Type>::GlobalIOField(const IOobject& io, const label size)
// Check for MUST_READ_IF_MODIFIED // Check for MUST_READ_IF_MODIFIED
warnNoRereading<GlobalIOField<Type>>(); warnNoRereading<GlobalIOField<Type>>();
if (!readHeaderOk(IOstream::BINARY, typeName)) if (!readHeaderOk(IOstreamOption::BINARY, typeName))
{ {
Field<Type>::setSize(size); Field<Type>::setSize(size);
} }
@ -69,7 +69,7 @@ Foam::GlobalIOField<Type>::GlobalIOField
// Check for MUST_READ_IF_MODIFIED // Check for MUST_READ_IF_MODIFIED
warnNoRereading<GlobalIOField<Type>>(); warnNoRereading<GlobalIOField<Type>>();
if (!readHeaderOk(IOstream::BINARY, typeName)) if (!readHeaderOk(IOstreamOption::BINARY, typeName))
{ {
Field<Type>::operator=(content); Field<Type>::operator=(content);
} }
@ -90,7 +90,7 @@ Foam::GlobalIOField<Type>::GlobalIOField
Field<Type>::transfer(content); Field<Type>::transfer(content);
readHeaderOk(IOstream::BINARY, typeName); readHeaderOk(IOstreamOption::BINARY, typeName);
} }
@ -113,7 +113,7 @@ Foam::GlobalIOField<Type>::GlobalIOField
Field<Type>::transfer(tfld.ref()); Field<Type>::transfer(tfld.ref());
} }
if (!readHeaderOk(IOstream::BINARY, typeName)) if (!readHeaderOk(IOstreamOption::BINARY, typeName))
{ {
Field<Type>::operator=(tfld()); Field<Type>::operator=(tfld());
} }

View File

@ -38,7 +38,7 @@ Foam::GlobalIOList<Type>::GlobalIOList(const IOobject& io)
// Check for MUST_READ_IF_MODIFIED // Check for MUST_READ_IF_MODIFIED
warnNoRereading<GlobalIOList<Type>>(); warnNoRereading<GlobalIOList<Type>>();
readHeaderOk(IOstream::BINARY, typeName); readHeaderOk(IOstreamOption::BINARY, typeName);
} }
@ -50,7 +50,7 @@ Foam::GlobalIOList<Type>::GlobalIOList(const IOobject& io, Foam::zero)
// Check for MUST_READ_IF_MODIFIED // Check for MUST_READ_IF_MODIFIED
warnNoRereading<GlobalIOList<Type>>(); warnNoRereading<GlobalIOList<Type>>();
readHeaderOk(IOstream::BINARY, typeName); readHeaderOk(IOstreamOption::BINARY, typeName);
} }
@ -62,7 +62,7 @@ Foam::GlobalIOList<Type>::GlobalIOList(const IOobject& io, const label len)
// Check for MUST_READ_IF_MODIFIED // Check for MUST_READ_IF_MODIFIED
warnNoRereading<GlobalIOList<Type>>(); warnNoRereading<GlobalIOList<Type>>();
if (!readHeaderOk(IOstream::BINARY, typeName)) if (!readHeaderOk(IOstreamOption::BINARY, typeName))
{ {
List<Type>::resize(len); List<Type>::resize(len);
} }
@ -81,7 +81,7 @@ Foam::GlobalIOList<Type>::GlobalIOList
// Check for MUST_READ_IF_MODIFIED // Check for MUST_READ_IF_MODIFIED
warnNoRereading<GlobalIOList<Type>>(); warnNoRereading<GlobalIOList<Type>>();
if (!readHeaderOk(IOstream::BINARY, typeName)) if (!readHeaderOk(IOstreamOption::BINARY, typeName))
{ {
List<Type>::operator=(content); List<Type>::operator=(content);
} }
@ -102,7 +102,7 @@ Foam::GlobalIOList<Type>::GlobalIOList
List<Type>::transfer(content); List<Type>::transfer(content);
readHeaderOk(IOstream::BINARY, typeName); readHeaderOk(IOstreamOption::BINARY, typeName);
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd. Copyright (C) 2021-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -62,7 +62,7 @@ Foam::IOdictionary::IOdictionary
: :
baseIOdictionary(io, fallback) baseIOdictionary(io, fallback)
{ {
if (!readHeaderOk(IOstream::ASCII, wantedType) && fallback) if (!readHeaderOk(IOstreamOption::ASCII, wantedType) && fallback)
{ {
dictionary::operator=(*fallback); dictionary::operator=(*fallback);
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2015-2017 OpenFOAM Foundation Copyright (C) 2015-2017 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd. Copyright (C) 2021-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -59,7 +59,7 @@ Foam::localIOdictionary::localIOdictionary
: :
baseIOdictionary(io, fallback) baseIOdictionary(io, fallback)
{ {
if (!readHeaderOk(IOstream::ASCII, wantedType) && fallback) if (!readHeaderOk(IOstreamOption::ASCII, wantedType) && fallback)
{ {
dictionary::operator=(*fallback); dictionary::operator=(*fallback);
} }

View File

@ -62,7 +62,7 @@ Foam::unwatchedIOdictionary::unwatchedIOdictionary
: :
baseIOdictionary(io, fallback) baseIOdictionary(io, fallback)
{ {
if (!readHeaderOk(IOstream::ASCII, wantedType) && fallback) if (!readHeaderOk(IOstreamOption::ASCII, wantedType) && fallback)
{ {
dictionary::operator=(*fallback); dictionary::operator=(*fallback);
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 2018-2019 OpenCFD Ltd. Copyright (C) 2018-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -32,8 +32,8 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef IOmanip_H #ifndef Foam_IOmanip_H
#define IOmanip_H #define Foam_IOmanip_H
#include "Istream.H" #include "Istream.H"
#include "Ostream.H" #include "Ostream.H"
@ -178,21 +178,21 @@ inline Omanip<char> setfill(char fillch)
} }
inline Omanip<IOstream::streamFormat> setformat inline Omanip<IOstreamOption::streamFormat> setformat
( (
const IOstream::streamFormat fmt const IOstreamOption::streamFormat fmt
) )
{ {
return Omanip<IOstream::streamFormat>(&IOstream::format, fmt); return Omanip<IOstreamOption::streamFormat>(&IOstreamOption::format, fmt);
} }
inline Omanip<IOstream::versionNumber> setversion inline Omanip<IOstreamOption::versionNumber> setversion
( (
const IOstream::versionNumber ver const IOstreamOption::versionNumber ver
) )
{ {
return Omanip<IOstream::versionNumber>(&IOstream::version, ver); return Omanip<IOstreamOption::versionNumber>(&IOstreamOption::version, ver);
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2017-2021 OpenCFD Ltd. Copyright (C) 2017-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -49,11 +49,11 @@ inline static void processFlags(Istream& is, int flagMask)
{ {
if ((flagMask & token::ASCII)) if ((flagMask & token::ASCII))
{ {
is.format(IOstream::ASCII); is.format(IOstreamOption::ASCII);
} }
else if ((flagMask & token::BINARY)) else if ((flagMask & token::BINARY))
{ {
is.format(IOstream::BINARY); is.format(IOstreamOption::BINARY);
} }
} }

View File

@ -459,7 +459,7 @@ Foam::Time::Time
writeOnce_(false), writeOnce_(false),
sigWriteNow_(*this, true), sigWriteNow_(*this, true),
sigStopAtWriteNow_(*this, true), sigStopAtWriteNow_(*this, true),
writeStreamOption_(IOstream::ASCII), writeStreamOption_(IOstreamOption::ASCII),
graphFormat_("raw"), graphFormat_("raw"),
runTimeModifiable_(false), runTimeModifiable_(false),
functionObjects_(*this, false) functionObjects_(*this, false)
@ -525,7 +525,7 @@ Foam::Time::Time
writeOnce_(false), writeOnce_(false),
sigWriteNow_(*this, true), sigWriteNow_(*this, true),
sigStopAtWriteNow_(*this, true), sigStopAtWriteNow_(*this, true),
writeStreamOption_(IOstream::ASCII), writeStreamOption_(IOstreamOption::ASCII),
graphFormat_("raw"), graphFormat_("raw"),
runTimeModifiable_(false), runTimeModifiable_(false),
functionObjects_(*this, false) functionObjects_(*this, false)
@ -619,7 +619,7 @@ Foam::Time::Time
writeOnce_(false), writeOnce_(false),
sigWriteNow_(*this, true), sigWriteNow_(*this, true),
sigStopAtWriteNow_(*this, true), sigStopAtWriteNow_(*this, true),
writeStreamOption_(IOstream::ASCII), writeStreamOption_(IOstreamOption::ASCII),
graphFormat_("raw"), graphFormat_("raw"),
runTimeModifiable_(false), runTimeModifiable_(false),
functionObjects_(*this, false) functionObjects_(*this, false)
@ -693,7 +693,7 @@ Foam::Time::Time
purgeWrite_(0), purgeWrite_(0),
subCycling_(0), subCycling_(0),
writeOnce_(false), writeOnce_(false),
writeStreamOption_(IOstream::ASCII), writeStreamOption_(IOstreamOption::ASCII),
graphFormat_("raw"), graphFormat_("raw"),
runTimeModifiable_(false), runTimeModifiable_(false),
functionObjects_(*this, false) functionObjects_(*this, false)

View File

@ -385,19 +385,19 @@ public:
} }
//- The write stream format //- The write stream format
IOstream::streamFormat writeFormat() const IOstreamOption::streamFormat writeFormat() const
{ {
return writeStreamOption_.format(); return writeStreamOption_.format();
} }
//- The write stream compression //- The write stream compression
IOstream::compressionType writeCompression() const IOstreamOption::compressionType writeCompression() const
{ {
return writeStreamOption_.compression(); return writeStreamOption_.compression();
} }
//- The write stream version //- The write stream version
IOstream::versionNumber writeVersion() const IOstreamOption::versionNumber writeVersion() const
{ {
return writeStreamOption_.version(); return writeStreamOption_.version();
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2015-2021 OpenCFD Ltd. Copyright (C) 2015-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -778,7 +778,7 @@ bool Foam::functionObjectList::execute()
propsDictPtr_->writeObject propsDictPtr_->writeObject
( (
IOstreamOption(IOstream::ASCII, time_.writeCompression()), IOstreamOption(IOstreamOption::ASCII, time_.writeCompression()),
true true
); );

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2018 OpenFOAM Foundation Copyright (C) 2011-2018 OpenFOAM Foundation
Copyright (C) 2015-2021 OpenCFD Ltd. Copyright (C) 2015-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -226,7 +226,8 @@ bool Foam::regIOobject::read()
// Note: IOstream::binary flag is for all the processor comms. (Only for // Note: IOstream::binary flag is for all the processor comms. (Only for
// dictionaries should it be ascii) // dictionaries should it be ascii)
bool ok = fileHandler().read(*this, masterOnly, IOstream::BINARY, type()); bool ok =
fileHandler().read(*this, masterOnly, IOstreamOption::BINARY, type());
if (oldWatchFiles.size()) if (oldWatchFiles.size())
{ {

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2019-2021 OpenCFD Ltd. Copyright (C) 2019-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -679,7 +679,7 @@ Foam::Ostream& Foam::dimensionSet::write
os << token::BEGIN_SQR; os << token::BEGIN_SQR;
if (writeUnits.valid() && os.format() == IOstream::ASCII) if (writeUnits.valid() && os.format() == IOstreamOption::ASCII)
{ {
scalarField exponents(dimensionSet::nDimensions); scalarField exponents(dimensionSet::nDimensions);
for (int d=0; d < dimensionSet::nDimensions; ++d) for (int d=0; d < dimensionSet::nDimensions; ++d)

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2012-2018 Bernhard Gschaider Copyright (C) 2012-2018 Bernhard Gschaider
Copyright (C) 2019-2021 OpenCFD Ltd. Copyright (C) 2019-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -587,7 +587,7 @@ void Foam::expressions::exprResult::writeDict
const bool subDict const bool subDict
) const ) const
{ {
// const auto oldFmt = os.format(IOstream::ASCII); // const auto oldFmt = os.format(IOstreamOption::ASCII);
DebugInFunction DebugInFunction
<< Foam::name(this) << nl << Foam::name(this) << nl
@ -631,7 +631,7 @@ void Foam::expressions::exprResult::writeField
const word& keyword const word& keyword
) const ) const
{ {
// const auto oldFmt = os.format(IOstream::ASCII); // const auto oldFmt = os.format(IOstreamOption::ASCII);
DebugInFunction DebugInFunction
<< Foam::name(this) << nl << Foam::name(this) << nl
@ -662,7 +662,7 @@ void Foam::expressions::exprResult::writeValue
Ostream& os Ostream& os
) const ) const
{ {
// const auto oldFmt = os.format(IOstream::ASCII); // const auto oldFmt = os.format(IOstreamOption::ASCII);
DebugInFunction DebugInFunction
<< Foam::name(this) << nl << Foam::name(this) << nl

View File

@ -5,8 +5,8 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2012-2018 Bernhard Gschaider <bgschaid@hfd-research.com> Copyright (C) 2012-2018 Bernhard Gschaider
Copyright (C) 2019-2020 OpenCFD Ltd. Copyright (C) 2019-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -163,7 +163,7 @@ bool Foam::expressions::exprResultGlobals::Delete(const objectRegistry& obr)
bool Foam::expressions::exprResultGlobals::writeData(Ostream& os) const bool Foam::expressions::exprResultGlobals::writeData(Ostream& os) const
{ {
// Enforce ASCII to avoid any potential binary issues // Enforce ASCII to avoid any potential binary issues
const auto oldFmt = os.format(IOstream::ASCII); const auto oldFmt = os.format(IOstreamOption::ASCII);
os << variables_; os << variables_;
@ -176,7 +176,7 @@ bool Foam::expressions::exprResultGlobals::writeData(Ostream& os) const
bool Foam::expressions::exprResultGlobals::readData(Istream& is) bool Foam::expressions::exprResultGlobals::readData(Istream& is)
{ {
// Enforce ASCII to avoid any potential binary issues // Enforce ASCII to avoid any potential binary issues
const auto oldFmt = is.format(IOstream::ASCII); const auto oldFmt = is.format(IOstreamOption::ASCII);
is >> variables_; is >> variables_;

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -40,7 +41,7 @@ Foam::UniformDimensionedField<Type>::UniformDimensionedField
dimensioned<Type>(dt) dimensioned<Type>(dt)
{ {
// Read value // Read value
readHeaderOk(IOstream::BINARY, typeName); readHeaderOk(IOstreamOption::BINARY, typeName);
} }
@ -68,7 +69,7 @@ Foam::UniformDimensionedField<Type>::UniformDimensionedField
addWatch(); addWatch();
// Read unless NO_READ // Read unless NO_READ
readHeaderOk(IOstream::BINARY, typeName); readHeaderOk(IOstreamOption::BINARY, typeName);
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2017-2018 OpenFOAM Foundation Copyright (C) 2017-2018 OpenFOAM Foundation
Copyright (C) 2020-2021 OpenCFD Ltd. Copyright (C) 2020-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -221,7 +221,8 @@ bool Foam::fileOperations::collatedFileOperation::appendObject
OFstream os OFstream os
( (
pathName, pathName,
IOstreamOption(IOstream::BINARY, streamOpt.version()), // UNCOMPRESSED // UNCOMPRESSED
IOstreamOption(IOstreamOption::BINARY, streamOpt.version()),
!isMaster // append slaves !isMaster // append slaves
); );

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2017-2018 OpenFOAM Foundation Copyright (C) 2017-2018 OpenFOAM Foundation
Copyright (C) 2020-2021 OpenCFD Ltd. Copyright (C) 2020-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -58,7 +58,7 @@ Foam::threadedCollatedOFstream::~threadedCollatedOFstream()
decomposedBlockData::typeName, decomposedBlockData::typeName,
pathName_, pathName_,
str(), str(),
IOstreamOption(IOstream::BINARY, version(), compression_), IOstreamOption(IOstreamOption::BINARY, version(), compression_),
false, // append=false false, // append=false
useThread_, useThread_,
headerEntries_ headerEntries_

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2009-2016 Bernhard Gschaider Copyright (C) 2009-2016 Bernhard Gschaider
Copyright (C) 2016-2020 OpenCFD Ltd. Copyright (C) 2016-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -387,7 +387,12 @@ bool Foam::profiling::writeObject
const bool valid const bool valid
) const ) const
{ {
return regIOobject::writeObject(IOstreamOption(IOstream::ASCII), true); return
regIOobject::writeObject
(
IOstreamOption(IOstreamOption::ASCII),
true
);
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2020-2021 OpenCFD Ltd. Copyright (C) 2020-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -47,7 +47,7 @@ Foam::labelList Foam::csvTableReader<Type>::getComponentColumns
labelList cols; labelList cols;
ITstream& is = dict.lookupCompat(name, compat); ITstream& is = dict.lookupCompat(name, compat);
is.format(IOstream::ASCII); is.format(IOstreamOption::ASCII);
is >> cols; is >> cols;
dict.checkITstream(is, name); dict.checkITstream(is, name);
@ -225,7 +225,7 @@ void Foam::csvTableReader<Type>::write(Ostream& os) const
os.writeEntry("refColumn", refColumn_); os.writeEntry("refColumn", refColumn_);
// Force writing labelList in ASCII // Force writing labelList in ASCII
const auto oldFmt = os.format(IOstream::ASCII); const auto oldFmt = os.format(IOstreamOption::ASCII);
os.writeEntry("componentColumns", componentColumns_); os.writeEntry("componentColumns", componentColumns_);
os.format(oldFmt); os.format(oldFmt);

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd. Copyright (C) 2020-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -235,7 +235,7 @@ void Foam::uniformInterpolationTable<Type>::write() const
dict.regIOobject::writeObject dict.regIOobject::writeObject
( (
IOstreamOption(IOstream::ASCII, dict.time().writeCompression()), IOstreamOption(IOstreamOption::ASCII, dict.time().writeCompression()),
true true
); );
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019-2021 OpenCFD Ltd. Copyright (C) 2019-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -70,7 +70,7 @@ bool Foam::Matrix<Form, Type>::readMatrix(Istream& is)
// The total size // The total size
const label len = size(); const label len = size();
if (is.format() == IOstream::BINARY && is_contiguous<Type>::value) if (is.format() == IOstreamOption::BINARY && is_contiguous<Type>::value)
{ {
// Binary and contiguous // Binary and contiguous
@ -154,7 +154,7 @@ Foam::Ostream& Foam::Matrix<Form, Type>::writeMatrix
// Rows, columns size // Rows, columns size
os << mat.nRows() << token::SPACE << mat.nCols(); os << mat.nRows() << token::SPACE << mat.nCols();
if (os.format() == IOstream::BINARY && is_contiguous<Type>::value) if (os.format() == IOstreamOption::BINARY && is_contiguous<Type>::value)
{ {
// Binary and contiguous // Binary and contiguous

View File

@ -147,7 +147,7 @@ Foam::schemesLookup::schemesLookup
|| (readOpt() == IOobject::READ_IF_PRESENT && headerOk()) || (readOpt() == IOobject::READ_IF_PRESENT && headerOk())
) )
{ {
readOpt() = IOobject::MUST_READ_IF_MODIFIED; readOpt(IOobject::MUST_READ_IF_MODIFIED);
addWatch(); addWatch();
} }

View File

@ -49,31 +49,35 @@ static const Foam::List<Foam::word> subDictNames
void Foam::solution::read(const dictionary& dict) void Foam::solution::read(const dictionary& dict)
{ {
if (dict.found("cache")) const dictionary* dictptr;
if ((dictptr = dict.findDict("cache")) != nullptr)
{ {
cache_ = dict.subDict("cache"); cache_ = *dictptr;
caching_ = cache_.getOrDefault("active", true); caching_ = cache_.getOrDefault("active", true);
} }
if (dict.found("relaxationFactors")) if ((dictptr = dict.findDict("relaxationFactors")) != nullptr)
{ {
const dictionary& relaxDict = dict.subDict("relaxationFactors"); const dictionary& relaxDict = *dictptr;
if (relaxDict.found("fields") || relaxDict.found("equations")) bool needsCompat = true;
if ((dictptr = relaxDict.findDict("fields")) != nullptr)
{ {
if (relaxDict.found("fields")) needsCompat = false;
{ fieldRelaxDict_ = *dictptr;
fieldRelaxDict_ = relaxDict.subDict("fields"); fieldRelaxCache_.clear();
fieldRelaxCache_.clear();
}
if (relaxDict.found("equations"))
{
eqnRelaxDict_ = relaxDict.subDict("equations");
eqnRelaxCache_.clear();
}
} }
else
if ((dictptr = relaxDict.findDict("equations")) != nullptr)
{
needsCompat = false;
eqnRelaxDict_ = *dictptr;
eqnRelaxCache_.clear();
}
if (needsCompat)
{ {
// backwards compatibility // backwards compatibility
fieldRelaxDict_.clear(); fieldRelaxDict_.clear();
@ -130,9 +134,9 @@ void Foam::solution::read(const dictionary& dict)
<< "equations: " << eqnRelaxDict_ << endl; << "equations: " << eqnRelaxDict_ << endl;
} }
if (dict.found("solvers")) if ((dictptr = dict.findDict("solvers")) != nullptr)
{ {
solvers_ = dict.subDict("solvers"); solvers_ = *dictptr;
upgradeSolverDict(solvers_); upgradeSolverDict(solvers_);
} }
} }
@ -173,7 +177,7 @@ Foam::solution::solution
|| (readOpt() == IOobject::READ_IF_PRESENT && headerOk()) || (readOpt() == IOobject::READ_IF_PRESENT && headerOk())
) )
{ {
readOpt() = IOobject::MUST_READ_IF_MODIFIED; readOpt(IOobject::MUST_READ_IF_MODIFIED);
addWatch(); addWatch();
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2016-2019 OpenCFD Ltd. Copyright (C) 2016-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -280,7 +280,7 @@ Foam::point Foam::boundBox::nearest(const point& pt) const
Foam::Ostream& Foam::operator<<(Ostream& os, const boundBox& bb) Foam::Ostream& Foam::operator<<(Ostream& os, const boundBox& bb)
{ {
if (os.format() == IOstream::ASCII) if (os.format() == IOstreamOption::ASCII)
{ {
os << bb.min_ << token::SPACE << bb.max_; os << bb.min_ << token::SPACE << bb.max_;
} }
@ -300,7 +300,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const boundBox& bb)
Foam::Istream& Foam::operator>>(Istream& is, boundBox& bb) Foam::Istream& Foam::operator>>(Istream& is, boundBox& bb)
{ {
if (is.format() == IOstream::ASCII) if (is.format() == IOstreamOption::ASCII)
{ {
is >> bb.min_ >> bb.max_; is >> bb.min_ >> bb.max_;
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 2016-2021 OpenCFD Ltd. Copyright (C) 2016-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -139,7 +139,7 @@ inline Foam::labelledTri::labelledTri(Istream& is)
inline Foam::Istream& Foam::operator>>(Istream& is, labelledTri& t) inline Foam::Istream& Foam::operator>>(Istream& is, labelledTri& t)
{ {
if (is.format() == IOstream::ASCII) if (is.format() == IOstreamOption::ASCII)
{ {
is.readBegin("labelledTri"); is.readBegin("labelledTri");
@ -164,7 +164,7 @@ inline Foam::Istream& Foam::operator>>(Istream& is, labelledTri& t)
inline Foam::Ostream& Foam::operator<<(Ostream& os, const labelledTri& t) inline Foam::Ostream& Foam::operator<<(Ostream& os, const labelledTri& t)
{ {
if (os.format() == IOstream::ASCII) if (os.format() == IOstreamOption::ASCII)
{ {
os << token::BEGIN_LIST os << token::BEGIN_LIST
<< static_cast<const triFace&>(t) << token::SPACE << t.index() << static_cast<const triFace&>(t) << token::SPACE << t.index()

View File

@ -38,7 +38,7 @@ namespace Foam
// is flattened on a single line. // is flattened on a single line.
static Ostream& printMaps(Ostream& os, const labelListList& maps) static Ostream& printMaps(Ostream& os, const labelListList& maps)
{ {
if (os.format() == IOstream::BINARY || maps.empty()) if (os.format() == IOstreamOption::BINARY || maps.empty())
{ {
os << maps; os << maps;
} }
@ -61,7 +61,7 @@ static Ostream& printMaps(Ostream& os, const labelListList& maps)
static void writeMaps(Ostream& os, const word& key, const labelListList& maps) static void writeMaps(Ostream& os, const word& key, const labelListList& maps)
{ {
if (os.format() == IOstream::BINARY || maps.empty()) if (os.format() == IOstreamOption::BINARY || maps.empty())
{ {
os.writeEntry(key, maps); os.writeEntry(key, maps);
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd. Copyright (C) 2020-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -256,7 +256,7 @@ public:
friend Ostream& operator<<(Ostream& os, const PointIndexHit& pHit) friend Ostream& operator<<(Ostream& os, const PointIndexHit& pHit)
{ {
if (os.format() == IOstream::ASCII) if (os.format() == IOstreamOption::ASCII)
{ {
os << pHit.hit_ << token::SPACE os << pHit.hit_ << token::SPACE
<< pHit.point_ << token::SPACE << pHit.point_ << token::SPACE
@ -278,7 +278,7 @@ public:
friend Istream& operator>>(Istream& is, PointIndexHit& pHit) friend Istream& operator>>(Istream& is, PointIndexHit& pHit)
{ {
if (is.format() == IOstream::ASCII) if (is.format() == IOstreamOption::ASCII)
{ {
is >> pHit.hit_ >> pHit.point_ >> pHit.index_; is >> pHit.hit_ >> pHit.point_ >> pHit.index_;
} }

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2021 OpenCFD Ltd. Copyright (C) 2021-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -84,7 +84,7 @@ Istream& List<char>::readList(Istream& is)
if (len) if (len)
{ {
const auto oldFmt = is.format(IOstream::BINARY); const auto oldFmt = is.format(IOstreamOption::BINARY);
// read(...) includes surrounding start/end delimiters // read(...) includes surrounding start/end delimiters
is.read(list.data(), std::streamsize(len)); is.read(list.data(), std::streamsize(len));

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2021 OpenCFD Ltd. Copyright (C) 2021-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -47,7 +47,7 @@ static Ostream& writeChars
if (count) if (count)
{ {
const auto oldFmt = os.format(IOstream::BINARY); const auto oldFmt = os.format(IOstreamOption::BINARY);
// write(...) includes surrounding start/end delimiters // write(...) includes surrounding start/end delimiters
os.write(chars, count); os.write(chars, count);
@ -163,7 +163,7 @@ Istream& UList<char>::readList(Istream& is)
if (len) if (len)
{ {
const auto oldFmt = is.format(IOstream::BINARY); const auto oldFmt = is.format(IOstreamOption::BINARY);
// read(...) includes surrounding start/end delimiters // read(...) includes surrounding start/end delimiters
is.read(list.data(), std::streamsize(len)); is.read(list.data(), std::streamsize(len));

View File

@ -325,7 +325,7 @@ bool Foam::coordinateSystems::writeObject
// Force ASCII, uncompressed // Force ASCII, uncompressed
return regIOobject::writeObject return regIOobject::writeObject
( (
IOstreamOption(IOstream::ASCII), IOstreamOption(IOstreamOption::ASCII),
valid valid
); );
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2016-2021 OpenCFD Ltd. Copyright (C) 2016-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -45,7 +45,7 @@ Foam::labelList Foam::Function1Types::CSV<Type>::getComponentColumns
labelList cols; labelList cols;
ITstream& is = dict.lookup(name); ITstream& is = dict.lookup(name);
is.format(IOstream::ASCII); is.format(IOstreamOption::ASCII);
is >> cols; is >> cols;
dict.checkITstream(is, name); dict.checkITstream(is, name);
@ -261,7 +261,7 @@ void Foam::Function1Types::CSV<Type>::writeEntries(Ostream& os) const
os.writeEntry("refColumn", refColumn_); os.writeEntry("refColumn", refColumn_);
// Force writing labelList in ASCII // Force writing labelList in ASCII
const auto oldFmt = os.format(IOstream::ASCII); const auto oldFmt = os.format(IOstreamOption::ASCII);
os.writeEntry("componentColumns", componentColumns_); os.writeEntry("componentColumns", componentColumns_);
os.format(oldFmt); os.format(oldFmt);

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2019-2021 OpenCFD Ltd. Copyright (C) 2019-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -100,7 +100,7 @@ void Foam::meshReader::writeInterfaces(const objectRegistry& registry) const
ioObj.writeHeader(os); ioObj.writeHeader(os);
os << interfaces_; os << interfaces_;
ioObj.writeEndDivider(os); IOobject::writeEndDivider(os);
} }

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2016-2021 OpenCFD Ltd. Copyright (C) 2016-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -376,7 +376,7 @@ void Foam::fileFormats::FIREMeshReader::addPatches(polyMesh& mesh) const
bool Foam::fileFormats::FIREMeshReader::readGeometry(const scalar scaleFactor) bool Foam::fileFormats::FIREMeshReader::readGeometry(const scalar scaleFactor)
{ {
IOstreamOption::streamFormat fmt = IOstream::ASCII; IOstreamOption::streamFormat fmt = IOstreamOption::ASCII;
const word ext(geometryFile_.ext()); const word ext(geometryFile_.ext());
@ -387,11 +387,11 @@ bool Foam::fileFormats::FIREMeshReader::readGeometry(const scalar scaleFactor)
FIRECore::fileExt3d fireFileType = FIRECore::file3dExtensions[ext]; FIRECore::fileExt3d fireFileType = FIRECore::file3dExtensions[ext];
if (fireFileType == FIRECore::POLY_ASCII) if (fireFileType == FIRECore::POLY_ASCII)
{ {
fmt = IOstream::ASCII; fmt = IOstreamOption::ASCII;
} }
else if (fireFileType == FIRECore::POLY_BINARY) else if (fireFileType == FIRECore::POLY_BINARY)
{ {
fmt = IOstream::BINARY; fmt = IOstreamOption::BINARY;
} }
else else
{ {

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2016-2018 OpenCFD Ltd. Copyright (C) 2016-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -38,17 +38,21 @@ bool Foam::fileFormats::FIREMeshWriter::compress = false;
bool Foam::fileFormats::FIREMeshWriter::prefixBoundary = true; bool Foam::fileFormats::FIREMeshWriter::prefixBoundary = true;
//! \cond fileScope // * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
//- Output newline in ascii mode, no-op in binary mode
inline static void newline(Foam::OSstream& os) namespace
{ {
if (os.format() == Foam::IOstream::ASCII)
// Output newline in ascii mode, no-op in binary mode
inline void newline(Foam::OSstream& os)
{
if (os.format() == Foam::IOstreamOption::ASCII)
{ {
os << Foam::endl; os << Foam::endl;
} }
} }
//! \endcond } // End anonymous namespace
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -316,9 +320,15 @@ bool Foam::fileFormats::FIREMeshWriter::write(const fileName& meshName) const
new OFstream new OFstream
( (
filename, filename,
(useBinary ? IOstream::BINARY : IOstream::ASCII), (
IOstream::currentVersion, useBinary
(useCompress ? IOstream::COMPRESSED : IOstream::UNCOMPRESSED) ? IOstreamOption::BINARY : IOstreamOption::ASCII
),
IOstreamOption::currentVersion,
(
useCompress
? IOstreamOption::COMPRESSED : IOstreamOption::UNCOMPRESSED
)
) )
); );

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd. Copyright (C) 2020-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -208,7 +208,7 @@ Foam::Ostream& Foam::operator<<
const directionInfo& rhs const directionInfo& rhs
) )
{ {
if (os.format() == IOstream::ASCII) if (os.format() == IOstreamOption::ASCII)
{ {
os << rhs.index_ << rhs.n_; os << rhs.index_ << rhs.n_;
} }
@ -232,7 +232,7 @@ Foam::Istream& Foam::operator>>
directionInfo& rhs directionInfo& rhs
) )
{ {
if (is.format() == IOstream::ASCII) if (is.format() == IOstreamOption::ASCII)
{ {
is >> rhs.index_ >> rhs.n_; is >> rhs.index_ >> rhs.n_;
} }

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -83,7 +84,7 @@ Foam::refineCell::refineCell(Istream& is)
Foam::Ostream& Foam::operator<<(Ostream& os, const refineCell& r) Foam::Ostream& Foam::operator<<(Ostream& os, const refineCell& r)
{ {
if (os.format() == IOstream::ASCII) if (os.format() == IOstreamOption::ASCII)
{ {
os << r.cellNo() << token::SPACE << r.direction(); os << r.cellNo() << token::SPACE << r.direction();
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd. Copyright (C) 2020-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -36,7 +36,7 @@ Foam::Ostream& Foam::operator<<
const wallNormalInfo& rhs const wallNormalInfo& rhs
) )
{ {
if (os.format() == IOstream::ASCII) if (os.format() == IOstreamOption::ASCII)
{ {
os << rhs.normal(); os << rhs.normal();
} }
@ -60,7 +60,7 @@ Foam::Istream& Foam::operator>>
wallNormalInfo& rhs wallNormalInfo& rhs
) )
{ {
if (is.format() == IOstream::ASCII) if (is.format() == IOstreamOption::ASCII)
{ {
is >> rhs.normal_; is >> rhs.normal_;
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd. Copyright (C) 2019-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -36,7 +36,7 @@ Foam::Ostream& Foam::operator<<
const refinementData& rhs const refinementData& rhs
) )
{ {
if (os.format() == IOstream::ASCII) if (os.format() == IOstreamOption::ASCII)
{ {
os << rhs.refinementCount_ << token::SPACE << rhs.count_; os << rhs.refinementCount_ << token::SPACE << rhs.count_;
} }
@ -60,7 +60,7 @@ Foam::Istream& Foam::operator>>
refinementData& rhs refinementData& rhs
) )
{ {
if (is.format() == IOstream::ASCII) if (is.format() == IOstreamOption::ASCII)
{ {
is >> rhs.refinementCount_ >> rhs.count_; is >> rhs.refinementCount_ >> rhs.count_;
} }

View File

@ -543,10 +543,10 @@ Foam::ensightCase::ensightCase
( (
const fileName& ensightDir, const fileName& ensightDir,
const word& caseName, const word& caseName,
const IOstreamOption::streamFormat format const IOstreamOption::streamFormat fmt
) )
: :
options_(new options(format)), options_(new options(fmt)),
os_(nullptr), os_(nullptr),
ensightDir_(ensightDir), ensightDir_(ensightDir),
caseName_(caseName + ".case"), caseName_(caseName + ".case"),

View File

@ -218,7 +218,7 @@ public:
( (
const fileName& ensightDir, const fileName& ensightDir,
const word& caseName, const word& caseName,
const IOstreamOption::streamFormat format = IOstreamOption::BINARY const IOstreamOption::streamFormat fmt = IOstreamOption::BINARY
); );
@ -415,7 +415,7 @@ public:
// Constructors // Constructors
//- Construct with the specified format (default is binary) //- Construct with the specified format (default is binary)
options(IOstreamOption::streamFormat format = IOstreamOption::BINARY); options(IOstreamOption::streamFormat fmt = IOstreamOption::BINARY);
// Member Functions // Member Functions

View File

@ -29,9 +29,9 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::ensightCase::options::options(IOstreamOption::streamFormat format) Foam::ensightCase::options::options(IOstreamOption::streamFormat fmt)
: :
format_(format), format_(fmt),
overwrite_(false), overwrite_(false),
nodeValues_(false), nodeValues_(false),
separateCloud_(false), separateCloud_(false),

View File

@ -119,10 +119,10 @@ void Foam::ensightFile::initialize()
Foam::ensightFile::ensightFile Foam::ensightFile::ensightFile
( (
const fileName& pathname, const fileName& pathname,
IOstreamOption::streamFormat format IOstreamOption::streamFormat fmt
) )
: :
OFstream(ensight::FileName(pathname), format) OFstream(ensight::FileName(pathname), fmt)
{ {
initialize(); initialize();
} }
@ -132,10 +132,10 @@ Foam::ensightFile::ensightFile
( (
const fileName& path, const fileName& path,
const fileName& name, const fileName& name,
IOstreamOption::streamFormat format IOstreamOption::streamFormat fmt
) )
: :
OFstream(path/ensight::FileName(name), format) OFstream(path/ensight::FileName(name), fmt)
{ {
initialize(); initialize();
} }

View File

@ -105,7 +105,7 @@ public:
explicit ensightFile explicit ensightFile
( (
const fileName& pathname, const fileName& pathname,
IOstreamOption::streamFormat format = IOstreamOption::BINARY IOstreamOption::streamFormat fmt = IOstreamOption::BINARY
); );
//- Construct from path and name. //- Construct from path and name.
@ -114,7 +114,7 @@ public:
( (
const fileName& path, const fileName& path,
const fileName& name, const fileName& name,
IOstreamOption::streamFormat format = IOstreamOption::BINARY IOstreamOption::streamFormat fmt = IOstreamOption::BINARY
); );

View File

@ -56,10 +56,10 @@ void Foam::ensightGeoFile::initialize()
Foam::ensightGeoFile::ensightGeoFile Foam::ensightGeoFile::ensightGeoFile
( (
const fileName& pathname, const fileName& pathname,
IOstreamOption::streamFormat format IOstreamOption::streamFormat fmt
) )
: :
ensightFile(pathname, format) ensightFile(pathname, fmt)
{ {
initialize(); initialize();
} }
@ -69,10 +69,10 @@ Foam::ensightGeoFile::ensightGeoFile
( (
const fileName& path, const fileName& path,
const fileName& name, const fileName& name,
IOstreamOption::streamFormat format IOstreamOption::streamFormat fmt
) )
: :
ensightFile(path, name, format) ensightFile(path, name, fmt)
{ {
initialize(); initialize();
} }

View File

@ -80,7 +80,7 @@ public:
explicit ensightGeoFile explicit ensightGeoFile
( (
const fileName& pathname, const fileName& pathname,
IOstreamOption::streamFormat format = IOstreamOption::BINARY IOstreamOption::streamFormat fmt = IOstreamOption::BINARY
); );
//- Construct from path and name. //- Construct from path and name.
@ -89,7 +89,7 @@ public:
( (
const fileName& path, const fileName& path,
const fileName& name, const fileName& name,
IOstreamOption::streamFormat format = IOstreamOption::BINARY IOstreamOption::streamFormat fmt = IOstreamOption::BINARY
); );

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2016 OpenCFD Ltd. Copyright (C) 2016-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -87,7 +87,7 @@ Foam::fileName Foam::fileFormats::FIRECore::fireFileName
Foam::label Foam::fileFormats::FIRECore::getFireLabel(ISstream& is) Foam::label Foam::fileFormats::FIRECore::getFireLabel(ISstream& is)
{ {
if (is.format() == IOstream::BINARY) if (is.format() == IOstreamOption::BINARY)
{ {
fireInt_t ivalue; fireInt_t ivalue;
@ -110,7 +110,7 @@ Foam::point Foam::fileFormats::FIRECore::getFirePoint(ISstream& is)
{ {
point pt; point pt;
if (is.format() == IOstream::BINARY) if (is.format() == IOstreamOption::BINARY)
{ {
fireReal_t coord[3]; fireReal_t coord[3];
@ -139,7 +139,7 @@ std::string Foam::fileFormats::FIRECore::getFireString(ISstream& is)
{ {
std::string str; std::string str;
if (is.format() == IOstream::BINARY) if (is.format() == IOstreamOption::BINARY)
{ {
long len; long len;
@ -204,7 +204,7 @@ void Foam::fileFormats::FIRECore::putFireLabel
const label value const label value
) )
{ {
if (os.format() == IOstream::BINARY) if (os.format() == IOstreamOption::BINARY)
{ {
fireInt_t ivalue(value); fireInt_t ivalue(value);
@ -227,7 +227,7 @@ void Foam::fileFormats::FIRECore::putFireLabels
const labelUList& lst const labelUList& lst
) )
{ {
if (os.format() == IOstream::BINARY) if (os.format() == IOstreamOption::BINARY)
{ {
fireInt_t ivalue(lst.size()); fireInt_t ivalue(lst.size());
@ -267,7 +267,7 @@ void Foam::fileFormats::FIRECore::putFireLabels
const label start const label start
) )
{ {
if (os.format() == IOstream::BINARY) if (os.format() == IOstreamOption::BINARY)
{ {
fireInt_t ivalue(count); fireInt_t ivalue(count);
@ -307,7 +307,7 @@ void Foam::fileFormats::FIRECore::putFirePoint
const point& value const point& value
) )
{ {
if (os.format() == IOstream::BINARY) if (os.format() == IOstreamOption::BINARY)
{ {
fireReal_t fvalue[3]; fireReal_t fvalue[3];
fvalue[0] = value.x(); fvalue[0] = value.x();
@ -336,7 +336,7 @@ void Foam::fileFormats::FIRECore::putFireString
const std::string& value const std::string& value
) )
{ {
if (os.format() == IOstream::BINARY) if (os.format() == IOstreamOption::BINARY)
{ {
long len(value.size()); long len(value.size());

View File

@ -183,7 +183,7 @@ void Foam::glTF::scene::write(Ostream& os)
// Write binary file // Write binary file
// Note: using stdStream // Note: using stdStream
OFstream bin(binFile, IOstream::BINARY); OFstream bin(binFile, IOstreamOption::BINARY);
auto& osbin = bin.stdStream(); auto& osbin = bin.stdStream();
label totalBytes = 0; label totalBytes = 0;

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2016-2020 OpenCFD Ltd. Copyright (C) 2016-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -92,7 +92,9 @@ int Foam::fileFormats::STLCore::detectBinaryHeader
// Handle compressed (.gz) or uncompressed input files // Handle compressed (.gz) or uncompressed input files
ifstreamPointer isPtr(filename); ifstreamPointer isPtr(filename);
const bool unCompressed(IOstream::UNCOMPRESSED == isPtr.whichCompression()); const bool unCompressed =
(IOstreamOption::UNCOMPRESSED == isPtr.whichCompression());
auto& is = *isPtr; auto& is = *isPtr;
if (!is.good()) if (!is.good())
@ -158,7 +160,8 @@ Foam::fileFormats::STLCore::readBinaryHeader
// Handle compressed (.gz) or uncompressed input files // Handle compressed (.gz) or uncompressed input files
{ {
ifstreamPointer isPtr(filename); ifstreamPointer isPtr(filename);
unCompressed = (IOstream::UNCOMPRESSED == isPtr.whichCompression()); unCompressed =
(IOstreamOption::UNCOMPRESSED == isPtr.whichCompression());
// Take ownership // Take ownership
streamPtr.reset(isPtr.release()); streamPtr.reset(isPtr.release());

View File

@ -253,7 +253,7 @@ void Foam::functionObjects::momentumError::calcMomentError()
fvMesh& subMesh = zoneSubSetPtr_->subsetter().subMesh(); fvMesh& subMesh = zoneSubSetPtr_->subsetter().subMesh();
subMesh.fvSchemes::readOpt() = mesh_.fvSchemes::readOpt(); subMesh.fvSchemes::readOpt(mesh_.fvSchemes::readOpt());
subMesh.fvSchemes::read(); subMesh.fvSchemes::read();
auto& momentErrMap = auto& momentErrMap =

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2013-2017 OpenFOAM Foundation Copyright (C) 2013-2017 OpenFOAM Foundation
Copyright (C) 2018 OpenCFD Ltd. Copyright (C) 2018-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -76,7 +76,7 @@ Foam::findCellParticle::findCellParticle
{ {
if (readFields) if (readFields)
{ {
if (is.format() == IOstream::ASCII) if (is.format() == IOstreamOption::ASCII)
{ {
is >> start_ >> end_ >> data_; is >> start_ >> end_ >> data_;
} }
@ -238,7 +238,7 @@ void Foam::findCellParticle::hitWallPatch
Foam::Ostream& Foam::operator<<(Ostream& os, const findCellParticle& p) Foam::Ostream& Foam::operator<<(Ostream& os, const findCellParticle& p)
{ {
if (os.format() == IOstream::ASCII) if (os.format() == IOstreamOption::ASCII)
{ {
os << static_cast<const particle&>(p) os << static_cast<const particle&>(p)
<< token::SPACE << p.start_ << token::SPACE << p.start_

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2017-2019 OpenCFD Ltd. Copyright (C) 2017-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -438,7 +438,7 @@ Foam::wallBoundedParticle::wallBoundedParticle
{ {
if (readFields) if (readFields)
{ {
if (is.format() == IOstream::ASCII) if (is.format() == IOstreamOption::ASCII)
{ {
is >> localPosition_ >> meshEdgeStart_ >> diagEdge_; is >> localPosition_ >> meshEdgeStart_ >> diagEdge_;
} }
@ -484,7 +484,7 @@ Foam::Ostream& Foam::operator<<
const wallBoundedParticle& p const wallBoundedParticle& p
) )
{ {
if (os.format() == IOstream::ASCII) if (os.format() == IOstreamOption::ASCII)
{ {
os << static_cast<const particle&>(p) os << static_cast<const particle&>(p)
<< token::SPACE << p.localPosition_ << token::SPACE << p.localPosition_

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2016-2019 OpenCFD Ltd. Copyright (C) 2016-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -58,7 +58,7 @@ Foam::DSMCParcel<ParcelType>::DSMCParcel
{ {
if (readFields) if (readFields)
{ {
if (is.format() == IOstream::ASCII) if (is.format() == IOstreamOption::ASCII)
{ {
is >> U_ >> Ei_ >> typeId_; is >> U_ >> Ei_ >> typeId_;
} }
@ -153,7 +153,7 @@ Foam::Ostream& Foam::operator<<
const DSMCParcel<ParcelType>& p const DSMCParcel<ParcelType>& p
) )
{ {
if (os.format() == IOstream::ASCII) if (os.format() == IOstreamOption::ASCII)
{ {
os << static_cast<const ParcelType& >(p) os << static_cast<const ParcelType& >(p)
<< token::SPACE << p.U() << token::SPACE << p.U()

View File

@ -121,7 +121,7 @@ void Foam::Cloud<ParticleType>::writeCloudUniformProperties() const
uniformPropsDict.writeObject uniformPropsDict.writeObject
( (
IOstreamOption(IOstream::ASCII, time().writeCompression()), IOstreamOption(IOstreamOption::ASCII, time().writeCompression()),
true true
); );
} }

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2016-2019 OpenCFD Ltd. Copyright (C) 2016-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -67,7 +67,7 @@ Foam::injectedParticle::injectedParticle
// particle position on this mesh // particle position on this mesh
position_ = particle::position(); position_ = particle::position();
if (is.format() == IOstream::ASCII) if (is.format() == IOstreamOption::ASCII)
{ {
is >> tag_ >> soi_ >> d_ >> U_; is >> tag_ >> soi_ >> d_ >> U_;
} }
@ -256,7 +256,7 @@ void Foam::injectedParticle::writeObjects
void Foam::injectedParticle::writePosition(Ostream& os) const void Foam::injectedParticle::writePosition(Ostream& os) const
{ {
if (os.format() == IOstream::ASCII) if (os.format() == IOstreamOption::ASCII)
{ {
os << position_ << token::SPACE << cell(); os << position_ << token::SPACE << cell();
} }
@ -290,7 +290,7 @@ Foam::Ostream& Foam::operator<<
{ {
// Note: not writing local position_ - defer to base particle class // Note: not writing local position_ - defer to base particle class
if (os.format() == IOstream::ASCII) if (os.format() == IOstreamOption::ASCII)
{ {
os << static_cast<const particle&>(p) os << static_cast<const particle&>(p)
<< token::SPACE << p.tag() << token::SPACE << p.tag()

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2016-2019,2022 OpenCFD Ltd. Copyright (C) 2016-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -83,7 +83,7 @@ void Foam::particle::readData
{ {
if (newFormat) if (newFormat)
{ {
if (is.format() == IOstream::ASCII) if (is.format() == IOstreamOption::ASCII)
{ {
is >> coordinates_ >> celli_ >> tetFacei_ >> tetPti_; is >> coordinates_ >> celli_ >> tetFacei_ >> tetPti_;
if (readFields) if (readFields)
@ -128,7 +128,7 @@ void Foam::particle::readData
{ {
positionsCompat1706 p; positionsCompat1706 p;
if (is.format() == IOstream::ASCII) if (is.format() == IOstreamOption::ASCII)
{ {
is >> p.position >> p.celli; is >> p.position >> p.celli;
@ -244,7 +244,7 @@ void Foam::particle::writeProperties
void Foam::particle::writeCoordinates(Ostream& os) const void Foam::particle::writeCoordinates(Ostream& os) const
{ {
if (os.format() == IOstream::ASCII) if (os.format() == IOstreamOption::ASCII)
{ {
os << coordinates_ os << coordinates_
<< token::SPACE << celli_ << token::SPACE << celli_
@ -263,7 +263,7 @@ void Foam::particle::writeCoordinates(Ostream& os) const
void Foam::particle::writePosition(Ostream& os) const void Foam::particle::writePosition(Ostream& os) const
{ {
if (os.format() == IOstream::ASCII) if (os.format() == IOstreamOption::ASCII)
{ {
os << position() << token::SPACE << celli_; os << position() << token::SPACE << celli_;
} }
@ -290,7 +290,7 @@ void Foam::particle::writePosition(Ostream& os) const
Foam::Ostream& Foam::operator<<(Ostream& os, const particle& p) Foam::Ostream& Foam::operator<<(Ostream& os, const particle& p)
{ {
if (os.format() == IOstream::ASCII) if (os.format() == IOstreamOption::ASCII)
{ {
os << p.coordinates_ os << p.coordinates_
<< token::SPACE << p.celli_ << token::SPACE << p.celli_

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2016-2021 OpenCFD Ltd. Copyright (C) 2016-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -290,7 +290,7 @@ void Foam::KinematicCloud<CloudType>::postEvolve
( (
IOstreamOption IOstreamOption
( (
IOstream::ASCII, IOstreamOption::ASCII,
this->db().time().writeCompression() this->db().time().writeCompression()
), ),
true true

View File

@ -135,7 +135,7 @@ bool Foam::ensightOutput::writeCloudPositions
if (Pstream::master()) if (Pstream::master())
{ {
ensightFile& os = output(); ensightFile& os = output();
const bool isBinaryOutput = (os.format() == IOstream::BINARY); const bool isBinaryOutput = (os.format() == IOstreamOption::BINARY);
label parcelId = 0; label parcelId = 0;

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -63,7 +63,7 @@ Foam::CollidingParcel<ParcelType>::CollidingParcel
{ {
if (readFields) if (readFields)
{ {
if (is.format() == IOstream::ASCII) if (is.format() == IOstreamOption::ASCII)
{ {
is >> f_; is >> f_;
is >> angularMomentum_; is >> angularMomentum_;
@ -380,7 +380,7 @@ Foam::Ostream& Foam::operator<<
const CollidingParcel<ParcelType>& p const CollidingParcel<ParcelType>& p
) )
{ {
if (os.format() == IOstream::ASCII) if (os.format() == IOstreamOption::ASCII)
{ {
os << static_cast<const ParcelType&>(p) os << static_cast<const ParcelType&>(p)
<< token::SPACE << p.f_ << token::SPACE << p.f_

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2016-2020 OpenCFD Ltd. Copyright (C) 2016-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -72,7 +72,7 @@ Foam::KinematicParcel<ParcelType>::KinematicParcel
{ {
if (readFields) if (readFields)
{ {
if (is.format() == IOstream::ASCII) if (is.format() == IOstreamOption::ASCII)
{ {
is >> active_ is >> active_
>> typeId_ >> typeId_
@ -410,7 +410,7 @@ Foam::Ostream& Foam::operator<<
const KinematicParcel<ParcelType>& p const KinematicParcel<ParcelType>& p
) )
{ {
if (os.format() == IOstream::ASCII) if (os.format() == IOstreamOption::ASCII)
{ {
os << static_cast<const ParcelType&>(p) os << static_cast<const ParcelType&>(p)
<< token::SPACE << bool(p.active()) << token::SPACE << bool(p.active())

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2013-2017 OpenFOAM Foundation Copyright (C) 2013-2017 OpenFOAM Foundation
Copyright (C) 2016-2019 OpenCFD Ltd. Copyright (C) 2016-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -60,7 +60,7 @@ Foam::MPPICParcel<ParcelType>::MPPICParcel
{ {
if (readFields) if (readFields)
{ {
if (is.format() == IOstream::ASCII) if (is.format() == IOstreamOption::ASCII)
{ {
is >> UCorrect_; is >> UCorrect_;
} }
@ -211,7 +211,7 @@ Foam::Ostream& Foam::operator<<
const MPPICParcel<ParcelType>& p const MPPICParcel<ParcelType>& p
) )
{ {
if (os.format() == IOstream::ASCII) if (os.format() == IOstreamOption::ASCII)
{ {
os << static_cast<const ParcelType&>(p) os << static_cast<const ParcelType&>(p)
<< token::SPACE << p.UCorrect(); << token::SPACE << p.UCorrect();

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2018-2019 OpenCFD Ltd. Copyright (C) 2018-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -384,7 +384,7 @@ Foam::Ostream& Foam::operator<<
) )
{ {
scalarField F(p.F()); scalarField F(p.F());
if (os.format() == IOstream::ASCII) if (os.format() == IOstreamOption::ASCII)
{ {
os << static_cast<const ParcelType&>(p) os << static_cast<const ParcelType&>(p)
<< token::SPACE << F; << token::SPACE << F;

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2016-2020 OpenCFD Ltd. Copyright (C) 2016-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -469,7 +469,7 @@ Foam::Ostream& Foam::operator<<
scalarField YLiquidLoc(p.YLiquid()); scalarField YLiquidLoc(p.YLiquid());
scalarField YSolidLoc(p.YSolid()); scalarField YSolidLoc(p.YSolid());
if (os.format() == IOstream::ASCII) if (os.format() == IOstreamOption::ASCII)
{ {
os << static_cast<const ParcelType&>(p) os << static_cast<const ParcelType&>(p)
<< token::SPACE << YGasLoc << token::SPACE << YGasLoc

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2016-2019 OpenCFD Ltd. Copyright (C) 2016-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -62,7 +62,7 @@ Foam::ReactingParcel<ParcelType>::ReactingParcel
{ {
DynamicList<scalar> Ymix; DynamicList<scalar> Ymix;
if (is.format() == IOstream::ASCII) if (is.format() == IOstreamOption::ASCII)
{ {
is >> mass0_; is >> mass0_;
} }
@ -384,7 +384,7 @@ Foam::Ostream& Foam::operator<<
const ReactingParcel<ParcelType>& p const ReactingParcel<ParcelType>& p
) )
{ {
if (os.format() == IOstream::ASCII) if (os.format() == IOstreamOption::ASCII)
{ {
os << static_cast<const ParcelType&>(p) os << static_cast<const ParcelType&>(p)
<< token::SPACE << p.mass0() << token::SPACE << p.mass0()

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2016-2019 OpenCFD Ltd. Copyright (C) 2016-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -61,7 +61,7 @@ Foam::ThermoParcel<ParcelType>::ThermoParcel
{ {
if (readFields) if (readFields)
{ {
if (is.format() == IOstream::ASCII) if (is.format() == IOstreamOption::ASCII)
{ {
is >> T_ >> Cp_; is >> T_ >> Cp_;
} }
@ -221,7 +221,7 @@ Foam::Ostream& Foam::operator<<
const ThermoParcel<ParcelType>& p const ThermoParcel<ParcelType>& p
) )
{ {
if (os.format() == IOstream::ASCII) if (os.format() == IOstreamOption::ASCII)
{ {
os << static_cast<const ParcelType&>(p) os << static_cast<const ParcelType&>(p)
<< token::SPACE << p.T() << token::SPACE << p.T()

View File

@ -73,8 +73,8 @@ void Foam::PatchParticleHistogram<CloudType>::write()
OFstream patchOutFile OFstream patchOutFile
( (
this->writeTimeDir()/patchName + ".post", this->writeTimeDir()/patchName + ".post",
IOstream::ASCII, IOstreamOption::ASCII,
IOstream::currentVersion, IOstreamOption::currentVersion,
mesh.time().writeCompression() mesh.time().writeCompression()
); );

View File

@ -71,8 +71,8 @@ void Foam::PatchPostProcessing<CloudType>::write()
OFstream patchOutFile OFstream patchOutFile
( (
this->writeTimeDir()/patchName + ".post", this->writeTimeDir()/patchName + ".post",
IOstream::ASCII, IOstreamOption::ASCII,
IOstream::currentVersion, IOstreamOption::currentVersion,
mesh.time().writeCompression() mesh.time().writeCompression()
); );

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2016-2019 OpenCFD Ltd. Copyright (C) 2016-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -64,7 +64,7 @@ Foam::molecule::molecule
{ {
if (readFields) if (readFields)
{ {
if (is.format() == IOstream::ASCII) if (is.format() == IOstreamOption::ASCII)
{ {
is >> Q_ is >> Q_
>> v_ >> v_
@ -271,7 +271,7 @@ void Foam::molecule::writeFields(const Cloud<molecule>& mC)
Foam::Ostream& Foam::operator<<(Ostream& os, const molecule& mol) Foam::Ostream& Foam::operator<<(Ostream& os, const molecule& mol)
{ {
if (os.format() == IOstream::ASCII) if (os.format() == IOstreamOption::ASCII)
{ {
os << token::SPACE << static_cast<const particle&>(mol) os << token::SPACE << static_cast<const particle&>(mol)
<< token::SPACE << mol.Q_ << token::SPACE << mol.Q_

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -51,7 +51,7 @@ Foam::solidParticle::solidParticle
{ {
if (readFields) if (readFields)
{ {
if (is.format() == IOstream::ASCII) if (is.format() == IOstreamOption::ASCII)
{ {
is >> d_ >> U_; is >> d_ >> U_;
} }
@ -124,7 +124,7 @@ void Foam::solidParticle::writeFields(const Cloud<solidParticle>& c)
Foam::Ostream& Foam::operator<<(Ostream& os, const solidParticle& p) Foam::Ostream& Foam::operator<<(Ostream& os, const solidParticle& p)
{ {
if (os.format() == IOstream::ASCII) if (os.format() == IOstreamOption::ASCII)
{ {
os << static_cast<const particle&>(p) os << static_cast<const particle&>(p)
<< token::SPACE << p.d_ << token::SPACE << p.d_

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2016-2019 OpenCFD Ltd. Copyright (C) 2016-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -71,7 +71,7 @@ Foam::SprayParcel<ParcelType>::SprayParcel
{ {
if (readFields) if (readFields)
{ {
if (is.format() == IOstream::ASCII) if (is.format() == IOstreamOption::ASCII)
{ {
is >> d0_ is >> d0_
>> position0_ >> position0_
@ -487,7 +487,7 @@ Foam::Ostream& Foam::operator<<
const SprayParcel<ParcelType>& p const SprayParcel<ParcelType>& p
) )
{ {
if (os.format() == IOstream::ASCII) if (os.format() == IOstreamOption::ASCII)
{ {
os << static_cast<const ParcelType&>(p) os << static_cast<const ParcelType&>(p)
<< token::SPACE << p.d0() << token::SPACE << p.d0()

View File

@ -814,7 +814,7 @@ void Foam::PDRblock::writeBlockMeshDict(const IOobject& io) const
// Just like writeData, but without copying beforehand // Just like writeData, but without copying beforehand
this->blockMeshDict(os); this->blockMeshDict(os);
iodict.writeEndDivider(os); IOobject::writeEndDivider(os);
} }

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2018-2020 OpenCFD Ltd. Copyright (C) 2018-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -271,7 +271,7 @@ inline Foam::Ostream& Foam::operator<<
const PointIntegrateData<DataType>& rhs const PointIntegrateData<DataType>& rhs
) )
{ {
if (os.format() == IOstream::ASCII) if (os.format() == IOstreamOption::ASCII)
{ {
return os << rhs.valid_ << token::SPACE << rhs.data(); return os << rhs.valid_ << token::SPACE << rhs.data();
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2017-2019 OpenCFD Ltd. Copyright (C) 2017-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -96,7 +96,7 @@ Foam::trackedParticle::trackedParticle
{ {
if (readFields) if (readFields)
{ {
if (is.format() == IOstream::ASCII) if (is.format() == IOstreamOption::ASCII)
{ {
is >> start_ >> end_ >> level_ >> i_ >> j_ >> k_; is >> start_ >> end_ >> level_ >> i_ >> j_ >> k_;
} }
@ -289,7 +289,7 @@ void Foam::trackedParticle::correctAfterParallelTransfer
Foam::Ostream& Foam::operator<<(Ostream& os, const trackedParticle& p) Foam::Ostream& Foam::operator<<(Ostream& os, const trackedParticle& p)
{ {
if (os.format() == IOstream::ASCII) if (os.format() == IOstreamOption::ASCII)
{ {
os << static_cast<const particle&>(p) os << static_cast<const particle&>(p)
<< token::SPACE << p.start_ << token::SPACE << p.start_

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2015 OpenFOAM Foundation Copyright (C) 2015 OpenFOAM Foundation
Copyright (C) 2016-2021 OpenCFD Ltd. Copyright (C) 2016-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -487,7 +487,7 @@ bool Foam::AABBTree<Type>::overlaps(const boundBox& bbIn) const
template<class Type> template<class Type>
Foam::Ostream& Foam::operator<<(Ostream& os, const AABBTree<Type>& tree) Foam::Ostream& Foam::operator<<(Ostream& os, const AABBTree<Type>& tree)
{ {
if (os.format() == IOstream::ASCII) if (os.format() == IOstreamOption::ASCII)
{ {
os << tree.maxLevel_ << token::SPACE os << tree.maxLevel_ << token::SPACE
<< tree.minLeafSize_ << token::SPACE << tree.minLeafSize_ << token::SPACE
@ -514,7 +514,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const AABBTree<Type>& tree)
template<class Type> template<class Type>
Foam::Istream& Foam::operator>>(Istream& is, AABBTree<Type>& tree) Foam::Istream& Foam::operator>>(Istream& is, AABBTree<Type>& tree)
{ {
if (is.format() == IOstream::ASCII) if (is.format() == IOstreamOption::ASCII)
{ {
is >> tree.maxLevel_ is >> tree.maxLevel_
>> tree.minLeafSize_; >> tree.minLeafSize_;

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd. Copyright (C) 2020-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -37,7 +37,7 @@ Foam::Ostream& Foam::operator<<
const PointData<T>& rhs const PointData<T>& rhs
) )
{ {
if (os.format() == IOstream::ASCII) if (os.format() == IOstreamOption::ASCII)
{ {
return os return os
<< static_cast<const pointEdgePoint&>(rhs) << static_cast<const pointEdgePoint&>(rhs)

Some files were not shown because too many files have changed in this diff Show More