mfu = getfem.MeshFem('load', 'tank_3D.mfu')
m = mfu.linked_mesh()
mfp = getfem.MeshFem('load', 'tank_3D.mfp', m)
U = fromfile('tank_3D.U', 'd')
P = fromfile('tank_3D.P', 'd')

sl = getfem.Slice(
    ('boundary', ('intersection', ('planar', +1, [0, 0, 0], [0, 1, 0]),
                  ('planar', +1, [0, 0, 0], [1, 0, 0]))), m, 3)

print "importing tvtk.."
import getfem_tvtk
print "import done"

fig = getfem_tvtk.Figure(gui='tvtk')

fig.show(sl, data=(mfp, P), vdata=(mfu, U), edges=False)

fig.show(sl, data=(mfp, P), edges=False)

old = fig.scalar_range()

sl = getfem.Slice(
    ('boundary', ('intersection', ('planar', +1, [0, 0, 6], [0, 0, -1]),
                  ('planar', +1, [0, 0, 0], [0, 1, 0]))), m, 3)
fig.show(sl, data=(mfp, P), scalar_bar=True, edges=False)
fig.scalar_range((-40, 40))

#print fig.scalar_range()
Exemple #2
0
dd = mf0.basic_dof_from_cvid()

print 'nbstep:', nbstep
for step in range(0, nbstep):
    print 'step %d' % (step, )
    md.set_variable('VolumicData', [F[step, 0], F[step, 1]])
    md.solve('noisy', 'lsearch', 'simplest', 'alpha min', 0.8, 'max_iter', 100,
             'max_res', 1e-6)
    U = md.variable('u')
    md.elastoplasticity_next_iter(mim, 'u', 'previous_u', 'VM', 'lambda', 'mu',
                                  'von_mises_threshold', 'sigma')

    VM = md.compute_elastoplasticity_Von_Mises_or_Tresca(
        'sigma', mfdu, 'Von Mises')

    #subplot(2,1,1);
    #gf_plot(mfdu,VM,'deformed_mesh','on', 'deformation',U,'deformation_mf',mfu,'refine', 4, 'deformation_scale',1);
    #colorbar;
    #caxis([0 10000]);

    ERR = gf.compute_error_estimate(mfu, U, mim)
    #E=ERR; E(dd)=ERR;
    #subplot(2,1,2);
    #gf_plot(mf0, E, 'mesh','on', 'refine', 1); colorbar;

    if with_graphics:
        fig = getfem_tvtk.Figure()
        fig.show(mfu, deformation=U, deformation_scale=1, data=(mfdu, VM))
        print "Press Q to continue.."
        fig.loop()