plasma.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:Codes 作者: SP2RC-Coding-Club 项目源码 文件源码
def momentum(self, momentum: u.kg/(u.m**2 * u.s)):
        """Sets the simulation's momentum profile to the specified array.
        Other arrays which depend on the velocity values, such as the kinetic
        pressure,
        are then redefined automatically.

        Parameters
        ----------

        momentum : ndarray
            Array of momentum vectors. Shape must be (3, x, [y, z]), where x,
            y and z are the dimensions of the simulation grid.
            Note that a full 3D vector is necessary even if the simulation has
            fewer than 3 dimensions.

        """
        assert momentum.shape == (3, *self.domain_shape), """
            Specified density array shape {} does not match simulation grid {}.
            """.format(momentum.shape, (3, *self.domain_shape))
        self._momentum = momentum

    # Internal energy
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号