Skip to main content

VtkWriter

Struct VtkWriter 

Source
pub struct VtkWriter;
Expand description

Stateless collection of higher-level VTK writing helpers.

Implementations§

Source§

impl VtkWriter

Source

pub fn write_unstructured_vector_field( path: &str, points: &[[f64; 3]], cells: &[Vec<usize>], cell_types: &[VtkCellTypeW], field_name: &str, vectors: &[[f64; 3]], ) -> Result<()>

Write an unstructured mesh with an attached vector field to a VTU file.

§Arguments
  • path – output file path (.vtu)
  • points – node coordinates
  • cells – connectivity (each element is a list of 0-based point indices)
  • cell_types – VTK cell type for each cell (parallel to cells)
  • field_name – name of the vector field (e.g. "velocity")
  • vectors – one [vx, vy, vz] per node (point data)
Source

pub fn write_streamlines( path: &str, streamlines: &[Vec<[f64; 3]>], ) -> Result<()>

Write a set of streamlines as VTK PolyData in legacy ASCII format.

Each streamline is a polyline: a sequence of 3-D points. The output is a valid legacy VTK file containing one POLYDATA dataset.

§Arguments
  • path – output file path (.vtk)
  • streamlines – each inner Vec is one polyline (≥ 2 points each)
Source

pub fn write_rectilinear_grid( path: &str, x_coords: &[f64], y_coords: &[f64], z_coords: &[f64], field_name: Option<&str>, scalars: &[f64], ) -> Result<()>

Write a rectilinear grid to a legacy VTK ASCII file.

A rectilinear grid is defined by three 1-D coordinate arrays x_coords, y_coords, z_coords. The grid dimensions are nx × ny × nz where nx = x_coords.len() etc.

Optionally attach a scalar point-data field scalars of length nx * ny * nz (pass an empty slice to omit).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

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

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.