本文整理汇总了Python中Solver.Solver.build_solution方法的典型用法代码示例。如果您正苦于以下问题:Python Solver.build_solution方法的具体用法?Python Solver.build_solution怎么用?Python Solver.build_solution使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Solver.Solver
的用法示例。
在下文中一共展示了Solver.build_solution方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Interpreter
# 需要导入模块: from Solver import Solver [as 别名]
# 或者: from Solver.Solver import build_solution [as 别名]
simu.domain.read_regions_file(reg_filename)
inter = Interpreter()
eq = inter.build_static_EM_eq(simu)
g = eq['sol_vec']
my_solver = Solver()
fields = my_solver.solve_stationary(simu, eq)
quads = my_solver.substract_1(simu.domain.elements.quads.el_set)
quads = quads[:,1:]
field3 = zeros((simu.domain.nodes.n,3))
field3[:,0:2] = fields
fields = field3
dir_sol = zeros(g.shape[0])
remove = eq['dir_positions']
g = my_solver.build_solution(dir_sol, g, remove, True)
print g
field2 = zeros((simu.domain.nodes.n,3))
field2[:,0:2] = g
g_sol = field2
write_vtk(filename +'.vtk', 'MyTitle', 'UNSTRUCTURED_GRID' ,simu.domain.nodes.coords,\
quads, ['VECTORS', ['sol'], [fields]])
write_vtk(filename+'_dirichlet' +'.vtk', 'MyTitle', 'UNSTRUCTURED_GRID' ,simu.domain.nodes.coords,\
quads, ['VECTORS', ['sol'], [g_sol]])