Geometry

class mcnpy.Cell(*args, **kwargs)

Bases: IDManagerMixin, Cell

A representation of the model object Cell.

Parameters
class DetectorContribution(*args, **kwargs)

Bases: CellDetectorContribution

A representation of the model object Cell.DetectorContribution.

Parameters
  • tally (mcnpy.Tally) – Tally for Cell.DetectorContribution.

  • probability (float) – Probability for Cell.DetectorContribution.

class DeterministicContribution(*args, **kwargs)

Bases: CellDeterministicContribution

A representation of the model object Cell.DeterministicContribution.

Parameters
property sphere
class EnergyCutoff(*args, **kwargs)

Bases: CellEnergyCutoff

A representation of the model object Cell.EnergyCutoff.

Parameters
  • lower_cutoff (float) – LowerCutoff for Cell.EnergyCutoff.

  • particles (iterable of mcnpy.Particle) – Particles for Cell.EnergyCutoff.

class ExponentialTransform(*args, **kwargs)

Bases: CellExponentialTransform

A representation of the model object Cell.ExponentialTransform.

Parameters
  • magnitude (float) – Magnitude for Cell.ExponentialTransform.

  • axis (mcnpy.Axis) – Axis for Cell.ExponentialTransform.

  • vector (mcnpy.Vector) – Vector for Cell.ExponentialTransform.

  • particles (iterable of mcnpy.Particle) – Particles for Cell.ExponentialTransform.

property vector
class Fill(*args, **kwargs)

Bases: CellFill

A representation of the model object Cell.Fill.

Parameters
  • unit (mcnpy.AngleUnit) – Unit for Cell.Fill.

  • fill (Object) – Fill for Cell.Fill.

  • transform (mcnpy.Transform) – Transform for Cell.Fill.

  • transformation (mcnpy.Transformation) – Transformation for Cell.Fill.

  • i (iterable of int) – I for Cell.Fill.

  • j (iterable of int) – J for Cell.Fill.

  • k (iterable of int) – K for Cell.Fill.

  • lattice (iterable of Object) – Lattice for Cell.Fill.

  • transforms (iterable of mcnpy.Transform) – Transforms for Cell.Fill.

  • transformations (iterable of mcnpy.Transformation) – Transformations for Cell.Fill.

lattice_fill(lattice, cell)

Cell.Fill using a Lattice.

universe_fill(universe, cell, transform=None, transformation=None)

Cell.Fill using a UniverseList, UniverseBase, or UniversesBase.

class ForcedCollision(*args, **kwargs)

Bases: CellForcedCollision

A representation of the model object Cell.ForcedCollision.

Parameters
  • which_particles (iterable of float) – WhichParticles for Cell.ForcedCollision.

  • particles (iterable of mcnpy.Particle) – Particles for Cell.ForcedCollision.

class Importance(*args, **kwargs)

Bases: CellImportance

A representation of the model object Cell.Importance.

Parameters
  • particles (iterable of mcnpy.Particle) – Particles for Cell.Importance.

  • importance (float) – Importance for Cell.Importance.

class UncollidedSecondaries(*args, **kwargs)

Bases: CellUncollidedSecondaries

A representation of the model object Cell.UncollidedSecondaries.

Parameters
  • uncollided (int) – Uncollided for Cell.UncollidedSecondaries.

  • particles (iterable of mcnpy.Particle) – Particles for Cell.UncollidedSecondaries.

class WeightWindow(*args, **kwargs)

Bases: CellWeightWindow

A representation of the model object Cell.WeightWindow.

Parameters
  • index (int) – Index for Cell.WeightWindow.

  • weight_window (float) – WeightWindow for Cell.WeightWindow.

  • particles (iterable of mcnpy.Particle) – Particles for Cell.WeightWindow.

property density
property fill
property importances
property material
next_id = 1
property no_fission
property region
property temperature
used_ids = {}
class mcnpy.Transformation(*args, **kwargs)

Bases: IDManagerMixin, Transformation, GeometrySetting

TR Card

Parameters
  • name (str) – Unique ID for the transformation.

  • transformation (mcnpy.geometry.Transform or nested list) – The transformation itself described as a Transform or a list. The list may contain up to 3 items. First a list of displacements, second a 3x3 array describing the rotation matrix, and third the ‘m’ value specifiying the rotation reference frame.

next_id = 1
property transformation
used_ids = {}
class mcnpy.Transform(*args, **kwargs)

Bases: Transform

A representation of the model object Transform.

Parameters
  • disp1 (float) – Disp1 for Transform.

  • j_disp1 (str) – J_disp1 for Transform.

  • disp2 (float) – Disp2 for Transform.

  • j_disp2 (str) – J_disp2 for Transform.

  • disp3 (float) – Disp3 for Transform.

  • j_disp3 (str) – J_disp3 for Transform.

  • rotation (mcnpy.Transform.RotMatrix) – Rotation for Transform.

class RotMatrix(*args, **kwargs)

Bases: RotMatrix

A representation of the model object Transform.RotMatrix.

Parameters
  • xx (float) – Xx for Transform.RotMatrix.

  • j_xx (str) – J_xx for Transform.RotMatrix.

  • yx (float) – Yx for Transform.RotMatrix.

  • j_yx (str) – J_yx for Transform.RotMatrix.

  • zx (float) – Zx for Transform.RotMatrix.

  • j_zx (str) – J_zx for Transform.RotMatrix.

  • xy (float) – Xy for Transform.RotMatrix.

  • j_xy (str) – J_xy for Transform.RotMatrix.

  • yy (float) – Yy for Transform.RotMatrix.

  • j_yy (str) – J_yy for Transform.RotMatrix.

  • zy (float) – Zy for Transform.RotMatrix.

  • j_zy (str) – J_zy for Transform.RotMatrix.

  • xz (float) – Xz for Transform.RotMatrix.

  • j_xz (str) – J_xz for Transform.RotMatrix.

  • yz (float) – Yz for Transform.RotMatrix.

  • j_yz (str) – J_yz for Transform.RotMatrix.

  • zz (float) – Zz for Transform.RotMatrix.

  • j_zz (str) – J_zz for Transform.RotMatrix.

  • m (float) – M for Transform.RotMatrix.

  • j_m (str) – J_m for Transform.RotMatrix.

property matrix
property displacement
class mcnpy.Volumes(*args, **kwargs)

Bases: Volumes, GeometrySetting

A representation of the model object Volumes.

Parameters

volumes (iterable of str) – Volumes for Volumes.

class mcnpy.Areas(*args, **kwargs)

Bases: Areas, GeometrySetting

A representation of the model object Areas.

Parameters

areas (iterable of str) – Areas for Areas.

class mcnpy.Fills(*args, **kwargs)

Bases: Fills, GeometrySetting

A representation of the model object Fills.

class mcnpy.StochasticGeometry(*args, **kwargs)

Bases: StochasticGeometry, GeometrySetting

A representation of the model object StochasticGeometry.

Parameters

stochastic_transformations (iterable of mcnpy.StochasticGeometry.Transformation) – StochasticTransformations for StochasticGeometry.

class Transformation(*args, **kwargs)

Bases: StochasticGeometryTransformation

A representation of the model object StochasticGeometry.Transformation.

Parameters
  • universe (Object) – Universe for StochasticGeometry.Transformation.

  • dx (float) – Dx for StochasticGeometry.Transformation.

  • dy (float) – Dy for StochasticGeometry.Transformation.

  • dz (float) – Dz for StochasticGeometry.Transformation.

class mcnpy.Deterministic

Bases: GeometrySetting

class Materials(*args, **kwargs)

Bases: DeterministicMaterials, GeometrySetting

A representation of the model object Deterministic.Materials.

class WeightWindowGenerator(*args, **kwargs)

Bases: DeterministicWeightWindowGenerator, GeometrySetting

A representation of the model object Deterministic.WeightWindowGenerator.

Parameters
  • points (int) – Points for Deterministic.WeightWindowGenerator.

  • xsec_library (mcnpy.Library) – XsecLibrary for Deterministic.WeightWindowGenerator.

  • tally (mcnpy.Tally) – Tally for Deterministic.WeightWindowGenerator.

  • block_one (mcnpy.Partisn.BlockOne) – BlockOne for Deterministic.WeightWindowGenerator.

  • block_three (mcnpy.Partisn.BlockThree) – BlockThree for Deterministic.WeightWindowGenerator.

  • block_five (mcnpy.Partisn.BlockFive) – BlockFive for Deterministic.WeightWindowGenerator.

  • block_six (mcnpy.Partisn.BlockSix) – BlockSix for Deterministic.WeightWindowGenerator.

class mcnpy.Embedded

Bases: GeometrySetting

class Edit(*args, **kwargs)

Bases: EmbeddedEdit, GeometrySetting

A representation of the model object Embedded.Edit.

Parameters
  • name (int) – Name for Embedded.Edit.

  • mesh_universe (int) – MeshUniverse for Embedded.Edit.

  • scale_energy (float) – ScaleEnergy for Embedded.Edit.

  • scale_time (float) – ScaleTime for Embedded.Edit.

  • atom_density_flag (mcnpy.YesNo) – AtomDensityFlag for Embedded.Edit.

  • mult_constant (float) – MultConstant for Embedded.Edit.

  • rxn_list (mcnpy.Tally.Bins.Multiplier.RxnLists) – RxnList for Embedded.Edit.

  • material_no (mcnpy.Material) – MaterialNo for Embedded.Edit.

  • mult_type (mcnpy.MTypeOptions) – MultType for Embedded.Edit.

  • errors (mcnpy.YesNo) – Errors for Embedded.Edit.

  • comment (str) – Comment for Embedded.Edit.

  • particles (iterable of mcnpy.Particle) – Particles for Embedded.Edit.

class DoseBinMultipliers(*args, **kwargs)

Bases: EmbeddedEditDoseBinMultipliers, GeometrySetting

A representation of the model object Embedded.Edit.DoseBinMultipliers.

Parameters
  • edit (mcnpy.Embedded.Edit) – Edit for Embedded.Edit.DoseBinMultipliers.

  • multipliers (iterable of float) – Multipliers for Embedded.Edit.DoseBinMultipliers.

class DoseBins(*args, **kwargs)

Bases: EmbeddedEditDoseBins, GeometrySetting

A representation of the model object Embedded.Edit.DoseBins.

Parameters
  • edit (mcnpy.Embedded.Edit) – Edit for Embedded.Edit.DoseBins.

  • bins (iterable of float) – Bins for Embedded.Edit.DoseBins.

class EnergyBinMultipliers(*args, **kwargs)

Bases: EmbeddedEditEnergyBinMultipliers, GeometrySetting

A representation of the model object Embedded.Edit.EnergyBinMultipliers.

Parameters
  • edit (mcnpy.Embedded.Edit) – Edit for Embedded.Edit.EnergyBinMultipliers.

  • multipliers (iterable of float) – Multipliers for Embedded.Edit.EnergyBinMultipliers.

class EnergyBins(*args, **kwargs)

Bases: EmbeddedEditEnergyBins, GeometrySetting

A representation of the model object Embedded.Edit.EnergyBins.

Parameters
  • edit (mcnpy.Embedded.Edit) – Edit for Embedded.Edit.EnergyBins.

  • bins (iterable of float) – Bins for Embedded.Edit.EnergyBins.

  • particles (iterable of mcnpy.Particle) – Particles for Embedded.Edit.EnergyBins.

class TimeBinMultipliers(*args, **kwargs)

Bases: EmbeddedEditTimeBinMultipliers, GeometrySetting

A representation of the model object Embedded.Edit.TimeBinMultipliers.

Parameters
  • edit (mcnpy.Embedded.Edit) – Edit for Embedded.Edit.TimeBinMultipliers.

  • multipliers (iterable of float) – Multipliers for Embedded.Edit.TimeBinMultipliers.

class TimeBins(*args, **kwargs)

Bases: EmbeddedEditTimeBins, GeometrySetting

A representation of the model object Embedded.Edit.TimeBins.

Parameters
  • edit (mcnpy.Embedded.Edit) – Edit for Embedded.Edit.TimeBins.

  • bins (iterable of float) – Bins for Embedded.Edit.TimeBins.

class Geometry(*args, **kwargs)

Bases: EmbeddedGeometry, GeometrySetting

A representation of the model object Embedded.Geometry.

Parameters
  • name (int) – Name for Embedded.Geometry.

  • background (mcnpy.Cell) – Background for Embedded.Geometry.

  • sign (iterable of str) – Sign for Embedded.Geometry.

  • materials (iterable of int) – Materials for Embedded.Geometry.

  • cells (iterable of int) – Cells for Embedded.Geometry.

  • mesh_format (mcnpy.EmbeddedGeometryMeshFormat) – MeshFormat for Embedded.Geometry.

  • mesh (str) – Mesh for Embedded.Geometry.

  • eeout (str) – Eeout for Embedded.Geometry.

  • eeout_res (str) – EeoutRes for Embedded.Geometry.

  • calculate_volumes (mcnpy.YesNo) – CalculateVolumes for Embedded.Geometry.

  • debug (mcnpy.EmbeddedGeometryDebug) – Debug for Embedded.Geometry.

  • filetype (mcnpy.EmbeddedGeometryFiletype) – Filetype for Embedded.Geometry.

  • gmv_file (str) – GmvFile for Embedded.Geometry.

  • length_conversion_factor (float) – LengthConversionFactor for Embedded.Geometry.

  • mcnpum_file (str) – McnpumFile for Embedded.Geometry.

  • overlap (mcnpy.EmbeddedGeometryOverlap) – Overlap for Embedded.Geometry.

  • overlap_cell (iterable of mcnpy.EmbeddedGeometryOverlap) – OverlapCell for Embedded.Geometry.

  • overlap_cells (iterable of mcnpy.Cell) – OverlapCells for Embedded.Geometry.

class mcnpy.Lattices(*args, **kwargs)

Bases: Lattices, GeometrySetting

A representation of the model object Lattices.

class mcnpy.Partisn

Bases: GeometrySetting

class BlockFive(*args, **kwargs)

Bases: PartisnBlockFive, GeometrySetting

A representation of the model object Partisn.BlockFive.

Parameters
  • calculation_type (int) – CalculationType for Partisn.BlockFive.

  • legendre_order (int) – LegendreOrder for Partisn.BlockFive.

  • adjoint (int) – Adjoint for Partisn.BlockFive.

  • trcor (str) – Trcor for Partisn.BlockFive.

  • left_b_c (int) – LeftBC for Partisn.BlockFive.

  • right_b_c (int) – RightBC for Partisn.BlockFive.

  • top_b_c (int) – TopBC for Partisn.BlockFive.

  • bottom_b_c (int) – BottomBC for Partisn.BlockFive.

  • convergence_precision (float) – ConvergencePrecision for Partisn.BlockFive.

  • max_outer_iterations (int) – MaxOuterIterations for Partisn.BlockFive.

  • inhibit_fission_multiplication (int) – InhibitFissionMultiplication for Partisn.BlockFive.

  • solver_acceleration (mcnpy.PartisnSolverAcceleration) – SolverAcceleration for Partisn.BlockFive.

  • diffusion_solver (str) – DiffusionSolver for Partisn.BlockFive.

  • synthetic_acceleration_sn_order (int) – SyntheticAccelerationSnOrder for Partisn.BlockFive.

  • synthetic_acceleration_convergence (float) – SyntheticAccelerationConvergence for Partisn.BlockFive.

  • max_synthetic_acceleration_iterations (float) – MaxSyntheticAccelerationIterations for Partisn.BlockFive.

  • sytnethic_acceleration_scattering_reduction (float) – SytnethicAccelerationScatteringReduction for Partisn.BlockFive.

  • special_criticality_convergence (int) – SpecialCriticalityConvergence for Partisn.BlockFive.

  • norm (float) – Norm for Partisn.BlockFive.

  • print_xsecs (int) – PrintXsecs for Partisn.BlockFive.

  • print_fission_source_rate (int) – PrintFissionSourceRate for Partisn.BlockFive.

  • print_fission_source (int) – PrintFissionSource for Partisn.BlockFive.

  • print_angular_flux (int) – PrintAngularFlux for Partisn.BlockFive.

  • print_coarse_mesh_balance (int) – PrintCoarseMeshBalance for Partisn.BlockFive.

  • prepare_angular_flux (int) – PrepareAngularFlux for Partisn.BlockFive.

  • prepare_flux_moments (int) – PrepareFluxMoments for Partisn.BlockFive.

  • prepare_xmfluxa (int) – PrepareXmfluxa for Partisn.BlockFive.

  • right_flux (int) – RightFlux for Partisn.BlockFive.

  • left_flux (int) – LeftFlux for Partisn.BlockFive.

  • top_flux (int) – TopFlux for Partisn.BlockFive.

  • bottom_flux (int) – BottomFlux for Partisn.BlockFive.

  • back_flux (int) – BackFlux for Partisn.BlockFive.

  • front_flux (int) – FrontFlux for Partisn.BlockFive.

class BlockOne(*args, **kwargs)

Bases: PartisnBlockOne, GeometrySetting

A representation of the model object Partisn.BlockOne.

Parameters
  • group_count (int) – GroupCount for Partisn.BlockOne.

  • sn_order (int) – SnOrder for Partisn.BlockOne.

  • isotope_count (int) – IsotopeCount for Partisn.BlockOne.

  • material_count (int) – MaterialCount for Partisn.BlockOne.

  • quadrature (int) – Quadrature for Partisn.BlockOne.

  • read_composition (int) – ReadComposition for Partisn.BlockOne.

  • suppress_solver (int) – SuppressSolver for Partisn.BlockOne.

  • supress_edit (int) – SupressEdit for Partisn.BlockOne.

  • print_g_e_o_d_s_t (int) – PrintGEODST for Partisn.BlockOne.

  • print_mixing (int) – PrintMixing for Partisn.BlockOne.

  • print_a_s_g_m_a_t (int) – PrintASGMAT for Partisn.BlockOne.

  • print_m_a_c_r_x_s (int) – PrintMACRXS for Partisn.BlockOne.

  • print_s_o_l_i_n_p (int) – PrintSOLINP for Partisn.BlockOne.

  • print_e_d_i_t_i_t (int) – PrintEDITIT for Partisn.BlockOne.

  • print_a_d_j_m_a_c (int) – PrintADJMAC for Partisn.BlockOne.

class BlockSix(*args, **kwargs)

Bases: PartisnBlockSix, GeometrySetting

A representation of the model object Partisn.BlockSix.

Parameters
  • mass_edits (int) – MassEdits for Partisn.BlockSix.

  • edits_by_fine_mesh (int) – EditsByFineMesh for Partisn.BlockSix.

  • edits_by_zone (int) – EditsByZone for Partisn.BlockSix.

  • print_a_flux (int) – PrintAFlux for Partisn.BlockSix.

  • print_b_flux (int) – PrintBFlux for Partisn.BlockSix.

  • ascii_output (int) – AsciiOutput for Partisn.BlockSix.

  • scale_edits_by_volume (int) – ScaleEditsByVolume for Partisn.BlockSix.

  • adjoint (int) – Adjoint for Partisn.BlockSix.

  • flux_override (int) – FluxOverride for Partisn.BlockSix.

class BlockThree(*args, **kwargs)

Bases: PartisnBlockThree, GeometrySetting

A representation of the model object Partisn.BlockThree.

Parameters
  • xsec_form (str) – XsecForm for Partisn.BlockThree.

  • xsec_library (str) – XsecLibrary for Partisn.BlockThree.

  • enable_fission_neutrons (int) – EnableFissionNeutrons for Partisn.BlockThree.

  • last_neutron_group_index (int) – LastNeutronGroupIndex for Partisn.BlockThree.

  • xsec_balance (int) – XsecBalance for Partisn.BlockThree.

  • mendf_fission_fraction (int) – MendfFissionFraction for Partisn.BlockThree.

class mcnpy.Lattice(i=[], j=[], k=[], lattice=None, type='REC', universes=None, transformations=None)

Bases: object

Class for lattices. Defined by max indicies i, j, k, and a 3D array lattice. The array should be defined using numpy.array() where k indicies are your outermost dimension followed by j and i. Elements of lattice can be LatticeElement objects, universe IDs, tuple(universe ID, transformation ID), or 0. When using IDs, universes and transformations must include the key value pair of ID and object. Using Transforms instead of Transformations is also allowed.

Parameters
  • i (iterable of int) – Indices of innermost lattice dimension.

  • j (iterable of int) – Indicies of second lattice dimension.

  • k (iterable of int) – Indicies of outermost lattice dimension.

  • lattice (numpy.array) – Array of universe IDs, mcnpy.Lattice.Element objects, or tuple(universe ID, transformation ID). When providing IDs, universes and transformations must be specified. Use 0 for elements with background fill.

  • type (str, optional) – Lattice type, ‘REC’ or ‘HEX’

  • universes (dict, optional) – Dictionary mapping universe IDs to mcnpy.Univese objects.

  • transformations (dict, optional) – Dictionary mapping Transformation IDs to mcnpy.Transformation objects. Note that that the values can also be mcnpy.Transforms if an appropriate ID is used when defining lattice.

class Coordinate(*args, **kwargs)

Bases: LatticeCoordinate

A representation of the model object Lattice.Coordinate.

Parameters
  • i (int) – I for Lattice.Coordinate.

  • j (int) – J for Lattice.Coordinate.

  • k (int) – K for Lattice.Coordinate.

property coordinate
class Coordinates(*args, **kwargs)

Bases: LatticeCoordinates

A representation of the model object Lattice.Coordinates.

Parameters

coordinates (iterable of mcnpy.Lattice.Coordinate) – Coordinates for Lattice.Coordinates.

property coordinates
class Element(*args, **kwargs)

Bases: LatticeElement

A representation of the model object Lattice.Element.

Parameters

element (list or tuple) – A mcnpy.Universe with optional mcnpy.Transform or mcnpy.Transformation.

property element
class FlatIndex(*args, **kwargs)

Bases: LatticeFlatIndex

A representation of the model object Lattice.FlatIndex.

Parameters

i (int) – I for Lattice.FlatIndex.

class Index(*args, **kwargs)

Bases: LatticeIndex

A representation of the model object Lattice.Index.

Parameters
  • index (Object) – Index for Lattice.Index.

  • universe (mcnpy.Universe) – Universe for Lattice.Index.

property index
class Range(*args, **kwargs)

Bases: LatticeRange

A representation of the model object Lattice.Range.

Parameters
class Int(*args, **kwargs)

Bases: RangeInt

A representation of the model object Lattice.Range.Int.

Parameters
  • sign (str) – Sign for Lattice.Range.Int.

  • value (int) – Value for Lattice.Range.Int.

property value
property rrange
as_ids()
property dims
flatten()

Flattens the provided lattice.

property i
property j
property k
property lattice
make_element(element)
rings()

For HEX lattices. Lattice must have equal X and Y dimensions. Returns a list of rings describing the lattice.

property size
property transformations
property type
property universes
class mcnpy.UniverseList(name, cells=None, sign=None)

Bases: object

Class to assign mcnpy.Universe objects to a list of mcnpy.Cell objects.

Parameters
  • name (int) – The universe ID number.

  • cells (iterable of mcnpy.Cell, optional) – List of cells.

  • sign (str, optional) – ‘-’ turns off distance to universe boundary calculations.

name

The universe ID number.

Type

int

cells

Dictionary storing all cells in the universe by their IDs.

Type

dict

sign

‘-’ turns off distance to universe boundary calculations.

Type

str

add(cell)

Add a cell to a mcnpy.UniverseList.

Parameters

cell (mcnpy.Cell) – Cell to be added.

add_all(cells)

Add a list of cells to a mcnpy.UniverseList.

Parameters

cells (iterable of mcnpy.Cell) – Cells to be added.

add_only(cell)
apply_to_cell(cell)
remove(cell)

Remove a cell from a mcnpy.UniverseList.

Parameters

cell (mcnpy.Cell) – Cell to be removed.

remove_all(cells)

Remove a list of cells from a mcnpy.UniverseList.

Parameters

cells (iterable of mcnpy.Cell) – Cells to be removed.

class mcnpy.Universe(*args, **kwargs)

Bases: Universe

A representation of the model object Universe.

Parameters
  • sign (str) – Sign for Universe.

  • name (int) – Name for Universe.

property name
class mcnpy.Universes(*args, **kwargs)

Bases: Universes

A representation of the model object Universes.