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) |
Add a file with given contentType extension The name is either empty or created with autoName. More... | |
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) |
Add in content from another vtm and place under the given block name. More... | |
void | add (const word &blockName, const fileName &prefix, const vtmWriter &other) |
Add in content from another vtm and place under the given block name. Adjust the added 'file' entries to include the given prefix. More... | |
label | write (const fileName &file) |
Open file for writing (creates parent directory) and write the blocks and TimeValue. More... | |
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 87 of file foamVtmWriter.H.
vtmWriter | ( | ) |
Default construct, with autoName on.
Definition at line 310 of file foamVtmWriter.C.
|
explicit |
Construct with specified behaviour for autoName.
Definition at line 316 of file foamVtmWriter.C.
|
default |
Destructor.
|
inlinestatic |
File extension (always "vtm")
Definition at line 23 of file foamVtmWriterI.H.
References Foam::vtk::fileExtension, and Foam::vtk::MULTI_BLOCK.
bool empty | ( | ) | const |
If there are no data sets.
Definition at line 338 of file foamVtmWriter.C.
References Foam::constant::electromagnetic::e.
Foam::label size | ( | ) | const |
The number of data sets.
Definition at line 352 of file foamVtmWriter.C.
References Foam::constant::electromagnetic::e.
void clear | ( | ) |
Clear all entries and reset output.
Definition at line 328 of file foamVtmWriter.C.
References Foam::Zero.
void setTime | ( | scalar | timeValue | ) |
Define "TimeValue" for FieldData (name as per Catalyst output)
Definition at line 368 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 375 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 382 of file foamVtmWriter.C.
Foam::label endBlock | ( | const word & | blockName = word::null | ) |
End the previous block, optionally with name checking.
Definition at line 391 of file foamVtmWriter.C.
References Foam::endl(), and WarningInFunction.
bool append | ( | const fileName & | file | ) |
Add a file. The name is either empty or created with autoName.
Definition at line 412 of file foamVtmWriter.C.
References append(), word::null, and fileName::stem().
Add a file with name.
Definition at line 439 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 424 of file foamVtmWriter.C.
References append(), word::null, and fileName::stem().
bool append | ( | const word & | name, |
const fileName & | file, | ||
vtk::fileTag | contentType | ||
) |
Add a file with name, with given contentType extension.
Definition at line 455 of file foamVtmWriter.C.
References Foam::vtk::fileExtension, fileName::has_ext(), and Foam::name().
|
inline |
Add a (.vtp) file.
Definition at line 29 of file foamVtmWriterI.H.
References append(), and Foam::vtk::POLY_DATA.
Add a (.vtp) file with name.
Definition at line 36 of file foamVtmWriterI.H.
References append(), Foam::name(), and Foam::vtk::POLY_DATA.
|
inline |
Add a (.vtu) file.
Definition at line 45 of file foamVtmWriterI.H.
References append(), and Foam::vtk::UNSTRUCTURED_GRID.
Add a (.vtu) file with name.
Definition at line 52 of file foamVtmWriterI.H.
References append(), Foam::name(), and Foam::vtk::UNSTRUCTURED_GRID.
void repair | ( | bool | collapse = false | ) |
Sanity fixes on the data.
Definition at line 199 of file foamVtmWriter.C.
References Foam::constant::electromagnetic::e.
Add in content from another vtm and place under the given block name.
Definition at line 562 of file foamVtmWriter.C.
References Foam::add(), and fileName::null.
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 487 of file foamVtmWriter.C.
References Foam::beginBlock(), Foam::constant::electromagnetic::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 571 of file foamVtmWriter.C.
References Foam::constant::electromagnetic::e, format(), fileName::has_ext(), 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 252 of file foamVtmWriter.C.
References Foam::constant::electromagnetic::e, Foam::nl, and os().