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",
tmagGradP()/max(tmagGradP())
);
normalisedGradP.writeOpt() = IOobject::AUTO_WRITE;
normalisedGradP.writeOpt(IOobject::AUTO_WRITE);
tmagGradP.clear();
++runTime;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2014 OpenFOAM Foundation
Copyright (C) 2016-2021 OpenCFD Ltd.
Copyright (C) 2016-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -44,7 +44,7 @@ Foam::Ostream& Foam::IndirectListBase<T, Addr>::writeList
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
os << nl << len << nl;

View File

@ -40,7 +40,7 @@ void Foam::FixedList<T, N>::writeEntry(Ostream& os) const
if (token::compound::isCompound(tag))
{
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
os << static_cast<label>(N);
@ -90,7 +90,7 @@ Foam::Ostream& Foam::FixedList<T, N>::writeList
// small and we prefer a consistent appearance.
// 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
@ -158,7 +158,7 @@ Foam::Istream& Foam::FixedList<T, N>::readList
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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 2018-2019 OpenCFD Ltd.
Copyright (C) 2018-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -32,8 +32,8 @@ Description
\*---------------------------------------------------------------------------*/
#ifndef IOmanip_H
#define IOmanip_H
#ifndef Foam_IOmanip_H
#define Foam_IOmanip_H
#include "Istream.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 |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2017-2021 OpenCFD Ltd.
Copyright (C) 2017-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -49,11 +49,11 @@ inline static void processFlags(Istream& is, int flagMask)
{
if ((flagMask & token::ASCII))
{
is.format(IOstream::ASCII);
is.format(IOstreamOption::ASCII);
}
else if ((flagMask & token::BINARY))
{
is.format(IOstream::BINARY);
is.format(IOstreamOption::BINARY);
}
}

View File

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

View File

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

View File

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

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2018 OpenFOAM Foundation
Copyright (C) 2015-2021 OpenCFD Ltd.
Copyright (C) 2015-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
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
// 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())
{

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019-2021 OpenCFD Ltd.
Copyright (C) 2019-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -70,7 +70,7 @@ bool Foam::Matrix<Form, Type>::readMatrix(Istream& is)
// The total 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
@ -154,7 +154,7 @@ Foam::Ostream& Foam::Matrix<Form, Type>::writeMatrix
// Rows, columns size
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

View File

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

View File

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

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2016-2019 OpenCFD Ltd.
Copyright (C) 2016-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
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)
{
if (os.format() == IOstream::ASCII)
if (os.format() == IOstreamOption::ASCII)
{
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)
{
if (is.format() == IOstream::ASCII)
if (is.format() == IOstreamOption::ASCII)
{
is >> bb.min_ >> bb.max_;
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 2016-2021 OpenCFD Ltd.
Copyright (C) 2016-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
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)
{
if (is.format() == IOstream::ASCII)
if (is.format() == IOstreamOption::ASCII)
{
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)
{
if (os.format() == IOstream::ASCII)
if (os.format() == IOstreamOption::ASCII)
{
os << token::BEGIN_LIST
<< static_cast<const triFace&>(t) << token::SPACE << t.index()

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2021 OpenCFD Ltd.
Copyright (C) 2016-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
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)
{
IOstreamOption::streamFormat fmt = IOstream::ASCII;
IOstreamOption::streamFormat fmt = IOstreamOption::ASCII;
const word ext(geometryFile_.ext());
@ -387,11 +387,11 @@ bool Foam::fileFormats::FIREMeshReader::readGeometry(const scalar scaleFactor)
FIRECore::fileExt3d fireFileType = FIRECore::file3dExtensions[ext];
if (fireFileType == FIRECore::POLY_ASCII)
{
fmt = IOstream::ASCII;
fmt = IOstreamOption::ASCII;
}
else if (fireFileType == FIRECore::POLY_BINARY)
{
fmt = IOstream::BINARY;
fmt = IOstreamOption::BINARY;
}
else
{

View File

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

View File

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

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -83,7 +84,7 @@ Foam::refineCell::refineCell(Istream& is)
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();
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -105,7 +105,7 @@ public:
explicit ensightFile
(
const fileName& pathname,
IOstreamOption::streamFormat format = IOstreamOption::BINARY
IOstreamOption::streamFormat fmt = IOstreamOption::BINARY
);
//- Construct from path and name.
@ -114,7 +114,7 @@ public:
(
const fileName& path,
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
(
const fileName& pathname,
IOstreamOption::streamFormat format
IOstreamOption::streamFormat fmt
)
:
ensightFile(pathname, format)
ensightFile(pathname, fmt)
{
initialize();
}
@ -69,10 +69,10 @@ Foam::ensightGeoFile::ensightGeoFile
(
const fileName& path,
const fileName& name,
IOstreamOption::streamFormat format
IOstreamOption::streamFormat fmt
)
:
ensightFile(path, name, format)
ensightFile(path, name, fmt)
{
initialize();
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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