当前位置: 首页>>代码示例>>Python>>正文


Python LinSystem.project_global方法代码示例

本文整理汇总了Python中hermes2d.LinSystem.project_global方法的典型用法代码示例。如果您正苦于以下问题:Python LinSystem.project_global方法的具体用法?Python LinSystem.project_global怎么用?Python LinSystem.project_global使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在hermes2d.LinSystem的用法示例。


在下文中一共展示了LinSystem.project_global方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: while

# 需要导入模块: from hermes2d import LinSystem [as 别名]
# 或者: from hermes2d.LinSystem import project_global [as 别名]
while (not done):
    print("\n---- Adaptivity step %d ---------------------------------------------\n" % (it+1))
    it += 1

    # Assemble and solve the fine mesh problem
    rs = RefSystem(ls)
    rs.assemble()
    rs.solve_system(sln_fine)
    
    # Either solve on coarse mesh or project the fine mesh solution 
    # on the coarse mesh.   
    if SOLVE_ON_COARSE_MESH:
        ls.assemble()
        ls.solve_system(sln_coarse)
    else:
        ls.project_global(sln_fine, sln_coarse)
        
    # View the solution and mesh
    sview.show(sln_coarse);
    mesh.plot(space=space)

    # Calculate error estimate wrt. fine mesh solution
    hp = H1Adapt(ls)
    hp.set_solutions([sln_coarse], [sln_fine])
    err_est = hp.calc_error() * 100
    print("Error estimate: %d" % err_est)

    # If err_est too large, adapt the mesh
    if (err_est < ERR_STOP):
        done = True
    else:
开发者ID:B-Rich,项目名称:hermes-legacy,代码行数:33,代码来源:12.py

示例2: print

# 需要导入模块: from hermes2d import LinSystem [as 别名]
# 或者: from hermes2d.LinSystem import project_global [as 别名]
    print ("\n---- Adaptivity step %d ---------------------------------------------\n" % it)
    it += 1
    
    # Assemble and Solve the fine mesh problem
    rs = RefSystem(ls)
    rs.assemble()
    rs.solve_system(u_sln_fine, v_sln_fine, lib="scipy")

    # Either solve on coarse mesh or project the fine mesh solution 
    # on the coarse mesh.
    if SOLVE_ON_COARSE_MESH:
        ls.assemble()
        ls.solve_system(u_sln_coarse, v_sln_coarse, lib="scipy")
    else:
        ls.project_global()

    # View the solution and meshes
    uview.show(u_sln_coarse)
    vview.show(v_sln_coarse)
    umesh.plot(space=uspace)
    vmesh.plot(space=vspace)

    # Calculate element errors and total error estimate
    hp = H1Adapt(ls)
    hp.set_solutions([u_sln_coarse, v_sln_coarse], [u_sln_fine, v_sln_fine]);
    set_hp_forms(hp)
    err_est = hp.calc_error() * 100

    print("Error estimate: %s" % err_est)
开发者ID:B-Rich,项目名称:hermes-legacy,代码行数:31,代码来源:11.py


注:本文中的hermes2d.LinSystem.project_global方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。