pub struct VtrWriter<'a> { /* private fields */ }Expand description
Builder for one .vtr file. See the module documentation.
All inputs are borrowed; nothing is copied. Inconsistent inputs (wrong
array lengths, duplicate names, non-increasing coordinates, …) are reported
as Error::Invalid by write / write_to
before anything is written.
Implementations§
Source§impl<'a> VtrWriter<'a>
impl<'a> VtrWriter<'a>
Sourcepub fn new(x: &'a [f64], y: &'a [f64], z: &'a [f64]) -> Self
pub fn new(x: &'a [f64], y: &'a [f64], z: &'a [f64]) -> Self
Starts a file for the rectilinear grid with coordinates x, y, z
(metres, each non-empty and strictly increasing).
Sourcepub fn encoding(self, encoding: Encoding) -> Self
pub fn encoding(self, encoding: Encoding) -> Self
Sets the data encoding (default Encoding::Binary).
Sourcepub fn header_type(self, header: HeaderType) -> Self
pub fn header_type(self, header: HeaderType) -> Self
Sets the binary header type (default HeaderType::UInt64).
Sourcepub fn time(self, t: f64) -> Self
pub fn time(self, t: f64) -> Self
Stores t as the TimeValue field-data entry, the time ParaView
assigns to this dataset. For a frequency-domain dump, pass the
frequency (and consider also adding it with field
under a descriptive name).
Sourcepub fn field(self, name: impl Into<String>, values: &'a [f64]) -> Self
pub fn field(self, name: impl Into<String>, values: &'a [f64]) -> Self
Adds a Float64 field-data array (dataset-wide metadata, not attached
to points or cells), e.g. field("Frequency", &[f]).
Sourcepub fn point<T: VtkFloat>(
self,
name: impl Into<String>,
field: Field<'a, T>,
layout: Layout,
) -> Self
pub fn point<T: VtkFloat>( self, name: impl Into<String>, field: Field<'a, T>, layout: Layout, ) -> Self
Adds a point array (one tuple per grid node).
Sourcepub fn cell<T: VtkFloat>(
self,
name: impl Into<String>,
field: Field<'a, T>,
layout: Layout,
) -> Self
pub fn cell<T: VtkFloat>( self, name: impl Into<String>, field: Field<'a, T>, layout: Layout, ) -> Self
Adds a cell array (one tuple per grid cell).
Sourcepub fn point_scalar<T: VtkFloat>(
self,
name: impl Into<String>,
data: &'a [T],
layout: Layout,
) -> Self
pub fn point_scalar<T: VtkFloat>( self, name: impl Into<String>, data: &'a [T], layout: Layout, ) -> Self
Adds a scalar point array; shorthand for
point(name, Field::Scalar(data), layout).
Sourcepub fn point_vector<T: VtkFloat>(
self,
name: impl Into<String>,
data: &'a [[T; 3]],
layout: Layout,
) -> Self
pub fn point_vector<T: VtkFloat>( self, name: impl Into<String>, data: &'a [[T; 3]], layout: Layout, ) -> Self
Adds an interleaved vector point array; shorthand for
point(name, Field::Vector(data), layout).
Sourcepub fn cell_scalar<T: VtkFloat>(
self,
name: impl Into<String>,
data: &'a [T],
layout: Layout,
) -> Self
pub fn cell_scalar<T: VtkFloat>( self, name: impl Into<String>, data: &'a [T], layout: Layout, ) -> Self
Adds a scalar cell array; shorthand for
cell(name, Field::Scalar(data), layout).
Sourcepub fn cell_vector<T: VtkFloat>(
self,
name: impl Into<String>,
data: &'a [[T; 3]],
layout: Layout,
) -> Self
pub fn cell_vector<T: VtkFloat>( self, name: impl Into<String>, data: &'a [[T; 3]], layout: Layout, ) -> Self
Adds an interleaved vector cell array; shorthand for
cell(name, Field::Vector(data), layout).
Sourcepub fn point_complex<T: VtkFloat>(
self,
name: &str,
re: Field<'a, T>,
im: Field<'a, T>,
layout: Layout,
form: ComplexForm,
) -> Self
pub fn point_complex<T: VtkFloat>( self, name: &str, re: Field<'a, T>, im: Field<'a, T>, layout: Layout, form: ComplexForm, ) -> Self
Adds a complex point array as two real arrays (see ComplexForm).
re and im must have the same shape (both scalar or both vector).
Sourcepub fn cell_complex<T: VtkFloat>(
self,
name: &str,
re: Field<'a, T>,
im: Field<'a, T>,
layout: Layout,
form: ComplexForm,
) -> Self
pub fn cell_complex<T: VtkFloat>( self, name: &str, re: Field<'a, T>, im: Field<'a, T>, layout: Layout, form: ComplexForm, ) -> Self
Adds a complex cell array as two real arrays (see ComplexForm).
re and im must have the same shape (both scalar or both vector).