Utilities

Plotting

eldraw2(ex, ey, [plotpar=[1,1,0], elnum=zeros(0)])

Draws the 2D mesh defined by ex, ey.

eldisp2(ex, ey, ed, [plotpar=[1,1,0], sfac=1.0])

Draws the displaced 2D mesh defined by ex, ey and the displacements given in ed.

Solving system of equations

solveq(K, f, bc[, symmetric=false]) → a, fb

Solves the equation system Ka = f taking into account the Dirichlet boundary conditions in the matrix bc. Returns the solution vector a and reaction forces fb If symmetric is set to true, the matrix will be factorized with Cholesky factorization.

Coordinate extraction

extract(edof, a)

Extracts the element displacements from the global solution vector a given an edof matrix. This assumes all elements to have the same number of dofs.

coordxtr(Edof, Coord, Dof, nen) → Ex, Ey, Ez

Extracts the coordinates of the nodes of the elements.

This function can be slow for large number of elements.

topologyxtr(Edof, Coord, Dof, nen) → topology

Extracts the connectivity matrix.

This function can be slow for large number of elements.

Static condensation

statcon(K, f, cd) → K_cond, f_cond

Condenses out the dofs given in cd from K and f.

Assembler

assemble(edof, a, Ke)

Assembles the element matrix Ke into a.