Exemplo n.º 1
0
bc = np.array([], 'i')
bc_val = np.array([], 'i')

bc, bc_val = cfu.applybc(bdofs, bc, bc_val, 2, 30.0)
bc, bc_val = cfu.applybc(bdofs, bc, bc_val, 3, 0.0)

a, r = cfc.solveq(K, f, bc, bc_val)

# ---- Compute element forces -----------------------------------------------

print("Computing element forces...")

ed = cfc.extractEldisp(edof, a)

for i in range(np.shape(ex)[0]):
    es, et, eci = cfc.flw2i8s(
        ex[i, :], ey[i, :], ep, Ddict[elementmarkers[i]], ed[i, :])

    # Do something with es, et, eci here.

# ---- Visualise results ----------------------------------------------------

print("Visualising...")

cfv.drawGeometry(g, title="Geometry")

cfv.figure()

# 8-node quads are drawn as simple quads.

cfv.drawMesh(coords, edof, dofs_per_node, el_type, filled=False)
Exemplo n.º 2
0
a, r = cfc.solveq(K, f, bc, bc_val)

# ---- Compute element forces -----------------------------------------------

print("Computing element forces...")

ed = cfc.extract_eldisp(edof, a)

for i in range(np.shape(ex)[0]):
    if mesh.el_type == 2:
        es, et = cfc.flw2ts(ex[i, :], ey[i, :], D, ed[i, :])
    elif mesh.el_type == 3:
        es, et, eci = cfc.flw2i4s(ex[i, :], ey[i, :], ep, D, ed[i, :])
    elif mesh.el_type == 16:
        es, et, eci = cfc.flw2i8s(ex[i, :], ey[i, :], ep, D, ed[i, :])
    else:
        print("Element type not supported.")

    # Do something with es, et, eci here.

# ---- Visualise mesh -------------------------------------------------------

# Hold left mouse button to pan.
# Hold right mouse button to zoom.

# Draw the geometry. Note that surfaces and volumes are not drawn at all by
# this function.

cfv.draw_geometry(g)