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() -> Self
pub fn new() -> Self
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
Trait Implementations§
§impl Debug for MeshtalReader
impl Debug for MeshtalReader
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
§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.