Skip to main content

VoxelReport

Struct VoxelReport 

Source
pub struct VoxelReport {
    pub grid: VoxelTallyGrid,
    pub histories: u64,
    pub voxels: Vec<VoxelRecord>,
    pub outside: VoxelCell,
    pub species_z: Vec<u8>,
    pub outside_defects: Vec<SpeciesDefects>,
}
Expand description

A VoxelTally as plain data. Voxels are in increasing flat-index order (i + nx (j + ny k)).

Fields§

§grid: VoxelTallyGrid

The grid the voxels refer to.

§histories: u64

Primary histories tallied.

§voxels: Vec<VoxelRecord>

Occupied voxels.

§outside: VoxelCell

Sum of the events outside the grid.

§species_z: Vec<u8>

Atomic number of each species index; empty when defects were not tallied (VoxelTally::with_species).

§outside_defects: Vec<SpeciesDefects>

Defects outside the grid, per species index.

Implementations§

Source§

impl VoxelReport

Source

pub fn defect_totals(&self) -> Vec<SpeciesDefects>

Per-species defects summed over the occupied voxels (not including Self::outside_defects); empty without species.

Source

pub fn grand_defect_totals(&self) -> Vec<SpeciesDefects>

Per-species defects over the grid and the outside.

Source

pub fn totals(&self) -> VoxelCell

Sum over the occupied voxels (not including Self::outside), added in flat-index order.

Source

pub fn grand_totals(&self) -> VoxelCell

Sum over the grid and the outside: everything the tally received.

Source

pub fn profile(&self, axis: usize) -> Vec<VoxelCell>

Per-slab sums along axis (0 = x): entry n adds every occupied voxel whose index on that axis is n. This is the laterally integrated profile, comparable to a 1D depth tally of the same bins.

Source

pub fn write_csv<W: Write>(&self, w: W) -> Result<()>

Write the CSV export: a # key = value header, a column row, then one row per occupied voxel (indices, centre in m, tallies; energies in eV). See the module docs.

Source

pub fn write_export_csv<W: Write>( &self, w: W, p: &ExportProvenance, ) -> Result<()>

Write the damage-export file: the Self::write_csv layout under the EXPORT_BANNER, with the provenance and units keys in the header (docs/damage-export-format.md). Floats are the shortest text that reads back to the same bits, so Self::read_export_csv returns the report unchanged.

Source

pub fn to_export_csv(&self, p: &ExportProvenance) -> String

The damage-export file as a string.

Source

pub fn to_csv(&self) -> String

The CSV export as a string.

Source

pub fn read_csv(text: &str) -> Result<Self, VoxelTallyError>

Read back a file written by Self::write_csv.

Source

pub fn read_export_csv( text: &str, ) -> Result<(Self, ExportProvenance), VoxelTallyError>

Read back a file written by Self::write_export_csv, with its provenance. Errors if the banner, the format version or any provenance key is missing.

Source

pub fn write_vtk<W: Write>(&self, w: W) -> Result<()>

Write the legacy ASCII VTK export: an UNSTRUCTURED_GRID with one VTK_VOXEL cell per occupied voxel and the tallies as cell scalars. The grid and the history count are in the title line. See the module docs.

Source

pub fn to_vtk(&self) -> String

The VTK export as a string.

Source

pub fn read_vtk(text: &str) -> Result<Self, VoxelTallyError>

Read back a file written by Self::write_vtk. The result has an empty Self::outside, which the VTK file does not carry.

Trait Implementations§

Source§

impl Clone for VoxelReport

Source§

fn clone(&self) -> VoxelReport

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for VoxelReport

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for VoxelReport

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for VoxelReport

Source§

fn eq(&self, other: &VoxelReport) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for VoxelReport

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for VoxelReport

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V