Note
Go to the end to download the full example code
Make a Theta-R-Z grid.
This builds a 3-D grid in Theta-R-Z geometry by specifying the theta, r, and z dimension bounds explicitly.
Learn more about grids
.
import itertools
import matplotlib.pyplot as plt
import numpy as np
from armi import configure
from armi.reactor import grids
configure(permissive=True)
fig = plt.figure()
theta = np.linspace(0, 2 * np.pi, 10)
rad = np.linspace(0, 10, 10)
z = np.linspace(5, 25, 6)
rz_grid = grids.ThetaRZGrid(bounds=(theta, rad, z))
xyz = []
for i, j, k in itertools.product(
range(len(theta) - 1), range(len(rad) - 1), range(len(z) - 1)
):
xyz.append(rz_grid[i, j, k].getGlobalCoordinates())
ax = fig.add_subplot(1, 1, 1, projection="3d")
x, y, z = zip(*xyz)
ax.scatter(x, y, z)
plt.show()
Total running time of the script: ( 0 minutes 0.109 seconds)