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

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -29,11 +29,11 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
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)
{
@ -82,19 +82,19 @@ template<class T, class BaseType>
Foam::CompactIOField<T, BaseType>::CompactIOField
(
const IOobject& io,
const bool valid
const bool read
)
:
regIOobject(io)
{
if (io.readOpt() == IOobject::MUST_READ)
{
readFromStream(valid);
readFromStream(read);
}
else if (io.readOpt() == IOobject::READ_IF_PRESENT)
{
bool haveFile = headerOk();
readFromStream(valid && haveFile);
readFromStream(read && haveFile);
}
}
@ -185,7 +185,7 @@ bool Foam::CompactIOField<T, BaseType>::writeObject
IOstream::streamFormat fmt,
IOstream::versionNumber ver,
IOstream::compressionType cmp,
const bool valid
const bool write
) const
{
if (fmt == IOstream::ASCII)
@ -195,7 +195,7 @@ bool Foam::CompactIOField<T, BaseType>::writeObject
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
const_cast<word&>(typeName) = oldTypeName;
@ -204,7 +204,7 @@ bool Foam::CompactIOField<T, BaseType>::writeObject
}
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
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -75,7 +75,7 @@ class CompactIOField
// Private Member Functions
//- Read according to header type
void readFromStream(const bool valid = true);
void readFromStream(const bool read = true);
public:
@ -89,7 +89,7 @@ public:
CompactIOField(const IOobject&);
//- 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
CompactIOField(const IOobject&, const label);
@ -113,7 +113,7 @@ public:
IOstream::streamFormat,
IOstream::versionNumber,
IOstream::compressionType,
const bool valid
const bool write
) const;
virtual bool writeData(Ostream&) const;

View File

@ -161,7 +161,7 @@ bool Foam::CompactIOList<T, BaseType>::writeObject
IOstream::streamFormat fmt,
IOstream::versionNumber ver,
IOstream::compressionType cmp,
const bool valid
const bool write
) const
{
if (fmt == IOstream::ASCII)
@ -171,7 +171,7 @@ bool Foam::CompactIOList<T, BaseType>::writeObject
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
const_cast<word&>(typeName) = oldTypeName;
@ -190,7 +190,7 @@ bool Foam::CompactIOList<T, BaseType>::writeObject
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
const_cast<word&>(typeName) = oldTypeName;
@ -199,7 +199,7 @@ bool Foam::CompactIOList<T, BaseType>::writeObject
}
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::versionNumber,
IOstream::compressionType,
const bool valid
const bool write
) const;
virtual bool writeData(Ostream&) const;

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -65,7 +65,7 @@ public:
IOField(const IOobject&);
//- 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)
IOField(const IOobject&, const label size);

View File

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

View File

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

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -59,7 +59,7 @@ class masterOFstream
const bool append_;
//- Should file be written
const bool valid_;
const bool write_;
// Private Member Functions
@ -80,7 +80,7 @@ public:
versionNumber version=currentVersion,
compressionType compression=UNCOMPRESSED,
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
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -364,7 +364,7 @@ public:
IOstream::streamFormat,
IOstream::versionNumber,
IOstream::compressionType,
const bool valid
const bool write
) const;
//- 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
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -543,7 +543,7 @@ bool Foam::Time::writeObject
IOstream::streamFormat fmt,
IOstream::versionNumber ver,
IOstream::compressionType cmp,
const bool valid
const bool write
) const
{
if (writeTime())
@ -552,7 +552,7 @@ bool Foam::Time::writeObject
if (writeOK)
{
writeOK = objectRegistry::writeObject(fmt, ver, cmp, valid);
writeOK = objectRegistry::writeObject(fmt, ver, cmp, write);
}
if (writeOK)

View File

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

View File

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

View File

@ -91,7 +91,7 @@ private:
// Private Member Functions
//- Return Istream
Istream& readStream(const bool valid = true);
Istream& readStream(const bool read = true);
//- Dissallow assignment
void operator=(const regIOobject&);
@ -226,7 +226,7 @@ public:
bool headerOk();
//- 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
void close();
@ -273,11 +273,11 @@ public:
IOstream::streamFormat,
IOstream::versionNumber,
IOstream::compressionType,
const bool valid
const bool write
) const;
//- Write using setting from DB
virtual bool write(const bool valid = true) const;
virtual bool write(const bool write = true) const;
// Member operators

View File

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

View File

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

View File

@ -453,7 +453,7 @@ bool Foam::fileOperations::collatedFileOperation::writeObject
IOstream::streamFormat fmt,
IOstream::versionNumber ver,
IOstream::compressionType cmp,
const bool valid
const bool write
) const
{
const Time& tm = io.time();
@ -479,7 +479,7 @@ bool Foam::fileOperations::collatedFileOperation::writeObject
ver,
cmp,
false,
valid
write
);
// If any of these fail, return (leave error handling to Ostream class)
@ -525,7 +525,7 @@ bool Foam::fileOperations::collatedFileOperation::writeObject
ver,
cmp,
false,
valid
write
);
// 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
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -150,7 +150,7 @@ public:
IOstream::streamFormat format=IOstream::ASCII,
IOstream::versionNumber version=IOstream::currentVersion,
IOstream::compressionType compression=IOstream::UNCOMPRESSED,
const bool valid = true
const bool write = true
) const;
// Other

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -363,7 +363,7 @@ public:
regIOobject&,
const fileName&,
const word& typeName,
const bool valid = true
const bool read = true
) const = 0;
//- Top-level read
@ -377,7 +377,7 @@ public:
//- Writes a regIOobject (so header, contents and divider).
// 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
// suppress empty local lagrangian data)
virtual bool writeObject
@ -386,7 +386,7 @@ public:
IOstream::streamFormat format=IOstream::ASCII,
IOstream::versionNumber version=IOstream::currentVersion,
IOstream::compressionType compression=IOstream::UNCOMPRESSED,
const bool valid = true
const bool write = true
) const;
@ -406,7 +406,7 @@ public:
IOstream::streamFormat format=IOstream::ASCII,
IOstream::versionNumber version=IOstream::currentVersion,
IOstream::compressionType compression=IOstream::UNCOMPRESSED,
const bool valid = true
const bool write = true
) const = 0;

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -478,7 +478,7 @@ protected:
const label comm,
const bool uniform, // 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
@ -683,7 +683,7 @@ public:
regIOobject&,
const fileName&,
const word& typeName,
const bool valid = true
const bool read = true
) const;
//- Top-level read
@ -703,7 +703,7 @@ public:
IOstream::streamFormat format=IOstream::ASCII,
IOstream::versionNumber version=IOstream::currentVersion,
IOstream::compressionType compression=IOstream::UNCOMPRESSED,
const bool valid = true
const bool write = true
) const;
//- Generate an ISstream that reads a file
@ -716,7 +716,7 @@ public:
IOstream::streamFormat format=IOstream::ASCII,
IOstream::versionNumber version=IOstream::currentVersion,
IOstream::compressionType compression=IOstream::UNCOMPRESSED,
const bool valid = true
const bool write = true
) const;

View File

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

View File

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

View File

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

View File

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

View File

@ -79,11 +79,11 @@ bool Foam::dynamicMotionSolverFvMesh::writeObject
IOstream::streamFormat fmt,
IOstream::versionNumber ver,
IOstream::compressionType cmp,
const bool valid
const bool write
) const
{
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::versionNumber ver,
IOstream::compressionType cmp,
const bool valid
const bool write = true
) const;
};

View File

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

View File

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

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -566,7 +566,7 @@ public:
void setInstance(const fileName& inst);
//- 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::versionNumber ver,
IOstream::compressionType cmp,
const bool valid
const bool write
) const
{
bool ok = true;
if (phiPtr_)
{
ok = phiPtr_->write(valid);
ok = phiPtr_->write(write);
}
// Write V0 only if V00 exists
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::versionNumber ver,
IOstream::compressionType cmp,
const bool valid
const bool write = true
) const;
//- 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

View File

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

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -82,7 +82,7 @@ public:
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;
};

View File

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

View File

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

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -162,7 +162,7 @@ public:
virtual bool writeData(Ostream&) const;
//- 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
virtual tmp<Field<Type>> primitiveField() const = 0;

View File

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

View File

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

View File

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

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -249,13 +249,13 @@ bool cellZoneSet::writeObject
IOstream::streamFormat s,
IOstream::versionNumber v,
IOstream::compressionType c,
const bool valid
const bool write
) const
{
// Write shadow cellSet
word oldTypeName = 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;
// Modify cellZone
@ -285,7 +285,7 @@ bool cellZoneSet::writeObject
}
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
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -143,7 +143,7 @@ public:
IOstream::streamFormat,
IOstream::versionNumber,
IOstream::compressionType,
const bool valid
const bool write = true
) const;
//- Update any stored data for new labels

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -464,13 +464,13 @@ bool faceZoneSet::writeObject
IOstream::streamFormat s,
IOstream::versionNumber v,
IOstream::compressionType c,
const bool valid
const bool write
) const
{
// Write shadow faceSet
word oldTypeName = 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;
// Modify faceZone
@ -501,7 +501,7 @@ bool faceZoneSet::writeObject
}
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
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -160,7 +160,7 @@ public:
IOstream::streamFormat,
IOstream::versionNumber,
IOstream::compressionType,
const bool valid
const bool write = true
) const;
//- Update any stored data for new labels

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -250,13 +250,13 @@ bool pointZoneSet::writeObject
IOstream::streamFormat s,
IOstream::versionNumber v,
IOstream::compressionType c,
const bool valid
const bool write
) const
{
// Write shadow pointSet
word oldTypeName = 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;
// Modify pointZone
@ -286,7 +286,7 @@ bool pointZoneSet::writeObject
}
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
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -147,7 +147,7 @@ public:
IOstream::streamFormat,
IOstream::versionNumber,
IOstream::compressionType,
const bool valid
const bool write = true
) const;
//- Update any stored data for new labels

View File

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

View File

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

View File

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

View File

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