本文整理匯總了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