Struct MeshtalReader
pub struct MeshtalReader { /* private fields */ }
Expand description
A generalised reader for legacy meshtal files of any type
Supports COL, CF, UKAEA Cell-under-Voxel, IJ, IK, and JK output formats for both rectangular and cylindrical meshes.
The reader operates in two stages to minimise time wasted on erroneous inputs:
- Quickly check mesh tally IDs and auto-detect their formatting
- Extract the data using the appropriate parsing strategy
Notes:
- CuV results are weighted by volume of each contributing cell
- VoidRecord::Off will fill in missing void voxels with 0.0 flux
- Run-on numbers without whitespace are handled e.g. 1.00E+00-2.00E+00
- Broken exponential formatting is handled e.g. 1.00+002 => 1.00E+002
- Rectangualr mesh origin set to match FMESH input cards
Minimal Example:
let path = Path::new("path/to/file.msht");
let mut reader = MeshtalReader::new();
let mesh_list = reader.parse(path).unwrap();
Implementations§
§impl MeshtalReader
High level methods
impl MeshtalReader
High level methods
pub fn new() -> MeshtalReader
pub fn new() -> MeshtalReader
Just calls Default::default(), nothing special to be initialised
pub fn parse(&mut self, path: &Path) -> Result<Vec<Mesh>, Error>
pub fn parse(&mut self, path: &Path) -> Result<Vec<Mesh>, Error>
Parses all mesh data from a mcnp meshtal file
May need to implement something to ensure precision consistency for the energy and time group values used
pub fn set_target_id(&mut self, target_id: u32)
pub fn set_target_id(&mut self, target_id: u32)
Setter for specifying which mesh to target
pub fn disable_progress(&mut self)
pub fn disable_progress(&mut self)
Do not print the tqdm progress indicators
impl MeshtalReader
This impl block contains no items.
Single use initialisations
impl MeshtalReader
This impl block contains no items.
Primary run loop and fixes
impl MeshtalReader
This impl block contains no items.
COL, sparse COL, and CF formats
impl MeshtalReader
This impl block contains no items.
Matrix IJ, JK, IK formats
impl MeshtalReader
This impl block contains no items.
Cell-under-Voxel formats
Trait Implementations§
§impl Debug for MeshtalReader
impl Debug for MeshtalReader
§impl Default for MeshtalReader
impl Default for MeshtalReader
§fn default() -> MeshtalReader
fn default() -> MeshtalReader
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MeshtalReader
impl RefUnwindSafe for MeshtalReader
impl Send for MeshtalReader
impl Sync for MeshtalReader
impl Unpin for MeshtalReader
impl UnwindSafe for MeshtalReader
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<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>
Converts
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>
Converts
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>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§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).§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.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.