本文整理汇总了Python中Interpreter.Interpreter.lumped_mass_matrix方法的典型用法代码示例。如果您正苦于以下问题:Python Interpreter.lumped_mass_matrix方法的具体用法?Python Interpreter.lumped_mass_matrix怎么用?Python Interpreter.lumped_mass_matrix使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Interpreter.Interpreter
的用法示例。
在下文中一共展示了Interpreter.lumped_mass_matrix方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: range
# 需要导入模块: from Interpreter import Interpreter [as 别名]
# 或者: from Interpreter.Interpreter import lumped_mass_matrix [as 别名]
simu.domain.read_bc_file(simu.bc_filename)
reg_filename = simu.bc_filename.split('.bc')[0]
simu.domain.read_regions_file(reg_filename)
node_coords = simu.domain.nodes.coords
dt = 0.1
n_timesteps = 50
times = range(2, n_timesteps)
dofs_past = []
dofs_present = []
dofs_future = []
inter = Interpreter(vectorial =True)
mass = inter.lumped_mass_matrix(simu)
mass = mass[:,0]
print sum(mass)
for node in range(node_coords.shape[0]):
dofs_past.append(DOF(node, simu, comp = 0, t = 0 * dt))
dofs_past.append(DOF(node, simu, comp = 1, t = 0 * dt))
dofs_present.append(DOF(node, simu, comp = 0, t = 1 * dt))
dofs_present.append(DOF(node, simu, comp = 1, t = 1 * dt))
dofs_future.append(DOF(node, simu, comp = 0, t = 2 * dt))
dofs_future.append(DOF(node, simu, comp = 1, t = 2 * dt))
snapshot = [dofs_past, dofs_present, dofs_future]
from numpy import zeros, append, array
solver = Solver()
quads = solver.substract_1(simu.domain.elements.quads.el_set)