Struct WeightsToVtk
pub struct WeightsToVtk {
pub byte_order: ByteOrder,
pub compressor: Compressor,
pub resolution: u8,
}
Expand description
Convert weight window sets to vtk formats for plotting
All of the of logic for converting weight window sets into the right VTK types and formats is implemented here. This includes calculating verticies for cylindrical cases as an unstructured mesh.
The fields remain public for direct use, but for convenience and style preference a builder pattern is also implemented and recommended.
§Formatting
Included are a couple of more advanced options for VTK preferences.
Most useful is the byte ordering, which is important for binary file compatability with plotting software. ParaView does not care, but something like Visit only likes big endian. This is the default for convenience but is completely up to the user.
let converter = WeightsToVtk::builder()
.byte_order(ByteOrder::LittleEndian)
.build();
Perhaps less useful is the compression method for XML file formats, but it is included for completeness anyway.
let converter = WeightsToVtk::builder()
.compressor(Compressor::LZMA)
.build();
Generally just use LZMA but other options are available:
- lzma (default)
- lz4
- zlib
- none
§A note on Cylindrical meshes
There is no VTK representation of cylindrical meshes, so an unstructured mesh is generated from verticies based on the RZT bounds.
Unfortunately, this can result in “low-resolution” plots for meshes with few theta bins. The number of theta bins can be increased to round off these edges. This simply subdivides the voxels by an integer number of theta bins.
For example:
let converter = WeightsToVtk::builder()
.resolution(3)
.build();
Setting the resolution
to 3 will subbdivide the theta bins into 3, thereby
tripling the number of edges plotted from 8 to 24 for a more rounded look.
Note that this can increase memory usage and file size significantly but is a nice feature for generating more accurate cylinders.
Fields§
§byte_order: ByteOrder
Byte ordering as big or little endian
compressor: Compressor
compression method for xml file formats
resolution: u8
Cylindrical mesh resolution
Implementations§
§impl WeightsToVtk
impl WeightsToVtk
pub fn new() -> WeightsToVtk
pub fn new() -> WeightsToVtk
Start with the default configuration
pub fn builder() -> WeightsToVtkBuilder
pub fn builder() -> WeightsToVtkBuilder
Get an instance of the WeightsToVtkBuilder
pub fn convert(&self, weight_window: &WeightWindow) -> Vtk
pub fn convert(&self, weight_window: &WeightWindow) -> Vtk
Convert a WeightWindow to Vtk object
Once the configuration is set through either the builder or changing the fields directly, convert any WeightWindow into a Vtk ready for writing or futher processing.
impl WeightsToVtk
Implementations for proecessing Rectangular mesh types
impl WeightsToVtk
Implementations for proecessing Cylindrical mesh types
Trait Implementations§
§impl Debug for WeightsToVtk
impl Debug for WeightsToVtk
§impl Default for WeightsToVtk
impl Default for WeightsToVtk
§fn default() -> WeightsToVtk
fn default() -> WeightsToVtk
§impl PartialEq for WeightsToVtk
impl PartialEq for WeightsToVtk
impl StructuralPartialEq for WeightsToVtk
Auto Trait Implementations§
impl Freeze for WeightsToVtk
impl RefUnwindSafe for WeightsToVtk
impl Send for WeightsToVtk
impl Sync for WeightsToVtk
impl Unpin for WeightsToVtk
impl UnwindSafe for WeightsToVtk
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.