Crate weights

Expand description

Tools for MCNP weight window operations

This module is designed for the core weight window structures defined by MCNP.

The main WeightWindow type represents a set of weight windows for a single mesh and particle type.

§MCNP formats

Writers are implemented to generate the standardised UTF-8 file format for WWINP/WWOUT/WWONE files for direct use in MCNP simulations.

Details may be found in the Appendicies of the user manuals:

For example,

// Make a weight window set
let ww = WeightWindow::default();

// Write to standard fromatted UTF-8 file
ww.write("/path/to/wwout");

For combining multiple particle types and meshes into a single file, see the write_multi_particle() convenience function.

let neutron = WeightWindow {
    particle: 1,                    // Particle::Neutron
    ..Default::default()
};

let photon = WeightWindow {
    particle: 2,                    // Particle::Photon
    ..Default::default()
};

// Write a combined NP weight window file
let ww_sets = [photon, neutron];
let weight_window = write_multi_particle(&ww_sets, "wwout_NP", false);

§Visualisation

The weights may also be written out to a Visual Toolkit files using the vtk module.

// Convert to VTK with the default configuration
let vtk = weights_to_vtk(&WeightWindow::default());

// Wite the VTK to a file in one of several formats
write_vtk(vtk, "output.vtk", VtkFormat::Xml).unwrap();

For more details and advanced use see the vtk module documentation.

Modules§

vtk
Conversion to Visual Toolkit (VTK) formats

Structs§

WeightWindow
Mesh-based global weight window data for WWINP/WWOUT/WWONE

Enums§

Error
The error type for the ntools-weights crate

Functions§

write_multi_particle
Combine multiple weight window sets into a single wwout file
write_single_particle
Convenience function for writing a WeightWindow into a single wwout file