vtkWrite Class Reference

Writes fields in VTK (xml or legacy) format. Writes cell-values or point-interpolated values for volFields. More...

Inheritance diagram for vtkWrite:
[legend]
Collaboration diagram for vtkWrite:
[legend]

Public Member Functions

 TypeName ("vtkWrite")
 Runtime type information. More...
 
 vtkWrite (const word &name, const Time &runTime, const dictionary &dict)
 Construct from Time and dictionary. More...
 
virtual ~vtkWrite ()=default
 Destructor. More...
 
virtual bool read (const dictionary &dict)
 Read the vtkWrite specification. More...
 
virtual bool execute ()
 Execute - does nothing. More...
 
virtual bool write ()
 Write fields. More...
 
virtual bool end ()
 On end - cleanup internal allocations. More...
 
virtual void updateMesh (const mapPolyMesh &mpm)
 Update for changes of mesh. More...
 
virtual void movePoints (const polyMesh &mesh)
 Update for mesh point-motion. More...
 
template<class GeoField >
Foam::label writeVolFields (autoPtr< vtk::internalWriter > &internalWriter, UPtrList< vtk::patchWriter > &patchWriters, const fvMeshSubset &proxy, const wordHashSet &acceptField) const
 
template<class GeoField >
Foam::label writeVolFields (autoPtr< vtk::internalWriter > &internalWriter, const autoPtr< volPointInterpolation > &pInterp, UPtrList< vtk::patchWriter > &patchWriters, const UPtrList< PrimitivePatchInterpolation< primitivePatch >> &patchInterps, const fvMeshSubset &proxy, const wordHashSet &acceptField) const
 
- Public Member Functions inherited from timeFunctionObject
 timeFunctionObject (const word &name, const Time &runTime)
 Construct from Time. More...
 
virtual ~timeFunctionObject ()=default
 Destructor. More...
 
const Timetime () const
 Return time database. More...
 
objectRegistrystoredObjects ()
 
const objectRegistrystoredObjects () const
 
- Public Member Functions inherited from functionObject
 declareRunTimeSelectionTable (autoPtr, functionObject, dictionary,(const word &name, const Time &runTime, const dictionary &dict),(name, runTime, dict))
 
 functionObject (const word &name, const bool withNamePrefix=defaultUseNamePrefix)
 Construct from components. More...
 
autoPtr< functionObjectclone () const
 Return clone. More...
 
virtual ~functionObject ()=default
 Destructor. More...
 
virtual const wordtype () const =0
 Runtime type information. More...
 
const wordname () const noexcept
 Return the name of this functionObject. More...
 
bool useNamePrefix () const noexcept
 Return the flag for adding a scoping name prefix. More...
 
bool useNamePrefix (bool on) noexcept
 Modify the flag for adding a scoping name prefix. More...
 
virtual bool execute (const label subIndex)
 Execute using the specified subIndex. More...
 
virtual bool adjustTimeStep ()
 Called at the end of Time::adjustDeltaT() if adjustTime is true. More...
 
virtual bool filesModified () const
 Did any file get changed during execution? More...
 

Additional Inherited Members

- Static Public Member Functions inherited from functionObject
static autoPtr< functionObjectNew (const word &name, const Time &runTime, const dictionary &dict)
 Select from dictionary, based on its "type" entry. More...
 
- Public Attributes inherited from functionObject
bool log
 Flag to write log into Info. More...
 
- Static Public Attributes inherited from functionObject
static int debug
 Flag to execute debug content. More...
 
static bool postProcess
 Global post-processing mode switch. More...
 
static bool defaultUseNamePrefix
 Global default for useNamePrefix. More...
 
static word outputPrefix
 Directory prefix. More...
 
- Protected Member Functions inherited from timeFunctionObject
void clearOutputObjects (const wordList &objNames)
 Remove specified items from "functionObjectObjects". More...
 
 timeFunctionObject (const timeFunctionObject &)=delete
 No copy construct. More...
 
void operator= (const timeFunctionObject &)=delete
 No copy assignment. More...
 
- Protected Member Functions inherited from functionObject
word scopedName (const word &name) const
 Return a scoped (prefixed) name. More...
 
- Protected Attributes inherited from timeFunctionObject
const Timetime_
 Reference to the time database. More...
 

Detailed Description

Writes fields in VTK (xml or legacy) format. Writes cell-values or point-interpolated values for volFields.

Example of function object specification:

vtkWrite1
{
    type            vtkWrite;
    libs            (utilityFunctionObjects);
    writeControl    writeTime;
    writeInterval   1;
    format          binary;
    legacy          false;
    decompose       false;
    ...
    fields          (U p);

    selection
    {
        box
        {
            action  use;
            source  box;
            box     (-0.1 -0.01 -0.1) (0.1 0.30 0.1);
        }
        dome
        {
            action  add;
            source  sphere;
            origin  (-0.1 -0.01 -0.1);
            radius  0.25;
        }
        centre
        {
            action  subtract;
            source  sphere;
            origin  (-0.1 -0.01 -0.1);
            radius  0.1;
        }
        blob
        {
            action  add;
            source  surface;
            surface triSurfaceMesh;
            name    blob.stl;
        }
    }
}


Basic Usage

Property Description Required Default
type Type name: vtkWrite yes
fields Fields to output (wordRe list) yes
boundary Convert boundary fields no true
internal Convert internal fields no true
single Combine patches into a single boundary no false
interpolate Interpolate for point values no false


Output Options

Property Description Required Default
format ascii or binary format no binary
legacy Legacy VTK output no false
precision Write precision in ascii no same as IOstream
directory The output directory name no postProcessing/NAME
width Padding width for file name no 8
decompose Decompose polyhedral cells no false
writeIds Write cell,patch,proc id fields no false


Output Selection

Property Description Required Default
region Name for a single region no region0
regions List of regions (wordRe list) no
patches Limit to listed patches (wordRe list) no
selection Cell selection (topoSet actions) no empty dict
Note
The region of interest is defined by the selection dictionary as a set of actions (use,add,subtract,subset,invert). Omitting the selection dictionary is the same as specifying the conversion of all cells (in the selected regions). Omitting the patches entry is the same as specifying the conversion of all patches.
See also
Foam::functionObjects::ensightWrite Foam::functionObjects::fvMeshFunctionObject Foam::functionObjects::timeControl
Source files

Definition at line 254 of file vtkWrite.H.

Constructor & Destructor Documentation

◆ vtkWrite()

vtkWrite ( const word name,
const Time runTime,
const dictionary dict 
)

Construct from Time and dictionary.

Definition at line 121 of file vtkWrite.C.

References dict, and Foam::read().

Here is the call graph for this function:

◆ ~vtkWrite()

virtual ~vtkWrite ( )
virtualdefault

Destructor.

Member Function Documentation

◆ TypeName()

TypeName ( "vtkWrite"  )

Runtime type information.

◆ read()

bool read ( const dictionary dict)
virtual

Read the vtkWrite specification.

Reimplemented from functionObject.

Definition at line 164 of file vtkWrite.C.

References IOstreamOption::ASCII, IOstreamOption::BINARY, IOstream::defaultPrecision(), dict, IOstreamOption::formatEnum(), Foam::vtk::INLINE_BASE64, Foam::name(), functionObject::outputPrefix, and functionObject::read().

Here is the call graph for this function:

◆ execute()

bool execute ( )
virtual

Execute - does nothing.

Implements functionObject.

Definition at line 245 of file vtkWrite.C.

◆ write()

◆ end()

bool end ( )
virtual

On end - cleanup internal allocations.

Reimplemented from functionObject.

Definition at line 756 of file vtkWrite.C.

◆ updateMesh()

void updateMesh ( const mapPolyMesh mpm)
virtual

Update for changes of mesh.

Reimplemented from functionObject.

Definition at line 271 of file vtkWriteUpdate.C.

References polyMesh::TOPO_CHANGE.

◆ movePoints()

void movePoints ( const polyMesh mesh)
virtual

Update for mesh point-motion.

Reimplemented from functionObject.

Definition at line 277 of file vtkWriteUpdate.C.

References polyMesh::POINTS_MOVED, and polyMesh::UNCHANGED.

◆ writeVolFields() [1/2]

Foam::label writeVolFields ( autoPtr< vtk::internalWriter > &  internalWriter,
UPtrList< vtk::patchWriter > &  patchWriters,
const fvMeshSubset proxy,
const wordHashSet acceptField 
) const

Definition at line 32 of file vtkWriteTemplates.C.

References fvMeshSubset::baseMesh(), Foam::BitOps::count(), Foam::endl(), field(), objectRegistry::findObject(), internalWriter, Foam::fac::interpolate(), Log, patchWriters, objectRegistry::sortedNames(), and writer< Type >::write().

Here is the call graph for this function:

◆ writeVolFields() [2/2]

Foam::label writeVolFields ( autoPtr< vtk::internalWriter > &  internalWriter,
const autoPtr< volPointInterpolation > &  pInterp,
UPtrList< vtk::patchWriter > &  patchWriters,
const UPtrList< PrimitivePatchInterpolation< primitivePatch >> &  patchInterps,
const fvMeshSubset proxy,
const wordHashSet acceptField 
) const

Definition at line 102 of file vtkWriteTemplates.C.

References fvMeshSubset::baseMesh(), Foam::BitOps::count(), Foam::endl(), field(), objectRegistry::findObject(), internalWriter, Foam::fac::interpolate(), Log, patchInterps, patchWriters, pInterp, objectRegistry::sortedNames(), and writer< Type >::write().

Here is the call graph for this function:

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