def density(self, density: u.kg/u.m**3):
"""Sets the simulation's density profile to the specified array.
Other arrays which depend on the density values, such as the kinetic
pressure, are then redefined automatically.
Parameters
----------
density : ndarray
Array of density values. Shape and size must be equal to those of
the simulation grid.
Must have units of density.
"""
assert density.shape == self.domain_shape, """
Specified density array shape {} does not match simulation grid {}.
""".format(density.shape, self.domain_shape)
self._density = density
# Momentum
评论列表
文章目录