plasma.py 文件源码

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

项目:Codes 作者: SP2RC-Coding-Club 项目源码 文件源码
def magnetic_field(self, magnetic_field: u.Tesla):
        """
        Sets the simulation's magnetic field profile to the specified array.
        Other arrays which depend on the magnetic field, such as the magnetic
        pressure, are then redefined automatically.

        Parameters
        ----------

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

        """

        assert magnetic_field.shape == (3, *self.domain_shape), """
            Specified density array shape {} does not match simulation grid {}.
            """.format(magnetic_field.shape, (3, *self.domain_shape))
        self._magnetic_field = magnetic_field
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号