📅  最后修改于: 2022-03-11 15:04:41.694000             🧑  作者: Mango
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)