Provides a means of accumulating file entries for generating a vtkMultiBlockDataSet (.vtm) file. More...
Public Member Functions | |
vtmWriter () | |
Default construct, with autoName on. More... | |
vtmWriter (bool autoName) | |
Construct with specified behaviour for autoName. More... | |
~vtmWriter ()=default | |
Destructor. More... | |
bool | empty () const |
If there are no data sets. More... | |
label | size () const |
The number of data sets. More... | |
void | clear () |
Clear all entries and reset output. More... | |
void | setTime (scalar timeValue) |
Define "TimeValue" for FieldData (name as per Catalyst output) More... | |
void | setTime (const Time &t) |
Define "TimeValue" for FieldData (name as per Catalyst output) More... | |
label | beginBlock (const word &blockName=word::null) |
Start a new block, optionally with a name. More... | |
label | endBlock (const word &blockName=word::null) |
End the previous block, optionally with name checking. More... | |
bool | append (const fileName &file) |
Add a file. The name is either empty or created with autoName. More... | |
bool | append (const word &name, const fileName &file) |
Add a file with name. More... | |
bool | append (const fileName &file, vtk::fileTag contentType) |
bool | append (const word &name, const fileName &file, vtk::fileTag contentType) |
Add a file with name, with given contentType extension. More... | |
bool | append_vtp (const fileName &file) |
Add a (.vtp) file. More... | |
bool | append_vtp (const word &name, const fileName &file) |
Add a (.vtp) file with name. More... | |
bool | append_vtu (const fileName &file) |
Add a (.vtu) file. More... | |
bool | append_vtu (const word &name, const fileName &file) |
Add a (.vtu) file with name. More... | |
void | repair (bool collapse=false) |
Sanity fixes on the data. More... | |
void | add (const word &blockName, const vtmWriter &other) |
void | add (const word &blockName, const fileName &prefix, const vtmWriter &other) |
label | write (const fileName &file) |
void | dump (Ostream &os) const |
Print debug view of block and dataset contents. More... | |
Static Public Member Functions | |
static word | ext () |
File extension (always "vtm") More... | |
Provides a means of accumulating file entries for generating a vtkMultiBlockDataSet (.vtm) file.
For example, to generate the following content:
<?xml version='1.0'?> <VTKFile type='vtkMultiBlockDataSet' ...> <vtkMultiBlockDataSet> <DataSet name='internal' file='internal.vtu' /> <Block name='boundary'> <DataSet name='inlet' file='boundary/inlet.vtp' /> <DataSet name='outlet' file='boundary/outlet.vtp' /> </Block> </vtkMultiBlockDataSet> <FieldData> <DataArray type='Float32' Name='TimeValue' ...> 12.345 </DataArray> </FieldData> </VTKFile>
The following code would be used:
Definition at line 91 of file foamVtmWriter.H.
vtmWriter | ( | ) |
Default construct, with autoName on.
Definition at line 317 of file foamVtmWriter.C.
Construct with specified behaviour for autoName.
Definition at line 323 of file foamVtmWriter.C.
|
default |
Destructor.
|
inlinestatic |
File extension (always "vtm")
Definition at line 30 of file foamVtmWriterI.H.
References Foam::vtk::fileExtension, and Foam::vtk::MULTI_BLOCK.
bool empty | ( | ) | const |
Foam::label size | ( | ) | const |
void clear | ( | ) |
Clear all entries and reset output.
Definition at line 335 of file foamVtmWriter.C.
References Foam::Zero.
void setTime | ( | scalar | timeValue | ) |
Define "TimeValue" for FieldData (name as per Catalyst output)
Definition at line 375 of file foamVtmWriter.C.
Referenced by vtkWrite::write().
void setTime | ( | const Time & | t | ) |
Define "TimeValue" for FieldData (name as per Catalyst output)
Definition at line 382 of file foamVtmWriter.C.
References dimensioned< Type >::value().
Foam::label beginBlock | ( | const word & | blockName = word::null | ) |
Start a new block, optionally with a name.
Definition at line 389 of file foamVtmWriter.C.
Foam::label endBlock | ( | const word & | blockName = word::null | ) |
End the previous block, optionally with name checking.
Definition at line 398 of file foamVtmWriter.C.
References Foam::endl(), and WarningInFunction.
Add a file. The name is either empty or created with autoName.
Definition at line 420 of file foamVtmWriter.C.
References append(), and fileName::nameLessExt().
Add a file with name.
Definition at line 446 of file foamVtmWriter.C.
References Foam::name().
bool append | ( | const fileName & | file, |
vtk::fileTag | contentType | ||
) |
Add a file with given contentType extension The name is either empty or created with autoName
Definition at line 431 of file foamVtmWriter.C.
References append(), and fileName::nameLessExt().
bool append | ( | const word & | name, |
const fileName & | file, | ||
vtk::fileTag | contentType | ||
) |
Add a file with name, with given contentType extension.
Definition at line 462 of file foamVtmWriter.C.
References Foam::vtk::fileExtension, fileName::hasExt(), and Foam::name().
Add a (.vtp) file.
Definition at line 36 of file foamVtmWriterI.H.
References append(), and Foam::vtk::POLY_DATA.
Add a (.vtp) file with name.
Definition at line 42 of file foamVtmWriterI.H.
References append(), Foam::name(), and Foam::vtk::POLY_DATA.
Add a (.vtu) file.
Definition at line 52 of file foamVtmWriterI.H.
References append(), and Foam::vtk::UNSTRUCTURED_GRID.
Add a (.vtu) file with name.
Definition at line 58 of file foamVtmWriterI.H.
References append(), Foam::name(), and Foam::vtk::UNSTRUCTURED_GRID.
void repair | ( | bool | collapse = false | ) |
Add in content from another vtm and place under the given block name.
Definition at line 569 of file foamVtmWriter.C.
References Foam::add().
Referenced by vtkWrite::write().
Add in content from another vtm and place under the given block name. Adjust the added 'file' entries to include the given prefix.
Definition at line 494 of file foamVtmWriter.C.
References Foam::beginBlock(), e, and f().
Foam::label write | ( | const fileName & | file | ) |
Open file for writing (creates parent directory) and write the blocks and TimeValue.
The file name is with/without an extension.
Definition at line 579 of file foamVtmWriter.C.
References e, format(), fileName::hasExt(), Foam::vtk::INLINE_ASCII, Foam::mkDir(), Foam::vtk::MULTI_BLOCK, Foam::name(), Foam::vtk::newFormatter(), and fileName::path().
Referenced by vtkWrite::write().
void dump | ( | Ostream & | os | ) | const |
Print debug view of block and dataset contents.
Definition at line 259 of file foamVtmWriter.C.
References e, Foam::nl, and os().