In order to be able to use this module import it like this:

#or assign it to a shorter name
import as vtk



Bases: mpacts.core.command.Command, mpacts.core.baseobject.BaseObject

Writer of VTK (.vtp/vtu) files. The writer acts on the data member given in the constructor. By default all child array managers are written, but without their additional data arrays (such as for instance ‘r’, ‘v’, ...) this can be changed by invoking the ‘select_all’ member function.
Also individual arrays can be selected by adding a ‘enable_VTK_write’ child (‘ r.add_child( BaseObject(‘enable_VTK_write’)’), or they can be unselected by adding a ‘disable_VTK_write’ child.
Conforming to what ParaView expects, symmetric tensors are written as diagonal values, then upper triangle:
0 3 4
x 1 5
x x 2.
If you write a full matrix, however, the order is as in our c++ code, i.e.:
0 1 2
3 4 5
6 7 8.
Has no default location.
  • Required keywords:
    • data — The root of which the data will be written
    • filename — The base filename of the files that will be written. A number will be appended to differentiate between different timesteps.
  • Optional keywords:
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • select_all (default value = 0) — Determines whether the writer tries to write as much as possible or not (by default false). Note: for legacy reasons there is also a named function for this.
    • start_index (default value = 0) — Index of the next file that will be written. The index of each subsequent file will be incremented by one. Default is zero.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: data, filename, [gate, start_index, select_all]
VTKSerialWriter(name, parent, **kwargs)
file_name((VTKSerialWriter)self) → str :

Return the filename of the file that is currently open for writing,or an empty string if no file is open.

select_all((VTKSerialWriter)self, (bool)select_all) → None :

Select all data arrays for every manager under the data parent.