STYLE: readOnProc/writeOnProc instead of 'valid' for IO

This commit is contained in:
Mark Olesen
2023-03-14 17:39:28 +01:00
parent 188e61af16
commit 475ed5cc32
94 changed files with 415 additions and 383 deletions

View File

@ -46,35 +46,39 @@ using namespace Foam;
template<class Type>
void doWrite(const IOobject& io, const label sz)
{
const bool writeOnProc = (sz > 0);
IOField<Type> fld(io, sz);
forAll(fld, i)
{
fld[i] = i + 1000.25 + (0.25 * i);
}
Pout<< "writing:" << fld << endl;
fld.write(sz > 0);
fld.write(writeOnProc);
}
template<>
void doWrite<bool>(const IOobject& io, const label sz)
{
const bool writeOnProc = (sz > 0);
IOField<bool> fld(io, sz);
forAll(fld, i)
{
fld[i] = i % 2;
}
Pout<< "writing:" << fld << endl;
fld.write(sz > 0);
fld.write(writeOnProc);
}
template<class Type>
void doRead(const IOobject& io, const label sz)
{
bool valid = (sz > 0);
Pout<< " valid:" << valid << endl;
IOField<Type> fld(io, valid);
const bool readOnProc = (sz > 0);
Pout<< " readOnProc:" << readOnProc << endl;
IOField<Type> fld(io, readOnProc);
Pout<< " wanted:" << sz << " actually read:" << fld.size() << endl;
if (fld.size() != sz)

View File

@ -203,7 +203,7 @@ bool writeOptionalMeshObject
const word& name,
const fileName& meshDir,
Time& runTime,
const bool valid
const bool writeOnProc
)
{
IOobject io
@ -218,8 +218,7 @@ bool writeOptionalMeshObject
);
bool writeOk = false;
bool haveFile = io.typeHeaderOk<IOField<label>>(false);
const bool haveFile = io.typeHeaderOk<IOField<label>>(false);
// Make sure all know if there is a valid class name
wordList classNames(1, io.headerClassName());
@ -230,10 +229,10 @@ bool writeOptionalMeshObject
{
Info<< " Reading " << classNames[0]
<< " : " << name << endl;
T meshObject(io, valid && haveFile);
T meshObject(io, writeOnProc && haveFile);
Info<< " Writing " << name << endl;
writeOk = meshObject.regIOobject::write(valid && haveFile);
writeOk = meshObject.regIOobject::write(writeOnProc && haveFile);
}
return writeOk;

View File

@ -94,7 +94,7 @@ public:
{}
//- Disable writing objects
virtual bool writeObject(IOstreamOption, const bool valid) const
virtual bool writeObject(IOstreamOption, const bool writeOnProc) const
{
return true;
}

View File

@ -32,11 +32,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 readOnProc)
{
Istream& is = readStream(word::null, valid);
Istream& is = readStream(word::null, readOnProc);
if (valid)
if (readOnProc)
{
if (headerClassName() == IOField<T>::typeName)
{
@ -93,19 +93,19 @@ template<class T, class BaseType>
Foam::CompactIOField<T, BaseType>::CompactIOField
(
const IOobject& io,
const bool valid
const bool readOnProc
)
:
regIOobject(io)
{
if (readOpt() == IOobject::MUST_READ)
{
readFromStream(valid);
readFromStream(readOnProc);
}
else if (isReadOptional())
{
bool haveFile = headerOk();
readFromStream(valid && haveFile);
const bool haveFile = headerOk();
readFromStream(readOnProc && haveFile);
}
}
@ -176,7 +176,7 @@ template<class T, class BaseType>
bool Foam::CompactIOField<T, BaseType>::writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const
{
if (streamOpt.format() == IOstreamOption::ASCII)
@ -186,7 +186,7 @@ bool Foam::CompactIOField<T, BaseType>::writeObject
const_cast<word&>(typeName) = IOField<T>::typeName;
bool good = regIOobject::writeObject(streamOpt, valid);
bool good = regIOobject::writeObject(streamOpt, writeOnProc);
// Restore type
const_cast<word&>(typeName) = oldTypeName;
@ -194,7 +194,7 @@ bool Foam::CompactIOField<T, BaseType>::writeObject
return good;
}
return regIOobject::writeObject(streamOpt, valid);
return regIOobject::writeObject(streamOpt, writeOnProc);
}

View File

@ -76,8 +76,8 @@ class CompactIOField
{
// Private Member Functions
//- Read according to header type
void readFromStream(const bool valid = true);
//- Read according to header type, with optional 'on-proc' value
void readFromStream(const bool readOnProc = true);
//- Read if IOobject flags set. Return true if read.
// Reads according to the header type
@ -99,7 +99,7 @@ public:
explicit CompactIOField(const IOobject& io);
//- Construct from IOobject, with local processor conditional reading
CompactIOField(const IOobject& io, const bool valid);
CompactIOField(const IOobject& io, const bool readOnProc);
//- Construct from IOobject and zero size (if not read)
CompactIOField(const IOobject& io, Foam::zero);
@ -124,7 +124,7 @@ public:
virtual bool writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const;
virtual bool writeData(Ostream& os) const;

View File

@ -169,7 +169,7 @@ template<class T, class BaseType>
bool Foam::CompactIOList<T, BaseType>::writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const
{
if
@ -193,7 +193,7 @@ bool Foam::CompactIOList<T, BaseType>::writeObject
const_cast<word&>(typeName) = IOList<T>::typeName;
bool good = regIOobject::writeObject(streamOpt, valid);
bool good = regIOobject::writeObject(streamOpt, writeOnProc);
// Change type back
const_cast<word&>(typeName) = oldTypeName;
@ -201,7 +201,7 @@ bool Foam::CompactIOList<T, BaseType>::writeObject
return good;
}
return regIOobject::writeObject(streamOpt, valid);
return regIOobject::writeObject(streamOpt, writeOnProc);
}

View File

@ -127,7 +127,7 @@ public:
virtual bool writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const;
virtual bool writeData(Ostream&) const;

View File

@ -30,13 +30,25 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class Type>
void Foam::IOField<Type>::readFromStream(const bool readOnProc)
{
Istream& is = readStream(typeName, readOnProc);
if (readOnProc)
{
is >> *this;
}
close();
}
template<class Type>
bool Foam::IOField<Type>::readContents()
{
if (isReadRequired() || (isReadOptional() && headerOk()))
{
readStream(typeName) >> *this;
close();
readFromStream();
return true;
}
@ -59,7 +71,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 readOnProc)
:
regIOobject(io)
{
@ -68,25 +80,12 @@ Foam::IOField<Type>::IOField(const IOobject& io, const bool valid)
if (isReadRequired())
{
Istream& is = readStream(typeName, valid);
if (valid)
{
is >> *this;
}
close();
readFromStream(readOnProc);
}
else if (isReadOptional())
{
bool haveFile = headerOk();
Istream& is = readStream(typeName, haveFile && valid);
if (valid && haveFile)
{
is >> *this;
}
close();
const bool haveFile = headerOk();
readFromStream(readOnProc && haveFile);
}
}

View File

@ -59,6 +59,9 @@ class IOField
{
// Private Member Functions
//- Read with optional 'on-proc' value
void readFromStream(const bool readOnProc = true);
//- Read if IOobject flags set. Return true if read.
bool readContents();
@ -80,7 +83,7 @@ public:
explicit IOField(const IOobject& io);
//- Construct from IOobject, with local processor conditional reading
IOField(const IOobject& io, const bool valid);
IOField(const IOobject& io, const bool readOnProc);
//- Construct from IOobject and zero size (if not read)
IOField(const IOobject& io, Foam::zero);

View File

@ -1002,7 +1002,7 @@ bool Foam::decomposedBlockData::writeData(Ostream& os) const
bool Foam::decomposedBlockData::writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const
{
autoPtr<OSstream> osPtr;

View File

@ -188,7 +188,7 @@ public:
virtual bool writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const;

View File

@ -101,7 +101,7 @@ void Foam::masterOFstream::commit()
if (uniform)
{
if (Pstream::master() && valid_)
if (Pstream::master() && writeOnProc_)
{
checkWrite(pathName_, this->str());
}
@ -116,7 +116,7 @@ void Foam::masterOFstream::commit()
// Send my (valid) buffer to master
if (!Pstream::master())
{
if (valid_)
if (writeOnProc_)
{
string s(this->str());
@ -131,7 +131,7 @@ void Foam::masterOFstream::commit()
if (Pstream::master())
{
// Write (valid) master data
if (valid_)
if (writeOnProc_)
{
checkWrite(filePaths[Pstream::masterNo()], this->str());
}
@ -173,7 +173,7 @@ Foam::masterOFstream::masterOFstream
const fileName& pathName,
IOstreamOption streamOpt,
IOstreamOption::appendType append,
const bool valid
const bool writeOnProc
)
:
OStringStream(streamOpt),
@ -181,7 +181,7 @@ Foam::masterOFstream::masterOFstream
atomic_(atomic),
compression_(streamOpt.compression()),
append_(append),
valid_(valid)
writeOnProc_(writeOnProc)
{}

View File

@ -68,7 +68,7 @@ class masterOFstream
const IOstreamOption::appendType append_;
//- Should file be written (on this processor)
const bool valid_;
const bool writeOnProc_;
// Private Member Functions
@ -100,7 +100,7 @@ public:
const fileName& pathname,
IOstreamOption streamOpt = IOstreamOption(),
IOstreamOption::appendType append = IOstreamOption::NON_APPEND,
const bool valid = true
const bool writeOnProc = true
);
//- Construct (with worldComm)
@ -110,7 +110,7 @@ public:
const fileName& pathname,
IOstreamOption streamOpt = IOstreamOption(),
IOstreamOption::appendType append = IOstreamOption::NON_APPEND,
const bool valid = true
const bool writeOnProc = true
)
:
masterOFstream
@ -119,7 +119,7 @@ public:
pathname,
streamOpt,
append,
valid
writeOnProc
)
{}

View File

@ -465,7 +465,7 @@ public:
virtual bool writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const;
//- Write the objects immediately (not at end of iteration)

View File

@ -547,7 +547,7 @@ bool Foam::Time::writeTimeDict() const
bool Foam::Time::writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const
{
if (writeTime())
@ -556,7 +556,7 @@ bool Foam::Time::writeObject
if (writeOK)
{
writeOK = objectRegistry::writeObject(streamOpt, valid);
writeOK = objectRegistry::writeObject(streamOpt, writeOnProc);
}
if (writeOK)

View File

@ -500,7 +500,7 @@ bool Foam::objectRegistry::readIfModified()
bool Foam::objectRegistry::writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const
{
bool ok = true;
@ -521,7 +521,7 @@ bool Foam::objectRegistry::writeObject
if (iter.val()->writeOpt() != IOobjectOption::NO_WRITE)
{
ok = iter.val()->writeObject(streamOpt, valid) && ok;
ok = iter.val()->writeObject(streamOpt, writeOnProc) && ok;
}
}

View File

@ -585,7 +585,7 @@ public:
virtual bool writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const;

View File

@ -114,7 +114,7 @@ private:
// Private Member Functions
//- Construct object stream, read header if not already constructed
void readStream(const bool valid);
void readStream(const bool readOnProc);
//- No copy assignment
void operator=(const regIOobject&) = delete;
@ -306,7 +306,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 readOnProc = true);
//- Close Istream
void close();
@ -347,11 +347,11 @@ public:
virtual bool writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const;
//- Write using setting from DB
virtual bool write(const bool valid = true) const;
virtual bool write(const bool writeOnProc = true) const;
// Other
@ -378,10 +378,10 @@ public:
IOstreamOption::streamFormat fmt,
IOstreamOption::versionNumber ver,
IOstreamOption::compressionType cmp,
const bool valid
const bool writeOnProc
) const
{
return writeObject(IOstreamOption(fmt, ver, cmp), valid);
return writeObject(IOstreamOption(fmt, ver, cmp), writeOnProc);
}
};

View File

@ -83,7 +83,7 @@ bool Foam::regIOobject::readHeaderOk
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::regIOobject::readStream(const bool valid)
void Foam::regIOobject::readStream(const bool readOnProc)
{
if (readOpt() == IOobject::NO_READ)
{
@ -117,7 +117,7 @@ void Foam::regIOobject::readStream(const bool valid)
}
}
isPtr_ = fileHandler().readStream(*this, objPath, type(), valid);
isPtr_ = fileHandler().readStream(*this, objPath, type(), readOnProc);
}
}
@ -125,7 +125,7 @@ void Foam::regIOobject::readStream(const bool valid)
Foam::Istream& Foam::regIOobject::readStream
(
const word& expectName,
const bool valid
const bool readOnProc
)
{
if (IFstream::debug)
@ -140,14 +140,14 @@ Foam::Istream& Foam::regIOobject::readStream
// Construct IFstream if not already constructed
if (!isPtr_)
{
readStream(valid);
readStream(readOnProc);
// Check the className of the regIOobject
// dictionary is an allowable name in case the actual class
// instantiated is a dictionary
if
(
valid
readOnProc
&& expectName.size()
&& headerClassName() != expectName
&& headerClassName() != "dictionary"

View File

@ -35,7 +35,7 @@ License
bool Foam::regIOobject::writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const
{
if (!good())
@ -107,7 +107,7 @@ bool Foam::regIOobject::writeObject
bool osGood = false;
if (!masterOnly || Pstream::master())
{
osGood = fileHandler().writeObject(*this, streamOpt, valid);
osGood = fileHandler().writeObject(*this, streamOpt, writeOnProc);
}
else
{
@ -131,12 +131,12 @@ bool Foam::regIOobject::writeObject
}
bool Foam::regIOobject::write(const bool valid) const
bool Foam::regIOobject::write(const bool writeOnProc) const
{
return writeObject
(
IOstreamOption(time().writeFormat(), time().writeCompression()),
valid
writeOnProc
);
}

View File

@ -364,7 +364,7 @@ bool Foam::fileOperations::collatedFileOperation::writeObject
(
const regIOobject& io,
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const
{
const Time& tm = io.time();
@ -392,7 +392,7 @@ bool Foam::fileOperations::collatedFileOperation::writeObject
pathName,
streamOpt,
IOstreamOption::NON_APPEND,
valid
writeOnProc
);
// If any of these fail, return
@ -436,7 +436,7 @@ bool Foam::fileOperations::collatedFileOperation::writeObject
pathName,
streamOpt,
IOstreamOption::NON_APPEND,
valid
writeOnProc
);
// If any of these fail, return

View File

@ -162,7 +162,7 @@ public:
(
const regIOobject&,
IOstreamOption streamOpt = IOstreamOption(),
const bool valid = true
const bool writeOnProc = true
) const;
// Other

View File

@ -801,10 +801,10 @@ bool Foam::fileOperation::writeObject
(
const regIOobject& io,
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const
{
if (valid)
if (writeOnProc)
{
const fileName pathName(io.objectPath());

View File

@ -433,7 +433,7 @@ public:
regIOobject&,
const fileName&,
const word& typeName,
const bool valid = true
const bool readOnProc = true
) const = 0;
//- Top-level read
@ -447,14 +447,14 @@ 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 !writeOnProc the
// file does not need to be written (this is used e.g. to
// suppress empty local lagrangian data)
virtual bool writeObject
(
const regIOobject& io,
IOstreamOption streamOpt = IOstreamOption(),
const bool valid = true
const bool writeOnProc = true
) const;
@ -477,7 +477,7 @@ public:
(
const fileName& pathname,
IOstreamOption streamOpt = IOstreamOption(),
const bool valid = true
const bool writeOnProc = true
) const = 0;
//- Generate an OSstream that writes a file
@ -486,7 +486,7 @@ public:
IOstreamOption::atomicType atomic,
const fileName& pathname,
IOstreamOption streamOpt = IOstreamOption(),
const bool valid = true
const bool writeOnProc = true
) const = 0;

View File

@ -1835,7 +1835,7 @@ Foam::fileOperations::masterUncollatedFileOperation::readStream
regIOobject& io,
const fileName& fName,
const word& typeName,
const bool valid
const bool readOnProc
) const
{
if (debug)
@ -1843,7 +1843,7 @@ Foam::fileOperations::masterUncollatedFileOperation::readStream
Pout<< "masterUncollatedFileOperation::readStream :"
<< " object : " << io.name()
<< " global : " << io.global()
<< " fName : " << fName << " valid:" << valid << endl;
<< " fName : " << fName << " readOnProc:" << readOnProc << endl;
}
@ -2027,10 +2027,13 @@ Foam::fileOperations::masterUncollatedFileOperation::readStream
filePaths[Pstream::myProcNo()] = fName;
Pstream::gatherList(filePaths);
boolList procValid(UPstream::listGatherValues<bool>(valid));
boolList procValid
(
UPstream::listGatherValues<bool>(readOnProc)
);
// NB: local proc validity information required on sub-ranks too!
procValid.resize(Pstream::nProcs());
procValid[Pstream::myProcNo()] = valid;
procValid[Pstream::myProcNo()] = readOnProc;
return read(io, Pstream::worldComm, true, filePaths, procValid);
}
@ -2041,10 +2044,13 @@ Foam::fileOperations::masterUncollatedFileOperation::readStream
filePaths[Pstream::myProcNo(comm_)] = fName;
Pstream::gatherList(filePaths, Pstream::msgType(), comm_);
boolList procValid(UPstream::listGatherValues<bool>(valid, comm_));
boolList procValid
(
UPstream::listGatherValues<bool>(readOnProc, comm_)
);
// NB: local proc validity information required on sub-ranks too!
procValid.resize(Pstream::nProcs(comm_));
procValid[Pstream::myProcNo(comm_)] = valid;
procValid[Pstream::myProcNo(comm_)] = readOnProc;
// Uniform in local comm
const bool uniform = uniformFile(filePaths);
@ -2139,7 +2145,7 @@ bool Foam::fileOperations::masterUncollatedFileOperation::writeObject
(
const regIOobject& io,
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const
{
fileName pathName(io.objectPath());
@ -2147,7 +2153,7 @@ bool Foam::fileOperations::masterUncollatedFileOperation::writeObject
if (debug)
{
Pout<< "masterUncollatedFileOperation::writeObject :"
<< " io:" << pathName << " valid:" << valid << endl;
<< " io:" << pathName << " writeOnProc:" << writeOnProc << endl;
}
// Make sure to pick up any new times
@ -2156,7 +2162,7 @@ bool Foam::fileOperations::masterUncollatedFileOperation::writeObject
// Update meta-data for current state
const_cast<regIOobject&>(io).updateMetaData();
autoPtr<OSstream> osPtr(NewOFstream(pathName, streamOpt, valid));
autoPtr<OSstream> osPtr(NewOFstream(pathName, streamOpt, writeOnProc));
OSstream& os = *osPtr;
// If any of these fail, return (leave error handling to Ostream class)
@ -2406,7 +2412,7 @@ Foam::fileOperations::masterUncollatedFileOperation::NewOFstream
(
const fileName& pathName,
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const
{
return autoPtr<OSstream>
@ -2416,7 +2422,7 @@ Foam::fileOperations::masterUncollatedFileOperation::NewOFstream
pathName,
streamOpt,
IOstreamOption::NON_APPEND,
valid
writeOnProc
)
);
}
@ -2428,7 +2434,7 @@ Foam::fileOperations::masterUncollatedFileOperation::NewOFstream
IOstreamOption::atomicType atomic,
const fileName& pathName,
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const
{
return autoPtr<OSstream>
@ -2439,7 +2445,7 @@ Foam::fileOperations::masterUncollatedFileOperation::NewOFstream
pathName,
streamOpt,
IOstreamOption::NON_APPEND,
valid
writeOnProc
)
);
}

View File

@ -662,13 +662,13 @@ public:
) const;
//- Reads header for regIOobject and returns an ISstream
// to read the contents.
//- to read the contents.
virtual autoPtr<ISstream> readStream
(
regIOobject&,
const fileName&,
const word& typeName,
const bool valid = true
const bool readOnProc = true
) const;
//- Top-level read
@ -686,7 +686,7 @@ public:
(
const regIOobject& io,
IOstreamOption streamOpt = IOstreamOption(),
const bool valid = true
const bool writeOnProc = true
) const;
//- Generate an ISstream that reads a file
@ -697,7 +697,7 @@ public:
(
const fileName& pathname,
IOstreamOption streamOpt = IOstreamOption(),
const bool valid = true
const bool writeOnProc = true
) const;
//- Generate an OSstream that writes a file
@ -706,7 +706,7 @@ public:
IOstreamOption::atomicType atomic,
const fileName& pathname,
IOstreamOption streamOpt = IOstreamOption(),
const bool valid = true
const bool writeOnProc = true
) const;

View File

@ -548,10 +548,10 @@ Foam::fileOperations::uncollatedFileOperation::readStream
regIOobject& io,
const fileName& fName,
const word& typeName,
const bool valid
const bool writeOnProc
) const
{
if (!valid)
if (!writeOnProc)
{
return autoPtr<ISstream>(new dummyISstream());
}
@ -718,7 +718,7 @@ Foam::fileOperations::uncollatedFileOperation::NewOFstream
(
const fileName& pathName,
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const
{
return autoPtr<OSstream>(new OFstream(pathName, streamOpt));
@ -731,7 +731,7 @@ Foam::fileOperations::uncollatedFileOperation::NewOFstream
IOstreamOption::atomicType atomic,
const fileName& pathName,
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const
{
return autoPtr<OSstream>(new OFstream(atomic, pathName, streamOpt));

View File

@ -291,7 +291,7 @@ public:
(
const fileName& pathname,
IOstreamOption streamOpt = IOstreamOption(),
const bool valid = true
const bool writeOnProc = true
) const;
//- Generate an OSstream that writes a file
@ -300,7 +300,7 @@ public:
IOstreamOption::atomicType,
const fileName& pathname,
IOstreamOption streamOpt = IOstreamOption(),
const bool valid = true
const bool writeOnProc = true
) const;
};

View File

@ -386,7 +386,7 @@ bool Foam::profiling::writeData(Ostream& os) const
bool Foam::profiling::writeObject
(
IOstreamOption,
const bool valid
const bool writeOnProc
) const
{
return

View File

@ -260,7 +260,7 @@ public:
virtual bool writeObject
(
IOstreamOption /*ignore*/,
const bool valid
const bool writeOnProc
) const;
};

View File

@ -1246,11 +1246,11 @@ bool Foam::polyBoundaryMesh::writeData(Ostream& os) const
bool Foam::polyBoundaryMesh::writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const
{
streamOpt.compression(IOstreamOption::UNCOMPRESSED);
return regIOobject::writeObject(streamOpt, valid);
return regIOobject::writeObject(streamOpt, writeOnProc);
}

View File

@ -315,7 +315,7 @@ public:
virtual bool writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const;

View File

@ -46,11 +46,11 @@ static const char* headerTypeCompat = "IOPtrList<coordinateSystem>";
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::coordinateSystems::readFromStream(const bool valid)
void Foam::coordinateSystems::readFromStream(const bool readOnProc)
{
Istream& is = readStream(word::null, valid);
Istream& is = readStream(word::null, readOnProc);
if (valid)
if (readOnProc)
{
if (headerClassName() == typeName)
{
@ -308,14 +308,14 @@ bool Foam::coordinateSystems::writeData(Ostream& os) const
bool Foam::coordinateSystems::writeObject
(
IOstreamOption,
const bool valid
const bool writeOnProc
) const
{
// Force ASCII, uncompressed
return regIOobject::writeObject
(
IOstreamOption(IOstreamOption::ASCII),
valid
writeOnProc
);
}

View File

@ -84,7 +84,7 @@ class coordinateSystems
// Private Member Functions
//- Read "coordinateSystems" or older "IOPtrList<coordinateSystem>"
void readFromStream(const bool valid = true);
void readFromStream(const bool readOnProc = true);
//- Read if IOobject flags set. Return true if read.
bool readContents();
@ -184,7 +184,7 @@ public:
virtual bool writeObject
(
IOstreamOption streamOpt,
const bool valid = true
const bool writeOnProc = true
) const;

View File

@ -1486,7 +1486,7 @@ bool Foam::dynamicRefineFvMesh::update()
bool Foam::dynamicRefineFvMesh::writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const
{
// Force refinement data to go to the current time directory.
@ -1494,9 +1494,9 @@ bool Foam::dynamicRefineFvMesh::writeObject
bool writeOk =
(
//dynamicFvMesh::writeObject(streamOpt, valid)
dynamicMotionSolverListFvMesh::writeObject(streamOpt, valid)
&& meshCutter_.write(valid)
//dynamicFvMesh::writeObject(streamOpt, writeOnProc)
dynamicMotionSolverListFvMesh::writeObject(streamOpt, writeOnProc)
&& meshCutter_.write(writeOnProc)
);
if (dumpLevel_)

View File

@ -280,7 +280,7 @@ public:
virtual bool writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const;
};

View File

@ -217,7 +217,7 @@ void Foam::motionSolver::updateMesh(const mapPolyMesh& mpm)
bool Foam::motionSolver::writeObject
(
IOstreamOption,
const bool valid
const bool writeOnProc
) const
{
return true;

View File

@ -174,7 +174,7 @@ public:
virtual bool writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const;
//- Read dynamicMeshDict dictionary

View File

@ -5690,16 +5690,16 @@ void Foam::hexRef8::setUnrefinement
// Write refinement to polyMesh directory.
bool Foam::hexRef8::write(const bool valid) const
bool Foam::hexRef8::write(const bool writeOnProc) const
{
bool writeOk =
cellLevel_.write(valid)
&& pointLevel_.write(valid)
&& level0Edge_.write(valid);
cellLevel_.write(writeOnProc)
&& pointLevel_.write(writeOnProc)
&& level0Edge_.write(writeOnProc);
if (history_.active())
{
writeOk = writeOk && history_.write(valid);
writeOk = writeOk && history_.write(writeOnProc);
}
else
{

View File

@ -588,7 +588,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 writeOnProc = true) const;
//- Helper: remove all relevant files from mesh instance
static void removeFiles(const polyMesh&);

View File

@ -909,14 +909,14 @@ bool Foam::faBoundaryMesh::writeData(Ostream& os) const
bool Foam::faBoundaryMesh::writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const
{
// Allow/disallow compression?
// 1. keep readable
// 2. save some space
// ??? streamOpt.compression(IOstreamOption::UNCOMPRESSED);
return regIOobject::writeObject(streamOpt, valid);
return regIOobject::writeObject(streamOpt, writeOnProc);
}

View File

@ -244,7 +244,7 @@ public:
virtual bool writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const;

View File

@ -1044,7 +1044,7 @@ Foam::boolList& Foam::faMesh::correctPatchPointNormals() const
}
bool Foam::faMesh::write(const bool valid) const
bool Foam::faMesh::write(const bool writeOnProc) const
{
faceLabels_.write();
boundary_.write();

View File

@ -947,7 +947,7 @@ public:
//- Write mesh
virtual bool write(const bool valid = true) const;
virtual bool write(const bool writeOnProc = true) const;
// Member Operators

View File

@ -1048,13 +1048,13 @@ void Foam::fvMesh::updateMesh(const mapPolyMesh& mpm)
bool Foam::fvMesh::writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const
{
bool ok = true;
if (phiPtr_)
{
ok = phiPtr_->write(valid);
ok = phiPtr_->write(writeOnProc);
// NOTE: The old old time mesh phi might be necessary for certain
// solver smooth restart using second order time schemes.
//ok = phiPtr_->oldTime().write();
@ -1062,16 +1062,16 @@ bool Foam::fvMesh::writeObject
if (V0Ptr_ && V0Ptr_->writeOpt() == IOobject::AUTO_WRITE)
{
// For second order restarts we need to write V0
ok = V0Ptr_->write(valid);
ok = V0Ptr_->write(writeOnProc);
}
return ok && polyMesh::writeObject(streamOpt, valid);
return ok && polyMesh::writeObject(streamOpt, writeOnProc);
}
bool Foam::fvMesh::write(const bool valid) const
bool Foam::fvMesh::write(const bool writeOnProc) const
{
return polyMesh::write(valid);
return polyMesh::write(writeOnProc);
}

View File

@ -508,11 +508,11 @@ public:
virtual bool writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const;
//- Write mesh using IO settings from time
virtual bool write(const bool valid = true) const;
virtual bool write(const bool writeOnProc = true) const;
// Member Operators

View File

@ -388,21 +388,21 @@ void Foam::streamLineParticle::hitWallPatch
void Foam::streamLineParticle::readFields(Cloud<streamLineParticle>& c)
{
const bool valid = c.size();
const bool readOnProc = c.size();
particle::readFields(c);
IOField<label> lifeTime
(
c.fieldIOobject("lifeTime", IOobject::MUST_READ),
valid
readOnProc
);
c.checkFieldIOobject(c, lifeTime);
vectorFieldIOField sampledPositions
(
c.fieldIOobject("sampledPositions", IOobject::MUST_READ),
valid
readOnProc
);
c.checkFieldIOobject(c, sampledPositions);
@ -421,7 +421,7 @@ void Foam::streamLineParticle::writeFields(const Cloud<streamLineParticle>& c)
particle::writeFields(c);
const label np = c.size();
const bool valid = c.size();
const bool writeOnProc = c.size();
IOField<label> lifeTime
(
@ -442,8 +442,8 @@ void Foam::streamLineParticle::writeFields(const Cloud<streamLineParticle>& c)
++i;
}
lifeTime.write(valid);
sampledPositions.write(valid);
lifeTime.write(writeOnProc);
sampledPositions.write(writeOnProc);
}

View File

@ -87,20 +87,20 @@ Foam::DSMCParcel<ParcelType>::DSMCParcel
template<class ParcelType>
void Foam::DSMCParcel<ParcelType>::readFields(Cloud<DSMCParcel<ParcelType>>& c)
{
bool valid = c.size();
const bool readOnProc = c.size();
ParcelType::readFields(c);
IOField<vector> U(c.fieldIOobject("U", IOobject::MUST_READ), valid);
IOField<vector> U(c.fieldIOobject("U", IOobject::MUST_READ), readOnProc);
c.checkFieldIOobject(c, U);
IOField<scalar> Ei(c.fieldIOobject("Ei", IOobject::MUST_READ), valid);
IOField<scalar> Ei(c.fieldIOobject("Ei", IOobject::MUST_READ), readOnProc);
c.checkFieldIOobject(c, Ei);
IOField<label> typeId
(
c.fieldIOobject("typeId", IOobject::MUST_READ),
valid
readOnProc
);
c.checkFieldIOobject(c, typeId);
@ -123,7 +123,8 @@ void Foam::DSMCParcel<ParcelType>::writeFields
{
ParcelType::writeFields(c);
label np = c.size();
const label np = c.size();
const bool writeOnProc = c.size();
IOField<vector> U(c.fieldIOobject("U", IOobject::NO_READ), np);
IOField<scalar> Ei(c.fieldIOobject("Ei", IOobject::NO_READ), np);
@ -138,9 +139,9 @@ void Foam::DSMCParcel<ParcelType>::writeFields
++i;
}
U.write(np > 0);
Ei.write(np > 0);
typeId.write(np > 0);
U.write(writeOnProc);
Ei.write(writeOnProc);
typeId.write(writeOnProc);
}

View File

@ -269,7 +269,7 @@ public:
virtual bool writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const;
//- Write positions to \<cloudName\>_positions.obj file

View File

@ -134,18 +134,18 @@ void Foam::Cloud<ParticleType>::initCloud(const bool checkClass)
IOPosition<Cloud<ParticleType>> ioP(*this, geometryType_);
const bool valid = ioP.headerOk();
Istream& is = ioP.readStream(checkClass ? typeName : "", valid);
if (valid)
const bool haveFile = ioP.headerOk();
Istream& is = ioP.readStream(checkClass ? typeName : word::null, haveFile);
if (haveFile)
{
ioP.readData(is, *this);
ioP.close();
}
if (!valid && debug)
if (!haveFile && debug)
{
Pout<< "Cannot read particle positions file:" << nl
<< " " << ioP.objectPath() << nl
Pout<< "Not reading particle positions file: "
<< ioP.objectRelPath() << nl
<< "Assuming the initial cloud contains 0 particles." << endl;
}
@ -329,13 +329,13 @@ template<class ParticleType>
bool Foam::Cloud<ParticleType>::writeObject
(
IOstreamOption streamOpt,
const bool
const bool /* writeOnProc */
) const
{
writeCloudUniformProperties();
writeFields();
return cloud::writeObject(streamOpt, this->size());
return cloud::writeObject(streamOpt, (this->size() > 0));
}

View File

@ -54,9 +54,12 @@ Foam::IOPosition<CloudType>::IOPosition
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
bool Foam::IOPosition<CloudType>::write(const bool valid) const
bool Foam::IOPosition<CloudType>::write
(
const bool /* writeOnProc */
) const
{
return regIOobject::write(cloud_.size());
return regIOobject::write(cloud_.size() > 0);
}

View File

@ -84,14 +84,14 @@ public:
);
// Member functions
// Member Functions
//- Inherit readData from regIOobject
using regIOobject::readData;
virtual void readData(Istream&, CloudType&);
virtual bool write(const bool valid = true) const;
virtual bool write(const bool writeOnProc = true) const;
virtual bool writeData(Ostream& os) const;
};

View File

@ -139,19 +139,19 @@ void Foam::particle::writeProperty
template<class TrackCloudType>
void Foam::particle::readFields(TrackCloudType& c)
{
const bool valid = c.size();
const bool readOnProc = c.size();
IOobject procIO(c.fieldIOobject("origProcId", IOobject::MUST_READ));
const bool haveFile = procIO.typeHeaderOk<IOField<label>>(true);
IOField<label> origProcId(procIO, valid && haveFile);
IOField<label> origProcId(procIO, readOnProc && haveFile);
c.checkFieldIOobject(c, origProcId);
IOField<label> origId
(
c.fieldIOobject("origId", IOobject::MUST_READ),
valid && haveFile
readOnProc && haveFile
);
c.checkFieldIOobject(c, origId);
@ -170,12 +170,12 @@ template<class TrackCloudType>
void Foam::particle::writeFields(const TrackCloudType& c)
{
const label np = c.size();
const bool valid = np;
const bool writeOnProc = c.size();
if (writeLagrangianCoordinates)
{
IOPosition<TrackCloudType> ioP(c);
ioP.write(valid);
ioP.write(writeOnProc);
}
else if (!writeLagrangianPositions)
{
@ -192,7 +192,7 @@ void Foam::particle::writeFields(const TrackCloudType& c)
c,
cloud::geometryType::POSITIONS
);
ioP.write(valid);
ioP.write(writeOnProc);
}
IOField<label> origProc
@ -215,8 +215,8 @@ void Foam::particle::writeFields(const TrackCloudType& c)
++i;
}
origProc.write(valid);
origId.write(valid);
origProc.write(writeOnProc);
origId.write(writeOnProc);
}

View File

@ -97,31 +97,31 @@ template<class ParcelType>
template<class CloudType>
void Foam::CollidingParcel<ParcelType>::readFields(CloudType& c)
{
const bool valid = c.size();
const bool readOnProc = c.size();
ParcelType::readFields(c);
IOField<vector> f(c.fieldIOobject("f", IOobject::MUST_READ), valid);
IOField<vector> f(c.fieldIOobject("f", IOobject::MUST_READ), readOnProc);
c.checkFieldIOobject(c, f);
IOField<vector> angularMomentum
(
c.fieldIOobject("angularMomentum", IOobject::MUST_READ),
valid
readOnProc
);
c.checkFieldIOobject(c, angularMomentum);
IOField<vector> torque
(
c.fieldIOobject("torque", IOobject::MUST_READ),
valid
readOnProc
);
c.checkFieldIOobject(c, torque);
labelFieldCompactIOField collisionRecordsPairAccessed
(
c.fieldIOobject("collisionRecordsPairAccessed", IOobject::MUST_READ),
valid
readOnProc
);
c.checkFieldFieldIOobject(c, collisionRecordsPairAccessed);
@ -132,7 +132,7 @@ void Foam::CollidingParcel<ParcelType>::readFields(CloudType& c)
"collisionRecordsPairOrigProcOfOther",
IOobject::MUST_READ
),
valid
readOnProc
);
c.checkFieldFieldIOobject(c, collisionRecordsPairOrigProcOfOther);
@ -143,35 +143,35 @@ void Foam::CollidingParcel<ParcelType>::readFields(CloudType& c)
"collisionRecordsPairOrigIdOfOther",
IOobject::MUST_READ
),
valid
readOnProc
);
c.checkFieldFieldIOobject(c, collisionRecordsPairOrigProcOfOther);
pairDataFieldCompactIOField collisionRecordsPairData
(
c.fieldIOobject("collisionRecordsPairData", IOobject::MUST_READ),
valid
readOnProc
);
c.checkFieldFieldIOobject(c, collisionRecordsPairData);
labelFieldCompactIOField collisionRecordsWallAccessed
(
c.fieldIOobject("collisionRecordsWallAccessed", IOobject::MUST_READ),
valid
readOnProc
);
c.checkFieldFieldIOobject(c, collisionRecordsWallAccessed);
vectorFieldCompactIOField collisionRecordsWallPRel
(
c.fieldIOobject("collisionRecordsWallPRel", IOobject::MUST_READ),
valid
readOnProc
);
c.checkFieldFieldIOobject(c, collisionRecordsWallPRel);
wallDataFieldCompactIOField collisionRecordsWallData
(
c.fieldIOobject("collisionRecordsWallData", IOobject::MUST_READ),
valid
readOnProc
);
c.checkFieldFieldIOobject(c, collisionRecordsWallData);
@ -206,7 +206,7 @@ void Foam::CollidingParcel<ParcelType>::writeFields(const CloudType& c)
ParcelType::writeFields(c);
const label np = c.size();
const bool valid = np;
const bool writeOnProc = c.size();
IOField<vector> f(c.fieldIOobject("f", IOobject::NO_READ), np);
@ -277,17 +277,17 @@ void Foam::CollidingParcel<ParcelType>::writeFields(const CloudType& c)
++i;
}
f.write(valid);
angMom.write(valid);
torque.write(valid);
f.write(writeOnProc);
angMom.write(writeOnProc);
torque.write(writeOnProc);
collisionRecordsPairAccessed.write(valid);
collisionRecordsPairOrigProcOfOther.write(valid);
collisionRecordsPairOrigIdOfOther.write(valid);
collisionRecordsPairData.write(valid);
collisionRecordsWallAccessed.write(valid);
collisionRecordsWallPRel.write(valid);
collisionRecordsWallData.write(valid);
collisionRecordsPairAccessed.write(writeOnProc);
collisionRecordsPairOrigProcOfOther.write(writeOnProc);
collisionRecordsPairOrigIdOfOther.write(writeOnProc);
collisionRecordsPairData.write(writeOnProc);
collisionRecordsWallAccessed.write(writeOnProc);
collisionRecordsWallPRel.write(writeOnProc);
collisionRecordsWallData.write(writeOnProc);
}

View File

@ -120,84 +120,84 @@ template<class ParcelType>
template<class CloudType>
void Foam::KinematicParcel<ParcelType>::readFields(CloudType& c)
{
const bool valid = c.size();
const bool readOnProc = c.size();
ParcelType::readFields(c);
IOField<label> active
(
c.fieldIOobject("active", IOobject::MUST_READ),
valid
readOnProc
);
c.checkFieldIOobject(c, active);
IOField<label> typeId
(
c.fieldIOobject("typeId", IOobject::MUST_READ),
valid
readOnProc
);
c.checkFieldIOobject(c, typeId);
IOField<scalar> nParticle
(
c.fieldIOobject("nParticle", IOobject::MUST_READ),
valid
readOnProc
);
c.checkFieldIOobject(c, nParticle);
IOField<scalar> d
(
c.fieldIOobject("d", IOobject::MUST_READ),
valid
readOnProc
);
c.checkFieldIOobject(c, d);
IOField<scalar> dTarget
(
c.fieldIOobject("dTarget", IOobject::MUST_READ),
valid
readOnProc
);
c.checkFieldIOobject(c, dTarget);
IOField<vector> U
(
c.fieldIOobject("U", IOobject::MUST_READ),
valid
readOnProc
);
c.checkFieldIOobject(c, U);
IOField<scalar> rho
(
c.fieldIOobject("rho", IOobject::MUST_READ),
valid
readOnProc
);
c.checkFieldIOobject(c, rho);
IOField<scalar> age
(
c.fieldIOobject("age", IOobject::MUST_READ),
valid
readOnProc
);
c.checkFieldIOobject(c, age);
IOField<scalar> tTurb
(
c.fieldIOobject("tTurb", IOobject::MUST_READ),
valid
readOnProc
);
c.checkFieldIOobject(c, tTurb);
IOField<vector> UTurb
(
c.fieldIOobject("UTurb", IOobject::MUST_READ),
valid
readOnProc
);
c.checkFieldIOobject(c, UTurb);
IOField<vector> UCorrect
(
c.fieldIOobject("UCorrect", IOobject::MUST_READ),
valid
readOnProc
);
c.checkFieldIOobject(c, UCorrect);
@ -229,7 +229,7 @@ void Foam::KinematicParcel<ParcelType>::writeFields(const CloudType& c)
ParcelType::writeFields(c);
const label np = c.size();
const bool valid = np;
const bool writeOnProc = c.size();
IOField<label> active(c.fieldIOobject("active", IOobject::NO_READ), np);
IOField<label> typeId(c.fieldIOobject("typeId", IOobject::NO_READ), np);
@ -266,17 +266,17 @@ void Foam::KinematicParcel<ParcelType>::writeFields(const CloudType& c)
++i;
}
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);
UCorrect.write(valid);
active.write(writeOnProc);
typeId.write(writeOnProc);
nParticle.write(writeOnProc);
d.write(writeOnProc);
dTarget.write(writeOnProc);
U.write(writeOnProc);
rho.write(writeOnProc);
age.write(writeOnProc);
tTurb.write(writeOnProc);
UTurb.write(writeOnProc);
UCorrect.write(writeOnProc);
}

View File

@ -88,14 +88,14 @@ template<class ParcelType>
template<class CloudType>
void Foam::MPPICParcel<ParcelType>::readFields(CloudType& c)
{
bool valid = c.size();
const bool readOnProc = c.size();
ParcelType::readFields(c);
IOField<vector> UCorrect
(
c.fieldIOobject("UCorrect", IOobject::MUST_READ),
valid
readOnProc
);
c.checkFieldIOobject(c, UCorrect);
@ -116,6 +116,7 @@ void Foam::MPPICParcel<ParcelType>::writeFields(const CloudType& c)
ParcelType::writeFields(c);
const label np = c.size();
const bool writeOnProc = c.size();
IOField<vector>
UCorrect(c.fieldIOobject("UCorrect", IOobject::NO_READ), np);
@ -129,7 +130,7 @@ void Foam::MPPICParcel<ParcelType>::writeFields(const CloudType& c)
++i;
}
UCorrect.write(np > 0);
UCorrect.write(writeOnProc);
}
@ -164,6 +165,7 @@ void Foam::MPPICParcel<ParcelType>::readObjects
{
ParcelType::readObjects(c, obr);
// const bool readOnProc = c.size();
if (!c.size()) return;
const auto& UCorrect = cloud::lookupIOField<vector>("UCorrect", obr);
@ -189,6 +191,7 @@ void Foam::MPPICParcel<ParcelType>::writeObjects
ParcelType::writeObjects(c, obr);
const label np = c.size();
// const bool writeOnProc = c.size();
auto& UCorrect = cloud::createIOField<vector>("UCorrect", np, obr);

View File

@ -87,14 +87,14 @@ void Foam::ReactingHeterogeneousParcel<ParcelType>::readFields
const CompositionType& compModel
)
{
const bool valid = c.size();
const bool readOnProc = c.size();
ParcelType::readFields(c);
IOField<scalar> mass0
(
c.fieldIOobject("mass0", IOobject::MUST_READ),
valid
readOnProc
);
c.checkFieldIOobject(c, mass0);
@ -128,7 +128,7 @@ void Foam::ReactingHeterogeneousParcel<ParcelType>::readFields
"F" + name(i),
IOobject::MUST_READ
),
valid
readOnProc
);
label j = 0;
@ -149,7 +149,7 @@ void Foam::ReactingHeterogeneousParcel<ParcelType>::readFields
"Y" + solidNames[j],
IOobject::MUST_READ
),
valid
readOnProc
);
label i = 0;
@ -186,7 +186,7 @@ void Foam::ReactingHeterogeneousParcel<ParcelType>::writeFields
ThermoParcel<KinematicParcel<particle>>::writeFields(c);
const label np = c.size();
const bool valid = np;
const bool writeOnProc = c.size();
IOField<scalar> mass0(c.fieldIOobject("mass0", IOobject::NO_READ), np);
@ -202,7 +202,7 @@ void Foam::ReactingHeterogeneousParcel<ParcelType>::writeFields
}
++i;
}
mass0.write(valid);
mass0.write(writeOnProc);
for (label i = 0; i < nF; i++)
{
@ -221,7 +221,7 @@ void Foam::ReactingHeterogeneousParcel<ParcelType>::writeFields
F = p0.F()[i];
}
F.write(valid);
F.write(writeOnProc);
}
const label idSolid = compModel.idSolid();
@ -246,7 +246,7 @@ void Foam::ReactingHeterogeneousParcel<ParcelType>::writeFields
++i;
}
Y.write(valid);
Y.write(writeOnProc);
}
}
@ -310,7 +310,7 @@ void Foam::ReactingHeterogeneousParcel<ParcelType>::readObjects
// Skip Reacting layer
ThermoParcel<KinematicParcel<particle>>::readObjects(c, obr);
// const label np = c.size();
// const bool readOnProc = c.size();
WarningInFunction
<< "Reading of objects is still a work-in-progress" << nl;
@ -332,6 +332,7 @@ void Foam::ReactingHeterogeneousParcel<ParcelType>::writeObjects
ThermoParcel<KinematicParcel<particle>>::writeObjects(c, obr);
const label np = c.size();
const bool writeOnProc = c.size();
// WIP
label nF = 0;
@ -341,7 +342,7 @@ void Foam::ReactingHeterogeneousParcel<ParcelType>::writeObjects
break;
}
if (np > 0)
if (writeOnProc)
{
for (label i = 0; i < nF; i++)
{

View File

@ -93,7 +93,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::readFields
const CompositionType& compModel
)
{
bool valid = c.size();
const bool readOnProc = c.size();
ParcelType::readFields(c, compModel);
@ -124,7 +124,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::readFields
"Y" + gasNames[j] + stateLabels[idGas],
IOobject::MUST_READ
),
valid
readOnProc
);
label i = 0;
@ -144,7 +144,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::readFields
"Y" + liquidNames[j] + stateLabels[idLiquid],
IOobject::MUST_READ
),
valid
readOnProc
);
label i = 0;
@ -164,7 +164,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::readFields
"Y" + solidNames[j] + stateLabels[idSolid],
IOobject::MUST_READ
),
valid
readOnProc
);
label i = 0;
@ -195,7 +195,8 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::writeFields
{
ParcelType::writeFields(c, compModel);
label np = c.size();
const label np = c.size();
const bool writeOnProc = c.size();
// Write the composition fractions
{
@ -222,7 +223,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::writeFields
++i;
}
YGas.write(np > 0);
YGas.write(writeOnProc);
}
const label idLiquid = compModel.idLiquid();
@ -246,7 +247,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::writeFields
++i;
}
YLiquid.write(np > 0);
YLiquid.write(writeOnProc);
}
const label idSolid = compModel.idSolid();
@ -270,7 +271,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::writeFields
++i;
}
YSolid.write(np > 0);
YSolid.write(writeOnProc);
}
}
}
@ -336,9 +337,10 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::readObjects
ParcelType::readObjects(c, obr);
const label np = c.size();
const bool readOnProc = c.size();
// The composition fractions
if (np > 0)
if (readOnProc)
{
const wordList& stateLabels = compModel.stateLabels();
@ -402,9 +404,10 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::writeObjects
ParcelType::writeObjects(c, obr);
const label np = c.size();
const bool writeOnProc = c.size();
// Write the composition fractions
if (np > 0)
if (writeOnProc)
{
const wordList& stateLabels = compModel.stateLabels();

View File

@ -106,14 +106,14 @@ void Foam::ReactingParcel<ParcelType>::readFields
const CompositionType& compModel
)
{
bool valid = c.size();
const bool readOnProc = c.size();
ParcelType::readFields(c);
IOField<scalar> mass0
(
c.fieldIOobject("mass0", IOobject::MUST_READ),
valid
readOnProc
);
c.checkFieldIOobject(c, mass0);
@ -151,7 +151,7 @@ void Foam::ReactingParcel<ParcelType>::readFields
"Y" + phaseTypes[j] + stateLabels[j],
IOobject::MUST_READ
),
valid
readOnProc
);
label i = 0;
@ -184,6 +184,7 @@ void Foam::ReactingParcel<ParcelType>::writeFields
ParcelType::writeFields(c);
const label np = c.size();
const bool writeOnProc = c.size();
{
IOField<scalar> mass0(c.fieldIOobject("mass0", IOobject::NO_READ), np);
@ -195,7 +196,7 @@ void Foam::ReactingParcel<ParcelType>::writeFields
++i;
}
mass0.write(np > 0);
mass0.write(writeOnProc);
// Write the composition fractions
const wordList& phaseTypes = compModel.phaseTypes();
@ -225,7 +226,7 @@ void Foam::ReactingParcel<ParcelType>::writeFields
++i;
}
Y.write(np > 0);
Y.write(writeOnProc);
}
}
}
@ -337,8 +338,9 @@ void Foam::ReactingParcel<ParcelType>::writeObjects
ParcelType::writeObjects(c, obr);
const label np = c.size();
const bool writeOnProc = c.size();
if (np > 0)
if (writeOnProc)
{
auto& mass0 = cloud::createIOField<scalar>("mass0", np, obr);

View File

@ -90,14 +90,14 @@ template<class ParcelType>
template<class CloudType>
void Foam::ThermoParcel<ParcelType>::readFields(CloudType& c)
{
const bool valid = c.size();
const bool readOnProc = c.size();
ParcelType::readFields(c);
IOField<scalar> T(c.fieldIOobject("T", IOobject::MUST_READ), valid);
IOField<scalar> T(c.fieldIOobject("T", IOobject::MUST_READ), readOnProc);
c.checkFieldIOobject(c, T);
IOField<scalar> Cp(c.fieldIOobject("Cp", IOobject::MUST_READ), valid);
IOField<scalar> Cp(c.fieldIOobject("Cp", IOobject::MUST_READ), readOnProc);
c.checkFieldIOobject(c, Cp);
@ -119,7 +119,7 @@ void Foam::ThermoParcel<ParcelType>::writeFields(const CloudType& c)
ParcelType::writeFields(c);
const label np = c.size();
const bool valid = np;
const bool writeOnProc = c.size();
IOField<scalar> T(c.fieldIOobject("T", IOobject::NO_READ), np);
IOField<scalar> Cp(c.fieldIOobject("Cp", IOobject::NO_READ), np);
@ -133,8 +133,8 @@ void Foam::ThermoParcel<ParcelType>::writeFields(const CloudType& c)
++i;
}
T.write(valid);
Cp.write(valid);
T.write(writeOnProc);
Cp.write(writeOnProc);
}

View File

@ -138,7 +138,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 writeOnProc) const
{
const pointMesh pointMesh_(mesh_);
@ -234,10 +234,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(writeOnProc)) return false;
if (!cellGrad.write(writeOnProc)) return false;
if (!pointValue.write(writeOnProc)) return false;
if (!pointGrad.write(writeOnProc)) return false;
return true;
}

View File

@ -167,7 +167,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 writeOnProc = true) const;
//- Return an internal field of the average
virtual tmp<Field<Type>> primitiveField() const = 0;

View File

@ -110,40 +110,44 @@ Foam::molecule::molecule
void Foam::molecule::readFields(Cloud<molecule>& mC)
{
const bool valid = mC.size();
const bool readOnProc = mC.size();
particle::readFields(mC);
IOField<tensor> Q(mC.fieldIOobject("Q", IOobject::MUST_READ), valid);
IOField<tensor> Q(mC.fieldIOobject("Q", IOobject::MUST_READ), readOnProc);
mC.checkFieldIOobject(mC, Q);
IOField<vector> v(mC.fieldIOobject("v", IOobject::MUST_READ), valid);
IOField<vector> v(mC.fieldIOobject("v", IOobject::MUST_READ), readOnProc);
mC.checkFieldIOobject(mC, v);
IOField<vector> a(mC.fieldIOobject("a", IOobject::MUST_READ), valid);
IOField<vector> a(mC.fieldIOobject("a", IOobject::MUST_READ), readOnProc);
mC.checkFieldIOobject(mC, a);
IOField<vector> pi(mC.fieldIOobject("pi", IOobject::MUST_READ), valid);
IOField<vector> pi(mC.fieldIOobject("pi", IOobject::MUST_READ), readOnProc);
mC.checkFieldIOobject(mC, pi);
IOField<vector> tau(mC.fieldIOobject("tau", IOobject::MUST_READ), valid);
IOField<vector> tau
(
mC.fieldIOobject("tau", IOobject::MUST_READ),
readOnProc
);
mC.checkFieldIOobject(mC, tau);
IOField<vector> specialPosition
(
mC.fieldIOobject("specialPosition", IOobject::MUST_READ),
valid
readOnProc
);
mC.checkFieldIOobject(mC, specialPosition);
IOField<label> special
(
mC.fieldIOobject("special", IOobject::MUST_READ),
valid
readOnProc
);
mC.checkFieldIOobject(mC, special);
IOField<label> id(mC.fieldIOobject("id", IOobject::MUST_READ), valid);
IOField<label> id(mC.fieldIOobject("id", IOobject::MUST_READ), readOnProc);
mC.checkFieldIOobject(mC, id);
label i = 0;
@ -168,7 +172,7 @@ void Foam::molecule::writeFields(const Cloud<molecule>& mC)
particle::writeFields(mC);
const label np = mC.size();
const bool valid = np;
const bool writeOnProc = mC.size();
IOField<tensor> Q(mC.fieldIOobject("Q", IOobject::NO_READ), np);
IOField<vector> v(mC.fieldIOobject("v", IOobject::NO_READ), np);
@ -237,21 +241,21 @@ void Foam::molecule::writeFields(const Cloud<molecule>& mC)
++i;
}
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(writeOnProc);
v.write(writeOnProc);
a.write(writeOnProc);
pi.write(writeOnProc);
tau.write(writeOnProc);
specialPosition.write(writeOnProc);
special.write(writeOnProc);
id.write(writeOnProc);
piGlobal.write(valid);
tauGlobal.write(valid);
piGlobal.write(writeOnProc);
tauGlobal.write(writeOnProc);
orientation1.write(valid);
orientation2.write(valid);
orientation3.write(valid);
orientation1.write(writeOnProc);
orientation2.write(writeOnProc);
orientation3.write(writeOnProc);
Info<< "writeFields " << mC.name() << endl;

View File

@ -78,14 +78,14 @@ Foam::solidParticle::solidParticle
void Foam::solidParticle::readFields(Cloud<solidParticle>& c)
{
bool valid = c.size();
const bool readOnProc = c.size();
particle::readFields(c);
IOField<scalar> d(c.fieldIOobject("d", IOobject::MUST_READ), valid);
IOField<scalar> d(c.fieldIOobject("d", IOobject::MUST_READ), readOnProc);
c.checkFieldIOobject(c, d);
IOField<vector> U(c.fieldIOobject("U", IOobject::MUST_READ), valid);
IOField<vector> U(c.fieldIOobject("U", IOobject::MUST_READ), readOnProc);
c.checkFieldIOobject(c, U);
label i = 0;
@ -103,6 +103,7 @@ void Foam::solidParticle::writeFields(const Cloud<solidParticle>& c)
particle::writeFields(c);
const label np = c.size();
const bool writeOnProc = c.size();
IOField<scalar> d(c.fieldIOobject("d", IOobject::NO_READ), np);
IOField<vector> U(c.fieldIOobject("U", IOobject::NO_READ), np);
@ -115,8 +116,8 @@ void Foam::solidParticle::writeFields(const Cloud<solidParticle>& c)
++i;
}
d.write(np > 0);
U.write(np > 0);
d.write(writeOnProc);
U.write(writeOnProc);
}

View File

@ -135,86 +135,90 @@ void Foam::SprayParcel<ParcelType>::readFields
const CompositionType& compModel
)
{
const bool valid = c.size();
const bool readOnProc = 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), readOnProc);
c.checkFieldIOobject(c, d0);
IOField<vector> position0
(
c.fieldIOobject("position0", IOobject::MUST_READ),
valid
readOnProc
);
c.checkFieldIOobject(c, position0);
IOField<scalar> sigma(c.fieldIOobject("sigma", IOobject::MUST_READ), valid);
IOField<scalar> sigma
(
c.fieldIOobject("sigma", IOobject::MUST_READ),
readOnProc
);
c.checkFieldIOobject(c, sigma);
IOField<scalar> mu(c.fieldIOobject("mu", IOobject::MUST_READ), valid);
IOField<scalar> mu(c.fieldIOobject("mu", IOobject::MUST_READ), readOnProc);
c.checkFieldIOobject(c, mu);
IOField<scalar> liquidCore
(
c.fieldIOobject("liquidCore", IOobject::MUST_READ),
valid
readOnProc
);
c.checkFieldIOobject(c, liquidCore);
IOField<scalar> KHindex
(
c.fieldIOobject("KHindex", IOobject::MUST_READ),
valid
readOnProc
);
c.checkFieldIOobject(c, KHindex);
IOField<scalar> y
(
c.fieldIOobject("y", IOobject::MUST_READ),
valid
readOnProc
);
c.checkFieldIOobject(c, y);
IOField<scalar> yDot
(
c.fieldIOobject("yDot", IOobject::MUST_READ),
valid
readOnProc
);
c.checkFieldIOobject(c, yDot);
IOField<scalar> tc
(
c.fieldIOobject("tc", IOobject::MUST_READ),
valid
readOnProc
);
c.checkFieldIOobject(c, tc);
IOField<scalar> ms
(
c.fieldIOobject("ms", IOobject::MUST_READ),
valid
readOnProc
);
c.checkFieldIOobject(c, ms);
IOField<scalar> injector
(
c.fieldIOobject("injector", IOobject::MUST_READ),
valid
readOnProc
);
c.checkFieldIOobject(c, injector);
IOField<scalar> tMom
(
c.fieldIOobject("tMom", IOobject::MUST_READ),
valid
readOnProc
);
c.checkFieldIOobject(c, tMom);
IOField<scalar> user
(
c.fieldIOobject("user", IOobject::MUST_READ),
valid
readOnProc
);
c.checkFieldIOobject(c, user);
@ -259,8 +263,7 @@ void Foam::SprayParcel<ParcelType>::writeFields
ParcelType::writeFields(c, compModel);
const label np = c.size();
const bool valid = np;
const bool writeOnProc = c.size();
IOField<scalar> d0(c.fieldIOobject("d0", IOobject::NO_READ), np);
IOField<vector> position0
@ -307,19 +310,19 @@ void Foam::SprayParcel<ParcelType>::writeFields
++i;
}
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(writeOnProc);
position0.write(writeOnProc);
sigma.write(writeOnProc);
mu.write(writeOnProc);
liquidCore.write(writeOnProc);
KHindex.write(writeOnProc);
y.write(writeOnProc);
yDot.write(writeOnProc);
tc.write(writeOnProc);
ms.write(writeOnProc);
injector.write(writeOnProc);
tMom.write(writeOnProc);
user.write(writeOnProc);
}

View File

@ -1265,7 +1265,7 @@ void Foam::triSurfaceMesh::getVolumeType
bool Foam::triSurfaceMesh::writeObject
(
IOstreamOption,
const bool valid
const bool writeOnProc
) const
{
const Time& runTime = searchableSurface::time();

View File

@ -316,7 +316,7 @@ public:
virtual bool writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const;
//- Is object global

View File

@ -229,13 +229,13 @@ Foam::label Foam::cellZoneSet::maxSize(const polyMesh& mesh) const
bool Foam::cellZoneSet::writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const
{
// Write shadow cellSet
word oldTypeName = typeName;
const_cast<word&>(type()) = cellSet::typeName;
bool ok = cellSet::writeObject(streamOpt, valid);
bool ok = cellSet::writeObject(streamOpt, writeOnProc);
const_cast<word&>(type()) = oldTypeName;
// Modify cellZone
@ -265,7 +265,7 @@ bool Foam::cellZoneSet::writeObject
}
cellZones.clearAddressing();
return ok && cellZones.write(valid);
return ok && cellZones.write(writeOnProc);
}

View File

@ -143,7 +143,7 @@ public:
virtual bool writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const;
//- Update any stored data for new labels

View File

@ -445,13 +445,13 @@ Foam::label Foam::faceZoneSet::maxSize(const polyMesh& mesh) const
bool Foam::faceZoneSet::writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const
{
// Write shadow faceSet
word oldTypeName = typeName;
const_cast<word&>(type()) = faceSet::typeName;
bool ok = faceSet::writeObject(streamOpt, valid);
bool ok = faceSet::writeObject(streamOpt, writeOnProc);
const_cast<word&>(type()) = oldTypeName;
// Modify faceZone
@ -482,7 +482,7 @@ bool Foam::faceZoneSet::writeObject
}
faceZones.clearAddressing();
return ok && faceZones.write(valid);
return ok && faceZones.write(writeOnProc);
}

View File

@ -157,7 +157,7 @@ public:
virtual bool writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const;
//- Update any stored data for new labels

View File

@ -229,13 +229,13 @@ Foam::label Foam::pointZoneSet::maxSize(const polyMesh& mesh) const
bool Foam::pointZoneSet::writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const
{
// Write shadow pointSet
word oldTypeName = typeName;
const_cast<word&>(type()) = pointSet::typeName;
bool ok = pointSet::writeObject(streamOpt, valid);
bool ok = pointSet::writeObject(streamOpt, writeOnProc);
const_cast<word&>(type()) = oldTypeName;
// Modify pointZone
@ -265,7 +265,7 @@ bool Foam::pointZoneSet::writeObject
}
pointZones.clearAddressing();
return ok && pointZones.write(valid);
return ok && pointZones.write(writeOnProc);
}

View File

@ -144,7 +144,7 @@ public:
virtual bool writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const;
//- Update any stored data for new labels

View File

@ -25,7 +25,6 @@ License
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::incompressiblePrimalSolver

View File

@ -74,11 +74,12 @@ bool Foam::dynamicOversetFvMesh::update()
bool Foam::dynamicOversetFvMesh::writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const
{
bool ok = dynamicMotionSolverListFvMesh::writeObject(streamOpt, valid);
ok = oversetFvMeshBase::writeObject(streamOpt, valid) && ok;
bool ok =
dynamicMotionSolverListFvMesh::writeObject(streamOpt, writeOnProc);
ok = oversetFvMeshBase::writeObject(streamOpt, writeOnProc) && ok;
return ok;
}

View File

@ -210,7 +210,7 @@ public:
virtual bool writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const;
};

View File

@ -633,7 +633,7 @@ bool Foam::oversetFvMeshBase::interpolateFields()
bool Foam::oversetFvMeshBase::writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const
{
// For postprocessing : write cellTypes and zoneID
@ -664,7 +664,7 @@ bool Foam::oversetFvMeshBase::writeObject
volTypes[cellI] = cellTypes[cellI];
}
volTypes.correctBoundaryConditions();
volTypes.writeObject(streamOpt, valid);
volTypes.writeObject(streamOpt, writeOnProc);
}
{
volScalarField volZoneID
@ -691,7 +691,7 @@ bool Foam::oversetFvMeshBase::writeObject
volZoneID[cellI] = zoneID[cellI];
}
volZoneID.correctBoundaryConditions();
volZoneID.writeObject(streamOpt, valid);
volZoneID.writeObject(streamOpt, writeOnProc);
}
if (debug)
{
@ -752,7 +752,7 @@ bool Foam::oversetFvMeshBase::writeObject
(
volDonorZoneID
);
ok = volDonorZoneID.writeObject(streamOpt, valid);
ok = volDonorZoneID.writeObject(streamOpt, writeOnProc);
}
return ok;

View File

@ -248,7 +248,7 @@ public:
virtual bool writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const;
//- Debug: check halo swap is ok

View File

@ -72,11 +72,11 @@ bool Foam::staticOversetFvMesh::update()
bool Foam::staticOversetFvMesh::writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const
{
bool ok = staticFvMesh::writeObject(streamOpt, valid);
ok = oversetFvMeshBase::writeObject(streamOpt, valid) && ok;
bool ok = staticFvMesh::writeObject(streamOpt, writeOnProc);
ok = oversetFvMeshBase::writeObject(streamOpt, writeOnProc) && ok;
return ok;
}

View File

@ -209,7 +209,7 @@ public:
virtual bool writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const;
};

View File

@ -4911,14 +4911,14 @@ void Foam::distributedTriSurfaceMesh::distribute
bool Foam::distributedTriSurfaceMesh::writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const
{
if (debug)
{
Pout<< "distributedTriSurfaceMesh::writeObject :"
<< " surface " << searchableSurface::name()
<< " writing surface valid:" << valid << endl;
<< " writing surface:" << writeOnProc << endl;
}
// Make sure dictionary goes to same directory as surface

View File

@ -584,7 +584,7 @@ public:
virtual bool writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const;
//- Is object global

View File

@ -392,7 +392,7 @@ void Foam::rigidBodyMeshMotion::solve()
bool Foam::rigidBodyMeshMotion::writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const
{
// Force ASCII writing
@ -413,7 +413,7 @@ bool Foam::rigidBodyMeshMotion::writeObject
);
model_.state().write(dict);
return dict.regIOobject::writeObject(streamOpt, valid);
return dict.regIOobject::writeObject(streamOpt, writeOnProc);
}

View File

@ -177,7 +177,7 @@ public:
virtual bool writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const;
//- Read dynamicMeshDict dictionary

View File

@ -279,7 +279,7 @@ void Foam::rigidBodyMeshMotionSolver::solve()
bool Foam::rigidBodyMeshMotionSolver::writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const
{
// Force ASCII writing
@ -300,7 +300,7 @@ bool Foam::rigidBodyMeshMotionSolver::writeObject
);
model_.state().write(dict);
return dict.regIOobject::writeObject(streamOpt, valid);
return dict.regIOobject::writeObject(streamOpt, writeOnProc);
}

View File

@ -157,7 +157,7 @@ public:
virtual bool writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const;
//- Read dynamicMeshDict dictionary

View File

@ -298,7 +298,7 @@ void Foam::sixDoFRigidBodyMotionSolver::solve()
bool Foam::sixDoFRigidBodyMotionSolver::writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const
{
IOdictionary dict
@ -316,7 +316,7 @@ bool Foam::sixDoFRigidBodyMotionSolver::writeObject
);
motion_.state().write(dict);
return dict.regIOobject::write();
return dict.regIOobject::writeObject(streamOpt, writeOnProc);
}

View File

@ -145,7 +145,7 @@ public:
virtual bool writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const;
//- Read dynamicMeshDict dictionary

View File

@ -103,13 +103,13 @@ void Foam::Detail::MeshedSurfaceIOAllocator::clear()
bool Foam::Detail::MeshedSurfaceIOAllocator::writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const
{
return
(
points_.writeObject(streamOpt, valid)
&& faces_.writeObject(streamOpt, valid)
points_.writeObject(streamOpt, writeOnProc)
&& faces_.writeObject(streamOpt, writeOnProc)
);
}

View File

@ -152,7 +152,7 @@ public:
virtual bool writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const;
};

View File

@ -391,7 +391,7 @@ public:
virtual bool writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const;

View File

@ -32,7 +32,7 @@ License
bool Foam::polySurface::writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const
{
return true; // no-op

View File

@ -341,7 +341,7 @@ public:
virtual bool writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const;

View File

@ -194,14 +194,14 @@ Foam::surfMesh::readUpdateState Foam::surfMesh::readUpdate()
bool Foam::surfMesh::writeObject
(
IOstreamOption streamOpt,
const bool valid
const bool writeOnProc
) const
{
bool ok = Allocator::writeObject(streamOpt, valid);
bool ok = Allocator::writeObject(streamOpt, writeOnProc);
if (ok)
{
surfZones_.writeObject(streamOpt, valid);
surfZones_.writeObject(streamOpt, writeOnProc);
}
return ok;