本文整理汇总了Python中burnman.mineral.Mineral.set_state方法的典型用法代码示例。如果您正苦于以下问题:Python Mineral.set_state方法的具体用法?Python Mineral.set_state怎么用?Python Mineral.set_state使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类burnman.mineral.Mineral
的用法示例。
在下文中一共展示了Mineral.set_state方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set_state
# 需要导入模块: from burnman.mineral import Mineral [as 别名]
# 或者: from burnman.mineral.Mineral import set_state [as 别名]
def set_state(self, pressure, temperature):
for mat in self.base_materials:
mat.method = self.method
mat.set_state(pressure, temperature)
itrange = range(0, len(self.base_materials))
self.params = {}
# some do arithmetic averaging of the end members
for prop in self.base_materials[0].params:
try:
self.params[prop] = sum([ self.base_materials[i].params[prop] * self.molar_fraction[i] for i in itrange ])
except TypeError:
#if there is a type error, it is probably a string. Just go with the value of the first base_material.
self.params[prop] = self.base_materials[0].params[prop]
Mineral.set_state(self, pressure, temperature)