pub struct MeshSourceSampler { /* private fields */ }Expand description
Mesh source sampler over MeshTallyData energy-integrated totals.
The PDF lives over volume elements only (no energy dimension): densities are multiplied by cell volumes before normalization, since structured meshes may have unequal cells.
Implementations§
Source§impl MeshSourceSampler
impl MeshSourceSampler
Sourcepub fn new(
tally: &MeshTallyData,
mode: Mode,
user_pdf: Option<&[f64]>,
) -> Result<Self, Error>
pub fn new( tally: &MeshTallyData, mode: Mode, user_pdf: Option<&[f64]>, ) -> Result<Self, Error>
Build a sampler over tally’s totals in mode.
For Mode::User, user_pdf supplies one unnormalized density value
per volume element (length must equal tally.num_ves()); it is
scaled by cell volumes and normalized, like a bias tag.
Sourcepub fn sample(&self, r1: f64, r2: f64) -> SampledVoxel
pub fn sample(&self, r1: f64, r2: f64) -> SampledVoxel
Sample a birth voxel with two uniforms in [0, 1).
Sourcepub fn num_voxels(&self) -> usize
pub fn num_voxels(&self) -> usize
Number of voxels in the sampling domain.
Sourcepub fn table(&self) -> &AliasTable
pub fn table(&self) -> &AliasTable
The underlying alias table (biased/analog PDF included).
Trait Implementations§
Source§impl Clone for MeshSourceSampler
impl Clone for MeshSourceSampler
Source§fn clone(&self) -> MeshSourceSampler
fn clone(&self) -> MeshSourceSampler
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MeshSourceSampler
impl Debug for MeshSourceSampler
Source§impl PartialEq for MeshSourceSampler
impl PartialEq for MeshSourceSampler
impl StructuralPartialEq for MeshSourceSampler
Auto Trait Implementations§
impl Freeze for MeshSourceSampler
impl RefUnwindSafe for MeshSourceSampler
impl Send for MeshSourceSampler
impl Sync for MeshSourceSampler
impl Unpin for MeshSourceSampler
impl UnsafeUnpin for MeshSourceSampler
impl UnwindSafe for MeshSourceSampler
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