Note
Click here to download the full example code
Navier’s Solution to Simply-Supported Plates¶
import numpy as np
from dewloosh.mpl.triplot import triplot
from polymesh import PolyData
from polymesh.grid import grid
from polymesh.tri.trimesh import triangulate
from polymesh.topo.tr import Q4_to_T3
import matplotlib.pyplot as plt
from matplotlib import gridspec
plt.style.use('default')
size = Lx, Ly = (600., 800.)
E = 2890.
nu = 0.2
t = 25.0
Set up a material model
Define some loads
loads = {
'LG1' : {
'LC1' : {
'type' : 'rect',
'points' : [[0, 0], [Lx, Ly]],
'value' : [0, 0, -0.01],
},
'LC2' : {
'type' : 'rect',
'region' : [0.2*Lx, 0.5*Ly, 0.2*Lx, 0.3*Ly],
'value' : [0, 0, -100],
}
},
'LG2' : {
'LC3' : {
'type' : 'point',
'point' : [Lx/3, Ly/2],
'value' : [0, 0, -10],
},
'LC4' : {
'type' : 'point',
'point' : [2*Lx/3, Ly/2],
'value' : [0, 0, 10],
}
},
'dummy1' : 10
}
Solve the problem
shape = nx, ny = (30, 40)
gridparams = {
'size' : size,
'shape' : shape,
'origo' : (0, 0),
'start' : 0,
'eshape' : 'Q4'
}
coords_, topo = grid(**gridparams)
coords = np.zeros((coords_.shape[0], 3))
coords[:, :2] = coords_[:, :]
del coords_
coords, triangles = Q4_to_T3(coords, topo)
triobj = triangulate(points=coords[:, :2], triangles=triangles)[-1]
Mesh = PolyData(coords=coords, topo=triangles)
centers = Mesh.centers()
Problem.postproc(centers[:, :2], squeeze=False, cleanup=False)
fig = plt.figure(figsize=(8, 3)) # in inches
fig.patch.set_facecolor('white')
cmap = 'jet'
gs = gridspec.GridSpec(1, 3)
for i, key in enumerate([UZ, ROTX, ROTY]):
ax = fig.add_subplot(gs[i])
triplot(triobj, ax=ax, fig=fig, title=labels[key],
data=res2d[key, :], cmap=cmap, axis='off')
fig.tight_layout()
fig = plt.figure(figsize=(12, 3)) # in inches
fig.patch.set_facecolor('white')
cmap = 'seismic'
gs = gridspec.GridSpec(1, 5)
for i, key in enumerate([MX, MY, MXY, QX, QY]):
ax = fig.add_subplot(gs[i])
triplot(triobj, ax=ax, fig=fig, title=labels[key],
data=res2d[key, :], cmap=cmap, axis='off')
fig.tight_layout()
Total running time of the script: ( 0 minutes 41.821 seconds)
Estimated memory usage: 2397 MB

