Exemplo n.º 1
0
SOLS = np.zeros([nn])
SOLU = np.zeros([nn, 2])
SOLC = np.zeros([nn, 3])
coords[:, 0] = nodes[:, 1]
coords[:, 1] = nodes[:, 2]
"""
Computes the solution
"""
height = np.amax(coords[:, 1])
for i in range(0, nn):
    x = coords[i, 0]
    y = coords[i, 1]
    Y = -x
    X = height - y
    sigma = ela.boussipol(X, Y, P)
    sx, sy, txy = ela.boussicar(X, Y, P)
    ur, ut = ela.boussidispol(X, Y, P, E, nu, h)
    SOLS[i] = sigma
    SOLU[i, 0] = ur
    SOLU[i, 1] = ut
    #
    SOLC[i, 0] = sx
    SOLC[i, 1] = sy
    SOLC[i, 2] = txy
"""
Plot the solution
"""
plo.plot_SFIELD(SOLS, nodes, elements, 1, plt_type="contourf", levels=100)
#plo.plot_disp(SOLU, nodes   , elements , 2 , plt_type="contourf" ,   levels = 12 )
plo.plot_TFIELD(SOLC, nodes, elements, 3, plt_type="contourf", levels=24)
#plo.viewmesh(nodes , elements , True)
Exemplo n.º 2
0
var = geo.WedgeDifrac(L1, theta, c)
nodes, elements, nn = geo.create_model(var, False)
plo.viewmesh(nodes, elements, True)
"""
Define solution arrays
"""
coords = np.zeros([nn, 2])
SOL = np.zeros([nn, ninc])
coords[:, 0] = nodes[:, 1]
coords[:, 1] = nodes[:, 2]
"""
Computes the solution
"""
for i in range(nn):
    x = coords[i, 0]
    y = coords[i, 1]
    u, tt = ela.IncomingWaveReflec(x, y, L1, theta)
    for j in range(ninc):
        SOL[i, j] = u[j]
#
# Plot the solution
#
plo.plot_SFIELD(SOL[:, 1000],
                nodes,
                elements,
                1,
                plt_type="contourf",
                levels=12)

#
Exemplo n.º 3
0
init_printing()

"""
Creando los archivos .msh
"""
gui.ellipse_hlp()
a , b , c , ietype , order, contornos =gui.ellipse()
var = geo.Ellipse(a , b , c , ietype);
geo.create_mesh(order , var )
nodes , elements , nn = geo.writefiles(ietype , var)
"""
Define solution arrays
"""
coords=np.zeros([nn,2])
SOL = np.zeros([nn]) 
coords[:,0]=nodes[:,1]
coords[:,1]=nodes[:,2]
"""
Computes the solution
"""
for i in range(0,nn):
    x = coords[i,0]
    y = coords[i,1] 
    alabeo =ela.ellipse(a, b , x , y)
    SOL[i] = alabeo

"""
(iii) Plot the solution using the appropriate function from plotter.py
"""
plo.plot_SFIELD(SOL, nodes , elements, 1 , plt_type ="contourf", levels = contornos )
#
Exemplo n.º 4
0
P = -50.0
nu = 0.30
E = 1000.0
I = 42.67
L = 24.0
h = 8.0
for i in range(0, nn):
    x = coords[i, 0]
    y = coords[i, 1]
    u, v, exx, eyy, gammaxy = ela.beam(x, y, nu, P, E, I, L, h)
    U[i, 0] = u
    U[i, 1] = v
    STR[i, 0] = exx
    STR[i, 1] = eyy
    STR[i, 2] = gammaxy
"""
Plot the analytic displacement and strain solution
"""
plo.plot_VFIELD(U, nodes, elements, 1)
plo.plot_TFIELD(STR, nodes, elements, 1)
"""
Plot the displacement-based displacement gradient
"""
DuDx, DuDy = plo.plot_GRAD(U[:, 0], nodes, elements, 1)
DvDx, DvDy = plo.plot_GRAD(U[:, 1], nodes, elements, 1)
"""
Computes and plots the displacement-based shear strain.
"""
str = 0.5 * (DuDy + DvDx)
plo.plot_SFIELD(str, nodes, elements, 1)
#