示例#1
0
文件: 07.py 项目: Richardma/hermes2d
xdisp.set_uniform_order(8)
ydisp.set_uniform_order(8)

set_bc(xdisp, ydisp)

ndofs = xdisp.assign_dofs(0)
ndofs += ydisp.assign_dofs(ndofs)

# initialize the discrete problem
wf = WeakForm(2)
set_forms(wf)

solver = DummySolver()
sys = LinSystem(wf, solver)
sys.set_spaces(xdisp, ydisp)
sys.set_pss(pss)

xsln = Solution()
ysln = Solution()
sys.assemble()
sys.solve_system(xsln, ysln)

view = ScalarView("Von Mises stress [Pa]", 50, 50, 1200, 600)
E = float(200e9)
nu = 0.3
stress = VonMisesFilter(xsln, ysln, E / (2*(1 + nu)),
        (E * nu) / ((1 + nu) * (1 - 2*nu)))
view.show(stress)

view.wait()