本文整理汇总了Python中Solver.Solver.build_solution_2方法的典型用法代码示例。如果您正苦于以下问题:Python Solver.build_solution_2方法的具体用法?Python Solver.build_solution_2怎么用?Python Solver.build_solution_2使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Solver.Solver
的用法示例。
在下文中一共展示了Solver.build_solution_2方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: append
# 需要导入模块: from Solver import Solver [as 别名]
# 或者: from Solver.Solver import build_solution_2 [as 别名]
E_past = snapshot[0][dof]
E_present = snapshot[1][dof]
E_future = snapshot[2][dof]
if E_future.check_if_in_boundary(simu, t = n*dt) == False:
Fi = E_present.find_surrounding_elements(snapshot[1], simu)
F = -Fi + 1.0/(dt**2)*mass[dof]*(2*E_present.value - E_past.value)
snapshot[2][dof].value = dt**2/mass[dof] * F
snapshot[0][dof] = E_present
snapshot[1][dof] = E_future
field = append(field, snapshot[2][dof].value)
#print 'snapshot[2]['+str(dof)+'].value',snapshot[2][dof].value
field_past = append(field, snapshot[0][dof].value)
field_present = append(field, snapshot[2][dof].value)
field = solver.build_solution_2(field)
field3[:,0:2] = field
field = field3
write_vtk(filename+'_' +str(n)+'.vtk', 'MyTitle', 'UNSTRUCTURED_GRID' ,simu.domain.nodes.coords,\
quads, ['VECTORS', ['sol'], [field]])
# print n, n*dt
# #print snapshot[2][100].check_if_in_boundary(simu)
# field3[:,0:2] = fields[i]
#
#for i in range(len(fields)):
# field3 = zeros((simu.domain.nodes.n,3))
# field3[:,0:2] = fields[i]
# fields[i] = field3
#write_vtk(filename+'_' +str(i)+'.vtk', 'MyTitle', 'UNSTRUCTURED_GRID' ,simu.domain.nodes.coords,\
# quads, ['VECTORS', ['sol'], [fields[i]]])