regIOobject: changed the "valid" argument name to "read" for read function and "write" for write functions

This clarifies the purpose which is to indicate that the object should be read
or written on this particular processor rather than it is or is not valid.
This commit is contained in:
Henry Weller
2019-04-27 10:46:57 +01:00
parent 5420c5001b
commit af45bd636d
60 changed files with 306 additions and 298 deletions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -183,7 +183,7 @@ bool writeOptionalMeshObject
const word& name, const word& name,
const fileName& meshDir, const fileName& meshDir,
Time& runTime, Time& runTime,
const bool valid const bool write
) )
{ {
IOobject io IOobject io
@ -210,10 +210,10 @@ bool writeOptionalMeshObject
{ {
Info<< " Reading " << classNames[0] Info<< " Reading " << classNames[0]
<< " : " << name << endl; << " : " << name << endl;
T meshObject(io, valid && haveFile); T meshObject(io, write && haveFile);
Info<< " Writing " << name << endl; Info<< " Writing " << name << endl;
writeOk = meshObject.regIOobject::write(valid && haveFile); writeOk = meshObject.regIOobject::write(write && haveFile);
} }
return writeOk; return writeOk;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -188,13 +188,10 @@ void Foam::lagrangianFieldDecomposer::decomposeFields
const PtrList<GeoField>& fields const PtrList<GeoField>& fields
) const ) const
{ {
// if (particleIndices_.size()) const bool write = particleIndices_.size() > 0;
forAll(fields, fieldi)
{ {
bool valid = particleIndices_.size() > 0; decomposeField(cloudName, fields[fieldi])().write(write);
forAll(fields, fieldi)
{
decomposeField(cloudName, fields[fieldi])().write(valid);
}
} }
} }
@ -206,13 +203,10 @@ void Foam::lagrangianFieldDecomposer::decomposeFieldFields
const PtrList<GeoField>& fields const PtrList<GeoField>& fields
) const ) const
{ {
// if (particleIndices_.size()) const bool write = particleIndices_.size() > 0;
forAll(fields, fieldi)
{ {
bool valid = particleIndices_.size() > 0; decomposeFieldField(cloudName, fields[fieldi])().write(write);
forAll(fields, fieldi)
{
decomposeFieldField(cloudName, fields[fieldi])().write(valid);
}
} }
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -29,11 +29,11 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class T, class BaseType> template<class T, class BaseType>
void Foam::CompactIOField<T, BaseType>::readFromStream(const bool valid) void Foam::CompactIOField<T, BaseType>::readFromStream(const bool read)
{ {
Istream& is = readStream(word::null, valid); Istream& is = readStream(word::null, read);
if (valid) if (read)
{ {
if (headerClassName() == IOField<T>::typeName) if (headerClassName() == IOField<T>::typeName)
{ {
@ -82,19 +82,19 @@ template<class T, class BaseType>
Foam::CompactIOField<T, BaseType>::CompactIOField Foam::CompactIOField<T, BaseType>::CompactIOField
( (
const IOobject& io, const IOobject& io,
const bool valid const bool read
) )
: :
regIOobject(io) regIOobject(io)
{ {
if (io.readOpt() == IOobject::MUST_READ) if (io.readOpt() == IOobject::MUST_READ)
{ {
readFromStream(valid); readFromStream(read);
} }
else if (io.readOpt() == IOobject::READ_IF_PRESENT) else if (io.readOpt() == IOobject::READ_IF_PRESENT)
{ {
bool haveFile = headerOk(); bool haveFile = headerOk();
readFromStream(valid && haveFile); readFromStream(read && haveFile);
} }
} }
@ -185,7 +185,7 @@ bool Foam::CompactIOField<T, BaseType>::writeObject
IOstream::streamFormat fmt, IOstream::streamFormat fmt,
IOstream::versionNumber ver, IOstream::versionNumber ver,
IOstream::compressionType cmp, IOstream::compressionType cmp,
const bool valid const bool write
) const ) const
{ {
if (fmt == IOstream::ASCII) if (fmt == IOstream::ASCII)
@ -195,7 +195,7 @@ bool Foam::CompactIOField<T, BaseType>::writeObject
const_cast<word&>(typeName) = IOField<T>::typeName; const_cast<word&>(typeName) = IOField<T>::typeName;
bool good = regIOobject::writeObject(fmt, ver, cmp, valid); bool good = regIOobject::writeObject(fmt, ver, cmp, write);
// Change type back // Change type back
const_cast<word&>(typeName) = oldTypeName; const_cast<word&>(typeName) = oldTypeName;
@ -204,7 +204,7 @@ bool Foam::CompactIOField<T, BaseType>::writeObject
} }
else else
{ {
return regIOobject::writeObject(fmt, ver, cmp, valid); return regIOobject::writeObject(fmt, ver, cmp, write);
} }
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -75,7 +75,7 @@ class CompactIOField
// Private Member Functions // Private Member Functions
//- Read according to header type //- Read according to header type
void readFromStream(const bool valid = true); void readFromStream(const bool read = true);
public: public:
@ -89,7 +89,7 @@ public:
CompactIOField(const IOobject&); CompactIOField(const IOobject&);
//- Construct from IOobject; does local processor require reading? //- Construct from IOobject; does local processor require reading?
CompactIOField(const IOobject&, const bool valid); CompactIOField(const IOobject&, const bool read);
//- Construct from IOobject and size //- Construct from IOobject and size
CompactIOField(const IOobject&, const label); CompactIOField(const IOobject&, const label);
@ -113,7 +113,7 @@ public:
IOstream::streamFormat, IOstream::streamFormat,
IOstream::versionNumber, IOstream::versionNumber,
IOstream::compressionType, IOstream::compressionType,
const bool valid const bool write
) const; ) const;
virtual bool writeData(Ostream&) const; virtual bool writeData(Ostream&) const;

View File

@ -161,7 +161,7 @@ bool Foam::CompactIOList<T, BaseType>::writeObject
IOstream::streamFormat fmt, IOstream::streamFormat fmt,
IOstream::versionNumber ver, IOstream::versionNumber ver,
IOstream::compressionType cmp, IOstream::compressionType cmp,
const bool valid const bool write
) const ) const
{ {
if (fmt == IOstream::ASCII) if (fmt == IOstream::ASCII)
@ -171,7 +171,7 @@ bool Foam::CompactIOList<T, BaseType>::writeObject
const_cast<word&>(typeName) = IOList<T>::typeName; const_cast<word&>(typeName) = IOList<T>::typeName;
bool good = regIOobject::writeObject(fmt, ver, cmp, valid); bool good = regIOobject::writeObject(fmt, ver, cmp, write);
// Change type back // Change type back
const_cast<word&>(typeName) = oldTypeName; const_cast<word&>(typeName) = oldTypeName;
@ -190,7 +190,7 @@ bool Foam::CompactIOList<T, BaseType>::writeObject
const_cast<word&>(typeName) = IOList<T>::typeName; const_cast<word&>(typeName) = IOList<T>::typeName;
bool good = regIOobject::writeObject(IOstream::ASCII, ver, cmp, valid); bool good = regIOobject::writeObject(IOstream::ASCII, ver, cmp, write);
// Change type back // Change type back
const_cast<word&>(typeName) = oldTypeName; const_cast<word&>(typeName) = oldTypeName;
@ -199,7 +199,7 @@ bool Foam::CompactIOList<T, BaseType>::writeObject
} }
else else
{ {
return regIOobject::writeObject(fmt, ver, cmp, valid); return regIOobject::writeObject(fmt, ver, cmp, write);
} }
} }

View File

@ -95,7 +95,7 @@ public:
IOstream::streamFormat, IOstream::streamFormat,
IOstream::versionNumber, IOstream::versionNumber,
IOstream::compressionType, IOstream::compressionType,
const bool valid const bool write
) const; ) const;
virtual bool writeData(Ostream&) const; virtual bool writeData(Ostream&) const;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -51,7 +51,7 @@ Foam::IOField<Type>::IOField(const IOobject& io)
template<class Type> template<class Type>
Foam::IOField<Type>::IOField(const IOobject& io, const bool valid) Foam::IOField<Type>::IOField(const IOobject& io, const bool read)
: :
regIOobject(io) regIOobject(io)
{ {
@ -64,9 +64,9 @@ Foam::IOField<Type>::IOField(const IOobject& io, const bool valid)
|| io.readOpt() == IOobject::MUST_READ_IF_MODIFIED || io.readOpt() == IOobject::MUST_READ_IF_MODIFIED
) )
{ {
Istream& is = readStream(typeName, valid); Istream& is = readStream(typeName, read);
if (valid) if (read)
{ {
is >> *this; is >> *this;
} }
@ -76,9 +76,9 @@ Foam::IOField<Type>::IOField(const IOobject& io, const bool valid)
{ {
bool haveFile = headerOk(); bool haveFile = headerOk();
Istream& is = readStream(typeName, haveFile && valid); Istream& is = readStream(typeName, haveFile && read);
if (valid && haveFile) if (read && haveFile)
{ {
is >> *this; is >> *this;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -65,7 +65,7 @@ public:
IOField(const IOobject&); IOField(const IOobject&);
//- Construct from IOobject; does local processor require reading? //- Construct from IOobject; does local processor require reading?
IOField(const IOobject&, const bool valid); IOField(const IOobject&, const bool read);
//- Construct from IOobject and size (does not set values) //- Construct from IOobject and size (does not set values)
IOField(const IOobject&, const label size); IOField(const IOobject&, const label size);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -1028,7 +1028,7 @@ bool Foam::decomposedBlockData::writeObject
IOstream::streamFormat fmt, IOstream::streamFormat fmt,
IOstream::versionNumber ver, IOstream::versionNumber ver,
IOstream::compressionType cmp, IOstream::compressionType cmp,
const bool valid const bool write
) const ) const
{ {
autoPtr<OSstream> osPtr; autoPtr<OSstream> osPtr;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -139,7 +139,7 @@ public:
IOstream::streamFormat, IOstream::streamFormat,
IOstream::versionNumber, IOstream::versionNumber,
IOstream::compressionType, IOstream::compressionType,
const bool valid const bool write
) const; ) const;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -75,14 +75,14 @@ Foam::masterOFstream::masterOFstream
versionNumber version, versionNumber version,
compressionType compression, compressionType compression,
const bool append, const bool append,
const bool valid const bool write
) )
: :
OStringStream(format, version), OStringStream(format, version),
pathName_(pathName), pathName_(pathName),
compression_(compression), compression_(compression),
append_(append), append_(append),
valid_(valid) write_(write)
{} {}
@ -106,15 +106,15 @@ Foam::masterOFstream::~masterOFstream()
if (uniform) if (uniform)
{ {
if (Pstream::master() && valid_) if (Pstream::master() && write_)
{ {
checkWrite(pathName_, str()); checkWrite(pathName_, str());
} }
return; return;
} }
boolList valid(Pstream::nProcs()); boolList write(Pstream::nProcs());
valid[Pstream::myProcNo()] = valid_; write[Pstream::myProcNo()] = write_;
Pstream::gatherList(valid); Pstream::gatherList(write);
// Different files // Different files
@ -135,7 +135,7 @@ Foam::masterOFstream::~masterOFstream()
{ {
// Write my own data // Write my own data
{ {
if (valid[Pstream::myProcNo()]) if (write[Pstream::myProcNo()])
{ {
checkWrite(filePaths[Pstream::myProcNo()], str()); checkWrite(filePaths[Pstream::myProcNo()], str());
} }
@ -148,7 +148,7 @@ Foam::masterOFstream::~masterOFstream()
is.read(buf.begin(), buf.size()); is.read(buf.begin(), buf.size());
if (valid[proci]) if (write[proci])
{ {
checkWrite checkWrite
( (

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -59,7 +59,7 @@ class masterOFstream
const bool append_; const bool append_;
//- Should file be written //- Should file be written
const bool valid_; const bool write_;
// Private Member Functions // Private Member Functions
@ -80,7 +80,7 @@ public:
versionNumber version=currentVersion, versionNumber version=currentVersion,
compressionType compression=UNCOMPRESSED, compressionType compression=UNCOMPRESSED,
const bool append = false, const bool append = false,
const bool valid = true const bool write = true
); );

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -364,7 +364,7 @@ public:
IOstream::streamFormat, IOstream::streamFormat,
IOstream::versionNumber, IOstream::versionNumber,
IOstream::compressionType, IOstream::compressionType,
const bool valid const bool write
) const; ) const;
//- Write the objects now (not at end of iteration) and continue //- Write the objects now (not at end of iteration) and continue

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -543,7 +543,7 @@ bool Foam::Time::writeObject
IOstream::streamFormat fmt, IOstream::streamFormat fmt,
IOstream::versionNumber ver, IOstream::versionNumber ver,
IOstream::compressionType cmp, IOstream::compressionType cmp,
const bool valid const bool write
) const ) const
{ {
if (writeTime()) if (writeTime())
@ -552,7 +552,7 @@ bool Foam::Time::writeObject
if (writeOK) if (writeOK)
{ {
writeOK = objectRegistry::writeObject(fmt, ver, cmp, valid); writeOK = objectRegistry::writeObject(fmt, ver, cmp, write);
} }
if (writeOK) if (writeOK)

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -122,9 +122,9 @@ bool Foam::IOOutputFilter<OutputFilter>::read()
template<class OutputFilter> template<class OutputFilter>
bool Foam::IOOutputFilter<OutputFilter>::write(const bool valid) bool Foam::IOOutputFilter<OutputFilter>::write(const bool write)
{ {
return OutputFilter::write(valid); return OutputFilter::write(write);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -126,7 +126,7 @@ public:
using regIOobject::write; using regIOobject::write;
//- Sample and write //- Sample and write
virtual bool write(const bool valid = true); virtual bool write(const bool write = true);
//- Update for changes of mesh //- Update for changes of mesh
virtual void updateMesh(const mapPolyMesh& mpm); virtual void updateMesh(const mapPolyMesh& mpm);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -350,7 +350,7 @@ bool Foam::objectRegistry::writeObject
IOstream::streamFormat fmt, IOstream::streamFormat fmt,
IOstream::versionNumber ver, IOstream::versionNumber ver,
IOstream::compressionType cmp, IOstream::compressionType cmp,
const bool valid const bool write
) const ) const
{ {
bool ok = true; bool ok = true;
@ -370,7 +370,7 @@ bool Foam::objectRegistry::writeObject
if (iter()->writeOpt() != NO_WRITE) if (iter()->writeOpt() != NO_WRITE)
{ {
ok = iter()->writeObject(fmt, ver, cmp, valid) && ok; ok = iter()->writeObject(fmt, ver, cmp, write) && ok;
} }
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -232,7 +232,7 @@ public:
IOstream::streamFormat fmt, IOstream::streamFormat fmt,
IOstream::versionNumber ver, IOstream::versionNumber ver,
IOstream::compressionType cmp, IOstream::compressionType cmp,
const bool valid const bool write
) const; ) const;
}; };

View File

@ -91,7 +91,7 @@ private:
// Private Member Functions // Private Member Functions
//- Return Istream //- Return Istream
Istream& readStream(const bool valid = true); Istream& readStream(const bool read = true);
//- Dissallow assignment //- Dissallow assignment
void operator=(const regIOobject&); void operator=(const regIOobject&);
@ -226,7 +226,7 @@ public:
bool headerOk(); bool headerOk();
//- Return Istream and check object type against that given //- Return Istream and check object type against that given
Istream& readStream(const word&, const bool valid = true); Istream& readStream(const word&, const bool read = true);
//- Close Istream //- Close Istream
void close(); void close();
@ -273,11 +273,11 @@ public:
IOstream::streamFormat, IOstream::streamFormat,
IOstream::versionNumber, IOstream::versionNumber,
IOstream::compressionType, IOstream::compressionType,
const bool valid const bool write
) const; ) const;
//- Write using setting from DB //- Write using setting from DB
virtual bool write(const bool valid = true) const; virtual bool write(const bool write = true) const;
// Member operators // Member operators

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -85,7 +85,7 @@ bool Foam::regIOobject::readHeaderOk
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::Istream& Foam::regIOobject::readStream(const bool valid) Foam::Istream& Foam::regIOobject::readStream(const bool read)
{ {
if (IFstream::debug) if (IFstream::debug)
{ {
@ -127,7 +127,7 @@ Foam::Istream& Foam::regIOobject::readStream(const bool valid)
} }
} }
isPtr_ = fileHandler().readStream(*this, objPath, type(), valid); isPtr_ = fileHandler().readStream(*this, objPath, type(), read);
} }
return isPtr_(); return isPtr_();
@ -137,7 +137,7 @@ Foam::Istream& Foam::regIOobject::readStream(const bool valid)
Foam::Istream& Foam::regIOobject::readStream Foam::Istream& Foam::regIOobject::readStream
( (
const word& expectName, const word& expectName,
const bool valid const bool read
) )
{ {
if (IFstream::debug) if (IFstream::debug)
@ -150,14 +150,14 @@ Foam::Istream& Foam::regIOobject::readStream
// Construct IFstream if not already constructed // Construct IFstream if not already constructed
if (!isPtr_.valid()) if (!isPtr_.valid())
{ {
readStream(valid); readStream(read);
// Check the className of the regIOobject // Check the className of the regIOobject
// dictionary is an allowable name in case the actual class // dictionary is an allowable name in case the actual class
// instantiated is a dictionary // instantiated is a dictionary
if if
( (
valid read
&& expectName.size() && expectName.size()
&& headerClassName() != expectName && headerClassName() != expectName
&& headerClassName() != "dictionary" && headerClassName() != "dictionary"

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -38,7 +38,7 @@ bool Foam::regIOobject::writeObject
IOstream::streamFormat fmt, IOstream::streamFormat fmt,
IOstream::versionNumber ver, IOstream::versionNumber ver,
IOstream::compressionType cmp, IOstream::compressionType cmp,
const bool valid const bool write
) const ) const
{ {
if (!good()) if (!good())
@ -141,7 +141,7 @@ bool Foam::regIOobject::writeObject
// //
// osGood = os.good(); // osGood = os.good();
//} //}
osGood = fileHandler().writeObject(*this, fmt, ver, cmp, valid); osGood = fileHandler().writeObject(*this, fmt, ver, cmp, write);
} }
else else
{ {
@ -165,14 +165,14 @@ bool Foam::regIOobject::writeObject
} }
bool Foam::regIOobject::write(const bool valid) const bool Foam::regIOobject::write(const bool write) const
{ {
return writeObject return writeObject
( (
time().writeFormat(), time().writeFormat(),
IOstream::currentVersion, IOstream::currentVersion,
time().writeCompression(), time().writeCompression(),
valid write
); );
} }

View File

@ -453,7 +453,7 @@ bool Foam::fileOperations::collatedFileOperation::writeObject
IOstream::streamFormat fmt, IOstream::streamFormat fmt,
IOstream::versionNumber ver, IOstream::versionNumber ver,
IOstream::compressionType cmp, IOstream::compressionType cmp,
const bool valid const bool write
) const ) const
{ {
const Time& tm = io.time(); const Time& tm = io.time();
@ -479,7 +479,7 @@ bool Foam::fileOperations::collatedFileOperation::writeObject
ver, ver,
cmp, cmp,
false, false,
valid write
); );
// If any of these fail, return (leave error handling to Ostream class) // If any of these fail, return (leave error handling to Ostream class)
@ -525,7 +525,7 @@ bool Foam::fileOperations::collatedFileOperation::writeObject
ver, ver,
cmp, cmp,
false, false,
valid write
); );
// If any of these fail, return (leave error handling to Ostream // If any of these fail, return (leave error handling to Ostream

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -150,7 +150,7 @@ public:
IOstream::streamFormat format=IOstream::ASCII, IOstream::streamFormat format=IOstream::ASCII,
IOstream::versionNumber version=IOstream::currentVersion, IOstream::versionNumber version=IOstream::currentVersion,
IOstream::compressionType compression=IOstream::UNCOMPRESSED, IOstream::compressionType compression=IOstream::UNCOMPRESSED,
const bool valid = true const bool write = true
) const; ) const;
// Other // Other

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -460,10 +460,10 @@ bool Foam::fileOperation::writeObject
IOstream::streamFormat fmt, IOstream::streamFormat fmt,
IOstream::versionNumber ver, IOstream::versionNumber ver,
IOstream::compressionType cmp, IOstream::compressionType cmp,
const bool valid const bool write
) const ) const
{ {
if (valid) if (write)
{ {
fileName pathName(io.objectPath()); fileName pathName(io.objectPath());

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -363,7 +363,7 @@ public:
regIOobject&, regIOobject&,
const fileName&, const fileName&,
const word& typeName, const word& typeName,
const bool valid = true const bool read = true
) const = 0; ) const = 0;
//- Top-level read //- Top-level read
@ -377,7 +377,7 @@ public:
//- Writes a regIOobject (so header, contents and divider). //- Writes a regIOobject (so header, contents and divider).
// Returns success state. Default action is to write to // Returns success state. Default action is to write to
// the objectPath using writeData. If !valid the // the objectPath using writeData. If !write the
// file does not need to be written (this is used e.g. to // file does not need to be written (this is used e.g. to
// suppress empty local lagrangian data) // suppress empty local lagrangian data)
virtual bool writeObject virtual bool writeObject
@ -386,7 +386,7 @@ public:
IOstream::streamFormat format=IOstream::ASCII, IOstream::streamFormat format=IOstream::ASCII,
IOstream::versionNumber version=IOstream::currentVersion, IOstream::versionNumber version=IOstream::currentVersion,
IOstream::compressionType compression=IOstream::UNCOMPRESSED, IOstream::compressionType compression=IOstream::UNCOMPRESSED,
const bool valid = true const bool write = true
) const; ) const;
@ -406,7 +406,7 @@ public:
IOstream::streamFormat format=IOstream::ASCII, IOstream::streamFormat format=IOstream::ASCII,
IOstream::versionNumber version=IOstream::currentVersion, IOstream::versionNumber version=IOstream::currentVersion,
IOstream::compressionType compression=IOstream::UNCOMPRESSED, IOstream::compressionType compression=IOstream::UNCOMPRESSED,
const bool valid = true const bool write = true
) const = 0; ) const = 0;

View File

@ -559,7 +559,7 @@ Foam::fileOperations::masterUncollatedFileOperation::read
const label comm, const label comm,
const bool uniform, // on comms master only const bool uniform, // on comms master only
const fileNameList& filePaths, // on comms master only const fileNameList& filePaths, // on comms master only
const boolList& procValid // on comms master only const boolList& read // on comms master only
) )
{ {
autoPtr<ISstream> isPtr; autoPtr<ISstream> isPtr;
@ -577,7 +577,7 @@ Foam::fileOperations::masterUncollatedFileOperation::read
{ {
if (uniform) if (uniform)
{ {
if (procValid[0]) if (read[0])
{ {
if (filePaths[0].empty()) if (filePaths[0].empty())
{ {
@ -594,7 +594,7 @@ Foam::fileOperations::masterUncollatedFileOperation::read
proci++ proci++
) )
{ {
if (procValid[proci]) if (read[proci])
{ {
validProcs.append(proci); validProcs.append(proci);
} }
@ -614,7 +614,7 @@ Foam::fileOperations::masterUncollatedFileOperation::read
} }
else else
{ {
if (procValid[0]) if (read[0])
{ {
if (filePaths[0].empty()) if (filePaths[0].empty())
{ {
@ -654,7 +654,7 @@ Foam::fileOperations::masterUncollatedFileOperation::read
const fileName& fPath = filePaths[proci]; const fileName& fPath = filePaths[proci];
if (procValid[proci] && !fPath.empty()) if (read[proci] && !fPath.empty())
{ {
// Note: handle compression ourselves since size cannot // Note: handle compression ourselves since size cannot
// be determined without actually uncompressing // be determined without actually uncompressing
@ -671,7 +671,7 @@ Foam::fileOperations::masterUncollatedFileOperation::read
// IFstream. Else the information is in the PstreamBuffers (and // IFstream. Else the information is in the PstreamBuffers (and
// the special case of a uniform file) // the special case of a uniform file)
if (procValid[Pstream::myProcNo(comm)]) if (read[Pstream::myProcNo(comm)])
{ {
// This processor needs to return something // This processor needs to return something
@ -1866,7 +1866,7 @@ Foam::fileOperations::masterUncollatedFileOperation::readStream
regIOobject& io, regIOobject& io,
const fileName& fName, const fileName& fName,
const word& typeName, const word& typeName,
const bool valid const bool read
) const ) const
{ {
if (debug) if (debug)
@ -1874,7 +1874,7 @@ Foam::fileOperations::masterUncollatedFileOperation::readStream
Pout<< "masterUncollatedFileOperation::readStream :" Pout<< "masterUncollatedFileOperation::readStream :"
<< " object : " << io.name() << " object : " << io.name()
<< " global : " << io.global() << " global : " << io.global()
<< " fName : " << fName << " valid:" << valid << endl; << " fName : " << fName << " read:" << read << endl;
} }
@ -2068,10 +2068,17 @@ Foam::fileOperations::masterUncollatedFileOperation::readStream
filePaths[Pstream::myProcNo()] = fName; filePaths[Pstream::myProcNo()] = fName;
Pstream::gatherList(filePaths); Pstream::gatherList(filePaths);
boolList procValid(Pstream::nProcs()); boolList procValid(Pstream::nProcs());
procValid[Pstream::myProcNo()] = valid; procValid[Pstream::myProcNo()] = read;
Pstream::gatherList(procValid); Pstream::gatherList(procValid);
return read(io, Pstream::worldComm, true, filePaths, procValid); return this->read
(
io,
Pstream::worldComm,
true,
filePaths,
procValid
);
} }
else else
{ {
@ -2080,13 +2087,20 @@ Foam::fileOperations::masterUncollatedFileOperation::readStream
filePaths[Pstream::myProcNo(comm_)] = fName; filePaths[Pstream::myProcNo(comm_)] = fName;
Pstream::gatherList(filePaths, Pstream::msgType(), comm_); Pstream::gatherList(filePaths, Pstream::msgType(), comm_);
boolList procValid(Pstream::nProcs(comm_)); boolList procValid(Pstream::nProcs(comm_));
procValid[Pstream::myProcNo(comm_)] = valid; procValid[Pstream::myProcNo(comm_)] = read;
Pstream::gatherList(procValid, Pstream::msgType(), comm_); Pstream::gatherList(procValid, Pstream::msgType(), comm_);
// Uniform in local comm // Uniform in local comm
bool uniform = uniformFile(filePaths); bool uniform = uniformFile(filePaths);
return read(io, comm_, uniform, filePaths, procValid); return this->read
(
io,
comm_,
uniform,
filePaths,
procValid
);
} }
} }
} }
@ -2199,7 +2213,7 @@ bool Foam::fileOperations::masterUncollatedFileOperation::writeObject
IOstream::streamFormat fmt, IOstream::streamFormat fmt,
IOstream::versionNumber ver, IOstream::versionNumber ver,
IOstream::compressionType cmp, IOstream::compressionType cmp,
const bool valid const bool write
) const ) const
{ {
fileName pathName(io.objectPath()); fileName pathName(io.objectPath());
@ -2207,7 +2221,7 @@ bool Foam::fileOperations::masterUncollatedFileOperation::writeObject
if (debug) if (debug)
{ {
Pout<< "masterUncollatedFileOperation::writeObject :" Pout<< "masterUncollatedFileOperation::writeObject :"
<< " io:" << pathName << " valid:" << valid << endl; << " io:" << pathName << " write:" << write << endl;
} }
// Make sure to pick up any new times // Make sure to pick up any new times
@ -2221,7 +2235,7 @@ bool Foam::fileOperations::masterUncollatedFileOperation::writeObject
fmt, fmt,
ver, ver,
cmp, cmp,
valid write
) )
); );
Ostream& os = osPtr(); Ostream& os = osPtr();
@ -2475,7 +2489,7 @@ Foam::fileOperations::masterUncollatedFileOperation::NewOFstream
IOstream::streamFormat fmt, IOstream::streamFormat fmt,
IOstream::versionNumber ver, IOstream::versionNumber ver,
IOstream::compressionType cmp, IOstream::compressionType cmp,
const bool valid const bool write
) const ) const
{ {
return autoPtr<Ostream> return autoPtr<Ostream>
@ -2487,7 +2501,7 @@ Foam::fileOperations::masterUncollatedFileOperation::NewOFstream
ver, ver,
cmp, cmp,
false, // append false, // append
valid write
) )
); );
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -478,7 +478,7 @@ protected:
const label comm, const label comm,
const bool uniform, // on comms master only const bool uniform, // on comms master only
const fileNameList& filePaths, // on comms master only const fileNameList& filePaths, // on comms master only
const boolList& procValid // on comms master only const boolList& read // on comms master only
); );
//- Helper: check IO for local existence. Like filePathInfo but //- Helper: check IO for local existence. Like filePathInfo but
@ -683,7 +683,7 @@ public:
regIOobject&, regIOobject&,
const fileName&, const fileName&,
const word& typeName, const word& typeName,
const bool valid = true const bool read = true
) const; ) const;
//- Top-level read //- Top-level read
@ -703,7 +703,7 @@ public:
IOstream::streamFormat format=IOstream::ASCII, IOstream::streamFormat format=IOstream::ASCII,
IOstream::versionNumber version=IOstream::currentVersion, IOstream::versionNumber version=IOstream::currentVersion,
IOstream::compressionType compression=IOstream::UNCOMPRESSED, IOstream::compressionType compression=IOstream::UNCOMPRESSED,
const bool valid = true const bool write = true
) const; ) const;
//- Generate an ISstream that reads a file //- Generate an ISstream that reads a file
@ -716,7 +716,7 @@ public:
IOstream::streamFormat format=IOstream::ASCII, IOstream::streamFormat format=IOstream::ASCII,
IOstream::versionNumber version=IOstream::currentVersion, IOstream::versionNumber version=IOstream::currentVersion,
IOstream::compressionType compression=IOstream::UNCOMPRESSED, IOstream::compressionType compression=IOstream::UNCOMPRESSED,
const bool valid = true const bool write = true
) const; ) const;

View File

@ -522,12 +522,12 @@ Foam::fileOperations::uncollatedFileOperation::readStream
regIOobject& io, regIOobject& io,
const fileName& fName, const fileName& fName,
const word& typeName, const word& typeName,
const bool valid const bool read
) const ) const
{ {
autoPtr<ISstream> isPtr; autoPtr<ISstream> isPtr;
if (!valid) if (!read)
{ {
isPtr = autoPtr<ISstream>(new dummyISstream()); isPtr = autoPtr<ISstream>(new dummyISstream());
return isPtr; return isPtr;
@ -704,7 +704,7 @@ Foam::fileOperations::uncollatedFileOperation::NewOFstream
IOstream::streamFormat fmt, IOstream::streamFormat fmt,
IOstream::versionNumber ver, IOstream::versionNumber ver,
IOstream::compressionType cmp, IOstream::compressionType cmp,
const bool valid const bool write
) const ) const
{ {
return autoPtr<Ostream>(new OFstream(pathName, fmt, ver, cmp)); return autoPtr<Ostream>(new OFstream(pathName, fmt, ver, cmp));

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -249,7 +249,7 @@ public:
regIOobject&, regIOobject&,
const fileName&, const fileName&,
const word& typeName, const word& typeName,
const bool procValid = true const bool read = true
) const; ) const;
//- Top-level read //- Top-level read
@ -271,7 +271,7 @@ public:
IOstream::streamFormat format=IOstream::ASCII, IOstream::streamFormat format=IOstream::ASCII,
IOstream::versionNumber version=IOstream::currentVersion, IOstream::versionNumber version=IOstream::currentVersion,
IOstream::compressionType compression=IOstream::UNCOMPRESSED, IOstream::compressionType compression=IOstream::UNCOMPRESSED,
const bool valid = true const bool write = true
) const; ) const;
}; };

View File

@ -1161,12 +1161,13 @@ bool Foam::polyBoundaryMesh::writeObject
IOstream::streamFormat fmt, IOstream::streamFormat fmt,
IOstream::versionNumber ver, IOstream::versionNumber ver,
IOstream::compressionType cmp, IOstream::compressionType cmp,
const bool valid const bool write
) const ) const
{ {
return regIOobject::writeObject(fmt, ver, IOstream::UNCOMPRESSED, valid); return regIOobject::writeObject(fmt, ver, IOstream::UNCOMPRESSED, write);
} }
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
const Foam::polyPatch& Foam::polyBoundaryMesh::operator[] const Foam::polyPatch& Foam::polyBoundaryMesh::operator[]

View File

@ -237,7 +237,7 @@ public:
IOstream::streamFormat fmt, IOstream::streamFormat fmt,
IOstream::versionNumber ver, IOstream::versionNumber ver,
IOstream::compressionType cmp, IOstream::compressionType cmp,
const bool valid const bool write = true
) const; ) const;

View File

@ -79,11 +79,11 @@ bool Foam::dynamicMotionSolverFvMesh::writeObject
IOstream::streamFormat fmt, IOstream::streamFormat fmt,
IOstream::versionNumber ver, IOstream::versionNumber ver,
IOstream::compressionType cmp, IOstream::compressionType cmp,
const bool valid const bool write
) const ) const
{ {
motionPtr_->write(); motionPtr_->write();
return fvMesh::writeObject(fmt, ver, cmp, valid); return fvMesh::writeObject(fmt, ver, cmp, write);
} }

View File

@ -104,7 +104,7 @@ public:
IOstream::streamFormat fmt, IOstream::streamFormat fmt,
IOstream::versionNumber ver, IOstream::versionNumber ver,
IOstream::compressionType cmp, IOstream::compressionType cmp,
const bool valid const bool write = true
) const; ) const;
}; };

View File

@ -1375,7 +1375,7 @@ bool Foam::dynamicRefineFvMesh::writeObject
IOstream::streamFormat fmt, IOstream::streamFormat fmt,
IOstream::versionNumber ver, IOstream::versionNumber ver,
IOstream::compressionType cmp, IOstream::compressionType cmp,
const bool valid const bool write
) const ) const
{ {
// Force refinement data to go to the current time directory. // Force refinement data to go to the current time directory.
@ -1383,8 +1383,8 @@ bool Foam::dynamicRefineFvMesh::writeObject
bool writeOk = bool writeOk =
( (
dynamicFvMesh::writeObject(fmt, ver, cmp, valid) dynamicFvMesh::writeObject(fmt, ver, cmp, write)
&& meshCutter_.write(valid) && meshCutter_.write(write)
); );
if (dumpLevel_) if (dumpLevel_)

View File

@ -242,7 +242,7 @@ public:
IOstream::streamFormat fmt, IOstream::streamFormat fmt,
IOstream::versionNumber ver, IOstream::versionNumber ver,
IOstream::compressionType cmp, IOstream::compressionType cmp,
const bool valid const bool write = true
) const; ) const;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -5743,17 +5743,16 @@ void Foam::hexRef8::setUnrefinement
} }
// Write refinement to polyMesh directory. bool Foam::hexRef8::write(const bool write) const
bool Foam::hexRef8::write(const bool valid) const
{ {
bool writeOk = bool writeOk =
cellLevel_.write(valid) cellLevel_.write(write)
&& pointLevel_.write(valid) && pointLevel_.write(write)
&& level0Edge_.write(valid); && level0Edge_.write(write);
if (history_.active()) if (history_.active())
{ {
writeOk = writeOk && history_.write(valid); writeOk = writeOk && history_.write(write);
} }
return writeOk; return writeOk;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -566,7 +566,7 @@ public:
void setInstance(const fileName& inst); void setInstance(const fileName& inst);
//- Force writing refinement+history to polyMesh directory. //- Force writing refinement+history to polyMesh directory.
bool write(const bool valid = true) const; bool write(const bool write = true) const;
}; };

View File

@ -1005,28 +1005,28 @@ bool Foam::fvMesh::writeObject
IOstream::streamFormat fmt, IOstream::streamFormat fmt,
IOstream::versionNumber ver, IOstream::versionNumber ver,
IOstream::compressionType cmp, IOstream::compressionType cmp,
const bool valid const bool write
) const ) const
{ {
bool ok = true; bool ok = true;
if (phiPtr_) if (phiPtr_)
{ {
ok = phiPtr_->write(valid); ok = phiPtr_->write(write);
} }
// Write V0 only if V00 exists // Write V0 only if V00 exists
if (V00Ptr_) if (V00Ptr_)
{ {
ok = ok && V0Ptr_->write(valid); ok = ok && V0Ptr_->write(write);
} }
return ok && polyMesh::writeObject(fmt, ver, cmp, valid); return ok && polyMesh::writeObject(fmt, ver, cmp, write);
} }
bool Foam::fvMesh::write(const bool valid) const bool Foam::fvMesh::write(const bool write) const
{ {
return polyMesh::write(valid); return polyMesh::write(write);
} }

View File

@ -383,11 +383,11 @@ public:
IOstream::streamFormat fmt, IOstream::streamFormat fmt,
IOstream::versionNumber ver, IOstream::versionNumber ver,
IOstream::compressionType cmp, IOstream::compressionType cmp,
const bool valid const bool write = true
) const; ) const;
//- Write mesh using IO settings from time //- Write mesh using IO settings from time
virtual bool write(const bool valid = true) const; virtual bool write(const bool write = true) const;
// Member Operators // Member Operators

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -260,7 +260,7 @@ public:
IOstream::streamFormat fmt, IOstream::streamFormat fmt,
IOstream::versionNumber ver, IOstream::versionNumber ver,
IOstream::compressionType cmp, IOstream::compressionType cmp,
const bool valid const bool write = true
) const; ) const;
//- Write positions to \<cloudName\>_positions.obj file //- Write positions to \<cloudName\>_positions.obj file

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -48,7 +48,7 @@ Foam::IOPosition<CloudType>::IOPosition(const CloudType& c)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType> template<class CloudType>
bool Foam::IOPosition<CloudType>::write(const bool valid) const bool Foam::IOPosition<CloudType>::write(const bool write) const
{ {
return regIOobject::write(cloud_.size()); return regIOobject::write(cloud_.size());
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -82,7 +82,7 @@ public:
virtual void readData(Istream&, CloudType&); virtual void readData(Istream&, CloudType&);
virtual bool write(const bool valid = true) const; virtual bool write(const bool write = true) const;
virtual bool writeData(Ostream& os) const; virtual bool writeData(Ostream& os) const;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -86,31 +86,31 @@ template<class ParcelType>
template<class CloudType> template<class CloudType>
void Foam::CollidingParcel<ParcelType>::readFields(CloudType& c) void Foam::CollidingParcel<ParcelType>::readFields(CloudType& c)
{ {
bool valid = c.size(); bool write = c.size();
ParcelType::readFields(c); ParcelType::readFields(c);
IOField<vector> f(c.fieldIOobject("f", IOobject::MUST_READ), valid); IOField<vector> f(c.fieldIOobject("f", IOobject::MUST_READ), write);
c.checkFieldIOobject(c, f); c.checkFieldIOobject(c, f);
IOField<vector> angularMomentum IOField<vector> angularMomentum
( (
c.fieldIOobject("angularMomentum", IOobject::MUST_READ), c.fieldIOobject("angularMomentum", IOobject::MUST_READ),
valid write
); );
c.checkFieldIOobject(c, angularMomentum); c.checkFieldIOobject(c, angularMomentum);
IOField<vector> torque IOField<vector> torque
( (
c.fieldIOobject("torque", IOobject::MUST_READ), c.fieldIOobject("torque", IOobject::MUST_READ),
valid write
); );
c.checkFieldIOobject(c, torque); c.checkFieldIOobject(c, torque);
labelFieldCompactIOField collisionRecordsPairAccessed labelFieldCompactIOField collisionRecordsPairAccessed
( (
c.fieldIOobject("collisionRecordsPairAccessed", IOobject::MUST_READ), c.fieldIOobject("collisionRecordsPairAccessed", IOobject::MUST_READ),
valid write
); );
c.checkFieldFieldIOobject(c, collisionRecordsPairAccessed); c.checkFieldFieldIOobject(c, collisionRecordsPairAccessed);
@ -121,7 +121,7 @@ void Foam::CollidingParcel<ParcelType>::readFields(CloudType& c)
"collisionRecordsPairOrigProcOfOther", "collisionRecordsPairOrigProcOfOther",
IOobject::MUST_READ IOobject::MUST_READ
), ),
valid write
); );
c.checkFieldFieldIOobject(c, collisionRecordsPairOrigProcOfOther); c.checkFieldFieldIOobject(c, collisionRecordsPairOrigProcOfOther);
@ -132,35 +132,35 @@ void Foam::CollidingParcel<ParcelType>::readFields(CloudType& c)
"collisionRecordsPairOrigIdOfOther", "collisionRecordsPairOrigIdOfOther",
IOobject::MUST_READ IOobject::MUST_READ
), ),
valid write
); );
c.checkFieldFieldIOobject(c, collisionRecordsPairOrigProcOfOther); c.checkFieldFieldIOobject(c, collisionRecordsPairOrigProcOfOther);
pairDataFieldCompactIOField collisionRecordsPairData pairDataFieldCompactIOField collisionRecordsPairData
( (
c.fieldIOobject("collisionRecordsPairData", IOobject::MUST_READ), c.fieldIOobject("collisionRecordsPairData", IOobject::MUST_READ),
valid write
); );
c.checkFieldFieldIOobject(c, collisionRecordsPairData); c.checkFieldFieldIOobject(c, collisionRecordsPairData);
labelFieldCompactIOField collisionRecordsWallAccessed labelFieldCompactIOField collisionRecordsWallAccessed
( (
c.fieldIOobject("collisionRecordsWallAccessed", IOobject::MUST_READ), c.fieldIOobject("collisionRecordsWallAccessed", IOobject::MUST_READ),
valid write
); );
c.checkFieldFieldIOobject(c, collisionRecordsWallAccessed); c.checkFieldFieldIOobject(c, collisionRecordsWallAccessed);
vectorFieldCompactIOField collisionRecordsWallPRel vectorFieldCompactIOField collisionRecordsWallPRel
( (
c.fieldIOobject("collisionRecordsWallPRel", IOobject::MUST_READ), c.fieldIOobject("collisionRecordsWallPRel", IOobject::MUST_READ),
valid write
); );
c.checkFieldFieldIOobject(c, collisionRecordsWallPRel); c.checkFieldFieldIOobject(c, collisionRecordsWallPRel);
wallDataFieldCompactIOField collisionRecordsWallData wallDataFieldCompactIOField collisionRecordsWallData
( (
c.fieldIOobject("collisionRecordsWallData", IOobject::MUST_READ), c.fieldIOobject("collisionRecordsWallData", IOobject::MUST_READ),
valid write
); );
c.checkFieldFieldIOobject(c, collisionRecordsWallData); c.checkFieldFieldIOobject(c, collisionRecordsWallData);
@ -269,19 +269,19 @@ void Foam::CollidingParcel<ParcelType>::writeFields(const CloudType& c)
i++; i++;
} }
const bool valid = (np > 0); const bool write = (np > 0);
f.write(valid); f.write(write);
angularMomentum.write(valid); angularMomentum.write(write);
torque.write(valid); torque.write(write);
collisionRecordsPairAccessed.write(valid); collisionRecordsPairAccessed.write(write);
collisionRecordsPairOrigProcOfOther.write(valid); collisionRecordsPairOrigProcOfOther.write(write);
collisionRecordsPairOrigIdOfOther.write(valid); collisionRecordsPairOrigIdOfOther.write(write);
collisionRecordsPairData.write(valid); collisionRecordsPairData.write(write);
collisionRecordsWallAccessed.write(valid); collisionRecordsWallAccessed.write(write);
collisionRecordsWallPRel.write(valid); collisionRecordsWallPRel.write(write);
collisionRecordsWallData.write(valid); collisionRecordsWallData.write(write);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -98,77 +98,77 @@ template<class ParcelType>
template<class CloudType> template<class CloudType>
void Foam::KinematicParcel<ParcelType>::readFields(CloudType& c) void Foam::KinematicParcel<ParcelType>::readFields(CloudType& c)
{ {
bool valid = c.size(); bool write = c.size();
ParcelType::readFields(c); ParcelType::readFields(c);
IOField<label> active IOField<label> active
( (
c.fieldIOobject("active", IOobject::MUST_READ), c.fieldIOobject("active", IOobject::MUST_READ),
valid write
); );
c.checkFieldIOobject(c, active); c.checkFieldIOobject(c, active);
IOField<label> typeId IOField<label> typeId
( (
c.fieldIOobject("typeId", IOobject::MUST_READ), c.fieldIOobject("typeId", IOobject::MUST_READ),
valid write
); );
c.checkFieldIOobject(c, typeId); c.checkFieldIOobject(c, typeId);
IOField<scalar> nParticle IOField<scalar> nParticle
( (
c.fieldIOobject("nParticle", IOobject::MUST_READ), c.fieldIOobject("nParticle", IOobject::MUST_READ),
valid write
); );
c.checkFieldIOobject(c, nParticle); c.checkFieldIOobject(c, nParticle);
IOField<scalar> d IOField<scalar> d
( (
c.fieldIOobject("d", IOobject::MUST_READ), c.fieldIOobject("d", IOobject::MUST_READ),
valid write
); );
c.checkFieldIOobject(c, d); c.checkFieldIOobject(c, d);
IOField<scalar> dTarget IOField<scalar> dTarget
( (
c.fieldIOobject("dTarget", IOobject::MUST_READ), c.fieldIOobject("dTarget", IOobject::MUST_READ),
valid write
); );
c.checkFieldIOobject(c, dTarget); c.checkFieldIOobject(c, dTarget);
IOField<vector> U IOField<vector> U
( (
c.fieldIOobject("U", IOobject::MUST_READ), c.fieldIOobject("U", IOobject::MUST_READ),
valid write
); );
c.checkFieldIOobject(c, U); c.checkFieldIOobject(c, U);
IOField<scalar> rho IOField<scalar> rho
( (
c.fieldIOobject("rho", IOobject::MUST_READ), c.fieldIOobject("rho", IOobject::MUST_READ),
valid write
); );
c.checkFieldIOobject(c, rho); c.checkFieldIOobject(c, rho);
IOField<scalar> age IOField<scalar> age
( (
c.fieldIOobject("age", IOobject::MUST_READ), c.fieldIOobject("age", IOobject::MUST_READ),
valid write
); );
c.checkFieldIOobject(c, age); c.checkFieldIOobject(c, age);
IOField<scalar> tTurb IOField<scalar> tTurb
( (
c.fieldIOobject("tTurb", IOobject::MUST_READ), c.fieldIOobject("tTurb", IOobject::MUST_READ),
valid write
); );
c.checkFieldIOobject(c, tTurb); c.checkFieldIOobject(c, tTurb);
IOField<vector> UTurb IOField<vector> UTurb
( (
c.fieldIOobject("UTurb", IOobject::MUST_READ), c.fieldIOobject("UTurb", IOobject::MUST_READ),
valid write
); );
c.checkFieldIOobject(c, UTurb); c.checkFieldIOobject(c, UTurb);
@ -237,18 +237,18 @@ void Foam::KinematicParcel<ParcelType>::writeFields(const CloudType& c)
i++; i++;
} }
const bool valid = np > 0; const bool write = np > 0;
active.write(valid); active.write(write);
typeId.write(valid); typeId.write(write);
nParticle.write(valid); nParticle.write(write);
d.write(valid); d.write(write);
dTarget.write(valid); dTarget.write(write);
U.write(valid); U.write(write);
rho.write(valid); rho.write(write);
age.write(valid); age.write(write);
tTurb.write(valid); tTurb.write(write);
UTurb.write(valid); UTurb.write(write);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -142,7 +142,7 @@ bool Foam::AveragingMethod<Type>::writeData(Ostream& os) const
template<class Type> template<class Type>
bool Foam::AveragingMethod<Type>::write(const bool valid) const bool Foam::AveragingMethod<Type>::write(const bool write) const
{ {
const pointMesh pointMesh_(mesh_); const pointMesh pointMesh_(mesh_);
@ -238,10 +238,10 @@ bool Foam::AveragingMethod<Type>::write(const bool valid) const
pointGrad.primitiveFieldRef() /= pointVolume; pointGrad.primitiveFieldRef() /= pointVolume;
// write // write
if (!cellValue.write(valid)) return false; if (!cellValue.write(write)) return false;
if (!cellGrad.write(valid)) return false; if (!cellGrad.write(write)) return false;
if (!pointValue.write(valid)) return false; if (!pointValue.write(write)) return false;
if (!pointGrad.write(valid)) return false; if (!pointGrad.write(write)) return false;
return true; return true;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -162,7 +162,7 @@ public:
virtual bool writeData(Ostream&) const; virtual bool writeData(Ostream&) const;
//- Write using setting from DB //- Write using setting from DB
virtual bool write(const bool valid = true) const; virtual bool write(const bool write = true) const;
//- Return an internal field of the average //- Return an internal field of the average
virtual tmp<Field<Type>> primitiveField() const = 0; virtual tmp<Field<Type>> primitiveField() const = 0;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -93,40 +93,40 @@ Foam::molecule::molecule
void Foam::molecule::readFields(Cloud<molecule>& mC) void Foam::molecule::readFields(Cloud<molecule>& mC)
{ {
bool valid = mC.size(); bool write = mC.size();
particle::readFields(mC); particle::readFields(mC);
IOField<tensor> Q(mC.fieldIOobject("Q", IOobject::MUST_READ), valid); IOField<tensor> Q(mC.fieldIOobject("Q", IOobject::MUST_READ), write);
mC.checkFieldIOobject(mC, Q); mC.checkFieldIOobject(mC, Q);
IOField<vector> v(mC.fieldIOobject("v", IOobject::MUST_READ), valid); IOField<vector> v(mC.fieldIOobject("v", IOobject::MUST_READ), write);
mC.checkFieldIOobject(mC, v); mC.checkFieldIOobject(mC, v);
IOField<vector> a(mC.fieldIOobject("a", IOobject::MUST_READ), valid); IOField<vector> a(mC.fieldIOobject("a", IOobject::MUST_READ), write);
mC.checkFieldIOobject(mC, a); mC.checkFieldIOobject(mC, a);
IOField<vector> pi(mC.fieldIOobject("pi", IOobject::MUST_READ), valid); IOField<vector> pi(mC.fieldIOobject("pi", IOobject::MUST_READ), write);
mC.checkFieldIOobject(mC, pi); mC.checkFieldIOobject(mC, pi);
IOField<vector> tau(mC.fieldIOobject("tau", IOobject::MUST_READ), valid); IOField<vector> tau(mC.fieldIOobject("tau", IOobject::MUST_READ), write);
mC.checkFieldIOobject(mC, tau); mC.checkFieldIOobject(mC, tau);
IOField<vector> specialPosition IOField<vector> specialPosition
( (
mC.fieldIOobject("specialPosition", IOobject::MUST_READ), mC.fieldIOobject("specialPosition", IOobject::MUST_READ),
valid write
); );
mC.checkFieldIOobject(mC, specialPosition); mC.checkFieldIOobject(mC, specialPosition);
IOField<label> special IOField<label> special
( (
mC.fieldIOobject("special", IOobject::MUST_READ), mC.fieldIOobject("special", IOobject::MUST_READ),
valid write
); );
mC.checkFieldIOobject(mC, special); mC.checkFieldIOobject(mC, special);
IOField<label> id(mC.fieldIOobject("id", IOobject::MUST_READ), valid); IOField<label> id(mC.fieldIOobject("id", IOobject::MUST_READ), write);
mC.checkFieldIOobject(mC, id); mC.checkFieldIOobject(mC, id);
label i = 0; label i = 0;
@ -222,23 +222,23 @@ void Foam::molecule::writeFields(const Cloud<molecule>& mC)
i++; i++;
} }
const bool valid = np > 0; const bool write = np > 0;
Q.write(valid); Q.write(write);
v.write(valid); v.write(write);
a.write(valid); a.write(write);
pi.write(valid); pi.write(write);
tau.write(valid); tau.write(write);
specialPosition.write(valid); specialPosition.write(write);
special.write(valid); special.write(write);
id.write(valid); id.write(write);
piGlobal.write(valid); piGlobal.write(write);
tauGlobal.write(valid); tauGlobal.write(write);
orientation1.write(valid); orientation1.write(write);
orientation2.write(valid); orientation2.write(write);
orientation3.write(valid); orientation3.write(write);
Info<< "writeFields " << mC.name() << endl; Info<< "writeFields " << mC.name() << endl;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -113,86 +113,86 @@ void Foam::SprayParcel<ParcelType>::readFields
const CompositionType& compModel const CompositionType& compModel
) )
{ {
bool valid = c.size(); bool write = c.size();
ParcelType::readFields(c, compModel); ParcelType::readFields(c, compModel);
IOField<scalar> d0(c.fieldIOobject("d0", IOobject::MUST_READ), valid); IOField<scalar> d0(c.fieldIOobject("d0", IOobject::MUST_READ), write);
c.checkFieldIOobject(c, d0); c.checkFieldIOobject(c, d0);
IOField<vector> position0 IOField<vector> position0
( (
c.fieldIOobject("position0", IOobject::MUST_READ), c.fieldIOobject("position0", IOobject::MUST_READ),
valid write
); );
c.checkFieldIOobject(c, position0); c.checkFieldIOobject(c, position0);
IOField<scalar> sigma(c.fieldIOobject("sigma", IOobject::MUST_READ), valid); IOField<scalar> sigma(c.fieldIOobject("sigma", IOobject::MUST_READ), write);
c.checkFieldIOobject(c, sigma); c.checkFieldIOobject(c, sigma);
IOField<scalar> mu(c.fieldIOobject("mu", IOobject::MUST_READ), valid); IOField<scalar> mu(c.fieldIOobject("mu", IOobject::MUST_READ), write);
c.checkFieldIOobject(c, mu); c.checkFieldIOobject(c, mu);
IOField<scalar> liquidCore IOField<scalar> liquidCore
( (
c.fieldIOobject("liquidCore", IOobject::MUST_READ), c.fieldIOobject("liquidCore", IOobject::MUST_READ),
valid write
); );
c.checkFieldIOobject(c, liquidCore); c.checkFieldIOobject(c, liquidCore);
IOField<scalar> KHindex IOField<scalar> KHindex
( (
c.fieldIOobject("KHindex", IOobject::MUST_READ), c.fieldIOobject("KHindex", IOobject::MUST_READ),
valid write
); );
c.checkFieldIOobject(c, KHindex); c.checkFieldIOobject(c, KHindex);
IOField<scalar> y IOField<scalar> y
( (
c.fieldIOobject("y", IOobject::MUST_READ), c.fieldIOobject("y", IOobject::MUST_READ),
valid write
); );
c.checkFieldIOobject(c, y); c.checkFieldIOobject(c, y);
IOField<scalar> yDot IOField<scalar> yDot
( (
c.fieldIOobject("yDot", IOobject::MUST_READ), c.fieldIOobject("yDot", IOobject::MUST_READ),
valid write
); );
c.checkFieldIOobject(c, yDot); c.checkFieldIOobject(c, yDot);
IOField<scalar> tc IOField<scalar> tc
( (
c.fieldIOobject("tc", IOobject::MUST_READ), c.fieldIOobject("tc", IOobject::MUST_READ),
valid write
); );
c.checkFieldIOobject(c, tc); c.checkFieldIOobject(c, tc);
IOField<scalar> ms IOField<scalar> ms
( (
c.fieldIOobject("ms", IOobject::MUST_READ), c.fieldIOobject("ms", IOobject::MUST_READ),
valid write
); );
c.checkFieldIOobject(c, ms); c.checkFieldIOobject(c, ms);
IOField<scalar> injector IOField<scalar> injector
( (
c.fieldIOobject("injector", IOobject::MUST_READ), c.fieldIOobject("injector", IOobject::MUST_READ),
valid write
); );
c.checkFieldIOobject(c, injector); c.checkFieldIOobject(c, injector);
IOField<scalar> tMom IOField<scalar> tMom
( (
c.fieldIOobject("tMom", IOobject::MUST_READ), c.fieldIOobject("tMom", IOobject::MUST_READ),
valid write
); );
c.checkFieldIOobject(c, tMom); c.checkFieldIOobject(c, tMom);
IOField<scalar> user IOField<scalar> user
( (
c.fieldIOobject("user", IOobject::MUST_READ), c.fieldIOobject("user", IOobject::MUST_READ),
valid write
); );
c.checkFieldIOobject(c, user); c.checkFieldIOobject(c, user);
@ -284,21 +284,21 @@ void Foam::SprayParcel<ParcelType>::writeFields
i++; i++;
} }
const bool valid = np > 0; const bool write = np > 0;
d0.write(valid); d0.write(write);
position0.write(valid); position0.write(write);
sigma.write(valid); sigma.write(write);
mu.write(valid); mu.write(write);
liquidCore.write(valid); liquidCore.write(write);
KHindex.write(valid); KHindex.write(write);
y.write(valid); y.write(write);
yDot.write(valid); yDot.write(write);
tc.write(valid); tc.write(write);
ms.write(valid); ms.write(write);
injector.write(valid); injector.write(write);
tMom.write(valid); tMom.write(write);
user.write(valid); user.write(write);
} }

View File

@ -876,7 +876,7 @@ bool Foam::triSurfaceMesh::writeObject
IOstream::streamFormat fmt, IOstream::streamFormat fmt,
IOstream::versionNumber ver, IOstream::versionNumber ver,
IOstream::compressionType cmp, IOstream::compressionType cmp,
const bool valid const bool write
) const ) const
{ {
fileName fullPath; fileName fullPath;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -347,7 +347,7 @@ public:
IOstream::streamFormat fmt, IOstream::streamFormat fmt,
IOstream::versionNumber ver, IOstream::versionNumber ver,
IOstream::compressionType cmp, IOstream::compressionType cmp,
const bool valid const bool write = true
) const; ) const;
//- Is object global //- Is object global

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -249,13 +249,13 @@ bool cellZoneSet::writeObject
IOstream::streamFormat s, IOstream::streamFormat s,
IOstream::versionNumber v, IOstream::versionNumber v,
IOstream::compressionType c, IOstream::compressionType c,
const bool valid const bool write
) const ) const
{ {
// Write shadow cellSet // Write shadow cellSet
word oldTypeName = typeName; word oldTypeName = typeName;
const_cast<word&>(type()) = cellSet::typeName; const_cast<word&>(type()) = cellSet::typeName;
bool ok = cellSet::writeObject(s, v, c, valid); bool ok = cellSet::writeObject(s, v, c, write);
const_cast<word&>(type()) = oldTypeName; const_cast<word&>(type()) = oldTypeName;
// Modify cellZone // Modify cellZone
@ -285,7 +285,7 @@ bool cellZoneSet::writeObject
} }
cellZones.clearAddressing(); cellZones.clearAddressing();
return ok && cellZones.write(valid); return ok && cellZones.write(write);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -143,7 +143,7 @@ public:
IOstream::streamFormat, IOstream::streamFormat,
IOstream::versionNumber, IOstream::versionNumber,
IOstream::compressionType, IOstream::compressionType,
const bool valid const bool write = true
) const; ) const;
//- Update any stored data for new labels //- Update any stored data for new labels

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -464,13 +464,13 @@ bool faceZoneSet::writeObject
IOstream::streamFormat s, IOstream::streamFormat s,
IOstream::versionNumber v, IOstream::versionNumber v,
IOstream::compressionType c, IOstream::compressionType c,
const bool valid const bool write
) const ) const
{ {
// Write shadow faceSet // Write shadow faceSet
word oldTypeName = typeName; word oldTypeName = typeName;
const_cast<word&>(type()) = faceSet::typeName; const_cast<word&>(type()) = faceSet::typeName;
bool ok = faceSet::writeObject(s, v, c, valid); bool ok = faceSet::writeObject(s, v, c, write);
const_cast<word&>(type()) = oldTypeName; const_cast<word&>(type()) = oldTypeName;
// Modify faceZone // Modify faceZone
@ -501,7 +501,7 @@ bool faceZoneSet::writeObject
} }
faceZones.clearAddressing(); faceZones.clearAddressing();
return ok && faceZones.write(valid); return ok && faceZones.write(write);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -160,7 +160,7 @@ public:
IOstream::streamFormat, IOstream::streamFormat,
IOstream::versionNumber, IOstream::versionNumber,
IOstream::compressionType, IOstream::compressionType,
const bool valid const bool write = true
) const; ) const;
//- Update any stored data for new labels //- Update any stored data for new labels

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -250,13 +250,13 @@ bool pointZoneSet::writeObject
IOstream::streamFormat s, IOstream::streamFormat s,
IOstream::versionNumber v, IOstream::versionNumber v,
IOstream::compressionType c, IOstream::compressionType c,
const bool valid const bool write
) const ) const
{ {
// Write shadow pointSet // Write shadow pointSet
word oldTypeName = typeName; word oldTypeName = typeName;
const_cast<word&>(type()) = pointSet::typeName; const_cast<word&>(type()) = pointSet::typeName;
bool ok = pointSet::writeObject(s, v, c, valid); bool ok = pointSet::writeObject(s, v, c, write);
const_cast<word&>(type()) = oldTypeName; const_cast<word&>(type()) = oldTypeName;
// Modify pointZone // Modify pointZone
@ -286,7 +286,7 @@ bool pointZoneSet::writeObject
} }
pointZones.clearAddressing(); pointZones.clearAddressing();
return ok && pointZones.write(valid); return ok && pointZones.write(write);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -147,7 +147,7 @@ public:
IOstream::streamFormat, IOstream::streamFormat,
IOstream::versionNumber, IOstream::versionNumber,
IOstream::compressionType, IOstream::compressionType,
const bool valid const bool write = true
) const; ) const;
//- Update any stored data for new labels //- Update any stored data for new labels

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -2377,7 +2377,7 @@ bool Foam::distributedTriSurfaceMesh::writeObject
IOstream::streamFormat fmt, IOstream::streamFormat fmt,
IOstream::versionNumber ver, IOstream::versionNumber ver,
IOstream::compressionType cmp, IOstream::compressionType cmp,
const bool valid const bool write
) const ) const
{ {
// Make sure dictionary goes to same directory as surface // Make sure dictionary goes to same directory as surface

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -455,7 +455,7 @@ public:
IOstream::streamFormat fmt, IOstream::streamFormat fmt,
IOstream::versionNumber ver, IOstream::versionNumber ver,
IOstream::compressionType cmp, IOstream::compressionType cmp,
const bool valid const bool write = true
) const; ) const;
//- Is object global //- Is object global

View File

@ -264,7 +264,7 @@ bool Foam::sixDoFRigidBodyMotionSolver::writeObject
IOstream::streamFormat fmt, IOstream::streamFormat fmt,
IOstream::versionNumber ver, IOstream::versionNumber ver,
IOstream::compressionType cmp, IOstream::compressionType cmp,
const bool valid const bool write
) const ) const
{ {
IOdictionary dict IOdictionary dict

View File

@ -139,7 +139,7 @@ public:
IOstream::streamFormat fmt, IOstream::streamFormat fmt,
IOstream::versionNumber ver, IOstream::versionNumber ver,
IOstream::compressionType cmp, IOstream::compressionType cmp,
const bool valid const bool write = true
) const; ) const;
}; };