Compare commits
3 Commits
master
...
wip-develo
Author | SHA1 | Date | |
---|---|---|---|
|
622f476b32 | ||
|
7389ce15ce | ||
|
f801e99f9e |
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -93,10 +93,7 @@ CONSTRUCT
|
||||
|
||||
/*
|
||||
//Initialise with the value entry if evaluation is not possible
|
||||
FVPATCHF::operator=
|
||||
(
|
||||
FIELD("value", dict, p.size())
|
||||
);
|
||||
this->readValueEntry(dict, IOobjectOption::MUST_READ);
|
||||
this->refValue() = *this;
|
||||
*/
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -77,7 +77,7 @@ class CompactIOField
|
||||
// Private Member Functions
|
||||
|
||||
//- Read according to header type
|
||||
void readFromStream(const bool valid = true);
|
||||
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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -127,7 +127,7 @@ public:
|
||||
virtual bool writeObject
|
||||
(
|
||||
IOstreamOption streamOpt,
|
||||
const bool valid
|
||||
const bool writeOnProc
|
||||
) const;
|
||||
|
||||
virtual bool writeData(Ostream&) const;
|
||||
|
@ -59,7 +59,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,9 +68,9 @@ Foam::IOField<Type>::IOField(const IOobject& io, const bool valid)
|
||||
|
||||
if (isReadRequired())
|
||||
{
|
||||
Istream& is = readStream(typeName, valid);
|
||||
Istream& is = readStream(typeName, readOnProc);
|
||||
|
||||
if (valid)
|
||||
if (readOnProc)
|
||||
{
|
||||
is >> *this;
|
||||
}
|
||||
@ -78,11 +78,11 @@ Foam::IOField<Type>::IOField(const IOobject& io, const bool valid)
|
||||
}
|
||||
else if (isReadOptional())
|
||||
{
|
||||
bool haveFile = headerOk();
|
||||
const bool haveFile = headerOk();
|
||||
|
||||
Istream& is = readStream(typeName, haveFile && valid);
|
||||
Istream& is = readStream(typeName, readOnProc && haveFile);
|
||||
|
||||
if (valid && haveFile)
|
||||
if (readOnProc && haveFile)
|
||||
{
|
||||
is >> *this;
|
||||
}
|
||||
|
@ -80,7 +80,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);
|
||||
|
@ -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;
|
||||
|
@ -188,7 +188,7 @@ public:
|
||||
virtual bool writeObject
|
||||
(
|
||||
IOstreamOption streamOpt,
|
||||
const bool valid
|
||||
const bool writeOnProc
|
||||
) const;
|
||||
|
||||
|
||||
|
@ -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)
|
||||
{}
|
||||
|
||||
|
||||
|
@ -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
|
||||
)
|
||||
{}
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -585,7 +585,7 @@ public:
|
||||
virtual bool writeObject
|
||||
(
|
||||
IOstreamOption streamOpt,
|
||||
const bool valid
|
||||
const bool writeOnProc
|
||||
) const;
|
||||
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -162,7 +162,7 @@ public:
|
||||
(
|
||||
const regIOobject&,
|
||||
IOstreamOption streamOpt = IOstreamOption(),
|
||||
const bool valid = true
|
||||
const bool writeOnProc = true
|
||||
) const;
|
||||
|
||||
// Other
|
||||
|
@ -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());
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
||||
|
@ -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
|
||||
)
|
||||
);
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
||||
|
@ -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));
|
||||
|
@ -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;
|
||||
};
|
||||
|
||||
|
@ -386,7 +386,7 @@ bool Foam::profiling::writeData(Ostream& os) const
|
||||
bool Foam::profiling::writeObject
|
||||
(
|
||||
IOstreamOption,
|
||||
const bool valid
|
||||
const bool writeOnProc
|
||||
) const
|
||||
{
|
||||
return
|
||||
|
@ -260,7 +260,7 @@ public:
|
||||
virtual bool writeObject
|
||||
(
|
||||
IOstreamOption /*ignore*/,
|
||||
const bool valid
|
||||
const bool writeOnProc
|
||||
) const;
|
||||
};
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -315,7 +315,7 @@ public:
|
||||
virtual bool writeObject
|
||||
(
|
||||
IOstreamOption streamOpt,
|
||||
const bool valid
|
||||
const bool writeOnProc
|
||||
) const;
|
||||
|
||||
|
||||
|
@ -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
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
||||
|
@ -76,9 +76,66 @@ static unsigned char readHexDigit(Istream& is)
|
||||
} // End namespace Foam
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
namespace
|
||||
{
|
||||
|
||||
bool Foam::SHA1Digest::isEqual(const char* hexdigits, std::size_t len) const
|
||||
// Copy assign digest from content
|
||||
bool assign
|
||||
(
|
||||
std::array<unsigned char, 20>& digest,
|
||||
const unsigned char* content,
|
||||
std::size_t len
|
||||
)
|
||||
{
|
||||
if (!content || !len)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (len == digest.size())
|
||||
{
|
||||
// ie, std::copy
|
||||
for (auto& val : digest)
|
||||
{
|
||||
val = *content;
|
||||
++content;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Skip possible '_' prefix
|
||||
if (*content == '_')
|
||||
{
|
||||
++content;
|
||||
--len;
|
||||
}
|
||||
|
||||
// Incorrect length - can never assign
|
||||
if (len != 2*digest.size())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for (auto& val : digest)
|
||||
{
|
||||
const unsigned char upp = *content++;
|
||||
const unsigned char low = *content++;
|
||||
|
||||
val = (upp << 4) + low;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// Byte-wise compare digest contents
|
||||
bool isEqual
|
||||
(
|
||||
const std::array<unsigned char, 20>& digest,
|
||||
const char* hexdigits,
|
||||
std::size_t len
|
||||
)
|
||||
{
|
||||
// Skip possible '_' prefix
|
||||
if (*hexdigits == '_')
|
||||
@ -88,12 +145,12 @@ bool Foam::SHA1Digest::isEqual(const char* hexdigits, std::size_t len) const
|
||||
}
|
||||
|
||||
// Incorrect length - can never match
|
||||
if (len != 2*dig_.size())
|
||||
if (len != 2*digest.size())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for (const auto& byteVal : dig_)
|
||||
for (const auto& byteVal : digest)
|
||||
{
|
||||
const char upp = hexChars[((byteVal >> 4) & 0xF)];
|
||||
const char low = hexChars[(byteVal & 0xF)];
|
||||
@ -105,6 +162,8 @@ bool Foam::SHA1Digest::isEqual(const char* hexdigits, std::size_t len) const
|
||||
return true;
|
||||
}
|
||||
|
||||
} // End anonymous namespace
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
@ -114,6 +173,20 @@ Foam::SHA1Digest::SHA1Digest()
|
||||
}
|
||||
|
||||
|
||||
Foam::SHA1Digest::SHA1Digest(const char* content, std::size_t len)
|
||||
{
|
||||
clear();
|
||||
assign(dig_, reinterpret_cast<const unsigned char*>(content), len);
|
||||
}
|
||||
|
||||
|
||||
Foam::SHA1Digest::SHA1Digest(const unsigned char* content, std::size_t len)
|
||||
{
|
||||
clear();
|
||||
assign(dig_, content, len);
|
||||
}
|
||||
|
||||
|
||||
Foam::SHA1Digest::SHA1Digest(Istream& is)
|
||||
{
|
||||
clear();
|
||||
@ -214,7 +287,7 @@ bool Foam::SHA1Digest::operator==(const std::string& hexdigits) const
|
||||
// Interpret empty string as '0000..'
|
||||
size_t len = hexdigits.length();
|
||||
|
||||
return len ? isEqual(hexdigits.data(), len) : empty();
|
||||
return len ? isEqual(dig_, hexdigits.data(), len) : empty();
|
||||
}
|
||||
|
||||
|
||||
@ -223,7 +296,7 @@ bool Foam::SHA1Digest::operator==(const char* hexdigits) const
|
||||
// Interpret nullptr or empty string as '0000..'
|
||||
size_t len = (hexdigits ? strlen(hexdigits) : 0);
|
||||
|
||||
return len ? isEqual(hexdigits, len) : empty();
|
||||
return len ? isEqual(dig_, hexdigits, len) : empty();
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -68,18 +68,12 @@ class SHA1Digest
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Pointer to the underlying digest data
|
||||
unsigned char* data()
|
||||
{
|
||||
return dig_.data();
|
||||
}
|
||||
|
||||
//- Byte-wise compare digest contents
|
||||
bool isEqual(const char* hexdigits, std::size_t len) const;
|
||||
|
||||
// Permit SHA1 to calculate the digest
|
||||
friend class SHA1;
|
||||
|
||||
//- Raw digest data (20 bytes). Non-const access for SHA1
|
||||
unsigned char* data() noexcept { return dig_.data(); }
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -94,9 +88,19 @@ public:
|
||||
//- Default construct a zero digest
|
||||
SHA1Digest();
|
||||
|
||||
//- Read construct a digest
|
||||
//- Read construct a digest from stringified content
|
||||
explicit SHA1Digest(Istream& is);
|
||||
|
||||
//- Construct digest from raw or stringified content.
|
||||
//- The length is 20 for raw digest content and 40 (or 41) for
|
||||
//- stringified versions.
|
||||
SHA1Digest(const char* content, std::size_t len);
|
||||
|
||||
//- Construct digest from raw or stringified content.
|
||||
//- The length is 20 for raw digest content and 40 (or 41) for
|
||||
//- stringified versions.
|
||||
SHA1Digest(const unsigned char* content, std::size_t len);
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -119,6 +123,30 @@ public:
|
||||
Ostream& write(Ostream& os, const bool prefixed=false) const;
|
||||
|
||||
|
||||
// Low-level access
|
||||
|
||||
//- Raw digest data (20 bytes) - const access
|
||||
const unsigned char* cdata() const noexcept { return dig_.data(); }
|
||||
|
||||
//- Raw digest data (20 bytes) - const access
|
||||
const unsigned char* cdata_bytes() const noexcept
|
||||
{
|
||||
return dig_.data();
|
||||
}
|
||||
|
||||
//- Raw digest data (20 bytes) - non-const access. Use with caution!
|
||||
unsigned char* data_bytes() noexcept
|
||||
{
|
||||
return dig_.data();
|
||||
}
|
||||
|
||||
//- The number of bytes in digest (20)
|
||||
static constexpr std::streamsize size_bytes() noexcept { return 20; }
|
||||
|
||||
//- The dimensioned size of the digest is always 20 bytes
|
||||
static constexpr unsigned max_size() noexcept { return 20; }
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Equality operator
|
||||
|
@ -52,8 +52,8 @@ turbulentMixingLengthDissipationRateInletFvPatchScalarField
|
||||
mixingLength_(0.0),
|
||||
Cmu_(0.0)
|
||||
{
|
||||
this->refValue() = 0.0;
|
||||
this->refGrad() = 0.0;
|
||||
this->refValue() = Zero;
|
||||
this->refGrad() = Zero;
|
||||
this->valueFraction() = 0.0;
|
||||
}
|
||||
|
||||
@ -92,10 +92,10 @@ turbulentMixingLengthDissipationRateInletFvPatchScalarField
|
||||
{
|
||||
this->phiName_ = dict.getOrDefault<word>("phi", "phi");
|
||||
|
||||
fvPatchScalarField::operator=(scalarField("value", dict, p.size()));
|
||||
this->readValueEntry(dict, IOobjectOption::MUST_READ);
|
||||
|
||||
this->refValue() = 0.0;
|
||||
this->refGrad() = 0.0;
|
||||
this->refValue() = Zero;
|
||||
this->refGrad() = Zero;
|
||||
this->valueFraction() = 0.0;
|
||||
}
|
||||
|
||||
|
@ -51,8 +51,8 @@ turbulentMixingLengthFrequencyInletFvPatchScalarField
|
||||
mixingLength_(0.0),
|
||||
kName_("undefined-k")
|
||||
{
|
||||
this->refValue() = 0.0;
|
||||
this->refGrad() = 0.0;
|
||||
this->refValue() = Zero;
|
||||
this->refGrad() = Zero;
|
||||
this->valueFraction() = 0.0;
|
||||
}
|
||||
|
||||
@ -84,10 +84,10 @@ turbulentMixingLengthFrequencyInletFvPatchScalarField
|
||||
{
|
||||
this->phiName_ = dict.getOrDefault<word>("phi", "phi");
|
||||
|
||||
fvPatchScalarField::operator=(scalarField("value", dict, p.size()));
|
||||
this->readValueEntry(dict, IOobjectOption::MUST_READ);
|
||||
|
||||
this->refValue() = 0.0;
|
||||
this->refGrad() = 0.0;
|
||||
this->refValue() = Zero;
|
||||
this->refGrad() = Zero;
|
||||
this->valueFraction() = 0.0;
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,7 @@ atmBoundaryLayerInletEpsilonFvPatchScalarField
|
||||
|
||||
if (!initABL_)
|
||||
{
|
||||
scalarField::operator=(scalarField("value", dict, p.size()));
|
||||
this->readValueEntry(dict, IOobjectOption::MUST_READ);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -70,7 +70,7 @@ atmBoundaryLayerInletKFvPatchScalarField
|
||||
|
||||
if (!initABL_)
|
||||
{
|
||||
scalarField::operator=(scalarField("value", dict, p.size()));
|
||||
this->readValueEntry(dict, IOobjectOption::MUST_READ);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -69,7 +69,7 @@ atmBoundaryLayerInletOmegaFvPatchScalarField
|
||||
|
||||
if (!initABL_)
|
||||
{
|
||||
scalarField::operator=(scalarField("value", dict, p.size()));
|
||||
this->readValueEntry(dict, IOobjectOption::MUST_READ);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -70,7 +70,7 @@ atmBoundaryLayerInletVelocityFvPatchVectorField
|
||||
|
||||
if (!initABL_)
|
||||
{
|
||||
vectorField::operator=(vectorField("value", dict, p.size()));
|
||||
this->readValueEntry(dict, IOobjectOption::MUST_READ);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -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_)
|
||||
|
@ -280,7 +280,7 @@ public:
|
||||
virtual bool writeObject
|
||||
(
|
||||
IOstreamOption streamOpt,
|
||||
const bool valid
|
||||
const bool writeOnProc
|
||||
) const;
|
||||
};
|
||||
|
||||
|
@ -242,7 +242,7 @@ Foam::displacementLayeredMotionMotionSolver::faceZoneEvaluate
|
||||
|
||||
if (type == "fixedValue")
|
||||
{
|
||||
fld = vectorField("value", dict, meshPoints.size());
|
||||
fld.assign("value", dict, meshPoints.size());
|
||||
}
|
||||
else if (type == "timeVaryingUniformFixedValue")
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -174,7 +174,7 @@ public:
|
||||
virtual bool writeObject
|
||||
(
|
||||
IOstreamOption streamOpt,
|
||||
const bool valid
|
||||
const bool writeOnProc
|
||||
) const;
|
||||
|
||||
//- Read dynamicMeshDict dictionary
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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&);
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -244,7 +244,7 @@ public:
|
||||
virtual bool writeObject
|
||||
(
|
||||
IOstreamOption streamOpt,
|
||||
const bool valid
|
||||
const bool writeOnProc
|
||||
) const;
|
||||
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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
|
||||
|
@ -77,8 +77,7 @@ SRFFreestreamVelocityFvPatchVectorField
|
||||
UInf_(dict.get<vector>("UInf"))
|
||||
{
|
||||
this->phiName_ = dict.getOrDefault<word>("phi", "phi");
|
||||
|
||||
fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
|
||||
this->readValueEntry(dict, IOobjectOption::MUST_READ);
|
||||
}
|
||||
|
||||
|
||||
|
@ -72,7 +72,7 @@ fixedNormalInletOutletVelocityFvPatchVectorField
|
||||
)
|
||||
{
|
||||
fvPatchFieldBase::readDict(dict);
|
||||
fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
|
||||
this->readValueEntry(dict, IOobjectOption::MUST_READ);
|
||||
refValue() = normalVelocity();
|
||||
refGrad() = Zero;
|
||||
valueFraction() = Zero;
|
||||
|
@ -49,15 +49,14 @@ Foam::freestreamVelocityFvPatchVectorField::freestreamVelocityFvPatchVectorField
|
||||
:
|
||||
mixedFvPatchVectorField(p, iF)
|
||||
{
|
||||
freestreamValue() = vectorField("freestreamValue", dict, p.size());
|
||||
freestreamValue().assign("freestreamValue", dict, p.size());
|
||||
refGrad() = Zero;
|
||||
valueFraction() = 1;
|
||||
|
||||
if (!this->readValueEntry(dict))
|
||||
{
|
||||
fvPatchVectorField::operator=(freestreamValue());
|
||||
}
|
||||
|
||||
refGrad() = Zero;
|
||||
valueFraction() = 1;
|
||||
}
|
||||
|
||||
|
||||
|
@ -82,7 +82,7 @@ pressureDirectedInletOutletVelocityFvPatchVectorField
|
||||
inletDir_("inletDirection", dict, p.size())
|
||||
{
|
||||
fvPatchFieldBase::readDict(dict);
|
||||
fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
|
||||
this->readValueEntry(dict, IOobjectOption::MUST_READ);
|
||||
refValue() = *this;
|
||||
refGrad() = Zero;
|
||||
valueFraction() = 0.0;
|
||||
|
@ -80,7 +80,7 @@ pressureInletOutletParSlipVelocityFvPatchVectorField
|
||||
rhoName_(dict.getOrDefault<word>("rho", "rho"))
|
||||
{
|
||||
fvPatchFieldBase::readDict(dict);
|
||||
fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
|
||||
this->readValueEntry(dict, IOobjectOption::MUST_READ);
|
||||
refValue() = *this;
|
||||
refGrad() = Zero;
|
||||
valueFraction() = 0.0;
|
||||
|
@ -81,7 +81,7 @@ pressureInletOutletVelocityFvPatchVectorField
|
||||
phiName_(dict.getOrDefault<word>("phi", "phi"))
|
||||
{
|
||||
fvPatchFieldBase::readDict(dict);
|
||||
fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
|
||||
this->readValueEntry(dict, IOobjectOption::MUST_READ);
|
||||
|
||||
if (dict.found("tangentialVelocity"))
|
||||
{
|
||||
|
@ -80,7 +80,7 @@ pressureNormalInletOutletVelocityFvPatchVectorField
|
||||
rhoName_(dict.getOrDefault<word>("rho", "rho"))
|
||||
{
|
||||
fvPatchFieldBase::readDict(dict);
|
||||
fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
|
||||
this->readValueEntry(dict, IOobjectOption::MUST_READ);
|
||||
refValue() = *this;
|
||||
refGrad() = Zero;
|
||||
valueFraction() = 0.0;
|
||||
|
@ -84,7 +84,7 @@ pressurePermeableAlphaInletOutletVelocityFvPatchVectorField
|
||||
alphaMin_(dict.getOrDefault<scalar>("alphaMin", 1))
|
||||
{
|
||||
fvPatchFieldBase::readDict(dict);
|
||||
fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
|
||||
this->readValueEntry(dict, IOobjectOption::MUST_READ);
|
||||
refValue() = Zero;
|
||||
refGrad() = Zero;
|
||||
valueFraction() = 1.0;
|
||||
|
@ -45,8 +45,8 @@ turbulentIntensityKineticEnergyInletFvPatchScalarField
|
||||
intensity_(0.0),
|
||||
UName_("U")
|
||||
{
|
||||
this->refValue() = 0.0;
|
||||
this->refGrad() = 0.0;
|
||||
this->refValue() = Zero;
|
||||
this->refGrad() = Zero;
|
||||
this->valueFraction() = 0.0;
|
||||
}
|
||||
|
||||
@ -91,10 +91,10 @@ turbulentIntensityKineticEnergyInletFvPatchScalarField
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
fvPatchScalarField::operator=(scalarField("value", dict, p.size()));
|
||||
this->readValueEntry(dict, IOobjectOption::MUST_READ);
|
||||
|
||||
this->refValue() = 0.0;
|
||||
this->refGrad() = 0.0;
|
||||
this->refValue() = Zero;
|
||||
this->refGrad() = Zero;
|
||||
this->valueFraction() = 0.0;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -269,7 +269,7 @@ public:
|
||||
virtual bool writeObject
|
||||
(
|
||||
IOstreamOption streamOpt,
|
||||
const bool valid
|
||||
const bool writeOnProc
|
||||
) const;
|
||||
|
||||
//- Write positions to \<cloudName\>_positions.obj file
|
||||
|
@ -134,15 +134,15 @@ 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 readOnProc = ioP.headerOk();
|
||||
Istream& is = ioP.readStream(checkClass ? typeName : "", readOnProc);
|
||||
if (readOnProc)
|
||||
{
|
||||
ioP.readData(is, *this);
|
||||
ioP.close();
|
||||
}
|
||||
|
||||
if (!valid && debug)
|
||||
if (!readOnProc && debug)
|
||||
{
|
||||
Pout<< "Cannot read particle positions file:" << nl
|
||||
<< " " << ioP.objectPath() << nl
|
||||
@ -329,7 +329,7 @@ template<class ParticleType>
|
||||
bool Foam::Cloud<ParticleType>::writeObject
|
||||
(
|
||||
IOstreamOption streamOpt,
|
||||
const bool
|
||||
const bool /* writeOnProc */
|
||||
) const
|
||||
{
|
||||
writeCloudUniformProperties();
|
||||
|
@ -54,7 +54,10 @@ 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());
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ public:
|
||||
|
||||
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;
|
||||
};
|
||||
|
@ -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);
|
||||
|
||||
@ -169,13 +169,12 @@ void Foam::particle::readFields(TrackCloudType& c)
|
||||
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,18 +191,18 @@ void Foam::particle::writeFields(const TrackCloudType& c)
|
||||
c,
|
||||
cloud::geometryType::POSITIONS
|
||||
);
|
||||
ioP.write(valid);
|
||||
ioP.write(writeOnProc);
|
||||
}
|
||||
|
||||
IOField<label> origProc
|
||||
(
|
||||
c.fieldIOobject("origProcId", IOobject::NO_READ),
|
||||
np
|
||||
writeOnProc
|
||||
);
|
||||
IOField<label> origId
|
||||
(
|
||||
c.fieldIOobject("origId", IOobject::NO_READ),
|
||||
np
|
||||
writeOnProc
|
||||
);
|
||||
|
||||
label i = 0;
|
||||
@ -215,8 +214,8 @@ void Foam::particle::writeFields(const TrackCloudType& c)
|
||||
++i;
|
||||
}
|
||||
|
||||
origProc.write(valid);
|
||||
origId.write(valid);
|
||||
origProc.write(writeOnProc);
|
||||
origId.write(writeOnProc);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -311,6 +311,7 @@ void Foam::ReactingHeterogeneousParcel<ParcelType>::readObjects
|
||||
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 +333,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 +343,7 @@ void Foam::ReactingHeterogeneousParcel<ParcelType>::writeObjects
|
||||
break;
|
||||
}
|
||||
|
||||
if (np > 0)
|
||||
if (writeOnProc)
|
||||
{
|
||||
for (label i = 0; i < nF; i++)
|
||||
{
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -335,10 +336,10 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::readObjects
|
||||
{
|
||||
ParcelType::readObjects(c, obr);
|
||||
|
||||
const label np = c.size();
|
||||
const bool writeOnProc = c.size();
|
||||
|
||||
// The composition fractions
|
||||
if (np > 0)
|
||||
if (writeOnProc)
|
||||
{
|
||||
const wordList& stateLabels = compModel.stateLabels();
|
||||
|
||||
@ -402,9 +403,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();
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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();
|
||||
|
@ -316,7 +316,7 @@ public:
|
||||
virtual bool writeObject
|
||||
(
|
||||
IOstreamOption streamOpt,
|
||||
const bool valid
|
||||
const bool writeOnProc
|
||||
) const;
|
||||
|
||||
//- Is object global
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -143,7 +143,7 @@ public:
|
||||
virtual bool writeObject
|
||||
(
|
||||
IOstreamOption streamOpt,
|
||||
const bool valid
|
||||
const bool writeOnProc
|
||||
) const;
|
||||
|
||||
//- Update any stored data for new labels
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -157,7 +157,7 @@ public:
|
||||
virtual bool writeObject
|
||||
(
|
||||
IOstreamOption streamOpt,
|
||||
const bool valid
|
||||
const bool writeOnProc
|
||||
) const;
|
||||
|
||||
//- Update any stored data for new labels
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -144,7 +144,7 @@ public:
|
||||
virtual bool writeObject
|
||||
(
|
||||
IOstreamOption streamOpt,
|
||||
const bool valid
|
||||
const bool writeOnProc
|
||||
) const;
|
||||
|
||||
//- Update any stored data for new labels
|
||||
|
@ -73,10 +73,7 @@ adjointFarFieldPressureFvPatchScalarField
|
||||
fixedValueFvPatchScalarField(p, iF),
|
||||
adjointScalarBoundaryCondition(p, iF, dict.get<word>("solverName"))
|
||||
{
|
||||
fvPatchField<scalar>::operator=
|
||||
(
|
||||
scalarField("value", dict, p.size())
|
||||
);
|
||||
this->readValueEntry(dict, IOobjectOption::MUST_READ);
|
||||
}
|
||||
|
||||
|
||||
|
@ -69,10 +69,7 @@ adjointFarFieldVelocityFvPatchVectorField
|
||||
fixedValueFvPatchVectorField(p, iF),
|
||||
adjointVectorBoundaryCondition(p, iF, dict.get<word>("solverName"))
|
||||
{
|
||||
fvPatchField<vector>::operator=
|
||||
(
|
||||
vectorField("value", dict, p.size())
|
||||
);
|
||||
this->readValueEntry(dict, IOobjectOption::MUST_READ);
|
||||
}
|
||||
|
||||
|
||||
|
@ -71,10 +71,7 @@ adjointInletVelocityFvPatchVectorField
|
||||
fixedValueFvPatchVectorField(p, iF),
|
||||
adjointVectorBoundaryCondition(p, iF, dict.get<word>("solverName"))
|
||||
{
|
||||
fvPatchField<vector>::operator=
|
||||
(
|
||||
vectorField("value", dict, p.size())
|
||||
);
|
||||
this->readValueEntry(dict, IOobjectOption::MUST_READ);
|
||||
}
|
||||
|
||||
|
||||
|
@ -74,10 +74,7 @@ adjointOutletPressureFvPatchScalarField
|
||||
fixedValueFvPatchScalarField(p, iF),
|
||||
adjointScalarBoundaryCondition(p, iF, dict.get<word>("solverName"))
|
||||
{
|
||||
fvPatchField<scalar>::operator=
|
||||
(
|
||||
scalarField("value", dict, p.size())
|
||||
);
|
||||
this->readValueEntry(dict, IOobjectOption::MUST_READ);
|
||||
}
|
||||
|
||||
|
||||
|
@ -131,10 +131,7 @@ adjointOutletVelocityFvPatchVectorField
|
||||
fixedValueFvPatchVectorField(p, iF),
|
||||
adjointVectorBoundaryCondition(p, iF, dict.get<word>("solverName"))
|
||||
{
|
||||
fvPatchField<vector>::operator=
|
||||
(
|
||||
vectorField("value", dict, p.size())
|
||||
);
|
||||
this->readValueEntry(dict, IOobjectOption::MUST_READ);
|
||||
}
|
||||
|
||||
|
||||
|
@ -71,10 +71,7 @@ adjointOutletVelocityFluxFvPatchVectorField
|
||||
fixedValueFvPatchVectorField(p, iF),
|
||||
adjointVectorBoundaryCondition(p, iF, dict.get<word>("solverName"))
|
||||
{
|
||||
fvPatchField<vector>::operator=
|
||||
(
|
||||
vectorField("value", dict, p.size())
|
||||
);
|
||||
this->readValueEntry(dict, IOobjectOption::MUST_READ);
|
||||
}
|
||||
|
||||
|
||||
|
@ -77,10 +77,7 @@ adjointWallVelocityFvPatchVectorField
|
||||
kappa_(dict.getOrDefault<scalar>("kappa", 0.41)),
|
||||
E_(dict.getOrDefault<scalar>("E", 9.8))
|
||||
{
|
||||
fvPatchField<vector>::operator=
|
||||
(
|
||||
vectorField("value", dict, p.size())
|
||||
);
|
||||
this->readValueEntry(dict, IOobjectOption::MUST_READ);
|
||||
}
|
||||
|
||||
|
||||
|
@ -70,10 +70,7 @@ adjointWallVelocityLowReFvPatchVectorField
|
||||
fixedValueFvPatchVectorField(p, iF),
|
||||
adjointVectorBoundaryCondition(p, iF, dict.get<word>("solverName"))
|
||||
{
|
||||
fvPatchField<vector>::operator=
|
||||
(
|
||||
vectorField("value", dict, p.size())
|
||||
);
|
||||
this->readValueEntry(dict, IOobjectOption::MUST_READ);
|
||||
}
|
||||
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user