def mlab_plot():
    w = np.linspace(0, 1.8, 30)
    x = np.linspace(-50., 20., 30)
    P = CBEMClampedFiberSP()
    spirrid = SPIRRID(q = P,
                      sampling_type = 'LHS',
                      evars = dict(w = w,
                                    x = x),
                      tvars = dict(Ll = 50.,
                                   Lr = 20.,
                                   tau = RV('uniform', 0.05, .15),
                                   l = RV('uniform', 2.0, 15.0),
                                   A_f = Af,
                                   E_f = Ef,
                                   theta = 0.01, #RV('uniform', 0.0, .02),
                                   xi = RV('weibull_min', scale = 0.0179, shape = 5, n_int = 10),
                                   phi = phi,
                                   E_m = Em,
                                   A_m = Am,
                                   Nf = 1.
                                    ),
                    n_int = 20)

    e_arr = make_ogrid([x, w])
    n_e_arr = [ e / np.max(np.fabs(e)) for e in e_arr ]
    mu_q_arr = spirrid.mu_q_arr
    n_mu_q_arr = mu_q_arr / np.max(np.fabs(mu_q_arr))
    m.surf(n_e_arr[0], n_e_arr[1], n_mu_q_arr)
    from numpy import array

# ------------------------------------------- 
    scene = engine.scenes[0]
    scene.scene.background = (1.0, 1.0, 1.0)
    scene.scene.camera.position = [1.5028781189276834, 3.5681173520859848, 1.9543753549631095]
    scene.scene.camera.focal_point = [-0.29999999701976776, 0.5, 0.5]
    scene.scene.camera.view_angle = 30.0
    scene.scene.camera.view_up = [-0.14835983161589669, -0.35107055575000001, 0.92452086252733578]
    scene.scene.camera.clipping_range = [1.9820957553309271, 6.1977861427731007]
    scene.scene.camera.compute_view_plane_normal()
    module_manager = engine.scenes[0].children[0].children[0].children[0].children[0]
    module_manager.scalar_lut_manager.lut_mode = 'Greys'
    m.show()
Beispiel #2
0
                   x=np.linspace(-20.1, 20.5, 100),
                   Lr=np.linspace(0.1, 20.0, 50)),
        tvars=dict(
            tau=RV('uniform', 0.7, 1.0),
            l=RV('uniform', 5.0, 10.0),
            D_f=26e-3,
            E_f=72e3,
            theta=0.0,
            xi=RV('weibull_min', scale=0.017, shape=8, n_int=10),
            phi=1.0,
            Ll=50.0,
            #                              Lr = 1.0
        ),
        n_int=5)

    e_arr = make_ogrid(s.evar_lst)
    n_e_arr = [e / np.max(np.fabs(e)) for e in e_arr]

    max_mu_q = np.max(np.fabs(s.mu_q_arr))
    n_mu_q_arr = s.mu_q_arr / max_mu_q
    n_std_q_arr = np.sqrt(s.var_q_arr) / max_mu_q

    #===========================================================================
    # Prepare plotting
    #===========================================================================
    tdir = tempfile.mkdtemp()
    n_img = n_mu_q_arr.shape[0]
    fnames = [os.path.join(tdir, 'x%02d.jpg' % i) for i in range(n_img)]

    f = m.figure(1, size=(1000, 500), fgcolor=(0, 0, 0), bgcolor=(1., 1., 1.))
                             x = np.linspace(-20.1, 20.5, 100),
                             Lr = np.linspace(0.1, 20.0, 50)
                             ),
                tvars = dict(tau = RV('uniform', 0.7, 1.0),
                             l = RV('uniform', 5.0, 10.0),
                             D_f = 26e-3,
                             E_f = 72e3,
                             theta = 0.0,
                             xi = RV('weibull_min', scale = 0.017, shape = 8, n_int = 10),
                             phi = 1.0,
                             Ll = 50.0,
#                              Lr = 1.0
                             ),
                n_int = 5)

    e_arr = make_ogrid(s.evar_lst)
    n_e_arr = [ e / np.max(np.fabs(e)) for e in e_arr ]

    max_mu_q = np.max(np.fabs(s.mu_q_arr))
    n_mu_q_arr = s.mu_q_arr / max_mu_q
    n_std_q_arr = np.sqrt(s.var_q_arr) / max_mu_q

    #===========================================================================
    # Prepare plotting 
    #===========================================================================
    tdir = tempfile.mkdtemp()
    n_img = n_mu_q_arr.shape[0]
    fnames = [os.path.join(tdir, 'x%02d.jpg' % i) for i in range(n_img) ]

    f = m.figure(1, size = (1000, 500), fgcolor = (0, 0, 0),
                 bgcolor = (1., 1., 1.))