The decomposedBlockData comprise a List<char> for each output processor, typically with IO on the master processor only.
More...
#include <decomposedBlockData.H>


Public Member Functions | |
| TypeName ("decomposedBlockData") | |
| Declare type-name, virtual type (with debug switch). | |
| decomposedBlockData (const label comm, const IOobject &io, const UPstream::commsTypes=UPstream::commsTypes::scheduled) | |
| Construct given an IOobject. | |
| virtual | ~decomposedBlockData ()=default |
| Destructor. | |
| virtual bool | read () |
| Read object. | |
| virtual bool | writeData (Ostream &os) const |
| Write separated content (assumes content is the serialised data). | |
| virtual bool | writeObject (IOstreamOption streamOpt, const bool writeOnProc) const |
| Write using stream options. | |
| Public Member Functions inherited from regIOobject | |
| void | operator= (const regIOobject &)=delete |
| No copy assignment. | |
| TypeName ("regIOobject") | |
| Runtime type information. | |
| regIOobject (const IOobject &io, const bool isTimeObject=false) | |
| Construct from IOobject. The optional flag adds special handling if the object is the top-level regIOobject (eg, Time). | |
| regIOobject (const regIOobject &rio) | |
| Copy construct. | |
| regIOobject (const regIOobject &rio, bool registerCopy) | |
| Copy construct, transferring registry registration to the copy if registerCopy is true. | |
| regIOobject (const word &newName, const regIOobject &, bool registerCopy) | |
| Copy construct with new name, transferring registry registration to the copy if registerCopy is true. | |
| regIOobject (const IOobject &io, const regIOobject &rio) | |
| Copy construct with new IO parameters. | |
| virtual | ~regIOobject () |
| Destructor. | |
| bool | checkIn () |
| Add object to registry, if not already registered. | |
| bool | checkOut () |
| Remove object from registry, and remove all file watches. | |
| virtual void | addWatch () |
| Add file watch on object (if registered and READ_IF_MODIFIED). | |
| bool | registered () const noexcept |
| Query the registered state (ie, has been checked in). This is not necessarily the same as registerObject(), which is just a stated preference. | |
| bool | ownedByRegistry () const noexcept |
| Is this object owned by the registry? | |
| bool | store () |
| Register object with its registry and transfer ownership to the registry. | |
| void | release (const bool unregister=false) noexcept |
| Set object as not ownedByRegistry. | |
| label | eventNo () const noexcept |
| Event number at last update. | |
| label & | eventNo () noexcept |
| Event number at last update. | |
| bool | upToDate (const regIOobject &) const |
| Return true if up-to-date with respect to given object. | |
| bool | upToDate (const regIOobject &, const regIOobject &) const |
| Return true if up-to-date with respect to given objects. | |
| bool | upToDate (const regIOobject &, const regIOobject &, const regIOobject &) const |
| Return true if up-to-date with respect to given objects. | |
| bool | upToDate (const regIOobject &, const regIOobject &, const regIOobject &, const regIOobject &) const |
| Return true if up-to-date with respect to given objects. | |
| void | setUpToDate () |
| Set as up-to-date. | |
| virtual void | rename (const word &newName) |
| Rename. | |
| const dictionary * | findMetaData () const noexcept |
| Return pointer to meta-data or nullptr. | |
| dictionary & | getMetaData () noexcept |
| Get or create meta-data. | |
| void | removeMetaData () |
| Remove meta-data. | |
| virtual void | updateMetaData () |
| Update internal meta-data (eg, prior to writing). | |
| virtual fileName | filePath () const |
| Return complete path + object name if the file exists. | |
| bool | headerOk () |
| Read and check header info. Does not check the headerClassName. | |
| Istream & | readStream (const word &, const bool readOnProc=true) |
| Return Istream and check object type against that given. | |
| void | close () |
| Close Istream. | |
| virtual bool | readData (Istream &) |
| Virtual readData function. | |
| virtual label | addWatch (const fileName &) |
| Add file watch for fileName on object if not yet watched. | |
| const labelList & | watchIndices () const noexcept |
| Read access to file-monitoring handles. | |
| labelList & | watchIndices () noexcept |
| Write access to file-monitoring handles. | |
| virtual bool | modified () const |
| Return true if the object's file (or files for objectRegistry) have been modified. (modified state is cached by Time). | |
| virtual bool | readIfModified () |
| Read object if modified (as set by call to modified). | |
| virtual bool | write (const bool writeOnProc=true) const |
| Write using setting from DB. | |
| virtual bool | global () const |
| Is object global. | |
| void | operator= (const IOobject &io) |
| Copy assignment. | |
| virtual bool | writeObject (IOstreamOption::streamFormat fmt, IOstreamOption::versionNumber ver, IOstreamOption::compressionType cmp, const bool writeOnProc) const |
| Write using given format, version and compression. | |
| Public Member Functions inherited from IOobject | |
| TypeName ("IOobject") | |
| Declare type-name, virtual type (with debug switch). | |
| IOobject (const IOobject &)=default | |
| Copy construct. | |
| virtual | ~IOobject ()=default |
| Destructor. | |
| IOobject (const word &name, const fileName &instance, const objectRegistry ®istry, IOobjectOption ioOpt=IOobjectOption()) | |
| Construct from name, instance, registry, io options. | |
| IOobject (const word &name, const fileName &instance, const fileName &local, const objectRegistry ®istry, IOobjectOption ioOpt=IOobjectOption()) | |
| Construct from name, instance, local, registry, io options. | |
| IOobject (const fileName &path, const objectRegistry ®istry, IOobjectOption ioOpt=IOobjectOption()) | |
| Construct from path, registry, io options. | |
| IOobject (const word &name, const fileName &instance, const objectRegistry ®istry, IOobjectOption::readOption rOpt, IOobjectOption::writeOption wOpt=IOobjectOption::NO_WRITE, bool registerObject=true, bool globalObject=false) | |
| Construct from name, instance, registry, io options. | |
| IOobject (const word &name, const fileName &instance, const fileName &local, const objectRegistry ®istry, IOobjectOption::readOption rOpt, IOobjectOption::writeOption wOpt=IOobjectOption::NO_WRITE, bool registerObject=true, bool globalObject=false) | |
| Construct from name, instance, local, registry, io options. | |
| IOobject (const fileName &path, const objectRegistry ®istry, IOobjectOption::readOption rOpt, IOobjectOption::writeOption wOpt=IOobjectOption::NO_WRITE, bool registerObject=true, bool globalObject=false) | |
| Construct from path, registry, io options. | |
| IOobject (const IOobject &io, const objectRegistry ®istry) | |
| Copy construct, resetting registry. | |
| IOobject (const IOobject &io, const word &name) | |
| Copy construct, resetting name. | |
| IOobject (const IOobject &io, const word &name, const fileName &local) | |
| Copy construct, resetting name and local component. | |
| IOobject (const IOobject &io, IOobjectOption::readOption rOpt, IOobjectOption::writeOption wOpt) | |
| Copy construct, resetting read/write options. | |
| IOobject (const IOobject &io, IOobjectOption::registerOption regOpt) | |
| Copy construct, resetting register option. | |
| autoPtr< IOobject > | clone () const |
| Clone. | |
| autoPtr< IOobject > | clone (const objectRegistry ®istry) const |
| Clone resetting registry. | |
| const objectRegistry & | db () const noexcept |
| Return the local objectRegistry. | |
| const Time & | time () const noexcept |
| Return Time associated with the objectRegistry. | |
| const word & | name () const noexcept |
| Return the object name. | |
| const word & | headerClassName () const noexcept |
| Return name of the class name read from header. | |
| word & | headerClassName () noexcept |
| Modifiable access to the class name read from header. | |
| const string & | note () const noexcept |
| Return the optional note. | |
| string & | note () noexcept |
| Modifiable access to the optional note. | |
| unsigned | labelByteSize () const noexcept |
| The sizeof (label) in bytes, possibly read from the header. | |
| unsigned | scalarByteSize () const noexcept |
| The sizeof (scalar) in bytes, possibly read from the header. | |
| void | resetHeader (const word &newName=word::null) |
| Clear various bits (headerClassName, note, sizeof...) that would be obtained when reading from a file. | |
| bool | hasHeaderClass () const noexcept |
| True if headerClassName() is non-empty (after reading). | |
| bool | isHeaderClass (const word &expectedType) const |
| Check if headerClassName() equals the expected type. Always true if the expected type is empty. | |
| template<class Type> | |
| bool | isHeaderClass () const |
Check if headerClassName() equals Type::typeName Always true for a void type. | |
| word | group () const |
| Return group (extension part of name). | |
| word | member () const |
| Return member (name without the extension). | |
| const fileName & | rootPath () const noexcept |
| Return the Time::rootPath(). | |
| const fileName & | caseName () const noexcept |
| Return the Time::caseName(). | |
| const fileName & | globalCaseName () const noexcept |
| Return the Time::globalCaseName(). | |
| const fileName & | caseName (IOobjectOption::Layout) const noexcept |
| Return the Time::caseName() - normal or global. | |
| const fileName & | instance () const noexcept |
| Read access to instance path component. | |
| fileName & | instance () noexcept |
| Modifiable access to instance path component. | |
| scalar | instanceValue () const |
| Return the scalar value of the instance component (or 0), which often corresponds to a time index/value. | |
| const fileName & | local () const noexcept |
| Read access to local path component. | |
| fileName & | local () noexcept |
| Modifiable access to the local path component. | |
| fileName | path () const |
| The complete path for the object (with instance, local,...). | |
| fileName | globalPath () const |
| The complete global path for the object (with instance, local,...). | |
| fileName | path (IOobjectOption::Layout) const |
| The complete path (normal or global) for the object. | |
| fileName | path (const word &instance, const fileName &local=fileName::null) const |
| The complete path with alternative instance and local. | |
| fileName | globalPath (const word &instance, const fileName &local=fileName::null) const |
| The complete global path with alternative instance and local. | |
| fileName | path (IOobjectOption::Layout, const word &instance, const fileName &local=fileName::null) const |
| The complete path (normal or global) with alternative instance and local. | |
| fileName | objectPath () const |
| The complete path + object name. | |
| fileName | globalObjectPath () const |
| The complete global path + object name. | |
| fileName | objectPath (IOobjectOption::Layout) const |
| The complete path (normal or global) + object name. | |
| fileName | objectPath (IOobjectOption::Layout, const word &instance) const |
| The complete path (normal or global) + object name with alternative instance. | |
| fileName | objectPath (const word &instance) const |
| The complete path + object name with alternative instance. | |
| fileName | globalObjectPath (const word &instance) const |
| The complete global path + object name with alternative instance. | |
| fileName | objectRelPath () const |
| The object path relative to the case. | |
| fileName | localFilePath (const word &typeName, const bool search=true) const |
| Redirect to fileHandler filePath, searching locally. | |
| fileName | globalFilePath (const word &typeName, const bool search=true) const |
| Redirect to fileHandler filePath, searching up if in parallel. | |
| IOstreamOption | parseHeader (const dictionary &headerDict) |
| Parse 'FoamFile' header contents and set the IOobject characteristics and return the stream characteristics. | |
| bool | readHeader (Istream &is) |
| Read header ('FoamFile' dictionary) and set the IOobject and stream characteristics. | |
| bool | readHeader (dictionary &headerDict, Istream &is) |
| Read header (the 'FoamFile' dictionary) and set the IOobject and stream characteristics. | |
| template<class Type> | |
| bool | typeHeaderOk (const bool checkType=true, const bool search=true, const bool verbose=true) |
Read header (respects is_globalIOobject trait) and check its info. A void type suppresses trait and type-name checks. | |
| template<class Type, bool Searching> | |
| bool | typeHeaderOk (const bool checkType=true, const bool verbose=true) |
Forwards to single-parameter version with the specified search type. A void type suppresses trait and type-name checks. | |
| template<class Type> | |
| fileName | typeFilePath (const bool search=true) const |
| Call localFilePath or globalFilePath for given type depending on its is_globalIOobject trait. | |
| template<class Type> | |
| void | warnNoRereading () const |
| Helper: warn that type does not support re-reading. | |
| bool | writeHeader (Ostream &os) const |
| Write header with current type(). | |
| bool | writeHeader (Ostream &os, const word &objectType) const |
| Write header with override of type. | |
| void | writeHeader (dictionary &dict, IOstreamOption streamOpt) const |
| Write header into a dictionary with current type() and given output format. | |
| void | writeHeader (dictionary &dict, const word &objectType, IOstreamOption streamOpt) const |
| Write header into a dictionary with override of type and given output format. | |
| bool | good () const noexcept |
| Did last readHeader() succeed? | |
| bool | bad () const noexcept |
| Did last readHeader() fail? | |
| InfoProxy< IOobject > | info () const noexcept |
| Return info proxy, for printing information to a stream. | |
| void | operator= (const IOobject &io) |
| Copy assignment, copies all values (except the registry). | |
| template<class Type> | |
| bool | isHeaderClassName () const |
| Same as isHeaderClass(). | |
| template<class StringType> | |
| Foam::word | groupName (StringType base, const word &group) |
| template<class Type> | |
| Foam::fileName | typeFilePath (const bool search) const |
| Public Member Functions inherited from IOobjectOption | |
| constexpr | IOobjectOption (readOption rOpt=readOption::NO_READ, writeOption wOpt=writeOption::NO_WRITE, registerOption registerObject=registerOption::REGISTER, bool globalObject=false) noexcept |
| Default construct (NO_READ, NO_WRITE, REGISTER, non-global) or construct with specified options. | |
| constexpr | IOobjectOption (readOption rOpt, registerOption registerObject=registerOption::REGISTER, bool globalObject=false) noexcept |
| Construct NO_WRITE with specified read/register options. | |
| constexpr | IOobjectOption (writeOption wOpt, registerOption registerObject=registerOption::REGISTER, bool globalObject=false) noexcept |
| Construct NO_READ with specified write/register options. | |
| constexpr | IOobjectOption (registerOption registerObject, bool globalObject=false) noexcept |
| Construct (NO_READ, NO_WRITE) with specified register option. | |
| constexpr | IOobjectOption (readOption rOpt, writeOption wOpt, bool registerObject, bool globalObject=false) noexcept |
| Construct from components with specified register option as bool. | |
| constexpr | IOobjectOption (bool registerObject, bool globalObject=false) noexcept |
| Construct (NO_READ, NO_WRITE) with specified register option as bool. | |
| readOption | readOpt () const noexcept |
| Get the read option. | |
| readOption | readOpt (readOption opt) noexcept |
| Set the read option. | |
| writeOption | writeOpt () const noexcept |
| Get the write option. | |
| writeOption | writeOpt (writeOption opt) noexcept |
| Set the write option. | |
| bool | registerObject () const noexcept |
| Should objects created with this IOobject be registered? | |
| bool | registerObject (bool on) noexcept |
| Change registration preference. | |
| bool | globalObject () const noexcept |
| True if object is treated the same for all processors. | |
| bool | globalObject (bool on) noexcept |
| Change global-object status. | |
| bool | isAnyRead () const noexcept |
| True if any reading may be required (ie, != NO_READ). | |
| bool | isReadRequired () const noexcept |
| True if (MUST_READ | READ_MODIFIED) bits are set. | |
| bool | isReadOptional () const noexcept |
| True if (LAZY_READ) bits are set [same as READ_IF_PRESENT]. | |
| readOption & | readOpt () noexcept |
| Access to the read option. | |
| writeOption & | writeOpt () noexcept |
| Access to the write option. | |
| bool & | registerObject () noexcept |
| Access to the register object option. | |
| bool & | globalObject () noexcept |
| Access to the global object option. | |
Static Public Member Functions | |
| static bool | isCollatedType (const word &objectType) |
| True if object type is a known collated type. | |
| static bool | isCollatedType (const IOobject &io) |
| True if object header class is a known collated type. | |
| static label | getNumBlocks (Istream &is, const label maxNumBlocks=-1) |
| Extract number of decomposedBlockData block entries, optionally with an upper limit. The input stream should be in a rewound state (or only have read the header) before calling. | |
| static bool | hasBlock (Istream &is, const label blockNumber) |
| True if the given block number (starts at 0) has a corresponding decomposedBlockData block entry. The input stream should be in a rewound state (or only have read the header) before calling. | |
| static bool | readHeader (IOobject &io, Istream &is) |
| Read header as per IOobject with additional handling of decomposedBlockData. | |
| static void | writeHeader (Ostream &os, IOstreamOption streamOptContainer, const word &objectType, const string ¬e, const fileName &location, const word &objectName, const dictionary &extraEntries) |
| Helper: write FoamFile IOobject header. | |
| static void | writeHeader (Ostream &os, IOstreamOption streamOptData, const IOobject &io) |
| Helper: write FoamFile IOobject header. | |
| static void | writeExtraHeaderContent (dictionary &dict, IOstreamOption streamOptData, const IOobject &io) |
| Helper: generate additional entries for FoamFile header. | |
| static bool | readBlockEntry (Istream &is, List< char > &charData) |
| Helper: read block of (binary) character data. | |
| static std::streamoff | writeBlockEntry (OSstream &os, const label blocki, const char *str, const size_t len) |
| Helper: write block of (binary) character data. | |
| static std::streamoff | writeBlockEntry (OSstream &os, const label blocki, const UList< char > &s) |
| Helper: write block of (binary) character data. | |
| static std::streamoff | writeBlockEntry (OSstream &os, const label blocki, std::string_view sv) |
| Helper: write block of (binary) character content. | |
| static std::streamoff | writeBlockEntry (OSstream &os, IOstreamOption streamOptData, const regIOobject &io, const label blocki, const bool withLocalHeader) |
| Helper: write block of (binary) character data. | |
| static autoPtr< ISstream > | readBlock (const label blocki, ISstream &is, IOobject &headerIO) |
| Read selected block (non-seeking) + header information. | |
| static autoPtr< ISstream > | readBlocks (const label comm, const fileName &fName, autoPtr< ISstream > &isPtr, IOobject &headerIO, const UPstream::commsTypes commsType) |
| Read master header information (into headerIO) and return data in stream. | |
| static void | gatherProcData (const label comm, const UList< char > &localData, const labelUList &recvSizes, const labelRange &whichProcs, List< int > &recvOffsets, DynamicList< char > &recvData, const UPstream::commsTypes commsType) |
| Helper: gather data from (subset of) sub-ranks. | |
| static bool | writeBlocks (const label comm, autoPtr< OSstream > &osPtr, List< std::streamoff > &blockOffset, const UList< char > &localData, const labelUList &recvSizes, const UList< std::string_view > &procData, const UPstream::commsTypes commsType, const bool syncReturnState=true) |
| Write *this. Ostream only valid on master. | |
| static bool | writeBlocks (const label comm, autoPtr< OSstream > &osPtr, List< std::streamoff > &blockOffset, const UList< char > &localData, const labelUList &recvSizes, const UPtrList< SubList< char > > &procData, const UPstream::commsTypes commsType, const bool syncReturnState=true) |
| Write *this. Ostream only valid on master. | |
| static void | gather (const label comm, const label localValue, labelList &allValues) |
| Deprecated(2023-09) - consider UPstream::listGatherValue. | |
| Static Public Member Functions inherited from regIOobject | |
| template<class Type> | |
| static Type & | store (Type *p) |
| Transfer pointer ownership to its registry. | |
| template<class Type> | |
| static Type & | store (std::unique_ptr< Type > &&ptr) |
| Transfer pointer ownership to its registry. | |
| template<class Type> | |
| static Type & | store (autoPtr< Type > &ptr) |
| Transfer pointer ownership to its registry. | |
| template<class Type> | |
| static Type & | store (autoPtr< Type > &&ptr) |
| Transfer pointer ownership to its registry. | |
| template<class Type> | |
| static Type & | store (refPtr< Type > &ptr) |
| Transfer pointer ownership to its registry. | |
| template<class Type> | |
| static Type & | store (refPtr< Type > &&ptr) |
| Transfer pointer ownership to its registry. | |
| template<class Type> | |
| static Type & | store (tmp< Type > &ptr) |
| Transfer pointer ownership to its registry. | |
| template<class Type> | |
| static Type & | store (tmp< Type > &&ptr) |
| Transfer pointer ownership to its registry. | |
| Static Public Member Functions inherited from IOobject | |
| static bool | bannerEnabled () noexcept |
| Status of output file banner. | |
| static bool | bannerEnabled (bool on) noexcept |
| Enable/disable output file banner. | |
| static bool | fileModificationChecking_masterOnly () noexcept |
| Test fileModificationChecking for master-only. | |
| static bool | fileNameComponents (const fileName &path, fileName &instance, fileName &local, word &name) |
| Split path into instance, local, name components. | |
| template<class StringType> | |
| static word | groupName (StringType base, const word &group) |
| Create dot-delimited name.group string. | |
| static word | group (const word &name) |
| Return group (extension part of name). | |
| static word | member (const word &name) |
| Return member (name without the extension). | |
| static word | scopedName (const std::string &scope, const word &name) |
| Create scope:name or scope_name string. | |
| static word | scopedName (const std::string &scope, const word &name1, const word &name2) |
| Create scope:name1:name2 or scope_name1_name2 string. | |
| static IOobject | selectIO (const IOobject &io, const fileName &altFile, const word &ioName="") |
| Return the IOobject, but also consider an alternative file name. | |
| static Ostream & | writeBanner (Ostream &os, const bool noSyntaxHint=false) |
| Write the standard OpenFOAM file/dictionary banner. | |
| static Ostream & | writeDivider (Ostream &os) |
| Write the standard file section divider. | |
| static Ostream & | writeEndDivider (Ostream &os) |
| Write the standard end file divider. | |
| Static Public Member Functions inherited from IOobjectOption | |
| static bool | isAnyRead (readOption opt) noexcept |
| True if any reading may be required (ie, != NO_READ). | |
| static bool | isReadRequired (readOption opt) noexcept |
| True if (MUST_READ | READ_MODIFIED) bits are set. | |
| static bool | isReadOptional (readOption opt) noexcept |
| True if (LAZY_READ) bits are set [same as READ_IF_PRESENT]. | |
| static readOption | lazierRead (readOption opt) noexcept |
| Downgrade readOption optional (LAZY_READ), leaves NO_READ intact. | |
Static Protected Member Functions | |
| static bool | readBlocks (const label comm, autoPtr< ISstream > &isPtr, List< char > &localData, const UPstream::commsTypes commsType) |
| Read data (on master) and transmit. | |
| static bool | skipBlockEntry (Istream &is) |
| Helper: skip a block of (binary) character data. | |
| Static Protected Member Functions inherited from IOobject | |
| static void | writeHeaderContent (Ostream &os, const IOobject &io, const word &objectType, const dictionary *metaDataDict=nullptr) |
| Helper: write content for FoamFile IOobject header with optional meta information. | |
| static void | writeHeaderContent (dictionary &dict, const IOobject &io, const word &objectType, IOstreamOption streamOpt, const dictionary *metaDataDict=nullptr) |
| Helper: write dictionary content for FoamFile header with optional meta information. | |
Protected Attributes | |
| const UPstream::commsTypes | commsType_ |
| Type to use for gather. | |
| const label | comm_ |
| Communicator for all parallel comms. | |
| List< char > | contentData_ |
| The block content. | |
Additional Inherited Members | |
| Public Types inherited from IOobject | |
| enum | objectState : char { GOOD , BAD } |
| Enumeration defining the valid states of an IOobject. More... | |
| enum | fileCheckTypes : char { timeStamp = 1 , timeStampMaster = 3 , inotify = 4 , inotifyMaster = 6 } |
| Enumeration defining the file checking options (time-stamp | inotify) | (all | masterOnly). More... | |
| Public Types inherited from IOobjectOption | |
| enum | readOption : unsigned char { NO_READ = 0 , MUST_READ = 0x1 , READ_MODIFIED = 0x3 , MUST_READ_IF_MODIFIED = 0x3 , LAZY_READ = 0x4 , READ_IF_PRESENT = 0x4 } |
| Enumeration defining read preferences. More... | |
| enum | writeOption : unsigned char { NO_WRITE = 0 , AUTO_WRITE = 0x10 } |
| Enumeration defining write preferences. More... | |
| enum | registerOption : unsigned char { NO_REGISTER = 0 , REGISTER = 1 , LEGACY_REGISTER = 2 } |
| Enumeration for use with registerObject(). Values map to bool (false/true). More... | |
| enum class | Layout : unsigned char { regular , global } |
| The layout of the case structure. More... | |
| Static Public Attributes inherited from IOobject | |
| static const Enum< fileCheckTypes > | fileCheckTypesNames |
| Names for the fileCheckTypes. | |
| static char | scopeSeparator |
| Character for scoping object names (':' or '_'). | |
| static fileCheckTypes | fileModificationChecking |
| Type of file modification checking. | |
| static float | fileModificationSkew |
| Time skew (seconds) for file modification checks. | |
| static int | maxFileModificationPolls |
| Max number of times to poll for file modification changes. | |
| Protected Member Functions inherited from regIOobject | |
| bool | readHeaderOk (const IOstreamOption::streamFormat fmt, const word &typeName) |
| Helper: check readOpt flags and read if necessary. | |
| Protected Member Functions inherited from IOobject | |
| void | setBad (const string &s) |
| Set the object state to bad. | |
| Static Protected Attributes inherited from regIOobject | |
| static bool | masterOnlyReading = false |
| To flag master-only reading of objects. | |
The decomposedBlockData comprise a List<char> for each output processor, typically with IO on the master processor only.
For decomposedBlockData, we make a distinction between the container description and the individual block contents.
The FoamFile header specifies the container characteristics and thus has class = decomposedBlockData and normally format = binary. This description refers to the entire file container, not the individual blocks.
Each processor block is simply a binary chunk of characters and the first block also contains the header description for all of the blocks. For example,
FoamFile
{
version 2.0;
format binary;
arch "LSB;label=32;scalar=64";
class decomposedBlockData;
location "constant/polyMesh";
object points;
data.format ascii; // optional
data.class vectorField; // optional
}
// processor0
NCHARS
(FoamFile
{
version 2.0;
format ascii;
arch "LSB;label=32;scalar=64";
class vectorField;
location "constant/polyMesh";
object points;
}
...content...
)
// processor1
NCHARS
(...content...)
...
Definition at line 101 of file decomposedBlockData.H.
| decomposedBlockData | ( | const label | comm, |
| const IOobject & | io, | ||
| const UPstream::commsTypes | commsType = UPstream::commsTypes::scheduled ) |
Construct given an IOobject.
Definition at line 57 of file decomposedBlockData.C.
References comm_, commsType_, Foam::endl(), regIOobject::headerOk(), io, IOobjectOption::isReadOptional(), IOobjectOption::isReadRequired(), IOobject::name(), read(), IOobjectOption::READ_MODIFIED, IOobjectOption::readOpt(), regIOobject::regIOobject(), and WarningInFunction.
Referenced by isCollatedType().


|
virtualdefault |
Destructor.
References dict, io, IOobject::note(), and os().

|
staticprotected |
Read data (on master) and transmit.
Definition at line 458 of file decomposedBlockData.C.
References UPstream::broadcast, List< T >::clear(), UList< T >::data_bytes(), Foam::endl(), FUNCTION_NAME, UPstream::is_subrank(), UPstream::master(), UPstream::masterNo(), UPstream::msgType(), UPstream::nonBlocking, UPstream::nProcs(), UPstream::nRequests(), Foam::Pout, UPstream::probeMessage(), UIPstream::read(), readBlockEntry(), List< T >::resize(), List< T >::resize_nocopy(), UPstream::scheduled, UList< T >::size_bytes(), UPstream::subProcs(), UPstream::waitRequests(), and UOPstream::write().
Referenced by read(), and masterUncollatedFileOperation::readStream().


|
staticprotected |
Helper: skip a block of (binary) character data.
Definition at line 186 of file decomposedBlockData.C.
References IOstreamOption::BINARY, token::END_STATEMENT, IOstream::fatalCheck(), IOstreamOption::format(), FUNCTION_NAME, IOstream::good(), token::isCompound(), token::isLabel(), token::isWord(), token::labelToken(), Istream::putBack(), and Istream::read().
Referenced by getNumBlocks(), and readBlock().


| TypeName | ( | "decomposedBlockData" | ) |
Declare type-name, virtual type (with debug switch).
References io, and UPstream::scheduled.
|
virtual |
Read object.
Reimplemented from regIOobject.
Definition at line 1242 of file decomposedBlockData.C.
References comm_, commsType_, contentData_, Foam::fileHandler, regIOobject::filePath(), UPstream::master(), word::null, readBlocks(), IOobject::readHeader(), and autoPtr< T >::reset().
Referenced by decomposedBlockData().


|
virtual |
Write separated content (assumes content is the serialised data).
The serialised master data should also contain a FoamFile header
Implements regIOobject.
Definition at line 1256 of file decomposedBlockData.C.
References Pstream::broadcasts(), IOstreamOption::versionNumber::canonical(), comm_, contentData_, IOobject::db(), dictionary, IOstreamOption::format(), IOobject::instance(), io, UPstream::is_subrank(), Foam::isA(), local, UPstream::master(), IOobject::name(), os(), IOstreamOption::version(), IOobject::writeEndDivider(), and writeHeader().

|
virtual |
Write using stream options.
Reimplemented from regIOobject.
Definition at line 1328 of file decomposedBlockData.C.
References IOstreamOption::BINARY, comm_, commsType_, contentData_, UPstream::listGatherValues(), UPstream::master(), IOobject::objectPath(), regIOobject::regIOobject(), autoPtr< T >::reset(), regIOobject::updateMetaData(), writeBlocks(), and writeHeader().

|
static |
True if object type is a known collated type.
Definition at line 41 of file decomposedBlockData.C.
Referenced by readHeader(), masterUncollatedFileOperation::readStream(), and uncollatedFileOperation::readStream().

|
static |
True if object header class is a known collated type.
Definition at line 47 of file decomposedBlockData.C.
References decomposedBlockData(), and io.

|
static |
Extract number of decomposedBlockData block entries, optionally with an upper limit. The input stream should be in a rewound state (or only have read the header) before calling.
Obtain number of blocks directly This may not be reliable...
Definition at line 262 of file decomposedBlockData.C.
References IOstreamOption::format(), IOstream::good(), token::good(), token::isWord(), Istream::putBack(), dictionary::readIfPresent(), skipBlockEntry(), and IOstreamOption::version().
Referenced by hasBlock().


|
static |
True if the given block number (starts at 0) has a corresponding decomposedBlockData block entry. The input stream should be in a rewound state (or only have read the header) before calling.
This will be faster than checking against getNumBlocks() since it can potentially exit without scanning the entire file.
Definition at line 317 of file decomposedBlockData.C.
References getNumBlocks().

Read header as per IOobject with additional handling of decomposedBlockData.
Definition at line 101 of file decomposedBlockDataHeader.C.
References io, isCollatedType(), IOstream::name(), ISstream::name(), readBlockEntry(), and dictionary::readIfPresent().
Referenced by masterUncollatedFileOperation::readHeader(), and uncollatedFileOperation::readHeader().


|
static |
Helper: write FoamFile IOobject header.
Definition at line 132 of file decomposedBlockDataHeader.C.
References IOobject::bannerEnabled(), DLListBase::empty(), Foam::nl, IOobject::note(), os(), IOobject::writeBanner(), IOobject::writeDivider(), and dictionary::writeEntries().
Referenced by collatedFileOperation::appendObject(), writeData(), and writeObject().


|
static |
Helper: write FoamFile IOobject header.
Definition at line 192 of file decomposedBlockDataHeader.C.
References IOobject::bannerEnabled(), IOstreamOption::format(), io, Foam::nl, os(), IOobject::writeBanner(), IOobject::writeDivider(), and Foam::writeHeaderEntry().

|
static |
Helper: generate additional entries for FoamFile header.
Definition at line 174 of file decomposedBlockDataHeader.C.
References dict, IOstreamOption::format(), and io.

Helper: read block of (binary) character data.
Definition at line 142 of file decomposedBlockData.C.
References token::END_STATEMENT, IOstream::fatalCheck(), FUNCTION_NAME, token::good(), token::isCompound(), token::isWord(), Istream::putBack(), and List< T >::readList().
Referenced by readBlock(), readBlocks(), readBlocks(), and readHeader().


|
static |
Helper: write block of (binary) character data.
Definition at line 86 of file decomposedBlockData.C.
References IOstreamOption::BINARY, Foam::name(), Foam::nl, and os().
Referenced by collatedFileOperation::appendObject(), writeBlockEntry(), writeBlockEntry(), writeBlockEntry(), and writeBlocks().


|
inlinestatic |
Helper: write block of (binary) character data.
Definition at line 306 of file decomposedBlockData.H.
References os(), s(), and writeBlockEntry().

|
inlinestatic |
Helper: write block of (binary) character content.
Housekeeping
Definition at line 321 of file decomposedBlockData.H.
References os(), and writeBlockEntry().

|
static |
Helper: write block of (binary) character data.
Definition at line 327 of file decomposedBlockData.C.
References IOobject::bannerEnabled(), io, os(), regIOobject::regIOobject(), OCharStream::release(), OCharStream::reserve(), and writeBlockEntry().

|
static |
Read selected block (non-seeking) + header information.
Definition at line 371 of file decomposedBlockData.C.
References Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, IOstreamOption::format(), IOstream::labelByteSize(), ISstream::name(), Foam::nl, Foam::Pout, readBlockEntry(), IOobject::readHeader(), IOstream::relativeName(), autoPtr< T >::reset(), IOstream::scalarByteSize(), skipBlockEntry(), and IOstreamOption::version().
Referenced by masterUncollatedFileOperation::readStream(), and uncollatedFileOperation::readStream().


|
static |
Read master header information (into headerIO) and return data in stream.
| [in] | isPtr | The input stream (only valid on master) |
| [out] | headerIO | header information |
Definition at line 558 of file decomposedBlockData.C.
References Pstream::broadcasts(), IOstreamOption::versionNumber::canonical(), List< T >::clear(), UList< T >::data_bytes(), Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, FUNCTION_NAME, IOobject::headerClassName(), Foam::Info, UPstream::is_subrank(), UPstream::master(), UPstream::masterNo(), UPstream::msgType(), IOobject::name(), Foam::nl, UPstream::nonBlocking, IOobject::note(), UPstream::nProcs(), UPstream::nRequests(), Foam::Pout, UPstream::probeMessage(), UIPstream::read(), readBlockEntry(), IOobject::readHeader(), IOobject::rename(), autoPtr< T >::reset(), List< T >::resize(), List< T >::resize_nocopy(), UPstream::scheduled, UList< T >::size_bytes(), UPstream::subProcs(), UPstream::waitRequests(), and UOPstream::write().

|
static |
Helper: gather data from (subset of) sub-ranks.
In non-blocking mode it sets up send/recv for non-empty content. In blocking/scheduled mode it uses MPI_Gatherv to collect data.
Returns:
| [in] | localData | required on all procs |
| [in] | recvSizes | only required on master |
| [in] | whichProcs | required on all procs |
| [out] | recvOffsets | only relevant on master |
| [out] | recvData | only relevant on master |
Definition at line 736 of file decomposedBlockData.C.
References UList< T >::begin(), UList< T >::cbegin(), UList< T >::cdata(), UList< T >::cdata_bytes(), DynamicList< T, SizeMin >::clear(), IntRange< IntType >::contains(), UList< T >::data(), UList< T >::data_bytes(), UList< T >::empty(), UPstream::master(), UPstream::masterNo(), UPstream::mpiGatherv(), UPstream::msgType(), UPstream::myProcNo(), UPstream::nonBlocking, UPstream::nProcs(), UIPstream::read(), DynamicList< T, SizeMin >::resize_nocopy(), List< T >::resize_nocopy(), UList< T >::size(), UList< T >::size_bytes(), and UOPstream::write().
Referenced by writeBlocks().


|
static |
Write *this. Ostream only valid on master.
Returns offsets of processor blocks in blockOffset
Enable to get synchronised error checking.
Ensures that all procs are as slow as the master (which does all the writing)
| [in] | osPtr | output stream (relevant on master) |
| [out] | blockOffset | start offsets to each block (relevant on master), ignored if List::null() type |
| [in] | localData | required on all procs |
| [in] | recvSizes | only required on master |
| procData | Optional proc data (only written on master) but must also be symmetrically defined (empty/non-empty) on all ranks |
Definition at line 868 of file decomposedBlockData.C.
References UPstream::broadcast, UList< T >::cdata_bytes(), UPstream::commsTypeNames, UList< T >::data_bytes(), UList< T >::empty(), Foam::endl(), gatherProcData(), UPstream::is_subrank(), UPstream::master(), UPstream::masterNo(), IntRange< IntType >::max(), Foam::max(), IntRange< IntType >::min(), UPstream::msgType(), UPstream::nonBlocking, Foam::notNull(), UPstream::nProcs(), UPstream::nRequests(), os(), Foam::Pout, UIPstream::read(), List< T >::resize(), DynamicList< T, SizeMin >::resize_nocopy(), UPstream::scheduled, IntRange< IntType >::size(), UList< T >::size(), UList< T >::size_bytes(), IntRange< IntType >::start(), OStringStream::str(), UPstream::waitRequest(), UPstream::waitRequests(), UOPstream::write(), and writeBlockEntry().
Referenced by writeBlocks(), and writeObject().


|
inlinestatic |
Write *this. Ostream only valid on master.
Returns offsets of processor blocks in blockOffset
Definition at line 430 of file decomposedBlockData.H.
References forAll, and writeBlocks().

|
inlinestatic |
Deprecated(2023-09) - consider UPstream::listGatherValue.
The only difference is that this gather also resizes the output on the non-master procs
Definition at line 481 of file decomposedBlockData.H.
References gather(), UPstream::mpiGather(), and UPstream::nProcs().
Referenced by gather().


|
protected |
Type to use for gather.
Definition at line 128 of file decomposedBlockData.H.
Referenced by decomposedBlockData(), read(), and writeObject().
|
protected |
Communicator for all parallel comms.
Definition at line 133 of file decomposedBlockData.H.
Referenced by decomposedBlockData(), read(), writeData(), and writeObject().
|
protected |
The block content.
Definition at line 138 of file decomposedBlockData.H.
Referenced by read(), writeData(), and writeObject().