Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
writeObjectsBase Class Reference

FunctionObject base class for writing a list of objects registered to the database, on behalf of the inheriting function object, on when those should be written to disk. More...

Inheritance diagram for writeObjectsBase:
Inheritance graph
[legend]
Collaboration diagram for writeObjectsBase:
Collaboration graph
[legend]

Public Member Functions

 writeObjectsBase (const objectRegistry &obr, const Switch &logRef)
 Construct from objectRegistry and inheriting function object. More...
 
virtual ~writeObjectsBase ()
 Destructor. More...
 
const wordReListwriteObjectNames () const
 Return const access to the object names requested to be written. More...
 
virtual bool read (const dictionary &)
 Read the list of objects to be written. More...
 
virtual bool write ()
 Write function. More...
 

Protected Member Functions

void resetWriteObjectName (const wordRe &name)
 Reset the list of object names to be written to a single regular. More...
 
void resetWriteObjectNames (const wordReList &names)
 Reset the list of object names to be written. More...
 
virtual wordList objectNames ()
 Get the list of field names to be written. More...
 
virtual void writeObject (const regIOobject &obj)
 Write the requested registered IO object. More...
 

Protected Attributes

const objectRegistrywriteObr_
 Reference to the region objectRegistry. More...
 
const Switchlog_
 Reference to the inheriting function object's log variable. More...
 
wordReList writeObjectNames_
 Object names requested by the user to be written. More...
 

Detailed Description

FunctionObject base class for writing a list of objects registered to the database, on behalf of the inheriting function object, on when those should be written to disk.

FunctionObjects that inherit this class will receive the additional dictionary option objects which allows selecting which fields of the inherited function should be written to disk when write() is called.

Example of function object specification:

<functionObjectName>
{
    ...
    objects     (obj1 obj2);
    ...
}
Usage
Property Description Required Default value
objects List of objects to be written yes

Note: Regular expressions can also be used in objects.

See also
Foam::functionObject Foam::functionObjects::writeObjects Foam::functionObjects::writeLocalObjects
Source files

Definition at line 96 of file writeObjectsBase.H.

Constructor & Destructor Documentation

◆ writeObjectsBase()

writeObjectsBase ( const objectRegistry obr,
const Switch logRef 
)

Construct from objectRegistry and inheriting function object.

Definition at line 90 of file writeObjectsBase.C.

◆ ~writeObjectsBase()

~writeObjectsBase ( )
virtual

Destructor.

Definition at line 102 of file writeObjectsBase.C.

Member Function Documentation

◆ resetWriteObjectName()

void resetWriteObjectName ( const wordRe name)
protected

Reset the list of object names to be written to a single regular.

expression

Definition at line 33 of file writeObjectsBase.C.

References writeObjectsBase::resetWriteObjectNames().

Referenced by writeLocalObjects::read().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ resetWriteObjectNames()

void resetWriteObjectNames ( const wordReList names)
protected

Reset the list of object names to be written.

Definition at line 43 of file writeObjectsBase.C.

Referenced by writeObjectsBase::resetWriteObjectName().

Here is the caller graph for this function:

◆ objectNames()

Foam::wordList objectNames ( )
protectedvirtual

Get the list of field names to be written.

Reimplemented in writeLocalObjects.

Definition at line 52 of file writeObjectsBase.C.

References Foam::endl(), forAll, objectRegistry::names(), Foam::nl, List< T >::size(), HashTable< T, Key, Hash >::sortedToc(), HashTable< T, Key, Hash >::toc(), WarningInFunction, writeObjectsBase::writeObject(), writeObjectsBase::writeObjectNames_, and writeObjectsBase::writeObr_.

Referenced by writeObjectsBase::write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeObject()

void writeObject ( const regIOobject obj)
protectedvirtual

Write the requested registered IO object.

Definition at line 77 of file writeObjectsBase.C.

References Foam::endl(), Foam::Info, writeObjectsBase::log_, IOobject::name(), and regIOobject::write().

Referenced by NamedEnum< directionType, 3 >::names(), writeObjectsBase::objectNames(), and writeObjectsBase::write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeObjectNames()

const Foam::wordReList & writeObjectNames ( ) const

Return const access to the object names requested to be written.

Definition at line 109 of file writeObjectsBase.C.

References writeObjectsBase::writeObjectNames_.

◆ read()

bool read ( const dictionary dict)
virtual

Read the list of objects to be written.

Reimplemented in wallHeatTransferCoeff, writeObjects, wallShearStress, wallHeatFlux, writeLocalObjects, yPlus, and turbulenceIntensity.

Definition at line 115 of file writeObjectsBase.C.

References dictionary::lookup(), and writeObjectsBase::writeObjectNames_.

Referenced by writeLocalObjects::read(), and writeObjects::read().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write()

bool write ( )
virtual

Member Data Documentation

◆ writeObr_

const objectRegistry& writeObr_
protected

Reference to the region objectRegistry.

Definition at line 104 of file writeObjectsBase.H.

Referenced by writeObjectsBase::objectNames(), and writeObjectsBase::write().

◆ log_

const Switch& log_
protected

Reference to the inheriting function object's log variable.

Definition at line 107 of file writeObjectsBase.H.

Referenced by writeObjectsBase::writeObject().

◆ writeObjectNames_

wordReList writeObjectNames_
protected

Object names requested by the user to be written.

Definition at line 110 of file writeObjectsBase.H.

Referenced by writeLocalObjects::objectNames(), writeObjectsBase::objectNames(), writeObjectsBase::read(), and writeObjectsBase::writeObjectNames().


The documentation for this class was generated from the following files: