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:
Collaboration diagram for writeObjectsBase:

Public Member Functions

 writeObjectsBase (const objectRegistry &obr, const Switch &logRef=logFalse)
 Construct from objectRegistry and inheriting function object. More...
 
 writeObjectsBase (const writeObjectsBase &)=delete
 Disallow default bitwise copy construction. 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...
 
void operator= (const writeObjectsBase &)=delete
 Disallow default bitwise assignment. 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...
 
Switch regExp_
 Optional switch for regular expression support. More...
 
wordReList writeObjectNames_
 Object names requested by the user to be written. More...
 

Static Protected Attributes

static const Switch logFalse
 False switch to which log_ defaults. 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
regExp Switch for regular expression support no true

Note: Regular expressions can also be used in objects.

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

Definition at line 103 of file writeObjectsBase.H.

Constructor & Destructor Documentation

◆ writeObjectsBase() [1/2]

writeObjectsBase ( const objectRegistry obr,
const Switch logRef = logFalse 
)

Construct from objectRegistry and inheriting function object.

Definition at line 113 of file writeObjectsBase.C.

◆ writeObjectsBase() [2/2]

writeObjectsBase ( const writeObjectsBase )
delete

Disallow default bitwise copy construction.

◆ ~writeObjectsBase()

~writeObjectsBase ( )
virtual

Destructor.

Definition at line 126 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 37 of file writeObjectsBase.C.

References List< T >::append(), List< T >::clear(), Foam::name(), and writeObjectsBase::writeObjectNames_.

Here is the call graph for this function:

◆ resetWriteObjectNames()

void resetWriteObjectNames ( const wordReList names)
protected

Reset the list of object names to be written.

Definition at line 47 of file writeObjectsBase.C.

◆ objectNames()

Foam::wordList objectNames ( )
protectedvirtual

Get the list of field names to be written.

Reimplemented in writeLocalObjects.

Definition at line 57 of file writeObjectsBase.C.

References DynamicList< T, SizeInc, SizeMult, SizeDiv >::append(), Foam::endl(), forAll, Foam::Info, Foam::name(), List< T >::size(), and Foam::Warning.

Here is the call graph for this function:

◆ writeObject()

void writeObject ( const regIOobject obj)
protectedvirtual

Write the requested registered IO object.

Definition at line 100 of file writeObjectsBase.C.

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

Here is the call graph for this function:

◆ writeObjectNames()

const Foam::wordReList & writeObjectNames ( ) const

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

Definition at line 133 of file writeObjectsBase.C.

◆ read()

bool read ( const dictionary dict)
virtual

Read the list of objects to be written.

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

Definition at line 139 of file writeObjectsBase.C.

References dict, forAll, and List< T >::size().

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

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

◆ write()

bool write ( )
virtual

◆ operator=()

void operator= ( const writeObjectsBase )
delete

Disallow default bitwise assignment.

Member Data Documentation

◆ writeObr_

const objectRegistry& writeObr_
protected

Reference to the region objectRegistry.

Definition at line 111 of file writeObjectsBase.H.

◆ logFalse

const Foam::Switch logFalse
staticprotected

False switch to which log_ defaults.

Definition at line 114 of file writeObjectsBase.H.

◆ log_

const Switch& log_
protected

Reference to the inheriting function object's log variable.

Definition at line 117 of file writeObjectsBase.H.

◆ regExp_

Switch regExp_
protected

Optional switch for regular expression support.

Defaults to true

Definition at line 121 of file writeObjectsBase.H.

◆ writeObjectNames_

wordReList writeObjectNames_
protected

Object names requested by the user to be written.

Definition at line 124 of file writeObjectsBase.H.

Referenced by writeObjectsBase::resetWriteObjectName().


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