Tally ------------------ .. .. automodule:: mcnpy.tally :members: :undoc-members: :show-inheritance: .. autoclass:: mcnpy.DetTallyABC :members: :show-inheritance: .. autoclass:: mcnpy.FTallyABC :members: :show-inheritance: .. autoclass:: mcnpy.RadTallyABC :members: :show-inheritance: .. autoclass:: mcnpy.TMeshABC :members: :show-inheritance: To support the intricacies of MCNP's tally bin structure, there are a variety of classes to represent the different cell and surface bin constructs. Using these classes is greatly simplified by using operators which take after the ones used in native MCNP syntax. .. note:: These bins are not to be confused with MCNP's energy, time, angle, etc. bin cards. Cell and surface bins appear of the tally card itself. .. csv-table:: Tally Bin Operators :header: "Operation", "Symbol (Python)", "Symbol (MCNP)","Semantics" :widths: 20, 20, 20, 20 :align: center "Union", ``|``, ``( )``, "OR" "Level", ``&``, `space`, Grouping of cells "Levels", ``<<``, ``<``, Within repeated structure levels "Index", "``C1[i1, i2, ... i3]``", ``C1[i1 i2 ... i3]``, Elements of lattice cell To illustrate these operators, refer to the following example where we assume some cells, surfaces, and universes have been created already. .. code-block:: python # Simple tally bin bins = [cell_1, cell_2, cell_3] f4_tally = mcnpy.Tally.CellFlux(particles=[mcnpy.Particle.NEUTRON], bins=bins) # F4:N 1 2 3 .. important:: Using the ``particles`` and ``bins`` keywords are required when the ``name`` (Tally ID) is omitted. Omitting ``name`` invokes automated tally numbering. .. code-block:: python # Tally bin with operators cell_union = cell_1 | cell_2 cell_level = cell_union & cell_3 indexed_cell = cell_4[[1,2,3], [4,5,6]] cell_levels = indexed_cell << cell_level f4_tally = mcnpy.Tally.CellFlux(particles=[mcnpy.Particle.NEUTRON], bins=cell_levels) # F4:N 4[1 2 3, 4 5 6] < ((1 2) 3) .. note:: Surfaces and Universes can also be used where appropriate. .. autoclass:: mcnpy.Tally :members: :show-inheritance: .. .. autoclass:: mcnpy.TallyABC :members: :show-inheritance: .. autoclass:: mcnpy.TallyRef :members: :show-inheritance: .. autoclass:: mcnpy.TallySettingABC :members: :show-inheritance: