mcdc.Universe#

class mcdc.Universe(name: str = '', cells: list[Cell] = [])#

Reusable collections of cells in the simulation geometry.

Parameters:
  • name (str, optional) – User-facing universe name.

  • cells (list of Cell, optional) – Cells belonging to the universe. Cells are tested in list order by the geometry search.

Examples

Group two cells into a reusable universe:

>>> import numpy as np
>>> import mcdc
>>> left = mcdc.Surface.PlaneX(x=-1.0)
>>> middle = mcdc.Surface.PlaneX(x=0.0)
>>> right = mcdc.Surface.PlaneX(x=1.0)
>>> material = mcdc.MaterialMG(capture=np.array([1.0]))
>>> cells = [
...     mcdc.Cell(region=+left & -middle, fill=material),
...     mcdc.Cell(region=+middle & -right, fill=material),
... ]
>>> universe = mcdc.Universe(name="Two regions", cells=cells)

Create a universe for a spherical inclusion and its surrounding material:

>>> sphere = mcdc.Surface.Sphere(radius=0.5)
>>> fuel = mcdc.MaterialMG(fission=np.array([0.2]), nu_p=np.array([2.5]))
>>> water = mcdc.MaterialMG(capture=np.array([0.01]))
>>> pin = mcdc.Universe(
...     name="Pin",
...     cells=[
...         mcdc.Cell(region=-sphere, fill=fuel),
...         mcdc.Cell(region=+sphere, fill=water),
...     ],
... )

Use a universe as a cell fill:

>>> placed_pin = mcdc.Cell(fill=pin, translation=[1.0, 0.0, 0.0])