Ejemplo n.º 1
0
 def test_material_initialization(self):
     """Make sure all materials can be instantiated without error."""
     for matClass in materials.iterAllMaterialClassesInNamespace(materials):
         matClass()
Ejemplo n.º 2
0
More info about the materials here: :py:mod:`armi.materials`.

"""
import numpy as np
import matplotlib.pyplot as plt

from armi import configure, materials
from armi.nucDirectory import nuclideBases

MAX_Z = 96  # stop at Curium

configure(permissive=True)

materialNames = []
mats = list(materials.iterAllMaterialClassesInNamespace(materials))
numMats = len(mats)

zVals = np.zeros((numMats, MAX_Z))

for mi, matCls in enumerate(mats):
    m = matCls()
    materialNames.append(m.name)
    for nucName, frac in m.p.massFrac.items():
        nb = nuclideBases.byName[nucName]
        idx = mi, nb.z - 1
        zVals[idx] += frac

fig, ax = plt.subplots(figsize=(16, 12))
im = ax.imshow(zVals, cmap="YlGn")