本文整理汇总了Python中sfepy.discrete.Variables.time_update方法的典型用法代码示例。如果您正苦于以下问题:Python Variables.time_update方法的具体用法?Python Variables.time_update怎么用?Python Variables.time_update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sfepy.discrete.Variables
的用法示例。
在下文中一共展示了Variables.time_update方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Equations
# 需要导入模块: from sfepy.discrete import Variables [as 别名]
# 或者: from sfepy.discrete.Variables import time_update [as 别名]
#.........这里部分代码省略.........
new_terms = Terms(terms)
objs.append(Equation('eq_%d' % iv, new_terms))
subequations = Equations(objs)
return subequations
def get_domain(self):
domain = None
for eq in self:
for term in eq.terms:
if term.has_region:
domain = term.region.domain
return domain
def collect_materials(self):
"""
Collect materials present in the terms of all equations.
"""
materials = []
for eq in self:
materials.extend(eq.collect_materials())
# Make the list items unique.
materials = list(set(materials))
return materials
def reset_materials(self):
"""
Clear material data so that next materials.time_update() is
performed even for stationary materials.
"""
self.materials.reset()
def collect_variables(self):
"""
Collect variables present in the terms of all equations.
"""
variables = []
for eq in self:
variables.extend(eq.collect_variables())
# Make the list items unique.
variables = list(set(variables))
return variables
def get_variable(self, name):
var = self.variables.get(name,
msg_if_none='unknown variable! (%s)' % name)
return var
def collect_conn_info(self):
"""
Collect connectivity information as defined by the equations.
"""
self.conn_info = {}
for eq in self:
eq.collect_conn_info(self.conn_info)
return self.conn_info