pub struct VtkStreamWriter {
pub output: Vec<u8>,
pub dims: (usize, usize, usize),
pub spacing: (f64, f64, f64),
pub origin: (f64, f64, f64),
pub dataset_name: String,
pub header_written: bool,
pub fields_written: usize,
}Expand description
A streaming writer for VTK legacy format (ASCII structured points).
Builds VTK output incrementally as physics data is produced, without buffering the entire dataset in memory.
Fields§
§output: Vec<u8>Output buffer (simulates file I/O).
dims: (usize, usize, usize)Grid dimensions (nx, ny, nz).
spacing: (f64, f64, f64)Grid spacing (dx, dy, dz).
origin: (f64, f64, f64)Origin (ox, oy, oz).
dataset_name: StringDataset name.
header_written: boolWhether the header has been written.
fields_written: usizeNumber of scalar fields written.
Implementations§
Source§impl VtkStreamWriter
impl VtkStreamWriter
Sourcepub fn new(
dims: (usize, usize, usize),
spacing: (f64, f64, f64),
origin: (f64, f64, f64),
dataset_name: &str,
) -> Self
pub fn new( dims: (usize, usize, usize), spacing: (f64, f64, f64), origin: (f64, f64, f64), dataset_name: &str, ) -> Self
Create a new VTK stream writer.
Sourcepub fn write_header(&mut self)
pub fn write_header(&mut self)
Write the VTK file header (must be called before any field).
Sourcepub fn write_scalar_field(&mut self, field_name: &str, data: &[f64])
pub fn write_scalar_field(&mut self, field_name: &str, data: &[f64])
Write a scalar field with the given name and data.
Must call write_header first.
Sourcepub fn bytes_written(&self) -> usize
pub fn bytes_written(&self) -> usize
Total bytes written.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for VtkStreamWriter
impl RefUnwindSafe for VtkStreamWriter
impl Send for VtkStreamWriter
impl Sync for VtkStreamWriter
impl Unpin for VtkStreamWriter
impl UnsafeUnpin for VtkStreamWriter
impl UnwindSafe for VtkStreamWriter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.