📜  yt 派生字段 - C 编程语言代码示例

📅  最后修改于: 2022-03-11 15:04:41.694000             🧑  作者: Mango

代码示例1
import yt
from yt.units import dimensions

def _pressure(field, data):
    return (data.ds.gamma - 1.0) * \
          data["density"] * data["thermal_energy"]

yt.add_field(("gas","pressure"), function=_pressure, units="auto",
             dimensions=dimensions.pressure)