PARTISN Input and Output Interfaces – pyne.partisn

There is a module for processing input and output for PARTISN. The functionality of the module can be obtained by importing as such:

from pyne import partisn


Module for the production of PartiSn input decks. PartiSn is a discrete ordinates code produced by Los Almos National Laboratory (LANL). Can be used to produce neutron, photon, or coupled neutron photon prblems, adjoint or forward or time dependent problems can be run.

Module is designed to work on 1D, 2D, or 3D Cartesian geometries.

If PyTaps not installed then this module will not work.


Creates string out of a vector with the PARTISN format for repeated numbers.

pyne.partisn.isotropic_vol_source(geom, mesh, cells, spectra, intensities, **kwargs)[source]

This function creates an isotropic volumetric source within each requested geometry cell of a DAGMC CAD geometry. This is done by Monte Carlo ray tracing to determine volume fractions of each source cell within each mesh volume element. The PARTISN SOURCF card is returned, as well as the ray-traced volume fractions (dagmc.discretize_geom output), so that ray tracing does not have to be done twice when using this function with write_partisn_input. The supplied mesh is also tagged with the calculated source distribution using this function.

pyne.partisn.mesh_to_isotropic_source(m, tag)[source]

This function reads an isotropic source definition from a supplied mesh and creates a corresponding PARTISN SOURCF input card. The input card wraps to 80 characters and utilizes the “R” repeation notation for zero values (e.g. 4R 0 = 0 0 0 0).

pyne.partisn.write_partisn_input(mesh, hdf5, ngroup, **kwargs)[source]

This function reads a material-laden geometry file and a pre-made PyNE mesh object and writes a PARTISN text input file for blocks 1-5. The following cards are included:

block 1: igeom, ngroup, niso, mt, nzone, im, it, jm, jt, km, kt, block 2: xmesh, xints, ymesh, yints, zmesh, zints, zones, block 3: names, block 4: matls, assign, block 5: source.

The ‘source’ card that appears by default is uniform in space and energy and isotropic in direction. In addition, “suggested” cards are printed, commented-out. These suggested cards are the additional cards required for a minimum working PARTISN input file:

block 1: isn, maxscm, maxlcm, block 2: lib, lng, maxord, ihm, iht, ihs, ifido, ititl.

Using the ‘cards’ parameter, any one of these cards (including ‘source’) as well as any PARTISN input card not specified here can be supplied and printed to the input file. Supplied cards will be ommitted from suggested cards.


mesh : PyNE mesh

A premade mesh object that conforms to the geometry. Bounds of the mesh must correspond to the desired PARTISN coarse mesh intervals. By default one fine mesh inverval per coarse mesh will be used. This can be changed with the fine_per_coarse parameter. The sum of all fine mesh intervals in the problem must be greater than or equal to 7. Mesh can be 1-D (Nx1x1 mesh), 2-D (NxMx1 mesh), or 3-D (NxMxP mesh). Only Cartesian meshes are currently supported.

hdf5 : string

File path to a material-laden dagmc geometry file.

ngroup : int

The number of energy groups in the cross section library.

input_file : string, optional, default = ‘<hdf5 file name>_partisn.inp’

Desired path of generated PARTISN input file. Any file already existing by the same name will be overwritten.

cards : dict, optional, default = {}

This is a dictionary with the following keys: ‘block1’, ‘block2’, ‘block3’, ‘block4’, ‘block5’. The values are each dicts in the format:

<partisn_card_name>:<partisn_card_value>. These cards will be printed

out in the input file produced by this function. When specifying a source via this method, the key source be ‘source’ and the value should the entire source card, including the card name (e.g. source, sourcx, sourcef, etc) and ‘=’.

names_dict : dict, optional, default = None

PyNE element/isotope names to bxslib name assignment. Keys are PyNE nucids (int) and values are bxslib names (str) Example: names_dict[250550000] =’mn55’

num_rays : int, optional, default = 10

For discretize_geom. Structured mesh only. The number of rays to fire in each mesh row for each direction.

grid : boolean, optional, default = False

For discretize_geom. Structured mesh only. If false, rays starting points are chosen randomly (on the boundary) for each mesh row. If true, a linearly spaced grid of starting points is used, with dimension sqrt(num_rays) x sqrt(num_rays). In this case, “num_rays” must be a perfect square.

dg : record array, optional, default = None

The output of pyne.dagmc.discretize_geom(). Use this input option if discretize_geom() has already been run, to avoid duplicating this expensive step.

fine_per_coarse : int, optional, default = 1

The number of fine mesh intervals per coarse mesh interval.

data_hdf5path : string, optional, default = /materials

the path in the heirarchy to the data table in an HDF5 file.

nuc_hdf5path : string, optional, default = /nucid

the path in the heirarchy to the nuclide array in an HDF5 file.