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: VoxelTallyGridThe grid the voxels refer to.
histories: u64Primary histories tallied.
voxels: Vec<VoxelRecord>Occupied voxels.
outside: VoxelCellSum 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
impl VoxelReport
Sourcepub fn defect_totals(&self) -> Vec<SpeciesDefects>
pub fn defect_totals(&self) -> Vec<SpeciesDefects>
Per-species defects summed over the occupied voxels (not including
Self::outside_defects); empty without species.
Sourcepub fn grand_defect_totals(&self) -> Vec<SpeciesDefects>
pub fn grand_defect_totals(&self) -> Vec<SpeciesDefects>
Per-species defects over the grid and the outside.
Sourcepub fn totals(&self) -> VoxelCell
pub fn totals(&self) -> VoxelCell
Sum over the occupied voxels (not including Self::outside), added
in flat-index order.
Sourcepub fn grand_totals(&self) -> VoxelCell
pub fn grand_totals(&self) -> VoxelCell
Sum over the grid and the outside: everything the tally received.
Sourcepub fn profile(&self, axis: usize) -> Vec<VoxelCell>
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.
Sourcepub fn write_csv<W: Write>(&self, w: W) -> Result<()>
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.
Sourcepub fn write_export_csv<W: Write>(
&self,
w: W,
p: &ExportProvenance,
) -> Result<()>
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.
Sourcepub fn to_export_csv(&self, p: &ExportProvenance) -> String
pub fn to_export_csv(&self, p: &ExportProvenance) -> String
The damage-export file as a string.
Sourcepub fn read_csv(text: &str) -> Result<Self, VoxelTallyError>
pub fn read_csv(text: &str) -> Result<Self, VoxelTallyError>
Read back a file written by Self::write_csv.
Sourcepub fn read_export_csv(
text: &str,
) -> Result<(Self, ExportProvenance), VoxelTallyError>
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.
Sourcepub fn write_vtk<W: Write>(&self, w: W) -> Result<()>
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.
Sourcepub fn read_vtk(text: &str) -> Result<Self, VoxelTallyError>
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
impl Clone for VoxelReport
Source§fn clone(&self) -> VoxelReport
fn clone(&self) -> VoxelReport
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for VoxelReport
impl Debug for VoxelReport
Source§impl<'de> Deserialize<'de> for VoxelReport
impl<'de> Deserialize<'de> for VoxelReport
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for VoxelReport
impl PartialEq for VoxelReport
Source§impl Serialize for VoxelReport
impl Serialize for VoxelReport
impl StructuralPartialEq for VoxelReport
Auto Trait Implementations§
impl Freeze for VoxelReport
impl RefUnwindSafe for VoxelReport
impl Send for VoxelReport
impl Sync for VoxelReport
impl Unpin for VoxelReport
impl UnsafeUnpin for VoxelReport
impl UnwindSafe for VoxelReport
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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